5 include_once
"./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";
84 $this->ctrl->redirect($this);
97 $editor = $this->
object->_getRichTextEditor();
99 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
101 $this->form->setFormAction($ilCtrl->getFormAction($this));
102 $this->form->setTitle($lng->txt(
"adve_activation"));
104 if ($editor ==
"tinymce")
108 $this->form->addItem($cb);
109 $this->form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
111 $tpl->setContent($this->form->getHTML());
121 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_assessment.html");
123 $alltags =& $this->
object->getHTMLTags();
124 $usedtags =& $this->
object->_getUsedHTMLTags(
"assessment");
125 foreach ($alltags as $tag)
127 $this->tpl->setCurrentBlock(
"html_tag_row");
128 $this->tpl->setVariable(
"HTML_TAG", $tag);
129 if (is_array($usedtags))
131 if (in_array($tag, $usedtags))
133 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
136 $this->tpl->parseCurrentBlock();
139 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
141 $this->tpl->setCurrentBlock(
"save");
142 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
143 $this->tpl->parseCurrentBlock();
146 $this->tpl->setCurrentBlock(
"adm_content");
147 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
148 $this->tpl->setVariable(
"TXT_ASSESSMENT_SETTINGS", $this->lng->txt(
"advanced_editing_assessment_settings"));
149 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
151 $this->tpl->parseCurrentBlock();
162 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_survey.html");
164 $alltags =& $this->
object->getHTMLTags();
165 $usedtags =& $this->
object->_getUsedHTMLTags(
"survey");
166 foreach ($alltags as $tag)
168 $this->tpl->setCurrentBlock(
"html_tag_row");
169 $this->tpl->setVariable(
"HTML_TAG", $tag);
170 if (is_array($usedtags))
172 if (in_array($tag, $usedtags))
174 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
177 $this->tpl->parseCurrentBlock();
180 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
182 $this->tpl->setCurrentBlock(
"save");
183 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
184 $this->tpl->parseCurrentBlock();
187 $this->tpl->setCurrentBlock(
"adm_content");
188 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
189 $this->tpl->setVariable(
"TXT_SURVEY_SETTINGS", $this->lng->txt(
"advanced_editing_survey_settings"));
190 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
192 $this->tpl->parseCurrentBlock();
240 $this->
object->_setRichTextEditor(
"tinymce");
244 $this->
object->_setRichTextEditor(
"");
248 $this->ctrl->redirect($this,
'settings');
255 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"assessment");
256 $this->ctrl->redirect($this,
'assessment');
263 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"survey");
264 $this->ctrl->redirect($this,
'survey');
279 $this->addPageEditorSettingsSubTabs();
281 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
284 $this->cgrp =
$_GET[
"grp"];
285 if ($this->cgrp ==
"")
287 $this->cgrp = key($grps);
290 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
291 $ilTabs->setSubTabActive(
"adve_grp_".$this->cgrp);
294 $tpl->setContent($this->form->getHtml());
306 $lng->loadLanguageModule(
"content");
308 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
311 if ($this->cgrp ==
"rep")
313 $this->form->setTitle($lng->txt(
"adve_activation"));
314 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
315 $cb->
setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
316 if ($ilSetting->get(
"enable_cat_page_edit"))
318 $cb->setChecked(
true);
320 $this->form->addItem($cb);
323 $sh->setTitle($lng->txt(
"adve_text_content_features"));
324 $this->form->addItem($sh);
328 $this->form->setTitle($lng->txt(
"adve_text_content_features"));
332 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
334 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
336 foreach ($buttons as $b =>
$t)
339 $cb =
new ilCheckboxInputGUI(str_replace(
":",
"", $this->lng->txt(
"cont_text_".$b)),
"active_".$b);
341 $this->form->addItem($cb);
345 $this->form->addCommandButton(
"savePageEditorSettings", $lng->txt(
"save"));
347 $this->form->setFormAction($this->ctrl->getFormAction($this));
360 if ($this->form->checkInput())
362 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
363 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
365 foreach ($buttons as $b =>
$t)
368 $this->form->getInput(
"active_".$b));
371 if (
$_GET[
"grp"] ==
"rep")
373 $ilSetting->set(
"enable_cat_page_edit", (
int)
$_POST[
"cat_page_edit"]);
379 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
380 $ilCtrl->redirect($this,
"showPageEditorSettings");
388 global
$tpl, $ilTabs;
390 $this->addPageEditorSettingsSubTabs();
391 $ilTabs->activateTab(
"adve_page_editor_settings");
394 $tpl->setContent($form->getHTML());
404 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
411 $cb->
setInfo($this->lng->txt(
"adve_use_physical_info"));
412 $cb->setChecked($aset->get(
"use_physical"));
415 $form->addCommandButton(
"saveGeneralPageSettings", $lng->txt(
"save"));
417 $form->setTitle($lng->txt(
"adve_pe_general"));
418 $form->setFormAction($ilCtrl->getFormAction($this));
431 if ($form->checkInput())
434 $aset->set(
"use_physical",
$_POST[
"use_physical"]);
437 $ilCtrl->redirect($this,
"showGeneralPageEditorSettings");
447 if ($ilCtrl->getNextClass() !=
"ilpermissiongui" &&
448 !in_array($ilCtrl->getCmd(), array(
"showPageEditorSettings",
449 "showGeneralPageEditorSettings",
"",
"view")))
451 $tabs_gui->addSubTabTarget(
"adve_general_settings",
452 $this->ctrl->getLinkTarget($this,
"settings"),
453 array(
"settings",
"saveSettings"),
455 $tabs_gui->addSubTabTarget(
"adve_assessment_settings",
456 $this->ctrl->getLinkTarget($this,
"assessment"),
457 array(
"assessment",
"saveAssessmentSettings"),
459 $tabs_gui->addSubTabTarget(
"adve_survey_settings",
460 $this->ctrl->getLinkTarget($this,
"survey"),
461 array(
"survey",
"saveSurveySettings"),
467 $tabs_gui->addSubTabTarget(
"adve_frm_post_settings",
468 $this->ctrl->getLinkTarget($this,
"frmPost"),
469 array(
"frmPost",
"saveFrmPostSettings"),
480 $this->
object->_setUsedHTMLTags((array)
$_POST[
'html_tags'],
'frm_post');
487 $this->ctrl->redirect($this,
'frmPost');
492 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_frm_post.html");
494 $alltags =& $this->
object->getHTMLTags();
495 $usedtags =& $this->
object->_getUsedHTMLTags(
"frm_post");
496 foreach ($alltags as $tag)
498 $this->tpl->setCurrentBlock(
"html_tag_row");
499 $this->tpl->setVariable(
"HTML_TAG", $tag);
500 if (is_array($usedtags))
502 if (in_array($tag, $usedtags))
504 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
507 $this->tpl->parseCurrentBlock();
510 $this->tpl->setCurrentBlock(
"adm_content");
511 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
512 $this->tpl->setVariable(
"TXT_FRM_POST_SETTINGS", $this->lng->txt(
"advanced_editing_frm_post_settings"));
513 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
514 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
516 $this->tpl->parseCurrentBlock();
527 $ilTabs->addSubTabTarget(
"adve_pe_general",
528 $ilCtrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
529 array(
"showGeneralPageEditorSettings",
"",
"view"));
531 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
534 foreach ($grps as $g => $types)
536 $ilCtrl->setParameter($this,
"grp", $g);
537 $ilTabs->addSubTabTarget(
"adve_grp_".$g,
538 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
539 array(
"showPageEditorSettings"));
541 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
554 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
556 $tabs_gui->addTarget(
"adve_page_editor_settings",
557 $this->ctrl->getLinkTarget($this,
"showGeneralPageEditorSettings"),
558 array(
"showPageEditorSettings",
"",
"view"));
560 $tabs_gui->addTarget(
"adve_rte_settings",
561 $this->ctrl->getLinkTarget($this,
"settings"),
562 array(
"settings",
"assessment",
"survey",
"learningModule",
566 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
568 $tabs_gui->addTarget(
"perm_settings",
569 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');