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);
71 $message->setRows(15);
72 $message->setRequired(
true);
73 $message->setUseRte(
true);
74 $message->usePurifier(
true);
75 $message->setRTERootBlockElement(
'');
76 $message->setRTESupport($this->
user->getId(),
'frm~',
'frm_post',
'tpl.tinymce_frm_post.js',
false,
'5.6.0');
77 $message->disableButtons([
101 $draftInfoGUI->setValue(
103 $this->
lng->txt(
'autosave_draft_info'),
113 if ($this->properties->isFileUploadAllowed()) {
118 if ($this->isDraftContext && $this->draftId > 0) {
120 if ($threadDraft->getDraftId() > 0) {
123 if ($draftFileData->getFilesOfPost() !== []) {
125 $this->
lng->txt(
'forums_delete_file'),
128 foreach ($draftFileData->getFilesOfPost() as $file) {
131 $this->
addItem($existingFileSelection);
140 if ($this->allowNotification) {
142 $notifyOnAnswer->setInfo($this->
lng->txt(
'forum_notify_me'));
143 $notifyOnAnswer->setValue(
'1');
144 $this->
addItem($notifyOnAnswer);
152 $this->
setTitle($this->
lng->txt(
'forums_new_thread'));
153 if ($this->isDraftContext) {
154 $this->
setTitle($this->
lng->txt(
'edit_thread_draft'));
157 foreach ($this->input_items as $input_item) {
158 switch ($input_item) {
159 case self::ALIAS_INPUT:
163 case self::SUBJECT_INPUT:
167 case self::MESSAGE_INPUT:
171 case self::FILE_UPLOAD_INPUT:
175 case self::ALLOW_NOTIFICATION_INPUT:
179 case self::AUTOSAVE_INFO:
188 $this->input_items[] = $input_item;
196 $this->
ctrl->setParameter($this->delegatingGui,
'draft_id', $this->draftId);
197 if (in_array($this->
ctrl->getCmd(), [
'publishThreadDraft',
'editThreadDraft',
'updateThreadDraft'])) {
200 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'updateThreadDraft'));
204 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'saveThreadAsDraft'));
210 $this->
setFormAction($this->
ctrl->getFormAction($this->delegatingGui,
'addThread'));
220 $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 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)