ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRTESettingsGUI Class Reference

Class ilObjAdvancedEditingGUI. More...

+ Collaboration diagram for ilRTESettingsGUI:

Public Member Functions

 __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)
 
 settings ()
 
 getTinyForm ()
 
 saveSettings ()
 
 assessment ()
 
 saveAssessmentSettings ()
 
 frmPost ()
 
 saveFrmPostSettings ()
 

Protected Member Functions

 initTagsForm (string $a_id, string $a_cmd, string $a_title)
 
 saveTags (string $a_id, string $a_cmd, ilPropertyFormGUI $form)
 

Private Member Functions

 addSubtabs (ilTabsGUI $tabs_gui)
 

Private Attributes

ilRTESettings $settings
 

Detailed Description

Class ilObjAdvancedEditingGUI.

Author
Helmut Schottmüller hscho.nosp@m.ttm@.nosp@m.gmx.d.nosp@m.e

Definition at line 28 of file class.ilRTESettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRTESettingsGUI::__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 
)

Definition at line 32 of file class.ilRTESettingsGUI.php.

40 {
41 $this->settings = new ilRTESettings($this->lng, $current_user);
42 $this->addSubTabs($tabs_gui);
43 }

References ILIAS\Repository\lng(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubtabs()

ilRTESettingsGUI::addSubtabs ( ilTabsGUI  $tabs_gui)
private

Definition at line 45 of file class.ilRTESettingsGUI.php.

45 : void
46 {
47 $tabs_gui->addSubTabTarget(
48 'adve_general_settings',
49 $this->ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class], 'settings'),
50 ['settings', 'saveSettings'],
51 '',
52 ''
53 );
54 $tabs_gui->addSubTabTarget(
55 'adve_assessment_settings',
56 $this->ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class], 'assessment'),
57 ['assessment', 'saveAssessmentSettings'],
58 '',
59 ''
60 );
61 $tabs_gui->addSubTabTarget(
62 'adve_frm_post_settings',
63 $this->ctrl->getLinkTargetByClass([ilObjAdvancedEditingGUI::class, self::class], 'frmPost'),
64 ['frmPost', 'saveFrmPostSettings'],
65 '',
66 ''
67 );
68 }
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)

References ilTabsGUI\addSubTabTarget(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ assessment()

ilRTESettingsGUI::assessment ( )

Definition at line 114 of file class.ilRTESettingsGUI.php.

114 : void
115 {
116 $form = $this->initTagsForm(
117 "assessment",
118 "saveAssessmentSettings",
119 "advanced_editing_assessment_settings"
120 );
121
122 $this->tpl->setContent($form->getHTML());
123 }
initTagsForm(string $a_id, string $a_cmd, string $a_title)

References initTagsForm().

+ Here is the call graph for this function:

◆ frmPost()

ilRTESettingsGUI::frmPost ( )

Definition at line 138 of file class.ilRTESettingsGUI.php.

138 : void
139 {
140 $form = $this->initTagsForm(
141 "frm_post",
142 "saveFrmPostSettings",
143 "advanced_editing_frm_post_settings"
144 );
145
146 $this->tpl->setContent($form->getHTML());
147 }

References initTagsForm().

+ Here is the call graph for this function:

◆ getTinyForm()

ilRTESettingsGUI::getTinyForm ( )

Definition at line 77 of file class.ilRTESettingsGUI.php.

78 {
79 $form = new ilPropertyFormGUI();
80 $form->setFormAction($this->ctrl->getFormAction($this));
81 $form->setTitle($this->lng->txt("adve_activation"));
82 $cb = new ilCheckboxInputGUI($this->lng->txt("adve_use_tiny_mce"), "use_tiny");
83 if ($this->settings->getRichTextEditor() === "tinymce") {
84 $cb->setChecked(true);
85 }
86 $form->addItem($cb);
87 if ($this->access->checkAccess('write', '', $this->ref_id)) {
88 $form->addCommandButton("saveSettings", $this->lng->txt("save"));
89 }
90
91 return $form;
92 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and settings().

Referenced by saveSettings(), and settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTagsForm()

ilRTESettingsGUI::initTagsForm ( string  $a_id,
string  $a_cmd,
string  $a_title 
)
protected

Definition at line 162 of file class.ilRTESettingsGUI.php.

167 $form = new ilPropertyFormGUI();
168 $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
169 $form->setTitle($this->lng->txt($a_title));
170
171 $tags = new ilMultiSelectInputGUI($this->lng->txt("advanced_editing_allow_html_tags"), "html_tags");
172 $tags->setHeight(400);
173 $tags->enableSelectAll(true);
174 $tags->enableSelectedFirst(true);
175 $tags->setOptions(
176 array_combine($this->settings->getAllAvailableHTMLTags(), $this->settings->getAllAvailableHTMLTags())
177 );
178 $tags->setValue(ilRTESettings::_getUsedHTMLTags($a_id));
179 $form->addItem($tags);
180
181 if ($this->access->checkAccess('write', '', $this->ref_id)) {
182 $form->addCommandButton($a_cmd, $this->lng->txt("save"));
183 }
184
185 return $form;
186 }
This class represents a multi selection list property in a property form.
static _getUsedHTMLTags(string $module='')

Referenced by assessment(), frmPost(), saveAssessmentSettings(), and saveFrmPostSettings().

+ Here is the caller graph for this function:

◆ saveAssessmentSettings()

ilRTESettingsGUI::saveAssessmentSettings ( )

Definition at line 125 of file class.ilRTESettingsGUI.php.

125 : void
126 {
127 $form = $this->initTagsForm(
128 "assessment",
129 "saveAssessmentSettings",
130 "advanced_editing_assessment_settings"
131 );
132 if (!$this->saveTags("assessment", "assessment", $form)) {
133 $form->setValuesByPost();
134 $this->tpl->setContent($form->getHTML());
135 }
136 }
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)

References initTagsForm(), and saveTags().

+ Here is the call graph for this function:

◆ saveFrmPostSettings()

ilRTESettingsGUI::saveFrmPostSettings ( )

Definition at line 149 of file class.ilRTESettingsGUI.php.

149 : void
150 {
151 $form = $this->initTagsForm(
152 "frm_post",
153 "saveFrmPostSettings",
154 "advanced_editing_frm_post_settings"
155 );
156 if (!$this->saveTags("frm_post", "frmPost", $form)) {
157 $form->setValuesByPost();
158 $this->tpl->setContent($form->getHTML());
159 }
160 }

References initTagsForm(), and saveTags().

+ Here is the call graph for this function:

◆ saveSettings()

ilRTESettingsGUI::saveSettings ( )

Definition at line 94 of file class.ilRTESettingsGUI.php.

94 : void
95 {
96 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
97 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_read'), true);
98 return;
99 }
100
101 $form = $this->getTinyForm();
102 $form->checkInput();
103
104 if ($form->getInput('use_tiny')) {
105 $this->settings->setRichTextEditor('tinymce');
106 } else {
107 $this->settings->setRichTextEditor('');
108 }
109 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
110
111 $this->ctrl->redirect($this, 'settings');
112 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), getTinyForm(), ILIAS\Repository\lng(), and settings().

+ Here is the call graph for this function:

◆ saveTags()

ilRTESettingsGUI::saveTags ( string  $a_id,
string  $a_cmd,
ilPropertyFormGUI  $form 
)
protected

Definition at line 188 of file class.ilRTESettingsGUI.php.

192 : bool {
193 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
194 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_read'), true);
195 return false;
196 }
197 try {
198 if ($form->checkInput()) {
199 $html_tags = $form->getInput("html_tags");
200 // get rid of select all
201 if (array_key_exists(0, $html_tags) && (string) $html_tags[0] === '') {
202 unset($html_tags[0]);
203 }
204 $this->settings->setUsedHTMLTags((array) $html_tags, $a_id);
205 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
206 } else {
207 return false;
208 }
210 $this->tpl->setOnScreenMessage('info', $e->getMessage(), true);
211 }
212 $this->ctrl->redirect($this, $a_cmd);
213 return true;
214 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...

References ILIAS\Repository\lng().

Referenced by saveAssessmentSettings(), and saveFrmPostSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

ilRTESettingsGUI::settings ( )

Definition at line 70 of file class.ilRTESettingsGUI.php.

70 : void
71 {
72 $tpl = $this->tpl;
73 $form = $this->getTinyForm();
74 $tpl->setContent($form->getHTML());
75 }

References getTinyForm().

Referenced by __construct(), getTinyForm(), and saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $settings

ilRTESettings ilRTESettingsGUI::$settings
private

Definition at line 30 of file class.ilRTESettingsGUI.php.


The documentation for this class was generated from the following file: