4 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
5 require_once(
"./Services/MainMenu/classes/class.ilMainMenuGUI.php");
6 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
38 $lng->loadLanguageModule(
"content");
43 $this->offline =
false;
44 $this->frames = array();
46 $this->ctrl->saveParameter($this, array(
"ref_id"));
50 $type = $this->ilias->obj_factory->getTypeByRefId(
$_GET[
"ref_id"]);
56 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
61 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
67 $this->lm =& $this->lm_gui->object;
69 if(IS_PAYMENT_ENABLED)
71 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
74 else $this->needs_to_be_purchased =
false;
77 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
79 if (!$this->lm->getOnline())
81 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
85 $this->lm_tree =
new ilTree($this->lm->getId());
87 $this->lm_tree->setTreeTablePK(
"lm_id");
92 $this->
abstract =
true;
94 if((count(
$_POST[
"tr_id"]) > 1) or
95 (!
$_POST[
"target"] and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")))
97 $this->
abstract =
true;
99 else if(
$_GET[
"obj_id"] or (
$_POST[
"action"] ==
"show") or (
$_POST[
"action"] ==
"show_citation"))
101 $this->
abstract =
false;
115 if(IS_PAYMENT_ENABLED)
117 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
118 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
121 if(!((
int)
$_GET[
'obj_id'] &&
123 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
126 unset(
$_GET[
'obj_id']);
128 $this->tpl->getStandardTemplate();
131 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
133 $ret = $this->ctrl->forwardCommand($pp);
141 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
142 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
143 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
145 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
148 $next_class = $this->ctrl->getNextClass($this);
149 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
158 $obj_id =
$_GET[
"obj_id"];
159 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
160 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
161 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
169 case "ilinfoscreengui":
173 case "ilcommonactiondispatchergui":
174 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
176 $gui->enableCommentsSettings(
false);
177 $this->ctrl->forwardCommand($gui);
180 case "ilpageobjectgui":
181 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
182 if (
$_GET[
"pg_type"] !=
"glo")
191 $ret = $ilCtrl->forwardCommand($page_gui);
206 $this->offline = $a_offline;
225 $this->export_format = $a_format;
235 return $this->export_format;
257 $q =
"DELETE FROM lo_access ".
258 "WHERE usr_id = ".$ilDB->quote((
int)
$usr_id,
"integer").
" ".
259 "AND lm_id = ".$ilDB->quote((
int) $lm_id,
"integer");
260 $ilDB->manipulate($q);
261 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
264 $q =
"INSERT INTO lo_access ".
265 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
267 "(".$ilDB->now().
",".
268 $ilDB->quote((
int) $usr_id,
"integer").
",".
269 $ilDB->quote((
int) $lm_id,
"integer").
",".
270 $ilDB->quote((
int) $obj_id,
"integer").
",".
271 $ilDB->quote(
$title,
"text").
")";
272 $ilDB->manipulate($q);
285 switch($this->lm->getType())
288 $this->lm_gui->export();
304 if (
$_POST[
"cmd"][
"cancel"] !=
"")
306 $this->ctrl->setParameter($this,
"frame",
"maincontent");
307 $this->ctrl->redirect($this,
"layout");
310 switch($this->lm->getType())
314 $_GET[
"frame"] =
"maincontent";
317 $_GET[
"obj_id"] = $objRow[
"obj_id"];
319 $query =
"SELECT * FROM lm_data WHERE lm_id = ".
320 $ilDB->quote($objRow[
"obj_id"],
"integer").
326 while (is_array(
$row = $ilDB->fetchAssoc(
$result)) )
336 if(
$_POST[
"type"] ==
"pdf") $output .=
"<hr BREAK >\n";
337 if(
$_POST[
"type"] ==
"print") $output .=
"<p style=\"page-break-after:always\" />";
338 if(
$_POST[
"type"] ==
"html") $output .=
"<br><br><br><br>";
343 $o = $this->
layout(
"main.xml",
false);
345 $output .=
"<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_PageTitle\">".$this->lm->title.
"</div><p>";
348 $output .=
"\n<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td valign=top align=center>- ".$page.
" -</td></tr></table>\n";
353 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
355 if(
$_POST[
"type"] ==
"print")
357 $printTpl->touchBlock(
"printreq");
363 $css1 =
"./css/delos.css";
364 $css2 =
"./css/content.css";
366 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
368 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
369 $printTpl->setVariable(
"CONTENT",$output);
372 $printTpl->setCurrentBlock(
"SyntaxStyle");
373 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
375 $printTpl->parseCurrentBlock();
378 $html = $printTpl->get();
383 $this->lm->createExportDirectory();
384 $export_dir = $this->lm->getExportDirectory();
389 $fileName =
"offline";
390 $fileName = str_replace(
" ",
"_",$fileName);
392 if (!file_exists($export_dir.
"/".$fileName))
394 @mkdir($export_dir.
"/".$fileName);
395 @chmod($export_dir.
"/".$fileName, 0755);
397 @mkdir($export_dir.
"/".$fileName.
"/css");
398 @chmod($export_dir.
"/".$fileName.
"/css", 0755);
402 if(
$_POST[
"type"] ==
"xml")
405 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_GET[
"ref_id"]);
407 if ($tmp_obj->getType() ==
"dbk" )
409 require_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
415 else if(
$_POST[
"type"] ==
"print")
419 else if (
$_POST[
"type"]==
"html")
427 $css1 = file(
"./templates/default/delos.css");
428 $css1 = implode($css1,
"");
430 $fp = fopen($export_dir.
"/".$fileName.
"/css/delos.css",
"wb");
434 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".html",
"wb");
438 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
443 else if (
$_POST[
"type"]==
"pdf")
467 switch($this->lm->getType())
470 $this->lm_gui->offlineexportform();
491 $filename = preg_replace(
'/[^a-z0-9_]/i',
'_', $objRow[
"title"]);
493 $C = $this->lm_gui->showAbstract(array(1));
495 if (
$_GET[
"print"]==1)
497 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
498 $printTpl->touchBlock(
"printreq");
501 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
503 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
506 $printTpl->setCurrentBlock(
"SyntaxStyle");
507 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
509 $printTpl->parseCurrentBlock();
511 $printTpl->setVariable(
"CONTENT",$C);
513 echo $printTpl->get();
530 if(!is_array($a_attributes))
534 foreach ($a_attributes as $attribute)
536 $attr[$attribute->name()] = $attribute->value();
546 return $this->frames;
560 $layout = $this->lm->getLayout();
561 if ($this->lm->getLayoutPerPage())
565 if ((in_array(
$_GET[
"cmd"], array(
"media",
"glossary")) ||
566 !in_array(
$_GET[
"frame"], array(
"",
"_blank"))) &&
$_GET[
"from_page"] > 0)
568 $pg_id = (int)
$_GET[
"from_page"];
589 function layout($a_xml =
"main.xml", $doShow =
true)
593 $ilBench->start(
"ContentPresentation",
"layout");
600 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
604 include_once(
"./Modules/LearningModule/exceptions/class.ilLMPresentationException.php");
606 $layout.
"/".$a_xml.
".");
608 $this->layout_doc =& $doc;
612 $ilBench->start(
"ContentPresentation",
"layout_getFrameNode");
615 ?
"/ilLayout/ilFrame[1]"
616 :
"//ilFrame[@name='".$_GET[
"frame"].
"']";
619 if (count($found) != 1)
621 include_once(
"./Modules/LearningModule/exceptions/class.ilLMPresentationException.php");
623 " path ".
$path.
" in ".$layout.
"/".$a_xml.
". LM Layout is ".$this->lm->getLayout());
627 $ilBench->stop(
"ContentPresentation",
"layout_getFrameNode");
631 $attributes = $this->
attrib2arr($node->attributes());
633 $this->frames = array();
634 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
636 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
639 $content .= $this->
buildTag(
"end",
"frameset");
640 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
642 $this->tpl->setVariable(
"FS_CONTENT", $content);
645 $content = $this->tpl->get();
651 $ilBench->start(
"ContentPresentation",
"layout_processContentTag");
653 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
654 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
661 if(empty(
$_GET[
"obj_type"]))
663 $obj_type =
"PageObject";
667 $obj_type =
$_GET[
"obj_type"];
671 $childs = $node->child_nodes();
673 foreach($childs as $child)
675 if ($child->node_name() == $obj_type)
678 $attributes = $this->
attrib2arr($child->attributes());
684 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
685 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
689 $in_module = ($attributes[
"template_location"] ==
"module")
694 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
695 $this->tpl->setBodyClass(
"");
709 $style_name = $this->ilias->account->prefs[
"style"].
".css";
710 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
713 $childs = $node->child_nodes();
715 $ilBench->start(
"ContentPresentation",
"layout_processContentNodes");
716 foreach($childs as $child)
719 $child_attr = $this->
attrib2arr($child->attributes());
721 switch ($child->node_name())
729 $this->
ilTOC($child_attr[
"target_frame"]);
733 switch($this->lm->getType())
739 $content = $this->
ilPage($child);
746 $content = $this->lm_gui->showAbstract(
$_POST[
"target"]);
751 $content = $this->
ilPage($child);
766 case "ilLMNavigation":
769 if(
$_GET[
"obj_id"] or
771 (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")) or
772 $this->lm->getType() ==
'lm')
774 $ilBench->start(
"ContentPresentation",
"layout_lmnavigation");
776 $ilBench->stop(
"ContentPresentation",
"layout_lmnavigation");
789 $this->
ilJavaScript($child_attr[
"inline"], $child_attr[
"file"],
790 $child_attr[
"location"]);
813 $ilBench->stop(
"ContentPresentation",
"layout_processContentNodes");
815 $ilBench->stop(
"ContentPresentation",
"layout_processContentTag");
819 if (strcmp(
$_GET[
"frame"],
"topright") == 0) $this->tpl->fillJavaScriptFiles();
820 if (strcmp(
$_GET[
"frame"],
"right") == 0) $this->tpl->fillJavaScriptFiles();
821 if (strcmp(
$_GET[
"frame"],
"botright") == 0) $this->tpl->fillJavaScriptFiles();
825 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
830 $this->tpl->addJavascript(
"./Modules/LearningModule/js/LearningModule.js");
835 if (
$_GET[
"frame"] ==
"")
837 include_once(
"./Services/Authentication/classes/class.ilSessionIStorage.php");
839 $last_frame_url = $store->get(
"cf_".$this->lm->getId());
840 if ($last_frame_url !=
"")
842 $this->tpl->addOnLoadCode(
"il.LearningModule.setLastFrameUrl('".$last_frame_url.
"');");
845 if (in_array($layout, array(
"toc2windyn")))
847 $this->tpl->addOnLoadCode(
"il.LearningModule.setSaveUrl('".
848 $ilCtrl->getLinkTarget($this,
"saveFrameUrl",
"",
false,
false).
"');
849 il.LearningModule.openInitFrames();
856 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
857 $this->tpl->fillJavaScriptFiles();
858 $this->tpl->fillScreenReaderFocus();
860 $this->tpl->fillCssFiles();
865 $this->tpl->resetJavascript();
866 $this->tpl->resetCss();
868 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
871 if ($f[
"type"] ==
"js")
873 $this->tpl->addJavascript($f[
"target"]);
875 if ($f[
"type"] ==
"css")
877 $this->tpl->addCSS($f[
"target"]);
880 $this->tpl->fillJavaScriptFiles(
true);
881 $this->tpl->fillCssFiles(
true);
885 $this->tpl->fillBodyClass();
895 $this->tpl->fillTabs();
896 if ($this->fill_on_load_code)
898 $this->tpl->fillOnLoadCode();
900 $content = $this->tpl->get();
901 $content = str_replace(
"{",
"{", $content);
902 $content = str_replace(
"}",
"}", $content);
904 header(
'Content-type: text/html; charset=UTF-8');
909 $content = $this->tpl->get();
912 $ilBench->stop(
"ContentPresentation",
"layout");
925 include_once(
"./Services/Authentication/classes/class.ilSessionIStorage.php");
927 if (
$_GET[
"url"] !=
"")
929 $store->set(
"cf_".$this->lm->getId(),
$_GET[
"url"]);
933 $store->set(
"cf_".$this->lm->getId(),
$_GET[
"url"]);
945 if (
$_GET[
"frame"] !=
"_blank")
957 if (
$_GET[
"frame"] !=
"_blank")
963 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
973 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
974 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
984 return $this->tpl->get();
998 $this->tpl->touchBlock(
"pg_intro");
999 $this->tpl->touchBlock(
"pg_outro");
1007 $ilMainMenu->setSmallMode(
true);
1011 $ilMainMenu->setSmallMode(
false);
1017 $ilMainMenu->setLoginTargetPar(
"pg_".$page_id.
"_".$this->lm->getRefId());
1022 $this->tpl->touchBlock(
"pg_intro");
1023 $this->tpl->touchBlock(
"pg_outro");
1024 $this->tpl->setBodyClass(
"std");
1025 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
1035 $ilBench->start(
"ContentPresentation",
"ilTOC");
1036 require_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorer.php");
1037 if ($this->lm->cleanFrames())
1042 $exp->setExpandTarget($this->
getLink($this->lm->getRefId(),
$_GET[
"cmd"],
$_GET[
"obj_id"], $_GET[
"frame"]));
1043 $exp->setTargetGet(
"obj_id");
1044 if ($this->lm->cleanFrames())
1048 $exp->setFrameTarget(
"_top");
1057 $exp->setFrameTarget($a_target);
1059 $exp->addFilter(
"du");
1060 $exp->addFilter(
"st");
1063 if ($this->lm->cleanFrames())
1066 if ($this->deactivated_page)
1068 $page_id = $_GET[
"obj_id"];
1072 $path = $this->lm_tree->getPathId($page_id);
1073 $exp->setForceOpenPath(
$path);
1078 if ($this->chapter_has_no_active_page &&
1081 $exp->highlightNode($_GET[
"obj_id"]);
1085 if ($this->lm->getTOCMode() ==
"pages")
1087 if ($this->deactivated_page)
1089 $exp->highlightNode($_GET[
"obj_id"]);
1093 $exp->highlightNode($page_id);
1098 $exp->highlightNode($this->lm_tree->getParentId($page_id));
1105 if ($this->lm->getTOCMode() ==
"pages")
1107 $exp->addFilter(
"pg");
1109 $exp->setFiltered(
true);
1112 if ($_GET[
"lmexpand"] ==
"")
1114 $expand_keys = array();
1117 $expand_keys = array_keys(
$_SESSION[
"lmexpand"]);
1119 $_SESSION[
"lmexpand"] = array($this->lm_tree->readRootId());
1120 $expanded = $this->lm_tree->readRootId();
1124 $expanded = $_GET[
"lmexpand"];
1126 $exp->setExpand($expanded);
1130 $output = $exp->getOutput();
1152 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
1153 $this->tpl->setVariable(
"EXPLORER",$output);
1155 $this->tpl->setVariable(
"ACTION",
1156 $this->
getLink($this->lm->getRefId(), $_GET[
"cmd"],
"", $_GET[
"frame"]).
1157 "&lmexpand=".$_GET[
"lmexpand"]);
1159 $ilBench->stop(
"ContentPresentation",
"ilTOC");
1160 if ($_GET[
"lmexpand"] ==
"")
1163 foreach ($expand_keys as $k)
1176 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
1185 $this->tpl->setCurrentBlock(
"header_image");
1188 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.png");
1194 $this->tpl->parseCurrentBlock();
1195 $this->tpl->setCurrentBlock(
"lm_head");
1196 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
1197 $this->tpl->parseCurrentBlock();
1208 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1214 $showViewInFrameset =
true;
1216 if ($showViewInFrameset)
1222 $buttonTarget =
"_top";
1226 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
1227 $tpl_menu =&
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
1238 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1240 $tpl_menu->setCurrentBlock(
"edit_page");
1242 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
1243 "&obj_id=".$page_id.
"&to_page=1");
1244 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
1245 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
1246 $tpl_menu->parseCurrentBlock();
1251 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1253 $page_id.
"_".$this->lm->getRefId(),
1257 $title = $this->lm->getTitle();
1259 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
1260 if ($pg_title !=
"")
1262 $title.=
": ".$pg_title;
1267 $tpl_menu->setCurrentBlock(
"perma_link");
1268 $tpl_menu->setVariable(
"PERMA_LINK", $plinkgui->getHTML());
1269 $tpl_menu->parseCurrentBlock();
1273 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1293 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1295 $ilAccess, $this->lm->getType(),
$_GET[
"ref_id"], $this->lm->getId());
1298 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
1299 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
1300 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
1301 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
1303 $lg = $dispatcher->initHeaderAction();
1304 $lg->enableNotes(
true);
1305 $lg->enableComments($this->lm->publicNotes(),
false);
1309 $this->tpl->setVariable(
"HEAD_ACTION", $lg->getHeaderAction());
1313 return $lg->getHeaderAction();
1326 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1339 if (!$ilSetting->get(
"disable_notes"))
1346 if ($ilSetting->get(
"disable_comments"))
1351 if (!$this->lm->publicNotes())
1356 $next_class = $this->ctrl->getNextClass($this);
1358 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1366 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1371 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1372 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1374 $notes_gui->enablePrivateNotes();
1375 if ($this->lm->publicNotes())
1377 $notes_gui->enablePublicNotes();
1380 if ($next_class ==
"ilnotegui")
1382 $html = $this->ctrl->forwardCommand($notes_gui);
1386 $html = $notes_gui->getNotesHTML();
1388 $this->tpl->setVariable(
"NOTES", $html);
1397 global $ilLocator, $tree,
$ilCtrl;
1399 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1401 if (empty(
$_GET[
"obj_id"]))
1403 $a_id = $this->lm_tree->getRootId();
1407 $a_id =
$_GET[
"obj_id"];
1410 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1412 if (!$this->lm->cleanFrames())
1414 $frame_param =
$_GET[
"frame"];
1425 $frame_target =
"_top";
1430 $ilLocator->addItem(
"...",
"");
1432 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1433 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $par_id);
1434 $ilLocator->addItem(
1436 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset"),
1438 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1442 $ilLocator->setOffline(
true);
1445 if($this->lm_tree->isInTree($a_id))
1447 $path = $this->lm_tree->getPathFull($a_id);
1451 if (
$row[
"type"] !=
"pg")
1453 if(
$row[
"child"] != $this->lm_tree->getRootId())
1455 $ilLocator->addItem(
1458 $this->lm->isActiveNumbering()),50,
true),
1459 $this->
getLink(
$_GET[
"ref_id"],
"layout",
$row[
"child"], $frame_param,
"StructureObject"),
1464 $ilLocator->addItem(
1466 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1467 $frame_target,
$_GET[
"ref_id"]);
1475 $ilLocator->addItem(
1476 $this->lm->getTitle(),
1479 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1482 $ilLocator->addItem(
1483 $lm_obj->getTitle(),
1484 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1490 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1496 $this->tpl->setLocator();
1503 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1505 $this->chapter_has_no_active_page =
false;
1506 $this->deactivated_page =
false;
1509 if(empty(
$_GET[
"obj_id"]))
1511 $obj_id = $this->lm_tree->getRootId();
1515 $obj_id =
$_GET[
"obj_id"];
1517 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1522 $this->deactivated_page =
true;
1527 if (!$this->lm_tree->isInTree($obj_id))
1532 $curr_node = $this->lm_tree->getNodeData($obj_id);
1535 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1537 if ($curr_node[
"type"] ==
"pg" &&
1540 $page_id = $curr_node[
"obj_id"];
1547 while($succ_node && !$active)
1549 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1550 $page_id = $succ_node[
"obj_id"];
1552 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1555 if ($succ_node[
"type"] !=
"pg")
1557 $this->chapter_has_no_active_page =
true;
1559 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1560 $this->ilias->raiseError($this->lng->txt(
"cont_no_page"),$this->ilias->error_obj->FATAL);
1567 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1571 while ($public ===
false && $page_id > 0)
1573 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1574 $page_id = $succ_node[
'obj_id'];
1580 if ($this->lm_tree->isInTree($page_id))
1582 $path = $this->lm_tree->getPathId($page_id);
1585 $this->chapter_has_no_active_page =
true;
1595 $subtree = $this->lm_tree->getSubTree($this->lm_tree->getNodeData(1));
1596 $node = $this->lm_tree->getNodeData($current_page_id);
1597 $pos = array_search($node,$subtree);
1599 $this->tr_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_SESSION[
"tr_id"]);
1601 $lmtree =
new ilTree($this->tr_obj->getId());
1603 $lmtree->setTreeTablePK(
"lm_id");
1605 $subtree = $lmtree->getSubTree($lmtree->getNodeData(1));
1607 return $subtree[$pos][
"child"];
1614 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1615 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1621 $this->tpl->setVariable(
"TRANSLATION_CONTENT",
"NO TRNSLATION FOUND");
1625 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1626 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1629 $this->ilias->account->setDesktopItemParameters(
$_SESSION[
"tr_id"], $this->lm->getType(),$page_id);
1632 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1640 $lm_pg_obj->setLMId(
$_SESSION[
"tr_id"]);
1642 #$page_object_gui->setLayoutLinkTargets($targets);
1645 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1649 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1650 $page_object_gui->setOutputMode(
"presentation");
1651 $page_object_gui->setOutputSubmode(
"translation");
1653 $page_object_gui->setPresentationTitle(
1655 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1656 $this->lm_set->get(
"time_scheduled_page_activation")));
1657 # $page_object_gui->setLinkParams("ref_id=".$this->lm->getRefId());
1658 $page_object_gui->setLinkParams(
"ref_id=".
$_SESSION[
"tr_id"]);
1659 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1660 $page_object_gui->setTemplateOutputVar(
"TRANSLATION_CONTENT");
1663 return $page_object_gui->presentation();
1670 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1672 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1674 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1676 $this->pg_obj =&
new ilPageObject($this->lm->getType(),$page_id);
1678 $this->lm_gui->showCitation($xml);
1686 if (!is_object($this->layout_doc))
1691 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1694 for ($i = 0; $i < count(
$res->nodeset); $i++)
1696 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1697 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1698 $onclick =
$res->nodeset[$i]->get_attribute(
"OnClick");
1699 $targets[$type] = array(
"Type" => $type,
"Frame" => $frame,
"OnClick" => $onclick);
1711 function ilPage(&$a_page_node, $a_page_id = 0)
1716 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1729 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1730 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1733 if ($a_page_id == 0)
1741 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
1744 $search_string = $cache->getQuery();
1746 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
1747 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
1751 $words = $p->getQuotedWords();
1752 if (is_array($words))
1754 foreach ($words as $w)
1760 $this->fill_on_load_code =
true;
1765 $page_id = $a_page_id;
1769 $this->tpl->setCurrentBlock(
"ContentStyle");
1772 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1777 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1779 $this->tpl->parseCurrentBlock();
1782 if ($this->chapter_has_no_active_page &&
1785 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1786 "Modules/LearningModule");
1787 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1790 $mtpl->setVariable(
"ITEM_TITLE",
1792 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1793 return $mtpl->get();
1797 if ($this->deactivated_page)
1799 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1800 "Modules/LearningModule");
1801 $m = $this->lng->txt(
"cont_page_currently_deactivated");
1803 if ($act_data[
"show_activation_info"] &&
1806 $m.=
"<p>".sprintf($this->lng->txt(
"cont_page_activation_on"),
1811 $mtpl->setVariable(
"MESSAGE", $m);
1814 $mtpl->setVariable(
"ITEM_TITLE",
1816 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1817 return $mtpl->get();
1823 $cont = $this->lng->txt(
"cont_no_page");
1824 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1828 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1830 $page_object->registerOfflineHandler($this);
1832 $int_links = $page_object->getInternalLinks();
1834 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1837 $page_object_gui->setTemplateOutput(
false);
1840 $this->ilias->account->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1843 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1852 $lm_pg_obj->setLMId($this->lm->getId());
1854 $page_object_gui->setLinkXML($link_xml);
1857 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1858 $page_object_gui->enableCitation((
bool)
$_SESSION[
"citation"]);
1862 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1865 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1866 $page_id != $this->lm->getFooterPage()))
1868 $page_object_gui->setPresentationTitle(
1870 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1871 $this->lm_set->get(
"time_scheduled_page_activation")));
1874 if ($ilUser->getId() != ANONYMOUS_USER_ID)
1877 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
1879 $this->lm->getRefId(), $this->lm->getType());
1882 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1888 $page_object_gui->setEnabledPageFocus(
false);
1889 $page_object_gui->setEnabledSelfAssessment(
false);
1893 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1894 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1897 if($_SESSION[
"tr_id"])
1899 $page_object_gui->setOutputSubmode(
"translation");
1903 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1906 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1911 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1912 "syntaxhighlight.css");
1914 $this->tpl->parseCurrentBlock();
1917 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1920 if ($this->lm->getHeaderPage() > 0 &&
1921 $page_id != $this->lm->getHeaderPage() &&
1922 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1926 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1931 if ($this->lm->getFooterPage() > 0 &&
1932 $page_id != $this->lm->getFooterPage() &&
1933 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1937 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1940 $this->tpl->setVariable(
"PAGE_CONTENT", $head.$ret.$foot);
1942 return $head.$ret.$foot;
1954 $a_page_gui->setEnabledSelfAssessment(
true,
false);
1955 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1957 $this->lm->getStyleSheetId(),
"lm"));
1960 $a_page_gui->setOutputMode(
"presentation");
1961 $this->fill_on_load_code =
true;
1965 $a_page_gui->setOutputMode(
"offline");
1968 $a_page_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1969 $a_page_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1980 $ilBench->start(
"ContentPresentation",
"showPagePreconditions");
1987 $this->tpl->setCurrentBlock(
"ContentStyle");
1990 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1995 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1997 $this->tpl->parseCurrentBlock();
1999 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
2002 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
2003 foreach($conds as $cond)
2007 $this->tpl->setCurrentBlock(
"condition");
2008 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
2010 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
2011 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
2012 if ($cond[
"operator"] ==
"passed")
2014 $cond_str = $this->lng->txt(
"passed");
2018 $cond_str = $cond[
"operator"];
2020 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
2021 $this->tpl->parseCurrentBlock();
2023 $this->tpl->setCurrentBlock(
"pg_content");
2025 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
2026 sprintf($this->lng->txt(
"cont_missing_preconditions"),
2028 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
2029 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
2032 $parent = $this->lm_tree->getParentId($topchap);
2033 $childs = $this->lm_tree->getChildsByType($parent,
"st");
2036 foreach($childs as $child)
2038 if ($child[
"child"] == $topchap)
2044 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
2047 if($succ_node !=
"")
2049 $framestr = (!empty(
$_GET[
"frame"]))
2050 ?
"frame=".
$_GET[
"frame"].
"&"
2053 $showViewInFrameset =
true;
2054 $link =
"<br /><a href=\"".
2055 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
2056 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
2057 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
2060 $this->tpl->parseCurrentBlock();
2062 $ilBench->stop(
"ContentPresentation",
"showPagePreconditions");
2075 $showViewInFrameset =
true;
2077 if ($a_layoutframes ==
"")
2079 $a_layoutframes = array();
2081 $link_info =
"<IntLinkInfos>";
2082 foreach ($a_int_links as $int_link)
2084 $target = $int_link[
"Target"];
2085 if (substr($target, 0, 4) ==
"il__")
2089 $type = $int_link[
"Type"];
2090 $targetframe = ($int_link[
"TargetFrame"] !=
"")
2091 ? $int_link[
"TargetFrame"]
2095 $anc = $anc_add =
"";
2096 if ($int_link[
"Anchor"] !=
"")
2098 $anc = $int_link[
"Anchor"];
2099 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
2105 case "StructureObject":
2107 if ($lm_id == $this->lm->getId() ||
2108 ($targetframe !=
"None" && $targetframe !=
"New"))
2110 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2114 $nframe = ($ltarget ==
"")
2119 if ($showViewInFrameset) {
2140 if ($type ==
"PageObject")
2142 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
2146 $href =
"./goto.php?target=st_".$target_id;
2151 if ($type ==
"PageObject")
2153 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.$anc_add.
"&client_id=".CLIENT_ID;
2157 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
2160 if ($targetframe !=
"New")
2166 $ltarget =
"_blank";
2171 case "GlossaryItem":
2172 if ($targetframe ==
"None")
2174 $targetframe =
"Glossary";
2176 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2177 $nframe = ($ltarget ==
"")
2185 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2186 $nframe = ($ltarget ==
"")
2193 case "RepositoryItem":
2198 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
2202 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
2210 $ilCtrl->setParameter($this,
"file_id",
"il__file_".
$target_id);
2211 $href = $ilCtrl->getLinkTarget($this,
"downloadFile");
2212 $ilCtrl->setParameter($this,
"file_id",
"");
2217 $anc_par =
'Anchor="'.$anc.
'"';
2219 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
2220 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
2231 $link_info.=
"</IntLinkInfos>";
2241 $link_info =
"<LinkTargets>";
2244 $link_info.=
"<LinkTarget TargetFrame=\"".$t[
"Type"].
"\" LinkTarget=\"".
$t[
"Frame"].
"\" OnClick=\"".
$t[
"OnClick"].
"\" />";
2246 $link_info.=
"</LinkTargets>";
2257 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
2261 $this->tpl->setCurrentBlock(
"ContentStyle");
2264 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2269 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2271 $this->tpl->parseCurrentBlock();
2274 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2278 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2283 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2284 "syntaxhighlight.css");
2286 $this->tpl->parseCurrentBlock();
2288 $int_links = $term_gui->getInternalLinks();
2290 $term_gui->setLinkXML($link_xml);
2295 $ilCtrl->setParameter($this,
"pg_type",
"glo");
2300 $ilCtrl->setParameter($this,
"pg_type",
"");
2311 $ilBench->start(
"ContentPresentation",
"ilMedia");
2313 $this->tpl->setCurrentBlock(
"ContentStyle");
2316 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2321 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2323 $this->tpl->parseCurrentBlock();
2334 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2335 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2338 $this->tpl->setCurrentBlock(
"ilMedia");
2344 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2346 if (!empty (
$_GET[
"pg_id"]))
2348 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2355 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2376 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2377 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2392 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2397 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2398 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2399 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2400 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2401 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2406 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2409 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
2412 $ilBench->stop(
"ContentPresentation",
"ilMedia");
2420 if ($a_inline !=
"")
2422 $js_tpl =
new ilTemplate($a_inline,
true,
false, $a_location);
2423 $js = $js_tpl->get();
2424 $this->tpl->setVariable(
"INLINE_JS", $js);
2436 $ilBench->start(
"ContentPresentation",
"ilLMNavigation");
2437 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2439 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2449 if(!$this->lm_tree->isInTree($page_id))
2455 $limpos = strpos(
$_GET[
"back_pg"],
":");
2458 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2462 $back_pg =
$_GET[
"back_pg"];
2464 if (!$this->lm->cleanFrames())
2467 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2474 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2476 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2480 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2481 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2482 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2483 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2484 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2485 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2486 $this->tpl->setVariable(
"PREV_ACC_KEY",
2488 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2489 ?
"images/spacer.png"
2491 $this->tpl->parseCurrentBlock();
2492 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2493 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2494 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2495 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2496 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2497 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2498 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2499 ?
"images/spacer.png"
2501 $this->tpl->parseCurrentBlock();
2506 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2510 if ($this->chapter_has_no_active_page &&
2513 $c_id =
$_GET[
"obj_id"];
2517 if ($this->deactivated_page)
2519 $c_id =
$_GET[
"obj_id"];
2528 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2529 $c_id = $succ_node[
"obj_id"];
2532 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2534 if ($succ_node[
"obj_id"] > 0 &&
2536 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2541 else if ($succ_node[
"obj_id"] > 0 && !$active)
2545 if ($act_data[
"show_activation_info"] &&
2560 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2562 $succ_str = ($succ_node !==
false)
2563 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2567 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2569 if ($this->deactivated_page)
2571 $c_id =
$_GET[
"obj_id"];
2579 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2580 $c_id = $pre_node[
"obj_id"];
2582 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2583 if ($pre_node[
"obj_id"] > 0 &&
2585 ($this->lm->getPublicAccessMode() ==
"selected" &&
2590 else if ($pre_node[
"obj_id"] > 0 && !$active)
2594 if ($act_data[
"show_activation_info"] &&
2610 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2612 $pre_str = ($pre_node !==
false)
2613 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2617 $framestr = (!empty(
$_GET[
"frame"]))
2618 ?
"frame=".
$_GET[
"frame"].
"&"
2625 $showViewInFrameset =
true;
2629 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2638 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2640 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2641 $this->lm_set->get(
"time_scheduled_page_activation"));
2646 if (!$this->lm->cleanFrames())
2649 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2652 else if ($showViewInFrameset && !$this->
offlineMode())
2655 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2656 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2661 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2662 $prev_target =
'target="_top" ';
2668 $output = $this->lng->txt(
"msg_page_not_public");
2671 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2673 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2674 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2675 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2676 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2677 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2678 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2679 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2680 ?
"images/spacer.png"
2682 $this->tpl->setVariable(
"PREV_ACC_KEY",
2684 $this->tpl->parseCurrentBlock();
2685 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2686 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2687 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2688 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2689 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2690 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2691 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2692 ?
"images/spacer.png"
2694 $this->tpl->parseCurrentBlock();
2695 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2697 if($succ_node !=
"")
2699 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2702 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2704 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2705 $this->lm_set->get(
"time_scheduled_page_activation"));
2709 if (!$this->lm->cleanFrames())
2712 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2715 else if ($showViewInFrameset && !$this->
offlineMode())
2718 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2719 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2724 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2725 $succ_target =
' target="_top" ';
2731 $output = $this->lng->txt(
"msg_page_not_public");
2734 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2736 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2737 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2738 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2739 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2740 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2741 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2742 $this->tpl->setVariable(
"SPACER_SUCC", $this->
offlineMode()
2743 ?
"images/spacer.png"
2745 $this->tpl->setVariable(
"NEXT_ACC_KEY",
2747 $this->tpl->parseCurrentBlock();
2748 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2749 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2750 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2751 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2752 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2753 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2754 $this->tpl->setVariable(
"SPACER_SUCC2", $this->
offlineMode()
2755 ?
"images/spacer.png"
2757 $this->tpl->parseCurrentBlock();
2758 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2761 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation");
2767 $child_nodes = $a_node->child_nodes();
2768 foreach ($child_nodes as $child)
2770 if($child->node_name() ==
"ilFrame")
2772 $attributes = $this->
attrib2arr($child->attributes());
2774 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2778 if(!empty($attributes[
"name"]))
2780 unset($attributes[
"template"]);
2781 unset($attributes[
"template_location"]);
2782 $attributes[
"src"] =
2783 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2784 "",
"keep",
"",
$_GET[
"srcstring"]);
2785 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2786 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2787 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2792 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2794 $a_content .= $this->
buildTag(
"end",
"frameset");
2799 unset($attributes[
"template"]);
2800 unset($attributes[
"template_location"]);
2801 $attributes[
"src"] =
2802 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2803 "",
"keep",
"",
$_GET[
"srcstring"]);
2804 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2805 if ($attributes[
"name"] ==
"toc")
2807 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2812 if (
$_GET[
"anchor"] !=
"")
2814 $attributes[
"src"].=
"#".rawurlencode(
$_GET[
"anchor"]);
2817 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2818 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2840 if (is_array($attr))
2842 while (list($k,$v) = each($attr))
2843 $tag.=
" ".$k.
"=\"$v\"";
2862 $ilBench->start(
"ContentPresentation",
"TableOfContents");
2865 $this->tpl->setCurrentBlock(
"ContentStyle");
2868 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2873 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2875 $this->tpl->parseCurrentBlock();
2886 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2887 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2891 $this->tpl->getStandardTemplate();
2894 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2897 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
"Modules/LearningModule");
2900 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2901 $this->tpl->setTitle($this->lm->getTitle());
2915 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2917 $this->
getLink($this->lm->getRefId(),
""),
2920 $exp->setTargetGet(
"obj_id");
2922 $exp->forceExpandAll(
true,
false);
2930 if ($this->chapter_has_no_active_page &&
2933 $exp->highlightNode(
$_GET[
"obj_id"]);
2937 if ($this->lm->getTOCMode() ==
"pages")
2939 if ($this->deactivated_page)
2941 $exp->highlightNode(
$_GET[
"obj_id"]);
2945 $exp->highlightNode($page_id);
2950 $exp->highlightNode($this->lm_tree->getParentId($page_id));
2955 $tree =& $this->lm->getTree();
2956 if (
$_GET[
"lmtocexpand"] ==
"")
2958 $expanded = $tree->readRootId();
2962 $expanded =
$_GET[
"lmtocexpand"];
2965 $exp->setExpand($expanded);
2969 $output = $exp->getOutput();
2971 $this->tpl->setVariable(
"EXPLORER", $output);
2972 $this->tpl->parseCurrentBlock();
2976 return $this->tpl->get();
2983 $ilBench->stop(
"ContentPresentation",
"TableOfContents");
2994 $this->ctrl->setCmd(
"showSummary");
2995 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3012 global
$ilBench, $ilLocator, $ilAccess;
3023 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
3024 $this->tpl->setStyleSheetLocation(
"./".$style_name);
3027 $this->tpl->getStandardTemplate();
3028 $this->tpl->setTitle($this->lm->getTitle());
3031 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3035 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
3041 $ilLocator->addRepositoryItems();
3042 $this->tpl->setLocator();
3045 $this->lng->loadLanguageModule(
"meta");
3047 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
3050 $info->enablePrivateNotes();
3051 $info->enableLearningProgress();
3053 $info->enableNews();
3054 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
3057 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
3059 $info->enableNewsEditing();
3061 if ($enable_internal_rss)
3063 $info->setBlockProperty(
"news",
"settings",
true);
3085 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
3089 $this->tpl->setContent($info->getHTML());
3090 return $this->tpl->get();
3095 $this->ctrl->forwardCommand($info);
3108 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
3109 if (!$this->lm->isActivePrintView())
3114 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3117 $this->tpl->setCurrentBlock(
"ContentStyle");
3120 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3125 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3127 $this->tpl->parseCurrentBlock();
3131 $this->tpl->getStandardTemplate();
3133 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3137 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
3138 "tpl.lm_print_selection.html",
"Modules/LearningModule");
3141 $this->tpl->setTitle($this->lm->getTitle());
3149 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
3150 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
3152 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3154 if (!is_array(
$_POST[
"item"]))
3156 if (
$_GET[
"obj_id"] !=
"")
3168 foreach ($nodes as $node)
3173 $this->lm_set->get(
"time_scheduled_page_activation"));
3175 if ($node[
"type"] ==
"pg" &&
3181 $text = $img_scr = $img_alt =
"";
3185 switch ($node[
"type"])
3191 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3192 $this->lm_set->get(
"time_scheduled_page_activation"));
3195 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3200 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3204 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"pg");
3209 $text = $this->lm->getTitle();
3211 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"obj_lm");
3218 $this->lm->isActiveNumbering());
3220 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3225 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3229 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"st");
3235 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3238 $this->nl->addListNode($node[
"obj_id"], $text, $node[
"parent"], $checked, $disabled,
3239 $img_src, $img_alt);
3244 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
3248 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3249 $this->lm_set->get(
"time_scheduled_page_activation"));
3252 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3257 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3261 $id =
$_GET[
"obj_id"];
3265 $this->nl->addListNode($id, $text, 0, $checked, $disabled,
3266 $img_src, $img_alt);
3269 $f = $this->form->getHTML();
3273 $tb->addFormButton($lng->txt(
"cont_show_print_view"),
"showPrintView");
3274 $this->tpl->setVariable(
"TOOLBAR", $tb->getHTML());
3276 $this->tpl->setVariable(
"ITEM_SELECTION", $f);
3288 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3294 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
3295 $radg->addOption($op1);
3296 $op2 =
new ilRadioOption($lng->txt(
"cont_current_chapter"),
"chapter");
3297 $radg->addOption($op2);
3298 $op3=
new ilRadioOption($lng->txt(
"cont_selected_pg_chap"),
"selection");
3299 $radg->addOption($op3);
3301 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
3304 $op3->addSubItem($nl);
3307 $this->form->addItem($radg);
3309 $this->form->addCommandButton(
"showPrintView", $lng->txt(
"cont_show_print_view"));
3310 $this->form->setOpenTag(
false);
3311 $this->form->setCloseTag(
false);
3313 $this->form->setTitle($lng->txt(
"cont_print_selection"));
3314 $this->form->setFormAction($ilCtrl->getFormAction($this));
3324 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
3326 if (!$this->lm->isActivePrintView())
3331 $ilBench->start(
"ContentPresentation",
"PrintView");
3337 if (
$_POST[
"sel_type"] ==
"page")
3339 if (!is_array(
$_POST[
"obj_id"]) || !in_array($c_obj_id,
$_POST[
"obj_id"]))
3341 $_POST[
"obj_id"][] = $c_obj_id;
3344 if (
$_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
3347 $path = $this->lm_tree->getPathFull($c_obj_id);
3348 $chap_id =
$path[1][
"child"];
3351 $_POST[
"obj_id"][] = $chap_id;
3364 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
3365 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
3369 $this->tpl->setCurrentBlock(
"ContentStyle");
3372 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3377 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3379 $this->tpl->parseCurrentBlock();
3382 $this->tpl->setCurrentBlock(
"SyntaxStyle");
3383 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
3385 $this->tpl->parseCurrentBlock();
3388 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
3391 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
3393 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3395 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
3396 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3397 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3402 $glossary_links = array();
3403 $output_header =
false;
3404 $media_links = array();
3407 if ($this->lm->getFooterPage() > 0)
3412 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getFooterPage());
3413 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3415 $this->lm->getStyleSheetId(),
"lm"));
3419 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3420 $page_object_gui->setOutputMode(
"print");
3421 $page_object_gui->setPresentationTitle(
"");
3422 $page_object_gui->setFileDownloadLink(
"#");
3423 $page_object_gui->setFullscreenLink(
"#");
3424 $page_object_gui->setSourceCodeDownloadScript(
"#");
3425 $footer_page_content = $page_object_gui->showPage();
3428 if ($this->lm->getHeaderPage() > 0)
3433 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getHeaderPage());
3434 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3436 $this->lm->getStyleSheetId(),
"lm"));
3440 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3441 $page_object_gui->setOutputMode(
"print");
3442 $page_object_gui->setPresentationTitle(
"");
3443 $page_object_gui->setFileDownloadLink(
"#");
3444 $page_object_gui->setFullscreenLink(
"#");
3445 $page_object_gui->setSourceCodeDownloadScript(
"#");
3446 $header_page_content = $page_object_gui->showPage();
3451 if (is_array(
$_POST[
"obj_id"]))
3453 foreach(
$_POST[
"obj_id"] as $k)
3455 if ($k > 0 && !$this->lm_tree->isInTree($k))
3459 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
3467 $ilCtrl->redirect($this,
"showPrintViewSelection");
3470 foreach ($nodes as $node_key => $node)
3474 $this->lm_set->get(
"time_scheduled_page_activation"));
3475 if ($node[
"type"] ==
"pg" && !$active)
3482 if ($node[
"depth"] <= $act_level)
3484 if (is_array(
$_POST[
"obj_id"]) && in_array($node[
"obj_id"],
$_POST[
"obj_id"]))
3486 $act_level = $node[
"depth"];
3500 if ($node[
"type"] ==
"du")
3502 $output_header =
true;
3506 if ($node[
"type"] ==
"st")
3509 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3518 $this->tpl->setCurrentBlock(
"print_chapter");
3520 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3521 $this->lm->isActiveNumbering());
3522 $this->tpl->setVariable(
"CHAP_TITLE",
3527 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3529 $this->tpl->setVariable(
"CHAP_HEADER",
3530 $header_page_content);
3531 $did_chap_page_header =
true;
3535 $this->tpl->parseCurrentBlock();
3536 $this->tpl->setCurrentBlock(
"print_block");
3537 $this->tpl->parseCurrentBlock();
3541 if ($node[
"type"] ==
"pg")
3544 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3552 $this->tpl->setCurrentBlock(
"print_item");
3555 $page_id = $node[
"obj_id"];
3556 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
3557 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
3558 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3560 $this->lm->getStyleSheetId(),
"lm"));
3565 $lm_pg_obj->setLMId($this->lm->getId());
3568 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3569 $page_object_gui->setOutputMode(
"print");
3570 $page_object_gui->setPresentationTitle(
"");
3572 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3575 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3576 $this->lm_set->get(
"time_scheduled_page_activation"));
3580 if ($this->lm->isActiveNumbering())
3582 $chapter_title = trim(substr($chapter_title,
3583 strpos($chapter_title,
" ")));
3586 if ($page_title != $chapter_title)
3588 $page_object_gui->setPresentationTitle($page_title);
3593 $hcont = $header_page_content;
3594 $fcont = $footer_page_content;
3598 if ($did_chap_page_header)
3602 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3603 !($nodes[$node_key + 1][
"depth"] <= $act_level
3604 && !in_array($nodes[$node_key + 1][
"obj_id"],
$_POST[
"obj_id"])))
3610 $page_object_gui->setFileDownloadLink(
"#");
3611 $page_object_gui->setFullscreenLink(
"#");
3612 $page_object_gui->setSourceCodeDownloadScript(
"#");
3613 $page_object_gui->setEnabledSelfAssessment(
true);
3614 $page_content = $page_object_gui->showPage();
3617 $this->tpl->setVariable(
"CONTENT",
3618 $hcont.$page_content.$fcont);
3622 $this->tpl->setVariable(
"CONTENT",
3623 $hcont.$page_content.$fcont.
"<br />");
3625 $chapter_title =
"";
3626 $this->tpl->parseCurrentBlock();
3627 $this->tpl->setCurrentBlock(
"print_block");
3628 $this->tpl->parseCurrentBlock();
3635 foreach ($int_links as $key => $link)
3637 if ($link[
"type"] ==
"git" &&
3638 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3640 $glossary_links[$key] = $link;
3642 if ($link[
"type"] ==
"mob" &&
3643 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3646 $mob_links[$key] = $link;
3657 $page_object->buildDom();
3658 $links = $page_object->getInternalLinks();
3659 foreach($links as $link)
3661 if ($link[
"Type"] ==
"MediaObject"
3662 && $link[
"TargetFrame"] !=
""
3663 && $link[
"TargetFrame"] !=
"None")
3665 $media_links[] = $link;
3677 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3679 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3680 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3685 foreach($glossary_links as $key => $link)
3688 $terms[$term.
":".$key] = array(
"key" => $key,
"link" => $link,
"term" => $term);
3693 foreach($terms as
$t)
3701 foreach($defs as $def)
3704 if (count($defs) > 1)
3706 $this->tpl->setCurrentBlock(
"def_title");
3707 $this->tpl->setVariable(
"TXT_DEFINITION",
3708 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3709 $this->tpl->parseCurrentBlock();
3713 $page_gui->setTemplateOutput(
false);
3714 $page_gui->setOutputMode(
"print");
3716 $this->tpl->setCurrentBlock(
"definition");
3717 $page_gui->setFileDownloadLink(
"#");
3718 $page_gui->setFullscreenLink(
"#");
3719 $page_gui->setSourceCodeDownloadScript(
"#");
3720 $output = $page_gui->showPage();
3721 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3722 $this->tpl->parseCurrentBlock();
3726 $this->tpl->setCurrentBlock(
"term");
3727 $this->tpl->setVariable(
"VAL_TERM",
3729 $this->tpl->parseCurrentBlock();
3734 $this->tpl->setCurrentBlock(
"glossary");
3735 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3736 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3737 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3738 $this->tpl->parseCurrentBlock();
3740 $annexes[] = $annex_title;
3744 if (count($media_links) > 0)
3746 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3747 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3749 foreach($media_links as $media)
3751 if (substr($media[
"Target"],0,4) ==
"il__")
3753 $arr = explode(
"_",$media[
"Target"]);
3754 $id = $arr[count($arr) - 1];
3757 $med_item =& $med_obj->getMediaItem(
"Standard");
3758 if (is_object($med_item))
3760 if (is_int(strpos($med_item->getFormat(),
"image")))
3762 $this->tpl->setCurrentBlock(
"ref_image");
3765 if ($med_item->getLocationType() ==
"LocalFile")
3767 $this->tpl->setVariable(
"IMG_SOURCE",
3769 "/".$med_item->getLocation());
3773 $this->tpl->setVariable(
"IMG_SOURCE",
3774 $med_item->getLocation());
3777 if ($med_item->getCaption() !=
"")
3779 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3783 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3785 $this->tpl->parseCurrentBlock();
3793 $this->tpl->setCurrentBlock(
"ref_images");
3794 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3795 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3796 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3797 $this->tpl->parseCurrentBlock();
3799 $annexes[] = $annex_title;
3805 $this->tpl->setCurrentBlock(
"print_header");
3806 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3807 if ($this->lm->getDescription() !=
"none")
3809 include_once(
"Services/MetaData/classes/class.ilMD.php");
3810 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3812 foreach($md_gen->getDescriptionIds() as $id)
3814 $md_des = $md_gen->getDescription($id);
3815 $description = $md_des->getDescription();
3818 $this->tpl->setVariable(
"LM_DESCRIPTION",
3821 $this->tpl->parseCurrentBlock();
3825 foreach ($nodes2 as $node2)
3827 if ($node2[
"type"] ==
"st"
3830 for ($j=1; $j < $node2[
"depth"]; $j++)
3832 $this->tpl->setCurrentBlock(
"indent");
3834 $this->tpl->parseCurrentBlock();
3836 $this->tpl->setCurrentBlock(
"toc_entry");
3837 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3839 $this->lm->isActiveNumbering()));
3840 $this->tpl->parseCurrentBlock();
3845 foreach ($annexes as $annex)
3847 $this->tpl->setCurrentBlock(
"indent");
3849 $this->tpl->parseCurrentBlock();
3850 $this->tpl->setCurrentBlock(
"toc_entry");
3851 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3852 $this->tpl->parseCurrentBlock();
3855 $this->tpl->setCurrentBlock(
"toc");
3856 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3857 $this->tpl->parseCurrentBlock();
3859 $this->tpl->setCurrentBlock(
"print_start_block");
3860 $this->tpl->parseCurrentBlock();
3864 include_once
'Services/MetaData/classes/class.ilMD.php';
3865 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3866 if(is_object($lifecycle = $md->getLifecycle()))
3868 $sep = $author =
"";
3869 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3871 $md_con = $lifecycle->getContribute($con_id);
3872 if ($md_con->getRole() ==
"Author")
3874 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3876 $md_ent = $md_con->getEntity($ent_id);
3877 $author = $author.$sep.$md_ent->getEntity();
3884 $this->lng->loadLanguageModule(
"meta");
3885 $this->tpl->setCurrentBlock(
"author");
3886 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3887 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3888 $this->tpl->parseCurrentBlock();
3894 if (is_object($md_rights = $md->getRights()))
3896 $copyright = $md_rights->getDescription();
3897 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3900 if ($copyright !=
"")
3902 $this->lng->loadLanguageModule(
"meta");
3903 $this->tpl->setCurrentBlock(
"copyright");
3904 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3905 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3906 $this->tpl->parseCurrentBlock();
3910 $this->tpl->show(
false);
3912 $ilBench->stop(
"ContentPresentation",
"PrintView");
3918 if(
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")
3920 if(
$_POST[
"action"] ==
"show_citation")
3923 if(count(
$_POST[
"target"]) != 1)
3927 $_POST[
"target"] = 0;
3936 if(isset(
$_POST[
"tr_id"]))
3944 if(is_array(
$_POST[
"target"]))
3963 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3964 $fileObj =&
new ilObjFile($file_id,
false);
3965 $fileObj->sendFile();
3974 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3987 $this->tpl->setCurrentBlock(
"ContentStyle");
3990 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3995 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3997 $this->tpl->parseCurrentBlock();
4001 $this->tpl->getStandardTemplate();
4003 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
4008 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
4011 $this->tpl->setTitle($this->lm->getTitle());
4021 include_once
'Services/MetaData/classes/class.ilMD.php';
4022 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
4023 if (is_object($md_rights = $md->getRights()))
4025 $copyright = $md_rights->getDescription();
4027 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
4030 if ($copyright !=
"")
4032 $this->lng->loadLanguageModule(
"meta");
4033 $this->tpl->setCurrentBlock(
"copyright");
4034 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
4035 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
4036 $this->tpl->parseCurrentBlock();
4041 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
4045 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
4048 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
4050 $export_files = array();
4051 $types = array(
"xml",
"html",
"scorm");
4052 foreach($types as $type)
4054 if ($this->lm->getPublicExportFile($type) !=
"")
4056 if (is_file($this->lm->getExportDirectory($type).
"/".
4057 $this->lm->getPublicExportFile($type)))
4059 $dir = $this->lm->getExportDirectory($type);
4060 $size = filesize($this->lm->getExportDirectory($type).
"/".
4061 $this->lm->getPublicExportFile($type));
4062 $export_files[] = array(
"type" => $type,
4063 "file" => $this->lm->getPublicExportFile($type),
4071 $tbl->setTitle($this->lng->txt(
"download"));
4073 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
4074 $this->lng->txt(
"cont_file"),
4075 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
4078 $cols = array(
"format",
"file",
"size",
"date",
"download");
4079 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
4080 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
4081 $tbl->setHeaderVars($cols, $header_params);
4082 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
4083 $tbl->disable(
"sort");
4086 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
4087 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
4088 $tbl->setLimit(
$_GET[
"limit"]);
4089 $tbl->setOffset(
$_GET[
"offset"]);
4090 $tbl->setMaxCount($this->maxcount);
4096 $tbl->disable(
"footer");
4098 $tbl->setMaxCount(count($export_files));
4099 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
4102 if(count($export_files) > 0)
4105 foreach($export_files as $exp_file)
4107 if (!$exp_file[
"size"] > 0)
4112 $this->tpl->setCurrentBlock(
"tbl_content");
4113 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
4116 $this->tpl->setVariable(
"CSS_ROW", $css_row);
4118 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
4119 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
4120 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
4122 $file_arr = explode(
"__", $exp_file[
"file"]);
4123 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
4125 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
4126 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
4127 $this->tpl->setVariable(
"LINK_DOWNLOAD",
4128 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
4130 $this->tpl->parseCurrentBlock();
4135 $this->tpl->setCurrentBlock(
"notfound");
4136 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
4137 $this->tpl->setVariable(
"NUM_COLS", 5);
4138 $this->tpl->parseCurrentBlock();
4150 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
4151 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
4153 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
4154 if (is_file($dir.
"/".
$file))
4160 $this->ilias->raiseError($this->lng->txt(
"file_not_found"),$this->ilias->error_obj->MESSAGE);
4166 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
4167 $a_back_link =
"append", $a_anchor =
"", $a_srcstring =
"")
4178 $back_pg =
$_GET[
"back_pg"];
4179 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
4180 $a_back_link ==
"append")
4184 $back_pg = $cur_page_id.
":".$back_pg;
4188 $back_pg = $cur_page_id;
4193 if ($a_back_link ==
"reduce")
4195 $limpos = strpos(
$_GET[
"back_pg"],
":");
4199 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
4206 else if ($a_back_link !=
"keep")
4215 if (
$_GET[
"from_page"] ==
"")
4217 $this->ctrl->setParameter($this,
"from_page", $cur_page_id);
4223 if (!in_array($a_frame, array(
"",
"_blank")))
4225 $this->ctrl->setParameter($this,
"from_page",
$_GET[
"from_page"]);
4229 if ($a_anchor !=
"")
4231 $this->ctrl->setParameter($this,
"anchor", rawurlencode($a_anchor));
4233 if ($a_srcstring !=
"")
4235 $this->ctrl->setParameter($this,
"srcstring", $a_srcstring);
4240 $link = $this->ctrl->getLinkTarget($this,
"fullscreen",
"",
false,
false);
4247 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
4251 $this->ctrl->setParameter($this,
"frame", $a_frame);
4253 if ($a_obj_id !=
"")
4258 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
4262 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
4263 $link.=
"&obj_id=".$a_obj_id;
4269 $this->ctrl->setParameter($this,
"obj_type", $a_type);
4271 $link = $this->ctrl->getLinkTarget($this, $a_cmd, $a_anchor);
4274 $this->ctrl->setParameter($this,
"frame",
"");
4275 $this->ctrl->setParameter($this,
"obj_id",
"");
4276 $this->ctrl->setParameter($this,
"mob_id",
"");
4284 case "downloadFile":
4288 $link =
"fullscreen.html";
4293 if ($a_obj_id ==
"")
4295 $a_obj_id = $this->lm_tree->getRootId();
4296 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4297 $a_obj_id = $pg_node[
"obj_id"];
4299 if ($a_type ==
"StructureObject")
4301 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4302 $a_obj_id = $pg_node[
"obj_id"];
4304 if ($a_frame !=
"" && $a_frame !=
"_blank")
4306 if ($a_frame !=
"toc")
4308 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
4312 $link =
"frame_".$a_frame.
".html";
4320 $link =
"lm_pg_".$nid.
".html";
4324 $link =
"lm_pg_".$a_obj_id.
".html";
4330 $link =
"term_".$a_obj_id.
".html";
4334 $link =
"media_".$a_obj_id.
".html";
4342 $this->ctrl->clearParameters($this);
4354 $this->tpl->setCurrentBlock(
"ContentStyle");
4358 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
4363 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
4366 $this->tpl->parseCurrentBlock();
4367 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
4368 $this->tpl->setCurrentBlock(
"pg_content");
4369 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
4370 $this->tpl->parseCurrentBlock();
4377 $target = $this->ctrl->getLinkTarget($this,
"");
4379 return $this->ctrl->getLinkTarget($this,
"");
4395 $this->offline_directory = $offdir;
4417 if (!($fp = @fopen(
$file,
"w+")))
4419 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
4420 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
4430 $this->tpl->setHeaderPageTitle($this->lm->getTitle());
4431 $this->tpl->fillWindowTitle();