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");
37 $lng->loadLanguageModule(
"content");
42 $this->offline =
false;
43 $this->frames = array();
45 $this->ctrl->saveParameter($this, array(
"ref_id"));
48 # include_once './classes/class.ilSearch.php';
50 # if(!ilSearch::_checkParentConditions($_GET['ref_id']))
52 # $ilias->error_obj->raiseError($lng->txt('access_denied'),$ilias->error_obj->WARNING);
55 $type = $this->ilias->obj_factory->getTypeByRefId(
$_GET[
"ref_id"]);
61 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
66 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
72 $this->lm =& $this->lm_gui->object;
74 include_once
'payment/classes/class.ilPaymentObject.php';
78 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
80 if (!$this->lm->getOnline())
82 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
86 $this->lm_tree =
new ilTree($this->lm->getId());
88 $this->lm_tree->setTreeTablePK(
"lm_id");
93 $this->
abstract =
true;
95 if((count(
$_POST[
"tr_id"]) > 1) or
96 (!
$_POST[
"target"] and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")))
98 $this->
abstract =
true;
100 else if(
$_GET[
"obj_id"] or (
$_POST[
"action"] ==
"show") or (
$_POST[
"action"] ==
"show_citation"))
102 $this->
abstract =
false;
114 global $ilNavigationHistory, $ilAccess,
$ilias,
$lng;
116 include_once
'payment/classes/class.ilPaymentObject.php';
117 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
120 if(!((
int)
$_GET[
'obj_id'] &&
122 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
125 unset(
$_GET[
'obj_id']);
127 $this->tpl->getStandardTemplate();
130 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
132 $ret = $this->ctrl->forwardCommand($pp);
140 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
141 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
142 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
144 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
147 $next_class = $this->ctrl->getNextClass($this);
148 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
157 $obj_id =
$_GET[
"obj_id"];
158 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
159 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
160 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
168 case "ilinfoscreengui":
184 $this->offline = $a_offline;
203 $this->export_format = $a_format;
213 return $this->export_format;
235 $q =
"DELETE FROM lo_access ".
236 "WHERE usr_id = ".$ilDB->quote((
int)
$usr_id,
"integer").
" ".
237 "AND lm_id = ".$ilDB->quote((
int) $lm_id,
"integer");
238 $ilDB->manipulate(
$q);
239 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
242 $q =
"INSERT INTO lo_access ".
243 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
245 "(".$ilDB->now().
",".
246 $ilDB->quote((
int) $usr_id,
"integer").
",".
247 $ilDB->quote((
int) $lm_id,
"integer").
",".
248 $ilDB->quote((
int) $obj_id,
"integer").
",".
249 $ilDB->quote(
$title,
"text").
")";
250 $ilDB->manipulate(
$q);
263 switch($this->lm->getType())
266 $this->lm_gui->export();
282 if (
$_POST[
"cmd"][
"cancel"] !=
"")
284 $this->ctrl->setParameter($this,
"frame",
"maincontent");
285 $this->ctrl->redirect($this,
"layout");
288 switch($this->lm->getType())
292 $_GET[
"frame"] =
"maincontent";
295 $_GET[
"obj_id"] = $objRow[
"obj_id"];
297 $query =
"SELECT * FROM lm_data WHERE lm_id = ".
298 $ilDB->quote($objRow[
"obj_id"],
"integer").
304 while (is_array(
$row = $ilDB->fetchAssoc(
$result)) )
314 if(
$_POST[
"type"] ==
"pdf") $output .=
"<hr BREAK >\n";
315 if(
$_POST[
"type"] ==
"print") $output .=
"<p style=\"page-break-after:always\" />";
316 if(
$_POST[
"type"] ==
"html") $output .=
"<br><br><br><br>";
321 $o = $this->
layout(
"main.xml",
false);
323 $output .=
"<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_PageTitle\">".$this->lm->title.
"</div><p>";
326 $output .=
"\n<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td valign=top align=center>- ".$page.
" -</td></tr></table>\n";
331 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
333 if(
$_POST[
"type"] ==
"print")
335 $printTpl->touchBlock(
"printreq");
341 $css1 =
"./css/delos.css";
342 $css2 =
"./css/content.css";
344 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
346 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
347 $printTpl->setVariable(
"CONTENT",$output);
350 $printTpl->setCurrentBlock(
"SyntaxStyle");
351 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
353 $printTpl->parseCurrentBlock();
356 $html = $printTpl->get();
361 $this->lm->createExportDirectory();
362 $export_dir = $this->lm->getExportDirectory();
367 $fileName =
"offline";
368 $fileName = str_replace(
" ",
"_",$fileName);
370 if (!file_exists($export_dir.
"/".$fileName))
372 @mkdir($export_dir.
"/".$fileName);
373 @chmod($export_dir.
"/".$fileName, 0755);
375 @mkdir($export_dir.
"/".$fileName.
"/css");
376 @chmod($export_dir.
"/".$fileName.
"/css", 0755);
380 if(
$_POST[
"type"] ==
"xml")
383 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_GET[
"ref_id"]);
385 if ($tmp_obj->getType() ==
"dbk" )
387 require_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
393 else if(
$_POST[
"type"] ==
"print")
397 else if (
$_POST[
"type"]==
"html")
405 $css1 = file(
"./templates/default/delos.css");
406 $css1 = implode($css1,
"");
408 $fp = fopen($export_dir.
"/".$fileName.
"/css/delos.css",
"wb");
412 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".html",
"wb");
416 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
421 else if (
$_POST[
"type"]==
"pdf")
445 switch($this->lm->getType())
448 $this->lm_gui->offlineexportform();
469 $filename = preg_replace(
'/[^a-z0-9_]/i',
'_', $objRow[
"title"]);
471 $C = $this->lm_gui->showAbstract(array(1));
473 if (
$_GET[
"print"]==1)
475 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
476 $printTpl->touchBlock(
"printreq");
479 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
481 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
484 $printTpl->setCurrentBlock(
"SyntaxStyle");
485 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
487 $printTpl->parseCurrentBlock();
489 $printTpl->setVariable(
"CONTENT",$C);
491 echo $printTpl->get();
508 if(!is_array($a_attributes))
512 foreach ($a_attributes as $attribute)
514 $attr[$attribute->name()] = $attribute->value();
524 return $this->frames;
538 $layout = $this->lm->getLayout();
539 if ($this->lm->getLayoutPerPage())
560 function layout($a_xml =
"main.xml", $doShow =
true)
564 $ilBench->start(
"ContentPresentation",
"layout");
571 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
573 if (!$doc =
domxml_open_mem($xmlfile)) { echo
"ilLMPresentation: XML File invalid";
exit; }
574 $this->layout_doc =& $doc;
578 $ilBench->start(
"ContentPresentation",
"layout_getFrameNode");
580 $path = (empty(
$_GET[
"frame"]) || (
$_GET[
"frame"] ==
"_blank"))
581 ?
"/ilLayout/ilFrame[1]"
582 :
"//ilFrame[@name='".$_GET[
"frame"].
"']";
585 if (count($found) != 1) { echo
"ilLMPresentation: XML File invalid";
exit; }
588 $ilBench->stop(
"ContentPresentation",
"layout_getFrameNode");
592 $attributes = $this->
attrib2arr($node->attributes());
594 $this->frames = array();
595 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
597 $ilBench->start(
"ContentPresentation",
"layout_processFrameset");
598 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
602 $content .= $this->
buildTag(
"end",
"frameset");
603 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
604 $this->tpl->setVariable(
"PAGETITLE",
"- ".$this->lm->getTitle());
605 $this->tpl->setVariable(
"FS_CONTENT", $content);
606 $ilBench->stop(
"ContentPresentation",
"layout_processFrameset");
609 $content = $this->tpl->get();
615 $ilBench->start(
"ContentPresentation",
"layout_processContentTag");
617 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
618 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
625 if(empty(
$_GET[
"obj_type"]))
627 $obj_type =
"PageObject";
631 $obj_type =
$_GET[
"obj_type"];
635 $childs = $node->child_nodes();
637 foreach($childs as $child)
639 if ($child->node_name() == $obj_type)
642 $attributes = $this->
attrib2arr($child->attributes());
648 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
649 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
653 $in_module = ($attributes[
"template_location"] ==
"module")
658 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
659 $this->tpl->setBodyClass(
"");
673 $style_name = $this->ilias->account->prefs[
"style"].
".css";
674 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
677 $childs = $node->child_nodes();
679 $ilBench->start(
"ContentPresentation",
"layout_processContentNodes");
680 foreach($childs as $child)
683 $child_attr = $this->
attrib2arr($child->attributes());
685 switch ($child->node_name())
688 $ilBench->start(
"ContentPresentation",
"layout_mainmenu");
690 $ilBench->stop(
"ContentPresentation",
"layout_mainmenu");
694 $this->
ilTOC($child_attr[
"target_frame"]);
698 switch($this->lm->getType())
704 $content = $this->
ilPage($child);
711 $content = $this->lm_gui->showAbstract(
$_POST[
"target"]);
716 $content = $this->
ilPage($child);
731 case "ilLMNavigation":
734 if(
$_GET[
"obj_id"] or
736 (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")) or
737 $this->lm->getType() ==
'lm')
739 $ilBench->start(
"ContentPresentation",
"layout_lmnavigation");
741 $ilBench->stop(
"ContentPresentation",
"layout_lmnavigation");
750 $ilBench->start(
"ContentPresentation",
"layout_locator");
752 $ilBench->stop(
"ContentPresentation",
"layout_locator");
756 $this->
ilJavaScript($child_attr[
"inline"], $child_attr[
"file"],
757 $child_attr[
"location"]);
761 $ilBench->start(
"ContentPresentation",
"layout_lmmenu");
763 $ilBench->stop(
"ContentPresentation",
"layout_lmmenu");
771 $ilBench->start(
"ContentPresentation",
"layout_lmsubmenu");
773 $ilBench->stop(
"ContentPresentation",
"layout_lmsubmenu");
777 if (!$this->ilias->getSetting(
'disable_notes'))
779 $ilBench->start(
"ContentPresentation",
"layout_lmnotes");
781 $ilBench->stop(
"ContentPresentation",
"layout_lmnotes");
786 $ilBench->stop(
"ContentPresentation",
"layout_processContentNodes");
788 $ilBench->stop(
"ContentPresentation",
"layout_processContentTag");
792 if (strcmp(
$_GET[
"frame"],
"topright") == 0) $this->tpl->fillJavaScriptFiles();
793 if (strcmp(
$_GET[
"frame"],
"right") == 0) $this->tpl->fillJavaScriptFiles();
794 if (strcmp(
$_GET[
"frame"],
"botright") == 0) $this->tpl->fillJavaScriptFiles();
796 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
801 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
802 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
803 $this->tpl->fillJavaScriptFiles();
804 $this->tpl->fillScreenReaderFocus();
806 $this->tpl->fillCssFiles();
807 $this->tpl->fillBodyClass();
815 $this->tpl->fillTabs();
816 $content = $this->tpl->get();
817 $content = str_replace(
"{",
"{", $content);
818 $content = str_replace(
"}",
"}", $content);
820 header(
'Content-type: text/html; charset=UTF-8');
825 $content = $this->tpl->get();
828 $ilBench->stop(
"ContentPresentation",
"layout");
840 if (
$_GET[
"frame"] !=
"_blank")
852 if (
$_GET[
"frame"] !=
"_blank")
858 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
859 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
868 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
869 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
879 return $this->tpl->get();
899 $ilMainMenu->setSmallMode(
true);
903 $ilMainMenu->setSmallMode(
false);
906 $this->tpl->touchBlock(
"mm_intro");
907 $this->tpl->touchBlock(
"mm_outro");
908 $this->tpl->touchBlock(
"pg_intro");
909 $this->tpl->touchBlock(
"pg_outro");
910 $this->tpl->setBodyClass(
"std");
911 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
921 $ilBench->start(
"ContentPresentation",
"ilTOC");
922 require_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorer.php");
923 if ($this->lm->cleanFrames())
928 $exp->setExpandTarget($this->
getLink($this->lm->getRefId(),
$_GET[
"cmd"],
$_GET[
"obj_id"], $_GET[
"frame"]));
929 $exp->setTargetGet(
"obj_id");
930 if ($this->lm->cleanFrames())
934 $exp->setFrameTarget(
"_top");
943 $exp->setFrameTarget($a_target);
945 $exp->addFilter(
"du");
946 $exp->addFilter(
"st");
949 if ($this->lm->cleanFrames())
954 $path = $this->lm_tree->getPathId($page_id);
955 $exp->setForceOpenPath($path);
960 if ($this->chapter_has_no_active_page &&
963 $exp->highlightNode($_GET[
"obj_id"]);
967 $exp->highlightNode($page_id);
973 if ($this->lm->getTOCMode() ==
"pages")
975 $exp->addFilter(
"pg");
977 $exp->setFiltered(
true);
980 if ($_GET[
"lmexpand"] ==
"")
982 $expand_keys = array();
985 $expand_keys = array_keys(
$_SESSION[
"lmexpand"]);
987 $_SESSION[
"lmexpand"] = array($this->lm_tree->readRootId());
988 $expanded = $this->lm_tree->readRootId();
992 $expanded = $_GET[
"lmexpand"];
994 $exp->setExpand($expanded);
998 $output = $exp->getOutput();
1000 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
1009 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
1010 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
1015 $this->tpl->addBlockFile(
"EXPL_TOP",
"exp_top",
"tpl.explorer_top.html");
1019 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
1020 $this->tpl->setVariable(
"EXPLORER",$output);
1021 $this->tpl->setVariable(
"ACTION",
1022 $this->
getLink($this->lm->getRefId(), $_GET[
"cmd"],
"", $_GET[
"frame"]).
1023 "&lmexpand=".$_GET[
"lmexpand"]);
1024 $this->tpl->parseCurrentBlock();
1025 $ilBench->stop(
"ContentPresentation",
"ilTOC");
1026 if ($_GET[
"lmexpand"] ==
"")
1029 foreach ($expand_keys as $k)
1042 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
1051 $this->tpl->setCurrentBlock(
"header_image");
1054 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.gif");
1060 $this->tpl->parseCurrentBlock();
1061 $this->tpl->setCurrentBlock(
"lm_head");
1062 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
1063 $this->tpl->parseCurrentBlock();
1074 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1080 $showViewInFrameset =
true;
1082 if ($showViewInFrameset)
1088 $buttonTarget =
"_top";
1092 include_once(
"./classes/class.ilTemplate.php");
1093 $tpl_menu =&
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
1104 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1106 $tpl_menu->setCurrentBlock(
"edit_page");
1108 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
1109 "&obj_id=".$page_id.
"&to_page=1");
1110 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
1111 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
1112 $tpl_menu->parseCurrentBlock();
1117 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1119 $page_id.
"_".$this->lm->getRefId(),
1124 $title = $this->lm->getTitle();
1126 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
1127 if ($pg_title !=
"")
1129 $title.=
": ".$pg_title;
1134 $tpl_menu->setCurrentBlock(
"perma_link");
1135 $tpl_menu->setVariable(
"PERMA_LINK", $plinkgui->getHTML());
1136 $tpl_menu->parseCurrentBlock();
1140 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1152 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1165 $next_class = $this->ctrl->getNextClass($this);
1167 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1175 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1180 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1181 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1183 $notes_gui->enablePrivateNotes();
1184 if ($this->lm->publicNotes())
1186 $notes_gui->enablePublicNotes();
1189 if ($next_class ==
"ilnotegui")
1191 $html = $this->ctrl->forwardCommand($notes_gui);
1195 $html = $notes_gui->getNotesHTML();
1197 $this->tpl->setVariable(
"NOTES", $html);
1206 global $ilLocator, $tree;
1208 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1210 if (empty(
$_GET[
"obj_id"]))
1212 $a_id = $this->lm_tree->getRootId();
1216 $a_id =
$_GET[
"obj_id"];
1219 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1221 if (!$this->lm->cleanFrames())
1223 $frame_param =
$_GET[
"frame"];
1234 $frame_target =
"_top";
1239 $ilLocator->addItem(
"...",
"");
1241 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1242 $ilLocator->addItem(
1244 "repository.php?cmd=frameset&ref_id=".$par_id,
1249 $ilLocator->setOffline(
true);
1252 if($this->lm_tree->isInTree($a_id))
1254 $path = $this->lm_tree->getPathFull($a_id);
1258 if (
$row[
"type"] !=
"pg")
1260 if(
$row[
"child"] != $this->lm_tree->getRootId())
1262 $ilLocator->addItem(
1265 $this->lm->isActiveNumbering()),50,
true),
1266 $this->
getLink(
$_GET[
"ref_id"],
"layout",
$row[
"child"], $frame_param,
"StructureObject"),
1271 $ilLocator->addItem(
1273 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1274 $frame_target,
$_GET[
"ref_id"]);
1282 $ilLocator->addItem(
1283 $this->lm->getTitle(),
1286 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1289 $ilLocator->addItem(
1290 $lm_obj->getTitle(),
1291 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1297 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1303 $this->tpl->setLocator();
1310 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1312 $this->chapter_has_no_active_page =
false;
1313 $this->deactivated_page =
false;
1316 if(empty(
$_GET[
"obj_id"]))
1318 $obj_id = $this->lm_tree->getRootId();
1322 $obj_id =
$_GET[
"obj_id"];
1324 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1329 $this->deactivated_page =
true;
1334 if (!$this->lm_tree->isInTree($obj_id))
1339 $curr_node = $this->lm_tree->getNodeData($obj_id);
1342 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1344 if ($curr_node[
"type"] ==
"pg" &&
1347 $page_id = $curr_node[
"obj_id"];
1354 while($succ_node && !$active)
1356 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1357 $page_id = $succ_node[
"obj_id"];
1359 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1362 if ($succ_node[
"type"] !=
"pg")
1364 $this->chapter_has_no_active_page =
true;
1366 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1367 $this->ilias->raiseError($this->lng->txt(
"cont_no_page"),$this->ilias->error_obj->FATAL);
1374 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1378 while ($public ===
false && $page_id > 0)
1380 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1381 $page_id = $succ_node[
'obj_id'];
1387 if ($this->lm_tree->isInTree($page_id))
1389 $path = $this->lm_tree->getPathId($page_id);
1390 if (!in_array(
$_GET[
"obj_id"], $path))
1392 $this->chapter_has_no_active_page =
true;
1402 $subtree = $this->lm_tree->getSubTree($this->lm_tree->getNodeData(1));
1403 $node = $this->lm_tree->getNodeData($current_page_id);
1404 $pos = array_search($node,$subtree);
1406 $this->tr_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_SESSION[
"tr_id"]);
1408 $lmtree =
new ilTree($this->tr_obj->getId());
1410 $lmtree->setTreeTablePK(
"lm_id");
1412 $subtree = $lmtree->getSubTree($lmtree->getNodeData(1));
1414 return $subtree[$pos][
"child"];
1421 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1422 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1428 $this->tpl->setVariable(
"TRANSLATION_CONTENT",
"NO TRNSLATION FOUND");
1432 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1433 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1436 $this->ilias->account->setDesktopItemParameters(
$_SESSION[
"tr_id"], $this->lm->getType(),$page_id);
1439 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1447 $lm_pg_obj->setLMId(
$_SESSION[
"tr_id"]);
1449 #$page_object_gui->setLayoutLinkTargets($targets);
1452 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1456 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1457 $page_object_gui->setOutputMode(
"presentation");
1458 $page_object_gui->setOutputSubmode(
"translation");
1460 $page_object_gui->setPresentationTitle(
1462 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1463 $this->lm_set->get(
"time_scheduled_page_activation")));
1464 # $page_object_gui->setLinkParams("ref_id=".$this->lm->getRefId());
1465 $page_object_gui->setLinkParams(
"ref_id=".
$_SESSION[
"tr_id"]);
1466 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1467 $page_object_gui->setTemplateOutputVar(
"TRANSLATION_CONTENT");
1470 return $page_object_gui->presentation();
1477 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1479 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1481 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1483 $this->pg_obj =&
new ilPageObject($this->lm->getType(),$page_id);
1485 $this->lm_gui->showCitation($xml);
1493 if (!is_object($this->layout_doc))
1498 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1501 for ($i = 0; $i < count(
$res->nodeset); $i++)
1503 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1504 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1505 $onclick =
$res->nodeset[$i]->get_attribute(
"OnClick");
1506 $targets[
$type] = array(
"Type" =>
$type,
"Frame" => $frame,
"OnClick" => $onclick);
1517 function ilPage(&$a_page_node, $a_page_id = 0)
1522 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1535 $ilBench->start(
"ContentPresentation",
"ilPage");
1537 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1538 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1541 if ($a_page_id == 0)
1543 $ilBench->start(
"ContentPresentation",
"ilPage_getCurrentPageId");
1545 $ilBench->stop(
"ContentPresentation",
"ilPage_getCurrentPageId");
1549 $page_id = $a_page_id;
1553 $this->tpl->setCurrentBlock(
"ContentStyle");
1556 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1561 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1563 $this->tpl->parseCurrentBlock();
1566 if ($this->chapter_has_no_active_page &&
1569 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1570 "Modules/LearningModule");
1571 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1574 $mtpl->setVariable(
"ITEM_TITLE",
1576 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1577 return $mtpl->get();
1581 if ($this->deactivated_page)
1583 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1584 "Modules/LearningModule");
1585 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_page_currently_deactivated"));
1588 $mtpl->setVariable(
"ITEM_TITLE",
1590 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1591 return $mtpl->get();
1597 $cont = $this->lng->txt(
"cont_no_page");
1598 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1602 $ilBench->start(
"ContentPresentation",
"ilPage_getPageObject");
1603 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1605 $page_object->registerOfflineHandler($this);
1606 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageObject");
1608 $ilBench->start(
"ContentPresentation",
"ilPage_getInternalLinks");
1609 $int_links = $page_object->getInternalLinks();
1610 $ilBench->stop(
"ContentPresentation",
"ilPage_getInternalLinks");
1612 $ilBench->start(
"ContentPresentation",
"ilPage_getPageObjectGUI");
1613 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1614 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1616 $this->lm->getStyleSheetId(),
"lm"));
1618 $page_object_gui->setTemplateOutput(
false);
1619 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageObjectGUI");
1622 $this->ilias->account->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1625 $ilBench->start(
"ContentPresentation",
"ilPage_updateCourseItems");
1626 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1628 $ilBench->stop(
"ContentPresentation",
"ilPage_updateCourseItems");
1637 $ilBench->start(
"ContentPresentation",
"ilPage_getLMPageObject");
1639 $lm_pg_obj->setLMId($this->lm->getId());
1641 $page_object_gui->setLinkXML($link_xml);
1642 $ilBench->stop(
"ContentPresentation",
"ilPage_getLMPageObject");
1644 $ilBench->start(
"ContentPresentation",
"ilPage_preparePage");
1647 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1648 $page_object_gui->enableCitation((
bool)
$_SESSION[
"citation"]);
1652 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1655 $page_object_gui->setOutputMode(
"presentation");
1659 $page_object_gui->setOutputMode(
"offline");
1662 $page_object_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1663 $page_object_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1667 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1668 $page_id != $this->lm->getFooterPage()))
1670 $page_object_gui->setPresentationTitle(
1672 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1673 $this->lm_set->get(
"time_scheduled_page_activation")));
1677 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1678 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1681 if($_SESSION[
"tr_id"])
1683 $page_object_gui->setOutputSubmode(
"translation");
1687 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1690 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1695 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1696 "syntaxhighlight.css");
1698 $this->tpl->parseCurrentBlock();
1700 $ilBench->stop(
"ContentPresentation",
"ilPage_preparePage");
1703 $ilBench->start(
"ContentPresentation",
"ilPage_trackUserAccess");
1704 include_once
"Services/Tracking/classes/class.ilTracking.php";
1706 $page_id,
"pg",
"read");
1707 $ilBench->stop(
"ContentPresentation",
"ilPage_trackUserAccess");
1709 $ilBench->start(
"ContentPresentation",
"ilPage_getPageContent");
1710 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1711 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageContent");
1713 $ilBench->stop(
"ContentPresentation",
"ilPage");
1716 if ($this->lm->getHeaderPage() > 0 &&
1717 $page_id != $this->lm->getHeaderPage() &&
1718 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1722 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1727 if ($this->lm->getFooterPage() > 0 &&
1728 $page_id != $this->lm->getFooterPage() &&
1729 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1733 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1736 $this->tpl->setVariable(
"PAGE_CONTENT", $head.$ret.$foot);
1738 return $head.$ret.$foot;
1749 $ilBench->start(
"ContentPresentation",
"showPagePreconditions");
1756 $this->tpl->setCurrentBlock(
"ContentStyle");
1759 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1764 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1766 $this->tpl->parseCurrentBlock();
1768 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
1771 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
1772 foreach($conds as $cond)
1776 $this->tpl->setCurrentBlock(
"condition");
1777 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
1779 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
1780 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
1781 if ($cond[
"operator"] ==
"passed")
1783 $cond_str = $this->lng->txt(
"passed");
1787 $cond_str = $cond[
"operator"];
1789 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
1790 $this->tpl->parseCurrentBlock();
1792 $this->tpl->setCurrentBlock(
"pg_content");
1794 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
1795 sprintf($this->lng->txt(
"cont_missing_preconditions"),
1797 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
1798 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
1801 $parent = $this->lm_tree->getParentId($topchap);
1802 $childs = $this->lm_tree->getChildsByType($parent,
"st");
1805 foreach($childs as $child)
1807 if ($child[
"child"] == $topchap)
1813 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
1816 if($succ_node !=
"")
1818 $framestr = (!empty(
$_GET[
"frame"]))
1819 ?
"frame=".
$_GET[
"frame"].
"&"
1822 $showViewInFrameset =
true;
1823 $link =
"<br /><a href=\"".
1824 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
1825 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
1826 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
1829 $this->tpl->parseCurrentBlock();
1831 $ilBench->stop(
"ContentPresentation",
"showPagePreconditions");
1842 $showViewInFrameset =
true;
1844 if ($a_layoutframes ==
"")
1846 $a_layoutframes = array();
1848 $link_info =
"<IntLinkInfos>";
1849 foreach ($a_int_links as $int_link)
1851 $target = $int_link[
"Target"];
1852 if (substr($target, 0, 4) ==
"il__")
1856 $type = $int_link[
"Type"];
1857 $targetframe = ($int_link[
"TargetFrame"] !=
"")
1858 ? $int_link[
"TargetFrame"]
1862 $anc = $anc_add =
"";
1863 if ($int_link[
"Anchor"] !=
"")
1865 $anc = $int_link[
"Anchor"];
1866 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
1872 case "StructureObject":
1874 if ($lm_id == $this->lm->getId() ||
1875 ($targetframe !=
"None" && $targetframe !=
"New"))
1877 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1881 $nframe = ($ltarget ==
"")
1886 if ($showViewInFrameset) {
1907 if (
$type ==
"PageObject")
1909 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
1913 $href =
"./goto.php?target=st_".$target_id;
1918 if (
$type ==
"PageObject")
1920 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.$anc_add.
"&client_id=".CLIENT_ID;
1924 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
1931 case "GlossaryItem":
1932 if ($targetframe ==
"None")
1934 $targetframe =
"Glossary";
1936 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1937 $nframe = ($ltarget ==
"")
1945 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1946 $nframe = ($ltarget ==
"")
1953 case "RepositoryItem":
1958 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
1962 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
1969 $anc_par =
'Anchor="'.$anc.
'"';
1971 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1972 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1983 $link_info.=
"</IntLinkInfos>";
1993 $link_info =
"<LinkTargets>";
1996 $link_info.=
"<LinkTarget TargetFrame=\"".$t[
"Type"].
"\" LinkTarget=\"".
$t[
"Frame"].
"\" OnClick=\"".
$t[
"OnClick"].
"\" />";
1998 $link_info.=
"</LinkTargets>";
2010 $ilBench->start(
"ContentPresentation",
"ilGlossary");
2012 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
2016 $this->tpl->setCurrentBlock(
"ContentStyle");
2019 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2024 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2026 $this->tpl->parseCurrentBlock();
2029 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2033 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2038 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2039 "syntaxhighlight.css");
2041 $this->tpl->parseCurrentBlock();
2043 $int_links = $term_gui->getInternalLinks();
2045 $term_gui->setLinkXML($link_xml);
2052 $ilBench->stop(
"ContentPresentation",
"ilGlossary");
2062 $ilBench->start(
"ContentPresentation",
"ilMedia");
2064 $this->tpl->setCurrentBlock(
"ContentStyle");
2067 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2072 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2074 $this->tpl->parseCurrentBlock();
2076 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2085 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2086 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2089 $this->tpl->setCurrentBlock(
"ilMedia");
2095 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2097 if (!empty (
$_GET[
"pg_id"]))
2099 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2106 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2127 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2128 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2143 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2148 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2149 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2150 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2151 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2152 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2157 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2159 $ilBench->stop(
"ContentPresentation",
"ilMedia");
2167 if ($a_inline !=
"")
2169 $js_tpl =
new ilTemplate($a_inline,
true,
false, $a_location);
2170 $js = $js_tpl->get();
2171 $this->tpl->setVariable(
"INLINE_JS", $js);
2183 $ilBench->start(
"ContentPresentation",
"ilLMNavigation");
2184 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2186 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2196 if(!$this->lm_tree->isInTree($page_id))
2202 $limpos = strpos(
$_GET[
"back_pg"],
":");
2205 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2209 $back_pg =
$_GET[
"back_pg"];
2211 if (!$this->lm->cleanFrames())
2214 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2221 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2223 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2227 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2228 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2229 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2230 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2231 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2232 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2233 $this->tpl->setVariable(
"PREV_ACC_KEY",
2235 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2236 ?
"images/spacer.gif"
2238 $this->tpl->parseCurrentBlock();
2239 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2240 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2241 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2242 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2243 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2244 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2245 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2246 ?
"images/spacer.gif"
2248 $this->tpl->parseCurrentBlock();
2253 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2257 if ($this->chapter_has_no_active_page &&
2260 $c_id =
$_GET[
"obj_id"];
2268 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2269 $c_id = $succ_node[
"obj_id"];
2272 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2274 if ($succ_node[
"obj_id"] > 0 &&
2276 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2281 else if ($succ_node[
"obj_id"] > 0 && !$active)
2290 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2292 $succ_str = ($succ_node !==
false)
2293 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2297 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2302 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2303 $c_id = $pre_node[
"obj_id"];
2305 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2306 if ($pre_node[
"obj_id"] > 0 &&
2308 ($this->lm->getPublicAccessMode() ==
"selected" &&
2313 else if ($pre_node[
"obj_id"] > 0 && !$active)
2323 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2325 $pre_str = ($pre_node !==
false)
2326 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2330 $framestr = (!empty(
$_GET[
"frame"]))
2331 ?
"frame=".
$_GET[
"frame"].
"&"
2338 $showViewInFrameset =
true;
2342 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2351 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2353 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2354 $this->lm_set->get(
"time_scheduled_page_activation"));
2359 if (!$this->lm->cleanFrames())
2362 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2365 else if ($showViewInFrameset && !$this->
offlineMode())
2368 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2369 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2374 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2375 $prev_target =
'target="_top" ';
2381 $output = $this->lng->txt(
"msg_page_not_public");
2384 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2386 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2387 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2388 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2389 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2390 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2391 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2392 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2393 ?
"images/spacer.gif"
2395 $this->tpl->setVariable(
"PREV_ACC_KEY",
2397 $this->tpl->parseCurrentBlock();
2398 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2399 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2400 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2401 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2402 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2403 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2404 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2405 ?
"images/spacer.gif"
2407 $this->tpl->parseCurrentBlock();
2408 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2410 if($succ_node !=
"")
2412 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2415 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2417 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2418 $this->lm_set->get(
"time_scheduled_page_activation"));
2422 if (!$this->lm->cleanFrames())
2425 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2428 else if ($showViewInFrameset && !$this->
offlineMode())
2431 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2432 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2437 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2438 $succ_target =
' target="_top" ';
2444 $output = $this->lng->txt(
"msg_page_not_public");
2447 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2449 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2450 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2451 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2452 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2453 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2454 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2455 $this->tpl->setVariable(
"SPACER_SUCC", $this->
offlineMode()
2456 ?
"images/spacer.gif"
2458 $this->tpl->setVariable(
"NEXT_ACC_KEY",
2460 $this->tpl->parseCurrentBlock();
2461 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2462 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2463 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2464 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2465 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2466 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2467 $this->tpl->setVariable(
"SPACER_SUCC2", $this->
offlineMode()
2468 ?
"images/spacer.gif"
2470 $this->tpl->parseCurrentBlock();
2471 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2474 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation");
2480 $child_nodes = $a_node->child_nodes();
2481 foreach ($child_nodes as $child)
2483 if($child->node_name() ==
"ilFrame")
2485 $attributes = $this->
attrib2arr($child->attributes());
2487 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2491 if(!empty($attributes[
"name"]))
2493 unset($attributes[
"template"]);
2494 unset($attributes[
"template_location"]);
2495 $attributes[
"src"] =
2496 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2498 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2499 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2500 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2505 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2507 $a_content .= $this->
buildTag(
"end",
"frameset");
2512 unset($attributes[
"template"]);
2513 unset($attributes[
"template_location"]);
2514 $attributes[
"src"] =
2515 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2517 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2518 if ($attributes[
"name"] ==
"toc")
2520 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2525 if (
$_GET[
"anchor"] !=
"")
2527 $attributes[
"src"].=
"#".rawurlencode(
$_GET[
"anchor"]);
2530 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2531 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2553 if (is_array($attr))
2555 while (list($k,$v) = each($attr))
2556 $tag.=
" ".$k.
"=\"$v\"";
2575 $ilBench->start(
"ContentPresentation",
"TableOfContents");
2578 $this->tpl->setCurrentBlock(
"ContentStyle");
2581 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2586 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2588 $this->tpl->parseCurrentBlock();
2590 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2599 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2600 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2604 $this->tpl->getStandardTemplate();
2607 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2610 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
"Modules/LearningModule");
2613 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2614 $this->tpl->setTitle($this->lm->getTitle());
2628 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2630 $this->
getLink($this->lm->getRefId(),
""),
2633 $exp->setTargetGet(
"obj_id");
2635 $exp->forceExpandAll(
true,
false);
2643 if ($this->chapter_has_no_active_page &&
2646 $exp->highlightNode(
$_GET[
"obj_id"]);
2650 $exp->highlightNode($page_id);
2654 $tree =& $this->lm->getTree();
2655 if (
$_GET[
"lmtocexpand"] ==
"")
2657 $expanded = $tree->readRootId();
2661 $expanded =
$_GET[
"lmtocexpand"];
2664 $exp->setExpand($expanded);
2668 $output = $exp->getOutput();
2670 $this->tpl->setVariable(
"EXPLORER", $output);
2671 $this->tpl->parseCurrentBlock();
2675 return $this->tpl->get();
2682 $ilBench->stop(
"ContentPresentation",
"TableOfContents");
2693 $this->ctrl->setCmd(
"showSummary");
2694 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2711 global
$ilBench, $ilLocator, $ilAccess;
2713 $this->tpl->setHeaderPageTitle(
"PAGETITLE",
" - ".$this->lm->getTitle());
2722 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2723 $this->tpl->setStyleSheetLocation(
"./".$style_name);
2726 $this->tpl->getStandardTemplate();
2727 $this->tpl->setTitle($this->lm->getTitle());
2730 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2734 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2740 $ilLocator->addRepositoryItems();
2741 $this->tpl->setLocator();
2744 $this->lng->loadLanguageModule(
"meta");
2746 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2749 $info->enablePrivateNotes();
2750 $info->enableLearningProgress();
2752 $info->enableNews();
2753 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2756 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
2758 $info->enableNewsEditing();
2760 if ($enable_internal_rss)
2762 $info->setBlockProperty(
"news",
"settings",
true);
2784 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
2788 $this->tpl->setContent($info->getHTML());
2789 return $this->tpl->get();
2794 $this->ctrl->forwardCommand($info);
2807 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2808 if (!$this->lm->isActivePrintView())
2813 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2815 $ilBench->start(
"ContentPresentation",
"PrintViewSelection");
2818 $this->tpl->setCurrentBlock(
"ContentStyle");
2821 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2826 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2828 $this->tpl->parseCurrentBlock();
2830 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2832 $this->tpl->getStandardTemplate();
2834 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2838 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
2839 "tpl.lm_print_selection.html",
"Modules/LearningModule");
2842 $this->tpl->setTitle($this->lm->getTitle());
2844 $this->tpl->setVariable(
"TXT_SHOW_PRINT", $this->lng->txt(
"cont_show_print_view"));
2845 $this->tpl->setVariable(
"TXT_PRINT_VIEW_SELECTION", $this->lng->txt(
"cont_print_selection"));
2847 $this->tpl->setVariable(
"TXT_CURRENT_PAGE", $this->lng->txt(
"cont_current_page"));
2848 $this->tpl->setVariable(
"TXT_CURRENT_CHAPTER", $this->lng->txt(
"cont_current_chapter"));
2849 $this->tpl->setVariable(
"TXT_SELECTION", $this->lng->txt(
"cont_selected_pg_chap"));
2856 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
2857 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
2859 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2861 if (!is_array(
$_POST[
"item"]))
2863 if (
$_GET[
"obj_id"] !=
"")
2873 foreach ($nodes as $node)
2878 $this->lm_set->get(
"time_scheduled_page_activation"));
2880 if ($node[
"type"] ==
"pg" &&
2887 for ($i=0; $i<$node[
"depth"]; $i++)
2889 $this->tpl->setCurrentBlock(
"indent");
2891 $this->tpl->parseCurrentBlock();
2895 $this->tpl->setCurrentBlock(
"lm_item");
2897 switch ($node[
"type"])
2901 $this->tpl->setVariable(
"TXT_TITLE",
2903 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2904 $this->lm_set->get(
"time_scheduled_page_activation")));
2907 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2911 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2912 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2916 $this->tpl->setVariable(
"IMG_ALT", $lng->txt(
"icon").
" ".$lng->txt(
"pg"));
2921 $this->tpl->setVariable(
"TXT_TITLE", $this->lm->getTitle());
2923 $this->tpl->setVariable(
"IMG_ALT", $lng->txt(
"icon").
" ".$lng->txt(
"obj_lm"));
2933 $this->tpl->setVariable(
"TXT_TITLE",
2935 $this->lm->isActiveNumbering()));
2937 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2941 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2942 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2946 $this->tpl->setVariable(
"IMG_ALT", $lng->txt(
"icon").
" ".$lng->txt(
"st"));
2952 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2955 $this->tpl->setVariable(
"ITEM_ID", $node[
"obj_id"]);
2957 if (
$_POST[
"item"][$node[
"obj_id"]] ==
"y")
2962 $this->tpl->parseCurrentBlock();
2966 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
2968 $this->tpl->setCurrentBlock(
"indent");
2970 $this->tpl->parseCurrentBlock();
2971 $this->tpl->setCurrentBlock(
"indent");
2973 $this->tpl->parseCurrentBlock();
2975 $this->tpl->setCurrentBlock(
"lm_item");
2976 $this->tpl->setVariable(
"TXT_TITLE",
2978 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2979 $this->lm_set->get(
"time_scheduled_page_activation")));
2982 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2986 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2987 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2991 $this->tpl->setVariable(
"ITEM_ID",
$_GET[
"obj_id"]);
2993 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
2995 $this->tpl->parseCurrentBlock();
3001 $ilBench->stop(
"ContentPresentation",
"PrintViewSelection");
3011 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
3013 if (!$this->lm->isActivePrintView())
3018 $ilBench->start(
"ContentPresentation",
"PrintView");
3020 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
3024 if (
$_POST[
"sel_type"] ==
"page")
3026 $_POST[
"item"] = array($c_obj_id =>
"y");
3028 if (
$_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
3031 $path = $this->lm_tree->getPathFull($c_obj_id);
3032 $chap_id = $path[1][
"child"];
3035 $_POST[
"item"] = array($chap_id =>
"y");
3048 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
3049 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
3053 $this->tpl->setCurrentBlock(
"ContentStyle");
3056 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3061 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3063 $this->tpl->parseCurrentBlock();
3066 $this->tpl->setCurrentBlock(
"SyntaxStyle");
3067 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
3069 $this->tpl->parseCurrentBlock();
3072 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
3075 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
3077 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3079 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
3080 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3081 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3086 $glossary_links = array();
3087 $output_header =
false;
3088 $media_links = array();
3091 if ($this->lm->getFooterPage() > 0)
3096 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getFooterPage());
3097 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3099 $this->lm->getStyleSheetId(),
"lm"));
3103 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3104 $page_object_gui->setOutputMode(
"print");
3105 $page_object_gui->setPresentationTitle(
"");
3106 $page_object_gui->setFileDownloadLink(
"#");
3107 $page_object_gui->setFullscreenLink(
"#");
3108 $page_object_gui->setSourceCodeDownloadScript(
"#");
3109 $footer_page_content = $page_object_gui->showPage();
3112 if ($this->lm->getHeaderPage() > 0)
3117 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getHeaderPage());
3118 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3120 $this->lm->getStyleSheetId(),
"lm"));
3124 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3125 $page_object_gui->setOutputMode(
"print");
3126 $page_object_gui->setPresentationTitle(
"");
3127 $page_object_gui->setFileDownloadLink(
"#");
3128 $page_object_gui->setFullscreenLink(
"#");
3129 $page_object_gui->setSourceCodeDownloadScript(
"#");
3130 $header_page_content = $page_object_gui->showPage();
3135 if (is_array(
$_POST[
"item"]))
3137 foreach(
$_POST[
"item"] as $k => $item)
3139 if ($item ==
"y" && $k > 0 && !$this->lm_tree->isInTree($k))
3143 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
3151 $ilCtrl->redirect($this,
"showPrintViewSelection");
3154 foreach ($nodes as $node_key => $node)
3158 $this->lm_set->get(
"time_scheduled_page_activation"));
3159 if ($node[
"type"] ==
"pg" && !$active)
3166 if ($node[
"depth"] <= $act_level)
3168 if (
$_POST[
"item"][$node[
"obj_id"]] ==
"y")
3170 $act_level = $node[
"depth"];
3184 if ($node[
"type"] ==
"du")
3186 $output_header =
true;
3190 if ($node[
"type"] ==
"st")
3193 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3202 $this->tpl->setCurrentBlock(
"print_chapter");
3204 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3205 $this->lm->isActiveNumbering());
3206 $this->tpl->setVariable(
"CHAP_TITLE",
3211 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3213 $this->tpl->setVariable(
"CHAP_HEADER",
3214 $header_page_content);
3215 $did_chap_page_header =
true;
3219 $this->tpl->parseCurrentBlock();
3220 $this->tpl->setCurrentBlock(
"print_block");
3221 $this->tpl->parseCurrentBlock();
3225 if ($node[
"type"] ==
"pg")
3228 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3236 $this->tpl->setCurrentBlock(
"print_item");
3239 $page_id = $node[
"obj_id"];
3240 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
3241 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
3242 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3244 $this->lm->getStyleSheetId(),
"lm"));
3249 $lm_pg_obj->setLMId($this->lm->getId());
3252 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3253 $page_object_gui->setOutputMode(
"print");
3254 $page_object_gui->setPresentationTitle(
"");
3256 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3259 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3260 $this->lm_set->get(
"time_scheduled_page_activation"));
3264 if ($this->lm->isActiveNumbering())
3266 $chapter_title = trim(substr($chapter_title,
3267 strpos($chapter_title,
" ")));
3270 if ($page_title != $chapter_title)
3272 $page_object_gui->setPresentationTitle($page_title);
3277 $hcont = $header_page_content;
3278 $fcont = $footer_page_content;
3282 if ($did_chap_page_header)
3286 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3287 !($nodes[$node_key + 1][
"depth"] <= $act_level
3288 &&
$_POST[
"item"][$nodes[$node_key + 1][
"obj_id"]] !=
"y"))
3294 $page_object_gui->setFileDownloadLink(
"#");
3295 $page_object_gui->setFullscreenLink(
"#");
3296 $page_object_gui->setSourceCodeDownloadScript(
"#");
3297 $page_content = $page_object_gui->showPage();
3300 $this->tpl->setVariable(
"CONTENT",
3301 $hcont.$page_content.$fcont);
3305 $this->tpl->setVariable(
"CONTENT",
3306 $hcont.$page_content.$fcont.
"<br />");
3308 $chapter_title =
"";
3309 $this->tpl->parseCurrentBlock();
3310 $this->tpl->setCurrentBlock(
"print_block");
3311 $this->tpl->parseCurrentBlock();
3318 foreach ($int_links as
$key => $link)
3320 if ($link[
"type"] ==
"git" &&
3321 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3323 $glossary_links[
$key] = $link;
3325 if ($link[
"type"] ==
"mob" &&
3326 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3329 $mob_links[
$key] = $link;
3340 $page_object->buildDom();
3341 $links = $page_object->getInternalLinks();
3342 foreach($links as $link)
3344 if ($link[
"Type"] ==
"MediaObject"
3345 && $link[
"TargetFrame"] !=
""
3346 && $link[
"TargetFrame"] !=
"None")
3348 $media_links[] = $link;
3360 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3362 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3363 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3368 foreach($glossary_links as
$key => $link)
3371 $terms[$term.
":".
$key] = array(
"key" =>
$key,
"link" => $link,
"term" => $term);
3376 foreach($terms as
$t)
3384 foreach($defs as $def)
3387 if (count($defs) > 1)
3389 $this->tpl->setCurrentBlock(
"def_title");
3390 $this->tpl->setVariable(
"TXT_DEFINITION",
3391 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3392 $this->tpl->parseCurrentBlock();
3396 $page_gui->setTemplateOutput(
false);
3397 $page_gui->setOutputMode(
"print");
3399 $this->tpl->setCurrentBlock(
"definition");
3400 $page_gui->setFileDownloadLink(
"#");
3401 $page_gui->setFullscreenLink(
"#");
3402 $page_gui->setSourceCodeDownloadScript(
"#");
3403 $output = $page_gui->showPage();
3404 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3405 $this->tpl->parseCurrentBlock();
3409 $this->tpl->setCurrentBlock(
"term");
3410 $this->tpl->setVariable(
"VAL_TERM",
3412 $this->tpl->parseCurrentBlock();
3417 $this->tpl->setCurrentBlock(
"glossary");
3418 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3419 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3420 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3421 $this->tpl->parseCurrentBlock();
3423 $annexes[] = $annex_title;
3427 if (count($media_links) > 0)
3429 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3430 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3432 foreach($media_links as $media)
3434 if (substr($media[
"Target"],0,4) ==
"il__")
3436 $arr = explode(
"_",$media[
"Target"]);
3437 $id = $arr[count($arr) - 1];
3440 $med_item =& $med_obj->getMediaItem(
"Standard");
3441 if (is_object($med_item))
3443 if (is_int(strpos($med_item->getFormat(),
"image")))
3445 $this->tpl->setCurrentBlock(
"ref_image");
3448 if ($med_item->getLocationType() ==
"LocalFile")
3450 $this->tpl->setVariable(
"IMG_SOURCE",
3452 "/".$med_item->getLocation());
3456 $this->tpl->setVariable(
"IMG_SOURCE",
3457 $med_item->getLocation());
3460 if ($med_item->getCaption() !=
"")
3462 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3466 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3468 $this->tpl->parseCurrentBlock();
3476 $this->tpl->setCurrentBlock(
"ref_images");
3477 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3478 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3479 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3480 $this->tpl->parseCurrentBlock();
3482 $annexes[] = $annex_title;
3488 $this->tpl->setCurrentBlock(
"print_header");
3489 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3490 if ($this->lm->getDescription() !=
"none")
3492 include_once(
"Services/MetaData/classes/class.ilMD.php");
3493 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3495 foreach($md_gen->getDescriptionIds() as $id)
3497 $md_des = $md_gen->getDescription($id);
3498 $description = $md_des->getDescription();
3501 $this->tpl->setVariable(
"LM_DESCRIPTION",
3504 $this->tpl->parseCurrentBlock();
3508 foreach ($nodes2 as $node2)
3510 if ($node2[
"type"] ==
"st"
3513 for ($j=1; $j < $node2[
"depth"]; $j++)
3515 $this->tpl->setCurrentBlock(
"indent");
3517 $this->tpl->parseCurrentBlock();
3519 $this->tpl->setCurrentBlock(
"toc_entry");
3520 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3522 $this->lm->isActiveNumbering()));
3523 $this->tpl->parseCurrentBlock();
3528 foreach ($annexes as $annex)
3530 $this->tpl->setCurrentBlock(
"indent");
3532 $this->tpl->parseCurrentBlock();
3533 $this->tpl->setCurrentBlock(
"toc_entry");
3534 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3535 $this->tpl->parseCurrentBlock();
3538 $this->tpl->setCurrentBlock(
"toc");
3539 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3540 $this->tpl->parseCurrentBlock();
3542 $this->tpl->setCurrentBlock(
"print_start_block");
3543 $this->tpl->parseCurrentBlock();
3547 include_once
'Services/MetaData/classes/class.ilMD.php';
3548 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3549 if(is_object($lifecycle = $md->getLifecycle()))
3551 $sep = $author =
"";
3552 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3554 $md_con = $lifecycle->getContribute($con_id);
3555 if ($md_con->getRole() ==
"Author")
3557 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3559 $md_ent = $md_con->getEntity($ent_id);
3560 $author = $author.$sep.$md_ent->getEntity();
3567 $this->lng->loadLanguageModule(
"meta");
3568 $this->tpl->setCurrentBlock(
"author");
3569 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3570 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3571 $this->tpl->parseCurrentBlock();
3577 if (is_object($md_rights = $md->getRights()))
3579 $copyright = $md_rights->getDescription();
3580 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3583 if ($copyright !=
"")
3585 $this->lng->loadLanguageModule(
"meta");
3586 $this->tpl->setCurrentBlock(
"copyright");
3587 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3588 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3589 $this->tpl->parseCurrentBlock();
3593 $this->tpl->show(
false);
3595 $ilBench->stop(
"ContentPresentation",
"PrintView");
3601 if(
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")
3603 if(
$_POST[
"action"] ==
"show_citation")
3606 if(count(
$_POST[
"target"]) != 1)
3610 $_POST[
"target"] = 0;
3619 if(isset(
$_POST[
"tr_id"]))
3627 if(is_array(
$_POST[
"target"]))
3645 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3647 $fileObj->sendFile();
3656 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3669 $this->tpl->setCurrentBlock(
"ContentStyle");
3672 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3677 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3679 $this->tpl->parseCurrentBlock();
3681 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
3683 $this->tpl->getStandardTemplate();
3685 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3690 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
3693 $this->tpl->setTitle($this->lm->getTitle());
3703 include_once
'Services/MetaData/classes/class.ilMD.php';
3704 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3705 if (is_object($md_rights = $md->getRights()))
3707 $copyright = $md_rights->getDescription();
3708 if ($copyright !=
"")
3710 $this->lng->loadLanguageModule(
"meta");
3711 $this->tpl->setCurrentBlock(
"copyright");
3712 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3713 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3714 $this->tpl->parseCurrentBlock();
3719 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
3723 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
3726 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
3728 $export_files = array();
3729 $types = array(
"xml",
"html");
3730 foreach($types as
$type)
3732 if ($this->lm->getPublicExportFile($type) !=
"")
3734 if (is_file($this->lm->getExportDirectory($type).
"/".
3735 $this->lm->getPublicExportFile($type)))
3737 $dir = $this->lm->getExportDirectory($type);
3738 $size = filesize($this->lm->getExportDirectory($type).
"/".
3739 $this->lm->getPublicExportFile($type));
3740 $export_files[] = array(
"type" => $type,
3741 "file" => $this->lm->getPublicExportFile($type),
3749 $tbl->setTitle($this->lng->txt(
"download"));
3751 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
3752 $this->lng->txt(
"cont_file"),
3753 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
3756 $cols = array(
"format",
"file",
"size",
"date",
"download");
3757 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
3758 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
3759 $tbl->setHeaderVars($cols, $header_params);
3760 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
3761 $tbl->disable(
"sort");
3764 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3765 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3766 $tbl->setLimit(
$_GET[
"limit"]);
3767 $tbl->setOffset(
$_GET[
"offset"]);
3768 $tbl->setMaxCount($this->maxcount);
3774 $tbl->disable(
"footer");
3776 $tbl->setMaxCount(count($export_files));
3777 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3780 if(count($export_files) > 0)
3783 foreach($export_files as $exp_file)
3785 if (!$exp_file[
"size"] > 0)
3790 $this->tpl->setCurrentBlock(
"tbl_content");
3791 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
3794 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3796 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
3797 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
3798 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
3800 $file_arr = explode(
"__", $exp_file[
"file"]);
3801 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
3803 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
3804 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
3805 $this->tpl->setVariable(
"LINK_DOWNLOAD",
3806 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
3808 $this->tpl->parseCurrentBlock();
3813 $this->tpl->setCurrentBlock(
"notfound");
3814 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3815 $this->tpl->setVariable(
"NUM_COLS", 5);
3816 $this->tpl->parseCurrentBlock();
3828 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
3829 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
3831 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
3838 $this->ilias->raiseError($this->lng->txt(
"file_not_found"),$this->ilias->error_obj->MESSAGE);
3844 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
3845 $a_back_link =
"append", $a_anchor =
"")
3856 $back_pg =
$_GET[
"back_pg"];
3857 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
3858 $a_back_link ==
"append")
3862 $back_pg = $cur_page_id.
":".$back_pg;
3866 $back_pg = $cur_page_id;
3871 if ($a_back_link ==
"reduce")
3873 $limpos = strpos(
$_GET[
"back_pg"],
":");
3877 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
3884 else if ($a_back_link !=
"keep")
3893 if ($a_anchor !=
"")
3895 $this->ctrl->setParameter($this,
"anchor", rawurlencode($a_anchor));
3900 $link = $this->ctrl->getLinkTarget($this,
"fullscreen");
3907 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
3911 $this->ctrl->setParameter($this,
"frame", $a_frame);
3913 if ($a_obj_id !=
"")
3918 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
3922 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
3923 $link.=
"&obj_id=".$a_obj_id;
3929 $this->ctrl->setParameter($this,
"obj_type", $a_type);
3931 $link = $this->ctrl->getLinkTarget($this, $a_cmd, $a_anchor);
3932 $link = str_replace(
"&",
"&", $link);
3934 $this->ctrl->setParameter($this,
"frame",
"");
3935 $this->ctrl->setParameter($this,
"obj_id",
"");
3936 $this->ctrl->setParameter($this,
"mob_id",
"");
3944 case "downloadFile":
3948 $link =
"fullscreen.html";
3953 if ($a_obj_id ==
"")
3955 $a_obj_id = $this->lm_tree->getRootId();
3956 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3957 $a_obj_id = $pg_node[
"obj_id"];
3959 if ($a_type ==
"StructureObject")
3961 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3962 $a_obj_id = $pg_node[
"obj_id"];
3964 if ($a_frame !=
"" && $a_frame !=
"_blank")
3966 if ($a_frame !=
"toc")
3968 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
3972 $link =
"frame_".$a_frame.
".html";
3979 $link =
"lm_pg_".$nid.
".html";
3983 $link =
"lm_pg_".$a_obj_id.
".html";
3989 $link =
"term_".$a_obj_id.
".html";
3993 $link =
"media_".$a_obj_id.
".html";
4001 $this->ctrl->clearParameters($this);
4013 $this->tpl->setCurrentBlock(
"ContentStyle");
4017 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
4022 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
4025 $this->tpl->parseCurrentBlock();
4026 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
4027 $this->tpl->setCurrentBlock(
"pg_content");
4028 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
4029 $this->tpl->parseCurrentBlock();
4036 $target = $this->ctrl->getLinkTarget($this,
"");
4038 return $this->ctrl->getLinkTarget($this,
"");
4054 $this->offline_directory = $offdir;
4076 if (!($fp = @fopen(
$file,
"w+")))
4078 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
4079 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");