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();
65 $this->lng->loadLanguageModule(
'adve');
66 $this->lng->loadLanguageModule(
'meta');
71 if (!$this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
72 $mess = str_replace(
"%s", $this->object->getTitle(), $this->lng->txt(
"msg_no_perm_read_item"));
73 $this->
ilias->raiseError($mess, $this->
ilias->error_obj->WARNING);
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd();
80 switch ($next_class) {
82 case 'ilpermissiongui':
83 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
85 $ret = &$this->ctrl->forwardCommand($perm_gui);
89 if ($cmd ==
"" || $cmd ==
"view") {
90 $cmd =
"showGeneralPageEditorSettings";
108 parent::saveObject();
111 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
112 $this->ctrl->redirect($this);
127 if ($ilCtrl->getNextClass() !=
"ilpermissiongui" &&
128 !in_array($ilCtrl->getCmd(), array(
"showPageEditorSettings",
129 "showGeneralPageEditorSettings",
"showCharSelectorSettings",
"",
"view"))) {
130 $this->tabs_gui->addSubTabTarget(
131 "adve_general_settings",
132 $this->ctrl->getLinkTarget($this,
"settings"),
133 array(
"settings",
"saveSettings"),
137 $this->tabs_gui->addSubTabTarget(
138 "adve_assessment_settings",
139 $this->ctrl->getLinkTarget($this,
"assessment"),
140 array(
"assessment",
"saveAssessmentSettings"),
144 $this->tabs_gui->addSubTabTarget(
145 "adve_survey_settings",
146 $this->ctrl->getLinkTarget($this,
"survey"),
147 array(
"survey",
"saveSurveySettings"),
151 $this->tabs_gui->addSubTabTarget(
152 "adve_frm_post_settings",
153 $this->ctrl->getLinkTarget($this,
"frmPost"),
154 array(
"frmPost",
"saveFrmPostSettings"),
158 $this->tabs_gui->addSubTabTarget(
159 "adve_excass_settings",
160 $this->ctrl->getLinkTarget($this,
"excass"),
161 array(
"excass",
"saveExcAssSettings"),
176 $ilTabs->addSubTabTarget(
178 $ilCtrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
179 array(
"showGeneralPageEditorSettings",
"",
"view")
182 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
185 foreach ($grps as $g => $types) {
186 $ilCtrl->setParameter($this,
"grp", $g);
187 $ilTabs->addSubTabTarget(
189 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
190 array(
"showPageEditorSettings")
193 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
205 if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
206 $this->tabs_gui->addTarget(
207 "adve_page_editor_settings",
208 $this->ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
209 array(
"showPageEditorSettings",
"",
"view")
212 $this->tabs_gui->addTarget(
214 $this->ctrl->getLinkTarget($this,
"settings"),
215 array(
"settings",
"assessment",
"survey",
"frmPost",
"excass"),
220 $this->tabs_gui->addTarget(
221 "adve_char_selector_settings",
222 $this->ctrl->getLinkTarget($this,
"showCharSelectorSettings"),
223 array(
"showCharSelectorSettings",
"",
"view")
227 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
228 $this->tabs_gui->addTarget(
230 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
231 array(
"perm",
"info",
"owner"),
248 $editor = $this->
object->_getRichTextEditor();
250 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
252 $this->form->setFormAction($ilCtrl->getFormAction($this));
253 $this->form->setTitle(
$lng->txt(
"adve_activation"));
255 if ($editor ==
"tinymce") {
256 $cb->setChecked(
true);
258 $this->form->addItem($cb);
260 $this->form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
263 $tpl->setContent($this->form->getHTML());
274 $this->
object->setRichTextEditor(
"tinymce");
276 $this->
object->setRichTextEditor(
"");
278 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
280 $this->ctrl->redirect($this,
'settings');
291 "saveAssessmentSettings",
292 "advanced_editing_assessment_settings"
295 $this->tpl->setContent($form->getHTML());
302 "saveAssessmentSettings",
303 "advanced_editing_assessment_settings"
305 if (!$this->
saveTags(
"assessment",
"assessment", $form)) {
306 $form->setValuesByPost();
307 $this->tpl->setContent($form->getHTML());
319 "saveSurveySettings",
320 "advanced_editing_survey_settings"
323 $this->tpl->setContent($form->getHTML());
330 "saveSurveySettings",
331 "advanced_editing_survey_settings"
333 if (!$this->
saveTags(
"survey",
"survey", $form)) {
334 $form->setValuesByPost();
335 $this->tpl->setContent($form->getHTML());
347 "saveFrmPostSettings",
348 "advanced_editing_frm_post_settings"
351 $this->tpl->setContent($form->getHTML());
358 "saveFrmPostSettings",
359 "advanced_editing_frm_post_settings"
361 if (!$this->
saveTags(
"frm_post",
"frmPost", $form)) {
362 $form->setValuesByPost();
363 $this->tpl->setContent($form->getHTML());
375 "saveExcAssSettings",
376 "advanced_editing_excass_settings"
379 $this->tpl->setContent($form->getHTML());
386 "saveExcAssSettings",
387 "advanced_editing_excass_settings"
389 if (!$this->
saveTags(
"exc_ass",
"excAss", $form)) {
390 $form->setValuesByPost();
391 $this->tpl->setContent($form->getHTML());
400 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
402 $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
403 $form->setTitle($this->lng->txt($a_title));
405 $alltags = $this->
object->getHTMLTags();
406 $alltags = array_combine($alltags, $alltags);
408 include_once
"Services/Form/classes/class.ilMultiSelectInputGUI.php";
410 $tags->setHeight(400);
411 $tags->enableSelectAll(
true);
412 $tags->enableSelectedFirst(
true);
413 $tags->setOptions($alltags);
415 $form->addItem($tags);
417 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
418 $form->addCommandButton($a_cmd, $this->lng->txt(
"save"));
428 if ($form->checkInput()) {
430 if (is_array(
$_POST[
'html_tags']) &&
$_POST[
'html_tags'][0] ==
"") {
431 unset(
$_POST[
'html_tags'][0]);
434 $this->
object->setUsedHTMLTags((array)
$_POST[
'html_tags'], $a_id);
435 ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'),
true);
443 $this->ctrl->redirect($this, $a_cmd);
457 $this->addPageEditorSettingsSubTabs();
459 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
462 $this->cgrp =
$_GET[
"grp"];
463 if ($this->cgrp ==
"") {
464 $this->cgrp = key($grps);
467 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
468 $ilTabs->setSubTabActive(
"adve_grp_" . $this->cgrp);
471 $tpl->setContent($this->form->getHtml());
484 $lng->loadLanguageModule(
"content");
486 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
489 if ($this->cgrp ==
"test") {
490 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
492 $this->form->setTitle(
$lng->txt(
"adve_activation"));
493 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_tst_editing"),
"tst_page_edit");
494 $cb->setInfo($this->lng->txt(
"advanced_editing_tst_editing_desc"));
496 $cb->setChecked(
true);
498 $this->form->addItem($cb);
501 $sh->setTitle(
$lng->txt(
"adve_text_content_features"));
502 $this->form->addItem($sh);
503 } elseif ($this->cgrp ==
"rep") {
504 $this->form->setTitle(
$lng->txt(
"adve_activation"));
505 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
506 $cb->setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
507 if (
$ilSetting->get(
"enable_cat_page_edit")) {
508 $cb->setChecked(
true);
510 $this->form->addItem($cb);
513 $sh->setTitle(
$lng->txt(
"adve_text_content_features"));
514 $this->form->addItem($sh);
516 $this->form->setTitle(
$lng->txt(
"adve_text_content_features"));
520 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
522 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
524 foreach ($buttons as
$b => $t) {
528 $this->form->addItem($cb);
533 $this->form->addCommandButton(
"savePageEditorSettings",
$lng->txt(
"save"));
536 $this->form->setFormAction($this->ctrl->getFormAction($this));
552 if ($this->form->checkInput()) {
553 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
554 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
556 foreach ($buttons as
$b => $t) {
560 $this->form->getInput(
"active_" .
$b)
564 if (
$_GET[
"grp"] ==
"test") {
566 } elseif (
$_GET[
"grp"] ==
"rep") {
573 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
574 $ilCtrl->redirect($this,
"showPageEditorSettings");
586 $this->addPageEditorSettingsSubTabs();
587 $ilTabs->activateTab(
"adve_page_editor_settings");
590 $tpl->setContent($form->getHTML());
601 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
608 $cb->setInfo($this->lng->txt(
"adve_use_physical_info"));
609 $cb->setChecked($aset->get(
"use_physical"));
613 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"adve_blocking_mode"),
"block_mode_act");
614 $cb->setChecked($aset->get(
"block_mode_minutes") > 0);
618 $ni =
new ilNumberInputGUI($this->lng->txt(
"adve_minutes"),
"block_mode_minutes");
620 $ni->setMaxLength(5);
622 $ni->setRequired(
true);
623 $ni->setInfo($this->lng->txt(
"adve_minutes_info"));
624 $ni->setValue($aset->get(
"block_mode_minutes"));
625 $cb->addSubItem($ni);
629 $as->setSuffix($this->lng->txt(
"seconds"));
630 $as->setMaxLength(5);
632 $as->setInfo($this->lng->txt(
"adve_autosave_info"));
633 $as->setValue($aset->get(
"autosave"));
637 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"adve_auto_url_linking"),
"auto_url_linking");
638 $cb->setChecked($aset->get(
"auto_url_linking"));
639 $cb->setInfo($this->lng->txt(
"adve_auto_url_linking_info"));
643 $form->addCommandButton(
"saveGeneralPageSettings",
$lng->txt(
"save"));
647 $this->lng->loadLanguageModule(
"copg");
649 $sh->setTitle(
$lng->txt(
"copg_allow_html"));
650 $sh->setInfo(
$lng->txt(
"copg_allow_html_info"));
654 $comps_per_dir = array_column(array_map(
function ($k, $v) {
655 return [$v[
"type"] .
"/" . $v[
"name"], $v];
656 }, array_keys($comps), $comps), 1, 0);
659 foreach ($cdef->getDefinitions() as $key => $def) {
661 $comp_id = $comps_per_dir[$def[
"component"]][
"id"];
662 $this->lng->loadLanguageModule($comp_id);
663 $cb =
new ilCheckboxInputGUI($def[
"component"] .
": " . $this->lng->txt($comp_id .
"_page_type_" . $key),
"act_html_" . $key);
664 $cb->setChecked($aset->get(
"act_html_" . $key));
673 $form->setTitle(
$lng->txt(
"adve_pe_general"));
674 $form->setFormAction($ilCtrl->getFormAction($this));
690 return [
"lobj",
"copa",
"mep",
"blp",
"prtf",
"prtt",
"gdf",
"lm",
"qht",
"qpl",
"qfbg",
"qfbs",
"sahs",
"stys",
"cont",
"cstr",
"auth"];
705 if ($form->checkInput()) {
706 $autosave = (int) $form->getInput(
"autosave");
710 if ($autosave > 0 && $autosave < 10) {
711 $form->getItemByPostVar(
"autosave")->setAlert($this->lng->txt(
"adve_autosave_info_min_10"));
717 $aset->set(
"use_physical",
$_POST[
"use_physical"]);
718 if (
$_POST[
"block_mode_act"]) {
719 $aset->set(
"block_mode_minutes", (
int)
$_POST[
"block_mode_minutes"]);
721 $aset->set(
"block_mode_minutes", 0);
723 $aset->set(
"auto_url_linking",
$_POST[
"auto_url_linking"]);
725 $aset->set(
"autosave", $form->getInput(
"autosave"));
728 foreach ($def->getDefinitions() as $key => $def) {
730 $aset->set(
"act_html_" . $key, (
int)
$_POST[
"act_html_" . $key]);
734 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
735 $ilCtrl->redirect($this,
"showGeneralPageEditorSettings");
739 $form->setValuesByPost();
740 $tpl->setContent($form->getHTML());
751 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
753 $form->setTitle(
$lng->txt(
'settings'));
754 $form->setFormAction($ilCtrl->getFormAction($this));
756 $form->addCommandButton(
"saveCharSelectorSettings",
$lng->txt(
"save"));
773 $ilTabs->activateTab(
"adve_char_selector_settings");
775 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
777 $char_selector->getConfig()->setAvailability(
$ilSetting->get(
'char_selector_availability'));
778 $char_selector->getConfig()->setDefinition(
$ilSetting->get(
'char_selector_definition'));
780 $char_selector->setFormValues($form);
781 $tpl->setContent($form->getHTML());
797 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
800 if ($form->checkInput()) {
801 $char_selector->getFormValues($form);
803 $ilSetting->set(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
804 $ilSetting->set(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
806 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
807 $ilCtrl->redirect($this,
"showCharSelectorSettings");
809 $form->setValuesByPost();
810 $tpl->setContent($form->getHTML());
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 sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)