24 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
25 require_once(
"./classes/class.ilMainMenuGUI.php");
26 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
57 $lng->loadLanguageModule(
"content");
62 $this->offline =
false;
63 $this->frames = array();
65 $this->ctrl->saveParameter($this, array(
"ref_id"));
67 # include_once './classes/class.ilSearch.php';
69 # if(!ilSearch::_checkParentConditions($_GET['ref_id']))
71 # $ilias->error_obj->raiseError($lng->txt('access_denied'),$ilias->error_obj->WARNING);
74 $type = $this->ilias->obj_factory->getTypeByRefId(
$_GET[
"ref_id"]);
80 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
85 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
91 $this->lm =& $this->lm_gui->object;
93 include_once
'payment/classes/class.ilPaymentObject.php';
97 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
99 if (!$this->lm->getOnline())
101 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
105 $this->lm_tree =
new ilTree($this->lm->getId());
107 $this->lm_tree->setTreeTablePK(
"lm_id");
112 $this->
abstract =
true;
114 if((count($_POST[
"tr_id"]) > 1) or
115 (!$_POST[
"target"] and ($_POST[
"action"] ==
"show" or $_POST[
"action"] ==
"show_citation")))
117 $this->
abstract =
true;
119 else if(
$_GET[
"obj_id"] or ($_POST[
"action"] ==
"show") or ($_POST[
"action"] ==
"show_citation"))
121 $this->
abstract =
false;
133 global $ilNavigationHistory, $ilAccess,
$ilias,
$lng;
135 include_once
'payment/classes/class.ilPaymentObject.php';
136 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
139 if(!((
int)
$_GET[
'obj_id'] &&
141 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
144 unset(
$_GET[
'obj_id']);
146 $this->tpl->getStandardTemplate();
149 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
151 $ret = $this->ctrl->forwardCommand($pp);
159 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
160 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
161 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
163 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
166 $next_class = $this->ctrl->getNextClass($this);
167 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
169 $cmd = (isset($_POST[
'cmd'][
'citation']))
176 $obj_id =
$_GET[
"obj_id"];
177 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
178 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
179 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
187 case "ilinfoscreengui":
203 $this->offline = $a_offline;
222 $this->export_format = $a_format;
232 return $this->export_format;
254 $q =
"DELETE FROM lo_access ".
255 "WHERE usr_id = ".$ilDB->quote($usr_id).
" ".
256 "AND lm_id = ".$ilDB->quote($lm_id);
257 $this->ilias->db->query($q);
258 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
261 $q =
"INSERT INTO lo_access ".
262 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
264 "(now(),".$ilDB->quote($usr_id).
",".$ilDB->quote($lm_id).
",".
265 $ilDB->quote($obj_id).
",".$ilDB->quote(
$title).
")";
266 $this->ilias->db->query($q);
279 switch($this->lm->getType())
282 $this->lm_gui->export();
298 if ($_POST[
"cmd"][
"cancel"] !=
"")
300 $this->ctrl->setParameter($this,
"frame",
"maincontent");
301 $this->ctrl->redirect($this,
"layout");
304 switch($this->lm->getType())
308 $_GET[
"frame"] =
"maincontent";
310 $query =
"SELECT * FROM object_reference,object_data WHERE object_reference.ref_id=".
311 $ilDB->quote(
$_GET[
"ref_id"]).
" AND object_reference.obj_id=object_data.obj_id ";
312 $result = $this->ilias->db->query($query);
314 $_GET[
"obj_id"] = $objRow[
"obj_id"];
316 $query =
"SELECT * FROM lm_data WHERE lm_id = ".$ilDB->quote($objRow[
"obj_id"]).
318 $result = $this->ilias->db->query($query);
327 if ($_POST[
"pages"]==
"all" || ($_POST[
"pages"]==
"fromto" && $page>=$_POST[
"pagefrom"] && $page<=$_POST[
"pageto"] ))
332 if($_POST[
"type"] ==
"pdf") $output .=
"<hr BREAK >\n";
333 if($_POST[
"type"] ==
"print") $output .=
"<p style=\"page-break-after:always\" />";
334 if($_POST[
"type"] ==
"html") $output .=
"<br><br><br><br>";
338 $_GET[
"obj_id"] = $row[
"obj_id"];
339 $o = $this->
layout(
"main.xml",
false);
341 $output .=
"<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_PageTitle\">".$this->lm->title.
"</div><p>";
344 $output .=
"\n<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td valign=top align=center>- ".$page.
" -</td></tr></table>\n";
349 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
351 if($_POST[
"type"] ==
"print")
353 $printTpl->touchBlock(
"printreq");
359 $css1 =
"./css/delos.css";
360 $css2 =
"./css/content.css";
362 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
364 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
365 $printTpl->setVariable(
"CONTENT",$output);
368 $printTpl->setCurrentBlock(
"SyntaxStyle");
369 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
371 $printTpl->parseCurrentBlock();
374 $html = $printTpl->get();
379 $this->lm->createExportDirectory();
380 $export_dir = $this->lm->getExportDirectory();
385 $fileName =
"offline";
386 $fileName = str_replace(
" ",
"_",$fileName);
388 if (!file_exists($export_dir.
"/".$fileName))
390 @mkdir($export_dir.
"/".$fileName);
391 @chmod($export_dir.
"/".$fileName, 0755);
393 @mkdir($export_dir.
"/".$fileName.
"/css");
394 @chmod($export_dir.
"/".$fileName.
"/css", 0755);
398 if($_POST[
"type"] ==
"xml")
401 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_GET[
"ref_id"]);
403 if ($tmp_obj->getType() ==
"dbk" )
405 require_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
411 else if($_POST[
"type"] ==
"print")
415 else if ($_POST[
"type"]==
"html")
423 $css1 = file(
"./templates/default/delos.css");
424 $css1 = implode($css1,
"");
426 $fp = fopen($export_dir.
"/".$fileName.
"/css/delos.css",
"wb");
430 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".html",
"wb");
434 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
439 else if ($_POST[
"type"]==
"pdf")
463 switch($this->lm->getType())
466 $this->lm_gui->offlineexportform();
484 $query =
"SELECT * FROM object_reference,object_data WHERE object_reference.ref_id= ".
485 $ilDB->quote(
$_GET[
"ref_id"]).
" AND object_reference.obj_id=object_data.obj_id ";
486 $result = $this->ilias->db->query($query);
490 $filename = preg_replace(
'/[^a-z0-9_]/i',
'_', $objRow[
"title"]);
492 $C = $this->lm_gui->showAbstract(array(1));
494 if (
$_GET[
"print"]==1)
496 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
497 $printTpl->touchBlock(
"printreq");
500 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
502 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
505 $printTpl->setCurrentBlock(
"SyntaxStyle");
506 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
508 $printTpl->parseCurrentBlock();
510 $printTpl->setVariable(
"CONTENT",$C);
512 echo $printTpl->get();
529 if(!is_array($a_attributes))
533 foreach ($a_attributes as $attribute)
535 $attr[$attribute->name()] = $attribute->value();
545 return $this->frames;
551 function layout($a_xml =
"main.xml", $doShow =
true)
555 $ilBench->start(
"ContentPresentation",
"layout");
564 $layout = $this->lm->getLayout();
569 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
571 if (!$doc =
domxml_open_mem($xmlfile)) { echo
"ilLMPresentation: XML File invalid";
exit; }
572 $this->layout_doc =& $doc;
576 $ilBench->start(
"ContentPresentation",
"layout_getFrameNode");
578 $path = (empty(
$_GET[
"frame"]) || (
$_GET[
"frame"] ==
"_blank"))
579 ?
"/ilLayout/ilFrame[1]"
580 :
"//ilFrame[@name='".$_GET[
"frame"].
"']";
583 if (count($found) != 1) { echo
"ilLMPresentation: XML File invalid";
exit; }
586 $ilBench->stop(
"ContentPresentation",
"layout_getFrameNode");
590 $attributes = $this->
attrib2arr($node->attributes());
591 $this->frames = array();
592 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
594 $ilBench->start(
"ContentPresentation",
"layout_processFrameset");
595 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
599 $content .= $this->
buildTag(
"end",
"frameset");
600 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
601 $this->tpl->setVariable(
"PAGETITLE",
"- ".$this->lm->getTitle());
602 $this->tpl->setVariable(
"FS_CONTENT", $content);
603 $ilBench->stop(
"ContentPresentation",
"layout_processFrameset");
606 $content = $this->tpl->get();
612 $ilBench->start(
"ContentPresentation",
"layout_processContentTag");
614 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
615 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
622 if(empty(
$_GET[
"obj_type"]))
624 $obj_type =
"PageObject";
628 $obj_type =
$_GET[
"obj_type"];
632 $childs = $node->child_nodes();
634 foreach($childs as $child)
636 if ($child->node_name() == $obj_type)
639 $attributes = $this->
attrib2arr($child->attributes());
645 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
646 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
650 $in_module = ($attributes[
"template_location"] ==
"module")
655 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
669 $style_name = $this->ilias->account->prefs[
"style"].
".css";
670 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
673 $childs = $node->child_nodes();
675 $ilBench->start(
"ContentPresentation",
"layout_processContentNodes");
676 foreach($childs as $child)
679 $child_attr = $this->
attrib2arr($child->attributes());
681 switch ($child->node_name())
684 $ilBench->start(
"ContentPresentation",
"layout_mainmenu");
686 $ilBench->stop(
"ContentPresentation",
"layout_mainmenu");
690 $this->
ilTOC($child_attr[
"target_frame"]);
694 switch($this->lm->getType())
700 $content = $this->
ilPage($child);
707 $content = $this->lm_gui->showAbstract($_POST[
"target"]);
712 $content = $this->
ilPage($child);
727 case "ilLMNavigation":
730 if(
$_GET[
"obj_id"] or
731 ((count($_POST[
"tr_id"]) < 2) and $_POST[
"target"] and
732 ($_POST[
"action"] ==
"show" or $_POST[
"action"] ==
"show_citation")) or
733 $this->lm->getType() ==
'lm')
735 $ilBench->start(
"ContentPresentation",
"layout_lmnavigation");
737 $ilBench->stop(
"ContentPresentation",
"layout_lmnavigation");
746 $ilBench->start(
"ContentPresentation",
"layout_locator");
748 $ilBench->stop(
"ContentPresentation",
"layout_locator");
752 $ilBench->start(
"ContentPresentation",
"layout_lmmenu");
754 $ilBench->stop(
"ContentPresentation",
"layout_lmmenu");
762 $ilBench->start(
"ContentPresentation",
"layout_lmsubmenu");
764 $ilBench->stop(
"ContentPresentation",
"layout_lmsubmenu");
768 if (!$this->ilias->getSetting(
'disable_notes'))
770 $ilBench->start(
"ContentPresentation",
"layout_lmnotes");
772 $ilBench->stop(
"ContentPresentation",
"layout_lmnotes");
777 $ilBench->stop(
"ContentPresentation",
"layout_processContentNodes");
779 $ilBench->stop(
"ContentPresentation",
"layout_processContentTag");
783 if (strcmp(
$_GET[
"frame"],
"topright") == 0) $this->tpl->fillJavaScriptFiles();
784 if (strcmp(
$_GET[
"frame"],
"right") == 0) $this->tpl->fillJavaScriptFiles();
785 if (strcmp(
$_GET[
"frame"],
"botright") == 0) $this->tpl->fillJavaScriptFiles();
787 $content = $this->tpl->get();
795 $this->tpl->fillTabs();
796 $content = $this->tpl->get();
797 $content = str_replace(
"{",
"{", $content);
798 $content = str_replace(
"}",
"}", $content);
800 header(
'Content-type: text/html; charset=UTF-8');
804 $ilBench->stop(
"ContentPresentation",
"layout");
816 if (
$_GET[
"frame"] !=
"_blank")
828 if (
$_GET[
"frame"] !=
"_blank")
834 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
835 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
844 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
845 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
855 return $this->tpl->get();
872 $ilBench->start(
"ContentPresentation",
"ilMainMenu");
874 if ($this->lm->getLayout() ==
"2window" ||
875 $this->lm->getLayout() ==
"3window")
877 $ilMainMenu->setSmallMode(
true);
881 $ilMainMenu->setSmallMode(
false);
884 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
885 $this->tpl->addJavascript(
"./Services/Javascript/js/Basic.js");
886 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
887 $this->tpl->fillJavaScriptFiles();
893 $ilBench->stop(
"ContentPresentation",
"ilMainMenu");
903 $ilBench->start(
"ContentPresentation",
"ilTOC");
904 require_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorer.php");
905 if ($this->lm->cleanFrames())
910 $exp->setExpandTarget($this->
getLink($this->lm->getRefId(),
$_GET[
"cmd"],
$_GET[
"obj_id"], $_GET[
"frame"]));
911 $exp->setTargetGet(
"obj_id");
912 if ($this->lm->cleanFrames())
916 $exp->setFrameTarget(
"_top");
925 $exp->setFrameTarget($a_target);
927 $exp->addFilter(
"du");
928 $exp->addFilter(
"st");
931 if ($this->lm->cleanFrames())
936 $path = $this->lm_tree->getPathId($page_id);
937 $exp->setForceOpenPath($path);
942 if ($this->chapter_has_no_active_page &&
945 $exp->highlightNode($_GET[
"obj_id"]);
949 $exp->highlightNode($page_id);
955 if ($this->lm->getTOCMode() ==
"pages")
957 $exp->addFilter(
"pg");
959 $exp->setFiltered(
true);
962 if ($_GET[
"lmexpand"] ==
"")
964 $expanded = $this->lm_tree->readRootId();
968 $expanded = $_GET[
"lmexpand"];
970 $exp->setExpand($expanded);
974 $output = $exp->getOutput();
976 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
985 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
986 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
991 $this->tpl->addBlockFile(
"EXPL_TOP",
"exp_top",
"tpl.explorer_top.html");
995 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_toc"));
996 $this->tpl->setVariable(
"EXPLORER",$output);
997 $this->tpl->setVariable(
"ACTION",
998 $this->
getLink($this->lm->getRefId(), $_GET[
"cmd"],
"", $_GET[
"frame"]).
999 "&lmexpand=".$_GET[
"lmexpand"]);
1000 $this->tpl->parseCurrentBlock();
1001 $ilBench->stop(
"ContentPresentation",
"ilTOC");
1009 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
1018 $this->tpl->setCurrentBlock(
"header_image");
1021 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.gif");
1027 $this->tpl->parseCurrentBlock();
1028 $this->tpl->setCurrentBlock(
"lm_head");
1029 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
1030 $this->tpl->parseCurrentBlock();
1041 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1047 $showViewInFrameset =
true;
1049 if ($showViewInFrameset)
1055 $buttonTarget =
"_top";
1059 include_once(
"./classes/class.ilTemplate.php");
1060 $tpl_menu =&
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
1071 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1073 $tpl_menu->setCurrentBlock(
"edit_page");
1075 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
1076 "&obj_id=".$page_id.
"&to_page=1");
1077 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
1078 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
1079 $tpl_menu->parseCurrentBlock();
1082 $tpl_menu->setCurrentBlock(
"perma_link");
1084 $tpl_menu->setVariable(
"PERMA_LINK", ILIAS_HTTP_PATH.
1085 "/goto.php?target=pg_".$page_id.
"_".$this->lm->getRefId().
"&client_id=".CLIENT_ID);
1086 $tpl_menu->setVariable(
"TXT_PERMA_LINK", $this->lng->txt(
"perma_link"));
1087 $tpl_menu->setVariable(
"PERMA_TARGET",
"_top");
1088 $tpl_menu->parseCurrentBlock();
1092 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1104 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1117 $next_class = $this->ctrl->getNextClass($this);
1119 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1127 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1132 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1133 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1135 $notes_gui->enablePrivateNotes();
1136 if ($this->lm->publicNotes())
1138 $notes_gui->enablePublicNotes();
1141 if ($next_class ==
"ilnotegui")
1143 $html = $this->ctrl->forwardCommand($notes_gui);
1147 $html = $notes_gui->getNotesHTML();
1149 $this->tpl->setVariable(
"NOTES", $html);
1158 global $ilLocator, $tree;
1160 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1162 if (empty(
$_GET[
"obj_id"]))
1164 $a_id = $this->lm_tree->getRootId();
1168 $a_id =
$_GET[
"obj_id"];
1171 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1173 if (!$this->lm->cleanFrames())
1175 $frame_param =
$_GET[
"frame"];
1186 $frame_target =
"_top";
1191 $ilLocator->addItem(
"...",
"");
1193 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1194 $ilLocator->addItem(
1196 "repository.php?cmd=frameset&ref_id=".$par_id,
1201 $ilLocator->setOffline(
true);
1204 if($this->lm_tree->isInTree($a_id))
1206 $path = $this->lm_tree->getPathFull($a_id);
1208 foreach ($path as $key => $row)
1210 if ($row[
"type"] !=
"pg")
1212 if($row[
"child"] != $this->lm_tree->getRootId())
1214 $ilLocator->addItem(
1217 $this->lm->isActiveNumbering()),50,
true),
1218 $this->
getLink(
$_GET[
"ref_id"],
"layout", $row[
"child"], $frame_param,
"StructureObject"),
1223 $ilLocator->addItem(
1225 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1226 $frame_target,
$_GET[
"ref_id"]);
1234 $ilLocator->addItem(
1235 $this->lm->getTitle(),
1238 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1241 $ilLocator->addItem(
1242 $lm_obj->getTitle(),
1243 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1249 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1255 $this->tpl->setLocator();
1262 $this->chapter_has_no_active_page =
false;
1263 $this->deactivated_page =
false;
1266 if(empty(
$_GET[
"obj_id"]))
1268 $obj_id = $this->lm_tree->getRootId();
1272 $obj_id =
$_GET[
"obj_id"];
1276 $this->deactivated_page =
true;
1281 if (!$this->lm_tree->isInTree($obj_id))
1286 $curr_node = $this->lm_tree->getNodeData($obj_id);
1288 if ($curr_node[
"type"] ==
"pg" &&
1291 $page_id = $curr_node[
"obj_id"];
1298 while($succ_node && !$active)
1300 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1301 $page_id = $succ_node[
"obj_id"];
1305 if ($succ_node[
"type"] !=
"pg")
1307 $this->chapter_has_no_active_page =
true;
1309 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1310 $this->ilias->raiseError($this->lng->txt(
"cont_no_page"),$this->ilias->error_obj->FATAL);
1317 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1321 while ($public ===
false && $page_id > 0)
1323 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1324 $page_id = $succ_node[
'obj_id'];
1330 if ($this->lm_tree->isInTree($page_id))
1332 $path = $this->lm_tree->getPathId($page_id);
1333 if (!in_array(
$_GET[
"obj_id"], $path))
1335 $this->chapter_has_no_active_page =
true;
1345 $subtree = $this->lm_tree->getSubTree($this->lm_tree->getNodeData(1));
1346 $node = $this->lm_tree->getNodeData($current_page_id);
1347 $pos = array_search($node,$subtree);
1349 $this->tr_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_SESSION[
"tr_id"]);
1351 $lmtree =
new ilTree($this->tr_obj->getId());
1353 $lmtree->setTreeTablePK(
"lm_id");
1355 $subtree = $lmtree->getSubTree($lmtree->getNodeData(1));
1357 return $subtree[$pos][
"child"];
1364 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1365 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1371 $this->tpl->setVariable(
"TRANSLATION_CONTENT",
"NO TRNSLATION FOUND");
1375 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1376 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1379 $this->ilias->account->setDesktopItemParameters(
$_SESSION[
"tr_id"], $this->lm->getType(),$page_id);
1382 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1390 $lm_pg_obj->setLMId(
$_SESSION[
"tr_id"]);
1392 #$page_object_gui->setLayoutLinkTargets($targets);
1395 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1399 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1400 $page_object_gui->setOutputMode(
"presentation");
1401 $page_object_gui->setOutputSubmode(
"translation");
1403 $page_object_gui->setPresentationTitle(
1405 $this->lm->getPageHeader(), $this->lm->isActiveNumbering()));
1406 # $page_object_gui->setLinkParams("ref_id=".$this->lm->getRefId());
1407 $page_object_gui->setLinkParams(
"ref_id=".
$_SESSION[
"tr_id"]);
1408 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1409 $page_object_gui->setTemplateOutputVar(
"TRANSLATION_CONTENT");
1412 return $page_object_gui->presentation();
1419 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1421 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1423 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1425 $this->pg_obj =&
new ilPageObject($this->lm->getType(),$page_id);
1427 $this->lm_gui->showCitation($xml);
1435 if (!is_object($this->layout_doc))
1440 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1443 for ($i = 0; $i < count(
$res->nodeset); $i++)
1445 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1446 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1447 $targets[$type] = array(
"Type" => $type,
"Frame" => $frame);
1458 function ilPage(&$a_page_node, $a_page_id = 0)
1463 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1476 $ilBench->start(
"ContentPresentation",
"ilPage");
1478 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1479 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1482 if ($a_page_id == 0)
1484 $ilBench->start(
"ContentPresentation",
"ilPage_getCurrentPageId");
1486 $ilBench->stop(
"ContentPresentation",
"ilPage_getCurrentPageId");
1490 $page_id = $a_page_id;
1494 if ($this->chapter_has_no_active_page &&
1497 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1498 "Modules/LearningModule");
1499 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1502 $mtpl->setVariable(
"ITEM_TITLE",
1504 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1505 return $mtpl->get();
1509 if ($this->deactivated_page)
1511 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1512 "Modules/LearningModule");
1513 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_page_currently_deactivated"));
1516 $mtpl->setVariable(
"ITEM_TITLE",
1518 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1519 return $mtpl->get();
1525 $cont = $this->lng->txt(
"cont_no_page");
1526 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1530 $ilBench->start(
"ContentPresentation",
"ilPage_getPageObject");
1531 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1533 $page_object->registerOfflineHandler($this);
1534 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageObject");
1536 $ilBench->start(
"ContentPresentation",
"ilPage_getInternalLinks");
1537 $int_links = $page_object->getInternalLinks();
1538 $ilBench->stop(
"ContentPresentation",
"ilPage_getInternalLinks");
1540 $ilBench->start(
"ContentPresentation",
"ilPage_getPageObjectGUI");
1541 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1543 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageObjectGUI");
1546 $this->ilias->account->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1549 $ilBench->start(
"ContentPresentation",
"ilPage_updateCourseItems");
1550 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1552 $ilBench->stop(
"ContentPresentation",
"ilPage_updateCourseItems");
1559 $ilBench->start(
"ContentPresentation",
"ilPage_getLMPageObject");
1561 $lm_pg_obj->setLMId($this->lm->getId());
1563 $page_object_gui->setLinkXML($link_xml);
1564 $ilBench->stop(
"ContentPresentation",
"ilPage_getLMPageObject");
1566 $ilBench->start(
"ContentPresentation",
"ilPage_preparePage");
1569 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1570 $page_object_gui->enableCitation((
bool)
$_SESSION[
"citation"]);
1574 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1577 $page_object_gui->setOutputMode(
"presentation");
1581 $page_object_gui->setOutputMode(
"offline");
1584 $page_object_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1585 $page_object_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1589 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1590 $page_id != $this->lm->getFooterPage()))
1592 $page_object_gui->setPresentationTitle(
1594 $this->lm->getPageHeader(), $this->lm->isActiveNumbering()));
1598 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1599 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1602 if($_SESSION[
"tr_id"])
1604 $page_object_gui->setOutputSubmode(
"translation");
1608 $this->tpl->setCurrentBlock(
"ContentStyle");
1611 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1616 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
1618 $this->tpl->parseCurrentBlock();
1621 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1624 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1629 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1630 "syntaxhighlight.css");
1632 $this->tpl->parseCurrentBlock();
1634 $ilBench->stop(
"ContentPresentation",
"ilPage_preparePage");
1637 $ilBench->start(
"ContentPresentation",
"ilPage_trackUserAccess");
1638 include_once
"Services/Tracking/classes/class.ilTracking.php";
1640 $page_id,
"pg",
"read");
1641 $ilBench->stop(
"ContentPresentation",
"ilPage_trackUserAccess");
1643 $ilBench->start(
"ContentPresentation",
"ilPage_getPageContent");
1644 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1645 $ilBench->stop(
"ContentPresentation",
"ilPage_getPageContent");
1647 $ilBench->stop(
"ContentPresentation",
"ilPage");
1650 if ($this->lm->getHeaderPage() > 0 &&
1651 $page_id != $this->lm->getHeaderPage() &&
1652 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1656 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1661 if ($this->lm->getFooterPage() > 0 &&
1662 $page_id != $this->lm->getFooterPage() &&
1663 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1667 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1670 $this->tpl->setVariable(
"PAGE_CONTENT", $head.$ret.$foot);
1672 return $head.$ret.$foot;
1683 $ilBench->start(
"ContentPresentation",
"showPagePreconditions");
1690 $this->tpl->setCurrentBlock(
"ContentStyle");
1693 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1698 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
1700 $this->tpl->parseCurrentBlock();
1702 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
1705 include_once(
"classes/class.ilRepositoryExplorer.php");
1706 foreach($conds as $cond)
1710 $this->tpl->setCurrentBlock(
"condition");
1711 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
1713 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
1714 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
1715 if ($cond[
"operator"] ==
"passed")
1717 $cond_str = $this->lng->txt(
"passed");
1721 $cond_str = $cond[
"operator"];
1723 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
1724 $this->tpl->parseCurrentBlock();
1726 $this->tpl->setCurrentBlock(
"pg_content");
1728 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
1729 sprintf($this->lng->txt(
"cont_missing_preconditions"),
1731 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
1732 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
1735 $parent = $this->lm_tree->getParentId($topchap);
1736 $childs = $this->lm_tree->getChildsByType($parent,
"st");
1739 foreach($childs as $child)
1741 if ($child[
"child"] == $topchap)
1747 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
1750 if($succ_node !=
"")
1752 $framestr = (!empty(
$_GET[
"frame"]))
1753 ?
"frame=".
$_GET[
"frame"].
"&"
1756 $showViewInFrameset =
true;
1757 $link =
"<br /><a href=\"".
1758 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
1759 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
1760 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
1763 $this->tpl->parseCurrentBlock();
1765 $ilBench->stop(
"ContentPresentation",
"showPagePreconditions");
1776 $showViewInFrameset =
true;
1778 if ($a_layoutframes ==
"")
1780 $a_layoutframes = array();
1782 $link_info =
"<IntLinkInfos>";
1783 foreach ($a_int_links as $int_link)
1785 $target = $int_link[
"Target"];
1786 if (substr($target, 0, 4) ==
"il__")
1790 $type = $int_link[
"Type"];
1791 $targetframe = ($int_link[
"TargetFrame"] !=
"")
1792 ? $int_link[
"TargetFrame"]
1798 case "StructureObject":
1800 if ($lm_id == $this->lm->getId() ||
1801 ($targetframe !=
"None" && $targetframe !=
"New"))
1803 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1807 $nframe = ($ltarget ==
"")
1812 if ($showViewInFrameset) {
1832 if ($type ==
"PageObject")
1834 $href =
"./goto.php?target=pg_".$target_id;
1838 $href =
"./goto.php?target=st_".$target_id;
1843 if ($type ==
"PageObject")
1845 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.
"&client_id=".CLIENT_ID;
1849 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
1856 case "GlossaryItem":
1857 if ($targetframe ==
"None")
1859 $targetframe =
"Glossary";
1861 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1862 $nframe = ($ltarget ==
"")
1870 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1871 $nframe = ($ltarget ==
"")
1878 case "RepositoryItem":
1883 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
1887 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
1893 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1894 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" />";
1905 $link_info.=
"</IntLinkInfos>";
1918 $ilBench->start(
"ContentPresentation",
"ilGlossary");
1920 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
1924 $this->tpl->setCurrentBlock(
"ContentStyle");
1927 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1932 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
1934 $this->tpl->parseCurrentBlock();
1937 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1941 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1946 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1947 "syntaxhighlight.css");
1949 $this->tpl->parseCurrentBlock();
1951 $int_links = $term_gui->getInternalLinks();
1953 $term_gui->setLinkXML($link_xml);
1960 $ilBench->stop(
"ContentPresentation",
"ilGlossary");
1970 $ilBench->start(
"ContentPresentation",
"ilMedia");
1972 $this->tpl->setCurrentBlock(
"ContentStyle");
1975 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1980 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
1982 $this->tpl->parseCurrentBlock();
1984 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
1993 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
1994 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
1997 $this->tpl->setCurrentBlock(
"ilMedia");
2003 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2005 if (!empty (
$_GET[
"pg_id"]))
2007 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2014 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2035 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2036 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2051 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2056 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2057 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2058 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2059 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2060 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2065 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2067 $ilBench->stop(
"ContentPresentation",
"ilMedia");
2079 $ilBench->start(
"ContentPresentation",
"ilLMNavigation");
2089 if(!$this->lm_tree->isInTree($page_id))
2095 $limpos = strpos(
$_GET[
"back_pg"],
":");
2098 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2102 $back_pg =
$_GET[
"back_pg"];
2104 if (!$this->lm->cleanFrames())
2107 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2114 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2116 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2120 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2121 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2122 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2123 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2124 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2125 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2126 $this->tpl->parseCurrentBlock();
2127 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2128 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2129 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2130 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2131 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2132 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2133 $this->tpl->parseCurrentBlock();
2138 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2142 if ($this->chapter_has_no_active_page &&
2145 $c_id =
$_GET[
"obj_id"];
2153 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2154 $c_id = $succ_node[
"obj_id"];
2155 if ($succ_node[
"obj_id"] > 0 &&
2157 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2162 else if ($succ_node[
"obj_id"] > 0 &&
2172 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2174 $succ_str = ($succ_node !==
false)
2175 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2179 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2184 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2185 $c_id = $pre_node[
"obj_id"];
2186 if ($pre_node[
"obj_id"] > 0 &&
2188 ($this->lm->getPublicAccessMode() ==
"selected" &&
2193 else if ($pre_node[
"obj_id"] > 0 &&
2204 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2206 $pre_str = ($pre_node !==
false)
2207 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2211 $framestr = (!empty(
$_GET[
"frame"]))
2212 ?
"frame=".
$_GET[
"frame"].
"&"
2219 $showViewInFrameset =
true;
2223 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2232 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2234 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
2239 if (!$this->lm->cleanFrames())
2242 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2245 else if ($showViewInFrameset && !$this->
offlineMode())
2248 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2249 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2254 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2255 $prev_target =
'target="_top" ';
2261 $output = $this->lng->txt(
"msg_page_not_public");
2264 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2266 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2267 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2268 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2269 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2270 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2271 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2272 $this->tpl->parseCurrentBlock();
2273 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2274 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2275 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2276 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2277 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2278 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2279 $this->tpl->parseCurrentBlock();
2280 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2282 if($succ_node !=
"")
2284 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2287 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2289 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
2293 if (!$this->lm->cleanFrames())
2296 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2299 else if ($showViewInFrameset && !$this->
offlineMode())
2302 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2303 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2308 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2309 $succ_target =
' target="_top" ';
2315 $output = $this->lng->txt(
"msg_page_not_public");
2318 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2320 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2321 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2322 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2323 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2324 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2325 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2326 $this->tpl->parseCurrentBlock();
2327 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2328 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2329 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2330 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2331 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2332 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2333 $this->tpl->parseCurrentBlock();
2334 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2337 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation");
2343 $child_nodes = $a_node->child_nodes();
2344 foreach ($child_nodes as $child)
2346 if($child->node_name() ==
"ilFrame")
2348 $attributes = $this->
attrib2arr($child->attributes());
2350 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2354 if(!empty($attributes[
"name"]))
2356 unset($attributes[
"template"]);
2357 unset($attributes[
"template_location"]);
2358 $attributes[
"src"] =
2359 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2361 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2362 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2363 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2368 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2370 $a_content .= $this->
buildTag(
"end",
"frameset");
2375 unset($attributes[
"template"]);
2376 unset($attributes[
"template_location"]);
2377 $attributes[
"src"] =
2378 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2380 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2381 if ($attributes[
"name"] ==
"toc")
2383 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2385 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2386 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2408 if (is_array($attr))
2410 while (list($k,$v) = each($attr))
2411 $tag.=
" ".$k.
"=\"$v\"";
2430 $ilBench->start(
"ContentPresentation",
"TableOfContents");
2433 $this->tpl->setCurrentBlock(
"ContentStyle");
2436 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2441 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
2443 $this->tpl->parseCurrentBlock();
2445 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2454 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2455 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
2459 $this->tpl->getStandardTemplate();
2462 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2465 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
true);
2468 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2469 $this->tpl->setTitle($this->lm->getTitle());
2483 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2485 $this->
getLink($this->lm->getRefId(),
""),
2488 $exp->setTargetGet(
"obj_id");
2490 $exp->forceExpandAll(
true,
false);
2498 if ($this->chapter_has_no_active_page &&
2501 $exp->highlightNode(
$_GET[
"obj_id"]);
2505 $exp->highlightNode($page_id);
2509 $tree =& $this->lm->getTree();
2510 if (
$_GET[
"lmtocexpand"] ==
"")
2512 $expanded = $tree->readRootId();
2516 $expanded =
$_GET[
"lmtocexpand"];
2519 $exp->setExpand($expanded);
2523 $output = $exp->getOutput();
2525 $this->tpl->setVariable(
"EXPLORER", $output);
2526 $this->tpl->parseCurrentBlock();
2530 return $this->tpl->get();
2537 $ilBench->stop(
"ContentPresentation",
"TableOfContents");
2548 $this->ctrl->setCmd(
"showSummary");
2549 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2566 global
$ilBench, $ilLocator, $ilAccess;
2568 $this->tpl->setHeaderPageTitle(
"PAGETITLE",
" - ".$this->lm->getTitle());
2577 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2578 $this->tpl->setStyleSheetLocation(
"./".$style_name);
2581 $this->tpl->getStandardTemplate();
2582 $this->tpl->setTitle($this->lm->getTitle());
2585 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2589 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2595 $ilLocator->addRepositoryItems();
2596 $this->tpl->setLocator();
2599 $this->lng->loadLanguageModule(
"meta");
2601 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2604 $info->enablePrivateNotes();
2605 $info->enableLearningProgress();
2607 $info->enableNews();
2608 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2611 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
2613 $info->enableNewsEditing();
2615 if ($enable_internal_rss)
2617 $info->setBlockProperty(
"news",
"settings",
true);
2639 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
2643 $this->tpl->setContent($info->getHTML());
2644 return $this->tpl->get();
2649 $this->ctrl->forwardCommand($info);
2662 if (!$this->lm->isActivePrintView())
2667 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2669 $ilBench->start(
"ContentPresentation",
"PrintViewSelection");
2672 $this->tpl->setCurrentBlock(
"ContentStyle");
2675 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2680 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
2682 $this->tpl->parseCurrentBlock();
2684 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2686 $this->tpl->getStandardTemplate();
2688 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2692 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
2693 "tpl.lm_print_selection.html",
true);
2696 $this->tpl->setTitle($this->lm->getTitle());
2698 $this->tpl->setVariable(
"TXT_SHOW_PRINT", $this->lng->txt(
"cont_show_print_view"));
2700 $this->tpl->setVariable(
"TXT_CURRENT_PAGE", $this->lng->txt(
"cont_current_page"));
2701 $this->tpl->setVariable(
"TXT_CURRENT_CHAPTER", $this->lng->txt(
"cont_current_chapter"));
2702 $this->tpl->setVariable(
"TXT_SELECTION", $this->lng->txt(
"cont_selected_pg_chap"));
2709 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
2710 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
2712 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2714 if (!is_array($_POST[
"item"]))
2716 if (
$_GET[
"obj_id"] !=
"")
2718 $_POST[
"item"][
$_GET[
"obj_id"]] =
"y";
2722 $_POST[
"item"][1] =
"y";
2726 foreach ($nodes as $node)
2730 if ($node[
"type"] ==
"pg" &&
2737 for ($i=0; $i<$node[
"depth"]; $i++)
2739 $this->tpl->setCurrentBlock(
"indent");
2741 $this->tpl->parseCurrentBlock();
2745 $this->tpl->setCurrentBlock(
"lm_item");
2747 switch ($node[
"type"])
2751 $this->tpl->setVariable(
"TXT_TITLE",
2753 $this->lm->getPageHeader(), $this->lm->isActiveNumbering()));
2756 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2760 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2761 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2769 $this->tpl->setVariable(
"TXT_TITLE", $this->lm->getTitle());
2780 $this->tpl->setVariable(
"TXT_TITLE",
2782 $this->lm->isActiveNumbering()));
2784 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2788 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2789 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2799 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2802 $this->tpl->setVariable(
"ITEM_ID", $node[
"obj_id"]);
2804 if ($_POST[
"item"][$node[
"obj_id"]] ==
"y")
2809 $this->tpl->parseCurrentBlock();
2813 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
2815 $this->tpl->setCurrentBlock(
"indent");
2817 $this->tpl->parseCurrentBlock();
2818 $this->tpl->setCurrentBlock(
"indent");
2820 $this->tpl->parseCurrentBlock();
2822 $this->tpl->setCurrentBlock(
"lm_item");
2823 $this->tpl->setVariable(
"TXT_TITLE",
2825 $this->lm->getPageHeader(), $this->lm->isActiveNumbering()));
2828 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2832 $this->tpl->setVariable(
"DISABLED",
"disabled=\"disabled\"");
2833 $this->tpl->setVariable(
"TXT_NO_ACCESS",
"(".$this->lng->txt(
"cont_no_access").
")");
2837 $this->tpl->setVariable(
"ITEM_ID",
$_GET[
"obj_id"]);
2839 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
2841 $this->tpl->parseCurrentBlock();
2847 $ilBench->stop(
"ContentPresentation",
"PrintViewSelection");
2857 if (!$this->lm->isActivePrintView())
2862 $ilBench->start(
"ContentPresentation",
"PrintView");
2864 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2868 if ($_POST[
"sel_type"] ==
"page")
2870 $_POST[
"item"] = array($c_obj_id =>
"y");
2872 if ($_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
2875 $path = $this->lm_tree->getPathFull($c_obj_id);
2876 $chap_id = $path[1][
"child"];
2879 $_POST[
"item"] = array($chap_id =>
"y");
2892 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2893 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./".$style_name);
2897 $this->tpl->setCurrentBlock(
"ContentStyle");
2900 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2905 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
2907 $this->tpl->parseCurrentBlock();
2910 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2911 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2913 $this->tpl->parseCurrentBlock();
2916 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
2919 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
2921 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2923 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
2924 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
2925 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2930 $glossary_links = array();
2931 $output_header =
false;
2932 $media_links = array();
2935 if ($this->lm->getFooterPage() > 0)
2940 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getFooterPage());
2944 $page_object_gui->setOutputMode(
"print");
2945 $page_object_gui->setPresentationTitle(
"");
2946 $page_object_gui->setFileDownloadLink(
"#");
2947 $page_object_gui->setFullscreenLink(
"#");
2948 $page_object_gui->setSourceCodeDownloadScript(
"#");
2949 $footer_page_content = $page_object_gui->showPage();
2952 if ($this->lm->getHeaderPage() > 0)
2957 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getHeaderPage());
2961 $page_object_gui->setOutputMode(
"print");
2962 $page_object_gui->setPresentationTitle(
"");
2963 $page_object_gui->setFileDownloadLink(
"#");
2964 $page_object_gui->setFullscreenLink(
"#");
2965 $page_object_gui->setSourceCodeDownloadScript(
"#");
2966 $header_page_content = $page_object_gui->showPage();
2971 if (is_array($_POST[
"item"]))
2973 foreach($_POST[
"item"] as $k => $item)
2975 if ($item ==
"y" && $k > 0 && !$this->lm_tree->isInTree($k))
2979 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
2987 $ilCtrl->redirect($this,
"showPrintViewSelection");
2990 foreach ($nodes as $node_key => $node)
2993 if ($node[
"type"] ==
"pg" &&
3001 if ($node[
"depth"] <= $act_level)
3003 if ($_POST[
"item"][$node[
"obj_id"]] ==
"y")
3005 $act_level = $node[
"depth"];
3019 if ($node[
"type"] ==
"du")
3021 $output_header =
true;
3025 if ($node[
"type"] ==
"st")
3028 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3037 $this->tpl->setCurrentBlock(
"print_chapter");
3039 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3040 $this->lm->isActiveNumbering());
3041 $this->tpl->setVariable(
"CHAP_TITLE",
3046 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3048 $this->tpl->setVariable(
"CHAP_HEADER",
3049 $header_page_content);
3050 $did_chap_page_header =
true;
3054 $this->tpl->parseCurrentBlock();
3055 $this->tpl->setCurrentBlock(
"print_block");
3056 $this->tpl->parseCurrentBlock();
3060 if ($node[
"type"] ==
"pg")
3063 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3071 $this->tpl->setCurrentBlock(
"print_item");
3074 $page_id = $node[
"obj_id"];
3075 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
3076 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
3080 $lm_pg_obj->setLMId($this->lm->getId());
3083 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3084 $page_object_gui->setOutputMode(
"print");
3085 $page_object_gui->setPresentationTitle(
"");
3087 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3090 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
3094 if ($this->lm->isActiveNumbering())
3096 $chapter_title = trim(substr($chapter_title,
3097 strpos($chapter_title,
" ")));
3100 if ($page_title != $chapter_title)
3102 $page_object_gui->setPresentationTitle($page_title);
3107 $hcont = $header_page_content;
3108 $fcont = $footer_page_content;
3112 if ($did_chap_page_header)
3116 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3117 !($nodes[$node_key + 1][
"depth"] <= $act_level
3118 && $_POST[
"item"][$nodes[$node_key + 1][
"obj_id"]] !=
"y"))
3124 $page_object_gui->setFileDownloadLink(
"#");
3125 $page_object_gui->setFullscreenLink(
"#");
3126 $page_object_gui->setSourceCodeDownloadScript(
"#");
3127 $page_content = $page_object_gui->showPage();
3130 $this->tpl->setVariable(
"CONTENT",
3131 $hcont.$page_content.$fcont);
3135 $this->tpl->setVariable(
"CONTENT",
3136 $hcont.$page_content.$fcont.
"<br />");
3138 $chapter_title =
"";
3139 $this->tpl->parseCurrentBlock();
3140 $this->tpl->setCurrentBlock(
"print_block");
3141 $this->tpl->parseCurrentBlock();
3148 foreach ($int_links as $key => $link)
3150 if ($link[
"type"] ==
"git" &&
3151 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3153 $glossary_links[$key] = $link;
3155 if ($link[
"type"] ==
"mob" &&
3156 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3159 $mob_links[$key] = $link;
3170 $page_object->buildDom();
3171 $links = $page_object->getInternalLinks();
3172 foreach($links as $link)
3174 if ($link[
"Type"] ==
"MediaObject"
3175 && $link[
"TargetFrame"] !=
""
3176 && $link[
"TargetFrame"] !=
"None")
3178 $media_links[] = $link;
3190 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3192 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3193 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3198 foreach($glossary_links as $key => $link)
3201 $terms[$term.
":".$key] = array(
"key" => $key,
"link" => $link,
"term" => $term);
3206 foreach($terms as
$t)
3214 foreach($defs as $def)
3217 if (count($defs) > 1)
3219 $this->tpl->setCurrentBlock(
"def_title");
3220 $this->tpl->setVariable(
"TXT_DEFINITION",
3221 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3222 $this->tpl->parseCurrentBlock();
3226 $page_gui->setTemplateOutput(
false);
3227 $page_gui->setOutputMode(
"print");
3229 $this->tpl->setCurrentBlock(
"definition");
3230 $page_gui->setFileDownloadLink(
"#");
3231 $page_gui->setFullscreenLink(
"#");
3232 $page_gui->setSourceCodeDownloadScript(
"#");
3233 $output = $page_gui->showPage();
3234 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3235 $this->tpl->parseCurrentBlock();
3239 $this->tpl->setCurrentBlock(
"term");
3240 $this->tpl->setVariable(
"VAL_TERM",
3242 $this->tpl->parseCurrentBlock();
3247 $this->tpl->setCurrentBlock(
"glossary");
3248 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3249 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3250 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3251 $this->tpl->parseCurrentBlock();
3253 $annexes[] = $annex_title;
3257 if (count($media_links) > 0)
3259 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3260 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3262 foreach($media_links as $media)
3264 if (substr($media[
"Target"],0,4) ==
"il__")
3266 $arr = explode(
"_",$media[
"Target"]);
3267 $id = $arr[count($arr) - 1];
3270 $med_item =& $med_obj->getMediaItem(
"Standard");
3271 if (is_object($med_item))
3273 if (is_int(strpos($med_item->getFormat(),
"image")))
3275 $this->tpl->setCurrentBlock(
"ref_image");
3278 if ($med_item->getLocationType() ==
"LocalFile")
3280 $this->tpl->setVariable(
"IMG_SOURCE",
3282 "/".$med_item->getLocation());
3286 $this->tpl->setVariable(
"IMG_SOURCE",
3287 $med_item->getLocation());
3290 if ($med_item->getCaption() !=
"")
3292 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3296 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3298 $this->tpl->parseCurrentBlock();
3306 $this->tpl->setCurrentBlock(
"ref_images");
3307 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3308 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3309 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3310 $this->tpl->parseCurrentBlock();
3312 $annexes[] = $annex_title;
3318 $this->tpl->setCurrentBlock(
"print_header");
3319 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3320 if ($this->lm->getDescription() !=
"none")
3322 include_once(
"Services/MetaData/classes/class.ilMD.php");
3323 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3325 foreach($md_gen->getDescriptionIds() as $id)
3327 $md_des = $md_gen->getDescription($id);
3328 $description = $md_des->getDescription();
3331 $this->tpl->setVariable(
"LM_DESCRIPTION",
3334 $this->tpl->parseCurrentBlock();
3338 foreach ($nodes2 as $node2)
3340 if ($node2[
"type"] ==
"st"
3343 for ($j=1; $j < $node2[
"depth"]; $j++)
3345 $this->tpl->setCurrentBlock(
"indent");
3347 $this->tpl->parseCurrentBlock();
3349 $this->tpl->setCurrentBlock(
"toc_entry");
3350 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3352 $this->lm->isActiveNumbering()));
3353 $this->tpl->parseCurrentBlock();
3358 foreach ($annexes as $annex)
3360 $this->tpl->setCurrentBlock(
"indent");
3362 $this->tpl->parseCurrentBlock();
3363 $this->tpl->setCurrentBlock(
"toc_entry");
3364 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3365 $this->tpl->parseCurrentBlock();
3368 $this->tpl->setCurrentBlock(
"toc");
3369 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3370 $this->tpl->parseCurrentBlock();
3372 $this->tpl->setCurrentBlock(
"print_start_block");
3373 $this->tpl->parseCurrentBlock();
3377 include_once
'Services/MetaData/classes/class.ilMD.php';
3378 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3379 if(is_object($lifecycle = $md->getLifecycle()))
3381 $sep = $author =
"";
3382 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3384 $md_con = $lifecycle->getContribute($con_id);
3385 if ($md_con->getRole() ==
"Author")
3387 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3389 $md_ent = $md_con->getEntity($ent_id);
3390 $author = $author.$sep.$md_ent->getEntity();
3397 $this->lng->loadLanguageModule(
"meta");
3398 $this->tpl->setCurrentBlock(
"author");
3399 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3400 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3401 $this->tpl->parseCurrentBlock();
3407 if (is_object($md_rights = $md->getRights()))
3409 $copyright = $md_rights->getDescription();
3410 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3413 if ($copyright !=
"")
3415 $this->lng->loadLanguageModule(
"meta");
3416 $this->tpl->setCurrentBlock(
"copyright");
3417 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3418 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3419 $this->tpl->parseCurrentBlock();
3423 $this->tpl->show(
false);
3425 $ilBench->stop(
"ContentPresentation",
"PrintView");
3431 if($_POST[
"action"] ==
"show" or $_POST[
"action"] ==
"show_citation")
3433 if($_POST[
"action"] ==
"show_citation")
3436 if(count($_POST[
"target"]) != 1)
3439 $_POST[
"action"] =
"";
3440 $_POST[
"target"] = 0;
3449 if(isset($_POST[
"tr_id"]))
3451 $_SESSION[
"tr_id"] = $_POST[
"tr_id"][0];
3457 if(is_array($_POST[
"target"]))
3459 $_SESSION[
"bib_id"] =
",".implode(
',',$_POST[
"target"]).
",";
3475 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3477 $fileObj->sendFile();
3486 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3499 $this->tpl->setCurrentBlock(
"ContentStyle");
3502 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3507 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
3509 $this->tpl->parseCurrentBlock();
3511 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
3513 $this->tpl->getStandardTemplate();
3515 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3520 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
3523 $this->tpl->setTitle($this->lm->getTitle());
3533 include_once
'Services/MetaData/classes/class.ilMD.php';
3534 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3535 if (is_object($md_rights = $md->getRights()))
3537 $copyright = $md_rights->getDescription();
3538 if ($copyright !=
"")
3540 $this->lng->loadLanguageModule(
"meta");
3541 $this->tpl->setCurrentBlock(
"copyright");
3542 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3543 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3544 $this->tpl->parseCurrentBlock();
3549 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
3553 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
3556 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
3558 $export_files = array();
3559 $types = array(
"xml",
"html");
3560 foreach($types as $type)
3562 if ($this->lm->getPublicExportFile($type) !=
"")
3564 if (is_file($this->lm->getExportDirectory($type).
"/".
3565 $this->lm->getPublicExportFile($type)))
3567 $dir = $this->lm->getExportDirectory($type);
3568 $size = filesize($this->lm->getExportDirectory($type).
"/".
3569 $this->lm->getPublicExportFile($type));
3570 $export_files[] = array(
"type" => $type,
3571 "file" => $this->lm->getPublicExportFile($type),
3579 $tbl->setTitle($this->lng->txt(
"download"));
3581 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
3582 $this->lng->txt(
"cont_file"),
3583 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
3586 $cols = array(
"format",
"file",
"size",
"date",
"download");
3587 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
3588 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
3589 $tbl->setHeaderVars($cols, $header_params);
3590 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
3591 $tbl->disable(
"sort");
3594 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3595 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3596 $tbl->setLimit(
$_GET[
"limit"]);
3597 $tbl->setOffset(
$_GET[
"offset"]);
3598 $tbl->setMaxCount($this->maxcount);
3604 $tbl->disable(
"footer");
3606 $tbl->setMaxCount(count($export_files));
3607 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3610 if(count($export_files) > 0)
3613 foreach($export_files as $exp_file)
3615 if (!$exp_file[
"size"] > 0)
3620 $this->tpl->setCurrentBlock(
"tbl_content");
3621 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
3624 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3626 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
3627 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
3628 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
3630 $file_arr = explode(
"__", $exp_file[
"file"]);
3631 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
3633 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
3634 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
3635 $this->tpl->setVariable(
"LINK_DOWNLOAD",
3636 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
3638 $this->tpl->parseCurrentBlock();
3643 $this->tpl->setCurrentBlock(
"notfound");
3644 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3645 $this->tpl->setVariable(
"NUM_COLS", 5);
3646 $this->tpl->parseCurrentBlock();
3658 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
3659 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
3661 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
3668 $this->ilias->raiseError($this->lng->txt(
"file_not_found"),$this->ilias->error_obj->MESSAGE);
3674 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
3675 $a_back_link =
"append")
3686 $back_pg =
$_GET[
"back_pg"];
3687 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
3688 $a_back_link ==
"append")
3692 $back_pg = $cur_page_id.
":".$back_pg;
3696 $back_pg = $cur_page_id;
3701 if ($a_back_link ==
"reduce")
3703 $limpos = strpos(
$_GET[
"back_pg"],
":");
3707 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
3714 else if ($a_back_link !=
"keep")
3726 $link = $this->ctrl->getLinkTarget($this,
"fullscreen");
3733 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
3737 $this->ctrl->setParameter($this,
"frame", $a_frame);
3739 if ($a_obj_id !=
"")
3744 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
3748 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
3749 $link.=
"&obj_id=".$a_obj_id;
3755 $this->ctrl->setParameter($this,
"obj_type", $a_type);
3757 $link = $this->ctrl->getLinkTarget($this, $a_cmd);
3758 $link = str_replace(
"&",
"&", $link);
3760 $this->ctrl->setParameter($this,
"frame",
"");
3761 $this->ctrl->setParameter($this,
"obj_id",
"");
3762 $this->ctrl->setParameter($this,
"mob_id",
"");
3770 case "downloadFile":
3774 $link =
"fullscreen.html";
3779 if ($a_obj_id ==
"")
3781 $a_obj_id = $this->lm_tree->getRootId();
3782 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3783 $a_obj_id = $pg_node[
"obj_id"];
3785 if ($a_type ==
"StructureObject")
3787 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3788 $a_obj_id = $pg_node[
"obj_id"];
3790 if ($a_frame !=
"" && $a_frame !=
"_blank")
3792 if ($a_frame !=
"toc")
3794 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
3798 $link =
"frame_".$a_frame.
".html";
3805 $link =
"lm_pg_".$nid.
".html";
3809 $link =
"lm_pg_".$a_obj_id.
".html";
3815 $link =
"term_".$a_obj_id.
".html";
3819 $link =
"media_".$a_obj_id.
".html";
3827 $this->ctrl->clearParameters($this);
3839 $this->tpl->setCurrentBlock(
"ContentStyle");
3843 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3848 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content.css");
3851 $this->tpl->parseCurrentBlock();
3852 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
3853 $this->tpl->setCurrentBlock(
"pg_content");
3854 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
3855 $this->tpl->parseCurrentBlock();
3862 $target = $this->ctrl->getLinkTarget($this,
"");
3864 return $this->ctrl->getLinkTarget($this,
"");
3880 $this->offline_directory = $offdir;
3902 if (!($fp = @fopen(
$file,
"w+")))
3904 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
3905 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");