19 declare(strict_types=1);
42 $this->addSubTabs($tabs_gui);
48 'adve_general_settings',
49 $this->
ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class],
'settings'),
50 [
'settings',
'saveSettings'],
55 'adve_assessment_settings',
56 $this->
ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class],
'assessment'),
57 [
'assessment',
'saveAssessmentSettings'],
62 'adve_frm_post_settings',
63 $this->
ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class],
'frmPost'),
64 [
'frmPost',
'saveFrmPostSettings'],
74 $tpl->setContent($form->getHTML());
80 $form->setFormAction($this->
ctrl->getFormAction($this));
81 $form->setTitle($this->
lng->txt(
"adve_activation"));
83 if ($this->
settings->getRichTextEditor() ===
"tinymce") {
84 $cb->setChecked(
true);
87 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
88 $form->addCommandButton(
"saveSettings", $this->
lng->txt(
"save"));
96 if (!$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
97 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_read'),
true);
104 if ($form->getInput(
'use_tiny')) {
105 $this->
settings->setRichTextEditor(
'tinymce');
107 $this->
settings->setRichTextEditor(
'');
109 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
111 $this->
ctrl->redirect($this,
'settings');
118 "saveAssessmentSettings",
119 "advanced_editing_assessment_settings" 122 $this->tpl->setContent($form->getHTML());
129 "saveAssessmentSettings",
130 "advanced_editing_assessment_settings" 132 if (!$this->
saveTags(
"assessment",
"assessment", $form)) {
133 $form->setValuesByPost();
134 $this->tpl->setContent($form->getHTML());
142 "saveFrmPostSettings",
143 "advanced_editing_frm_post_settings" 146 $this->tpl->setContent($form->getHTML());
153 "saveFrmPostSettings",
154 "advanced_editing_frm_post_settings" 156 if (!$this->
saveTags(
"frm_post",
"frmPost", $form)) {
157 $form->setValuesByPost();
158 $this->tpl->setContent($form->getHTML());
168 $form->setFormAction($this->
ctrl->getFormAction($this, $a_cmd));
169 $form->setTitle($this->
lng->txt($a_title));
173 $tags->enableSelectAll(
true);
174 $tags->enableSelectedFirst(
true);
176 array_combine($this->
settings->getAllAvailableHTMLTags(), $this->
settings->getAllAvailableHTMLTags())
179 $form->addItem($tags);
181 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
182 $form->addCommandButton($a_cmd, $this->
lng->txt(
"save"));
193 if (!$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
194 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_read'),
true);
199 $html_tags = $form->
getInput(
"html_tags");
201 if (array_key_exists(0, $html_tags) && (
string) $html_tags[0] ===
'') {
202 unset($html_tags[0]);
204 $this->
settings->setUsedHTMLTags((array) $html_tags, $a_id);
205 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
210 $this->tpl->setOnScreenMessage(
'info', $e->getMessage(),
true);
212 $this->
ctrl->redirect($this, $a_cmd);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addSubtabs(ilTabsGUI $tabs_gui)
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
static _getUsedHTMLTags(string $module='')
initTagsForm(string $a_id, string $a_cmd, string $a_title)
__construct(private readonly int $ref_id, private readonly ilGlobalTemplateInterface $tpl, private readonly ilCtrlInterface $ctrl, private readonly Language $lng, private readonly ilAccessHandler $access, ilObjUser $current_user, ilTabsGUI $tabs_gui)
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
Class ilObjAdvancedEditingGUI.