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/COPage/classes/class.ilParagraphPlugins.php");
14 include_once(
"./Services/COPage/classes/class.ilParagraphPlugin.php");
15 include_once(
"./Services/Utilities/classes/class.ilDOMUtil.php");
80 "ContentInclude" => array(
86 "InteractiveImage" => array(
90 "LoginPageElement" => array(
94 "MediaObject" => array(
98 "PlaceHolder" => array(
102 "Resources" => array(
106 "SourceCode" => array(
114 "Verification" => array(
118 "QuestionOverview" => array(
131 $a_prevent_get_id =
false)
136 if ($a_old_nr == 0 && !$a_prevent_get_id &&
$_GET[
"old_nr"] > 0)
138 $a_old_nr =
$_GET[
"old_nr"];
156 include_once(
"./Services/COPage/classes/class.ilPageConfig.php");
165 $this->output2template =
true;
166 $this->question_xml =
"";
167 $this->question_html =
"";
168 $this->tabs_gui =& $ilTabs;
171 $this->template_output_var =
"PAGE_CONTENT";
172 $this->citation =
false;
173 $this->change_comments =
false;
174 $this->page_back_title = $this->lng->txt(
"page");
175 $lng->loadLanguageModule(
"content");
189 if (isset($a_pc_type))
191 $this->pc_types[$a_pc_type][
"enabled"] = $a_val;
202 return $this->pc_types[$a_pc_type][
"enabled"];
212 $this->page_config = $a_val;
227 $page =
new ilPageObject($a_parent_type, $a_id, $a_old_nr);
237 $this->bib_id = $a_id;
245 return $this->bib_id ? $this->bib_id : 0;
255 $this->obj = $a_pg_obj;
275 $this->output_mode = $a_mode;
285 $this->output2template = $a_output;
295 $this->presentation_title = $a_title;
305 $this->header = $a_title;
310 return $this->header;
315 $this->link_params = $l_params;
325 $this->link_frame = $l_frame;
330 return $this->link_frame;
335 $this->link_xml = $link_xml;
336 $this->link_xml_set =
true;
341 return $this->link_xml;
346 $this->question_xml = $question_xml;
356 return $this->question_xml;
366 $this->target_var = $a_variable;
377 $this->template_output_var = $a_value;
388 $this->output_submode = $a_mode;
398 $this->sourcecode_download_script = $script_name;
407 $this->citation = $a_enabled;
417 $this->locator =& $a_locator;
422 $this->tabs_gui = $a_tabs;
427 $this->page_back_title = $a_title;
432 $this->file_download_link = $a_download_link;
437 return $this->file_download_link;
442 $this->fullscreen_link = $a_fullscreen_link;
447 return $this->fullscreen_link;
457 $this->enable_keywords = $a_val;
477 $this->enable_anchors = $a_val;
492 $this->int_link_def_type = $a_type;
493 $this->int_link_def_id = $a_id;
498 $this->int_link_return = $a_return;
503 $this->change_comments = $a_enabled;
513 $this->notes_enabled = $a_enabled;
514 $this->notes_parent_id = $a_parent_id;
519 return $this->notes_enabled;
544 $this->offline_directory = $offdir;
553 return $this->offline_directory;
565 $this->view_page_link = $a_link;
566 $this->view_page_target = $a_target;
574 return $this->view_page_link;
582 return $this->view_page_target;
587 $this->act_obj =& $a_obj;
588 $this->act_meth = $a_meth;
593 $this->activation = $a_act;
603 $this->scheduled_activation = $a_act;
608 return $this->scheduled_activation;
618 $this->page_toc = $a_val;
628 return $this->page_toc;
638 $this->enabled_news = $a_enabled;
639 $this->news_obj_id = $a_news_obj_id;
640 $this->news_obj_type = $a_news_obj_type;
650 return $this->enabled_news;
658 $this->tab_hook = array(
"obj" => $a_object,
"func" => $a_function);
669 $this->enabledinternallinks = $a_enabledinternallinks;
689 $this->editpreview = $a_editpreview;
709 $this->preventhtmlunmasking = $a_preventhtmlunmasking;
719 return $this->preventhtmlunmasking;
729 $this->tabs_enabled = $a_enabledtabs;
768 $this->
setEnablePCType(
"LoginPageElement", (
bool) $a_enablegloginpage);
847 $this->enabledpagefocus = $a_enabledpagefocus;
857 return $this->enabledpagefocus;
943 $this->exp_frame = $a_exp_frame;
944 $this->exp_id = $a_exp_id;
945 $this->exp_target_script = $a_exp_target_script;
955 $this->prependinghtml = $a_prependinghtml;
965 return $this->prependinghtml;
975 $this->enablewikilinks = $a_enablewikilinks;
985 return $this->enablewikilinks;
995 $this->enableediting = $a_enableediting;
1015 $this->rawpagecontent = $a_rawpagecontent;
1035 $this->layout_mode = $a_layout_mode;
1045 return $this->layout_mode;
1055 $this->styleid = $a_styleid;
1065 return $this->styleid;
1076 $this->enabledselfassessment = $a_enabledselfassessment;
1077 $this->enabledselfassessment_scorm = $a_scorm;
1088 return $this->enabledselfassessment;
1098 return $this->enabledselfassessment_scorm;
1108 $this->compare_mode = $a_val;
1128 $this->abstract_only = $a_val;
1151 $a_observer_obj = NULL, $a_observer_func =
"")
1153 $this->use_meta_data =
true;
1154 $this->meta_data_rep_obj_id = $a_rep_obj_id;
1155 $this->meta_data_sub_obj_id = $a_sub_obj_id;
1156 $this->meta_data_type = $a_type;
1157 $this->meta_data_observer_obj = $a_observer_obj;
1158 $this->meta_data_observer_func = $a_observer_func;
1173 $file_download_link = $ilCtrl->getLinkTarget($this,
"downloadFile");
1175 return $file_download_link;
1190 $fullscreen_link = $ilCtrl->getLinkTarget($this,
"displayMediaFullscreen",
"",
false,
false);
1192 return $fullscreen_link;
1205 if ($this->sourcecode_download_script ==
"" && $this->
getOutputMode() !=
"offline")
1207 $l = $ilCtrl->getLinkTarget($this,
"");
1220 global $ilPluginAdmin;
1224 foreach ($pl_names as $pl_name)
1227 "COPage",
"pgcp", $pl_name);
1228 if ($plugin->isValidParentType($this->getPageObject()->getParentType()))
1230 $xml =
'<ComponentPlugin Name="'.$plugin->getPluginName().
1237 $xml =
"<ComponentPlugins>".$xml.
"</ComponentPlugins>";
1251 $next_class = $this->ctrl->getNextClass($this);
1253 $cmd = $this->ctrl->getCmd();
1258 $ilCtrl->setReturn($this,
"edit");
1262 case 'ilmdeditorgui':
1264 $ilTabs->setTabActive(
"meta_data");
1265 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
1267 $this->meta_data_sub_obj_id, $this->meta_data_type);
1268 if (is_object($this->meta_data_observer_obj))
1270 $md_gui->addObserver($this->meta_data_observer_obj,
1271 $this->meta_data_observer_func,
"General");
1273 $this->ctrl->forwardCommand($md_gui);
1276 case "ileditclipboardgui":
1280 $clip_gui->setPageBackTitle($this->page_back_title);
1282 $ret =& $this->ctrl->forwardCommand($clip_gui);
1287 switch(
$_GET[
"notes_mode"])
1290 $html = $this->
edit();
1291 $ilTabs->setTabActive(
"edit");
1296 case 'ilpublicuserprofilegui':
1297 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
1299 $ret = $this->ctrl->forwardCommand($profile_gui);
1302 case "ilpageeditorgui":
1306 $ilCtrl->redirect($this,
"preview");
1309 $page_editor->setLocator($this->locator);
1310 $page_editor->setHeader($this->
getHeader());
1311 $page_editor->setPageBackTitle($this->page_back_title);
1315 $page_editor->setIntLinkHelpDefault($this->int_link_def_type,
1316 $this->int_link_def_id);
1317 $page_editor->setIntLinkReturn($this->int_link_return);
1319 $ret =& $this->ctrl->forwardCommand($page_editor);
1322 case 'ilnewsitemgui':
1323 include_once(
"./Services/News/classes/class.ilNewsItemGUI.php");
1325 $news_item_gui->setEnableEdit(
true);
1326 $news_item_gui->setContextObjId($this->news_obj_id);
1327 $news_item_gui->setContextObjType($this->news_obj_type);
1328 $news_item_gui->setContextSubObjId($this->obj->getId());
1329 $news_item_gui->setContextSubObjType(
"pg");
1331 $ret = $ilCtrl->forwardCommand($news_item_gui);
1335 $ret = $this->ctrl->forwardCommand($profile_gui);
1338 case "ilpropertyformgui":
1339 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1341 $this->ctrl->forwardCommand($form);
1344 case "ilinternallinkgui":
1345 $this->lng->loadLanguageModule(
"content");
1346 require_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
1350 $link_gui->filterLinkType(
"PageObject_FAQ");
1351 $link_gui->filterLinkType(
"GlossaryItem");
1352 $link_gui->filterLinkType(
"Media_Media");
1353 $link_gui->filterLinkType(
"Media_FAQ");
1355 $link_gui->setFilterWhiteList(
true);
1356 $link_gui->setMode(
"asynch");
1357 $ilCtrl->forwardCommand($link_gui);
1362 $cmd = $this->ctrl->getCmd(
"preview");
1376 $this->ctrl->redirect($this,
"edit");
1385 $this->ctrl->redirect($this,
"edit");
1395 $ilBench->start(
"ContentPresentation",
"ilPageObjectGUI_showPage");
1399 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1403 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/COPage/js/ilCOPagePres.js");
1406 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
1409 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1418 $tpl =
new ilTemplate(
"tpl.page_edit_wysiwyg.html",
true,
true,
"Services/COPage");
1422 $tpl->setVariable(
"CLASS_PAGE_TD",
"ilc_Page");
1427 $tpl->setCurrentBlock(
"change_comment");
1428 $tpl->setVariable(
"TXT_ADD_COMMENT", $this->lng->txt(
"cont_add_change_comment"));
1429 $tpl->parseCurrentBlock();
1430 $tpl->setCurrentBlock(
"adm_content");
1434 if ($this->exp_frame !=
"")
1436 $tpl->setCurrentBlock(
"updater");
1437 $tpl->setVariable(
"UPDATER_FRAME", $this->exp_frame);
1438 $tpl->setVariable(
"EXP_ID_UPDATER", $this->exp_id);
1439 $tpl->setVariable(
"HREF_UPDATER", $this->exp_target_script);
1440 $tpl->parseCurrentBlock();
1448 $tpl->setVariable(
"WYSIWYG_ACTION",
1449 $ilCtrl->getFormActionByClass(
"ilpageeditorgui",
"",
"",
true));
1453 $sel_media_mode = ($ilUser->getPref(
"ilPageEditor_MediaMode") ==
"disable")
1456 $sel_html_mode = ($ilUser->getPref(
"ilPageEditor_HTMLMode") ==
"disable")
1459 $sel_js_mode =
"disable";
1469 $tpl->setVariable(
"TXT_CONFIRM_DELETE", $lng->txt(
"cont_confirm_delete"));
1474 $ilTabs->addNonTabbedLink(
"pres_view", $this->lng->txt(
"cont_presentation_view"),
1482 if ($sel_js_mode ==
"enable")
1485 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1489 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/COPage/js/ilcopagecallback.js");
1490 $GLOBALS[
"tpl"]->addJavascript(
"Services/COPage/js/page_editing.js");
1492 include_once
'./Services/Style/classes/class.ilObjStyleSheet.php';
1493 $GLOBALS[
"tpl"]->addOnloadCode(
"var preloader = new Image();
1494 preloader.src = './templates/default/images/loader.gif';
1495 ilCOPage.setContentCss('".
1498 ", ./Services/COPage/css/tiny_extra.css".
1501 $GLOBALS[
"tpl"]->addJavascript(
"Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
1502 $tpl->touchBlock(
"init_dragging");
1504 $tpl->setVariable(
"IL_TINY_MENU",
1514 include_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
1515 $tpl->setCurrentBlock(
"int_link_prep");
1517 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
1518 "",
false,
true,
false)));
1519 $tpl->parseCurrentBlock();
1526 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1528 $GLOBALS[
"tpl"]->addJavaScript(
"./Services/UIComponent/Explorer/js/ilExplorer.js");
1535 ($this->
getPageObject()->getParentType() !=
"qpl" && $cnt_pcs > 0))
1537 $tpl->setCurrentBlock(
"multi_actions");
1538 if ($sel_js_mode ==
"enable")
1540 $tpl->setVariable(
"ONCLICK_DE_ACTIVATE_SELECTED",
'onclick="return ilEditMultiAction(\'activateSelected\');"');
1541 $tpl->setVariable(
"ONCLICK_DELETE_SELECTED",
'onclick="return ilEditMultiAction(\'deleteSelected\');"');
1542 $tpl->setVariable(
"ONCLICK_ASSIGN_CHARACTERISTIC",
'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
1543 $tpl->setVariable(
"ONCLICK_COPY_SELECTED",
'onclick="return ilEditMultiAction(\'copySelected\');"');
1544 $tpl->setVariable(
"ONCLICK_CUT_SELECTED",
'onclick="return ilEditMultiAction(\'cutSelected\');"');
1545 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
1546 $tpl->setVariable(
"ONCLICK_SELECT_ALL",
'onclick="return ilEditMultiAction(\'selectAll\');"');
1548 $tpl->setVariable(
"TXT_DE_ACTIVATE_SELECTED", $this->lng->txt(
"cont_ed_enable"));
1549 $tpl->setVariable(
"TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt(
"cont_assign_characteristic"));
1550 $tpl->setVariable(
"TXT_DELETE_SELECTED", $this->lng->txt(
"cont_delete_selected"));
1551 $tpl->setVariable(
"TXT_COPY_SELECTED", $this->lng->txt(
"copy"));
1552 $tpl->setVariable(
"TXT_CUT_SELECTED", $this->lng->txt(
"cut"));
1554 $tpl->parseCurrentBlock();
1561 $tpl =
new ilTemplate(
"tpl.page_translation_content.html",
true,
true,
"Services/COPage");
1568 $tpl =
new ilTemplate(
"tpl.page_content.html",
true,
true,
"Services/COPage");
1571 $tpl->touchBlock(
"page_focus");
1576 $tpl =
new ilTemplate(
"tpl.page_preview.html",
true,
true,
"Services/COPage");
1577 include_once(
"./Services/User/classes/class.ilUserUtil.php");
1588 if (is_array($hist_info[
"previous"]))
1590 $tpl->setCurrentBlock(
"previous_rev");
1591 $tpl->setVariable(
"TXT_PREV_REV", $lng->txt(
"cont_previous_rev"));
1592 $ilCtrl->setParameter($this,
"old_nr", $hist_info[
"previous"][
"nr"]);
1593 $tpl->setVariable(
"HREF_PREV",
1594 $ilCtrl->getLinkTarget($this,
"preview"));
1595 $tpl->parseCurrentBlock();
1599 $tpl->setCurrentBlock(
"previous_rev_disabled");
1600 $tpl->setVariable(
"TXT_PREV_REV", $lng->txt(
"cont_previous_rev"));
1601 $tpl->parseCurrentBlock();
1605 $tpl->setCurrentBlock(
"next_rev");
1606 $tpl->setVariable(
"TXT_NEXT_REV", $lng->txt(
"cont_next_rev"));
1607 $ilCtrl->setParameter($this,
"old_nr", $hist_info[
"next"][
"nr"]);
1608 $tpl->setVariable(
"HREF_NEXT",
1609 $ilCtrl->getLinkTarget($this,
"preview"));
1610 $tpl->parseCurrentBlock();
1613 $tpl->setCurrentBlock(
"latest_rev");
1614 $tpl->setVariable(
"TXT_LATEST_REV", $lng->txt(
"cont_latest_rev"));
1615 $ilCtrl->setParameter($this,
"old_nr",
"");
1616 $tpl->setVariable(
"HREF_LATEST",
1617 $ilCtrl->getLinkTarget($this,
"preview"));
1618 $tpl->parseCurrentBlock();
1621 if ($c_old_nr > 0 && $ilUser->getId() != ANONYMOUS_USER_ID)
1623 $tpl->setCurrentBlock(
"rollback");
1624 $ilCtrl->setParameter($this,
"old_nr", $c_old_nr);
1625 $tpl->setVariable(
"HREF_ROLLBACK",
1626 $ilCtrl->getLinkTarget($this,
"rollbackConfirmation"));
1627 $ilCtrl->setParameter($this,
"old_nr",
"");
1628 $tpl->setVariable(
"TXT_ROLLBACK",
1629 $lng->txt(
"cont_rollback"));
1630 $tpl->parseCurrentBlock();
1634 $tpl->setCurrentBlock(
"hist_nav");
1635 $tpl->setVariable(
"TXT_REVISION", $lng->txt(
"cont_revision"));
1636 $tpl->setVariable(
"VAL_REVISION_DATE",
1638 $tpl->setVariable(
"VAL_REV_USER",
1640 $tpl->parseCurrentBlock();
1650 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormActionByClass(
"ilpageeditorgui"));
1657 $this->obj->getId());
1658 $mob_links = array();
1659 foreach($links as $link)
1661 if ($link[
"type"] ==
"mob")
1671 if (count($mob_links) > 0)
1673 $tpl->setCurrentBlock(
"med_link");
1674 $tpl->setVariable(
"TXT_LINKED_MOBS", $this->lng->txt(
"cont_linked_mobs"));
1675 $tpl->setVariable(
"SEL_MED_LINKS",
1677 $tpl->setVariable(
"TXT_EDIT_MEDIA", $this->lng->txt(
"cont_edit_mob"));
1678 $tpl->setVariable(
"TXT_COPY_TO_CLIPBOARD", $this->lng->txt(
"cont_copy_to_clipboard"));
1680 $tpl->parseCurrentBlock();
1684 $snippets = $this->
getPageObject()->collectContentIncludes();
1685 if (count($snippets) > 0)
1687 foreach ($snippets as $s)
1689 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1692 $tpl->setCurrentBlock(
"med_link");
1693 $tpl->setVariable(
"TXT_CONTENT_SNIPPETS_USED", $this->lng->txt(
"cont_snippets_used"));
1694 $tpl->setVariable(
"SEL_SNIPPETS",
1696 $tpl->setVariable(
"TXT_SHOW_INFO", $this->lng->txt(
"cont_show_info"));
1697 $tpl->parseCurrentBlock();
1705 $tpl->setCurrentBlock(
"activation_txt");
1706 $tpl->setVariable(
"TXT_SCHEDULED_ACTIVATION", $lng->txt(
"cont_scheduled_activation"));
1707 $tpl->setVariable(
"SA_FROM",
1711 $tpl->setVariable(
"SA_TO",
1715 $tpl->parseCurrentBlock();
1719 if (
$_GET[
"reloadTree"] ==
"y")
1721 $tpl->setCurrentBlock(
"reload_tree");
1722 if ($this->obj->getParentType() ==
"dbk")
1724 $tpl->setVariable(
"LINK_TREE",
1725 $this->ctrl->getLinkTargetByClass(
"ilobjdlbookgui",
"explorer",
"",
false,
false));
1729 $tpl->setVariable(
"LINK_TREE",
1730 $this->ctrl->getLinkTargetByClass(
"ilobjlearningmodulegui",
"explorer",
"",
false,
false));
1732 $tpl->parseCurrentBlock();
1736 $builded = $this->obj->buildDom();
1743 if (!$this->obj->checkPCIds())
1745 $this->obj->insertPCIds();
1746 $this->obj->update(
true,
true);
1749 $this->obj->addFileSizes();
1750 $this->obj->addHierIDs();
1752 $hids = $this->obj->getHierIds();
1753 $row1_ids = $this->obj->getFirstRowIds();
1754 $col1_ids = $this->obj->getFirstColumnIds();
1755 $litem_ids = $this->obj->getListItemIds();
1756 $fitem_ids = $this->obj->getFileItemIds();
1759 $hids = $this->obj->getHierIds();
1760 foreach($hids as $hid)
1762 $tpl->setCurrentBlock(
"add_dhtml");
1763 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_".$hid);
1764 $tpl->parseCurrentBlock();
1768 foreach($col1_ids as $hid)
1770 $tpl->setCurrentBlock(
"add_dhtml");
1771 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_r".$hid);
1772 $tpl->parseCurrentBlock();
1776 foreach($row1_ids as $hid)
1778 $tpl->setCurrentBlock(
"add_dhtml");
1779 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_c".$hid);
1780 $tpl->parseCurrentBlock();
1784 foreach($litem_ids as $hid)
1786 $tpl->setCurrentBlock(
"add_dhtml");
1787 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_i".$hid);
1788 $tpl->parseCurrentBlock();
1792 foreach($fitem_ids as $hid)
1794 $tpl->setCurrentBlock(
"add_dhtml");
1795 $tpl->setVariable(
"CONTEXTMENU",
"contextmenu_i".$hid);
1796 $tpl->parseCurrentBlock();
1801 $this->obj->addFileSizes();
1808 if (!$this->link_xml_set)
1822 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1824 $template_xml = $style->getTemplateXML();
1825 $disable_auto_margins =
"n";
1826 if ($style->lookupStyleSetting(
"disable_auto_margins"))
1828 $disable_auto_margins =
"y";
1835 $content =
"<dummy><PageObject><PageContent><Paragraph>".
1836 $this->obj->getFirstParagraphText().$link_xml.
1837 "</Paragraph></PageContent></PageObject></dummy>";
1841 $content = $this->obj->getXMLFromDom(
false,
true,
true,
1842 $link_xml.$this->getQuestionXML().$template_xml);
1846 if($builded !==
true)
1878 $enlarge_path =
"images/enlarge.png";
1882 ?
"ilc_PrintPageTitle"
1887 $enable_split_new = ($this->obj->getParentType() ==
"lm" ||
1888 $this->obj->getParentType() ==
"dbk")
1894 if (($this->obj->getParentType() ==
"lm" ||
1895 $this->obj->getParentType() ==
"dbk") &&
1897 $this->obj->getId()))
1899 $enable_split_next =
"y";
1903 $enable_split_next =
"n";
1908 $paragraph_plugins->initialize ();
1912 $paragraph_plugin_string = $paragraph_plugins->serializeToString();
1913 $_SESSION [
"paragraph_plugins"] = $paragraph_plugins;
1925 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
1937 ? $ilUser->getPref(
"ilPageEditor_MediaMode")
1940 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
1944 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1951 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1952 $params = array (
'mode' => $this->
getOutputMode(),
'pg_title' => htmlentities($pg_title,ENT_QUOTES,
"UTF-8"),
1954 'pg_id' => $this->obj->getId(),
'pg_title_class' => $pg_title_class,
1955 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path,
1956 'img_add' => $add_path,
1957 'img_col' => $col_path,
1958 'img_row' => $row_path,
1959 'img_item' => $item_path,
1960 'enable_split_new' => $enable_split_new,
1961 'enable_split_next' => $enable_split_next,
1963 'file_download_link' => $file_download_link,
1964 'fullscreen_link' => $fullscreen_link,
1965 'med_disabled_path' => $med_disabled_path,
1966 'img_path' => $img_path,
1967 'parent_id' => $this->obj->getParentId(),
1969 'encoded_download_script' => urlencode($this->sourcecode_download_script),
1972 'pagebreak' => $this->lng->txt(
'dgl_pagebreak'),
1973 'page' => $this->lng->txt(
'page'),
1974 'citate_page' => $this->lng->txt(
'citate_page'),
1975 'citate_from' => $this->lng->txt(
'citate_from'),
1976 'citate_to' => $this->lng->txt(
'citate_to'),
1977 'citate' => $this->lng->txt(
'citate'),
1985 'paste' => $paste ?
"y" :
"n",
1986 'media_mode' => $media_mode,
1987 'javascript' => $sel_js_mode,
1988 'paragraph_plugins' => $paragraph_plugin_string,
1989 'disable_auto_margins' => $disable_auto_margins,
1990 'page_toc' => $this->
getPageToc() ?
"y" :
"n",
1995 'enable_qover' => $this->
getEnablePCType(
"QuestionOverview") ?
"y" :
"n",
1996 'flv_video_player' => $flv_video_player
1998 if($this->link_frame !=
"")
1999 $params[
"pg_frame"] = $this->link_frame;
2006 $params[
"incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
2009 $md5 = md5(serialize($params).$link_xml.$template_xml);
2017 $md5 == $this->obj->getRenderMd5() &&
2018 ($this->obj->getLastChange() < $this->obj->getRenderedTime()) &&
2019 $this->obj->getRenderedTime() !=
"" &&
2020 $this->obj->old_nr == 0)
2023 $output = $this->obj->getRenderedContent();
2030 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2034 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2037 $args = array(
'/_xml' => $content,
'/_xsl' => $xsl );
2041 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", NULL, $args, $params);
2045 && $this->obj->old_nr == 0)
2048 $this->obj->writeRenderedContent($output, $md5);
2060 $ilUser->getPref(
"ilPageEditor_HTMLMode") !=
"disable")
2063 $output = str_replace(
"<",
"<",$output);
2064 $output = str_replace(
">",
">",$output);
2066 $output = str_replace(
"&",
"&", $output);
2100 $output = str_replace(
"\n",
"", $output);
2104 if (is_array($qhtml))
2106 foreach ($qhtml as $k => $h)
2108 $output = str_replace($this->pl_start.
"Question;il__qst_$k".$this->pl_end,
" ".$h, $output);
2117 $output =
'<div class="il_editarea_disabled">'.$output.
'</div>';
2121 $output = $this->obj->insertSourceCodeParagraphs($output, $this->
getOutputMode());
2123 $ilBench->stop(
"ContentPresentation",
"ilPageObjectGUI_showPage");
2131 if (
$_GET[
"updated_pc_id_str"] !=
"")
2133 echo
$_GET[
"updated_pc_id_str"];
2136 $tpl->setCurrentBlock(
"edit_page");
2137 $tpl->parseCurrentBlock();
2138 echo
$tpl->get(
"edit_page");
2171 while (is_int($start = strpos($output,
"<!--ParStart-->")) &&
2172 is_int($end = strpos($output,
"<!--ParEnd-->", $start)))
2174 $output = substr($output, 0, $start).
2175 str_replace(array(
"{",
"}"), array(
"{",
"}"),
2176 substr($output, $start + 15, $end - ($start + 15))).
2177 substr($output, $end + 13);
2193 return array(
"deactivatePage" => $lng->txt(
"cont_deactivate_page"),
2194 "activatePage" => $lng->txt(
"cont_activate_page"));
2205 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2209 $list->setListTitle($lng->txt(
"actions"));
2210 $list->setId(
"copage_act");
2218 $list->addItem($captions[
"deactivatePage"],
"",
2219 $ilCtrl->getLinkTarget($this,
"deactivatePage"));
2223 $list->addItem($captions[
"activatePage"],
"",
2224 $ilCtrl->getLinkTarget($this,
"activatePage"));
2227 $a_tpl->setVariable(
"PAGE_ACTIONS", $list->getHTML());
2234 $list->addItem($lng->txt(
"cont_initial_attached_content"),
"",
2235 $ilCtrl->getLinkTarget($this,
"initialOpenedContent"));
2240 $a_tpl->setVariable(
"PAGE_ACTIONS", $list->getHTML());
2243 $lng->loadLanguageModule(
"content");
2245 $list->setListTitle($lng->txt(
"cont_edit_mode"));
2246 $list->setId(
"copage_ed_mode");
2249 if ($sel_media_mode ==
"enable")
2251 $ilCtrl->setParameter($this,
"media_mode",
"disable");
2252 $list->addItem($lng->txt(
"cont_deactivate_media"),
"",
2253 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2257 $ilCtrl->setParameter($this,
"media_mode",
"enable");
2258 $list->addItem($lng->txt(
"cont_activate_media"),
"",
2259 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2261 $ilCtrl->setParameter($this,
"media_mode",
"");
2266 if ($sel_html_mode ==
"enable")
2268 $ilCtrl->setParameter($this,
"html_mode",
"disable");
2269 $list->addItem($lng->txt(
"cont_deactivate_html"),
"",
2270 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2274 $ilCtrl->setParameter($this,
"html_mode",
"enable");
2275 $list->addItem($lng->txt(
"cont_activate_html"),
"",
2276 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2279 $ilCtrl->setParameter($this,
"html_mode",
"");
2282 if ($sel_js_mode ==
"enable")
2284 $ilCtrl->setParameter($this,
"js_mode",
"disable");
2285 $list->addItem($lng->txt(
"cont_deactivate_js"),
"",
2286 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2290 $ilCtrl->setParameter($this,
"js_mode",
"enable");
2291 $list->addItem($lng->txt(
"cont_activate_js"),
"",
2292 $ilCtrl->getLinkTarget($this,
"setEditMode"));
2294 $ilCtrl->setParameter($this,
"js_mode",
"");
2296 $a_tpl->setVariable(
"EDIT_MODE", $list->getHTML());
2306 if (
$_GET[
"media_mode"] !=
"")
2308 if (
$_GET[
"media_mode"] ==
"disable")
2310 $ilUser->writePref(
"ilPageEditor_MediaMode",
"disable");
2314 $ilUser->writePref(
"ilPageEditor_MediaMode",
"");
2317 if (
$_GET[
"html_mode"] !=
"")
2319 if (
$_GET[
"html_mode"] ==
"disable")
2321 $ilUser->writePref(
"ilPageEditor_HTMLMode",
"disable");
2325 $ilUser->writePref(
"ilPageEditor_HTMLMode",
"");
2328 if (
$_GET[
"js_mode"] !=
"")
2330 if (
$_GET[
"js_mode"] ==
"disable")
2332 $ilUser->writePref(
"ilPageEditor_JavaScript",
"disable");
2336 $ilUser->writePref(
"ilPageEditor_JavaScript",
"");
2340 $ilCtrl->redirect($this,
"edit");
2348 $a_int_links =
false, $a_wiki_links =
false, $a_keywords =
false,
2349 $a_style_id = 0, $a_paragraph_styles =
true, $a_save_return =
true,
2356 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
2358 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
2360 $btpl =
new ilTemplate(
"tpl.tiny_menu.html",
true,
true,
"Services/COPage");
2365 $btpl->touchBlock(
"debug_ghost");
2369 $btpl->setCurrentBlock(
"pword_button");
2372 $btpl->parseCurrentBlock();
2374 $lng->txt(
"cont_pword"),
2378 $btpl->setCurrentBlock(
"blist_button");
2381 $btpl->parseCurrentBlock();
2383 $lng->txt(
"cont_blist"),
2387 $btpl->setCurrentBlock(
"nlist_button");
2390 $btpl->parseCurrentBlock();
2392 $lng->txt(
"cont_nlist"),
2396 $btpl->setCurrentBlock(
"list_indent");
2399 $btpl->parseCurrentBlock();
2401 $lng->txt(
"cont_list_indent"),
2406 $btpl->setCurrentBlock(
"list_outdent");
2409 $btpl->parseCurrentBlock();
2411 $lng->txt(
"cont_list_outdent"),
2416 $btpl->touchBlock(
"bb_ilink_button");
2424 $btpl->setCurrentBlock(
"rformat_button");
2427 $btpl->parseCurrentBlock();
2431 if ($a_paragraph_styles)
2434 $btpl->setCurrentBlock(
"new_par");
2435 $btpl->setVariable(
"IMG_NEWPAR",
"+");
2436 $btpl->parseCurrentBlock();
2440 $btpl->setCurrentBlock(
"par_edit");
2441 $btpl->setVariable(
"TXT_PAR_FORMAT", $lng->txt(
"cont_par_format"));
2442 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
2447 $lng->txt(
"cont_paragraph_styles"),
"iltinymenu_bd");
2449 $btpl->parseCurrentBlock();
2454 $btpl->setCurrentBlock(
"bb_kw_button");
2455 $btpl->setVariable(
"CC_KW",
"kw");
2456 $btpl->parseCurrentBlock();
2464 $btpl->setCurrentBlock(
"bb_wikilink_button");
2465 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"obj_wiki"));
2466 $btpl->parseCurrentBlock();
2473 include_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
2477 if (in_array($c, array(
"com",
"quot",
"acc",
"code")))
2482 $a_par_type,
"active_".$c,
true))
2485 if ($aset->get(
"use_physical"))
2487 $cc_code = str_replace(array(
"str",
"emp",
"imp"), array(
"B",
"I",
"U"), $cc_code);
2490 if ($c !=
"tex" ||
$mathJaxSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
2492 $btpl->setCurrentBlock(
"bb_".$c.
"_button");
2493 $btpl->setVariable(
"CC_".strtoupper($c), $cc_code);
2494 $btpl->parseCurrentBlock();
2496 $lng->txt(
"cont_cc_".$c),
2514 $btpl->setCurrentBlock(
"save_return");
2515 $btpl->setVariable(
"TXT_SAVE_RETURN", $lng->txt(
"save_return"));
2516 $btpl->parseCurrentBlock();
2521 $btpl->setCurrentBlock(
"bb_anc_button");
2522 $btpl->setVariable(
"CC_ANC",
"anc");
2523 $btpl->parseCurrentBlock();
2535 $btpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
2536 $btpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
2538 $btpl->setVariable(
"TXT_CHAR_FORMAT", $lng->txt(
"cont_char_format"));
2539 $btpl->setVariable(
"TXT_LISTS", $lng->txt(
"cont_lists"));
2540 $btpl->setVariable(
"TXT_LINKS", $lng->txt(
"cont_links"));
2541 $btpl->setVariable(
"TXT_MORE_FUNCTIONS", $lng->txt(
"cont_more_functions"));
2542 $btpl->setVariable(
"TXT_SAVING", $lng->txt(
"cont_saving"));
2544 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
2547 $lng->txt(
"cont_more_character_styles"),
"iltinymenu_bd");
2549 return $btpl->get();
2561 $link_info =
"<IntLinkInfos>";
2562 $targetframe =
"None";
2563 foreach ($int_links as $int_link)
2565 $target = $int_link[
"Target"];
2566 if (substr($target, 0, 4) ==
"il__")
2570 $type = $int_link[
"Type"];
2572 $targetframe = ($int_link[
"TargetFrame"] !=
"")
2573 ? $int_link[
"TargetFrame"]
2577 if ($targetframe !=
"None")
2583 $anc = $anc_add =
"";
2584 if ($int_link[
"Anchor"] !=
"")
2586 $anc = $int_link[
"Anchor"];
2587 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
2594 case "StructureObject":
2596 if ($type ==
"PageObject")
2598 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
2602 $href =
"./goto.php?target=st_".$target_id;
2606 case "GlossaryItem":
2607 if ($targetframe ==
"None")
2609 $targetframe =
"Glossary";
2611 $href =
"./goto.php?target=git_".$target_id;
2615 $ilCtrl->setParameter($this,
"mob_id",
$target_id);
2617 $href = $ilCtrl->getLinkTarget($this,
"displayMedia");
2618 $ilCtrl->setParameter($this,
"mob_id",
"");
2621 case "RepositoryItem":
2624 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
2629 $anc_par =
'Anchor="'.$anc.
'"';
2630 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".$anc_par.
" ".
2631 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" />";
2634 $link_info.=
"</IntLinkInfos>";
2643 $this->obj->buildDom();
2644 $files = $this->obj->collectFileItems();
2647 require_once(
"./Modules/File/classes/class.ilObjFile.php");
2651 if (!in_array($file_id, $files))
2655 $fileObj =&
new ilObjFile($file_id,
false);
2656 $fileObj->sendFile();
2673 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Modules/LearningModule");
2674 $tpl->setCurrentBlock(
"ilMedia");
2682 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2684 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2686 $pg_obj->buildDom();
2688 if (!empty (
$_GET[
"pg_id"]))
2691 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2705 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2706 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2712 $mode =
"fullscreen";
2719 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2720 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' =>
"",
2721 'ref_id' =>
$_GET[
"ref_id"],
'webspace_path' => $wb_path);
2722 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2728 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2731 $tpl->setVariable(
"MEDIA_CONTENT", $output);
2742 $pg_obj->send_paragraph(
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
2751 $start = strpos($a_html,
"[[[[[Map;");
2754 $end = strpos($a_html,
"]]]]]", $start);
2759 $param = substr($a_html, $start + 9, $end - $start - 9);
2761 $param = explode(
";", $param);
2762 if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2]))
2764 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
2766 $map_gui->setMapId(
"map_".$i);
2767 $map_gui->setLatitude($param[0]);
2768 $map_gui->setLongitude($param[1]);
2769 $map_gui->setZoom($param[2]);
2770 $map_gui->setWidth($param[3].
"px");
2771 $map_gui->setHeight($param[4].
"px");
2772 $map_gui->setEnableTypeControl(
true);
2773 $map_gui->setEnableNavigationControl(
true);
2774 $map_gui->setEnableCentralMarker(
true);
2775 $h2 = substr($a_html, 0, $start).
2776 $map_gui->getHtml().
2777 substr($a_html, $end + 5);
2781 $start = strpos($a_html,
"[[[[[Map;", $start + 5);
2785 $end = strpos($a_html,
"]]]]]", $start);
2800 $start = strpos($a_html,
"{{{{{ContentInclude;");
2803 $end = strpos($a_html,
"}}}}}", $start);
2808 $param = substr($a_html, $start + 20, $end - $start - 20);
2809 $param = explode(
";", $param);
2811 if ($param[0] ==
"mep" && is_numeric($param[1]) && $param[2] <= 0)
2813 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
2829 $html = $page_gui->getRawContent();
2835 $html =
"// ".$lng->txt(
"cont_missing_snippet").
" //";
2838 $h2 = substr($a_html, 0, $start).
2840 substr($a_html, $end + 5);
2844 $start = strpos($a_html,
"{{{{{ContentInclude;", $start + 5);
2848 $end = strpos($a_html,
"}}}}}", $start);
2864 include_once(
"./Services/Utilities/classes/class.ilStr.php");
2868 $page_heads = array();
2869 foreach ($offsets as $os)
2871 $level = (int) substr($a_output, $os + 10, 1);
2872 if (in_array($level, array(1,2,3)))
2874 $anchor = str_replace(
"TocH",
"TocA",
2875 substr($a_output, $os, strpos($a_output,
"<", $os) - $os - 3)
2879 $tag_start = stripos($a_output,
"<h".$level.
" ", $os);
2880 $tag_end = stripos($a_output,
"</h".$level.
">", $tag_start);
2881 $head = substr($a_output, $tag_start, $tag_end - $tag_start);
2884 $text_start = stripos($head,
">") + 1;
2885 $text_end = strripos($head,
"<!--", $text_start);
2886 $text = substr($head, $text_start, $text_end - $text_start);
2887 $page_heads[] = array(
"level" => $level,
"text" => $text,
2888 "anchor" => $anchor);
2892 if (count($page_heads) > 1)
2894 include_once(
"./Services/UIComponent/NestedList/classes/class.ilNestedList.php");
2896 $list->setAutoNumbering(
true);
2897 $list->setListClass(
"ilc_page_toc_PageTOCList");
2898 $list->setItemClass(
"ilc_page_toc_PageTOCItem");
2906 foreach ($page_heads as $ind => $h)
2913 if ($h[
"level"] == 2 && $c_par[1] > 0)
2917 if ($h[
"level"] == 3 && $c_par[2] > 0)
2922 $h[
"text"] = str_replace(
"<!--PageTocPH-->",
"", $h[
"text"]);
2926 "<a href='#".$h[
"anchor"].
"' class='ilc_page_toc_PageTOCLink'>".$h[
"text"].
"</a>",
2930 if ($h[
"level"] == 1)
2935 if ($h[
"level"] == 2)
2943 $tpl->setVariable(
"PAGE_TOC", $list->getHTML());
2944 $tpl->setVariable(
"TXT_PAGE_TOC", $lng->txt(
"cont_page_toc"));
2945 $tpl->setVariable(
"TXT_HIDE", $lng->txt(
"hide"));
2946 $tpl->setVariable(
"TXT_SHOW", $lng->txt(
"show"));
2948 $a_output = str_replace(
"{{{{{PageTOC}}}}}",
2949 $tpl->get(), $a_output);
2950 $numbers = $list->getNumbers();
2952 if (count($numbers) > 0)
2954 include_once(
"./Services/Utilities/classes/class.ilStr.php");
2955 foreach ($numbers as
$n)
2964 $a_output = str_replace(
"{{{{{PageTOC}}}}}",
2984 include_once(
"./Services/COPage/classes/class.ilPCResourcesGUI.php");
3004 $a_output = str_replace(
"{{{{{LV_show_adv}}}}}",
3005 $lng->txt(
"cont_show_adv"), $a_output);
3006 $a_output = str_replace(
"{{{{{LV_hide_adv}}}}}",
3007 $lng->txt(
"cont_hide_adv"), $a_output);
3011 $a_output = str_replace(
"{{{{{LV_show_adv}}}}}",
3013 $a_output = str_replace(
"{{{{{LV_hide_adv}}}}}",
3037 $a_tpl->setCurrentBlock(
"help_img");
3039 $a_tpl->parseCurrentBlock();
3040 $a_tpl->setCurrentBlock(
"help_item");
3041 $a_tpl->setVariable(
"TXT_HELP", $lng->txt(
"cont_add_elements"));
3042 $a_tpl->parseCurrentBlock();
3044 $a_tpl->setCurrentBlock(
"help_img");
3046 $a_tpl->parseCurrentBlock();
3047 $a_tpl->setCurrentBlock(
"help_img");
3049 $a_tpl->parseCurrentBlock();
3050 $a_tpl->setCurrentBlock(
"help_item");
3051 $a_tpl->setVariable(
"TXT_HELP", $lng->txt(
"cont_drag_and_drop_elements"));
3052 $a_tpl->parseCurrentBlock();
3054 $a_tpl->setCurrentBlock(
"help_img");
3056 $a_tpl->parseCurrentBlock();
3057 $a_tpl->setCurrentBlock(
"help_item");
3058 $a_tpl->setVariable(
"TXT_HELP", $lng->txt(
"cont_double_click_to_delete"));
3059 $a_tpl->parseCurrentBlock();
3061 $a_tpl->setCurrentBlock(
"help");
3062 $a_tpl->parseCurrentBlock();
3085 $ilCtrl->redirect($this,
"preview");
3088 include_once(
"./Services/Captcha/classes/class.ilCaptchaUtil.php");
3089 if ($ilUser->getId() == ANONYMOUS_USER_ID &&
3091 !$ilUser->isCaptchaVerified())
3094 if (
$_POST[
"captcha_code"] && $form->checkInput())
3096 $ilUser->setCaptchaVerified(
true);
3100 return $form->getHTML();
3110 $html.=
"<br /><br />".$this->getNotesHTML();
3128 $html = $this->
edit();
3130 $tpl->addOnLoadCode(
"ilCOPage.insertJSAtPlaceholder('".
3144 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3148 include_once(
"./Services/Captcha/classes/class.ilCaptchaInputGUI.php");
3151 $form->addItem($ci);
3153 $form->addCommandButton(
"edit", $lng->txt(
"ok"));
3155 $form->setTitle($lng->txt(
"cont_captcha_verification"));
3156 $form->setFormAction($ilCtrl->getFormAction($this));
3183 $this->tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
3184 $this->tpl->setCurrentBlock(
"ContentStyle");
3185 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 0);
3186 $this->tpl->parseCurrentBlock();
3190 $this->tpl->setCurrentBlock(
"ilMedia");
3192 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3194 if (!empty (
$_GET[
"pg_id"]))
3196 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3203 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
3217 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
3218 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
3226 $mode =
"fullscreen";
3227 $params = array (
'mode' => $mode,
'webspace_path' => $wb_path);
3228 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
3233 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
3243 if(is_array($a_error))
3245 $error_str =
"<b>Validation Error(s):</b><br>";
3246 foreach ($a_error as $error)
3248 $err_mess = implode($error,
" - ");
3249 if (!is_int(strpos($err_mess,
":0:")))
3251 $error_str .= htmlentities($err_mess).
"<br />";
3254 $this->tpl->setVariable(
"MESSAGE", $error_str);
3270 $tpl->addJavaScript(
"./Services/COPage/js/page_history.js");
3272 include_once(
"./Services/COPage/classes/class.ilPageHistoryTableGUI.php");
3274 $table_gui->setId(
"hist_table");
3276 $entries[] = array(
'page_id' => $this->
getPageObject()->getId(),
3281 'sortkey' => 999999,
3283 $table_gui->setData($entries);
3284 return $table_gui->getHTML();
3299 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
3303 $ilCtrl->setParameter($this,
"rollback_nr",
$_GET[
"old_nr"]);
3304 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"rollback"));
3305 $c_gui->setHeaderText($lng->txt(
"cont_rollback_confirmation"));
3306 $c_gui->setCancel($lng->txt(
"cancel"),
"history");
3307 $c_gui->setConfirm($lng->txt(
"confirm"),
"rollback");
3309 $hentry = $this->obj->getHistoryEntry(
$_GET[
"old_nr"]);
3311 $c_gui->addItem(
"id[]",
$_GET[
"old_nr"],
3314 $tpl->setContent($c_gui->getHTML());
3329 $hentry = $this->obj->getHistoryEntry(
$_GET[
"rollback_nr"]);
3331 if ($hentry[
"content"] !=
"")
3333 $this->obj->setXMLContent($hentry[
"content"]);
3334 $this->obj->buildDom(
true);
3335 if ($this->obj->update())
3337 $ilCtrl->redirect($this,
"history");
3340 $ilCtrl->redirect($this,
"history");
3353 $ilHelp->setScreenIdComponent(
"copg");
3377 $ilTabs->addTarget(
"pg", $ilCtrl->getLinkTarget($this,
"preview")
3378 , array(
"",
"preview"));
3382 $ilTabs->addTarget(
"edit", $ilCtrl->getLinkTarget($this,
"edit")
3383 , array(
"",
"edit"));
3390 $ilTabs->addTarget(
"edit", $ilCtrl->getLinkTarget($this,
"edit")
3391 , array(
"",
"edit"));
3394 $ilTabs->addTarget(
"cont_preview", $ilCtrl->getLinkTarget($this,
"preview")
3395 , array(
"",
"preview"));
3401 if ($this->use_meta_data && !$this->layout_mode)
3403 $ilTabs->addTarget(
"meta_data",
3404 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
3405 "",
"ilmdeditorgui");
3411 $lm_set->get(
"page_history", 1))
3413 $ilTabs->addTarget(
"history", $this->ctrl->getLinkTarget($this,
"history")
3414 ,
"history", get_class($this));
3426 $ilTabs->addTarget(
"clipboard", $this->ctrl->getLinkTargetByClass(
"ilEditClipboardGUI",
"view")
3427 ,
"view",
"ilEditClipboardGUI");
3432 $ilTabs->addTarget(
"cont_activation", $this->ctrl->getLinkTarget($this,
"editActivation"),
3433 "editActivation", get_class($this));
3438 $ilTabs->addTarget(
"news",
3439 $this->ctrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNews"),
3440 "",
"ilnewsitemgui");
3444 if (is_array($this->tab_hook))
3446 $func = $this->tab_hook[
"func"];
3447 $this->tab_hook[
"obj"]->$func();
3464 $tpl =
new ilTemplate(
"tpl.page_compare.html",
true,
true,
"Services/COPage");
3465 $compare = $this->obj->compareVersion(
$_POST[
"left"],
$_POST[
"right"]);
3468 $lpage = $compare[
"l_page"];
3471 $lpage_gui->setPageObject($lpage);
3472 $lpage_gui->setPreventHTMLUnmasking(
true);
3474 $lpage_gui->setCompareMode(
true);
3475 $lhtml = $lpage_gui->showPage();
3477 $lhtml = str_replace(
"<br />",
"<br />", $lhtml);
3478 $tpl->setVariable(
"LEFT", $lhtml);
3481 $rpage = $compare[
"r_page"];
3484 $rpage_gui->setPageObject($rpage);
3485 $rpage_gui->setPreventHTMLUnmasking(
true);
3487 $rpage_gui->setCompareMode(
true);
3488 $rhtml = $rpage_gui->showPage();
3490 $rhtml = str_replace(
"<br />",
"<br />", $rhtml);
3491 $tpl->setVariable(
"RIGHT", $rhtml);
3493 $tpl->setVariable(
"TXT_NEW", $lng->txt(
"cont_pc_new"));
3494 $tpl->setVariable(
"TXT_MODIFIED", $lng->txt(
"cont_pc_modified"));
3495 $tpl->setVariable(
"TXT_DELETED", $lng->txt(
"cont_pc_deleted"));
3505 $a_html = str_replace(
"[ilDiffInsStart]",
'<span class="ilDiffIns">', $a_html);
3506 $a_html = str_replace(
"[ilDiffDelStart]",
'<span class="ilDiffDel">', $a_html);
3507 $a_html = str_replace(
"[ilDiffInsEnd]",
'</span>', $a_html);
3508 $a_html = str_replace(
"[ilDiffDelEnd]",
'</span>', $a_html);
3520 $atpl =
new ilTemplate(
"tpl.page_activation.php",
true,
true,
"Services/COPage");
3523 $atpl->setVariable(
"FORM", $this->form->getHTML());
3524 $atpl->setCurrentBlock(
"updater");
3525 $atpl->setVariable(
"UPDATER_FRAME", $this->exp_frame);
3526 $atpl->setVariable(
"EXP_ID_UPDATER", $this->exp_id);
3527 $atpl->setVariable(
"HREF_UPDATER", $this->exp_target_script);
3528 $atpl->parseCurrentBlock();
3529 $tpl->setContent($atpl->get());
3539 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3541 $this->form->setFormAction($ilCtrl->getFormAction($this));
3542 $this->form->setTitle($lng->txt(
"cont_page_activation"));
3546 $rad_op1 =
new ilRadioOption($lng->txt(
"cont_activated"),
"activated");
3548 $rad->addOption($rad_op1);
3549 $rad_op2 =
new ilRadioOption($lng->txt(
"cont_deactivated"),
"deactivated");
3550 $rad->addOption($rad_op2);
3551 $rad_op3 =
new ilRadioOption($lng->txt(
"cont_scheduled_activation"),
"scheduled");
3554 $dt_prop->setShowTime(
true);
3558 $rad_op3->addSubItem($dt_prop2);
3561 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"cont_show_activation_info"),
"show_activation_info");
3562 $cb->
setInfo($this->lng->txt(
"cont_show_activation_info_info"));
3563 $rad_op3->addSubItem($cb);
3566 $rad->addOption($rad_op3);
3568 $this->form->addCommandButton(
"saveActivation", $lng->txt(
"save"));
3570 $this->form->addItem($rad);
3579 $values[
"activation"] =
"deactivated";
3582 $values[
"activation"] =
"activated";
3585 $dt_prop = $this->form->getItemByPostVar(
"start");
3588 $values[
"activation"] =
"scheduled";
3592 $dt_prop = $this->form->getItemByPostVar(
"end");
3595 $values[
"activation"] =
"scheduled";
3600 $values[
"show_activation_info"] = $this->
getPageObject()->getShowActivationInfo();
3602 $this->form->setValuesByArray($values);
3614 if ($this->form->checkInput())
3620 if (
$_POST[
"activation"] ==
"deactivated")
3624 if (
$_POST[
"activation"] ==
"scheduled")
3628 $this->form->getItemByPostVar(
"start")->getDate()->get(
IL_CAL_DATETIME));
3630 $this->form->getItemByPostVar(
"end")->getDate()->get(
IL_CAL_DATETIME));
3634 $ilCtrl->redirect($this,
"editActivation");
3636 $this->form->getValuesByPost();
3637 $tpl->setContent($this->form->getHTML());
3649 function getNotesHTML($a_content_object = null, $a_enable_private_notes =
true, $a_enable_public_notes =
false, $a_enable_notes_deletion =
false, $a_callback = null)
3653 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
3656 if(!$a_content_object)
3658 $notes_gui =
new ilNoteGUI($this->notes_parent_id,
3659 (
int)$this->obj->getId(),
"pg");
3661 $a_enable_private_notes =
true;
3662 $a_enable_public_notes =
true;
3663 $a_enable_notes_deletion =
false;
3668 $notes_gui =
new ilNoteGUI($a_content_object->getParentId(),
3669 $a_content_object->getId(), $a_content_object->getParentType());
3672 if($a_enable_private_notes)
3676 if ($a_enable_public_notes)
3678 $notes_gui->enablePublicNotes();
3679 if ((
bool)$a_enable_notes_deletion)
3681 $notes_gui->enablePublicNotesDeletion(
true);
3687 $notes_gui->addObserver($a_callback);
3690 $next_class = $this->ctrl->getNextClass($this);
3691 if ($next_class ==
"ilnotegui")
3693 $html = $this->ctrl->forwardCommand($notes_gui);
3697 $html = $notes_gui->getNotesHTML();
3707 require_once
'./Modules/Scorm2004/classes/class.ilQuestionExporter.php';
3710 if (count($q_ids) > 0)
3712 foreach ($q_ids as $q_id)
3715 $js[$q_id] = $q_exporter->exportQuestion($q_id);
3738 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
3741 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/pure.js");
3742 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/question_handling.js");
3743 $tpl->addCss(
"./Modules/Scorm2004/templates/default/question_handling.css");
3747 $tpl->addJavaScript(
"./Services/COPage/js/ilCOPageQuestionHandler.js");
3748 $url = $ilCtrl->getLinkTarget($this,
"processAnswer",
"",
true,
false);
3749 $tpl->addOnloadCode(
"ilCOPageQuestionHandler.initCallback('".$url.
"');");
3767 $a_tpl->addOnloadCode(self::getJSTextInitCode($a_lang).
3768 'ilCOPagePres.updateQuestionOverviews();
3784 $a_lang = $ilUser->getLanguage();
3789 ilias.questions.txt.wrong_answers = "'.$lng->txtlng(
"content",
"cont_wrong_answers", $a_lang).
'";
3790 ilias.questions.txt.wrong_answers_single = "'.$lng->txtlng(
"content",
"cont_wrong_answers_single", $a_lang).
'";
3791 ilias.questions.txt.tries_remaining = "'.$lng->txtlng(
"content",
"cont_tries_remaining", $a_lang).
'";
3792 ilias.questions.txt.please_try_again = "'.$lng->txtlng(
"content",
"cont_please_try_again", $a_lang).
'";
3793 ilias.questions.txt.all_answers_correct = "'.$lng->txtlng(
"content",
"cont_all_answers_correct", $a_lang).
'";
3794 ilias.questions.txt.nr_of_tries_exceeded = "'.$lng->txtlng(
"content",
"cont_nr_of_tries_exceeded", $a_lang).
'";
3795 ilias.questions.txt.correct_answers_shown = "'.$lng->txtlng(
"content",
"cont_correct_answers_shown", $a_lang).
'";
3796 ilias.questions.txt.correct_answers_also = "'.$lng->txtlng(
"content",
"cont_correct_answers_also", $a_lang).
'";
3797 ilias.questions.txt.correct_answer_also = "'.$lng->txtlng(
"content",
"cont_correct_answer_also", $a_lang).
'";
3798 ilias.questions.txt.ov_all_correct = "'.$lng->txtlng(
"content",
"cont_ov_all_correct", $a_lang).
'";
3799 ilias.questions.txt.ov_some_correct = "'.$lng->txtlng(
"content",
"cont_ov_some_correct", $a_lang).
'";
3800 ilias.questions.txt.ov_wrong_answered = "'.$lng->txtlng(
"content",
"cont_ov_wrong_answered", $a_lang).
'";
3801 ilias.questions.txt.please_select = "'.$lng->txtlng(
"content",
"cont_please_select", $a_lang).
'";
3802 ilias.questions.refresh_lang();
3821 include_once(
"./Services/COPage/classes/class.ilPageQuestionProcessor.php");
3838 require_once
'./Modules/Scorm2004/classes/class.ilQuestionExporter.php';
3839 $a_output =
"<script>var ScormApi=null;".ilQuestionExporter::questionsJS().
"</script>".$a_output;
3860 $ilTabs->activateTab(
"edit");
3863 $this->tpl->setContent($form->getHTML());
3876 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3880 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
3881 $ac =
new ilLinkInputGUI($this->lng->txt(
'cont_resource'),
'opened_content');
3883 $ac->setInternalLinkDefault(
"Media_Media", 0);
3884 $ac->setInternalLinkFilterTypes(array(
"PageObject_FAQ",
"GlossaryItem",
"Media_Media",
"Media_FAQ"));
3885 $val = $this->obj->getInitialOpenedContent();
3886 if ($val[
"id"] !=
"" && $val[
"type"] !=
"")
3888 $ac->setValue($val[
"type"].
"|".$val[
"id"].
"|".$val[
"target"]);
3891 $form->addItem($ac);
3893 $form->addCommandButton(
"saveInitialOpenedContent", $this->lng->txt(
"save"));
3894 $form->addCommandButton(
"edit", $this->lng->txt(
"cancel"));
3895 $form->setTitle($this->lng->txt(
"cont_initial_attached_content"));
3896 $form->setFormAction($ilCtrl->getFormAction($this));
3911 $this->obj->saveInitialOpenedContent(
3918 $ilCtrl->redirect($this,
"edit");