44 parent::__construct();
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);
97 $message->setRTERootBlockElement(
'');
98 $message->setRTESupport($this->
user->getId(),
'frm~',
'frm_post',
'tpl.tinymce_frm_post.html',
false,
'3.5.11');
118 if ($this->properties->isFileUploadAllowed()) {
119 $files = new \ilFileWizardInputGUI($this->lng->txt(
'forums_attachments_add'),
'userfile');
120 $files->setFilenames([0 =>
'']);
123 if ($this->isDraftContext) {
124 if ($this->draftId > 0) {
126 if ((
int) $threadDraft->getDraftId() > 0) {
127 $draftFileData = new \ilFileDataForumDrafts(0, $threadDraft->getDraftId());
128 if (count($draftFileData->getFilesOfPost()) > 0) {
129 $existingFileSelection = new \ilCheckboxGroupInputGUI(
130 $this->lng->txt(
'forums_delete_file'),
133 foreach ($draftFileData->getFilesOfPost() as $file) {
134 $currentAttachment = new \ilCheckboxInputGUI($file[
'name'],
'del_file');
135 $currentAttachment->setValue($file[
'md5']);
136 $existingFileSelection->addOption($currentAttachment);
138 $this->
addItem($existingFileSelection);
145 if ($this->allowNotification) {
146 $notifyOnAnswer =
new ilCheckboxInputGUI($this->lng->txt(
'forum_direct_notification'),
'notify');
147 $notifyOnAnswer->
setInfo($this->lng->txt(
'forum_notify_me'));
148 $notifyOnAnswer->setValue(1);
149 $this->
addItem($notifyOnAnswer);
152 if ($this->
user->isAnonymous() && !$this->
user->isCaptchaVerified() && \ilCaptchaUtil::isActiveForForum()) {
153 $captcha = new \ilCaptchaInputGUI($this->lng->txt(
'cont_captcha_code'),
'captcha_code');
154 $captcha->setRequired(
true);
159 $this->ctrl->setParameter($this->delegatingGui,
'draft_id', $this->draftId);
160 if (in_array($this->ctrl->getCmd(), [
'publishThreadDraft',
'editThreadDraft',
'updateThreadDraft'])) {
162 $this->
addCommandButton(
'updateThreadDraft', $this->lng->txt(
'save_message'));
163 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'updateThreadDraft'));
166 $this->
addCommandButton(
'saveThreadAsDraft', $this->lng->txt(
'save_message'));
167 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'saveThreadAsDraft'));
173 $this->
setFormAction($this->ctrl->getFormAction($this->delegatingGui,
'addThread'));
catch(Exception $e) $message
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()
static _getInstanceByType($a_type)
Factory method for creating purifier instances.
This class represents a text area property in a property form.