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_frm_post_settings",
123 $this->
ctrl->getLinkTarget($this,
"frmPost"),
124 array(
"frmPost",
"saveFrmPostSettings"),
133 $this->tabs_gui->addSubTabTarget(
135 $this->
ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
136 array(
"showGeneralPageEditorSettings",
"",
"view")
141 foreach ($grps as $g => $types) {
142 $this->
ctrl->setParameter($this,
"grp", $g);
143 $this->tabs_gui->addSubTabTarget(
145 $this->
ctrl->getLinkTarget($this,
"showPageEditorSettings"),
146 array(
"showPageEditorSettings")
149 $this->
ctrl->setParameter($this,
"grp", $this->std_request->getGroup());
154 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
155 $this->tabs_gui->addTarget(
156 "adve_page_editor_settings",
157 $this->
ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
158 array(
"showPageEditorSettings",
"",
"view")
161 $this->tabs_gui->addTarget(
163 $this->
ctrl->getLinkTarget($this,
"settings"),
164 array(
"settings",
"assessment",
"frmPost"),
170 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
171 $this->tabs_gui->addTarget(
173 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
174 array(
"perm",
"info",
"owner"),
193 $form->
setTitle($this->
lng->txt(
"adve_activation"));
195 if ($editor ===
"tinymce") {
196 $cb->setChecked(
true);
214 $this->
object->setRichTextEditor(
"tinymce");
216 $this->
object->setRichTextEditor(
"");
218 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
220 $this->
ctrl->redirect($this,
'settings');
227 "saveAssessmentSettings",
228 "advanced_editing_assessment_settings" 231 $this->tpl->setContent($form->
getHTML());
238 "saveAssessmentSettings",
239 "advanced_editing_assessment_settings" 241 if (!$this->
saveTags(
"assessment",
"assessment", $form)) {
243 $this->tpl->setContent($form->
getHTML());
251 "saveFrmPostSettings",
252 "advanced_editing_frm_post_settings" 255 $this->tpl->setContent($form->
getHTML());
262 "saveFrmPostSettings",
263 "advanced_editing_frm_post_settings" 265 if (!$this->
saveTags(
"frm_post",
"frmPost", $form)) {
267 $this->tpl->setContent($form->
getHTML());
280 $alltags = $this->
object->getHTMLTags();
281 $alltags = array_combine($alltags, $alltags);
285 $tags->enableSelectAll(
true);
286 $tags->enableSelectedFirst(
true);
287 $tags->setOptions($alltags);
291 if ($this->
access->checkAccess(
"write",
"", $this->object->getRefId())) {
306 $html_tags = $form->
getInput(
"html_tags");
308 if (array_key_exists(0, $html_tags) && (
string) $html_tags[0] ===
'') {
309 unset($html_tags[0]);
311 $this->
object->setUsedHTMLTags((array) $html_tags, $a_id);
312 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
317 $this->tpl->setOnScreenMessage(
'info', $e->getMessage(),
true);
319 $this->
ctrl->redirect($this, $a_cmd);
329 $this->cgrp = $this->std_request->getGroup();
330 if ($this->cgrp ===
"") {
331 $this->cgrp = (string) key($grps);
334 $this->
ctrl->setParameter($this,
"grp", $this->cgrp);
335 $this->tabs_gui->setSubTabActive(
"adve_grp_" . $this->cgrp);
338 $this->tpl->setContent($this->
form->getHTML());
343 $this->
lng->loadLanguageModule(
"content");
347 if ($this->cgrp ===
"test") {
348 $this->
form->setTitle($this->
lng->txt(
"adve_activation"));
350 $cb->setInfo($this->
lng->txt(
"advanced_editing_tst_editing_desc"));
352 $cb->setChecked(
true);
354 $this->
form->addItem($cb);
357 $sh->setTitle($this->
lng->txt(
"adve_text_content_features"));
358 $this->
form->addItem($sh);
359 } elseif ($this->cgrp ===
"rep") {
360 $this->
form->setTitle($this->
lng->txt(
"adve_activation"));
362 $cb->setInfo($this->
lng->txt(
"advanced_editing_rep_page_editing_desc"));
363 if ($this->
settings->get(
"enable_cat_page_edit")) {
364 $cb->setChecked(
true);
366 $this->
form->addItem($cb);
369 $sh->setTitle($this->
lng->txt(
"adve_text_content_features"));
370 $this->
form->addItem($sh);
372 $this->
form->setTitle($this->
lng->txt(
"adve_text_content_features"));
377 foreach ($buttons as
$b => $t) {
381 $this->
form->addItem($cb);
386 $this->
form->addCommandButton(
"savePageEditorSettings", $this->
lng->txt(
"save"));
389 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
401 if ($this->
form->checkInput()) {
403 foreach ($buttons as
$b => $t) {
405 $this->std_request->getGroup(),
407 $this->
form->getInput(
"active_" .
$b)
411 if ($this->std_request->getGroup() ===
"test") {
412 $ilSetting->set(
"enable_tst_page_edit", (
string) $this->
form->getInput(
"tst_page_edit"));
413 } elseif ($this->std_request->getGroup() ===
"rep") {
414 $ilSetting->set(
"enable_cat_page_edit", (
string) $this->
form->getInput(
"cat_page_edit"));
417 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
420 $ilCtrl->setParameter($this,
"grp", $this->std_request->getGroup());
421 $ilCtrl->redirect($this,
"showPageEditorSettings");
427 $this->tabs_gui->activateTab(
"adve_page_editor_settings");
430 $this->tpl->setContent($form->
getHTML());
441 $cb->setInfo($this->
lng->txt(
"adve_use_physical_info"));
442 $cb->setChecked((
bool) $aset->get(
"use_physical"));
447 $cb->setChecked((
bool) $aset->get(
"block_mode_minutes") > 0);
453 $ni->setMaxLength(5);
455 $ni->setRequired(
true);
456 $ni->setInfo($this->
lng->txt(
"adve_minutes_info"));
457 $ni->setValue($aset->get(
"block_mode_minutes"));
458 $cb->addSubItem($ni);
462 $as->setSuffix($this->
lng->txt(
"seconds"));
463 $as->setMaxLength(5);
465 $as->setInfo($this->
lng->txt(
"adve_autosave_info"));
466 $as->setValue($aset->get(
"autosave"));
471 $cb->setChecked((
bool) $aset->get(
"auto_url_linking"));
472 $cb->setInfo($this->
lng->txt(
"adve_auto_url_linking_info"));
483 $form->
setTitle($this->
lng->txt(
"adve_pe_general"));
498 return [
"lobj",
"copa",
"mep",
"blp",
"prtf",
"prtt",
"term",
"lm",
"qht",
"qpl",
"qfbg",
"qfbs",
"sahs",
"stys",
"cont",
"cstr",
"auth"];
511 if ($autosave > 0 && $autosave < 10) {
512 $form->
getItemByPostVar(
"autosave")->setAlert($this->
lng->txt(
"adve_autosave_info_min_10"));
518 $aset->set(
"use_physical", $form->
getInput(
"use_physical"));
519 if ($form->
getInput(
"block_mode_act")) {
520 $aset->set(
"block_mode_minutes", (
string) (
int) $form->
getInput(
"block_mode_minutes"));
522 $aset->set(
"block_mode_minutes", 0);
524 $aset->set(
"auto_url_linking", $form->
getInput(
"auto_url_linking"));
526 $aset->set(
"autosave", $form->
getInput(
"autosave"));
528 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
529 $this->
ctrl->redirect($this,
"showGeneralPageEditorSettings");
534 $this->tpl->setContent($form->
getHTML());
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.
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.
saveAssessmentSettingsObject()
Class ilObjectGUI Basic methods of all Output classes.
ilComponentRepository $component_repository
Class ilObjForumAdministration.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
__construct(Container $dic, ilPlugin $plugin)
initTagsForm(string $a_id, string $a_cmd, string $a_title)
static _getCommonBBButtons()
savePageEditorSettingsObject()
Class ilObjAdvancedEditingGUI.
initGeneralPageSettingsForm()
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.