5 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
26 global $rbacsystem,
$lng;
29 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
30 $this->lng->loadLanguageModule(
'adve');
31 $this->lng->loadLanguageModule(
'meta');
33 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
35 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read_adve"),$this->ilias->error_obj->WARNING);
41 $next_class = $this->ctrl->getNextClass($this);
42 $cmd = $this->ctrl->getCmd();
48 case 'ilpermissiongui':
49 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
51 $ret =& $this->ctrl->forwardCommand($perm_gui);
57 $cmd =
"showGeneralPageEditorSettings";
83 $this->ctrl->redirect($this);
100 if ($ilCtrl->getNextClass() !=
"ilpermissiongui" &&
101 !in_array($ilCtrl->getCmd(), array(
"showPageEditorSettings",
102 "showGeneralPageEditorSettings",
"showCharSelectorSettings",
"",
"view")))
104 $tabs_gui->addSubTabTarget(
"adve_general_settings",
105 $this->ctrl->getLinkTarget($this,
"settings"),
106 array(
"settings",
"saveSettings"),
108 $tabs_gui->addSubTabTarget(
"adve_assessment_settings",
109 $this->ctrl->getLinkTarget($this,
"assessment"),
110 array(
"assessment",
"saveAssessmentSettings"),
112 $tabs_gui->addSubTabTarget(
"adve_survey_settings",
113 $this->ctrl->getLinkTarget($this,
"survey"),
114 array(
"survey",
"saveSurveySettings"),
116 $tabs_gui->addSubTabTarget(
"adve_frm_post_settings",
117 $this->ctrl->getLinkTarget($this,
"frmPost"),
118 array(
"frmPost",
"saveFrmPostSettings"),
120 $tabs_gui->addSubTabTarget(
"adve_excass_settings",
121 $this->ctrl->getLinkTarget($this,
"excass"),
122 array(
"excass",
"saveExcAssSettings"),
134 $ilTabs->addSubTabTarget(
"adve_pe_general",
135 $ilCtrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
136 array(
"showGeneralPageEditorSettings",
"",
"view"));
138 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
141 foreach ($grps as $g => $types)
143 $ilCtrl->setParameter($this,
"grp", $g);
144 $ilTabs->addSubTabTarget(
"adve_grp_".$g,
145 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
146 array(
"showPageEditorSettings"));
148 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
160 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
162 $tabs_gui->addTarget(
"adve_page_editor_settings",
163 $this->ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
164 array(
"showPageEditorSettings",
"",
"view"));
166 $tabs_gui->addTarget(
"adve_rte_settings",
167 $this->ctrl->getLinkTarget($this,
"settings"),
168 array(
"settings",
"assessment",
"survey",
"frmPost"),
"",
"");
170 $tabs_gui->addTarget(
"adve_char_selector_settings",
171 $this->ctrl->getLinkTarget($this,
"showCharSelectorSettings"),
172 array(
"showCharSelectorSettings",
"",
"view"));
175 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
177 $tabs_gui->addTarget(
"perm_settings",
178 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
191 $editor = $this->
object->_getRichTextEditor();
193 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
195 $this->form->setFormAction($ilCtrl->getFormAction($this));
196 $this->form->setTitle($lng->txt(
"adve_activation"));
198 if ($editor ==
"tinymce")
202 $this->form->addItem($cb);
203 $this->form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
205 $tpl->setContent($this->form->getHTML());
215 $this->
object->_setRichTextEditor(
"tinymce");
219 $this->
object->_setRichTextEditor(
"");
223 $this->ctrl->redirect($this,
'settings');
232 $form = $this->
initTagsForm(
"assessment",
"saveAssessmentSettings",
233 "advanced_editing_assessment_settings");
235 $this->tpl->setContent($form->getHTML());
240 $this->
saveTags(
"assessment",
"assessment");
249 $form = $this->
initTagsForm(
"survey",
"saveSurveySettings",
250 "advanced_editing_survey_settings");
252 $this->tpl->setContent($form->getHTML());
257 $this->
saveTags(
"survey",
"survey");
266 $form = $this->
initTagsForm(
"frm_post",
"saveFrmPostSettings",
267 "advanced_editing_frm_post_settings");
269 $this->tpl->setContent($form->getHTML());
274 $this->
saveTags(
"frm_post",
"frmPost");
283 $form = $this->
initTagsForm(
"exc_ass",
"saveExcAssSettings",
284 "advanced_editing_excass_settings");
286 $this->tpl->setContent($form->getHTML());
291 $this->
saveTags(
"exc_ass",
"excAss");
299 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
301 $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
302 $form->setTitle($this->lng->txt($a_title));
304 $alltags = $this->
object->getHTMLTags();
305 $alltags = array_combine($alltags, $alltags);
307 include_once
"Services/Form/classes/class.ilMultiSelectInputGUI.php";
310 $tags->enableSelectAll(
true);
311 $tags->enableSelectedFirst(
true);
312 $tags->setOptions($alltags);
313 $tags->setValue($this->object->_getUsedHTMLTags($a_id));
314 $form->addItem($tags);
316 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
318 $form->addCommandButton($a_cmd, $this->lng->txt(
"save"));
329 if(is_array(
$_POST[
'html_tags']) &&
$_POST[
'html_tags'][0] ==
"")
331 unset(
$_POST[
'html_tags'][0]);
334 $this->
object->_setUsedHTMLTags((array)
$_POST[
'html_tags'], $a_id);
342 $this->ctrl->redirect($this, $a_cmd);
353 $this->addPageEditorSettingsSubTabs();
355 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
358 $this->cgrp =
$_GET[
"grp"];
359 if ($this->cgrp ==
"")
361 $this->cgrp = key($grps);
364 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
365 $ilTabs->setSubTabActive(
"adve_grp_".$this->cgrp);
368 $tpl->setContent($this->form->getHtml());
380 $lng->loadLanguageModule(
"content");
382 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
385 if( $this->cgrp ==
"test" )
387 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
389 $this->form->setTitle($lng->txt(
"adve_activation"));
390 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_tst_editing"),
"tst_page_edit");
391 $cb->
setInfo($this->lng->txt(
"advanced_editing_tst_editing_desc"));
394 $cb->setChecked(
true);
396 $this->form->addItem($cb);
399 $sh->setTitle($lng->txt(
"adve_text_content_features"));
400 $this->form->addItem($sh);
402 elseif ($this->cgrp ==
"rep")
404 $this->form->setTitle($lng->txt(
"adve_activation"));
405 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
406 $cb->
setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
407 if ($ilSetting->get(
"enable_cat_page_edit"))
409 $cb->setChecked(
true);
411 $this->form->addItem($cb);
414 $sh->setTitle($lng->txt(
"adve_text_content_features"));
415 $this->form->addItem($sh);
419 $this->form->setTitle($lng->txt(
"adve_text_content_features"));
423 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
425 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
427 foreach ($buttons as $b =>
$t)
430 $cb =
new ilCheckboxInputGUI(str_replace(
":",
"", $this->lng->txt(
"cont_text_".$b)),
"active_".$b);
432 $this->form->addItem($cb);
436 $this->form->addCommandButton(
"savePageEditorSettings", $lng->txt(
"save"));
438 $this->form->setFormAction($this->ctrl->getFormAction($this));
451 if ($this->form->checkInput())
453 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
454 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
456 foreach ($buttons as $b =>
$t)
459 $this->form->getInput(
"active_".$b));
462 if (
$_GET[
"grp"] ==
"test")
464 $ilSetting->set(
"enable_tst_page_edit", (
int)
$_POST[
"tst_page_edit"]);
466 elseif (
$_GET[
"grp"] ==
"rep")
468 $ilSetting->set(
"enable_cat_page_edit", (
int)
$_POST[
"cat_page_edit"]);
474 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
475 $ilCtrl->redirect($this,
"showPageEditorSettings");
484 global
$tpl, $ilTabs;
486 $this->addPageEditorSettingsSubTabs();
487 $ilTabs->activateTab(
"adve_page_editor_settings");
490 $tpl->setContent($form->getHTML());
500 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
507 $cb->
setInfo($this->lng->txt(
"adve_use_physical_info"));
508 $cb->setChecked($aset->get(
"use_physical"));
512 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"adve_blocking_mode"),
"block_mode_act");
513 $cb->
setChecked($aset->get(
"block_mode_minutes") > 0);
517 $ni =
new ilNumberInputGUI($this->lng->txt(
"adve_minutes"),
"block_mode_minutes");
519 $ni->setMaxLength(5);
521 $ni->setRequired(
true);
522 $ni->setInfo($this->lng->txt(
"adve_minutes_info"));
523 $ni->setValue($aset->get(
"block_mode_minutes"));
524 $cb->addSubItem($ni);
526 $form->addCommandButton(
"saveGeneralPageSettings", $lng->txt(
"save"));
528 $form->setTitle($lng->txt(
"adve_pe_general"));
529 $form->setFormAction($ilCtrl->getFormAction($this));
542 if ($form->checkInput())
545 $aset->set(
"use_physical",
$_POST[
"use_physical"]);
546 if (
$_POST[
"block_mode_act"])
548 $aset->set(
"block_mode_minutes", (
int)
$_POST[
"block_mode_minutes"]);
552 $aset->set(
"block_mode_minutes", 0);
556 $ilCtrl->redirect($this,
"showGeneralPageEditorSettings");
559 $form->setValuesByPost();
560 $tpl->setContent($form->getHTML());
570 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
572 $form->setTitle($lng->txt(
'settings'));
573 $form->setFormAction($ilCtrl->getFormAction($this));
574 $form->addCommandButton(
"saveCharSelectorSettings", $lng->txt(
"save"));
588 $ilTabs->activateTab(
"adve_char_selector_settings");
590 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
592 $char_selector->getConfig()->setAvailability($ilSetting->get(
'char_selector_availability'));
593 $char_selector->getConfig()->setDefinition($ilSetting->get(
'char_selector_definition'));
595 $char_selector->setFormValues($form);
596 $tpl->setContent($form->getHTML());
607 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
610 if ($form->checkInput())
612 $char_selector->getFormValues($form);
614 $ilSetting->set(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
615 $ilSetting->set(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
618 $ilCtrl->redirect($this,
"showCharSelectorSettings");
620 $form->setValuesByPost();
621 $tpl->setContent($form->getHTML());