*/
public $neededModules = ['MODULE_LIKE'];
- /**
- * @var UploadFormField
- */
- protected $uploadFormField;
-
/**
* @inheritDoc
*/
->label('wcf.acp.reactionType.isDisabled')
]);
- $this->uploadFormField = UploadFormField::create('iconFile')
- ->label('wcf.acp.reactionType.image')
- ->description('wcf.acp.reactionType.image.description')
- ->required()
- ->maximum(1)
- ->imageOnly(true)
- ->allowSvgImage(true);
-
$iconContainer = FormContainer::create('imageSection')
->label('wcf.acp.reactionType.image')
->appendChildren([
- $this->uploadFormField
+ UploadFormField::create('iconFile')
+ ->label('wcf.acp.reactionType.image')
+ ->description('wcf.acp.reactionType.image.description')
+ ->required()
+ ->maximum(1)
+ ->imageOnly(true)
+ ->allowSvgImage(true)
]);
$this->form->appendChildren([
namespace wcf\acp\form;
use wcf\data\reaction\type\ReactionType;
use wcf\system\exception\IllegalLinkException;
-use wcf\system\file\upload\UploadFile;
/**
* Represents the reaction type add form.
}
}
}
-
- /**
- * Sets the form data based on the current form object.
- */
- protected function setFormObjectData() {
- parent::setFormObjectData();
-
- if (empty($_POST)) {
- $this->uploadFormField->value([
- new UploadFile(WCF_DIR . 'images/reaction/' . $this->formObject->iconFile, basename($this->formObject->iconFile), true, true, true)
- ]);
- }
- }
}