35 include_once
"./classes/class.ilObjectGUI.php";
47 global $rbacsystem,
$lng;
50 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
51 $this->lng->loadLanguageModule(
'adve');
52 $this->lng->loadLanguageModule(
'meta');
54 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
56 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read_adve"),$this->ilias->error_obj->WARNING);
62 $next_class = $this->ctrl->getNextClass($this);
63 $cmd = $this->ctrl->getCmd();
69 case 'ilpermissiongui':
70 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
72 $ret =& $this->ctrl->forwardCommand($perm_gui);
108 $this->ctrl->redirect($this);
121 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing.html");
123 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
125 $this->tpl->setCurrentBlock(
"save");
126 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
127 $this->tpl->parseCurrentBlock();
129 $this->tpl->setCurrentBlock(
"adm_content");
130 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
131 $this->tpl->setVariable(
"TXT_ADVANCED_EDITING_SETTINGS", $this->lng->txt(
"advanced_editing_settings"));
132 $this->tpl->setVariable(
"TXT_ALLOW_JAVASCRIPT_EDITOR", $this->lng->txt(
"advanced_editing_allow_javascript_editor"));
133 $this->tpl->setVariable(
"NO_RTE_EDITOR", $this->lng->txt(
"advanced_editing_no_rte"));
134 $this->tpl->setVariable(
"TINY_MCE_EDITOR", $this->lng->txt(
"advanced_editing_tinymce"));
135 $editor = $this->
object->_getRichTextEditor();
139 $this->tpl->setVariable(
"SELECTED_TINY_MCE_EDITOR",
" selected=\"selected\"");
143 $this->tpl->parseCurrentBlock();
153 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_assessment.html");
155 $alltags =& $this->
object->getHTMLTags();
156 $usedtags =& $this->
object->_getUsedHTMLTags(
"assessment");
157 foreach ($alltags as $tag)
159 $this->tpl->setCurrentBlock(
"html_tag_row");
160 $this->tpl->setVariable(
"HTML_TAG", $tag);
161 if (is_array($usedtags))
163 if (in_array($tag, $usedtags))
165 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
168 $this->tpl->parseCurrentBlock();
171 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
173 $this->tpl->setCurrentBlock(
"save");
174 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
175 $this->tpl->parseCurrentBlock();
178 $this->tpl->setCurrentBlock(
"adm_content");
179 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
180 $this->tpl->setVariable(
"TXT_ASSESSMENT_SETTINGS", $this->lng->txt(
"advanced_editing_assessment_settings"));
181 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
183 $this->tpl->parseCurrentBlock();
194 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_survey.html");
196 $alltags =& $this->
object->getHTMLTags();
197 $usedtags =& $this->
object->_getUsedHTMLTags(
"survey");
198 foreach ($alltags as $tag)
200 $this->tpl->setCurrentBlock(
"html_tag_row");
201 $this->tpl->setVariable(
"HTML_TAG", $tag);
202 if (is_array($usedtags))
204 if (in_array($tag, $usedtags))
206 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
209 $this->tpl->parseCurrentBlock();
212 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
214 $this->tpl->setCurrentBlock(
"save");
215 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
216 $this->tpl->parseCurrentBlock();
219 $this->tpl->setCurrentBlock(
"adm_content");
220 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
221 $this->tpl->setVariable(
"TXT_SURVEY_SETTINGS", $this->lng->txt(
"advanced_editing_survey_settings"));
222 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
224 $this->tpl->parseCurrentBlock();
234 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_learning_module.html");
236 $this->tpl->setCurrentBlock(
"adm_content");
237 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
238 $this->tpl->setVariable(
"TXT_LM_SETTINGS", $this->lng->txt(
"advanced_editing_lm_settings"));
239 $this->tpl->setVariable(
"TXT_LM_JS_EDITING", $this->lng->txt(
"advanced_editing_lm_js_editing"));
240 $this->tpl->setVariable(
"TXT_LM_JS_EDITING_DESC", $this->lng->txt(
"advanced_editing_lm_js_editing_desc"));
241 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
243 if ($ilSetting->get(
"enable_js_edit", 1))
245 $this->tpl->setVariable(
"JS_EDIT",
"checked=\"checked\"");
248 $this->tpl->parseCurrentBlock();
259 $ilSetting->set(
"enable_js_edit",
$_POST[
"js_edit"]);
260 $this->ctrl->redirect($this,
'learningmodule');
270 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
274 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
275 $cb->
setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
276 if ($ilSetting->get(
"enable_cat_page_edit"))
278 $cb->setChecked(
true);
280 $this->form->addItem($cb);
282 $this->form->addCommandButton(
"saveRepositorySettings", $lng->txt(
"save"));
284 $this->form->setTitle($lng->txt(
"adve_rep_settings"));
285 $this->form->setFormAction($ilCtrl->getFormAction($this));
287 $tpl->setContent($this->form->getHTML());
290 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_category.html");
291 $this->tpl->setCurrentBlock(
"adm_content");
292 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
293 $this->tpl->setVariable(
"TXT_CAT_SETTINGS", $this->lng->txt(
"adve_cat_settings"));
294 $this->tpl->setVariable(
"TXT_CAT_PAGE_EDITING", $this->lng->txt(
"advanced_editing_cat_page_editing"));
295 $this->tpl->setVariable(
"TXT_CAT_PAGE_EDITING_DESC", $this->lng->txt(
"advanced_editing_cat_page_editing_desc"));
296 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
298 $this->tpl->setVariable(
"TXT_CAT_PAGES",
299 $this->lng->txt(
"cat_pages"));
300 $this->tpl->setVariable(
"TXT_UNDO_LAST_CAT_CHANGES",
301 $this->lng->txt(
"cat_undo_last_page_changes"));
302 $this->tpl->setVariable(
"TXT_CLEAR_CAT_PAGE",
303 $this->lng->txt(
"cat_clear_page"));
305 $root_node = $tree->getNodeData(ROOT_FOLDER_ID);
306 $nodes = $tree->getSubTree($root_node,
true,
"cat");
307 $cats[0] = $this->lng->txt(
"please_select");
308 $cats[$root_node[
"ref_id"]] =
"- ".$this->lng->txt(
"repository");
309 foreach($nodes as $node)
311 $cats[$node[
"ref_id"]] = str_repeat(
" ",($node[
"depth"]-1)).
"- ".$node[
"title"];
313 $this->tpl->setVariable(
"SELECT_CATEGORY",
316 if ($ilSetting->get(
"enable_cat_page_edit"))
318 $this->tpl->setVariable(
"CAT_PAGE_EDIT",
"checked=\"checked\"");
321 $this->tpl->parseCurrentBlock();
332 $ilSetting->set(
"enable_cat_page_edit",
$_POST[
"cat_page_edit"]);
333 $this->ctrl->redirect($this,
'repositorySettings');
395 $this->
object->_setRichTextEditor(
$_POST[
"rte"]);
398 $this->ctrl->redirect($this,
'settings');
405 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"assessment");
406 $this->ctrl->redirect($this,
'assessment');
413 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"survey");
414 $this->ctrl->redirect($this,
'survey');
429 $this->addPageEditorSettingsSubTabs();
431 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
434 $this->cgrp =
$_GET[
"grp"];
435 if ($this->cgrp ==
"")
437 $this->cgrp = key($grps);
440 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
441 $ilTabs->setSubTabActive(
"adve_grp_".$this->cgrp);
444 $tpl->setContent($this->form->getHtml());
456 $lng->loadLanguageModule(
"content");
458 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
461 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
463 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
465 foreach ($buttons as $b =>
$t)
468 $cb =
new ilCheckboxInputGUI(str_replace(
":",
"", $this->lng->txt(
"cont_text_".$b)),
"active_".$b);
470 $this->form->addItem($cb);
474 $this->form->addCommandButton(
"savePageEditorSettings", $lng->txt(
"save"));
476 $this->form->setTitle($lng->txt(
"adve_text_content_features"));
477 $this->form->setFormAction($this->ctrl->getFormAction($this));
490 if ($this->form->checkInput())
492 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
493 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
495 foreach ($buttons as $b =>
$t)
498 $this->form->getInput(
"active_".$b));
503 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
504 $ilCtrl->redirect($this,
"showPageEditorSettings");
514 if ($ilCtrl->getNextClass() !=
"ilpermissiongui" &&
515 $ilCtrl->getCmd() !=
"showPageEditorSettings")
517 $tabs_gui->addSubTabTarget(
"adve_general_settings",
518 $this->ctrl->getLinkTarget($this,
"settings"),
519 array(
"",
"view",
"settings",
"saveSettings"),
521 $tabs_gui->addSubTabTarget(
"adve_assessment_settings",
522 $this->ctrl->getLinkTarget($this,
"assessment"),
523 array(
"assessment",
"saveAssessmentSettings"),
525 $tabs_gui->addSubTabTarget(
"adve_survey_settings",
526 $this->ctrl->getLinkTarget($this,
"survey"),
527 array(
"survey",
"saveSurveySettings"),
529 $tabs_gui->addSubTabTarget(
"adve_rep_settings",
530 $this->ctrl->getLinkTarget($this,
"repositorySettings"),
531 array(
"repositorySettings"),
533 $tabs_gui->addSubTabTarget(
"adve_lm_settings",
534 $this->ctrl->getLinkTarget($this,
"learningModule"),
535 array(
"learningModule",
"saveLearningModuleSettings"),
537 $tabs_gui->addSubTabTarget(
"adve_frm_post_settings",
538 $this->ctrl->getLinkTarget($this,
"frmPost"),
539 array(
"frmPost",
"saveFrmPostSettings"),
550 $this->
object->_setUsedHTMLTags((array)
$_POST[
'html_tags'],
'frm_post');
557 $this->ctrl->redirect($this,
'frmPost');
562 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_frm_post.html");
564 $alltags =& $this->
object->getHTMLTags();
565 $usedtags =& $this->
object->_getUsedHTMLTags(
"frm_post");
566 foreach ($alltags as $tag)
568 $this->tpl->setCurrentBlock(
"html_tag_row");
569 $this->tpl->setVariable(
"HTML_TAG", $tag);
570 if (is_array($usedtags))
572 if (in_array($tag, $usedtags))
574 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
577 $this->tpl->parseCurrentBlock();
580 $this->tpl->setCurrentBlock(
"adm_content");
581 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
582 $this->tpl->setVariable(
"TXT_FRM_POST_SETTINGS", $this->lng->txt(
"advanced_editing_frm_post_settings"));
583 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
584 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
586 $this->tpl->parseCurrentBlock();
597 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
600 foreach ($grps as $g => $types)
602 $ilCtrl->setParameter($this,
"grp", $g);
603 $ilTabs->addSubTabTarget(
"adve_grp_".$g,
604 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
605 array(
"showPageEditorSettings"));
607 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
620 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
622 $tabs_gui->addTarget(
"adve_rte_settings",
623 $this->ctrl->getLinkTarget($this,
"settings"),
624 array(
"settings",
"",
"view",
"assessment",
"survey",
"learningModule",
625 "category"),
"",
"");
627 $tabs_gui->addTarget(
"adve_page_editor_settings",
628 $this->ctrl->getLinkTarget($this,
"showPageEditorSettings"),
629 array(
"showPageEditorSettings"));
632 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
634 $tabs_gui->addTarget(
"perm_settings",
635 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');