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);
105 $this->ctrl->redirect($this);
118 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing.html");
120 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
122 $this->tpl->setCurrentBlock(
"save");
123 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
124 $this->tpl->parseCurrentBlock();
126 $this->tpl->setCurrentBlock(
"adm_content");
127 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
128 $this->tpl->setVariable(
"TXT_ADVANCED_EDITING_SETTINGS", $this->lng->txt(
"advanced_editing_settings"));
129 $this->tpl->setVariable(
"TXT_ALLOW_JAVASCRIPT_EDITOR", $this->lng->txt(
"advanced_editing_allow_javascript_editor"));
130 $this->tpl->setVariable(
"NO_RTE_EDITOR", $this->lng->txt(
"advanced_editing_no_rte"));
131 $this->tpl->setVariable(
"TINY_MCE_EDITOR", $this->lng->txt(
"advanced_editing_tinymce"));
132 $editor = $this->
object->_getRichTextEditor();
136 $this->tpl->setVariable(
"SELECTED_TINY_MCE_EDITOR",
" selected=\"selected\"");
140 $this->tpl->parseCurrentBlock();
150 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_assessment.html");
152 $alltags =& $this->
object->getHTMLTags();
153 $usedtags =& $this->
object->_getUsedHTMLTags(
"assessment");
154 foreach ($alltags as $tag)
156 $this->tpl->setCurrentBlock(
"html_tag_row");
157 $this->tpl->setVariable(
"HTML_TAG", $tag);
158 if (is_array($usedtags))
160 if (in_array($tag, $usedtags))
162 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
165 $this->tpl->parseCurrentBlock();
168 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
170 $this->tpl->setCurrentBlock(
"save");
171 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
172 $this->tpl->parseCurrentBlock();
175 $this->tpl->setCurrentBlock(
"adm_content");
176 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
177 $this->tpl->setVariable(
"TXT_ASSESSMENT_SETTINGS", $this->lng->txt(
"advanced_editing_assessment_settings"));
178 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
180 $this->tpl->parseCurrentBlock();
191 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_survey.html");
193 $alltags =& $this->
object->getHTMLTags();
194 $usedtags =& $this->
object->_getUsedHTMLTags(
"survey");
195 foreach ($alltags as $tag)
197 $this->tpl->setCurrentBlock(
"html_tag_row");
198 $this->tpl->setVariable(
"HTML_TAG", $tag);
199 if (is_array($usedtags))
201 if (in_array($tag, $usedtags))
203 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
206 $this->tpl->parseCurrentBlock();
209 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
211 $this->tpl->setCurrentBlock(
"save");
212 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
213 $this->tpl->parseCurrentBlock();
216 $this->tpl->setCurrentBlock(
"adm_content");
217 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
218 $this->tpl->setVariable(
"TXT_SURVEY_SETTINGS", $this->lng->txt(
"advanced_editing_survey_settings"));
219 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
221 $this->tpl->parseCurrentBlock();
231 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_learning_module.html");
233 $this->tpl->setCurrentBlock(
"adm_content");
234 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
235 $this->tpl->setVariable(
"TXT_LM_SETTINGS", $this->lng->txt(
"advanced_editing_lm_settings"));
236 $this->tpl->setVariable(
"TXT_LM_JS_EDITING", $this->lng->txt(
"advanced_editing_lm_js_editing"));
237 $this->tpl->setVariable(
"TXT_LM_JS_EDITING_DESC", $this->lng->txt(
"advanced_editing_lm_js_editing_desc"));
238 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
240 if ($ilSetting->get(
"enable_js_edit", 1))
242 $this->tpl->setVariable(
"JS_EDIT",
"checked=\"checked\"");
245 $this->tpl->parseCurrentBlock();
256 $ilSetting->set(
"enable_js_edit",
$_POST[
"js_edit"]);
257 $this->ctrl->redirect($this,
'learningmodule');
267 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
271 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"advanced_editing_rep_page_editing"),
"cat_page_edit");
272 $cb->
setInfo($this->lng->txt(
"advanced_editing_rep_page_editing_desc"));
273 if ($ilSetting->get(
"enable_cat_page_edit"))
275 $cb->setChecked(
true);
277 $this->form->addItem($cb);
279 $this->form->addCommandButton(
"saveRepositorySettings", $lng->txt(
"save"));
281 $this->form->setTitle($lng->txt(
"adve_rep_settings"));
282 $this->form->setFormAction($ilCtrl->getFormAction($this));
284 $tpl->setContent($this->form->getHTML());
287 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_category.html");
288 $this->tpl->setCurrentBlock(
"adm_content");
289 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
290 $this->tpl->setVariable(
"TXT_CAT_SETTINGS", $this->lng->txt(
"adve_cat_settings"));
291 $this->tpl->setVariable(
"TXT_CAT_PAGE_EDITING", $this->lng->txt(
"advanced_editing_cat_page_editing"));
292 $this->tpl->setVariable(
"TXT_CAT_PAGE_EDITING_DESC", $this->lng->txt(
"advanced_editing_cat_page_editing_desc"));
293 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
295 $this->tpl->setVariable(
"TXT_CAT_PAGES",
296 $this->lng->txt(
"cat_pages"));
297 $this->tpl->setVariable(
"TXT_UNDO_LAST_CAT_CHANGES",
298 $this->lng->txt(
"cat_undo_last_page_changes"));
299 $this->tpl->setVariable(
"TXT_CLEAR_CAT_PAGE",
300 $this->lng->txt(
"cat_clear_page"));
302 $root_node = $tree->getNodeData(ROOT_FOLDER_ID);
303 $nodes = $tree->getSubTree($root_node,
true,
"cat");
304 $cats[0] = $this->lng->txt(
"please_select");
305 $cats[$root_node[
"ref_id"]] =
"- ".$this->lng->txt(
"repository");
306 foreach($nodes as $node)
308 $cats[$node[
"ref_id"]] = str_repeat(
" ",($node[
"depth"]-1)).
"- ".$node[
"title"];
310 $this->tpl->setVariable(
"SELECT_CATEGORY",
313 if ($ilSetting->get(
"enable_cat_page_edit"))
315 $this->tpl->setVariable(
"CAT_PAGE_EDIT",
"checked=\"checked\"");
318 $this->tpl->parseCurrentBlock();
329 $ilSetting->set(
"enable_cat_page_edit",
$_POST[
"cat_page_edit"]);
330 $this->ctrl->redirect($this,
'repositorySettings');
392 $this->
object->_setRichTextEditor(
$_POST[
"rte"]);
395 $this->ctrl->redirect($this,
'settings');
402 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"assessment");
403 $this->ctrl->redirect($this,
'assessment');
410 $this->
object->_setUsedHTMLTags(
$_POST[
"html_tags"],
"survey");
411 $this->ctrl->redirect($this,
'survey');
426 $this->addPageEditorSettingsSubTabs();
428 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
431 $this->cgrp =
$_GET[
"grp"];
432 if ($this->cgrp ==
"")
434 $this->cgrp = key($grps);
437 $ilCtrl->setParameter($this,
"grp", $this->cgrp);
438 $ilTabs->setSubTabActive(
"adve_grp_".$this->cgrp);
441 $tpl->setContent($this->form->getHtml());
453 $lng->loadLanguageModule(
"content");
455 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
458 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
460 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
462 foreach ($buttons as $b =>
$t)
465 $cb =
new ilCheckboxInputGUI(str_replace(
":",
"", $this->lng->txt(
"cont_text_".$b)),
"active_".$b);
467 $this->form->addItem($cb);
471 $this->form->addCommandButton(
"savePageEditorSettings", $lng->txt(
"save"));
473 $this->form->setTitle($lng->txt(
"adve_text_content_features"));
474 $this->form->setFormAction($this->ctrl->getFormAction($this));
487 if ($this->form->checkInput())
489 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
490 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
492 foreach ($buttons as $b =>
$t)
495 $this->form->getInput(
"active_".$b));
500 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
501 $ilCtrl->redirect($this,
"showPageEditorSettings");
511 if ($ilCtrl->getNextClass() !=
"ilpermissiongui" &&
512 $ilCtrl->getCmd() !=
"showPageEditorSettings")
514 $tabs_gui->addSubTabTarget(
"adve_general_settings",
515 $this->ctrl->getLinkTarget($this,
"settings"),
516 array(
"",
"view",
"settings",
"saveSettings"),
518 $tabs_gui->addSubTabTarget(
"adve_assessment_settings",
519 $this->ctrl->getLinkTarget($this,
"assessment"),
520 array(
"assessment",
"saveAssessmentSettings"),
522 $tabs_gui->addSubTabTarget(
"adve_survey_settings",
523 $this->ctrl->getLinkTarget($this,
"survey"),
524 array(
"survey",
"saveSurveySettings"),
526 $tabs_gui->addSubTabTarget(
"adve_rep_settings",
527 $this->ctrl->getLinkTarget($this,
"repositorySettings"),
528 array(
"repositorySettings"),
530 $tabs_gui->addSubTabTarget(
"adve_lm_settings",
531 $this->ctrl->getLinkTarget($this,
"learningModule"),
532 array(
"learningModule",
"saveLearningModuleSettings"),
534 $tabs_gui->addSubTabTarget(
"adve_frm_post_settings",
535 $this->ctrl->getLinkTarget($this,
"frmPost"),
536 array(
"frmPost",
"saveFrmPostSettings"),
547 $this->
object->_setUsedHTMLTags((array)
$_POST[
'html_tags'],
'frm_post');
554 $this->ctrl->redirect($this,
'frmPost');
559 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.advanced_editing_frm_post.html");
561 $alltags =& $this->
object->getHTMLTags();
562 $usedtags =& $this->
object->_getUsedHTMLTags(
"frm_post");
563 foreach ($alltags as $tag)
565 $this->tpl->setCurrentBlock(
"html_tag_row");
566 $this->tpl->setVariable(
"HTML_TAG", $tag);
567 if (is_array($usedtags))
569 if (in_array($tag, $usedtags))
571 $this->tpl->setVariable(
"HTML_TAG_SELECTED",
" selected=\"selected\"");
574 $this->tpl->parseCurrentBlock();
577 $this->tpl->setCurrentBlock(
"adm_content");
578 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
579 $this->tpl->setVariable(
"TXT_FRM_POST_SETTINGS", $this->lng->txt(
"advanced_editing_frm_post_settings"));
580 $this->tpl->setVariable(
"TXT_ALLOW_HTML_TAGS", $this->lng->txt(
"advanced_editing_allow_html_tags"));
581 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
583 $this->tpl->parseCurrentBlock();
594 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
597 foreach ($grps as $g => $types)
599 $ilCtrl->setParameter($this,
"grp", $g);
600 $ilTabs->addSubTabTarget(
"adve_grp_".$g,
601 $ilCtrl->getLinkTarget($this,
"showPageEditorSettings"),
602 array(
"showPageEditorSettings"));
604 $ilCtrl->setParameter($this,
"grp",
$_GET[
"grp"]);
617 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
619 $tabs_gui->addTarget(
"adve_rte_settings",
620 $this->ctrl->getLinkTarget($this,
"settings"),
621 array(
"settings",
"",
"view",
"assessment",
"survey",
"learningModule",
622 "category"),
"",
"");
624 $tabs_gui->addTarget(
"adve_page_editor_settings",
625 $this->ctrl->getLinkTarget($this,
"showPageEditorSettings"),
626 array(
"showPageEditorSettings"));
629 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
631 $tabs_gui->addTarget(
"perm_settings",
632 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');