use wcf\data\trophy\category\TrophyCategoryCache;
use wcf\data\trophy\Trophy;
use wcf\data\trophy\TrophyAction;
+use wcf\data\trophy\TrophyEditor;
use wcf\system\condition\ConditionHandler;
use wcf\system\exception\UserInputException;
use wcf\system\language\I18nValue;
parent::readParameters();
$titleI18n = new I18nValue('title');
- $titleI18n->setLanguageItem('wcf.trophy.title', 'wcf.trophy', 'com.woltlab.wcf');
+ $titleI18n->setLanguageItem('wcf.user.trophy.title', 'wcf.user.trophy', 'com.woltlab.wcf');
$this->registerI18nValue($titleI18n);
$descriptionI18n = new I18nValue('description');
- $descriptionI18n->setLanguageItem('wcf.trophy.description', 'wcf.trophy', 'com.woltlab.wcf');
+ $descriptionI18n->setLanguageItem('wcf.user.trophy.description', 'wcf.user.trophy', 'com.woltlab.wcf');
$this->registerI18nValue($descriptionI18n);
if (isset($_POST['tmpHash'])) {
]);
$this->objectAction->executeAction();
+ $this->saveI18n($this->objectAction->getReturnValues()['returnValues'], TrophyEditor::class);
+
// transform conditions array into one-dimensional array
$conditions = [];
foreach ($this->conditions as $groupedObjectTypes) {
use wcf\data\trophy\category\TrophyCategoryCache;
use wcf\data\trophy\Trophy;
use wcf\data\user\trophy\UserTrophyAction;
+use wcf\data\user\trophy\UserTrophyEditor;
use wcf\data\user\UserProfile;
use wcf\system\exception\UserInputException;
use wcf\system\language\I18nHandler;
parent::readParameters();
$descriptionI18n = new I18nValue('description');
- $descriptionI18n->setLanguageItem('wcf.user.trophy.description', 'wcf.trophy', 'com.woltlab.wcf');
+ $descriptionI18n->setLanguageItem('wcf.user.trophy.userTrophy.description', 'wcf.user.trophy', 'com.woltlab.wcf');
$descriptionI18n->setFlags(I18nValue::ALLOW_EMPTY);
$this->registerI18nValue($descriptionI18n);
}
parent::save();
foreach ($this->userIDs as $user) {
- (new UserTrophyAction([], 'create', [
+ $databaseObject = (new UserTrophyAction([], 'create', [
'data' => array_merge($this->additionalFields, [
'trophyID' => $this->trophy->trophyID,
'userID' => $user,
'useCustomDescription' => $this->useCustomDescription
])
]))->executeAction();
+
+ $this->saveI18n($databaseObject, UserTrophyEditor::class);
}
$this->reset();