19 declare(strict_types=1);
39 private bool $allowPseudonyms,
40 private bool $allowNotification,
41 private bool $isDraftContext,
49 if ($this->allowPseudonyms) {
51 $alias->setInfo($this->
lng->txt(
'forums_use_alias'));
52 $alias->setMaxLength(255);
56 $alias->setValue($this->
user->getLogin());
64 $subject->setMaxLength(255);
65 $subject->setSize(50);
66 $subject->setRequired(
true);
82 $message->setRTERootBlockElement(
'');
83 $message->setRTESupport($this->
user->getId(),
'frm~',
'frm_post',
'tpl.tinymce_frm_post.js',
false,
'5.6.0');
108 $draftInfoGUI->setValue(
110 $this->
lng->txt(
'autosave_draft_info'),
120 if ($this->properties->isFileUploadAllowed()) {
125 if ($this->isDraftContext && $this->draftId > 0) {
127 if ($threadDraft->getDraftId() > 0) {
130 if ($draftFileData->getFilesOfPost() !== []) {
132 $this->
lng->txt(
'forums_delete_file'),
135 foreach ($draftFileData->getFilesOfPost() as $file) {
138 $this->
addItem($existingFileSelection);
147 if ($this->allowNotification) {
149 $notifyOnAnswer->setInfo($this->
lng->txt(
'forum_notify_me'));
150 $notifyOnAnswer->setValue(
'1');
151 $this->
addItem($notifyOnAnswer);
159 $this->
setTitle($this->
lng->txt(
'forums_new_thread'));
160 if ($this->isDraftContext) {
161 $this->
setTitle($this->
lng->txt(
'edit_thread_draft'));
164 foreach ($this->input_items as $input_item) {
165 switch ($input_item) {
166 case self::ALIAS_INPUT:
170 case self::SUBJECT_INPUT:
174 case self::MESSAGE_INPUT:
178 case self::FILE_UPLOAD_INPUT:
182 case self::ALLOW_NOTIFICATION_INPUT:
186 case self::AUTOSAVE_INFO:
195 $this->input_items[] = $input_item;
203 $this->
ctrl->setParameter($this->delegatingGui,
'draft_id', $this->draftId);
204 if (in_array($this->
ctrl->getCmd(), [
'publishThreadDraft',
'editThreadDraft',
'updateThreadDraft'])) {
207 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'updateThreadDraft'));
211 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'saveThreadAsDraft'));
217 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'addThread'));
227 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'addThread'));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static lookupAutosaveInterval()
static isAutoSavePostDraftAllowed()
ilObjForumGUI: ilPermissionGUI, ilForumExportGUI, ilInfoScreenGUI ilObjForumGUI: ilColumnGUI...
static getInstanceByType(string $type)
static isSavePostDraftAllowed()
This class represents a text area property in a property form.
static newInstanceByDraftId(int $draft_id)