ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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.

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

40  {
41  $this->settings = new ilRTESettings($this->lng, $current_user);
42  $this->addSubTabs($tabs_gui);
43  }
+ 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.

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

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)
+ Here is the call graph for this function:

◆ assessment()

ilRTESettingsGUI::assessment ( )

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

References initTagsForm().

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)
+ Here is the call graph for this function:

◆ frmPost()

ilRTESettingsGUI::frmPost ( )

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

References initTagsForm().

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  }
initTagsForm(string $a_id, string $a_cmd, string $a_title)
+ Here is the call graph for this function:

◆ getTinyForm()

ilRTESettingsGUI::getTinyForm ( )

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

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

Referenced by saveSettings(), and settings().

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  }
+ 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.

References ilRTESettings\_getUsedHTMLTags(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilMultiSelectInputGUI\setHeight(), and settings().

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

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  }
static _getUsedHTMLTags(string $module='')
This class represents a multi selection list property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssessmentSettings()

ilRTESettingsGUI::saveAssessmentSettings ( )

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

References initTagsForm(), and saveTags().

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  }
initTagsForm(string $a_id, string $a_cmd, string $a_title)
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ saveFrmPostSettings()

ilRTESettingsGUI::saveFrmPostSettings ( )

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

References initTagsForm(), and saveTags().

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  }
initTagsForm(string $a_id, string $a_cmd, string $a_title)
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ saveSettings()

ilRTESettingsGUI::saveSettings ( )

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

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

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  }
+ 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.

References Vendor\Package\$e, ILIAS\Repository\access(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), ILIAS\Repository\lng(), and settings().

Referenced by saveAssessmentSettings(), and saveFrmPostSettings().

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  }
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-...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

References getTinyForm().

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

70  : void
71  {
72  $tpl = $this->tpl;
73  $form = $this->getTinyForm();
74  $tpl->setContent($form->getHTML());
75  }
+ 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: