5include_once
"./Services/Object/classes/class.ilObjectGUI.php";
49 public function __construct($a_data, $a_id, $a_call_by_reference)
53 $this->rbacsystem =
$DIC->rbac()->system();
54 $this->rbacadmin =
$DIC->rbac()->admin();
55 $this->ctrl =
$DIC->ctrl();
56 $this->tabs =
$DIC->tabs();
57 $this->tpl =
$DIC[
"tpl"];
58 $this->lng =
$DIC->language();
59 $this->access =
$DIC->access();
64 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
65 $this->lng->loadLanguageModule(
'adve');
66 $this->lng->loadLanguageModule(
'meta');
68 if (!
$rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
69 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read_adve"), $this->ilias->error_obj->WARNING);
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
79 switch ($next_class) {
81 case 'ilpermissiongui':
82 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
84 $ret =&$this->ctrl->forwardCommand($perm_gui);
88 if ($cmd ==
"" || $cmd ==
"view") {
89 $cmd =
"showGeneralPageEditorSettings";
107 parent::saveObject();
111 $this->ctrl->redirect($this);
126 if (
$ilCtrl->getNextClass() !=
"ilpermissiongui" &&
127 !in_array(
$ilCtrl->getCmd(), array(
"showPageEditorSettings",
128 "showGeneralPageEditorSettings",
"showCharSelectorSettings",
"",
"view"))) {
129 $this->tabs_gui->addSubTabTarget(
130 "adve_general_settings",
131 $this->ctrl->getLinkTarget($this,
"settings"),
132 array(
"settings",
"saveSettings"),
136 $this->tabs_gui->addSubTabTarget(
137 "adve_assessment_settings",
138 $this->ctrl->getLinkTarget($this,
"assessment"),
139 array(
"assessment",
"saveAssessmentSettings"),
143 $this->tabs_gui->addSubTabTarget(
144 "adve_survey_settings",
145 $this->ctrl->getLinkTarget($this,
"survey"),
146 array(
"survey",
"saveSurveySettings"),
150 $this->tabs_gui->addSubTabTarget(
151 "adve_frm_post_settings",
152 $this->ctrl->getLinkTarget($this,
"frmPost"),
153 array(
"frmPost",
"saveFrmPostSettings"),
157 $this->tabs_gui->addSubTabTarget(
158 "adve_excass_settings",
159 $this->ctrl->getLinkTarget($this,
"excass"),
160 array(
"excass",
"saveExcAssSettings"),
175 $ilTabs->addSubTabTarget(
177 $ilCtrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
178 array(
"showGeneralPageEditorSettings",
"",
"view")
181 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
184 foreach ($grps as $g => $types) {
185 $ilCtrl->setParameter($this,
"grp", $g);
186 $ilTabs->addSubTabTarget(
188 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
189 array(
"showPageEditorSettings")
204 if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
205 $this->tabs_gui->addTarget(
206 "adve_page_editor_settings",
207 $this->ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
208 array(
"showPageEditorSettings",
"",
"view")
211 $this->tabs_gui->addTarget(
213 $this->ctrl->getLinkTarget($this,
"settings"),
214 array(
"settings",
"assessment",
"survey",
"frmPost",
"excass"),
219 $this->tabs_gui->addTarget(
220 "adve_char_selector_settings",
221 $this->ctrl->getLinkTarget($this,
"showCharSelectorSettings"),
222 array(
"showCharSelectorSettings",
"",
"view")
226 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
227 $this->tabs_gui->addTarget(
229 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
230 array(
"perm",
"info",
"owner"),
247 $editor = $this->
object->_getRichTextEditor();
249 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
251 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
252 $this->form->setTitle(
$lng->txt(
"adve_activation"));
255 $cb->setChecked(
true);
257 $this->form->addItem($cb);
259 $this->form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
262 $tpl->setContent($this->form->getHTML());
273 $this->
object->setRichTextEditor(
"tinymce");
275 $this->
object->setRichTextEditor(
"");
279 $this->ctrl->redirect($this,
'settings');
290 "saveAssessmentSettings",
291 "advanced_editing_assessment_settings"
294 $this->tpl->setContent(
$form->getHTML());
301 "saveAssessmentSettings",
302 "advanced_editing_assessment_settings"
305 $form->setValuesByPost();
306 $this->tpl->setContent(
$form->getHTML());
318 "saveSurveySettings",
319 "advanced_editing_survey_settings"
322 $this->tpl->setContent(
$form->getHTML());
329 "saveSurveySettings",
330 "advanced_editing_survey_settings"
333 $form->setValuesByPost();
334 $this->tpl->setContent(
$form->getHTML());
346 "saveFrmPostSettings",
347 "advanced_editing_frm_post_settings"
350 $this->tpl->setContent(
$form->getHTML());
357 "saveFrmPostSettings",
358 "advanced_editing_frm_post_settings"
361 $form->setValuesByPost();
362 $this->tpl->setContent(
$form->getHTML());
374 "saveExcAssSettings",
375 "advanced_editing_excass_settings"
378 $this->tpl->setContent(
$form->getHTML());
385 "saveExcAssSettings",
386 "advanced_editing_excass_settings"
389 $form->setValuesByPost();
390 $this->tpl->setContent(
$form->getHTML());
399 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
401 $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
402 $form->setTitle($this->lng->txt($a_title));
404 $alltags = $this->
object->getHTMLTags();
405 $alltags = array_combine($alltags, $alltags);
407 include_once
"Services/Form/classes/class.ilMultiSelectInputGUI.php";
409 $tags->setHeight(400);
410 $tags->enableSelectAll(
true);
411 $tags->enableSelectedFirst(
true);
412 $tags->setOptions($alltags);
416 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
417 $form->addCommandButton($a_cmd, $this->lng->txt(
"save"));
427 if (
$form->checkInput()) {
429 if (is_array(
$_POST[
'html_tags']) &&
$_POST[
'html_tags'][0] ==
"") {
430 unset(
$_POST[
'html_tags'][0]);
433 $this->
object->setUsedHTMLTags((array)
$_POST[
'html_tags'], $a_id);
442 $this->ctrl->redirect($this, $a_cmd);
456 $this->addPageEditorSettingsSubTabs();
458 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
461 $this->cgrp =
$_GET[
"grp"];
462 if ($this->cgrp ==
"") {
463 $this->cgrp = key($grps);
466 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
467 $ilTabs->setSubTabActive(
"adve_grp_" . $this->cgrp);
470 $tpl->setContent($this->form->getHtml());
483 $lng->loadLanguageModule(
"content");
485 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
488 if ($this->cgrp ==
"test") {
489 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
491 $this->form->setTitle(
$lng->txt(
"adve_activation"));
492 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_tst_editing"),
"tst_page_edit");
493 $cb->setInfo($this->lng->txt(
"advanced_editing_tst_editing_desc"));
495 $cb->setChecked(
true);
497 $this->form->addItem($cb);
500 $sh->setTitle(
$lng->txt(
"adve_text_content_features"));
501 $this->form->addItem($sh);
502 } elseif ($this->cgrp ==
"rep") {
503 $this->form->setTitle(
$lng->txt(
"adve_activation"));
504 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
505 $cb->setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
506 if (
$ilSetting->get(
"enable_cat_page_edit")) {
507 $cb->setChecked(
true);
509 $this->form->addItem($cb);
512 $sh->setTitle(
$lng->txt(
"adve_text_content_features"));
513 $this->form->addItem($sh);
515 $this->form->setTitle(
$lng->txt(
"adve_text_content_features"));
519 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
521 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
523 foreach ($buttons as $b =>
$t) {
525 $cb =
new ilCheckboxInputGUI(str_replace(
":",
"", $this->lng->txt(
"cont_text_" . $b)),
"active_" . $b);
527 $this->form->addItem($cb);
532 $this->form->addCommandButton(
"savePageEditorSettings",
$lng->txt(
"save"));
535 $this->form->setFormAction($this->ctrl->getFormAction($this));
551 if ($this->form->checkInput()) {
552 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
553 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
555 foreach ($buttons as $b =>
$t) {
559 $this->form->getInput(
"active_" . $b)
563 if (
$_GET[
"grp"] ==
"test") {
565 } elseif (
$_GET[
"grp"] ==
"rep") {
573 $ilCtrl->redirect($this,
"showPageEditorSettings");
585 $this->addPageEditorSettingsSubTabs();
586 $ilTabs->activateTab(
"adve_page_editor_settings");
600 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
607 $cb->setInfo($this->lng->txt(
"adve_use_physical_info"));
608 $cb->setChecked($aset->get(
"use_physical"));
612 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"adve_blocking_mode"),
"block_mode_act");
613 $cb->setChecked($aset->get(
"block_mode_minutes") > 0);
617 $ni =
new ilNumberInputGUI($this->lng->txt(
"adve_minutes"),
"block_mode_minutes");
619 $ni->setMaxLength(5);
621 $ni->setRequired(
true);
622 $ni->setInfo($this->lng->txt(
"adve_minutes_info"));
623 $ni->setValue($aset->get(
"block_mode_minutes"));
624 $cb->addSubItem($ni);
627 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"adve_auto_url_linking"),
"auto_url_linking");
628 $cb->setChecked($aset->get(
"auto_url_linking"));
629 $cb->setInfo($this->lng->txt(
"adve_auto_url_linking_info"));
633 $form->addCommandButton(
"saveGeneralPageSettings",
$lng->txt(
"save"));
637 $this->lng->loadLanguageModule(
"copg");
639 $sh->setTitle(
$lng->txt(
"copg_allow_html"));
640 $sh->setInfo(
$lng->txt(
"copg_allow_html_info"));
644 $comps_per_dir = array_column(array_map(
function ($k, $v) {
645 return [$v[
"type"].
"/".$v[
"name"], $v];
646 }, array_keys($comps), $comps), 1, 0);
649 foreach ($cdef->getDefinitions() as
$key =>
$def) {
651 $comp_id = $comps_per_dir[
$def[
"component"]][
"id"];
652 $this->lng->loadLanguageModule($comp_id);
654 $cb->setChecked($aset->get(
"act_html_" .
$key));
663 $form->setTitle(
$lng->txt(
"adve_pe_general"));
680 return [
"lobj",
"copa",
"mep",
"blp",
"prtf",
"prtt",
"gdf",
"lm",
"qht",
"qpl",
"qfbg",
"qfbs",
"sahs",
"stys",
"cont",
"cstr",
"auth"];
695 if (
$form->checkInput()) {
697 $aset->set(
"use_physical",
$_POST[
"use_physical"]);
698 if (
$_POST[
"block_mode_act"]) {
699 $aset->set(
"block_mode_minutes", (
int)
$_POST[
"block_mode_minutes"]);
701 $aset->set(
"block_mode_minutes", 0);
703 $aset->set(
"auto_url_linking",
$_POST[
"auto_url_linking"]);
713 $ilCtrl->redirect($this,
"showGeneralPageEditorSettings");
716 $form->setValuesByPost();
728 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
733 $form->addCommandButton(
"saveCharSelectorSettings",
$lng->txt(
"save"));
750 $ilTabs->activateTab(
"adve_char_selector_settings");
752 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
754 $char_selector->getConfig()->setAvailability(
$ilSetting->get(
'char_selector_availability'));
755 $char_selector->getConfig()->setDefinition(
$ilSetting->get(
'char_selector_definition'));
757 $char_selector->setFormValues(
$form);
774 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
777 if (
$form->checkInput()) {
778 $char_selector->getFormValues(
$form);
780 $ilSetting->set(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
781 $ilSetting->set(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
784 $ilCtrl->redirect($this,
"showCharSelectorSettings");
786 $form->setValuesByPost();
An exception for terminatinating execution or to throw for unit testing.
COPage page object definition handler.
This shows a character selector.
addFormProperties(ilPropertyFormGUI $a_form)
add the configuration elements to a property form
static setShortTextsDirtyGlobally()
Set short texts dirty.
Class ilObjAdvancedEditingGUI.
saveFrmPostSettingsObject()
saveSurveySettingsObject()
showPageEditorSettingsObject()
Show page editor settings.
saveExcAssSettingsObject()
saveAssessmentSettingsObject()
saveGeneralPageSettingsObject()
Save general page settings.
showGeneralPageEditorSettingsObject()
Show general page editor settings.
saveCharSelectorSettingsObject()
Save the settings for the selector of unicode characters.
initTagsForm($a_id, $a_cmd, $a_title)
surveyObject()
Display settings for surveys.
excAssObject()
Display settings for exercise assignments.
frmPostObject()
Display settings for forums.
getTabs()
get tabs @access public
getAdminTabs()
administration tabs show only permissions and trash folder
initGeneralPageSettingsForm()
Init general page editor settings form.
saveTags($a_id, $a_cmd, $form)
saveObject()
save object @access public
saveSettingsObject()
Save Assessment settings.
settingsObject()
Display assessment folder settings form.
initCharSelectorSettingsForm(ilCharSelectorGUI $char_selector)
Init the settings form for the selector of unicode characters.
addSubtabs()
Add rte subtabs.
getPageObjectKeysWithOptionalHTML()
This limits the possibility to allow html for these page objects that supported the feature in the pa...
initPageEditorForm($a_mode="edit")
Init page editor form.
addPageEditorSettingsSubtabs()
Show page editor settings subtabs.
showCharSelectorSettingsObject()
Show the settings for the selector of unicode characters.
assessmentObject()
Display settings for test and assessment.
savePageEditorSettingsObject()
Save page editor settings form.
__construct($a_data, $a_id, $a_call_by_reference)
Constructor.
executeCommand()
execute command
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static _getCommonBBButtons()
Get common bb buttons.
static lookupSetting($a_grp, $a_name, $a_default=false)
Lookup setting.
static getGroups()
Get all settings groups.
static writeSetting($a_grp, $a_name, $a_value)
Write Setting.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file)
if(isset($_POST['submit'])) $form