4 define (
"IL_PAGE_PRESENTATION",
"presentation");
5 define (
"IL_PAGE_EDIT",
"edit");
6 define (
"IL_PAGE_PREVIEW",
"preview");
7 define (
"IL_PAGE_OFFLINE",
"offline");
8 define (
"IL_PAGE_PRINT",
"print");
10 include_once (
"./Services/COPage/classes/class.ilPageEditorGUI.php");
11 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
12 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
13 include_once(
"./Services/Utilities/classes/class.ilDOMUtil.php");
79 $a_prevent_get_id =
false, $a_lang =
"")
85 if ($a_old_nr == 0 && !$a_prevent_get_id &&
$_GET[
"old_nr"] > 0)
87 $a_old_nr =
$_GET[
"old_nr"];
91 if ($a_lang ==
"" &&
$_GET[
"transl"] !=
"")
113 $this->output2template =
true;
114 $this->question_xml =
"";
115 $this->question_html =
"";
116 $this->tabs_gui =& $ilTabs;
118 $this->template_output_var =
"PAGE_CONTENT";
119 $this->citation =
false;
120 $this->change_comments =
false;
121 $this->page_back_title = $this->lng->txt(
"page");
122 $lng->loadLanguageModule(
"content");
126 $ilCtrl->saveParameter($this,
"transl");
144 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
157 $this->parent_type = $a_val;
197 $this->old_nr = $a_val;
207 return $this->old_nr;
217 $this->language = $a_val;
227 if ($this->language ==
"")
232 return $this->language;
262 $this->page_config = $a_val;
281 $this->bib_id = $a_id;
289 return $this->bib_id ? $this->bib_id : 0;
299 $this->obj = $a_pg_obj;
319 $this->output_mode = $a_mode;
329 $this->output2template = $a_output;
339 $this->presentation_title = $a_title;
349 $this->header = $a_title;
354 return $this->header;
359 $this->link_params = $l_params;
369 $this->link_frame = $l_frame;
374 return $this->link_frame;
379 $this->link_xml = $link_xml;
380 $this->link_xml_set =
true;
385 return $this->link_xml;
390 $this->question_xml = $question_xml;
400 return $this->question_xml;
410 $this->target_var = $a_variable;
420 $this->template_output_var = $a_value;
430 $this->sourcecode_download_script = $script_name;
439 $this->citation = $a_enabled;
449 $this->locator =& $a_locator;
454 $this->tabs_gui = $a_tabs;
459 $this->page_back_title = $a_title;
465 $this->file_download_link = $a_download_link;
470 return $this->file_download_link;
476 $this->fullscreen_link = $a_fullscreen_link;
481 return $this->fullscreen_link;
486 $this->int_link_return = $a_return;
491 $this->change_comments = $a_enabled;
501 $this->notes_enabled = $a_enabled;
502 $this->notes_parent_id = $a_parent_id;
507 return $this->notes_enabled;
516 $this->offline_directory = $offdir;
525 return $this->offline_directory;
537 $this->view_page_link = $a_link;
538 $this->view_page_target = $a_target;
546 return $this->view_page_link;
554 return $this->view_page_target;
559 $this->act_obj =& $a_obj;
560 $this->act_meth = $a_meth;
570 $this->enabled_news = $a_enabled;
571 $this->news_obj_id = $a_news_obj_id;
572 $this->news_obj_type = $a_news_obj_type;
582 return $this->enabled_news;
590 $this->tab_hook = array(
"obj" => $a_object,
"func" => $a_function);
600 $this->editpreview = $a_editpreview;
620 $this->tabs_enabled = $a_enabledtabs;
640 $this->enabledpagefocus = $a_enabledpagefocus;
650 return $this->enabledpagefocus;
661 $this->exp_frame = $a_exp_frame;
662 $this->exp_id = $a_exp_id;
663 $this->exp_target_script = $a_exp_target_script;
673 $this->prependinghtml = $a_prependinghtml;
683 return $this->prependinghtml;
693 $this->enableediting = $a_enableediting;
713 $this->rawpagecontent = $a_rawpagecontent;
733 $this->styleid = $a_styleid;
743 return $this->styleid;
753 $this->compare_mode = $a_val;
773 $this->abstract_only = $a_val;
793 $this->render_page_container = $a_val;
816 $a_observer_obj = NULL, $a_observer_func =
"")
818 $this->use_meta_data =
true;
819 $this->meta_data_rep_obj_id = $a_rep_obj_id;
820 $this->meta_data_sub_obj_id = $a_sub_obj_id;
821 $this->meta_data_type = $a_type;
822 $this->meta_data_observer_obj = $a_observer_obj;
823 $this->meta_data_observer_func = $a_observer_func;
838 $file_download_link = $ilCtrl->getLinkTarget($this,
"downloadFile");
840 return $file_download_link;
855 $fullscreen_link = $ilCtrl->getLinkTarget($this,
"displayMediaFullscreen",
"",
false,
false);
857 return $fullscreen_link;
870 if ($this->sourcecode_download_script ==
"" && $this->
getOutputMode() !=
"offline")
872 $l = $ilCtrl->getLinkTarget($this,
"");
885 global $ilPluginAdmin;
889 foreach ($pl_names as $pl_name)
892 "COPage",
"pgcp", $pl_name);
893 if ($plugin->isValidParentType($this->getPageObject()->getParentType()))
895 $xml.=
'<ComponentPlugin Name="'.$plugin->getPluginName().
902 $xml =
"<ComponentPlugins>".$xml.
"</ComponentPlugins>";
915 $next_class = $this->ctrl->getNextClass($this);
917 $cmd = $this->ctrl->getCmd();
922 $ilCtrl->setReturn($this,
"edit");
926 case 'ilmdeditorgui':
928 $ilTabs->setTabActive(
"meta_data");
929 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
931 $this->meta_data_sub_obj_id, $this->meta_data_type);
932 if (is_object($this->meta_data_observer_obj))
934 $md_gui->addObserver($this->meta_data_observer_obj,
935 $this->meta_data_observer_func,
"General");
937 $this->ctrl->forwardCommand($md_gui);
940 case "ileditclipboardgui":
944 $clip_gui->setPageBackTitle($this->page_back_title);
946 $ret =& $this->ctrl->forwardCommand($clip_gui);
951 switch(
$_GET[
"notes_mode"])
954 $html = $this->
edit();
955 $ilTabs->setTabActive(
"edit");
960 case 'ilpublicuserprofilegui':
961 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
963 $ret = $this->ctrl->forwardCommand($profile_gui);
966 case "ilpageeditorgui":
970 $ilCtrl->redirect($this,
"preview");
973 $page_editor->setLocator($this->locator);
974 $page_editor->setHeader($this->
getHeader());
975 $page_editor->setPageBackTitle($this->page_back_title);
976 $page_editor->setIntLinkReturn($this->int_link_return);
978 $ret =& $this->ctrl->forwardCommand($page_editor);
981 case 'ilnewsitemgui':
982 include_once(
"./Services/News/classes/class.ilNewsItemGUI.php");
984 $news_item_gui->setEnableEdit(
true);
985 $news_item_gui->setContextObjId($this->news_obj_id);
986 $news_item_gui->setContextObjType($this->news_obj_type);
987 $news_item_gui->setContextSubObjId($this->obj->getId());
988 $news_item_gui->setContextSubObjType(
"pg");
990 $ret = $ilCtrl->forwardCommand($news_item_gui);
994 $ret = $this->ctrl->forwardCommand($profile_gui);
997 case "ilpropertyformgui":
998 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1000 $this->ctrl->forwardCommand($form);
1003 case "ilinternallinkgui":
1004 $this->lng->loadLanguageModule(
"content");
1005 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
1009 $link_gui->filterLinkType(
"PageObject_FAQ");
1010 $link_gui->filterLinkType(
"GlossaryItem");
1011 $link_gui->filterLinkType(
"Media_Media");
1012 $link_gui->filterLinkType(
"Media_FAQ");
1014 $link_gui->setFilterWhiteList(
true);
1015 $link_gui->setMode(
"asynch");
1016 $ilCtrl->forwardCommand($link_gui);
1019 case "ilquestioneditgui":
1021 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
1025 $edit_gui->setSelfAssessmentEditingMode(
true);
1026 $ret = $ilCtrl->forwardCommand($edit_gui);
1027 $this->tpl->setContent(
$ret);
1030 case 'ilassquestionfeedbackeditinggui':
1038 $lng->loadLanguageModule(
"assessment");
1041 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
1042 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
1044 $questionGUI->object->setObjId(0);
1045 $questionGUI->object->setSelfAssessmentEditingMode(
true);
1046 $questionGUI->object->setPreventRteUsage($this->
getPageConfig()->getPreventRteUsage());
1049 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
1051 $ilCtrl->forwardCommand($gui);
1065 $cmd = $this->ctrl->getCmd(
"preview");
1082 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
1084 $ilTabs->clearTargets();
1086 $ilTabs->setBackTarget($lng->txt(
"back"),
1087 $ilCtrl->getLinkTarget($this,
"edit"));
1089 $ilCtrl->setParameterByClass(
"ilquestioneditgui",
"q_id",
$_GET[
"q_id"]);
1090 $ilTabs->addTab(
"question", $lng->txt(
"question"),
1091 $ilCtrl->getLinkTargetByClass(
"ilquestioneditgui",
"editQuestion"));
1093 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
1094 $ilCtrl->setParameterByClass(
"ilAssQuestionFeedbackEditingGUI",
"q_id",
$_GET[
"q_id"]);
1095 $ilTabs->addTab(
"feedback", $lng->txt(
"feedback"),
1098 $ilTabs->activateTab($a_active);
1116 $this->ctrl->redirect($this,
"edit");
1125 $this->ctrl->redirect($this,
"edit");
1136 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1142 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1145 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/COPage/js/ilCOPagePres.js");
1148 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
1151 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1160 $tpl =
new ilTemplate(
"tpl.page_edit_wysiwyg.html",
true,
true,
"Services/COPage");
1164 $tpl->setVariable(
"CLASS_PAGE_TD",
"ilc_Page");
1169 $tpl->setCurrentBlock(
"change_comment");
1170 $tpl->setVariable(
"TXT_ADD_COMMENT", $this->lng->txt(
"cont_add_change_comment"));
1171 $tpl->parseCurrentBlock();
1174 $tpl->setVariable(
"WYSIWYG_ACTION",
1175 $ilCtrl->getFormActionByClass(
"ilpageeditorgui",
"",
"",
true));
1178 $sel_media_mode = ($ilUser->getPref(
"ilPageEditor_MediaMode") ==
"disable")
1181 $sel_html_mode = ($ilUser->getPref(
"ilPageEditor_HTMLMode") ==
"disable")
1184 $sel_js_mode =
"disable";
1194 $tpl->setVariable(
"TXT_CONFIRM_DELETE", $lng->txt(
"cont_confirm_delete"));
1199 $ilTabs->addNonTabbedLink(
"pres_view", $this->lng->txt(
"cont_presentation_view"),
1207 if ($sel_js_mode ==
"enable")
1210 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1214 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/COPage/js/ilcopagecallback.js");
1215 $GLOBALS[
"tpl"]->addJavascript(
"Services/COPage/js/page_editing.js");
1217 include_once
'./Services/Style/classes/class.ilObjStyleSheet.php';
1218 $GLOBALS[
"tpl"]->addOnloadCode(
"var preloader = new Image();
1219 preloader.src = './templates/default/images/loader.svg';
1220 ilCOPage.setContentCss('".
1223 ", ./Services/COPage/css/tiny_extra.css".
1227 $GLOBALS[
"tpl"]->addJavascript(
"Services/COPage/tiny/4_1_5/tinymce.js");
1228 $tpl->touchBlock(
"init_dragging");
1231 $tpl->setVariable(
"IL_TINY_MENU",
1234 $cfg->getEnableInternalLinks(),
1235 $cfg->getEnableWikiLinks(),
1236 $cfg->getEnableKeywords(),
1238 $cfg->getEnableAnchors()
1242 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
1243 $tpl->setCurrentBlock(
"int_link_prep");
1245 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
1246 "",
false,
true,
false)));
1247 $tpl->parseCurrentBlock();
1249 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1251 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/UIComponent/Explorer/js/ilExplorer.js");
1260 $tpl->setCurrentBlock(
"multi_actions");
1261 if ($sel_js_mode ==
"enable")
1263 $tpl->setVariable(
"ONCLICK_DE_ACTIVATE_SELECTED",
'onclick="return ilEditMultiAction(\'activateSelected\');"');
1264 $tpl->setVariable(
"ONCLICK_DELETE_SELECTED",
'onclick="return ilEditMultiAction(\'deleteSelected\');"');
1265 $tpl->setVariable(
"ONCLICK_ASSIGN_CHARACTERISTIC",
'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
1266 $tpl->setVariable(
"ONCLICK_COPY_SELECTED",
'onclick="return ilEditMultiAction(\'copySelected\');"');
1267 $tpl->setVariable(
"ONCLICK_CUT_SELECTED",
'onclick="return ilEditMultiAction(\'cutSelected\');"');
1268 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
1269 $tpl->setVariable(
"ONCLICK_SELECT_ALL",
'onclick="return ilEditMultiAction(\'selectAll\');"');
1271 $tpl->setVariable(
"TXT_DE_ACTIVATE_SELECTED", $this->lng->txt(
"cont_ed_enable"));
1272 $tpl->setVariable(
"TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt(
"cont_assign_characteristic"));
1273 $tpl->setVariable(
"TXT_DELETE_SELECTED", $this->lng->txt(
"cont_delete_selected"));
1274 $tpl->setVariable(
"TXT_COPY_SELECTED", $this->lng->txt(
"copy"));
1275 $tpl->setVariable(
"TXT_CUT_SELECTED", $this->lng->txt(
"cut"));
1277 $tpl->parseCurrentBlock();
1284 $tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
"Services/COPage");
1287 $tpl->touchBlock(
"page_focus");
1290 include_once(
"./Services/User/classes/class.ilUserUtil.php");
1295 $tpl->touchBlock(
"page_container_1");
1296 $tpl->touchBlock(
"page_container_2");
1297 $tpl->touchBlock(
"page_container_3");
1309 $ilCtrl->setParameter($this,
"history_mode",
"1");
1312 if (is_array($hist_info[
"previous"]))
1314 $tpl->setCurrentBlock(
"previous_rev");
1315 $tpl->setVariable(
"TXT_PREV_REV", $lng->txt(
"cont_previous_rev"));
1316 $ilCtrl->setParameter($this,
"old_nr", $hist_info[
"previous"][
"nr"]);
1317 $tpl->setVariable(
"HREF_PREV",
1318 $ilCtrl->getLinkTarget($this,
"preview"));
1319 $tpl->parseCurrentBlock();
1323 $tpl->setCurrentBlock(
"previous_rev_disabled");
1324 $tpl->setVariable(
"TXT_PREV_REV", $lng->txt(
"cont_previous_rev"));
1325 $tpl->parseCurrentBlock();
1331 $tpl->setCurrentBlock(
"next_rev");
1332 $tpl->setVariable(
"TXT_NEXT_REV", $lng->txt(
"cont_next_rev"));
1333 $ilCtrl->setParameter($this,
"old_nr", $hist_info[
"next"][
"nr"]);
1334 $tpl->setVariable(
"HREF_NEXT",
1335 $ilCtrl->getLinkTarget($this,
"preview"));
1336 $tpl->parseCurrentBlock();
1339 $tpl->setCurrentBlock(
"latest_rev");
1340 $tpl->setVariable(
"TXT_LATEST_REV", $lng->txt(
"cont_latest_rev"));
1341 $ilCtrl->setParameter($this,
"old_nr",
"");
1342 $tpl->setVariable(
"HREF_LATEST",
1343 $ilCtrl->getLinkTarget($this,
"preview"));
1344 $tpl->parseCurrentBlock();
1347 $ilCtrl->setParameter($this,
"history_mode",
"");
1350 if ($c_old_nr > 0 && $ilUser->getId() != ANONYMOUS_USER_ID)
1352 $tpl->setCurrentBlock(
"rollback");
1353 $ilCtrl->setParameter($this,
"old_nr", $c_old_nr);
1354 $tpl->setVariable(
"HREF_ROLLBACK",
1355 $ilCtrl->getLinkTarget($this,
"rollbackConfirmation"));
1356 $ilCtrl->setParameter($this,
"old_nr",
"");
1357 $tpl->setVariable(
"TXT_ROLLBACK",
1358 $lng->txt(
"cont_rollback"));
1359 $tpl->parseCurrentBlock();
1363 $tpl->setCurrentBlock(
"hist_nav");
1364 $tpl->setVariable(
"TXT_REVISION", $lng->txt(
"cont_revision"));
1365 $tpl->setVariable(
"VAL_REVISION_DATE",
1367 $tpl->setVariable(
"VAL_REV_USER",
1369 $tpl->parseCurrentBlock();
1377 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormActionByClass(
"ilpageeditorgui"));
1384 $this->obj->getId(), $this->obj->getLanguage());
1385 $mob_links = array();
1386 foreach($links as $link)
1388 if ($link[
"type"] ==
"mob")
1398 if (count($mob_links) > 0)
1400 $tpl->setCurrentBlock(
"med_link");
1401 $tpl->setVariable(
"TXT_LINKED_MOBS", $this->lng->txt(
"cont_linked_mobs"));
1402 $tpl->setVariable(
"SEL_MED_LINKS",
1404 $tpl->setVariable(
"TXT_EDIT_MEDIA", $this->lng->txt(
"cont_edit_mob"));
1405 $tpl->setVariable(
"TXT_COPY_TO_CLIPBOARD", $this->lng->txt(
"cont_copy_to_clipboard"));
1407 $tpl->parseCurrentBlock();
1411 include_once(
"./Services/COPage/classes/class.ilPCContentInclude.php");
1414 if (count($snippets) > 0)
1416 foreach ($snippets as $s)
1418 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1421 $tpl->setCurrentBlock(
"med_link");
1422 $tpl->setVariable(
"TXT_CONTENT_SNIPPETS_USED", $this->lng->txt(
"cont_snippets_used"));
1423 $tpl->setVariable(
"SEL_SNIPPETS",
1425 $tpl->setVariable(
"TXT_SHOW_INFO", $this->lng->txt(
"cont_show_info"));
1426 $tpl->parseCurrentBlock();
1434 $tpl->setCurrentBlock(
"activation_txt");
1435 $tpl->setVariable(
"TXT_SCHEDULED_ACTIVATION", $lng->txt(
"cont_scheduled_activation"));
1436 $tpl->setVariable(
"SA_FROM",
1440 $tpl->setVariable(
"SA_TO",
1444 $tpl->parseCurrentBlock();
1448 if (
$_GET[
"reloadTree"] ==
"y")
1450 $tpl->setCurrentBlock(
"reload_tree");
1451 if ($this->obj->getParentType() ==
"dbk")
1453 $tpl->setVariable(
"LINK_TREE",
1454 $this->ctrl->getLinkTargetByClass(
"ilobjdlbookgui",
"explorer",
"",
false,
false));
1458 $tpl->setVariable(
"LINK_TREE",
1459 $this->ctrl->getLinkTargetByClass(
"ilobjlearningmodulegui",
"explorer",
"",
false,
false));
1461 $tpl->parseCurrentBlock();
1465 $builded = $this->obj->buildDom();
1472 if (!$this->obj->checkPCIds())
1474 $this->obj->insertPCIds();
1475 $this->obj->update(
true,
true);
1478 $this->obj->addFileSizes();
1479 $this->obj->addHierIDs();
1481 $hids = $this->obj->getHierIds();
1482 $row1_ids = $this->obj->getFirstRowIds();
1483 $col1_ids = $this->obj->getFirstColumnIds();
1484 $litem_ids = $this->obj->getListItemIds();
1485 $fitem_ids = $this->obj->getFileItemIds();
1488 $hids = $this->obj->getHierIds();
1489 foreach($hids as $hid)
1491 $tpl->setCurrentBlock(
"add_dhtml");
1492 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_".$hid);
1493 $tpl->parseCurrentBlock();
1497 foreach($col1_ids as $hid)
1499 $tpl->setCurrentBlock(
"add_dhtml");
1500 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_r".$hid);
1501 $tpl->parseCurrentBlock();
1505 foreach($row1_ids as $hid)
1507 $tpl->setCurrentBlock(
"add_dhtml");
1508 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_c".$hid);
1509 $tpl->parseCurrentBlock();
1513 foreach($litem_ids as $hid)
1515 $tpl->setCurrentBlock(
"add_dhtml");
1516 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_i".$hid);
1517 $tpl->parseCurrentBlock();
1521 foreach($fitem_ids as $hid)
1523 $tpl->setCurrentBlock(
"add_dhtml");
1524 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_i".$hid);
1525 $tpl->parseCurrentBlock();
1530 $this->obj->addFileSizes();
1537 if (!$this->link_xml_set)
1551 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1553 $template_xml = $style->getTemplateXML();
1554 $disable_auto_margins =
"n";
1555 if ($style->lookupStyleSetting(
"disable_auto_margins"))
1557 $disable_auto_margins =
"y";
1564 $content =
"<dummy><PageObject><PageContent><Paragraph>".
1565 $this->obj->getFirstParagraphText().$link_xml.
1566 "</Paragraph></PageContent></PageObject></dummy>";
1570 $content = $this->obj->getXMLFromDom(
false,
true,
true,
1571 $link_xml.$this->getQuestionXML().$template_xml.$this->getComponentPluginsXML());
1575 if($builded !==
true)
1605 $enlarge_path =
"images/enlarge.svg";
1609 ?
"ilc_PrintPageTitle"
1614 $enable_split_new = ($this->obj->getParentType() ==
"lm" ||
1615 $this->obj->getParentType() ==
"dbk")
1621 if (($this->obj->getParentType() ==
"lm" ||
1622 $this->obj->getParentType() ==
"dbk") &&
1624 $this->obj->getId()))
1626 $enable_split_next =
"y";
1630 $enable_split_next =
"n";
1640 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
1652 ? $ilUser->getPref(
"ilPageEditor_MediaMode")
1655 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
1659 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1668 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
1669 $params = array (
'mode' => $this->
getOutputMode(),
'pg_title' => htmlentities($pg_title,ENT_QUOTES,
"UTF-8"),
1670 'enable_placeholder' => $cfg->getEnablePCType(
"PlaceHolder") ?
"y" :
"n",
1671 'pg_id' => $this->obj->getId(),
'pg_title_class' => $pg_title_class,
1672 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path,
1673 'img_col' => $col_path,
1674 'img_row' => $row_path,
1675 'img_item' => $item_path,
1676 'enable_split_new' => $enable_split_new,
1677 'enable_split_next' => $enable_split_next,
1679 'file_download_link' => $file_download_link,
1680 'fullscreen_link' => $fullscreen_link,
1681 'img_path' => $img_path,
1682 'parent_id' => $this->obj->getParentId(),
1684 'encoded_download_script' => urlencode($this->sourcecode_download_script),
1687 'pagebreak' => $this->lng->txt(
'dgl_pagebreak'),
1688 'page' => $this->lng->txt(
'page'),
1689 'citate_page' => $this->lng->txt(
'citate_page'),
1690 'citate_from' => $this->lng->txt(
'citate_from'),
1691 'citate_to' => $this->lng->txt(
'citate_to'),
1692 'citate' => $this->lng->txt(
'citate'),
1693 'enable_rep_objects' => $cfg->getEnablePCType(
"Resources") ?
"y" :
"n",
1694 'enable_login_page' => $cfg->getEnablePCType(
"LoginPageElement") ?
"y" :
"n",
1696 'enable_tabs' => $cfg->getEnablePCType(
"Tabs") ?
"y" :
"n",
1697 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ?
"y" :
"n",
1698 'enable_file_list' => $cfg->getEnablePCType(
"FileList") ?
"y" :
"n",
1699 'enable_content_includes' => $cfg->getEnablePCType(
"ContentInclude") ?
"y" :
"n",
1700 'enable_content_templates' => (count($this->
getPageObject()->getContentTemplates()) > 0) ?
"y" :
"n",
1701 'paste' => $paste ?
"y" :
"n",
1702 'media_mode' => $media_mode,
1703 'javascript' => $sel_js_mode,
1704 'paragraph_plugins' => $paragraph_plugin_string,
1705 'disable_auto_margins' => $disable_auto_margins,
1706 'page_toc' => $cfg->getEnablePageToc() ?
"y" :
"n",
1707 'enable_profile' => $cfg->getEnablePCType(
"Profile") ?
"y" :
"n",
1708 'enable_verification' => $cfg->getEnablePCType(
"Verification") ?
"y" :
"n",
1709 'enable_blog' => $cfg->getEnablePCType(
"Blog") ?
"y" :
"n",
1710 'enable_skills' => $cfg->getEnablePCType(
"Skills") ?
"y" :
"n",
1711 'enable_qover' => $cfg->getEnablePCType(
"QuestionOverview") ?
"y" :
"n",
1712 'enable_consultation_hours' => $cfg->getEnablePCType(
"ConsultationHours") ?
"y" :
"n",
1713 'enable_my_courses' => $cfg->getEnablePCType(
"MyCourses") ?
"y" :
"n",
1714 'enable_amd_page_list' => $cfg->getEnablePCType(
"AMDPageList") ?
"y" :
"n",
1715 'flv_video_player' => $flv_video_player
1717 if($this->link_frame !=
"")
1718 $params[
"pg_frame"] = $this->link_frame;
1725 $params[
"incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
1728 $md5 = md5(serialize($params).$link_xml.$template_xml);
1737 $md5 == $this->obj->getRenderMd5() &&
1738 ($this->obj->getLastChange() < $this->obj->getRenderedTime()) &&
1739 $this->obj->getRenderedTime() !=
"" &&
1740 $this->obj->old_nr == 0)
1743 $output = $this->obj->getRenderedContent();
1747 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
1749 $args = array(
'/_xml' => $content,
'/_xsl' => $xsl );
1753 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", NULL, $args, $params);
1757 && $this->obj->old_nr == 0)
1760 $this->obj->writeRenderedContent($output, $md5);
1772 $ilUser->getPref(
"ilPageEditor_HTMLMode") !=
"disable")
1775 $output = str_replace(
"<",
"<",$output);
1776 $output = str_replace(
">",
">",$output);
1778 $output = str_replace(
"&",
"&", $output);
1803 $output = str_replace(
"\n",
"", $output);
1811 $output =
'<div class="il_editarea_disabled">'.$output.
'</div>';
1815 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
1817 foreach ($defs as $def)
1820 $pc_class = $def[
"pc_class"];
1824 $output = $pc_obj->modifyPageContentPostXsl($output, $this->
getOutputMode());
1827 $js_files = $pc_obj->getJavascriptFiles($this->
getOutputMode());
1828 foreach ($js_files as $js)
1830 $GLOBALS[
"tpl"]->addJavascript($js);
1835 foreach ($css_files as $css)
1841 $onload_code = $pc_obj->getOnloadCode($this->
getOutputMode());
1842 foreach ($onload_code as $code)
1844 $GLOBALS[
"tpl"]->addOnloadCode($code);
1855 if (
$_GET[
"updated_pc_id_str"] !=
"")
1857 echo
$_GET[
"updated_pc_id_str"];
1860 $tpl->setCurrentBlock(
"edit_page");
1861 $tpl->parseCurrentBlock();
1862 echo
$tpl->get(
"edit_page");
1895 while (is_int($start = strpos($output,
"<!--ParStart-->")) &&
1896 is_int($end = strpos($output,
"<!--ParEnd-->", $start)))
1898 $output = substr($output, 0, $start).
1899 str_replace(array(
"{",
"}"), array(
"{",
"}"),
1900 substr($output, $start + 15, $end - ($start + 15))).
1901 substr($output, $end + 13);
1917 return array(
"deactivatePage" => $lng->txt(
"cont_deactivate_page"),
1918 "activatePage" => $lng->txt(
"cont_activate_page"));
1929 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1933 $list->setListTitle($lng->txt(
"actions"));
1934 $list->setId(
"copage_act");
1942 $list->addItem($captions[
"deactivatePage"],
"",
1943 $ilCtrl->getLinkTarget($this,
"deactivatePage"));
1947 $list->addItem($captions[
"activatePage"],
"",
1948 $ilCtrl->getLinkTarget($this,
"activatePage"));
1951 $a_tpl->setVariable(
"PAGE_ACTIONS", $list->getHTML());
1958 $list->addItem($lng->txt(
"cont_initial_attached_content"),
"",
1959 $ilCtrl->getLinkTarget($this,
"initialOpenedContent"));
1970 $a_tpl->setVariable(
"PAGE_ACTIONS", $list->getHTML());
1973 $lng->loadLanguageModule(
"content");
1975 $list->setListTitle($lng->txt(
"cont_edit_mode"));
1976 $list->setId(
"copage_ed_mode");
1979 if ($sel_media_mode ==
"enable")
1981 $ilCtrl->setParameter($this,
"media_mode",
"disable");
1982 $list->addItem($lng->txt(
"cont_deactivate_media"),
"",
1983 $ilCtrl->getLinkTarget($this,
"setEditMode"));
1987 $ilCtrl->setParameter($this,
"media_mode",
"enable");
1988 $list->addItem($lng->txt(
"cont_activate_media"),
"",
1989 $ilCtrl->getLinkTarget($this,
"setEditMode"));
1991 $ilCtrl->setParameter($this,
"media_mode",
"");
1996 if ($sel_html_mode ==
"enable")
1998 $ilCtrl->setParameter($this,
"html_mode",
"disable");
1999 $list->addItem($lng->txt(
"cont_deactivate_html"),
"",
2000 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2004 $ilCtrl->setParameter($this,
"html_mode",
"enable");
2005 $list->addItem($lng->txt(
"cont_activate_html"),
"",
2006 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2009 $ilCtrl->setParameter($this,
"html_mode",
"");
2012 if ($sel_js_mode ==
"enable")
2014 $ilCtrl->setParameter($this,
"js_mode",
"disable");
2015 $list->addItem($lng->txt(
"cont_deactivate_js"),
"",
2016 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2020 $ilCtrl->setParameter($this,
"js_mode",
"enable");
2021 $list->addItem($lng->txt(
"cont_activate_js"),
"",
2022 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2024 $ilCtrl->setParameter($this,
"js_mode",
"");
2026 $a_tpl->setVariable(
"EDIT_MODE", $list->getHTML());
2044 if ($cfg->getMultiLangSupport())
2050 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
2053 if (!$ot->getContentActivated())
2065 $lng->loadLanguageModule(
"meta");
2069 $l = $ot->getMasterLanguage();
2070 $a_list->addItem($lng->txt(
"cont_edit_language_version").
": ".
2071 $lng->txt(
"meta_l_".$l),
"",
2072 $ilCtrl->getLinkTarget($this,
"editMasterLanguage"));
2075 foreach ($ot->getLanguages() as $al =>
$lang)
2078 $al != $ot->getMasterLanguage())
2080 $ilCtrl->setParameter($this,
"totransl", $al);
2081 $a_list->addItem($lng->txt(
"cont_edit_language_version").
": ".
2082 $lng->txt(
"meta_l_".$al),
"",
2083 $ilCtrl->getLinkTarget($this,
"switchToLanguage"));
2084 $ilCtrl->setParameter($this,
"totransl",
$_GET[
"totransl"]);
2094 include_once(
"./Services/COPage/classes/class.ilPageMultiLangGUI.php");
2097 $a_tpl->setVariable(
"MULTI_LANG_INFO", $ml_gui->getMultiLangInfo($this->getPageObject()->getLanguage()));
2114 if (
$_GET[
"media_mode"] !=
"")
2116 if (
$_GET[
"media_mode"] ==
"disable")
2118 $ilUser->writePref(
"ilPageEditor_MediaMode",
"disable");
2122 $ilUser->writePref(
"ilPageEditor_MediaMode",
"");
2125 if (
$_GET[
"html_mode"] !=
"")
2127 if (
$_GET[
"html_mode"] ==
"disable")
2129 $ilUser->writePref(
"ilPageEditor_HTMLMode",
"disable");
2133 $ilUser->writePref(
"ilPageEditor_HTMLMode",
"");
2136 if (
$_GET[
"js_mode"] !=
"")
2138 if (
$_GET[
"js_mode"] ==
"disable")
2140 $ilUser->writePref(
"ilPageEditor_JavaScript",
"disable");
2144 $ilUser->writePref(
"ilPageEditor_JavaScript",
"");
2148 $ilCtrl->redirect($this,
"edit");
2156 $a_int_links =
false, $a_wiki_links =
false, $a_keywords =
false,
2157 $a_style_id = 0, $a_paragraph_styles =
true, $a_save_return =
true,
2158 $a_anchors =
false, $a_save_new =
true)
2164 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
2166 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
2168 $btpl =
new ilTemplate(
"tpl.tiny_menu.html",
true,
true,
"Services/COPage");
2173 $btpl->touchBlock(
"debug_ghost");
2177 $btpl->touchBlock(
"blist_button");
2179 $lng->txt(
"cont_blist"),
2183 $btpl->touchBlock(
"nlist_button");
2185 $lng->txt(
"cont_nlist"),
2189 $btpl->touchBlock(
"list_indent");
2191 $lng->txt(
"cont_list_indent"),
2195 $btpl->touchBlock(
"list_outdent");
2197 $lng->txt(
"cont_list_outdent"),
2202 $btpl->touchBlock(
"bb_ilink_button");
2210 $btpl->touchBlock(
"rformat_button");
2214 if ($a_paragraph_styles)
2217 $btpl->setCurrentBlock(
"new_par");
2218 $btpl->setVariable(
"IMG_NEWPAR",
"+");
2219 $btpl->parseCurrentBlock();
2223 $btpl->setCurrentBlock(
"par_edit");
2224 $btpl->setVariable(
"TXT_PAR_FORMAT", $lng->txt(
"cont_par_format"));
2225 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
2230 $lng->txt(
"cont_paragraph_styles"),
"iltinymenu_bd");
2232 $btpl->parseCurrentBlock();
2237 $btpl->setCurrentBlock(
"bb_kw_button");
2238 $btpl->setVariable(
"CC_KW",
"kw");
2239 $btpl->parseCurrentBlock();
2247 $btpl->setCurrentBlock(
"bb_wikilink_button2");
2248 $btpl->setVariable(
"TXT_WIKI_BUTTON2", $lng->txt(
"obj_wiki"));
2249 $btpl->setVariable(
"WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
""));
2250 $btpl->parseCurrentBlock();
2254 $btpl->setCurrentBlock(
"bb_wikilink_button");
2255 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"obj_wiki"));
2256 $btpl->parseCurrentBlock();
2263 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
2267 if (in_array($c, array(
"com",
"quot",
"acc",
"code")))
2272 $a_par_type,
"active_".$c,
true))
2275 if ($aset->get(
"use_physical"))
2277 $cc_code = str_replace(array(
"str",
"emp",
"imp"), array(
"B",
"I",
"U"), $cc_code);
2280 if ($c !=
"tex" ||
$mathJaxSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
2282 $btpl->setCurrentBlock(
"bb_".$c.
"_button");
2283 $btpl->setVariable(
"CC_".strtoupper($c), $cc_code);
2284 $btpl->parseCurrentBlock();
2286 $lng->txt(
"cont_cc_".$c),
2302 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2304 $sdd->setPullRight(
false);
2305 $sdd->setListTitle($lng->txt(
"save").
"...");
2309 $btpl->setCurrentBlock(
"save_return");
2310 $btpl->setVariable(
"TXT_SAVE_RETURN", $lng->txt(
"save_return"));
2311 $btpl->parseCurrentBlock();
2312 $sdd->addItem($lng->txt(
"save_return"),
"",
"#",
"",
"",
"",
"",
"",
"ilCOPage.cmdSaveReturn(false); return false;");
2317 $btpl->setCurrentBlock(
"save_new");
2318 $btpl->setVariable(
"TXT_SAVE_NEW", $lng->txt(
"save_new"));
2319 $btpl->parseCurrentBlock();
2320 $sdd->addItem($lng->txt(
"save_new"),
"",
"#",
"",
"",
"",
"",
"",
"ilCOPage.cmdSaveReturn(true); return false;");
2323 $sdd->addItem($lng->txt(
"save"),
"",
"#",
"",
"",
"",
"",
"",
"ilCOPage.cmdSave(null); return false;");
2324 $sdd->addItem($lng->txt(
"cancel"),
"",
"#",
"",
"",
"",
"",
"",
"ilCOPage.cmdCancel(); return false;");
2328 $btpl->setCurrentBlock(
"bb_anc_button");
2329 $btpl->setVariable(
"CC_ANC",
"anc");
2330 $btpl->parseCurrentBlock();
2335 $btpl->setVariable(
"SAVE_DROPDOWN", $sdd->getHTML());
2344 $btpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
2345 $btpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
2347 $btpl->setVariable(
"TXT_CHAR_FORMAT", $lng->txt(
"cont_char_format"));
2348 $btpl->setVariable(
"TXT_LISTS", $lng->txt(
"cont_lists"));
2349 $btpl->setVariable(
"TXT_LINKS", $lng->txt(
"cont_links"));
2350 $btpl->setVariable(
"TXT_MORE_FUNCTIONS", $lng->txt(
"cont_more_functions"));
2351 $btpl->setVariable(
"TXT_SAVING", $lng->txt(
"cont_saving"));
2353 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
2356 $lng->txt(
"cont_more_character_styles"),
"iltinymenu_bd");
2358 return $btpl->get();
2370 $link_info =
"<IntLinkInfos>";
2371 $targetframe =
"None";
2372 foreach ($int_links as $int_link)
2374 $target = $int_link[
"Target"];
2375 if (substr($target, 0, 4) ==
"il__")
2379 $type = $int_link[
"Type"];
2381 $targetframe = ($int_link[
"TargetFrame"] !=
"")
2382 ? $int_link[
"TargetFrame"]
2386 if ($targetframe !=
"None")
2392 $anc = $anc_add =
"";
2393 if ($int_link[
"Anchor"] !=
"")
2395 $anc = $int_link[
"Anchor"];
2396 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
2403 case "StructureObject":
2405 if ($type ==
"PageObject")
2407 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
2411 $href =
"./goto.php?target=st_".$target_id;
2415 case "GlossaryItem":
2416 if ($targetframe ==
"None")
2418 $targetframe =
"Glossary";
2420 $href =
"./goto.php?target=git_".$target_id;
2424 $ilCtrl->setParameter($this,
"mob_id",
$target_id);
2426 $href = $ilCtrl->getLinkTarget($this,
"displayMedia");
2427 $ilCtrl->setParameter($this,
"mob_id",
"");
2431 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
2435 case "RepositoryItem":
2438 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
2443 $anc_par =
'Anchor="'.$anc.
'"';
2444 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".$anc_par.
" ".
2445 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" />";
2448 $link_info.=
"</IntLinkInfos>";
2457 $this->obj->buildDom();
2459 include_once(
"./Services/COPage/classes/class.ilPCFileList.php");
2463 require_once(
"./Modules/File/classes/class.ilObjFile.php");
2464 $file_id = $file[count($file) - 1];
2467 if (!in_array($file_id, $files))
2471 $fileObj =&
new ilObjFile($file_id,
false);
2472 $fileObj->sendFile();
2491 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Modules/LearningModule");
2492 $tpl->setCurrentBlock(
"ilMedia");
2500 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2502 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2504 $pg_obj->buildDom();
2506 if (!empty (
$_GET[
"pg_id"]))
2509 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2523 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2524 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2530 $mode =
"fullscreen";
2537 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2538 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' =>
"",
2539 'ref_id' =>
$_GET[
"ref_id"],
'webspace_path' => $wb_path);
2540 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2546 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2549 $tpl->setVariable(
"MEDIA_CONTENT", $output);
2552 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
2554 $tpl->fillJavaScriptFiles();
2555 $tpl->fillCssFiles();
2567 $pg_obj->send_paragraph(
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
2578 $start = strpos($a_html,
"{{{{{ContentInclude;");
2581 $end = strpos($a_html,
"}}}}}", $start);
2586 $param = substr($a_html, $start + 20, $end - $start - 20);
2587 $param = explode(
";", $param);
2589 if ($param[0] ==
"mep" && is_numeric($param[1]) && $param[2] <= 0)
2591 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
2607 $html = $page_gui->getRawContent();
2613 $html =
"// ".$lng->txt(
"cont_missing_snippet").
" //";
2616 $h2 = substr($a_html, 0, $start).
2618 substr($a_html, $end + 5);
2622 $start = strpos($a_html,
"{{{{{ContentInclude;", $start + 5);
2626 $end = strpos($a_html,
"}}}}}", $start);
2642 include_once(
"./Services/Utilities/classes/class.ilStr.php");
2646 $page_heads = array();
2647 foreach ($offsets as $os)
2649 $level = (int) substr($a_output, $os + 10, 1);
2650 if (in_array($level, array(1,2,3)))
2652 $anchor = str_replace(
"TocH",
"TocA",
2653 substr($a_output, $os, strpos($a_output,
"<", $os) - $os - 3)
2657 $tag_start = stripos($a_output,
"<h".$level.
" ", $os);
2658 $tag_end = stripos($a_output,
"</h".$level.
">", $tag_start);
2659 $head = substr($a_output, $tag_start, $tag_end - $tag_start);
2662 $text_start = stripos($head,
">") + 1;
2663 $text_end = strripos($head,
"<!--", $text_start);
2664 $text = substr($head, $text_start, $text_end - $text_start);
2665 $page_heads[] = array(
"level" => $level,
"text" => $text,
2666 "anchor" => $anchor);
2670 if (count($page_heads) > 1)
2672 include_once(
"./Services/UIComponent/NestedList/classes/class.ilNestedList.php");
2674 $list->setAutoNumbering(
true);
2675 $list->setListClass(
"ilc_page_toc_PageTOCList");
2676 $list->setItemClass(
"ilc_page_toc_PageTOCItem");
2684 foreach ($page_heads as $ind => $h)
2691 if ($h[
"level"] == 2 && $c_par[1] > 0)
2695 if ($h[
"level"] == 3 && $c_par[2] > 0)
2700 $h[
"text"] = str_replace(
"<!--PageTocPH-->",
"", $h[
"text"]);
2704 "<a href='#".$h[
"anchor"].
"' class='ilc_page_toc_PageTOCLink'>".$h[
"text"].
"</a>",
2708 if ($h[
"level"] == 1)
2713 if ($h[
"level"] == 2)
2721 $tpl->setVariable(
"PAGE_TOC", $list->getHTML());
2722 $tpl->setVariable(
"TXT_PAGE_TOC", $lng->txt(
"cont_page_toc"));
2723 $tpl->setVariable(
"TXT_HIDE", $lng->txt(
"hide"));
2724 $tpl->setVariable(
"TXT_SHOW", $lng->txt(
"show"));
2726 $a_output = str_replace(
"{{{{{PageTOC}}}}}",
2727 $tpl->get(), $a_output);
2728 $numbers = $list->getNumbers();
2730 if (count($numbers) > 0)
2732 include_once(
"./Services/Utilities/classes/class.ilStr.php");
2733 foreach ($numbers as
$n)
2742 $a_output = str_replace(
"{{{{{PageTOC}}}}}",
2762 include_once(
"./Services/COPage/classes/class.ilPCResourcesGUI.php");
2782 $a_output = str_replace(
"{{{{{LV_show_adv}}}}}",
2783 $lng->txt(
"cont_show_adv"), $a_output);
2784 $a_output = str_replace(
"{{{{{LV_hide_adv}}}}}",
2785 $lng->txt(
"cont_hide_adv"), $a_output);
2789 $a_output = str_replace(
"{{{{{LV_show_adv}}}}}",
2791 $a_output = str_replace(
"{{{{{LV_hide_adv}}}}}",
2815 $a_tpl->setCurrentBlock(
"help");
2816 $a_tpl->setVariable(
"TXT_ADD_EL", $lng->txt(
"cont_add_elements"));
2817 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
2820 $a_tpl->setVariable(
"TXT_DRAG", $lng->txt(
"cont_drag_and_drop_elements"));
2821 $a_tpl->setVariable(
"TXT_SEL", $lng->txt(
"cont_double_click_to_delete"));
2822 $a_tpl->parseCurrentBlock();
2854 $ilCtrl->redirect($this,
"preview");
2859 if ($ptype ==
"cont" &&
$_GET[
"ref_id"] > 0)
2863 $ilHelp->setScreenId(
"edit_".$ptype);
2865 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
2867 $ilUser->isAnonymous() &&
2868 !$ilUser->isCaptchaVerified() &&
2869 ilCaptchaUtil::isActiveForWiki()
2872 $form = $this->initCaptchaForm();
2873 if(
$_POST[
'captcha_code'] && $form->checkInput())
2875 $ilUser->setCaptchaVerified(
true);
2879 return $form->getHTML();
2886 include_once(
"./Services/User/classes/class.ilUserUtil.php");
2887 $info = $lng->txt(
"content_no_edit_lock");
2889 $info .=
"</br>" . $lng->txt(
"content_until") .
": " .
2891 $info .=
"</br>" . $lng->txt(
"obj_usr") .
": " .
2893 if (!$ilCtrl->isAsynch())
2900 echo $this->tpl->getMessageHTML($info);
2908 $min = (int) $aset->get(
"block_mode_minutes") ;
2911 include_once(
"./Services/User/classes/class.ilUserUtil.php");
2913 $info = $lng->txt(
"cont_got_lock_until");
2919 include_once(
"./Services/UIComponent/Button/classes/class.ilLinkButton.php");
2921 $but->setCaption(
"cont_finish_editing");
2922 $but->setUrl($ilCtrl->getLinkTarget($this,
"releasePageLock"));
2923 $info = str_replace(
"%2", $but->render(), $info);
2934 $html.=
"<br /><br />".$this->getNotesHTML();
2952 $html = $this->
edit();
2954 $tpl->addOnLoadCode(
"ilCOPage.insertJSAtPlaceholder('".
2964 public function initCaptchaForm()
2972 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
2975 require_once
'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
2978 $form->addItem($ci);
2980 $form->addCommandButton(
'edit', $lng->txt(
'ok'));
2982 $form->setTitle($lng->txt(
'cont_captcha_verification'));
2983 $form->setFormAction($ilCtrl->getFormAction($this));
3010 $this->tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
3011 $this->tpl->setCurrentBlock(
"ContentStyle");
3012 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 0);
3013 $this->tpl->parseCurrentBlock();
3017 $this->tpl->setCurrentBlock(
"ilMedia");
3019 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3021 if (!empty (
$_GET[
"pg_id"]))
3023 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
3025 $pg_obj->buildDom();
3030 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
3044 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
3045 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
3052 $mode =
"fullscreen";
3053 $params = array (
'mode' => $mode,
'webspace_path' => $wb_path);
3054 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
3059 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
3069 if(is_array($a_error))
3071 $error_str =
"<b>Error(s):</b><br>";
3072 foreach ($a_error as $error)
3074 $err_mess = implode($error,
" - ");
3075 if (!is_int(strpos($err_mess,
":0:")))
3077 $error_str .= htmlentities($err_mess).
"<br />";
3080 $this->tpl->setVariable(
"MESSAGE", $error_str);
3096 $tpl->addJavaScript(
"./Services/COPage/js/page_history.js");
3098 include_once(
"./Services/COPage/classes/class.ilPageHistoryTableGUI.php");
3100 $table_gui->setId(
"hist_table");
3107 'sortkey' => 999999,
3109 $table_gui->setData($entries);
3110 return $table_gui->getHTML();
3125 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
3129 $ilCtrl->setParameter($this,
"rollback_nr",
$_GET[
"old_nr"]);
3130 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"rollback"));
3131 $c_gui->setHeaderText($lng->txt(
"cont_rollback_confirmation"));
3132 $c_gui->setCancel($lng->txt(
"cancel"),
"history");
3133 $c_gui->setConfirm($lng->txt(
"confirm"),
"rollback");
3135 $hentry = $this->obj->getHistoryEntry(
$_GET[
"old_nr"]);
3137 $c_gui->addItem(
"id[]",
$_GET[
"old_nr"],
3140 $tpl->setContent($c_gui->getHTML());
3155 $hentry = $this->obj->getHistoryEntry(
$_GET[
"rollback_nr"]);
3157 if ($hentry[
"content"] !=
"")
3159 $this->obj->setXMLContent($hentry[
"content"]);
3160 $this->obj->buildDom(
true);
3161 if ($this->obj->update())
3163 $ilCtrl->redirect($this,
"history");
3166 $ilCtrl->redirect($this,
"history");
3179 $ilHelp->setScreenIdComponent(
"copg");
3203 $ilTabs->addTarget(
"pg", $ilCtrl->getLinkTarget($this,
"preview")
3204 , array(
"",
"preview"));
3208 $ilTabs->addTarget(
"edit", $ilCtrl->getLinkTarget($this,
"edit")
3209 , array(
"",
"edit"));
3216 $ilTabs->addTarget(
"edit", $ilCtrl->getLinkTarget($this,
"edit")
3217 , array(
"",
"edit"));
3220 $ilTabs->addTarget(
"cont_preview", $ilCtrl->getLinkTarget($this,
"preview")
3221 , array(
"",
"preview"));
3227 if ($this->use_meta_data)
3229 $ilTabs->addTarget(
"meta_data",
3230 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
3231 "",
"ilmdeditorgui");
3238 $ilTabs->addTarget(
"history", $this->ctrl->getLinkTarget($this,
"history")
3239 ,
"history", get_class($this));
3240 if (
$_GET[
"history_mode"] ==
"1" || $this->ctrl->getCmd() ==
"compareVersion")
3242 $ilTabs->activateTab(
"history");
3255 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTargetByClass(
"ilEditClipboardGUI",
"view")
3256 ,
"view",
"ilEditClipboardGUI");
3261 $ilTabs->addTarget(
"cont_activation", $this->ctrl->getLinkTarget($this,
"editActivation"),
3262 "editActivation", get_class($this));
3267 $ilTabs->addTarget(
"news",
3268 $this->ctrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNews"),
3269 "",
"ilnewsitemgui");
3273 if (is_array($this->tab_hook))
3275 $func = $this->tab_hook[
"func"];
3276 $this->tab_hook[
"obj"]->$func();
3293 $tpl =
new ilTemplate(
"tpl.page_compare.html",
true,
true,
"Services/COPage");
3294 $compare = $this->obj->compareVersion((
int)
$_POST[
"left"], (
int) $_POST[
"right"]);
3297 $lpage = $compare[
"l_page"];
3299 $cfg->setPreventHTMLUnmasking(
true);
3308 $lhtml = str_replace(
"<br />",
"<br />", $lhtml);
3309 $tpl->setVariable(
"LEFT", $lhtml);
3312 $rpage = $compare[
"r_page"];
3320 $rhtml = str_replace(
"<br />",
"<br />", $rhtml);
3321 $tpl->setVariable(
"RIGHT", $rhtml);
3323 $tpl->setVariable(
"TXT_NEW", $lng->txt(
"cont_pc_new"));
3324 $tpl->setVariable(
"TXT_MODIFIED", $lng->txt(
"cont_pc_modified"));
3325 $tpl->setVariable(
"TXT_DELETED", $lng->txt(
"cont_pc_deleted"));
3335 $a_html = str_replace(
"[ilDiffInsStart]",
'<span class="ilDiffIns">', $a_html);
3336 $a_html = str_replace(
"[ilDiffDelStart]",
'<span class="ilDiffDel">', $a_html);
3337 $a_html = str_replace(
"[ilDiffInsEnd]",
'</span>', $a_html);
3338 $a_html = str_replace(
"[ilDiffDelEnd]",
'</span>', $a_html);
3350 $atpl =
new ilTemplate(
"tpl.page_activation.php",
true,
true,
"Services/COPage");
3353 $atpl->setVariable(
"FORM", $this->form->getHTML());
3354 $atpl->setCurrentBlock(
"updater");
3355 $atpl->setVariable(
"UPDATER_FRAME", $this->exp_frame);
3356 $atpl->setVariable(
"EXP_ID_UPDATER", $this->exp_id);
3357 $atpl->setVariable(
"HREF_UPDATER", $this->exp_target_script);
3358 $atpl->parseCurrentBlock();
3359 $tpl->setContent($atpl->get());
3369 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3371 $this->form->setFormAction($ilCtrl->getFormAction($this));
3372 $this->form->setTitle($lng->txt(
"cont_page_activation"));
3376 $rad_op1 =
new ilRadioOption($lng->txt(
"cont_activated"),
"activated");
3378 $rad->addOption($rad_op1);
3379 $rad_op2 =
new ilRadioOption($lng->txt(
"cont_deactivated"),
"deactivated");
3380 $rad->addOption($rad_op2);
3381 $rad_op3 =
new ilRadioOption($lng->txt(
"cont_scheduled_activation"),
"scheduled");
3384 $dt_prop->setShowTime(
true);
3388 $rad_op3->addSubItem($dt_prop2);
3391 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"cont_show_activation_info"),
"show_activation_info");
3392 $cb->
setInfo($this->lng->txt(
"cont_show_activation_info_info"));
3393 $rad_op3->addSubItem($cb);
3396 $rad->addOption($rad_op3);
3398 $this->form->addCommandButton(
"saveActivation", $lng->txt(
"save"));
3400 $this->form->addItem($rad);
3409 $values[
"activation"] =
"deactivated";
3412 $values[
"activation"] =
"activated";
3415 $dt_prop = $this->form->getItemByPostVar(
"start");
3418 $values[
"activation"] =
"scheduled";
3422 $dt_prop = $this->form->getItemByPostVar(
"end");
3425 $values[
"activation"] =
"scheduled";
3430 $values[
"show_activation_info"] = $this->
getPageObject()->getShowActivationInfo();
3432 $this->form->setValuesByArray($values);
3444 if ($this->form->checkInput())
3450 if (
$_POST[
"activation"] ==
"deactivated")
3454 if (
$_POST[
"activation"] ==
"scheduled")
3458 $this->form->getItemByPostVar(
"start")->getDate()->get(
IL_CAL_DATETIME));
3460 $this->form->getItemByPostVar(
"end")->getDate()->get(
IL_CAL_DATETIME));
3464 $ilCtrl->redirect($this,
"editActivation");
3466 $this->form->getValuesByPost();
3467 $tpl->setContent($this->form->getHTML());
3479 function getNotesHTML($a_content_object = null, $a_enable_private_notes =
true, $a_enable_public_notes =
false, $a_enable_notes_deletion =
false, $a_callback = null)
3483 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
3486 if(!$a_content_object)
3488 $notes_gui =
new ilNoteGUI($this->notes_parent_id,
3489 (
int)$this->obj->getId(),
"pg");
3491 $a_enable_private_notes =
true;
3492 $a_enable_public_notes =
true;
3493 $a_enable_notes_deletion =
false;
3498 $notes_gui =
new ilNoteGUI($a_content_object->getParentId(),
3499 $a_content_object->getId(), $a_content_object->getParentType());
3502 if($a_enable_private_notes)
3506 if ($a_enable_public_notes)
3508 $notes_gui->enablePublicNotes();
3509 if ((
bool)$a_enable_notes_deletion)
3511 $notes_gui->enablePublicNotesDeletion(
true);
3517 $notes_gui->addObserver($a_callback);
3520 $next_class = $this->ctrl->getNextClass($this);
3521 if ($next_class ==
"ilnotegui")
3523 $html = $this->ctrl->forwardCommand($notes_gui);
3527 $html = $notes_gui->getNotesHTML();
3545 include_once(
"./Services/COPage/classes/class.ilPageQuestionProcessor.php");
3569 $ilTabs->activateTab(
"edit");
3572 $this->tpl->setContent($form->getHTML());
3585 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3589 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
3590 $ac =
new ilLinkInputGUI($this->lng->txt(
'cont_resource'),
'opened_content');
3592 $ac->setInternalLinkDefault(
"Media_Media", 0);
3593 $ac->setInternalLinkFilterTypes(array(
"PageObject_FAQ",
"GlossaryItem",
"Media_Media",
"Media_FAQ"));
3594 $val = $this->obj->getInitialOpenedContent();
3595 if ($val[
"id"] !=
"" && $val[
"type"] !=
"")
3597 $ac->setValue($val[
"type"].
"|".$val[
"id"].
"|".$val[
"target"]);
3600 $form->addItem($ac);
3602 $form->addCommandButton(
"saveInitialOpenedContent", $this->lng->txt(
"save"));
3603 $form->addCommandButton(
"edit", $this->lng->txt(
"cancel"));
3604 $form->setTitle($this->lng->txt(
"cont_initial_attached_content"));
3605 $form->setFormAction($ilCtrl->getFormAction($this));
3620 $this->obj->saveInitialOpenedContent(
3627 $ilCtrl->redirect($this,
"edit");
3649 $ilCtrl->setParameter($this,
"transl",
$_GET[
"totransl"]);
3650 $ilCtrl->redirect($this,
"edit");
3661 $ilCtrl->setParameter($this,
"totransl", $l);
3662 $lng->loadLanguageModule(
"meta");
3664 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
3666 $cgui->setFormAction($ilCtrl->getFormAction($this));
3667 $cgui->setHeaderText($lng->txt(
"cont_page_translation_does_not_exist").
": ".
3668 $lng->txt(
"meta_l_".$l));
3669 $cgui->setCancel($lng->txt(
"cancel"),
"editMasterLanguage");
3670 $cgui->setConfirm($lng->txt(
"confirm"),
"createPageTranslation");
3671 $tpl->setContent($cgui->getHTML());
3681 $ilCtrl->setParameter($this,
"transl",
"");
3682 $ilCtrl->redirect($this,
"edit");
3694 $ilCtrl->setParameter($this,
"transl", $l);
3695 $ilCtrl->redirect($this,
"edit");
3707 $ilCtrl->redirect($this,
"preview");