4 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
5 require_once(
"./Services/MainMenu/classes/class.ilMainMenuGUI.php");
6 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
38 $lng->loadLanguageModule(
"content");
43 $this->offline =
false;
44 $this->frames = array();
46 $this->ctrl->saveParameter($this, array(
"ref_id"));
49 # include_once './classes/class.ilSearch.php';
51 # if(!ilSearch::_checkParentConditions($_GET['ref_id']))
53 # $ilias->error_obj->raiseError($lng->txt('access_denied'),$ilias->error_obj->WARNING);
56 $type = $this->ilias->obj_factory->getTypeByRefId(
$_GET[
"ref_id"]);
62 include_once(
"./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
67 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
73 $this->lm =& $this->lm_gui->object;
75 if(IS_PAYMENT_ENABLED)
77 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
80 else $this->needs_to_be_purchased =
false;
83 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
85 if (!$this->lm->getOnline())
87 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
91 $this->lm_tree =
new ilTree($this->lm->getId());
93 $this->lm_tree->setTreeTablePK(
"lm_id");
98 $this->
abstract =
true;
100 if((count(
$_POST[
"tr_id"]) > 1) or
101 (!
$_POST[
"target"] and (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")))
103 $this->
abstract =
true;
105 else if(
$_GET[
"obj_id"] or (
$_POST[
"action"] ==
"show") or (
$_POST[
"action"] ==
"show_citation"))
107 $this->
abstract =
false;
121 if(IS_PAYMENT_ENABLED)
123 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
124 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
127 if(!((
int)
$_GET[
'obj_id'] &&
129 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
132 unset(
$_GET[
'obj_id']);
134 $this->tpl->getStandardTemplate();
137 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
139 $ret = $this->ctrl->forwardCommand($pp);
147 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
148 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
149 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
151 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
154 $next_class = $this->ctrl->getNextClass($this);
155 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
164 $obj_id =
$_GET[
"obj_id"];
165 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
166 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
167 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
175 case "ilinfoscreengui":
179 case "ilpageobjectgui":
180 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
181 if (
$_GET[
"pg_type"] !=
"glo")
190 $ret = $ilCtrl->forwardCommand($page_gui);
205 $this->offline = $a_offline;
224 $this->export_format = $a_format;
234 return $this->export_format;
256 $q =
"DELETE FROM lo_access ".
257 "WHERE usr_id = ".$ilDB->quote((
int)
$usr_id,
"integer").
" ".
258 "AND lm_id = ".$ilDB->quote((
int) $lm_id,
"integer");
259 $ilDB->manipulate($q);
260 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
263 $q =
"INSERT INTO lo_access ".
264 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
266 "(".$ilDB->now().
",".
267 $ilDB->quote((
int) $usr_id,
"integer").
",".
268 $ilDB->quote((
int) $lm_id,
"integer").
",".
269 $ilDB->quote((
int) $obj_id,
"integer").
",".
270 $ilDB->quote(
$title,
"text").
")";
271 $ilDB->manipulate($q);
284 switch($this->lm->getType())
287 $this->lm_gui->export();
303 if (
$_POST[
"cmd"][
"cancel"] !=
"")
305 $this->ctrl->setParameter($this,
"frame",
"maincontent");
306 $this->ctrl->redirect($this,
"layout");
309 switch($this->lm->getType())
313 $_GET[
"frame"] =
"maincontent";
316 $_GET[
"obj_id"] = $objRow[
"obj_id"];
318 $query =
"SELECT * FROM lm_data WHERE lm_id = ".
319 $ilDB->quote($objRow[
"obj_id"],
"integer").
321 $result = $ilDB->query(
$query);
325 while (is_array(
$row = $ilDB->fetchAssoc($result)) )
335 if(
$_POST[
"type"] ==
"pdf") $output .=
"<hr BREAK >\n";
336 if(
$_POST[
"type"] ==
"print") $output .=
"<p style=\"page-break-after:always\" />";
337 if(
$_POST[
"type"] ==
"html") $output .=
"<br><br><br><br>";
342 $o = $this->
layout(
"main.xml",
false);
344 $output .=
"<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_PageTitle\">".$this->lm->title.
"</div><p>";
347 $output .=
"\n<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td valign=top align=center>- ".$page.
" -</td></tr></table>\n";
352 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
354 if(
$_POST[
"type"] ==
"print")
356 $printTpl->touchBlock(
"printreq");
362 $css1 =
"./css/delos.css";
363 $css2 =
"./css/content.css";
365 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
367 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
368 $printTpl->setVariable(
"CONTENT",$output);
371 $printTpl->setCurrentBlock(
"SyntaxStyle");
372 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
374 $printTpl->parseCurrentBlock();
377 $html = $printTpl->get();
382 $this->lm->createExportDirectory();
383 $export_dir = $this->lm->getExportDirectory();
388 $fileName =
"offline";
389 $fileName = str_replace(
" ",
"_",$fileName);
391 if (!file_exists($export_dir.
"/".$fileName))
393 @mkdir($export_dir.
"/".$fileName);
394 @chmod($export_dir.
"/".$fileName, 0755);
396 @mkdir($export_dir.
"/".$fileName.
"/css");
397 @chmod($export_dir.
"/".$fileName.
"/css", 0755);
401 if(
$_POST[
"type"] ==
"xml")
404 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_GET[
"ref_id"]);
406 if ($tmp_obj->getType() ==
"dbk" )
408 require_once
"./Modules/LearningModule/classes/class.ilObjDlBook.php";
414 else if(
$_POST[
"type"] ==
"print")
418 else if (
$_POST[
"type"]==
"html")
426 $css1 = file(
"./templates/default/delos.css");
427 $css1 = implode($css1,
"");
429 $fp = fopen($export_dir.
"/".$fileName.
"/css/delos.css",
"wb");
433 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".html",
"wb");
437 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
442 else if (
$_POST[
"type"]==
"pdf")
466 switch($this->lm->getType())
469 $this->lm_gui->offlineexportform();
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;
559 $layout = $this->lm->getLayout();
560 if ($this->lm->getLayoutPerPage())
564 if (in_array(
$_GET[
"cmd"], array(
"media",
"glossary")) &&
$_GET[
"from_page"] > 0)
566 $pg_id = (int)
$_GET[
"from_page"];
587 function layout($a_xml =
"main.xml", $doShow =
true)
591 $ilBench->start(
"ContentPresentation",
"layout");
598 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
600 if (!$doc =
domxml_open_mem($xmlfile)) { echo
"ilLMPresentation: XML File invalid";
exit; }
601 $this->layout_doc =& $doc;
605 $ilBench->start(
"ContentPresentation",
"layout_getFrameNode");
608 ?
"/ilLayout/ilFrame[1]"
609 :
"//ilFrame[@name='".$_GET[
"frame"].
"']";
611 $found = $result->nodeset;
612 if (count($found) != 1) { echo
"ilLMPresentation: XML File invalid";
exit; }
615 $ilBench->stop(
"ContentPresentation",
"layout_getFrameNode");
619 $attributes = $this->
attrib2arr($node->attributes());
621 $this->frames = array();
622 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
624 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
627 $content .= $this->
buildTag(
"end",
"frameset");
628 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
629 $this->tpl->setVariable(
"PAGETITLE",
"- ".$this->lm->getTitle());
630 $this->tpl->setVariable(
"FS_CONTENT", $content);
633 $content = $this->tpl->get();
639 $ilBench->start(
"ContentPresentation",
"layout_processContentTag");
641 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
642 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
649 if(empty(
$_GET[
"obj_type"]))
651 $obj_type =
"PageObject";
655 $obj_type =
$_GET[
"obj_type"];
659 $childs = $node->child_nodes();
661 foreach($childs as $child)
663 if ($child->node_name() == $obj_type)
666 $attributes = $this->
attrib2arr($child->attributes());
672 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
673 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
677 $in_module = ($attributes[
"template_location"] ==
"module")
682 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
683 $this->tpl->setBodyClass(
"");
697 $style_name = $this->ilias->account->prefs[
"style"].
".css";
698 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
701 $childs = $node->child_nodes();
703 $ilBench->start(
"ContentPresentation",
"layout_processContentNodes");
704 foreach($childs as $child)
707 $child_attr = $this->
attrib2arr($child->attributes());
709 switch ($child->node_name())
716 $this->
ilTOC($child_attr[
"target_frame"]);
720 switch($this->lm->getType())
726 $content = $this->
ilPage($child);
733 $content = $this->lm_gui->showAbstract(
$_POST[
"target"]);
738 $content = $this->
ilPage($child);
753 case "ilLMNavigation":
756 if(
$_GET[
"obj_id"] or
758 (
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")) or
759 $this->lm->getType() ==
'lm')
761 $ilBench->start(
"ContentPresentation",
"layout_lmnavigation");
763 $ilBench->stop(
"ContentPresentation",
"layout_lmnavigation");
776 $this->
ilJavaScript($child_attr[
"inline"], $child_attr[
"file"],
777 $child_attr[
"location"]);
793 if (!$this->ilias->getSetting(
'disable_notes'))
800 $ilBench->stop(
"ContentPresentation",
"layout_processContentNodes");
802 $ilBench->stop(
"ContentPresentation",
"layout_processContentTag");
806 if (strcmp(
$_GET[
"frame"],
"topright") == 0) $this->tpl->fillJavaScriptFiles();
807 if (strcmp(
$_GET[
"frame"],
"right") == 0) $this->tpl->fillJavaScriptFiles();
808 if (strcmp(
$_GET[
"frame"],
"botright") == 0) $this->tpl->fillJavaScriptFiles();
812 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
817 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
818 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
819 $this->tpl->fillJavaScriptFiles();
820 $this->tpl->fillScreenReaderFocus();
822 $this->tpl->fillCssFiles();
826 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
829 if ($f[
"type"] ==
"js")
831 $this->tpl->addJavascript($f[
"target"]);
833 if ($f[
"type"] ==
"css")
835 $this->tpl->addCSS($f[
"target"]);
838 $this->tpl->fillJavaScriptFiles(
true);
839 $this->tpl->fillCssFiles(
true);
843 $this->tpl->fillBodyClass();
853 $this->tpl->fillTabs();
854 if ($this->fill_on_load_code)
856 $this->tpl->fillOnLoadCode();
858 $content = $this->tpl->get();
859 $content = str_replace(
"{",
"{", $content);
860 $content = str_replace(
"}",
"}", $content);
862 header(
'Content-type: text/html; charset=UTF-8');
867 $content = $this->tpl->get();
870 $ilBench->stop(
"ContentPresentation",
"layout");
882 if (
$_GET[
"frame"] !=
"_blank")
894 if (
$_GET[
"frame"] !=
"_blank")
900 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
901 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
910 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
911 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
921 return $this->tpl->get();
941 $ilMainMenu->setSmallMode(
true);
945 $ilMainMenu->setSmallMode(
false);
951 $ilMainMenu->setLoginTargetPar(
"pg_".$page_id.
"_".$this->lm->getRefId());
954 $this->tpl->touchBlock(
"mm_intro");
955 $this->tpl->touchBlock(
"mm_outro");
956 $this->tpl->touchBlock(
"pg_intro");
957 $this->tpl->touchBlock(
"pg_outro");
958 $this->tpl->setBodyClass(
"std");
959 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
969 $ilBench->start(
"ContentPresentation",
"ilTOC");
970 require_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorer.php");
971 if ($this->lm->cleanFrames())
976 $exp->setExpandTarget($this->
getLink($this->lm->getRefId(),
$_GET[
"cmd"],
$_GET[
"obj_id"], $_GET[
"frame"]));
977 $exp->setTargetGet(
"obj_id");
978 if ($this->lm->cleanFrames())
982 $exp->setFrameTarget(
"_top");
991 $exp->setFrameTarget($a_target);
993 $exp->addFilter(
"du");
994 $exp->addFilter(
"st");
997 if ($this->lm->cleanFrames())
1002 $path = $this->lm_tree->getPathId($page_id);
1003 $exp->setForceOpenPath(
$path);
1008 if ($this->chapter_has_no_active_page &&
1011 $exp->highlightNode($_GET[
"obj_id"]);
1015 $exp->highlightNode($page_id);
1021 if ($this->lm->getTOCMode() ==
"pages")
1023 $exp->addFilter(
"pg");
1025 $exp->setFiltered(
true);
1028 if ($_GET[
"lmexpand"] ==
"")
1030 $expand_keys = array();
1033 $expand_keys = array_keys(
$_SESSION[
"lmexpand"]);
1035 $_SESSION[
"lmexpand"] = array($this->lm_tree->readRootId());
1036 $expanded = $this->lm_tree->readRootId();
1040 $expanded = $_GET[
"lmexpand"];
1042 $exp->setExpand($expanded);
1046 $output = $exp->getOutput();
1048 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
1057 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
1058 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
1063 $this->tpl->addBlockFile(
"EXPL_TOP",
"exp_top",
"tpl.explorer_top.html");
1067 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
1068 $this->tpl->setVariable(
"EXPLORER",$output);
1069 $this->tpl->setVariable(
"ACTION",
1070 $this->
getLink($this->lm->getRefId(), $_GET[
"cmd"],
"", $_GET[
"frame"]).
1071 "&lmexpand=".$_GET[
"lmexpand"]);
1072 $this->tpl->parseCurrentBlock();
1073 $ilBench->stop(
"ContentPresentation",
"ilTOC");
1074 if ($_GET[
"lmexpand"] ==
"")
1077 foreach ($expand_keys as $k)
1090 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
1099 $this->tpl->setCurrentBlock(
"header_image");
1102 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.gif");
1108 $this->tpl->parseCurrentBlock();
1109 $this->tpl->setCurrentBlock(
"lm_head");
1110 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
1111 $this->tpl->parseCurrentBlock();
1122 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1128 $showViewInFrameset =
true;
1130 if ($showViewInFrameset)
1136 $buttonTarget =
"_top";
1140 include_once(
"./classes/class.ilTemplate.php");
1141 $tpl_menu =&
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
1152 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1154 $tpl_menu->setCurrentBlock(
"edit_page");
1156 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
1157 "&obj_id=".$page_id.
"&to_page=1");
1158 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
1159 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
1160 $tpl_menu->parseCurrentBlock();
1165 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1167 $page_id.
"_".$this->lm->getRefId(),
1171 $title = $this->lm->getTitle();
1173 $this->lm->getPageHeader(), $this->lm->isActiveNumbering());
1174 if ($pg_title !=
"")
1176 $title.=
": ".$pg_title;
1181 $tpl_menu->setCurrentBlock(
"perma_link");
1182 $tpl_menu->setVariable(
"PERMA_LINK", $plinkgui->getHTML());
1183 $tpl_menu->parseCurrentBlock();
1187 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1199 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1212 $next_class = $this->ctrl->getNextClass($this);
1214 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1222 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1227 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1228 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1230 $notes_gui->enablePrivateNotes();
1231 if ($this->lm->publicNotes())
1233 $notes_gui->enablePublicNotes();
1236 if ($next_class ==
"ilnotegui")
1238 $html = $this->ctrl->forwardCommand($notes_gui);
1242 $html = $notes_gui->getNotesHTML();
1244 $this->tpl->setVariable(
"NOTES", $html);
1253 global $ilLocator, $tree;
1255 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1257 if (empty(
$_GET[
"obj_id"]))
1259 $a_id = $this->lm_tree->getRootId();
1263 $a_id =
$_GET[
"obj_id"];
1266 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1268 if (!$this->lm->cleanFrames())
1270 $frame_param =
$_GET[
"frame"];
1281 $frame_target =
"_top";
1286 $ilLocator->addItem(
"...",
"");
1288 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1289 $ilLocator->addItem(
1291 "repository.php?cmd=frameset&ref_id=".$par_id,
1296 $ilLocator->setOffline(
true);
1299 if($this->lm_tree->isInTree($a_id))
1301 $path = $this->lm_tree->getPathFull($a_id);
1305 if (
$row[
"type"] !=
"pg")
1307 if(
$row[
"child"] != $this->lm_tree->getRootId())
1309 $ilLocator->addItem(
1312 $this->lm->isActiveNumbering()),50,
true),
1313 $this->
getLink(
$_GET[
"ref_id"],
"layout",
$row[
"child"], $frame_param,
"StructureObject"),
1318 $ilLocator->addItem(
1320 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1321 $frame_target,
$_GET[
"ref_id"]);
1329 $ilLocator->addItem(
1330 $this->lm->getTitle(),
1333 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1336 $ilLocator->addItem(
1337 $lm_obj->getTitle(),
1338 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1344 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1350 $this->tpl->setLocator();
1357 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1359 $this->chapter_has_no_active_page =
false;
1360 $this->deactivated_page =
false;
1363 if(empty(
$_GET[
"obj_id"]))
1365 $obj_id = $this->lm_tree->getRootId();
1369 $obj_id =
$_GET[
"obj_id"];
1371 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1376 $this->deactivated_page =
true;
1381 if (!$this->lm_tree->isInTree($obj_id))
1386 $curr_node = $this->lm_tree->getNodeData($obj_id);
1389 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1391 if ($curr_node[
"type"] ==
"pg" &&
1394 $page_id = $curr_node[
"obj_id"];
1401 while($succ_node && !$active)
1403 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1404 $page_id = $succ_node[
"obj_id"];
1406 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1409 if ($succ_node[
"type"] !=
"pg")
1411 $this->chapter_has_no_active_page =
true;
1413 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1414 $this->ilias->raiseError($this->lng->txt(
"cont_no_page"),$this->ilias->error_obj->FATAL);
1421 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1425 while ($public ===
false && $page_id > 0)
1427 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1428 $page_id = $succ_node[
'obj_id'];
1434 if ($this->lm_tree->isInTree($page_id))
1436 $path = $this->lm_tree->getPathId($page_id);
1439 $this->chapter_has_no_active_page =
true;
1449 $subtree = $this->lm_tree->getSubTree($this->lm_tree->getNodeData(1));
1450 $node = $this->lm_tree->getNodeData($current_page_id);
1451 $pos = array_search($node,$subtree);
1453 $this->tr_obj =& $this->ilias->obj_factory->getInstanceByRefId(
$_SESSION[
"tr_id"]);
1455 $lmtree =
new ilTree($this->tr_obj->getId());
1457 $lmtree->setTreeTablePK(
"lm_id");
1459 $subtree = $lmtree->getSubTree($lmtree->getNodeData(1));
1461 return $subtree[
$pos][
"child"];
1468 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1469 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1475 $this->tpl->setVariable(
"TRANSLATION_CONTENT",
"NO TRNSLATION FOUND");
1479 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1480 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1483 $this->ilias->account->setDesktopItemParameters(
$_SESSION[
"tr_id"], $this->lm->getType(),$page_id);
1486 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1494 $lm_pg_obj->setLMId(
$_SESSION[
"tr_id"]);
1496 #$page_object_gui->setLayoutLinkTargets($targets);
1499 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1503 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1504 $page_object_gui->setOutputMode(
"presentation");
1505 $page_object_gui->setOutputSubmode(
"translation");
1507 $page_object_gui->setPresentationTitle(
1509 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1510 $this->lm_set->get(
"time_scheduled_page_activation")));
1511 # $page_object_gui->setLinkParams("ref_id=".$this->lm->getRefId());
1512 $page_object_gui->setLinkParams(
"ref_id=".
$_SESSION[
"tr_id"]);
1513 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1514 $page_object_gui->setTemplateOutputVar(
"TRANSLATION_CONTENT");
1517 return $page_object_gui->presentation();
1524 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1526 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1528 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1530 $this->pg_obj =&
new ilPageObject($this->lm->getType(),$page_id);
1532 $this->lm_gui->showCitation($xml);
1540 if (!is_object($this->layout_doc))
1545 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1548 for ($i = 0; $i < count(
$res->nodeset); $i++)
1550 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1551 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1552 $onclick =
$res->nodeset[$i]->get_attribute(
"OnClick");
1553 $targets[
$type] = array(
"Type" =>
$type,
"Frame" => $frame,
"OnClick" => $onclick);
1565 function ilPage(&$a_page_node, $a_page_id = 0)
1570 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1583 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
1584 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1587 if ($a_page_id == 0)
1595 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
1598 $search_string = $cache->getQuery();
1600 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
1601 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
1605 $words = $p->getQuotedWords();
1606 if (is_array($words))
1608 foreach ($words as $w)
1614 $this->fill_on_load_code =
true;
1619 $page_id = $a_page_id;
1623 $this->tpl->setCurrentBlock(
"ContentStyle");
1626 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1631 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1633 $this->tpl->parseCurrentBlock();
1636 if ($this->chapter_has_no_active_page &&
1639 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1640 "Modules/LearningModule");
1641 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1644 $mtpl->setVariable(
"ITEM_TITLE",
1646 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1647 return $mtpl->get();
1651 if ($this->deactivated_page)
1653 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1654 "Modules/LearningModule");
1655 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_page_currently_deactivated"));
1658 $mtpl->setVariable(
"ITEM_TITLE",
1660 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1661 return $mtpl->get();
1667 $cont = $this->lng->txt(
"cont_no_page");
1668 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1672 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
1674 $page_object->registerOfflineHandler($this);
1676 $int_links = $page_object->getInternalLinks();
1678 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
1681 $page_object_gui->setTemplateOutput(
false);
1684 $this->ilias->account->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1687 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1696 $lm_pg_obj->setLMId($this->lm->getId());
1698 $page_object_gui->setLinkXML($link_xml);
1702 $page_object_gui->setBibId(
$_SESSION[
"bib_id"]);
1703 $page_object_gui->enableCitation((
bool)
$_SESSION[
"citation"]);
1707 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1710 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1711 $page_id != $this->lm->getFooterPage()))
1713 $page_object_gui->setPresentationTitle(
1715 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1716 $this->lm_set->get(
"time_scheduled_page_activation")));
1719 include_once
"Services/Tracking/classes/class.ilTracking.php";
1721 $page_id,
"pg",
"read");
1724 if ($ilUser->getId() != ANONYMOUS_USER_ID)
1726 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1732 $page_object_gui->setEnabledPageFocus(
false);
1733 $page_object_gui->setEnabledSelfAssessment(
false);
1737 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1738 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1741 if($_SESSION[
"tr_id"])
1743 $page_object_gui->setOutputSubmode(
"translation");
1747 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1750 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1755 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1756 "syntaxhighlight.css");
1758 $this->tpl->parseCurrentBlock();
1761 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1764 if ($this->lm->getHeaderPage() > 0 &&
1765 $page_id != $this->lm->getHeaderPage() &&
1766 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1770 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1775 if ($this->lm->getFooterPage() > 0 &&
1776 $page_id != $this->lm->getFooterPage() &&
1777 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1781 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1784 $this->tpl->setVariable(
"PAGE_CONTENT", $head.$ret.$foot);
1786 return $head.$ret.$foot;
1798 $a_page_gui->setEnabledSelfAssessment(
true,
false);
1799 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1801 $this->lm->getStyleSheetId(),
"lm"));
1804 $a_page_gui->setOutputMode(
"presentation");
1805 $this->fill_on_load_code =
true;
1809 $a_page_gui->setOutputMode(
"offline");
1812 $a_page_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1813 $a_page_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1824 $ilBench->start(
"ContentPresentation",
"showPagePreconditions");
1831 $this->tpl->setCurrentBlock(
"ContentStyle");
1834 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1839 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1841 $this->tpl->parseCurrentBlock();
1843 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
1846 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
1847 foreach($conds as $cond)
1851 $this->tpl->setCurrentBlock(
"condition");
1852 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
1854 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
1855 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
1856 if ($cond[
"operator"] ==
"passed")
1858 $cond_str = $this->lng->txt(
"passed");
1862 $cond_str = $cond[
"operator"];
1864 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
1865 $this->tpl->parseCurrentBlock();
1867 $this->tpl->setCurrentBlock(
"pg_content");
1869 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
1870 sprintf($this->lng->txt(
"cont_missing_preconditions"),
1872 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
1873 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
1876 $parent = $this->lm_tree->getParentId($topchap);
1877 $childs = $this->lm_tree->getChildsByType($parent,
"st");
1880 foreach($childs as $child)
1882 if ($child[
"child"] == $topchap)
1888 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
1891 if($succ_node !=
"")
1893 $framestr = (!empty(
$_GET[
"frame"]))
1894 ?
"frame=".
$_GET[
"frame"].
"&"
1897 $showViewInFrameset =
true;
1898 $link =
"<br /><a href=\"".
1899 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
1900 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
1901 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
1904 $this->tpl->parseCurrentBlock();
1906 $ilBench->stop(
"ContentPresentation",
"showPagePreconditions");
1919 $showViewInFrameset =
true;
1921 if ($a_layoutframes ==
"")
1923 $a_layoutframes = array();
1925 $link_info =
"<IntLinkInfos>";
1926 foreach ($a_int_links as $int_link)
1928 $target = $int_link[
"Target"];
1929 if (substr($target, 0, 4) ==
"il__")
1933 $type = $int_link[
"Type"];
1934 $targetframe = ($int_link[
"TargetFrame"] !=
"")
1935 ? $int_link[
"TargetFrame"]
1939 $anc = $anc_add =
"";
1940 if ($int_link[
"Anchor"] !=
"")
1942 $anc = $int_link[
"Anchor"];
1943 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
1949 case "StructureObject":
1951 if ($lm_id == $this->lm->getId() ||
1952 ($targetframe !=
"None" && $targetframe !=
"New"))
1954 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1958 $nframe = ($ltarget ==
"")
1963 if ($showViewInFrameset) {
1984 if (
$type ==
"PageObject")
1986 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
1990 $href =
"./goto.php?target=st_".$target_id;
1995 if (
$type ==
"PageObject")
1997 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.$anc_add.
"&client_id=".CLIENT_ID;
2001 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
2008 case "GlossaryItem":
2009 if ($targetframe ==
"None")
2011 $targetframe =
"Glossary";
2013 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2014 $nframe = ($ltarget ==
"")
2022 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
2023 $nframe = ($ltarget ==
"")
2030 case "RepositoryItem":
2035 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
2039 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
2047 $ilCtrl->setParameter($this,
"file_id",
"il__file_".
$target_id);
2048 $href = $ilCtrl->getLinkTarget($this,
"downloadFile");
2049 $ilCtrl->setParameter($this,
"file_id",
"");
2054 $anc_par =
'Anchor="'.$anc.
'"';
2056 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
2057 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
2068 $link_info.=
"</IntLinkInfos>";
2077 $link_info =
"<LinkTargets>";
2080 $link_info.=
"<LinkTarget TargetFrame=\"".$t[
"Type"].
"\" LinkTarget=\"".
$t[
"Frame"].
"\" OnClick=\"".
$t[
"OnClick"].
"\" />";
2082 $link_info.=
"</LinkTargets>";
2093 $ilBench->start(
"ContentPresentation",
"ilGlossary");
2095 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
2099 $this->tpl->setCurrentBlock(
"ContentStyle");
2102 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2107 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2109 $this->tpl->parseCurrentBlock();
2112 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2116 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2121 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
2122 "syntaxhighlight.css");
2124 $this->tpl->parseCurrentBlock();
2126 $int_links = $term_gui->getInternalLinks();
2128 $term_gui->setLinkXML($link_xml);
2133 $ilCtrl->setParameter($this,
"pg_type",
"glo");
2138 $ilCtrl->setParameter($this,
"pg_type",
"");
2143 $ilBench->stop(
"ContentPresentation",
"ilGlossary");
2153 $ilBench->start(
"ContentPresentation",
"ilMedia");
2155 $this->tpl->setCurrentBlock(
"ContentStyle");
2158 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2163 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2165 $this->tpl->parseCurrentBlock();
2167 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2176 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2177 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2180 $this->tpl->setCurrentBlock(
"ilMedia");
2186 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2188 if (!empty (
$_GET[
"pg_id"]))
2190 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
2197 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2218 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2219 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2234 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2239 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2240 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2241 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2242 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2243 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2248 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2250 $ilBench->stop(
"ContentPresentation",
"ilMedia");
2258 if ($a_inline !=
"")
2260 $js_tpl =
new ilTemplate($a_inline,
true,
false, $a_location);
2261 $js = $js_tpl->get();
2262 $this->tpl->setVariable(
"INLINE_JS", $js);
2274 $ilBench->start(
"ContentPresentation",
"ilLMNavigation");
2275 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2277 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2287 if(!$this->lm_tree->isInTree($page_id))
2293 $limpos = strpos(
$_GET[
"back_pg"],
":");
2296 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2300 $back_pg =
$_GET[
"back_pg"];
2302 if (!$this->lm->cleanFrames())
2305 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2312 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2314 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2318 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2319 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2320 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2321 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2322 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2323 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2324 $this->tpl->setVariable(
"PREV_ACC_KEY",
2326 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2327 ?
"images/spacer.gif"
2329 $this->tpl->parseCurrentBlock();
2330 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2331 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2332 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2333 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2334 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2335 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2336 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2337 ?
"images/spacer.gif"
2339 $this->tpl->parseCurrentBlock();
2344 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2348 if ($this->chapter_has_no_active_page &&
2351 $c_id =
$_GET[
"obj_id"];
2359 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2360 $c_id = $succ_node[
"obj_id"];
2363 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2365 if ($succ_node[
"obj_id"] > 0 &&
2367 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2372 else if ($succ_node[
"obj_id"] > 0 && !$active)
2381 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchSuccessor");
2383 $succ_str = ($succ_node !==
false)
2384 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2388 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2393 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2394 $c_id = $pre_node[
"obj_id"];
2396 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2397 if ($pre_node[
"obj_id"] > 0 &&
2399 ($this->lm->getPublicAccessMode() ==
"selected" &&
2404 else if ($pre_node[
"obj_id"] > 0 && !$active)
2414 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_fetchPredecessor");
2416 $pre_str = ($pre_node !==
false)
2417 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2421 $framestr = (!empty(
$_GET[
"frame"]))
2422 ?
"frame=".
$_GET[
"frame"].
"&"
2429 $showViewInFrameset =
true;
2433 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2442 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2444 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2445 $this->lm_set->get(
"time_scheduled_page_activation"));
2450 if (!$this->lm->cleanFrames())
2453 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2456 else if ($showViewInFrameset && !$this->
offlineMode())
2459 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2460 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2465 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2466 $prev_target =
'target="_top" ';
2472 $output = $this->lng->txt(
"msg_page_not_public");
2475 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2477 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2478 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2479 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2480 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2481 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2482 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2483 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2484 ?
"images/spacer.gif"
2486 $this->tpl->setVariable(
"PREV_ACC_KEY",
2488 $this->tpl->parseCurrentBlock();
2489 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2490 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2491 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2492 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2493 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2494 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2495 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2496 ?
"images/spacer.gif"
2498 $this->tpl->parseCurrentBlock();
2499 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputPredecessor");
2501 if($succ_node !=
"")
2503 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2506 $ilBench->start(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2508 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2509 $this->lm_set->get(
"time_scheduled_page_activation"));
2513 if (!$this->lm->cleanFrames())
2516 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2519 else if ($showViewInFrameset && !$this->
offlineMode())
2522 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2523 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2528 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2529 $succ_target =
' target="_top" ';
2535 $output = $this->lng->txt(
"msg_page_not_public");
2538 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_getPresentationTitle");
2540 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2541 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2542 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2543 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2544 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2545 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2546 $this->tpl->setVariable(
"SPACER_SUCC", $this->
offlineMode()
2547 ?
"images/spacer.gif"
2549 $this->tpl->setVariable(
"NEXT_ACC_KEY",
2551 $this->tpl->parseCurrentBlock();
2552 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2553 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2554 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2555 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2556 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2557 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2558 $this->tpl->setVariable(
"SPACER_SUCC2", $this->
offlineMode()
2559 ?
"images/spacer.gif"
2561 $this->tpl->parseCurrentBlock();
2562 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation_outputSuccessor");
2565 $ilBench->stop(
"ContentPresentation",
"ilLMNavigation");
2571 $child_nodes = $a_node->child_nodes();
2572 foreach ($child_nodes as $child)
2574 if($child->node_name() ==
"ilFrame")
2576 $attributes = $this->
attrib2arr($child->attributes());
2578 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2582 if(!empty($attributes[
"name"]))
2584 unset($attributes[
"template"]);
2585 unset($attributes[
"template_location"]);
2586 $attributes[
"src"] =
2587 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2588 "",
"keep",
"",
$_GET[
"srcstring"]);
2589 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2590 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2591 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2596 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2598 $a_content .= $this->
buildTag(
"end",
"frameset");
2603 unset($attributes[
"template"]);
2604 unset($attributes[
"template_location"]);
2605 $attributes[
"src"] =
2606 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2607 "",
"keep",
"",
$_GET[
"srcstring"]);
2608 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2609 if ($attributes[
"name"] ==
"toc")
2611 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2616 if (
$_GET[
"anchor"] !=
"")
2618 $attributes[
"src"].=
"#".rawurlencode(
$_GET[
"anchor"]);
2621 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2622 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2644 if (is_array($attr))
2646 while (list($k,$v) = each($attr))
2647 $tag.=
" ".$k.
"=\"$v\"";
2666 $ilBench->start(
"ContentPresentation",
"TableOfContents");
2669 $this->tpl->setCurrentBlock(
"ContentStyle");
2672 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2677 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2679 $this->tpl->parseCurrentBlock();
2681 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2690 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2691 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2695 $this->tpl->getStandardTemplate();
2698 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2701 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
"Modules/LearningModule");
2704 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2705 $this->tpl->setTitle($this->lm->getTitle());
2719 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2721 $this->
getLink($this->lm->getRefId(),
""),
2724 $exp->setTargetGet(
"obj_id");
2726 $exp->forceExpandAll(
true,
false);
2734 if ($this->chapter_has_no_active_page &&
2737 $exp->highlightNode(
$_GET[
"obj_id"]);
2741 $exp->highlightNode($page_id);
2745 $tree =& $this->lm->getTree();
2746 if (
$_GET[
"lmtocexpand"] ==
"")
2748 $expanded = $tree->readRootId();
2752 $expanded =
$_GET[
"lmtocexpand"];
2755 $exp->setExpand($expanded);
2759 $output = $exp->getOutput();
2761 $this->tpl->setVariable(
"EXPLORER", $output);
2762 $this->tpl->parseCurrentBlock();
2766 return $this->tpl->get();
2773 $ilBench->stop(
"ContentPresentation",
"TableOfContents");
2784 $this->ctrl->setCmd(
"showSummary");
2785 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2802 global
$ilBench, $ilLocator, $ilAccess;
2804 $this->tpl->setHeaderPageTitle(
"PAGETITLE",
" - ".$this->lm->getTitle());
2813 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
2814 $this->tpl->setStyleSheetLocation(
"./".$style_name);
2817 $this->tpl->getStandardTemplate();
2818 $this->tpl->setTitle($this->lm->getTitle());
2821 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2825 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2831 $ilLocator->addRepositoryItems();
2832 $this->tpl->setLocator();
2835 $this->lng->loadLanguageModule(
"meta");
2837 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2840 $info->enablePrivateNotes();
2841 $info->enableLearningProgress();
2843 $info->enableNews();
2844 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2847 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
2849 $info->enableNewsEditing();
2851 if ($enable_internal_rss)
2853 $info->setBlockProperty(
"news",
"settings",
true);
2875 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
2879 $this->tpl->setContent($info->getHTML());
2880 return $this->tpl->get();
2885 $this->ctrl->forwardCommand($info);
2896 global $ilUser,
$lng;
2898 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2899 if (!$this->lm->isActivePrintView())
2904 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2907 $this->tpl->setCurrentBlock(
"ContentStyle");
2910 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2915 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2917 $this->tpl->parseCurrentBlock();
2919 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
2921 $this->tpl->getStandardTemplate();
2923 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2927 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
2928 "tpl.lm_print_selection.html",
"Modules/LearningModule");
2931 $this->tpl->setTitle($this->lm->getTitle());
2939 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
2940 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
2942 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2944 if (!is_array(
$_POST[
"item"]))
2946 if (
$_GET[
"obj_id"] !=
"")
2958 foreach ($nodes as $node)
2963 $this->lm_set->get(
"time_scheduled_page_activation"));
2965 if ($node[
"type"] ==
"pg" &&
2971 $text = $img_scr = $img_alt =
"";
2975 switch ($node[
"type"])
2981 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2982 $this->lm_set->get(
"time_scheduled_page_activation"));
2985 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2990 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
2994 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"pg");
2999 $text = $this->lm->getTitle();
3001 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"obj_lm");
3008 $this->lm->isActiveNumbering());
3010 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3015 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3019 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"st");
3025 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3028 $this->nl->addListNode($node[
"obj_id"], $text, $node[
"parent"], $checked, $disabled,
3029 $img_src, $img_alt);
3034 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
3038 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3039 $this->lm_set->get(
"time_scheduled_page_activation"));
3042 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3047 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
3051 $id =
$_GET[
"obj_id"];
3055 $this->nl->addListNode($id, $text, 0, $checked, $disabled,
3056 $img_src, $img_alt);
3059 $f = $this->form->getHTML();
3063 $tb->addFormButton($lng->txt(
"cont_show_print_view"),
"showPrintView");
3064 $this->tpl->setVariable(
"TOOLBAR", $tb->getHTML());
3066 $this->tpl->setVariable(
"ITEM_SELECTION",
$f);
3078 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3084 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
3085 $radg->addOption($op1);
3086 $op2 =
new ilRadioOption($lng->txt(
"cont_current_chapter"),
"chapter");
3087 $radg->addOption($op2);
3088 $op3=
new ilRadioOption($lng->txt(
"cont_selected_pg_chap"),
"selection");
3089 $radg->addOption($op3);
3091 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
3094 $op3->addSubItem($nl);
3097 $this->form->addItem($radg);
3099 $this->form->addCommandButton(
"showPrintView", $lng->txt(
"cont_show_print_view"));
3100 $this->form->setOpenTag(
false);
3101 $this->form->setCloseTag(
false);
3103 $this->form->setTitle($lng->txt(
"cont_print_selection"));
3104 $this->form->setFormAction($ilCtrl->getFormAction($this));
3114 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
3116 if (!$this->lm->isActivePrintView())
3121 $ilBench->start(
"ContentPresentation",
"PrintView");
3123 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
3127 if (
$_POST[
"sel_type"] ==
"page")
3129 if (!is_array(
$_POST[
"obj_id"]) || !in_array($c_obj_id,
$_POST[
"obj_id"]))
3131 $_POST[
"obj_id"][] = $c_obj_id;
3134 if (
$_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
3137 $path = $this->lm_tree->getPathFull($c_obj_id);
3138 $chap_id =
$path[1][
"child"];
3141 $_POST[
"obj_id"][] = $chap_id;
3154 $style_name = $this->ilias->account->prefs[
"style"].
".css";;
3155 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
3159 $this->tpl->setCurrentBlock(
"ContentStyle");
3162 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3167 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3169 $this->tpl->parseCurrentBlock();
3172 $this->tpl->setCurrentBlock(
"SyntaxStyle");
3173 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
3175 $this->tpl->parseCurrentBlock();
3178 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
3181 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
3183 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3185 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
3186 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3187 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3192 $glossary_links = array();
3193 $output_header =
false;
3194 $media_links = array();
3197 if ($this->lm->getFooterPage() > 0)
3202 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getFooterPage());
3203 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3205 $this->lm->getStyleSheetId(),
"lm"));
3209 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3210 $page_object_gui->setOutputMode(
"print");
3211 $page_object_gui->setPresentationTitle(
"");
3212 $page_object_gui->setFileDownloadLink(
"#");
3213 $page_object_gui->setFullscreenLink(
"#");
3214 $page_object_gui->setSourceCodeDownloadScript(
"#");
3215 $footer_page_content = $page_object_gui->showPage();
3218 if ($this->lm->getHeaderPage() > 0)
3223 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $this->lm->getHeaderPage());
3224 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3226 $this->lm->getStyleSheetId(),
"lm"));
3230 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3231 $page_object_gui->setOutputMode(
"print");
3232 $page_object_gui->setPresentationTitle(
"");
3233 $page_object_gui->setFileDownloadLink(
"#");
3234 $page_object_gui->setFullscreenLink(
"#");
3235 $page_object_gui->setSourceCodeDownloadScript(
"#");
3236 $header_page_content = $page_object_gui->showPage();
3241 if (is_array(
$_POST[
"obj_id"]))
3243 foreach(
$_POST[
"obj_id"] as $k)
3245 if ($k > 0 && !$this->lm_tree->isInTree($k))
3249 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
3257 $ilCtrl->redirect($this,
"showPrintViewSelection");
3260 foreach ($nodes as $node_key => $node)
3264 $this->lm_set->get(
"time_scheduled_page_activation"));
3265 if ($node[
"type"] ==
"pg" && !$active)
3272 if ($node[
"depth"] <= $act_level)
3274 if (is_array(
$_POST[
"obj_id"]) && in_array($node[
"obj_id"],
$_POST[
"obj_id"]))
3276 $act_level = $node[
"depth"];
3290 if ($node[
"type"] ==
"du")
3292 $output_header =
true;
3296 if ($node[
"type"] ==
"st")
3299 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3308 $this->tpl->setCurrentBlock(
"print_chapter");
3310 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3311 $this->lm->isActiveNumbering());
3312 $this->tpl->setVariable(
"CHAP_TITLE",
3317 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3319 $this->tpl->setVariable(
"CHAP_HEADER",
3320 $header_page_content);
3321 $did_chap_page_header =
true;
3325 $this->tpl->parseCurrentBlock();
3326 $this->tpl->setCurrentBlock(
"print_block");
3327 $this->tpl->parseCurrentBlock();
3331 if ($node[
"type"] ==
"pg")
3334 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3342 $this->tpl->setCurrentBlock(
"print_item");
3345 $page_id = $node[
"obj_id"];
3346 $page_object =&
new ilPageObject($this->lm->getType(), $page_id);
3347 $page_object_gui =&
new ilPageObjectGUI($this->lm->getType(), $page_id);
3348 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3350 $this->lm->getStyleSheetId(),
"lm"));
3355 $lm_pg_obj->setLMId($this->lm->getId());
3358 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3359 $page_object_gui->setOutputMode(
"print");
3360 $page_object_gui->setPresentationTitle(
"");
3362 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3365 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3366 $this->lm_set->get(
"time_scheduled_page_activation"));
3370 if ($this->lm->isActiveNumbering())
3372 $chapter_title = trim(substr($chapter_title,
3373 strpos($chapter_title,
" ")));
3376 if ($page_title != $chapter_title)
3378 $page_object_gui->setPresentationTitle($page_title);
3383 $hcont = $header_page_content;
3384 $fcont = $footer_page_content;
3388 if ($did_chap_page_header)
3392 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3393 !($nodes[$node_key + 1][
"depth"] <= $act_level
3394 && !in_array($nodes[$node_key + 1][
"obj_id"],
$_POST[
"obj_id"])))
3400 $page_object_gui->setFileDownloadLink(
"#");
3401 $page_object_gui->setFullscreenLink(
"#");
3402 $page_object_gui->setSourceCodeDownloadScript(
"#");
3403 $page_object_gui->setEnabledSelfAssessment(
true);
3404 $page_content = $page_object_gui->showPage();
3407 $this->tpl->setVariable(
"CONTENT",
3408 $hcont.$page_content.$fcont);
3412 $this->tpl->setVariable(
"CONTENT",
3413 $hcont.$page_content.$fcont.
"<br />");
3415 $chapter_title =
"";
3416 $this->tpl->parseCurrentBlock();
3417 $this->tpl->setCurrentBlock(
"print_block");
3418 $this->tpl->parseCurrentBlock();
3425 foreach ($int_links as $key => $link)
3427 if ($link[
"type"] ==
"git" &&
3428 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3430 $glossary_links[$key] = $link;
3432 if ($link[
"type"] ==
"mob" &&
3433 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3436 $mob_links[$key] = $link;
3447 $page_object->buildDom();
3448 $links = $page_object->getInternalLinks();
3449 foreach($links as $link)
3451 if ($link[
"Type"] ==
"MediaObject"
3452 && $link[
"TargetFrame"] !=
""
3453 && $link[
"TargetFrame"] !=
"None")
3455 $media_links[] = $link;
3467 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3469 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3470 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3475 foreach($glossary_links as $key => $link)
3478 $terms[$term.
":".$key] = array(
"key" => $key,
"link" => $link,
"term" => $term);
3483 foreach($terms as
$t)
3491 foreach($defs as $def)
3494 if (count($defs) > 1)
3496 $this->tpl->setCurrentBlock(
"def_title");
3497 $this->tpl->setVariable(
"TXT_DEFINITION",
3498 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3499 $this->tpl->parseCurrentBlock();
3503 $page_gui->setTemplateOutput(
false);
3504 $page_gui->setOutputMode(
"print");
3506 $this->tpl->setCurrentBlock(
"definition");
3507 $page_gui->setFileDownloadLink(
"#");
3508 $page_gui->setFullscreenLink(
"#");
3509 $page_gui->setSourceCodeDownloadScript(
"#");
3510 $output = $page_gui->showPage();
3511 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3512 $this->tpl->parseCurrentBlock();
3516 $this->tpl->setCurrentBlock(
"term");
3517 $this->tpl->setVariable(
"VAL_TERM",
3519 $this->tpl->parseCurrentBlock();
3524 $this->tpl->setCurrentBlock(
"glossary");
3525 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3526 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3527 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3528 $this->tpl->parseCurrentBlock();
3530 $annexes[] = $annex_title;
3534 if (count($media_links) > 0)
3536 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3537 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3539 foreach($media_links as $media)
3541 if (substr($media[
"Target"],0,4) ==
"il__")
3543 $arr = explode(
"_",$media[
"Target"]);
3544 $id = $arr[count($arr) - 1];
3547 $med_item =& $med_obj->getMediaItem(
"Standard");
3548 if (is_object($med_item))
3550 if (is_int(strpos($med_item->getFormat(),
"image")))
3552 $this->tpl->setCurrentBlock(
"ref_image");
3555 if ($med_item->getLocationType() ==
"LocalFile")
3557 $this->tpl->setVariable(
"IMG_SOURCE",
3559 "/".$med_item->getLocation());
3563 $this->tpl->setVariable(
"IMG_SOURCE",
3564 $med_item->getLocation());
3567 if ($med_item->getCaption() !=
"")
3569 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3573 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3575 $this->tpl->parseCurrentBlock();
3583 $this->tpl->setCurrentBlock(
"ref_images");
3584 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3585 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3586 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3587 $this->tpl->parseCurrentBlock();
3589 $annexes[] = $annex_title;
3595 $this->tpl->setCurrentBlock(
"print_header");
3596 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3597 if ($this->lm->getDescription() !=
"none")
3599 include_once(
"Services/MetaData/classes/class.ilMD.php");
3600 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3602 foreach($md_gen->getDescriptionIds() as $id)
3604 $md_des = $md_gen->getDescription($id);
3605 $description = $md_des->getDescription();
3608 $this->tpl->setVariable(
"LM_DESCRIPTION",
3611 $this->tpl->parseCurrentBlock();
3615 foreach ($nodes2 as $node2)
3617 if ($node2[
"type"] ==
"st"
3620 for ($j=1; $j < $node2[
"depth"]; $j++)
3622 $this->tpl->setCurrentBlock(
"indent");
3624 $this->tpl->parseCurrentBlock();
3626 $this->tpl->setCurrentBlock(
"toc_entry");
3627 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3629 $this->lm->isActiveNumbering()));
3630 $this->tpl->parseCurrentBlock();
3635 foreach ($annexes as $annex)
3637 $this->tpl->setCurrentBlock(
"indent");
3639 $this->tpl->parseCurrentBlock();
3640 $this->tpl->setCurrentBlock(
"toc_entry");
3641 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3642 $this->tpl->parseCurrentBlock();
3645 $this->tpl->setCurrentBlock(
"toc");
3646 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3647 $this->tpl->parseCurrentBlock();
3649 $this->tpl->setCurrentBlock(
"print_start_block");
3650 $this->tpl->parseCurrentBlock();
3654 include_once
'Services/MetaData/classes/class.ilMD.php';
3655 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3656 if(is_object($lifecycle = $md->getLifecycle()))
3658 $sep = $author =
"";
3659 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3661 $md_con = $lifecycle->getContribute($con_id);
3662 if ($md_con->getRole() ==
"Author")
3664 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3666 $md_ent = $md_con->getEntity($ent_id);
3667 $author = $author.$sep.$md_ent->getEntity();
3674 $this->lng->loadLanguageModule(
"meta");
3675 $this->tpl->setCurrentBlock(
"author");
3676 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3677 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3678 $this->tpl->parseCurrentBlock();
3684 if (is_object($md_rights = $md->getRights()))
3686 $copyright = $md_rights->getDescription();
3687 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3690 if ($copyright !=
"")
3692 $this->lng->loadLanguageModule(
"meta");
3693 $this->tpl->setCurrentBlock(
"copyright");
3694 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3695 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3696 $this->tpl->parseCurrentBlock();
3700 $this->tpl->show(
false);
3702 $ilBench->stop(
"ContentPresentation",
"PrintView");
3708 if(
$_POST[
"action"] ==
"show" or
$_POST[
"action"] ==
"show_citation")
3710 if(
$_POST[
"action"] ==
"show_citation")
3713 if(count(
$_POST[
"target"]) != 1)
3717 $_POST[
"target"] = 0;
3726 if(isset(
$_POST[
"tr_id"]))
3734 if(is_array(
$_POST[
"target"]))
3753 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3754 $fileObj =&
new ilObjFile($file_id,
false);
3755 $fileObj->sendFile();
3764 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
3777 $this->tpl->setCurrentBlock(
"ContentStyle");
3780 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3785 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3787 $this->tpl->parseCurrentBlock();
3789 $this->tpl->setVariable(
"PAGETITLE",
" - ".$this->lm->getTitle());
3791 $this->tpl->getStandardTemplate();
3793 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3798 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
3801 $this->tpl->setTitle($this->lm->getTitle());
3811 include_once
'Services/MetaData/classes/class.ilMD.php';
3812 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3813 if (is_object($md_rights = $md->getRights()))
3815 $copyright = $md_rights->getDescription();
3817 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3820 if ($copyright !=
"")
3822 $this->lng->loadLanguageModule(
"meta");
3823 $this->tpl->setCurrentBlock(
"copyright");
3824 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3825 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3826 $this->tpl->parseCurrentBlock();
3831 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
3835 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
3838 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
3840 $export_files = array();
3841 $types = array(
"xml",
"html",
"scorm");
3842 foreach($types as
$type)
3844 if ($this->lm->getPublicExportFile($type) !=
"")
3846 if (is_file($this->lm->getExportDirectory($type).
"/".
3847 $this->lm->getPublicExportFile($type)))
3849 $dir = $this->lm->getExportDirectory($type);
3850 $size = filesize($this->lm->getExportDirectory($type).
"/".
3851 $this->lm->getPublicExportFile($type));
3852 $export_files[] = array(
"type" => $type,
3853 "file" => $this->lm->getPublicExportFile($type),
3861 $tbl->setTitle($this->lng->txt(
"download"));
3863 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
3864 $this->lng->txt(
"cont_file"),
3865 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
3868 $cols = array(
"format",
"file",
"size",
"date",
"download");
3869 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
3870 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
3871 $tbl->setHeaderVars($cols, $header_params);
3872 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
3873 $tbl->disable(
"sort");
3876 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3877 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3878 $tbl->setLimit(
$_GET[
"limit"]);
3879 $tbl->setOffset(
$_GET[
"offset"]);
3880 $tbl->setMaxCount($this->maxcount);
3886 $tbl->disable(
"footer");
3888 $tbl->setMaxCount(count($export_files));
3889 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3892 if(count($export_files) > 0)
3895 foreach($export_files as $exp_file)
3897 if (!$exp_file[
"size"] > 0)
3902 $this->tpl->setCurrentBlock(
"tbl_content");
3903 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
3906 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3908 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
3909 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
3910 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
3912 $file_arr = explode(
"__", $exp_file[
"file"]);
3913 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
3915 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
3916 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
3917 $this->tpl->setVariable(
"LINK_DOWNLOAD",
3918 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
3920 $this->tpl->parseCurrentBlock();
3925 $this->tpl->setCurrentBlock(
"notfound");
3926 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3927 $this->tpl->setVariable(
"NUM_COLS", 5);
3928 $this->tpl->parseCurrentBlock();
3940 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
3941 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
3943 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
3950 $this->ilias->raiseError($this->lng->txt(
"file_not_found"),$this->ilias->error_obj->MESSAGE);
3956 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
3957 $a_back_link =
"append", $a_anchor =
"", $a_srcstring =
"")
3968 $back_pg =
$_GET[
"back_pg"];
3969 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
3970 $a_back_link ==
"append")
3974 $back_pg = $cur_page_id.
":".$back_pg;
3978 $back_pg = $cur_page_id;
3983 if ($a_back_link ==
"reduce")
3985 $limpos = strpos(
$_GET[
"back_pg"],
":");
3989 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
3996 else if ($a_back_link !=
"keep")
4005 $this->ctrl->setParameter($this,
"from_page", $cur_page_id);
4007 if ($a_anchor !=
"")
4009 $this->ctrl->setParameter($this,
"anchor", rawurlencode($a_anchor));
4011 if ($a_srcstring !=
"")
4013 $this->ctrl->setParameter($this,
"srcstring", $a_srcstring);
4018 $link = $this->ctrl->getLinkTarget($this,
"fullscreen",
"",
false,
false);
4025 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
4029 $this->ctrl->setParameter($this,
"frame", $a_frame);
4031 if ($a_obj_id !=
"")
4036 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
4040 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
4041 $link.=
"&obj_id=".$a_obj_id;
4047 $this->ctrl->setParameter($this,
"obj_type", $a_type);
4049 $link = $this->ctrl->getLinkTarget($this, $a_cmd, $a_anchor);
4052 $this->ctrl->setParameter($this,
"frame",
"");
4053 $this->ctrl->setParameter($this,
"obj_id",
"");
4054 $this->ctrl->setParameter($this,
"mob_id",
"");
4062 case "downloadFile":
4066 $link =
"fullscreen.html";
4071 if ($a_obj_id ==
"")
4073 $a_obj_id = $this->lm_tree->getRootId();
4074 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4075 $a_obj_id = $pg_node[
"obj_id"];
4077 if ($a_type ==
"StructureObject")
4079 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
4080 $a_obj_id = $pg_node[
"obj_id"];
4082 if ($a_frame !=
"" && $a_frame !=
"_blank")
4084 if ($a_frame !=
"toc")
4086 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
4090 $link =
"frame_".$a_frame.
".html";
4097 $link =
"lm_pg_".$nid.
".html";
4101 $link =
"lm_pg_".$a_obj_id.
".html";
4107 $link =
"term_".$a_obj_id.
".html";
4111 $link =
"media_".$a_obj_id.
".html";
4119 $this->ctrl->clearParameters($this);
4131 $this->tpl->setCurrentBlock(
"ContentStyle");
4135 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
4140 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
4143 $this->tpl->parseCurrentBlock();
4144 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
4145 $this->tpl->setCurrentBlock(
"pg_content");
4146 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
4147 $this->tpl->parseCurrentBlock();
4154 $target = $this->ctrl->getLinkTarget($this,
"");
4156 return $this->ctrl->getLinkTarget($this,
"");
4172 $this->offline_directory = $offdir;
4194 if (!($fp = @fopen(
$file,
"w+")))
4196 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
4197 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");