/** * Lookup setting by parent type */ static function lookupSettingByParentType($a_par_type, $a_name, $a_default = false) { foreach (self::$option_groups as $g => $types) { if (in_array($a_par_type, $types)) { $grp = $g; } } if ($grp != "") { return ilPageEditorSettings::lookupSetting($grp, $a_name, $a_default); } return $a_default; }
/** * Init page editor form. * * @param int $a_mode Edit Mode */ public function initPageEditorForm($a_mode = "edit") { global $lng, $ilSetting; $lng->loadLanguageModule("content"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); if ($this->cgrp == "test") { require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php'; $this->form->setTitle($lng->txt("adve_activation")); $cb = new ilCheckboxInputGUI($this->lng->txt("advanced_editing_tst_editing"), "tst_page_edit"); $cb->setInfo($this->lng->txt("advanced_editing_tst_editing_desc")); if ($ilSetting->get("enable_tst_page_edit", ilObjAssessmentFolder::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED)) { $cb->setChecked(true); } $this->form->addItem($cb); $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("adve_text_content_features")); $this->form->addItem($sh); } elseif ($this->cgrp == "rep") { $this->form->setTitle($lng->txt("adve_activation")); $cb = new ilCheckboxInputGUI($this->lng->txt("advanced_editing_rep_page_editing"), "cat_page_edit"); $cb->setInfo($this->lng->txt("advanced_editing_rep_page_editing_desc")); if ($ilSetting->get("enable_cat_page_edit")) { $cb->setChecked(true); } $this->form->addItem($cb); $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("adve_text_content_features")); $this->form->addItem($sh); } else { $this->form->setTitle($lng->txt("adve_text_content_features")); } include_once "./Services/COPage/classes/class.ilPageEditorSettings.php"; include_once "./Services/COPage/classes/class.ilPageContentGUI.php"; $buttons = ilPageContentGUI::_getCommonBBButtons(); foreach ($buttons as $b => $t) { // command button activation $cb = new ilCheckboxInputGUI(str_replace(":", "", $this->lng->txt("cont_text_" . $b)), "active_" . $b); $cb->setChecked(ilPageEditorSettings::lookupSetting($this->cgrp, "active_" . $b, true)); $this->form->addItem($cb); } // save and cancel commands $this->form->addCommandButton("savePageEditorSettings", $lng->txt("save")); $this->form->setFormAction($this->ctrl->getFormAction($this)); }