19 declare(strict_types=1);
36 private readonly
bool $allowPseudonyms,
37 private readonly
bool $allowNotification,
38 private readonly
bool $isDraftContext,
39 private readonly
int $draftId
46 if ($this->allowPseudonyms) {
48 $alias->setInfo($this->
lng->txt(
'forums_use_alias'));
49 $alias->setMaxLength(255);
53 $alias->setValue($this->
user->getLogin());
61 $subject->setMaxLength(255);
62 $subject->setSize(50);
63 $subject->setRequired(
true);
75 $message->setRTERootBlockElement(
'');
76 $message->setRTESupport($this->
user->getId(),
'frm~',
'frm_post',
'tpl.tinymce_frm_post.js',
false,
'5.6.0');
94 $message->setInfo($this->
lng->txt(
'latex_edit_info'));
102 $draftInfoGUI->setValue(
104 $this->
lng->txt(
'autosave_draft_info'),
114 if ($this->properties->isFileUploadAllowed()) {
119 if ($this->isDraftContext && $this->draftId > 0) {
121 if ($threadDraft->getDraftId() > 0) {
124 if ($draftFileData->getFilesOfPost() !== []) {
126 $this->
lng->txt(
'forums_delete_file'),
129 foreach ($draftFileData->getFilesOfPost() as $file) {
132 $this->
addItem($existingFileSelection);
141 if ($this->allowNotification) {
143 $notifyOnAnswer->setInfo($this->
lng->txt(
'forum_notify_me'));
144 $notifyOnAnswer->setValue(
'1');
145 $this->
addItem($notifyOnAnswer);
153 $this->
setTitle($this->
lng->txt(
'forums_new_thread'));
154 if ($this->isDraftContext) {
155 $this->
setTitle($this->
lng->txt(
'edit_thread_draft'));
158 foreach ($this->input_items as $input_item) {
159 switch ($input_item) {
160 case self::ALIAS_INPUT:
164 case self::SUBJECT_INPUT:
168 case self::MESSAGE_INPUT:
172 case self::FILE_UPLOAD_INPUT:
176 case self::ALLOW_NOTIFICATION_INPUT:
180 case self::AUTOSAVE_INFO:
189 $this->input_items[] = $input_item;
197 $this->
ctrl->setParameter($this->delegatingGui,
'draft_id', $this->draftId);
198 if (in_array($this->
ctrl->getCmd(), [
'publishThreadDraft',
'editThreadDraft',
'updateThreadDraft'])) {
201 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'updateThreadDraft'));
205 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'saveThreadAsDraft'));
211 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'addThread'));
221 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'addThread'));
This class represents an option in a checkbox group.
static lookupAutosaveInterval()
static isAutoSavePostDraftAllowed()
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getInstanceByType(string $type)
static isSavePostDraftAllowed()
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static newInstanceByDraftId(int $draft_id)