37 bool $a_call_by_reference
42 $this->component_repository = $DIC[
"component.repository"];
46 $this->
lng->loadLanguageModule(
'adve');
47 $this->
lng->loadLanguageModule(
'meta');
56 if (!$this->rbac_system->checkAccess(
'read', $this->object->getRefId())) {
57 $mess = str_replace(
"%s", $this->
object->getTitle(), $this->
lng->txt(
"msg_no_perm_read_item"));
58 $this->
ilias->raiseError($mess, $this->
ilias->error_obj->WARNING);
61 $next_class = $this->
ctrl->getNextClass($this);
62 $cmd = $this->
ctrl->getCmd();
65 switch ($next_class) {
66 case 'ilpermissiongui':
68 $this->
ctrl->forwardCommand($perm_gui);
72 if ($cmd === null || $cmd ===
"" || $cmd ===
"view") {
73 $cmd =
"showGeneralPageEditorSettings";
89 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
90 $this->
ctrl->redirect($this);
100 if ($this->
ctrl->getNextClass() !==
"ilpermissiongui" &&
101 !in_array($this->
ctrl->getCmd(), array(
102 "showPageEditorSettings",
103 "showGeneralPageEditorSettings",
107 $this->tabs_gui->addSubTabTarget(
108 "adve_general_settings",
109 $this->
ctrl->getLinkTarget($this,
"settings"),
110 array(
"settings",
"saveSettings"),
114 $this->tabs_gui->addSubTabTarget(
115 "adve_assessment_settings",
116 $this->
ctrl->getLinkTarget($this,
"assessment"),
117 array(
"assessment",
"saveAssessmentSettings"),
121 $this->tabs_gui->addSubTabTarget(
122 "adve_survey_settings",
123 $this->
ctrl->getLinkTarget($this,
"survey"),
124 array(
"survey",
"saveSurveySettings"),
128 $this->tabs_gui->addSubTabTarget(
129 "adve_frm_post_settings",
130 $this->
ctrl->getLinkTarget($this,
"frmPost"),
131 array(
"frmPost",
"saveFrmPostSettings"),
135 $this->tabs_gui->addSubTabTarget(
136 "adve_excass_settings",
137 $this->
ctrl->getLinkTarget($this,
"excass"),
138 array(
"excass",
"saveExcAssSettings"),
147 $this->tabs_gui->addSubTabTarget(
149 $this->
ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
150 array(
"showGeneralPageEditorSettings",
"",
"view")
155 foreach ($grps as $g => $types) {
156 $this->
ctrl->setParameter($this,
"grp", $g);
157 $this->tabs_gui->addSubTabTarget(
159 $this->
ctrl->getLinkTarget($this,
"showPageEditorSettings"),
160 array(
"showPageEditorSettings")
163 $this->
ctrl->setParameter($this,
"grp", $this->std_request->getGroup());
168 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
169 $this->tabs_gui->addTarget(
170 "adve_page_editor_settings",
171 $this->
ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
172 array(
"showPageEditorSettings",
"",
"view")
175 $this->tabs_gui->addTarget(
177 $this->
ctrl->getLinkTarget($this,
"settings"),
178 array(
"settings",
"assessment",
"survey",
"frmPost",
"excass"),
184 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
185 $this->tabs_gui->addTarget(
187 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
188 array(
"perm",
"info",
"owner"),
207 $form->
setTitle($this->
lng->txt(
"adve_activation"));
209 if ($editor ===
"tinymce") {
210 $cb->setChecked(
true);
228 $this->
object->setRichTextEditor(
"tinymce");
230 $this->
object->setRichTextEditor(
"");
232 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
234 $this->
ctrl->redirect($this,
'settings');
241 "saveAssessmentSettings",
242 "advanced_editing_assessment_settings" 245 $this->tpl->setContent($form->
getHTML());
252 "saveAssessmentSettings",
253 "advanced_editing_assessment_settings" 255 if (!$this->
saveTags(
"assessment",
"assessment", $form)) {
257 $this->tpl->setContent($form->
getHTML());
265 "saveSurveySettings",
266 "advanced_editing_survey_settings" 269 $this->tpl->setContent($form->
getHTML());
276 "saveSurveySettings",
277 "advanced_editing_survey_settings" 279 if (!$this->
saveTags(
"survey",
"survey", $form)) {
281 $this->tpl->setContent($form->
getHTML());
289 "saveFrmPostSettings",
290 "advanced_editing_frm_post_settings" 293 $this->tpl->setContent($form->
getHTML());
300 "saveFrmPostSettings",
301 "advanced_editing_frm_post_settings" 303 if (!$this->
saveTags(
"frm_post",
"frmPost", $form)) {
305 $this->tpl->setContent($form->
getHTML());
313 "saveExcAssSettings",
314 "advanced_editing_excass_settings" 317 $this->tpl->setContent($form->
getHTML());
324 "saveExcAssSettings",
325 "advanced_editing_excass_settings" 327 if (!$this->
saveTags(
"exc_ass",
"excAss", $form)) {
329 $this->tpl->setContent($form->
getHTML());
343 $alltags = $this->
object->getHTMLTags();
344 $alltags = array_combine($alltags, $alltags);
348 $tags->enableSelectAll(
true);
349 $tags->enableSelectedFirst(
true);
350 $tags->setOptions($alltags);
354 if ($this->
access->checkAccess(
"write",
"", $this->object->getRefId())) {
369 $html_tags = $form->
getInput(
"html_tags");
371 if (array_key_exists(0, $html_tags) && (
string) $html_tags[0] ===
'') {
372 unset($html_tags[0]);
374 $this->
object->setUsedHTMLTags((array) $html_tags, $a_id);
375 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
380 $this->tpl->setOnScreenMessage(
'info', $e->getMessage(),
true);
382 $this->
ctrl->redirect($this, $a_cmd);
392 $this->cgrp = $this->std_request->getGroup();
393 if ($this->cgrp ===
"") {
394 $this->cgrp = (string) key($grps);
397 $this->
ctrl->setParameter($this,
"grp", $this->cgrp);
398 $this->tabs_gui->setSubTabActive(
"adve_grp_" . $this->cgrp);
401 $this->tpl->setContent($this->
form->getHTML());
406 $this->
lng->loadLanguageModule(
"content");
410 if ($this->cgrp ===
"test") {
411 $this->
form->setTitle($this->
lng->txt(
"adve_activation"));
413 $cb->setInfo($this->
lng->txt(
"advanced_editing_tst_editing_desc"));
415 $cb->setChecked(
true);
417 $this->
form->addItem($cb);
420 $sh->setTitle($this->
lng->txt(
"adve_text_content_features"));
421 $this->
form->addItem($sh);
422 } elseif ($this->cgrp ===
"rep") {
423 $this->
form->setTitle($this->
lng->txt(
"adve_activation"));
425 $cb->setInfo($this->
lng->txt(
"advanced_editing_rep_page_editing_desc"));
426 if ($this->
settings->get(
"enable_cat_page_edit")) {
427 $cb->setChecked(
true);
429 $this->
form->addItem($cb);
432 $sh->setTitle($this->
lng->txt(
"adve_text_content_features"));
433 $this->
form->addItem($sh);
435 $this->
form->setTitle($this->
lng->txt(
"adve_text_content_features"));
440 foreach ($buttons as
$b => $t) {
444 $this->
form->addItem($cb);
449 $this->
form->addCommandButton(
"savePageEditorSettings", $this->
lng->txt(
"save"));
452 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
464 if ($this->
form->checkInput()) {
466 foreach ($buttons as
$b => $t) {
468 $this->std_request->getGroup(),
470 $this->
form->getInput(
"active_" .
$b)
474 if ($this->std_request->getGroup() ===
"test") {
475 $ilSetting->set(
"enable_tst_page_edit", (
string) $this->
form->getInput(
"tst_page_edit"));
476 } elseif ($this->std_request->getGroup() ===
"rep") {
477 $ilSetting->set(
"enable_cat_page_edit", (
string) $this->
form->getInput(
"cat_page_edit"));
480 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
483 $ilCtrl->setParameter($this,
"grp", $this->std_request->getGroup());
484 $ilCtrl->redirect($this,
"showPageEditorSettings");
490 $this->tabs_gui->activateTab(
"adve_page_editor_settings");
493 $this->tpl->setContent($form->
getHTML());
504 $cb->setInfo($this->
lng->txt(
"adve_use_physical_info"));
505 $cb->setChecked((
bool) $aset->get(
"use_physical"));
510 $cb->setChecked((
bool) $aset->get(
"block_mode_minutes") > 0);
516 $ni->setMaxLength(5);
518 $ni->setRequired(
true);
519 $ni->setInfo($this->
lng->txt(
"adve_minutes_info"));
520 $ni->setValue($aset->get(
"block_mode_minutes"));
521 $cb->addSubItem($ni);
525 $as->setSuffix($this->
lng->txt(
"seconds"));
526 $as->setMaxLength(5);
528 $as->setInfo($this->
lng->txt(
"adve_autosave_info"));
529 $as->setValue($aset->get(
"autosave"));
534 $cb->setChecked((
bool) $aset->get(
"auto_url_linking"));
535 $cb->setInfo($this->
lng->txt(
"adve_auto_url_linking_info"));
546 $form->
setTitle($this->
lng->txt(
"adve_pe_general"));
561 return [
"lobj",
"copa",
"mep",
"blp",
"prtf",
"prtt",
"term",
"lm",
"qht",
"qpl",
"qfbg",
"qfbs",
"sahs",
"stys",
"cont",
"cstr",
"auth"];
574 if ($autosave > 0 && $autosave < 10) {
575 $form->
getItemByPostVar(
"autosave")->setAlert($this->
lng->txt(
"adve_autosave_info_min_10"));
581 $aset->set(
"use_physical", $form->
getInput(
"use_physical"));
582 if ($form->
getInput(
"block_mode_act")) {
583 $aset->set(
"block_mode_minutes", (
string) (
int) $form->
getInput(
"block_mode_minutes"));
585 $aset->set(
"block_mode_minutes", 0);
587 $aset->set(
"auto_url_linking", $form->
getInput(
"auto_url_linking"));
589 $aset->set(
"autosave", $form->
getInput(
"autosave"));
591 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
592 $this->
ctrl->redirect($this,
"showGeneralPageEditorSettings");
597 $this->tpl->setContent($form->
getHTML());
saveExcAssSettingsObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Readable part of repository interface to ilComponentDataDB.
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
StandardGUIRequest $std_request
prepareOutput(bool $show_sub_objects=true)
addPageEditorSettingsSubtabs()
showGeneralPageEditorSettingsObject()
saveGeneralPageSettingsObject()
static getGroups()
Get all settings groups.
getPageObjectKeysWithOptionalHTML()
This limits the possibility to allow html for these page objects that supported the feature in the pa...
static lookupSetting(string $a_grp, string $a_name, string $a_default='0')
Lookup setting.
static writeSetting(string $a_grp, string $a_name, string $a_value)
Write Setting.
showPageEditorSettingsObject()
ilGlobalTemplateInterface $tpl
saveFrmPostSettingsObject()
setContent(string $a_html)
Sets content for standard template.
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
saveAssessmentSettingsObject()
Class ilObjectGUI Basic methods of all Output classes.
ilComponentRepository $component_repository
header include for all ilias files.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
initTagsForm(string $a_id, string $a_cmd, string $a_title)
static _getCommonBBButtons()
savePageEditorSettingsObject()
Class ilObjAdvancedEditingGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
initGeneralPageSettingsForm()
saveSurveySettingsObject()
static setShortTextsDirtyGlobally()
Set short texts dirty (for all glossaries)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.