63 $this->
setTitle($this->lng->txt(
'forums_new_thread'));
64 if ($this->isDraftContext) {
65 $this->
setTitle($this->lng->txt(
'edit_thread_draft'));
68 if ($this->allowPseudonyms) {
69 $alias = new \ilTextInputGUI($this->lng->txt(
'forums_your_name'),
'alias');
70 $alias->setInfo($this->lng->txt(
'forums_use_alias'));
71 $alias->setMaxLength(255);
74 $alias = new \ilNonEditableValueGUI($this->lng->txt(
'forums_your_name'),
'alias');
75 $alias->setValue($this->
user->getLogin());
79 $subject = new \ilTextInputGUI($this->lng->txt(
'forums_thread'),
'subject');
80 $subject->setMaxLength(255);
81 $subject->setSize(50);
82 $subject->setRequired(
true);
96 $message->setRTERootBlockElement(
'');
97 $message->setRTESupport($this->
user->getId(),
'frm~',
'frm_post',
'tpl.tinymce_frm_post.js',
false,
'5.6.0');
117 if ($this->properties->isFileUploadAllowed()) {
118 $files = new \ilFileWizardInputGUI($this->lng->txt(
'forums_attachments_add'),
'userfile');
119 $files->setFilenames([0 =>
'']);
122 if ($this->isDraftContext) {
123 if ($this->draftId > 0) {
125 if ((
int) $threadDraft->getDraftId() > 0) {
126 $draftFileData = new \ilFileDataForumDrafts(0, $threadDraft->getDraftId());
127 if (count($draftFileData->getFilesOfPost()) > 0) {
128 $existingFileSelection = new \ilCheckboxGroupInputGUI(
129 $this->lng->txt(
'forums_delete_file'),
132 foreach ($draftFileData->getFilesOfPost() as $file) {
133 $currentAttachment = new \ilCheckboxInputGUI($file[
'name'],
'del_file');
134 $currentAttachment->setValue($file[
'md5']);
135 $existingFileSelection->addOption($currentAttachment);
137 $this->
addItem($existingFileSelection);
144 if ($this->allowNotification) {
145 $notifyOnAnswer =
new ilCheckboxInputGUI($this->lng->txt(
'forum_direct_notification'),
'notify');
146 $notifyOnAnswer->
setInfo($this->lng->txt(
'forum_notify_me'));
147 $notifyOnAnswer->setValue(1);
148 $this->
addItem($notifyOnAnswer);
151 if ($this->
user->isAnonymous() && !$this->
user->isCaptchaVerified() && \ilCaptchaUtil::isActiveForForum()) {
152 $captcha = new \ilCaptchaInputGUI($this->lng->txt(
'cont_captcha_code'),
'captcha_code');
153 $captcha->setRequired(
true);
158 $this->ctrl->setParameter($this->delegatingGui,
'draft_id', $this->draftId);
159 if (in_array($this->ctrl->getCmd(), [
'publishThreadDraft',
'editThreadDraft',
'updateThreadDraft'])) {
161 $this->
addCommandButton(
'updateThreadDraft', $this->lng->txt(
'save_message'));
162 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'updateThreadDraft'));
165 $this->
addCommandButton(
'saveThreadAsDraft', $this->lng->txt(
'save_message'));
166 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'saveThreadAsDraft'));
172 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'addThread'));
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static newInstanceByDraftId($draft_id)
static isSavePostDraftAllowed()
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static _getInstanceByType(string $type)
Factory method for creating purifier instances.