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"));
49 # include_once './classes/class.ilSearch.php';
51 # if(!ilSearch::_checkParentConditions($_GET['ref_id']))
53 # $ilias->error_obj->raiseError($lng->txt('access_denied'),$ilias->error_obj->WARNING);
56 $type = $this->ilias->obj_factory->getTypeByRefId(
$_GET[
"ref_id"]);
62 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
67 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
73 $this->lm =& $this->lm_gui->object;
75 if(IS_PAYMENT_ENABLED)
77 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
80 else $this->needs_to_be_purchased =
false;
83 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
85 if (!$this->lm->getOnline())
87 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
91 $this->lm_tree =
new ilTree($this->lm->getId());
93 $this->lm_tree->setTreeTablePK(
"lm_id");
98 $this->
abstract =
true;
100 if((count(
$_POST[
"tr_id"]) > 1) or
101 (!
$_POST[
"target"] and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")))
103 $this->
abstract =
true;
105 else if(
$_GET[
"obj_id"] or (
$_POST[
"action"] ==
"show") or (
$_POST[
"action"] ==
"show_citation"))
107 $this->
abstract =
false;
121 if(IS_PAYMENT_ENABLED)
123 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
124 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
127 if(!((
int)
$_GET[
'obj_id'] &&
129 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
132 unset(
$_GET[
'obj_id']);
134 $this->tpl->getStandardTemplate();
137 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
139 $ret = $this->ctrl->forwardCommand($pp);
147 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
148 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
149 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
151 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
154 $next_class = $this->ctrl->getNextClass($this);
155 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
164 $obj_id =
$_GET[
"obj_id"];
165 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
166 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
167 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
175 case "ilinfoscreengui":
179 case "ilcommonactiondispatchergui":
180 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
182 $gui->enableCommentsSettings(
false);
183 $this->ctrl->forwardCommand($gui);
186 case "ilpageobjectgui":
187 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
188 if (
$_GET[
"pg_type"] !=
"glo")
197 $ret = $ilCtrl->forwardCommand($page_gui);
212 $this->offline = $a_offline;
231 $this->export_format = $a_format;
241 return $this->export_format;
263 $q =
"DELETE FROM lo_access ".
264 "WHERE usr_id = ".$ilDB->quote((
int)
$usr_id,
"integer").
" ".
265 "AND lm_id = ".$ilDB->quote((
int) $lm_id,
"integer");
266 $ilDB->manipulate($q);
267 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
270 $q =
"INSERT INTO lo_access ".
271 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
273 "(".$ilDB->now().
",".
274 $ilDB->quote((
int) $usr_id,
"integer").
",".
275 $ilDB->quote((
int) $lm_id,
"integer").
",".
276 $ilDB->quote((
int) $obj_id,
"integer").
",".
277 $ilDB->quote(
$title,
"text").
")";
278 $ilDB->manipulate($q);
291 switch($this->lm->getType())
294 $this->lm_gui->export();
310 if (
$_POST[
"cmd"][
"cancel"] !=
"")
312 $this->ctrl->setParameter($this,
"frame",
"maincontent");
313 $this->ctrl->redirect($this,
"layout");
316 switch($this->lm->getType())
320 $_GET[
"frame"] =
"maincontent";
323 $_GET[
"obj_id"] = $objRow[
"obj_id"];
325 $query =
"SELECT * FROM lm_data WHERE lm_id = ".
326 $ilDB->quote($objRow[
"obj_id"],
"integer").
332 while (is_array(
$row = $ilDB->fetchAssoc(
$result)) )
342 if(
$_POST[
"type"] ==
"pdf") $output .=
"<hr BREAK >\n";
343 if(
$_POST[
"type"] ==
"print") $output .=
"<p style=\"page-break-after:always\" />";
344 if(
$_POST[
"type"] ==
"html") $output .=
"<br><br><br><br>";
349 $o = $this->
layout(
"main.xml",
false);
351 $output .=
"<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_PageTitle\">".$this->lm->title.
"</div><p>";
354 $output .=
"\n<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td valign=top align=center>- ".$page.
" -</td></tr></table>\n";
359 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
361 if(
$_POST[
"type"] ==
"print")
363 $printTpl->touchBlock(
"printreq");
369 $css1 =
"./css/delos.css";
370 $css2 =
"./css/content.css";
372 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
374 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
375 $printTpl->setVariable(
"CONTENT",$output);
378 $printTpl->setCurrentBlock(
"SyntaxStyle");
379 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
381 $printTpl->parseCurrentBlock();
384 $html = $printTpl->get();
389 $this->lm->createExportDirectory();
390 $export_dir = $this->lm->getExportDirectory();
395 $fileName =
"offline";
396 $fileName = str_replace(
" ",
"_",$fileName);
398 if (!file_exists($export_dir.
"/".$fileName))
400 @mkdir($export_dir.
"/".$fileName);
401 @chmod($export_dir.
"/".$fileName, 0755);
403 @mkdir($export_dir.
"/".$fileName.
"/css");
404 @chmod($export_dir.
"/".$fileName.
"/css", 0755);
408 if(
$_POST[
"type"] ==
"xml")
411 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_GET[
"ref_id"]);
413 if ($tmp_obj->getType() ==
"dbk" )
415 require_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
421 else if(
$_POST[
"type"] ==
"print")
425 else if (
$_POST[
"type"]==
"html")
433 $css1 = file(
"./templates/default/delos.css");
434 $css1 = implode($css1,
"");
436 $fp = fopen($export_dir.
"/".$fileName.
"/css/delos.css",
"wb");
440 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".html",
"wb");
444 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
449 else if (
$_POST[
"type"]==
"pdf")
473 switch($this->lm->getType())
476 $this->lm_gui->offlineexportform();
497 $filename = preg_replace(
'/[^a-z0-9_]/i',
'_', $objRow[
"title"]);
499 $C = $this->lm_gui->showAbstract(array(1));
501 if (
$_GET[
"print"]==1)
503 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
504 $printTpl->touchBlock(
"printreq");
507 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
509 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
512 $printTpl->setCurrentBlock(
"SyntaxStyle");
513 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
515 $printTpl->parseCurrentBlock();
517 $printTpl->setVariable(
"CONTENT",$C);
519 echo $printTpl->get();
536 if(!is_array($a_attributes))
540 foreach ($a_attributes as $attribute)
542 $attr[$attribute->name()] = $attribute->value();
552 return $this->frames;
566 $layout = $this->lm->getLayout();
567 if ($this->lm->getLayoutPerPage())
571 if (in_array(
$_GET[
"cmd"], array(
"media",
"glossary")) &&
$_GET[
"from_page"] > 0)
573 $pg_id = (int)
$_GET[
"from_page"];
594 function layout($a_xml =
"main.xml", $doShow =
true)
598 $ilBench->start(
"ContentPresentation",
"layout");
605 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
607 if (!$doc =
domxml_open_mem($xmlfile)) { echo
"ilLMPresentation: XML File invalid";
exit; }
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) { echo
"ilLMPresentation: XML File invalid";
exit; }
622 $ilBench->stop(
"ContentPresentation",
"layout_getFrameNode");
626 $attributes = $this->
attrib2arr($node->attributes());
628 $this->frames = array();
629 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
631 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
634 $content .= $this->
buildTag(
"end",
"frameset");
635 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
637 $this->tpl->setVariable(
"FS_CONTENT", $content);
640 $content = $this->tpl->get();
646 $ilBench->start(
"ContentPresentation",
"layout_processContentTag");
648 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
649 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
656 if(empty(
$_GET[
"obj_type"]))
658 $obj_type =
"PageObject";
662 $obj_type =
$_GET[
"obj_type"];
666 $childs = $node->child_nodes();
668 foreach($childs as $child)
670 if ($child->node_name() == $obj_type)
673 $attributes = $this->
attrib2arr($child->attributes());
679 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
680 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
684 $in_module = ($attributes[
"template_location"] ==
"module")
689 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
690 $this->tpl->setBodyClass(
"");
704 $style_name = $this->ilias->account->prefs[
"style"].
".css";
705 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
708 $childs = $node->child_nodes();
710 $ilBench->start(
"ContentPresentation",
"layout_processContentNodes");
711 foreach($childs as $child)
714 $child_attr = $this->
attrib2arr($child->attributes());
716 switch ($child->node_name())
723 $this->
ilTOC($child_attr[
"target_frame"]);
727 switch($this->lm->getType())
733 $content = $this->
ilPage($child);
740 $content = $this->lm_gui->showAbstract(
$_POST[
"target"]);
745 $content = $this->
ilPage($child);
760 case "ilLMNavigation":
763 if(
$_GET[
"obj_id"] or
765 (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")) or
766 $this->lm->getType() ==
'lm')
768 $ilBench->start(
"ContentPresentation",
"layout_lmnavigation");
770 $ilBench->stop(
"ContentPresentation",
"layout_lmnavigation");
783 $this->
ilJavaScript($child_attr[
"inline"], $child_attr[
"file"],
784 $child_attr[
"location"]);
807 $ilBench->stop(
"ContentPresentation",
"layout_processContentNodes");
809 $ilBench->stop(
"ContentPresentation",
"layout_processContentTag");
813 if (strcmp(
$_GET[
"frame"],
"topright") == 0) $this->tpl->fillJavaScriptFiles();
814 if (strcmp(
$_GET[
"frame"],
"right") == 0) $this->tpl->fillJavaScriptFiles();
815 if (strcmp(
$_GET[
"frame"],
"botright") == 0) $this->tpl->fillJavaScriptFiles();
819 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
824 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
825 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
826 $this->tpl->fillJavaScriptFiles();
827 $this->tpl->fillScreenReaderFocus();
829 $this->tpl->fillCssFiles();
833 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
836 if ($f[
"type"] ==
"js")
838 $this->tpl->addJavascript($f[
"target"]);
840 if ($f[
"type"] ==
"css")
842 $this->tpl->addCSS($f[
"target"]);
845 $this->tpl->fillJavaScriptFiles(
true);
846 $this->tpl->fillCssFiles(
true);
850 $this->tpl->fillBodyClass();
861 $this->tpl->fillTabs();
862 if ($this->fill_on_load_code)
864 $this->tpl->fillOnLoadCode();
866 $content = $this->tpl->get();
867 $content = str_replace(
"{",
"{", $content);
868 $content = str_replace(
"}",
"}", $content);
870 header(
'Content-type: text/html; charset=UTF-8');
875 $content = $this->tpl->get();
878 $ilBench->stop(
"ContentPresentation",
"layout");
890 if (
$_GET[
"frame"] !=
"_blank")
902 if (
$_GET[
"frame"] !=
"_blank")
908 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
918 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
919 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
929 return $this->tpl->get();
949 $ilMainMenu->setSmallMode(
true);
953 $ilMainMenu->setSmallMode(
false);
959 $ilMainMenu->setLoginTargetPar(
"pg_".$page_id.
"_".$this->lm->getRefId());
962 $this->tpl->touchBlock(
"mm_intro");
963 $this->tpl->touchBlock(
"mm_outro");
964 $this->tpl->touchBlock(
"pg_intro");
965 $this->tpl->touchBlock(
"pg_outro");
966 $this->tpl->setBodyClass(
"std");
967 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
977 $ilBench->start(
"ContentPresentation",
"ilTOC");
978 require_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorer.php");
979 if ($this->lm->cleanFrames())
984 $exp->setExpandTarget($this->
getLink($this->lm->getRefId(),
$_GET[
"cmd"],
$_GET[
"obj_id"], $_GET[
"frame"]));
985 $exp->setTargetGet(
"obj_id");
986 if ($this->lm->cleanFrames())
990 $exp->setFrameTarget(
"_top");
999 $exp->setFrameTarget($a_target);
1001 $exp->addFilter(
"du");
1002 $exp->addFilter(
"st");
1005 if ($this->lm->cleanFrames())
1010 $path = $this->lm_tree->getPathId($page_id);
1011 $exp->setForceOpenPath(
$path);
1016 if ($this->chapter_has_no_active_page &&
1019 $exp->highlightNode($_GET[
"obj_id"]);
1023 $exp->highlightNode($page_id);
1029 if ($this->lm->getTOCMode() ==
"pages")
1031 $exp->addFilter(
"pg");
1033 $exp->setFiltered(
true);
1036 if ($_GET[
"lmexpand"] ==
"")
1038 $expand_keys = array();
1041 $expand_keys = array_keys(
$_SESSION[
"lmexpand"]);
1043 $_SESSION[
"lmexpand"] = array($this->lm_tree->readRootId());
1044 $expanded = $this->lm_tree->readRootId();
1048 $expanded = $_GET[
"lmexpand"];
1050 $exp->setExpand($expanded);
1054 $output = $exp->getOutput();
1065 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
1066 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
1071 $this->tpl->addBlockFile(
"EXPL_TOP",
"exp_top",
"tpl.explorer_top.html");
1075 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
1076 $this->tpl->setVariable(
"EXPLORER",$output);
1077 $this->tpl->setVariable(
"ACTION",
1078 $this->
getLink($this->lm->getRefId(), $_GET[
"cmd"],
"", $_GET[
"frame"]).
1079 "&lmexpand=".$_GET[
"lmexpand"]);
1080 $this->tpl->parseCurrentBlock();
1081 $ilBench->stop(
"ContentPresentation",
"ilTOC");
1082 if ($_GET[
"lmexpand"] ==
"")
1085 foreach ($expand_keys as $k)
1098 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
1107 $this->tpl->setCurrentBlock(
"header_image");
1110 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.gif");
1116 $this->tpl->parseCurrentBlock();
1117 $this->tpl->setCurrentBlock(
"lm_head");
1118 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
1119 $this->tpl->parseCurrentBlock();
1130 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1136 $showViewInFrameset =
true;
1138 if ($showViewInFrameset)
1144 $buttonTarget =
"_top";
1148 include_once(
"./classes/class.ilTemplate.php");
1149 $tpl_menu =&
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
1160 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1162 $tpl_menu->setCurrentBlock(
"edit_page");
1164 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
1165 "&obj_id=".$page_id.
"&to_page=1");
1166 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
1167 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
1168 $tpl_menu->parseCurrentBlock();
1173 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1175 $page_id.
"_".$this->lm->getRefId(),
1179 $title = $this->lm->getTitle();
1181 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
1182 if ($pg_title !=
"")
1184 $title.=
": ".$pg_title;
1189 $tpl_menu->setCurrentBlock(
"perma_link");
1190 $tpl_menu->setVariable(
"PERMA_LINK", $plinkgui->getHTML());
1191 $tpl_menu->parseCurrentBlock();
1195 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1213 global $ilUser, $ilAccess;
1215 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1217 $ilAccess, $this->lm->getType(),
$_GET[
"ref_id"], $this->lm->getId());
1220 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
1221 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
1222 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
1223 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
1225 $lg = $dispatcher->initHeaderAction();
1226 $lg->enableNotes(
true);
1227 $lg->enableComments($this->lm->publicNotes(),
false);
1231 $this->tpl->setVariable(
"HEAD_ACTION", $lg->getHeaderAction());
1235 return $lg->getHeaderAction();
1248 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1261 if (!$ilSetting->get(
"disable_notes"))
1268 if ($ilSetting->get(
"disable_comments"))
1273 if (!$this->lm->publicNotes())
1278 $next_class = $this->ctrl->getNextClass($this);
1280 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1288 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1293 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1294 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1296 $notes_gui->enablePrivateNotes();
1297 if ($this->lm->publicNotes())
1299 $notes_gui->enablePublicNotes();
1302 if ($next_class ==
"ilnotegui")
1304 $html = $this->ctrl->forwardCommand($notes_gui);
1308 $html = $notes_gui->getNotesHTML();
1310 $this->tpl->setVariable(
"NOTES", $html);
1319 global $ilLocator, $tree;
1321 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1323 if (empty(
$_GET[
"obj_id"]))
1325 $a_id = $this->lm_tree->getRootId();
1329 $a_id =
$_GET[
"obj_id"];
1332 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1334 if (!$this->lm->cleanFrames())
1336 $frame_param =
$_GET[
"frame"];
1347 $frame_target =
"_top";
1352 $ilLocator->addItem(
"...",
"");
1354 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1355 $ilLocator->addItem(
1357 "repository.php?cmd=frameset&ref_id=".$par_id,
1362 $ilLocator->setOffline(
true);
1365 if($this->lm_tree->isInTree($a_id))
1367 $path = $this->lm_tree->getPathFull($a_id);
1371 if (
$row[
"type"] !=
"pg")
1373 if(
$row[
"child"] != $this->lm_tree->getRootId())
1375 $ilLocator->addItem(
1378 $this->lm->isActiveNumbering()),50,
true),
1379 $this->
getLink(
$_GET[
"ref_id"],
"layout",
$row[
"child"], $frame_param,
"StructureObject"),
1384 $ilLocator->addItem(
1386 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1387 $frame_target,
$_GET[
"ref_id"]);
1395 $ilLocator->addItem(
1396 $this->lm->getTitle(),
1399 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1402 $ilLocator->addItem(
1403 $lm_obj->getTitle(),
1404 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1410 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1416 $this->tpl->setLocator();
1423 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1425 $this->chapter_has_no_active_page =
false;
1426 $this->deactivated_page =
false;
1429 if(empty(
$_GET[
"obj_id"]))
1431 $obj_id = $this->lm_tree->getRootId();
1435 $obj_id =
$_GET[
"obj_id"];
1437 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1442 $this->deactivated_page =
true;
1447 if (!$this->lm_tree->isInTree($obj_id))
1452 $curr_node = $this->lm_tree->getNodeData($obj_id);
1455 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1457 if ($curr_node[
"type"] ==
"pg" &&
1460 $page_id = $curr_node[
"obj_id"];
1467 while($succ_node && !$active)
1469 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1470 $page_id = $succ_node[
"obj_id"];
1472 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1475 if ($succ_node[
"type"] !=
"pg")
1477 $this->chapter_has_no_active_page =
true;
1479 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1480 $this->ilias->raiseError($this->lng->txt(
"cont_no_page"),$this->ilias->error_obj->FATAL);
1487 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1491 while ($public ===
false && $page_id > 0)
1493 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1494 $page_id = $succ_node[
'obj_id'];
1500 if ($this->lm_tree->isInTree($page_id))
1502 $path = $this->lm_tree->getPathId($page_id);
1505 $this->chapter_has_no_active_page =
true;
1515 $subtree = $this->lm_tree->getSubTree($this->lm_tree->getNodeData(1));
1516 $node = $this->lm_tree->getNodeData($current_page_id);
1517 $pos = array_search($node,$subtree);
1519 $this->tr_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_SESSION[
"tr_id"]);
1521 $lmtree =
new ilTree($this->tr_obj->getId());
1523 $lmtree->setTreeTablePK(
"lm_id");
1525 $subtree = $lmtree->getSubTree($lmtree->getNodeData(1));
1527 return $subtree[$pos][
"child"];
1534 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1535 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1541 $this->tpl->setVariable(
"TRANSLATION_CONTENT",
"NO TRNSLATION FOUND");
1545 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1546 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1549 $this->ilias->account->setDesktopItemParameters(
$_SESSION[
"tr_id"], $this->lm->getType(),$page_id);
1552 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1560 $lm_pg_obj->setLMId(
$_SESSION[
"tr_id"]);
1562 #$page_object_gui->setLayoutLinkTargets($targets);
1565 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1569 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1570 $page_object_gui->setOutputMode(
"presentation");
1571 $page_object_gui->setOutputSubmode(
"translation");
1573 $page_object_gui->setPresentationTitle(
1575 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1576 $this->lm_set->get(
"time_scheduled_page_activation")));
1577 # $page_object_gui->setLinkParams("ref_id=".$this->lm->getRefId());
1578 $page_object_gui->setLinkParams(
"ref_id=".
$_SESSION[
"tr_id"]);
1579 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1580 $page_object_gui->setTemplateOutputVar(
"TRANSLATION_CONTENT");
1583 return $page_object_gui->presentation();
1590 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1592 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1594 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1596 $this->pg_obj =&
new ilPageObject($this->lm->getType(),$page_id);
1598 $this->lm_gui->showCitation($xml);
1606 if (!is_object($this->layout_doc))
1611 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1614 for ($i = 0; $i < count(
$res->nodeset); $i++)
1616 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1617 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1618 $onclick =
$res->nodeset[$i]->get_attribute(
"OnClick");
1619 $targets[$type] = array(
"Type" => $type,
"Frame" => $frame,
"OnClick" => $onclick);
1631 function ilPage(&$a_page_node, $a_page_id = 0)
1636 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1649 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1650 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1653 if ($a_page_id == 0)
1661 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
1664 $search_string = $cache->getQuery();
1666 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
1667 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
1671 $words = $p->getQuotedWords();
1672 if (is_array($words))
1674 foreach ($words as $w)
1680 $this->fill_on_load_code =
true;
1685 $page_id = $a_page_id;
1689 $this->tpl->setCurrentBlock(
"ContentStyle");
1692 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1697 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1699 $this->tpl->parseCurrentBlock();
1702 if ($this->chapter_has_no_active_page &&
1705 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1706 "Modules/LearningModule");
1707 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1710 $mtpl->setVariable(
"ITEM_TITLE",
1712 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1713 return $mtpl->get();
1717 if ($this->deactivated_page)
1719 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1720 "Modules/LearningModule");
1721 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_page_currently_deactivated"));
1724 $mtpl->setVariable(
"ITEM_TITLE",
1726 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1727 return $mtpl->get();
1733 $cont = $this->lng->txt(
"cont_no_page");
1734 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1738 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1740 $page_object->registerOfflineHandler($this);
1742 $int_links = $page_object->getInternalLinks();
1744 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1747 $page_object_gui->setTemplateOutput(
false);
1750 $this->ilias->account->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1753 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1762 $lm_pg_obj->setLMId($this->lm->getId());
1764 $page_object_gui->setLinkXML($link_xml);
1767 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1768 $page_object_gui->enableCitation((
bool)
$_SESSION[
"citation"]);
1772 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1775 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1776 $page_id != $this->lm->getFooterPage()))
1778 $page_object_gui->setPresentationTitle(
1780 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1781 $this->lm_set->get(
"time_scheduled_page_activation")));
1784 include_once
"Services/Tracking/classes/class.ilTracking.php";
1786 $page_id,
"pg",
"read");
1789 if ($ilUser->getId() != ANONYMOUS_USER_ID)
1791 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1797 $page_object_gui->setEnabledPageFocus(
false);
1798 $page_object_gui->setEnabledSelfAssessment(
false);
1802 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1803 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1806 if($_SESSION[
"tr_id"])
1808 $page_object_gui->setOutputSubmode(
"translation");
1812 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1815 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1820 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1821 "syntaxhighlight.css");
1823 $this->tpl->parseCurrentBlock();
1826 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1829 if ($this->lm->getHeaderPage() > 0 &&
1830 $page_id != $this->lm->getHeaderPage() &&
1831 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1835 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1840 if ($this->lm->getFooterPage() > 0 &&
1841 $page_id != $this->lm->getFooterPage() &&
1842 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1846 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1849 $this->tpl->setVariable(
"PAGE_CONTENT", $head.$ret.$foot);
1851 return $head.$ret.$foot;
1863 $a_page_gui->setEnabledSelfAssessment(
true,
false);
1864 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1866 $this->lm->getStyleSheetId(),
"lm"));
1869 $a_page_gui->setOutputMode(
"presentation");
1870 $this->fill_on_load_code =
true;
1874 $a_page_gui->setOutputMode(
"offline");
1877 $a_page_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1878 $a_page_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1889 $ilBench->start(
"ContentPresentation",
"showPagePreconditions");
1896 $this->tpl->setCurrentBlock(
"ContentStyle");
1899 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1904 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1906 $this->tpl->parseCurrentBlock();
1908 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
1911 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
1912 foreach($conds as $cond)
1916 $this->tpl->setCurrentBlock(
"condition");
1917 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
1919 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
1920 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
1921 if ($cond[
"operator"] ==
"passed")
1923 $cond_str = $this->lng->txt(
"passed");
1927 $cond_str = $cond[
"operator"];
1929 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
1930 $this->tpl->parseCurrentBlock();
1932 $this->tpl->setCurrentBlock(
"pg_content");
1934 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
1935 sprintf($this->lng->txt(
"cont_missing_preconditions"),
1937 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
1938 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
1941 $parent = $this->lm_tree->getParentId($topchap);
1942 $childs = $this->lm_tree->getChildsByType($parent,
"st");
1945 foreach($childs as $child)
1947 if ($child[
"child"] == $topchap)
1953 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
1956 if($succ_node !=
"")
1958 $framestr = (!empty(
$_GET[
"frame"]))
1959 ?
"frame=".
$_GET[
"frame"].
"&"
1962 $showViewInFrameset =
true;
1963 $link =
"<br /><a href=\"".
1964 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
1965 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
1966 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
1969 $this->tpl->parseCurrentBlock();
1971 $ilBench->stop(
"ContentPresentation",
"showPagePreconditions");
1984 $showViewInFrameset =
true;
1986 if ($a_layoutframes ==
"")
1988 $a_layoutframes = array();
1990 $link_info =
"<IntLinkInfos>";
1991 foreach ($a_int_links as $int_link)
1993 $target = $int_link[
"Target"];
1994 if (substr($target, 0, 4) ==
"il__")
1998 $type = $int_link[
"Type"];
1999 $targetframe = ($int_link[
"TargetFrame"] !=
"")
2000 ? $int_link[
"TargetFrame"]
2004 $anc = $anc_add =
"";
2005 if ($int_link[
"Anchor"] !=
"")
2007 $anc = $int_link[
"Anchor"];
2008 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
2014 case "StructureObject":
2016 if ($lm_id == $this->lm->getId() ||
2017 ($targetframe !=
"None" && $targetframe !=
"New"))
2019 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2023 $nframe = ($ltarget ==
"")
2028 if ($showViewInFrameset) {
2049 if ($type ==
"PageObject")
2051 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
2055 $href =
"./goto.php?target=st_".$target_id;
2060 if ($type ==
"PageObject")
2062 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.$anc_add.
"&client_id=".CLIENT_ID;
2066 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
2069 if ($targetframe !=
"New")
2075 $ltarget =
"_blank";
2080 case "GlossaryItem":
2081 if ($targetframe ==
"None")
2083 $targetframe =
"Glossary";
2085 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2086 $nframe = ($ltarget ==
"")
2094 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2095 $nframe = ($ltarget ==
"")
2102 case "RepositoryItem":
2107 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
2111 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
2119 $ilCtrl->setParameter($this,
"file_id",
"il__file_".
$target_id);
2120 $href = $ilCtrl->getLinkTarget($this,
"downloadFile");
2121 $ilCtrl->setParameter($this,
"file_id",
"");
2126 $anc_par =
'Anchor="'.$anc.
'"';
2128 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
2129 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
2140 $link_info.=
"</IntLinkInfos>";
2150 $link_info =
"<LinkTargets>";
2153 $link_info.=
"<LinkTarget TargetFrame=\"".$t[
"Type"].
"\" LinkTarget=\"".
$t[
"Frame"].
"\" OnClick=\"".
$t[
"OnClick"].
"\" />";
2155 $link_info.=
"</LinkTargets>";
2166 $ilBench->start(
"ContentPresentation",
"ilGlossary");
2168 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
2172 $this->tpl->setCurrentBlock(
"ContentStyle");
2175 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2180 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2182 $this->tpl->parseCurrentBlock();
2185 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2189 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2194 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2195 "syntaxhighlight.css");
2197 $this->tpl->parseCurrentBlock();
2199 $int_links = $term_gui->getInternalLinks();
2201 $term_gui->setLinkXML($link_xml);
2206 $ilCtrl->setParameter($this,
"pg_type",
"glo");
2211 $ilCtrl->setParameter($this,
"pg_type",
"");
2216 $ilBench->stop(
"ContentPresentation",
"ilGlossary");
2226 $ilBench->start(
"ContentPresentation",
"ilMedia");
2228 $this->tpl->setCurrentBlock(
"ContentStyle");
2231 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2236 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2238 $this->tpl->parseCurrentBlock();
2249 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2250 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2253 $this->tpl->setCurrentBlock(
"ilMedia");
2259 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2261 if (!empty (
$_GET[
"pg_id"]))
2263 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2270 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2291 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2292 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2307 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2312 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2313 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2314 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2315 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2316 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2321 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2323 $ilBench->stop(
"ContentPresentation",
"ilMedia");
2331 if ($a_inline !=
"")
2333 $js_tpl =
new ilTemplate($a_inline,
true,
false, $a_location);
2334 $js = $js_tpl->get();
2335 $this->tpl->setVariable(
"INLINE_JS", $js);
2347 $ilBench->start(
"ContentPresentation",
"ilLMNavigation");
2348 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2350 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2360 if(!$this->lm_tree->isInTree($page_id))
2366 $limpos = strpos(
$_GET[
"back_pg"],
":");
2369 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2373 $back_pg =
$_GET[
"back_pg"];
2375 if (!$this->lm->cleanFrames())
2378 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2385 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2387 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2391 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2392 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2393 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2394 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2395 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2396 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2397 $this->tpl->setVariable(
"PREV_ACC_KEY",
2399 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2400 ?
"images/spacer.gif"
2402 $this->tpl->parseCurrentBlock();
2403 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2404 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2405 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2406 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2407 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2408 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2409 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2410 ?
"images/spacer.gif"
2412 $this->tpl->parseCurrentBlock();
2417 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2421 if ($this->chapter_has_no_active_page &&
2424 $c_id =
$_GET[
"obj_id"];
2432 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2433 $c_id = $succ_node[
"obj_id"];
2436 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2438 if ($succ_node[
"obj_id"] > 0 &&
2440 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2445 else if ($succ_node[
"obj_id"] > 0 && !$active)
2454 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2456 $succ_str = ($succ_node !==
false)
2457 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2461 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2466 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2467 $c_id = $pre_node[
"obj_id"];
2469 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2470 if ($pre_node[
"obj_id"] > 0 &&
2472 ($this->lm->getPublicAccessMode() ==
"selected" &&
2477 else if ($pre_node[
"obj_id"] > 0 && !$active)
2487 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2489 $pre_str = ($pre_node !==
false)
2490 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2494 $framestr = (!empty(
$_GET[
"frame"]))
2495 ?
"frame=".
$_GET[
"frame"].
"&"
2502 $showViewInFrameset =
true;
2506 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2515 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2517 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2518 $this->lm_set->get(
"time_scheduled_page_activation"));
2523 if (!$this->lm->cleanFrames())
2526 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2529 else if ($showViewInFrameset && !$this->
offlineMode())
2532 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2533 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2538 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2539 $prev_target =
'target="_top" ';
2545 $output = $this->lng->txt(
"msg_page_not_public");
2548 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2550 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2551 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2552 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2553 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2554 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2555 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2556 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2557 ?
"images/spacer.gif"
2559 $this->tpl->setVariable(
"PREV_ACC_KEY",
2561 $this->tpl->parseCurrentBlock();
2562 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2563 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2564 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2565 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2566 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2567 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2568 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2569 ?
"images/spacer.gif"
2571 $this->tpl->parseCurrentBlock();
2572 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2574 if($succ_node !=
"")
2576 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2579 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2581 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2582 $this->lm_set->get(
"time_scheduled_page_activation"));
2586 if (!$this->lm->cleanFrames())
2589 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2592 else if ($showViewInFrameset && !$this->
offlineMode())
2595 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2596 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2601 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2602 $succ_target =
' target="_top" ';
2608 $output = $this->lng->txt(
"msg_page_not_public");
2611 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2613 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2614 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2615 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2616 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2617 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2618 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2619 $this->tpl->setVariable(
"SPACER_SUCC", $this->
offlineMode()
2620 ?
"images/spacer.gif"
2622 $this->tpl->setVariable(
"NEXT_ACC_KEY",
2624 $this->tpl->parseCurrentBlock();
2625 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2626 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2627 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2628 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2629 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2630 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2631 $this->tpl->setVariable(
"SPACER_SUCC2", $this->
offlineMode()
2632 ?
"images/spacer.gif"
2634 $this->tpl->parseCurrentBlock();
2635 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2638 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation");
2644 $child_nodes = $a_node->child_nodes();
2645 foreach ($child_nodes as $child)
2647 if($child->node_name() ==
"ilFrame")
2649 $attributes = $this->
attrib2arr($child->attributes());
2651 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2655 if(!empty($attributes[
"name"]))
2657 unset($attributes[
"template"]);
2658 unset($attributes[
"template_location"]);
2659 $attributes[
"src"] =
2660 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2661 "",
"keep",
"",
$_GET[
"srcstring"]);
2662 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2663 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2664 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2669 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2671 $a_content .= $this->
buildTag(
"end",
"frameset");
2676 unset($attributes[
"template"]);
2677 unset($attributes[
"template_location"]);
2678 $attributes[
"src"] =
2679 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2680 "",
"keep",
"",
$_GET[
"srcstring"]);
2681 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2682 if ($attributes[
"name"] ==
"toc")
2684 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2689 if (
$_GET[
"anchor"] !=
"")
2691 $attributes[
"src"].=
"#".rawurlencode(
$_GET[
"anchor"]);
2694 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2695 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2717 if (is_array($attr))
2719 while (list($k,$v) = each($attr))
2720 $tag.=
" ".$k.
"=\"$v\"";
2739 $ilBench->start(
"ContentPresentation",
"TableOfContents");
2742 $this->tpl->setCurrentBlock(
"ContentStyle");
2745 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2750 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2752 $this->tpl->parseCurrentBlock();
2763 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2764 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2768 $this->tpl->getStandardTemplate();
2771 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2774 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
"Modules/LearningModule");
2777 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2778 $this->tpl->setTitle($this->lm->getTitle());
2792 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2794 $this->
getLink($this->lm->getRefId(),
""),
2797 $exp->setTargetGet(
"obj_id");
2799 $exp->forceExpandAll(
true,
false);
2807 if ($this->chapter_has_no_active_page &&
2810 $exp->highlightNode(
$_GET[
"obj_id"]);
2814 $exp->highlightNode($page_id);
2818 $tree =& $this->lm->getTree();
2819 if (
$_GET[
"lmtocexpand"] ==
"")
2821 $expanded = $tree->readRootId();
2825 $expanded =
$_GET[
"lmtocexpand"];
2828 $exp->setExpand($expanded);
2832 $output = $exp->getOutput();
2834 $this->tpl->setVariable(
"EXPLORER", $output);
2835 $this->tpl->parseCurrentBlock();
2839 return $this->tpl->get();
2846 $ilBench->stop(
"ContentPresentation",
"TableOfContents");
2857 $this->ctrl->setCmd(
"showSummary");
2858 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2875 global
$ilBench, $ilLocator, $ilAccess;
2886 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2887 $this->tpl->setStyleSheetLocation(
"./".$style_name);
2890 $this->tpl->getStandardTemplate();
2891 $this->tpl->setTitle($this->lm->getTitle());
2894 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2898 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2904 $ilLocator->addRepositoryItems();
2905 $this->tpl->setLocator();
2908 $this->lng->loadLanguageModule(
"meta");
2910 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2913 $info->enablePrivateNotes();
2914 $info->enableLearningProgress();
2916 $info->enableNews();
2917 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2920 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
2922 $info->enableNewsEditing();
2924 if ($enable_internal_rss)
2926 $info->setBlockProperty(
"news",
"settings",
true);
2948 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
2952 $this->tpl->setContent($info->getHTML());
2953 return $this->tpl->get();
2958 $this->ctrl->forwardCommand($info);
2969 global $ilUser,
$lng;
2971 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2972 if (!$this->lm->isActivePrintView())
2977 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2980 $this->tpl->setCurrentBlock(
"ContentStyle");
2983 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2988 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2990 $this->tpl->parseCurrentBlock();
2994 $this->tpl->getStandardTemplate();
2996 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3000 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
3001 "tpl.lm_print_selection.html",
"Modules/LearningModule");
3004 $this->tpl->setTitle($this->lm->getTitle());
3012 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
3013 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
3015 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3017 if (!is_array(
$_POST[
"item"]))
3019 if (
$_GET[
"obj_id"] !=
"")
3031 foreach ($nodes as $node)
3036 $this->lm_set->get(
"time_scheduled_page_activation"));
3038 if ($node[
"type"] ==
"pg" &&
3044 $text = $img_scr = $img_alt =
"";
3048 switch ($node[
"type"])
3054 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3055 $this->lm_set->get(
"time_scheduled_page_activation"));
3058 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3063 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3067 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"pg");
3072 $text = $this->lm->getTitle();
3074 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"obj_lm");
3081 $this->lm->isActiveNumbering());
3083 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3088 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3092 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"st");
3098 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3101 $this->nl->addListNode($node[
"obj_id"], $text, $node[
"parent"], $checked, $disabled,
3102 $img_src, $img_alt);
3107 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
3111 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3112 $this->lm_set->get(
"time_scheduled_page_activation"));
3115 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3120 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3124 $id =
$_GET[
"obj_id"];
3128 $this->nl->addListNode($id, $text, 0, $checked, $disabled,
3129 $img_src, $img_alt);
3132 $f = $this->form->getHTML();
3136 $tb->addFormButton($lng->txt(
"cont_show_print_view"),
"showPrintView");
3137 $this->tpl->setVariable(
"TOOLBAR", $tb->getHTML());
3139 $this->tpl->setVariable(
"ITEM_SELECTION", $f);
3151 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3157 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
3158 $radg->addOption($op1);
3159 $op2 =
new ilRadioOption($lng->txt(
"cont_current_chapter"),
"chapter");
3160 $radg->addOption($op2);
3161 $op3=
new ilRadioOption($lng->txt(
"cont_selected_pg_chap"),
"selection");
3162 $radg->addOption($op3);
3164 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
3167 $op3->addSubItem($nl);
3170 $this->form->addItem($radg);
3172 $this->form->addCommandButton(
"showPrintView", $lng->txt(
"cont_show_print_view"));
3173 $this->form->setOpenTag(
false);
3174 $this->form->setCloseTag(
false);
3176 $this->form->setTitle($lng->txt(
"cont_print_selection"));
3177 $this->form->setFormAction($ilCtrl->getFormAction($this));
3187 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
3189 if (!$this->lm->isActivePrintView())
3194 $ilBench->start(
"ContentPresentation",
"PrintView");
3200 if (
$_POST[
"sel_type"] ==
"page")
3202 if (!is_array(
$_POST[
"obj_id"]) || !in_array($c_obj_id,
$_POST[
"obj_id"]))
3204 $_POST[
"obj_id"][] = $c_obj_id;
3207 if (
$_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
3210 $path = $this->lm_tree->getPathFull($c_obj_id);
3211 $chap_id =
$path[1][
"child"];
3214 $_POST[
"obj_id"][] = $chap_id;
3227 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
3228 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
3232 $this->tpl->setCurrentBlock(
"ContentStyle");
3235 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3240 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3242 $this->tpl->parseCurrentBlock();
3245 $this->tpl->setCurrentBlock(
"SyntaxStyle");
3246 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
3248 $this->tpl->parseCurrentBlock();
3251 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
3254 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
3256 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3258 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
3259 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3260 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3265 $glossary_links = array();
3266 $output_header =
false;
3267 $media_links = array();
3270 if ($this->lm->getFooterPage() > 0)
3275 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getFooterPage());
3276 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3278 $this->lm->getStyleSheetId(),
"lm"));
3282 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3283 $page_object_gui->setOutputMode(
"print");
3284 $page_object_gui->setPresentationTitle(
"");
3285 $page_object_gui->setFileDownloadLink(
"#");
3286 $page_object_gui->setFullscreenLink(
"#");
3287 $page_object_gui->setSourceCodeDownloadScript(
"#");
3288 $footer_page_content = $page_object_gui->showPage();
3291 if ($this->lm->getHeaderPage() > 0)
3296 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getHeaderPage());
3297 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3299 $this->lm->getStyleSheetId(),
"lm"));
3303 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3304 $page_object_gui->setOutputMode(
"print");
3305 $page_object_gui->setPresentationTitle(
"");
3306 $page_object_gui->setFileDownloadLink(
"#");
3307 $page_object_gui->setFullscreenLink(
"#");
3308 $page_object_gui->setSourceCodeDownloadScript(
"#");
3309 $header_page_content = $page_object_gui->showPage();
3314 if (is_array(
$_POST[
"obj_id"]))
3316 foreach(
$_POST[
"obj_id"] as $k)
3318 if ($k > 0 && !$this->lm_tree->isInTree($k))
3322 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
3330 $ilCtrl->redirect($this,
"showPrintViewSelection");
3333 foreach ($nodes as $node_key => $node)
3337 $this->lm_set->get(
"time_scheduled_page_activation"));
3338 if ($node[
"type"] ==
"pg" && !$active)
3345 if ($node[
"depth"] <= $act_level)
3347 if (is_array(
$_POST[
"obj_id"]) && in_array($node[
"obj_id"],
$_POST[
"obj_id"]))
3349 $act_level = $node[
"depth"];
3363 if ($node[
"type"] ==
"du")
3365 $output_header =
true;
3369 if ($node[
"type"] ==
"st")
3372 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3381 $this->tpl->setCurrentBlock(
"print_chapter");
3383 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3384 $this->lm->isActiveNumbering());
3385 $this->tpl->setVariable(
"CHAP_TITLE",
3390 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3392 $this->tpl->setVariable(
"CHAP_HEADER",
3393 $header_page_content);
3394 $did_chap_page_header =
true;
3398 $this->tpl->parseCurrentBlock();
3399 $this->tpl->setCurrentBlock(
"print_block");
3400 $this->tpl->parseCurrentBlock();
3404 if ($node[
"type"] ==
"pg")
3407 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3415 $this->tpl->setCurrentBlock(
"print_item");
3418 $page_id = $node[
"obj_id"];
3419 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
3420 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
3421 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3423 $this->lm->getStyleSheetId(),
"lm"));
3428 $lm_pg_obj->setLMId($this->lm->getId());
3431 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3432 $page_object_gui->setOutputMode(
"print");
3433 $page_object_gui->setPresentationTitle(
"");
3435 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3438 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3439 $this->lm_set->get(
"time_scheduled_page_activation"));
3443 if ($this->lm->isActiveNumbering())
3445 $chapter_title = trim(substr($chapter_title,
3446 strpos($chapter_title,
" ")));
3449 if ($page_title != $chapter_title)
3451 $page_object_gui->setPresentationTitle($page_title);
3456 $hcont = $header_page_content;
3457 $fcont = $footer_page_content;
3461 if ($did_chap_page_header)
3465 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3466 !($nodes[$node_key + 1][
"depth"] <= $act_level
3467 && !in_array($nodes[$node_key + 1][
"obj_id"],
$_POST[
"obj_id"])))
3473 $page_object_gui->setFileDownloadLink(
"#");
3474 $page_object_gui->setFullscreenLink(
"#");
3475 $page_object_gui->setSourceCodeDownloadScript(
"#");
3476 $page_object_gui->setEnabledSelfAssessment(
true);
3477 $page_content = $page_object_gui->showPage();
3480 $this->tpl->setVariable(
"CONTENT",
3481 $hcont.$page_content.$fcont);
3485 $this->tpl->setVariable(
"CONTENT",
3486 $hcont.$page_content.$fcont.
"<br />");
3488 $chapter_title =
"";
3489 $this->tpl->parseCurrentBlock();
3490 $this->tpl->setCurrentBlock(
"print_block");
3491 $this->tpl->parseCurrentBlock();
3498 foreach ($int_links as $key => $link)
3500 if ($link[
"type"] ==
"git" &&
3501 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3503 $glossary_links[$key] = $link;
3505 if ($link[
"type"] ==
"mob" &&
3506 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3509 $mob_links[$key] = $link;
3520 $page_object->buildDom();
3521 $links = $page_object->getInternalLinks();
3522 foreach($links as $link)
3524 if ($link[
"Type"] ==
"MediaObject"
3525 && $link[
"TargetFrame"] !=
""
3526 && $link[
"TargetFrame"] !=
"None")
3528 $media_links[] = $link;
3540 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3542 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3543 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3548 foreach($glossary_links as $key => $link)
3551 $terms[$term.
":".$key] = array(
"key" => $key,
"link" => $link,
"term" => $term);
3556 foreach($terms as
$t)
3564 foreach($defs as $def)
3567 if (count($defs) > 1)
3569 $this->tpl->setCurrentBlock(
"def_title");
3570 $this->tpl->setVariable(
"TXT_DEFINITION",
3571 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3572 $this->tpl->parseCurrentBlock();
3576 $page_gui->setTemplateOutput(
false);
3577 $page_gui->setOutputMode(
"print");
3579 $this->tpl->setCurrentBlock(
"definition");
3580 $page_gui->setFileDownloadLink(
"#");
3581 $page_gui->setFullscreenLink(
"#");
3582 $page_gui->setSourceCodeDownloadScript(
"#");
3583 $output = $page_gui->showPage();
3584 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3585 $this->tpl->parseCurrentBlock();
3589 $this->tpl->setCurrentBlock(
"term");
3590 $this->tpl->setVariable(
"VAL_TERM",
3592 $this->tpl->parseCurrentBlock();
3597 $this->tpl->setCurrentBlock(
"glossary");
3598 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3599 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3600 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3601 $this->tpl->parseCurrentBlock();
3603 $annexes[] = $annex_title;
3607 if (count($media_links) > 0)
3609 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3610 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3612 foreach($media_links as $media)
3614 if (substr($media[
"Target"],0,4) ==
"il__")
3616 $arr = explode(
"_",$media[
"Target"]);
3617 $id = $arr[count($arr) - 1];
3620 $med_item =& $med_obj->getMediaItem(
"Standard");
3621 if (is_object($med_item))
3623 if (is_int(strpos($med_item->getFormat(),
"image")))
3625 $this->tpl->setCurrentBlock(
"ref_image");
3628 if ($med_item->getLocationType() ==
"LocalFile")
3630 $this->tpl->setVariable(
"IMG_SOURCE",
3632 "/".$med_item->getLocation());
3636 $this->tpl->setVariable(
"IMG_SOURCE",
3637 $med_item->getLocation());
3640 if ($med_item->getCaption() !=
"")
3642 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3646 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3648 $this->tpl->parseCurrentBlock();
3656 $this->tpl->setCurrentBlock(
"ref_images");
3657 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3658 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3659 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3660 $this->tpl->parseCurrentBlock();
3662 $annexes[] = $annex_title;
3668 $this->tpl->setCurrentBlock(
"print_header");
3669 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3670 if ($this->lm->getDescription() !=
"none")
3672 include_once(
"Services/MetaData/classes/class.ilMD.php");
3673 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3675 foreach($md_gen->getDescriptionIds() as $id)
3677 $md_des = $md_gen->getDescription($id);
3678 $description = $md_des->getDescription();
3681 $this->tpl->setVariable(
"LM_DESCRIPTION",
3684 $this->tpl->parseCurrentBlock();
3688 foreach ($nodes2 as $node2)
3690 if ($node2[
"type"] ==
"st"
3693 for ($j=1; $j < $node2[
"depth"]; $j++)
3695 $this->tpl->setCurrentBlock(
"indent");
3697 $this->tpl->parseCurrentBlock();
3699 $this->tpl->setCurrentBlock(
"toc_entry");
3700 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3702 $this->lm->isActiveNumbering()));
3703 $this->tpl->parseCurrentBlock();
3708 foreach ($annexes as $annex)
3710 $this->tpl->setCurrentBlock(
"indent");
3712 $this->tpl->parseCurrentBlock();
3713 $this->tpl->setCurrentBlock(
"toc_entry");
3714 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3715 $this->tpl->parseCurrentBlock();
3718 $this->tpl->setCurrentBlock(
"toc");
3719 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3720 $this->tpl->parseCurrentBlock();
3722 $this->tpl->setCurrentBlock(
"print_start_block");
3723 $this->tpl->parseCurrentBlock();
3727 include_once
'Services/MetaData/classes/class.ilMD.php';
3728 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3729 if(is_object($lifecycle = $md->getLifecycle()))
3731 $sep = $author =
"";
3732 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3734 $md_con = $lifecycle->getContribute($con_id);
3735 if ($md_con->getRole() ==
"Author")
3737 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3739 $md_ent = $md_con->getEntity($ent_id);
3740 $author = $author.$sep.$md_ent->getEntity();
3747 $this->lng->loadLanguageModule(
"meta");
3748 $this->tpl->setCurrentBlock(
"author");
3749 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3750 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3751 $this->tpl->parseCurrentBlock();
3757 if (is_object($md_rights = $md->getRights()))
3759 $copyright = $md_rights->getDescription();
3760 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3763 if ($copyright !=
"")
3765 $this->lng->loadLanguageModule(
"meta");
3766 $this->tpl->setCurrentBlock(
"copyright");
3767 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3768 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3769 $this->tpl->parseCurrentBlock();
3773 $this->tpl->show(
false);
3775 $ilBench->stop(
"ContentPresentation",
"PrintView");
3781 if(
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")
3783 if(
$_POST[
"action"] ==
"show_citation")
3786 if(count(
$_POST[
"target"]) != 1)
3790 $_POST[
"target"] = 0;
3799 if(isset(
$_POST[
"tr_id"]))
3807 if(is_array(
$_POST[
"target"]))
3826 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3827 $fileObj =&
new ilObjFile($file_id,
false);
3828 $fileObj->sendFile();
3837 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3850 $this->tpl->setCurrentBlock(
"ContentStyle");
3853 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3858 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3860 $this->tpl->parseCurrentBlock();
3864 $this->tpl->getStandardTemplate();
3866 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3871 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
3874 $this->tpl->setTitle($this->lm->getTitle());
3884 include_once
'Services/MetaData/classes/class.ilMD.php';
3885 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3886 if (is_object($md_rights = $md->getRights()))
3888 $copyright = $md_rights->getDescription();
3890 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3893 if ($copyright !=
"")
3895 $this->lng->loadLanguageModule(
"meta");
3896 $this->tpl->setCurrentBlock(
"copyright");
3897 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3898 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3899 $this->tpl->parseCurrentBlock();
3904 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
3908 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
3911 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
3913 $export_files = array();
3914 $types = array(
"xml",
"html",
"scorm");
3915 foreach($types as $type)
3917 if ($this->lm->getPublicExportFile($type) !=
"")
3919 if (is_file($this->lm->getExportDirectory($type).
"/".
3920 $this->lm->getPublicExportFile($type)))
3922 $dir = $this->lm->getExportDirectory($type);
3923 $size = filesize($this->lm->getExportDirectory($type).
"/".
3924 $this->lm->getPublicExportFile($type));
3925 $export_files[] = array(
"type" => $type,
3926 "file" => $this->lm->getPublicExportFile($type),
3934 $tbl->setTitle($this->lng->txt(
"download"));
3936 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
3937 $this->lng->txt(
"cont_file"),
3938 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
3941 $cols = array(
"format",
"file",
"size",
"date",
"download");
3942 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
3943 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
3944 $tbl->setHeaderVars($cols, $header_params);
3945 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
3946 $tbl->disable(
"sort");
3949 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3950 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3951 $tbl->setLimit(
$_GET[
"limit"]);
3952 $tbl->setOffset(
$_GET[
"offset"]);
3953 $tbl->setMaxCount($this->maxcount);
3959 $tbl->disable(
"footer");
3961 $tbl->setMaxCount(count($export_files));
3962 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3965 if(count($export_files) > 0)
3968 foreach($export_files as $exp_file)
3970 if (!$exp_file[
"size"] > 0)
3975 $this->tpl->setCurrentBlock(
"tbl_content");
3976 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
3979 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3981 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
3982 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
3983 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
3985 $file_arr = explode(
"__", $exp_file[
"file"]);
3986 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
3988 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
3989 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
3990 $this->tpl->setVariable(
"LINK_DOWNLOAD",
3991 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
3993 $this->tpl->parseCurrentBlock();
3998 $this->tpl->setCurrentBlock(
"notfound");
3999 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
4000 $this->tpl->setVariable(
"NUM_COLS", 5);
4001 $this->tpl->parseCurrentBlock();
4013 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
4014 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
4016 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
4023 $this->ilias->raiseError($this->lng->txt(
"file_not_found"),$this->ilias->error_obj->MESSAGE);
4029 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
4030 $a_back_link =
"append", $a_anchor =
"", $a_srcstring =
"")
4041 $back_pg =
$_GET[
"back_pg"];
4042 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
4043 $a_back_link ==
"append")
4047 $back_pg = $cur_page_id.
":".$back_pg;
4051 $back_pg = $cur_page_id;
4056 if ($a_back_link ==
"reduce")
4058 $limpos = strpos(
$_GET[
"back_pg"],
":");
4062 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
4069 else if ($a_back_link !=
"keep")
4078 $this->ctrl->setParameter($this,
"from_page", $cur_page_id);
4080 if ($a_anchor !=
"")
4082 $this->ctrl->setParameter($this,
"anchor", rawurlencode($a_anchor));
4084 if ($a_srcstring !=
"")
4086 $this->ctrl->setParameter($this,
"srcstring", $a_srcstring);
4091 $link = $this->ctrl->getLinkTarget($this,
"fullscreen",
"",
false,
false);
4098 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
4102 $this->ctrl->setParameter($this,
"frame", $a_frame);
4104 if ($a_obj_id !=
"")
4109 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
4113 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
4114 $link.=
"&obj_id=".$a_obj_id;
4120 $this->ctrl->setParameter($this,
"obj_type", $a_type);
4122 $link = $this->ctrl->getLinkTarget($this, $a_cmd, $a_anchor);
4125 $this->ctrl->setParameter($this,
"frame",
"");
4126 $this->ctrl->setParameter($this,
"obj_id",
"");
4127 $this->ctrl->setParameter($this,
"mob_id",
"");
4135 case "downloadFile":
4139 $link =
"fullscreen.html";
4144 if ($a_obj_id ==
"")
4146 $a_obj_id = $this->lm_tree->getRootId();
4147 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4148 $a_obj_id = $pg_node[
"obj_id"];
4150 if ($a_type ==
"StructureObject")
4152 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4153 $a_obj_id = $pg_node[
"obj_id"];
4155 if ($a_frame !=
"" && $a_frame !=
"_blank")
4157 if ($a_frame !=
"toc")
4159 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
4163 $link =
"frame_".$a_frame.
".html";
4171 $link =
"lm_pg_".$nid.
".html";
4175 $link =
"lm_pg_".$a_obj_id.
".html";
4181 $link =
"term_".$a_obj_id.
".html";
4185 $link =
"media_".$a_obj_id.
".html";
4193 $this->ctrl->clearParameters($this);
4205 $this->tpl->setCurrentBlock(
"ContentStyle");
4209 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
4214 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
4217 $this->tpl->parseCurrentBlock();
4218 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
4219 $this->tpl->setCurrentBlock(
"pg_content");
4220 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
4221 $this->tpl->parseCurrentBlock();
4228 $target = $this->ctrl->getLinkTarget($this,
"");
4230 return $this->ctrl->getLinkTarget($this,
"");
4246 $this->offline_directory = $offdir;
4268 if (!($fp = @fopen(
$file,
"w+")))
4270 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
4271 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
4281 $this->tpl->setHeaderPageTitle($this->lm->getTitle());
4282 $this->tpl->fillWindowTitle();