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");
41 $lng->loadLanguageModule(
"content");
45 $this->offline =
false;
46 $this->frames = array();
48 $this->ctrl->saveParameter($this, array(
"ref_id",
"transl"));
51 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
53 $this->lm = $this->lm_gui->object;
56 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
61 if ($this->ot->getContentActivated())
63 $langs = $this->ot->getLanguages();
64 if (isset($langs[
$_GET[
"transl"]]) || $_GET[
"transl"] == $this->ot->getMasterLanguage())
66 $this->lang = $_GET[
"transl"];
68 else if (isset($langs[$ilUser->getCurrentLanguage()]))
70 $this->lang = $ilUser->getCurrentLanguage();
72 if ($this->lang == $this->ot->getMasterLanguage())
78 if(IS_PAYMENT_ENABLED)
80 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
83 else $this->needs_to_be_purchased =
false;
86 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
88 if (!$this->lm->getOnline())
90 $ilias->raiseError($lng->txt(
"permission_denied"),
$ilias->error_obj->WARNING);
94 include_once(
"./Modules/LearningModule/classes/class.ilLMTree.php");
110 if(IS_PAYMENT_ENABLED)
112 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
113 if($ilAccess->checkAccess(
'visible',
'',
$_GET[
'ref_id']) &&
116 if(!((
int)
$_GET[
'obj_id'] &&
118 ($this->ctrl->getCmd() ==
'layout' || $this->ctrl->getCmd() ==
'')))
121 unset(
$_GET[
'obj_id']);
123 $this->tpl->getStandardTemplate();
126 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
128 $ret = $this->ctrl->forwardCommand($pp);
136 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) &&
137 (!(($this->ctrl->getCmd() ==
"infoScreen" || $this->ctrl->getNextClass() ==
"ilinfoscreengui")
138 && $ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"]))))
140 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
143 $next_class = $this->ctrl->getNextClass($this);
144 $cmd = $this->ctrl->getCmd(
"layout", array(
"showPrintView"));
155 $obj_id =
$_GET[
"obj_id"];
156 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
157 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this),
"lm");
158 $this->ctrl->setParameter($this,
"obj_id", $obj_id);
166 case "ilinfoscreengui":
170 case "ilcommonactiondispatchergui":
171 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
173 $gui->enableCommentsSettings(
false);
174 $this->ctrl->forwardCommand($gui);
178 include_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
181 $ret = $ilCtrl->forwardCommand($page_gui);
184 case "ilglossarydefpagegui":
185 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
188 $ret = $ilCtrl->forwardCommand($page_gui);
191 case "illearningprogressgui":
193 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
195 $this->ctrl->forwardCommand($new_gui);
199 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
201 $rating_gui->setObject($this->lm->getId(),
"lm",
$_GET[
"obj_id"],
"lm");
202 $this->ctrl->forwardCommand($rating_gui);
217 $this->offline = $a_offline;
236 $this->export_format = $a_format;
246 return $this->export_format;
268 $q =
"DELETE FROM lo_access ".
269 "WHERE usr_id = ".$ilDB->quote((
int)
$usr_id,
"integer").
" ".
270 "AND lm_id = ".$ilDB->quote((
int) $lm_id,
"integer");
271 $ilDB->manipulate($q);
272 $title = (is_object($this->lm))?$this->lm->getTitle():
"- no title -";
275 $q =
"INSERT INTO lo_access ".
276 "(timestamp,usr_id,lm_id,obj_id,lm_title) ".
278 "(".$ilDB->now().
",".
279 $ilDB->quote((
int) $usr_id,
"integer").
",".
280 $ilDB->quote((
int) $lm_id,
"integer").
",".
281 $ilDB->quote((
int) $obj_id,
"integer").
",".
282 $ilDB->quote($title,
"text").
")";
283 $ilDB->manipulate($q);
296 switch($this->lm->getType())
299 $this->lm_gui->export();
319 $filename = preg_replace(
'/[^a-z0-9_]/i',
'_', $objRow[
"title"]);
321 $C = $this->lm_gui->showAbstract(array(1));
323 if (
$_GET[
"print"]==1)
325 $printTpl =
new ilTemplate(
"tpl.print.html",
true,
true,
"Modules/LearningModule");
326 $printTpl->touchBlock(
"printreq");
329 $printTpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", $css1 );
331 $printTpl->setVariable(
"LOCATION_STYLESHEET", $css2);
334 $printTpl->setCurrentBlock(
"SyntaxStyle");
335 $printTpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
337 $printTpl->parseCurrentBlock();
339 $printTpl->setVariable(
"CONTENT",$C);
341 echo $printTpl->get();
358 if(!is_array($a_attributes))
362 foreach ($a_attributes as $attribute)
364 $attr[$attribute->name()] = $attribute->value();
374 return $this->frames;
388 $layout = $this->lm->getLayout();
389 if ($this->lm->getLayoutPerPage())
392 if (!in_array(
$_GET[
"frame"], array(
"",
"_blank")) &&
$_GET[
"from_page"] > 0)
394 $pg_id = (int)
$_GET[
"from_page"];
398 if (in_array(
$_GET[
"cmd"], array(
"media",
"glossary")) &&
$_GET[
"back_pg"] > 0)
400 $pg_id = (int)
$_GET[
"back_pg"];
421 function layout($a_xml =
"main.xml", $doShow =
true)
430 $xmlfile = file_get_contents(
"./Modules/LearningModule/layouts/lm/".$layout.
"/".$a_xml);
434 include_once(
"./Modules/LearningModule/exceptions/class.ilLMPresentationException.php");
436 $layout.
"/".$a_xml.
".");
438 $this->layout_doc = $doc;
444 ?
"/ilLayout/ilFrame[1]"
445 :
"//ilFrame[@name='".$_GET[
"frame"].
"']";
448 if (count($found) != 1)
450 include_once(
"./Modules/LearningModule/exceptions/class.ilLMPresentationException.php");
452 " path ".
$path.
" in ".$layout.
"/".$a_xml.
". LM Layout is ".$this->lm->getLayout());
458 $attributes = $this->
attrib2arr($node->attributes());
460 $this->frames = array();
461 if((!empty($attributes[
"rows"])) || (!empty($attributes[
"cols"])))
463 $content .= $this->
buildTag(
"start",
"frameset", $attributes);
466 $content .= $this->
buildTag(
"end",
"frameset");
467 $this->tpl =
new ilTemplate(
"tpl.frameset.html",
true,
true,
"Modules/LearningModule");
469 $this->tpl->setVariable(
"FS_CONTENT", $content);
472 $content = $this->tpl->get();
479 if ((empty($attributes[
"template"]) || !empty(
$_GET[
"obj_type"]))
480 && (
$_GET[
"frame"] !=
"_blank" ||
$_GET[
"obj_type"] !=
"MediaObject"))
487 if(empty(
$_GET[
"obj_type"]))
489 $obj_type =
"PageObject";
493 $obj_type =
$_GET[
"obj_type"];
497 $childs = $node->child_nodes();
499 foreach($childs as $child)
501 if ($child->node_name() == $obj_type)
504 $attributes = $this->
attrib2arr($child->attributes());
510 if (!$found) { echo
"ilLMPresentation: No template specified for frame '".
511 $_GET[
"frame"].
"' and object type '".$obj_type.
"'.";
exit; }
515 $in_module = ($attributes[
"template_location"] ==
"module")
520 $this->tpl =
new ilTemplate($attributes[
"template"],
true,
true, $in_module);
521 $this->tpl->setBodyClass(
"");
535 $style_name = $ilUser->getPref(
"style").
".css";
536 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
539 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
547 $childs = $node->child_nodes();
549 foreach($childs as $child)
552 $child_attr = $this->
attrib2arr($child->attributes());
554 switch ($child->node_name())
562 $this->
ilTOC($child_attr[
"target_frame"]);
566 switch($this->lm->getType())
572 $content = $this->
ilPage($child);
581 case "ilLMNavigation":
594 $this->
ilJavaScript($child_attr[
"inline"], $child_attr[
"file"],
595 $child_attr[
"location"]);
626 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
631 $this->tpl->addJavascript(
"./Modules/LearningModule/js/LearningModule.js");
636 if (
$_GET[
"frame"] ==
"")
638 include_once(
"./Services/Authentication/classes/class.ilSessionIStorage.php");
640 $last_frame_url = $store->get(
"cf_".$this->lm->getId());
641 if ($last_frame_url !=
"")
643 $this->tpl->addOnLoadCode(
"il.LearningModule.setLastFrameUrl('".$last_frame_url.
"', 'center_bottom');");
646 if (in_array($layout, array(
"toc2windyn")))
648 $this->tpl->addOnLoadCode(
"il.LearningModule.setSaveUrl('".
649 $ilCtrl->getLinkTarget($this,
"saveFrameUrl",
"",
false,
false).
"');
650 il.LearningModule.openInitFrames();
657 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
658 $this->tpl->fillJavaScriptFiles();
659 $this->tpl->fillScreenReaderFocus();
661 $this->tpl->fillCssFiles();
666 $this->tpl->resetJavascript();
667 $this->tpl->resetCss();
669 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
672 if ($f[
"type"] ==
"js")
674 $this->tpl->addJavascript($f[
"target"]);
676 if ($f[
"type"] ==
"css")
678 $this->tpl->addCSS($f[
"target"]);
681 $this->tpl->fillJavaScriptFiles(
true);
682 $this->tpl->fillCssFiles(
true);
686 $this->tpl->fillBodyClass();
696 $this->tpl->fillTabs();
697 if ($this->fill_on_load_code)
699 $this->tpl->fillOnLoadCode();
701 $content = $this->tpl->get();
702 $content = str_replace(
"{",
"{", $content);
703 $content = str_replace(
"}",
"}", $content);
705 header(
'Content-type: text/html; charset=UTF-8');
710 $this->tpl->fillLeftNav();
711 $this->tpl->fillOnLoadCode();
712 $content = $this->tpl->get();
726 include_once(
"./Services/Authentication/classes/class.ilSessionIStorage.php");
728 if (
$_GET[
"url"] !=
"")
730 $store->set(
"cf_".$this->lm->getId(),
$_GET[
"url"]);
734 $store->set(
"cf_".$this->lm->getId(),
$_GET[
"url"]);
746 if (
$_GET[
"frame"] !=
"_blank")
760 if (
$_GET[
"frame"] !=
"_blank")
766 $this->tpl =
new ilTemplate(
"tpl.glossary_term_output.html",
true,
true,
true);
776 $style_name = $ilUser->getPref(
"style").
".css";;
777 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
787 return $this->tpl->get();
801 $this->tpl->touchBlock(
"pg_intro");
802 $this->tpl->touchBlock(
"pg_outro");
814 $ilMainMenu->setSmallMode(
false);
820 $ilMainMenu->setLoginTargetPar(
"pg_".$page_id.
"_".$this->lm->getRefId());
825 $this->tpl->touchBlock(
"pg_intro");
826 $this->tpl->touchBlock(
"pg_outro");
827 $this->tpl->setBodyClass(
"std");
828 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
836 include_once(
"./Modules/LearningModule/classes/class.ilLMTOCExplorerGUI.php");
838 if (!$exp->handleCommand())
842 if ($this->deactivated_page)
844 $page_id =
$_GET[
"obj_id"];
848 $exp->setPathOpen((
int) $page_id);
851 if ($this->chapter_has_no_active_page &&
854 $exp->setHighlightNode(
$_GET[
"obj_id"]);
858 if ($this->lm->getTOCMode() ==
"pages")
860 if ($this->deactivated_page)
862 $exp->setHighlightNode(
$_GET[
"obj_id"]);
866 $exp->setHighlightNode($page_id);
871 $exp->setHighlightNode($this->lm_tree->getParentId($page_id));
876 $exp->setOfflineMode(
true);
879 $this->tpl->setCurrentBlock(
"il_toc");
880 $this->tpl->setVariable(
"EXPLORER", $exp->getHTML());
881 $this->tpl->parseCurrentBlock();
890 $this->tpl->setVariable(
"MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
899 $this->tpl->setCurrentBlock(
"header_image");
902 $this->tpl->setVariable(
"IMG_HEADER",
"./images/icon_lm.png");
908 $this->tpl->parseCurrentBlock();
909 $this->tpl->setCurrentBlock(
"lm_head");
910 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
911 $this->tpl->parseCurrentBlock();
922 if ($this->lm->getType() ==
"dbk" && $this->abstract)
927 $showViewInFrameset =
true;
929 if ($showViewInFrameset)
935 $buttonTarget =
"_top";
939 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
940 $tpl_menu =
new ilTemplate(
"tpl.lm_sub_menu.html",
true,
true,
true);
951 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
953 $tpl_menu->setCurrentBlock(
"edit_page");
955 $tpl_menu->setVariable(
"EDIT_LINK", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
956 "&obj_id=".$page_id.
"&to_page=1");
957 $tpl_menu->setVariable(
"EDIT_TXT", $this->lng->txt(
"edit_page"));
958 $tpl_menu->setVariable(
"EDIT_TARGET", $buttonTarget);
959 $tpl_menu->parseCurrentBlock();
964 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
966 $page_id.
"_".$this->lm->getRefId(),
972 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
973 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
976 $title.=
": ".$pg_title;
981 $tpl_menu->setCurrentBlock(
"perma_link");
982 $tpl_menu->setVariable(
"PERMA_LINK", $plinkgui->getHTML());
983 $tpl_menu->parseCurrentBlock();
987 $this->tpl->setVariable(
"SUBMENU", $tpl_menu->get());
1005 global $ilAccess,
$tpl;
1007 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
1009 $ilAccess, $this->lm->getType(),
$_GET[
"ref_id"], $this->lm->getId());
1012 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
1013 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
1014 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
1015 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
1017 $lg = $dispatcher->initHeaderAction();
1018 $lg->enableNotes(
true);
1019 $lg->enableComments($this->lm->publicNotes(),
false);
1021 if($this->lm->hasRating())
1023 $lg->enableRating(
true, $this->lng->txt(
"lm_rating"),
false,
1024 array(
"ilcommonactiondispatchergui",
"ilratinggui"));
1029 $this->tpl->setVariable(
"HEAD_ACTION", $lg->getHeaderAction());
1034 return $lg->getHeaderAction().
1035 $tpl->getOnLoadCodeForAsynch();
1048 if ($this->lm->getType() ==
"dbk" && $this->abstract)
1061 if (!$ilSetting->get(
"disable_notes"))
1068 if ($ilSetting->get(
"disable_comments"))
1073 if (!$this->lm->publicNotes())
1078 $next_class = $this->ctrl->getNextClass($this);
1080 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1088 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1093 $this->ctrl->setParameter($this,
"frame",
$_GET[
"frame"]);
1094 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1096 $notes_gui->enablePrivateNotes();
1097 if ($this->lm->publicNotes())
1099 $notes_gui->enablePublicNotes();
1102 if ($next_class ==
"ilnotegui")
1104 $html = $this->ctrl->forwardCommand($notes_gui);
1108 $html = $notes_gui->getNotesHTML();
1110 $this->tpl->setVariable(
"NOTES", $html);
1119 global $ilLocator, $tree,
$ilCtrl;
1121 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
1123 if (empty(
$_GET[
"obj_id"]))
1125 $a_id = $this->lm_tree->getRootId();
1129 $a_id =
$_GET[
"obj_id"];
1132 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1134 if (!$this->lm->cleanFrames())
1136 $frame_param =
$_GET[
"frame"];
1147 $frame_target =
"_top";
1152 $ilLocator->addItem(
"...",
"");
1154 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
1155 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $par_id);
1156 $ilLocator->addItem(
1158 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset"),
1160 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1164 $ilLocator->setOffline(
true);
1167 if($this->lm_tree->isInTree($a_id))
1169 $path = $this->lm_tree->getPathFull($a_id);
1173 if (
$row[
"type"] !=
"pg")
1175 if(
$row[
"child"] != $this->lm_tree->getRootId())
1177 $ilLocator->addItem(
1180 $this->lm->isActiveNumbering(),
1181 $this->lm_set->get(
"time_scheduled_page_activation"), 0,
$this->lang),
1183 $this->
getLink(
$_GET[
"ref_id"],
"layout",
$row[
"child"], $frame_param,
"StructureObject"),
1188 $ilLocator->addItem(
1190 $this->
getLink(
$_GET[
"ref_id"],
"layout",
"", $frame_param),
1191 $frame_target,
$_GET[
"ref_id"]);
1199 $ilLocator->addItem(
1200 $this->lm->getTitle(),
1203 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1206 $ilLocator->addItem(
1207 $lm_obj->getTitle(),
1208 $this->
getLink(
$_GET[
"ref_id"],
"layout", $a_id, $frame_param),
1214 $debug =
"DEBUG: <font color=\"red\">".$this->type.
"::".$this->
id.
"::".
$_GET[
"cmd"].
"</font><br/>";
1220 $this->tpl->setLocator();
1227 if (!$this->
offlineMode() && $this->current_page_id !==
false)
1232 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
1234 $this->chapter_has_no_active_page =
false;
1235 $this->deactivated_page =
false;
1238 if(empty(
$_GET[
"obj_id"]))
1240 $obj_id = $this->lm_tree->getRootId();
1244 $obj_id =
$_GET[
"obj_id"];
1246 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1251 $this->deactivated_page =
true;
1256 if (!$this->lm_tree->isInTree($obj_id))
1261 $curr_node = $this->lm_tree->getNodeData($obj_id);
1264 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1266 if ($curr_node[
"type"] ==
"pg" &&
1269 $page_id = $curr_node[
"obj_id"];
1276 while($succ_node && !$active)
1278 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
1279 $page_id = $succ_node[
"obj_id"];
1281 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
1284 if ($succ_node[
"type"] !=
"pg")
1286 $this->chapter_has_no_active_page =
true;
1292 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1296 while ($public ===
false && $page_id > 0)
1298 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
1299 $page_id = $succ_node[
'obj_id'];
1305 if ($this->lm_tree->isInTree($page_id))
1307 $path = $this->lm_tree->getPathId($page_id);
1310 $this->chapter_has_no_active_page =
true;
1315 $this->current_page_id = $page_id;
1322 $this->tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
true);
1324 $this->tpl->setVariable(
"MENU",$this->lm_gui->setilCitationMenu());
1326 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
1328 $this->pg_obj = $this->
getLMPage($page_id);
1329 $xml = $this->pg_obj->getXMLContent();
1330 $this->lm_gui->showCitation($xml);
1338 if (!is_object($this->layout_doc))
1343 $path =
"/ilLayout/ilLinkTargets/LinkTarget";
1346 for ($i = 0; $i < count(
$res->nodeset); $i++)
1348 $type =
$res->nodeset[$i]->get_attribute(
"Type");
1349 $frame =
$res->nodeset[$i]->get_attribute(
"Frame");
1350 $onclick =
$res->nodeset[$i]->get_attribute(
"OnClick");
1351 $targets[$type] = array(
"Type" => $type,
"Frame" => $frame,
"OnClick" => $onclick);
1363 function ilPage(&$a_page_node, $a_page_id = 0)
1369 $ilHelp->setScreenIdComponent(
"lm");
1370 $ilHelp->setScreenId(
"content");
1371 $ilHelp->setSubScreenId(
"content");
1373 $this->fill_on_load_code =
true;
1376 $this->lm_gui->object->getPublicAccessMode() ==
'selected')
1389 require_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
1390 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
1393 if ($a_page_id == 0)
1401 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
1404 $search_string = $cache->getQuery();
1406 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
1407 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
1411 $words = $p->getQuotedWords();
1412 if (is_array($words))
1414 foreach ($words as $w)
1420 $this->fill_on_load_code =
true;
1425 $page_id = $a_page_id;
1429 $this->tpl->setCurrentBlock(
"ContentStyle");
1432 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1437 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1439 $this->tpl->parseCurrentBlock();
1442 if ($this->chapter_has_no_active_page &&
1445 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1446 "Modules/LearningModule");
1447 $mtpl->setVariable(
"MESSAGE", $this->lng->txt(
"cont_no_page_in_chapter"));
1450 $mtpl->setVariable(
"ITEM_TITLE",
1452 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1453 return $mtpl->get();
1457 if ($this->deactivated_page)
1459 $mtpl =
new ilTemplate(
"tpl.no_content_message.html",
true,
true,
1460 "Modules/LearningModule");
1461 $m = $this->lng->txt(
"cont_page_currently_deactivated");
1463 if ($act_data[
"show_activation_info"] &&
1466 $m.=
"<p>".sprintf($this->lng->txt(
"cont_page_activation_on"),
1471 $mtpl->setVariable(
"MESSAGE", $m);
1474 $mtpl->setVariable(
"ITEM_TITLE",
1476 $this->tpl->setVariable(
"PAGE_CONTENT", $mtpl->get());
1477 return $mtpl->get();
1483 $cont = $this->lng->txt(
"cont_no_page");
1484 $this->tpl->setVariable(
"PAGE_CONTENT", $cont);
1491 $page_object = $page_object_gui->getPageObject();
1492 $page_object->buildDom();
1493 $page_object->registerOfflineHandler($this);
1495 $int_links = $page_object->getInternalLinks();
1499 $page_object_gui->setTemplateOutput(
false);
1502 $ilUser->setDesktopItemParameters($this->lm->getRefId(), $this->lm->getType(), $page_id);
1505 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
1514 $lm_pg_obj->setLMId($this->lm->getId());
1516 $page_object_gui->setLinkXML($link_xml);
1520 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
1523 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
1524 $page_id != $this->lm->getFooterPage()))
1526 $page_object_gui->setPresentationTitle(
1528 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
1529 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang));
1532 if ($ilUser->getId() != ANONYMOUS_USER_ID)
1535 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
1537 $this->lm->getRefId(), $this->lm->getType());
1540 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1546 $page_object_gui->setEnabledPageFocus(
false);
1547 $page_object_gui->getPageConfig()->setEnableSelfAssessment(
false);
1551 $page_object_gui->setLinkParams(
"ref_id=".$this->lm->getRefId());
1552 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
1556 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1559 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1564 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1565 "syntaxhighlight.css");
1567 $this->tpl->parseCurrentBlock();
1570 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
1573 if ($this->lm->getHeaderPage() > 0 &&
1574 $page_id != $this->lm->getHeaderPage() &&
1575 ($page_id == 0 || $page_id != $this->lm->getFooterPage()))
1579 $head = $this->
ilPage($a_page_node, $this->lm->getHeaderPage());
1584 if ($this->lm->getFooterPage() > 0 &&
1585 $page_id != $this->lm->getFooterPage() &&
1586 ($page_id == 0 || $page_id != $this->lm->getHeaderPage()))
1590 $foot = $this->
ilPage($a_page_node, $this->lm->getFooterPage());
1596 if($this->lm->hasRatingPages())
1598 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
1600 $rating_gui->setObject($this->lm->getId(),
"lm", $page_id,
"lm");
1601 $rating_gui->setYourRatingText($this->lng->txt(
"lm_rate_page"));
1608 $this->ctrl->setParameter($this,
"pgid", $page_id);
1609 $this->tpl->addOnLoadCode(
"il.LearningModule.setRatingUrl('".
1610 $this->ctrl->getLinkTarget($this,
"updatePageRating",
"",
true,
false).
1612 $this->ctrl->setParameter($this,
"pgid",
"");
1614 $rating =
'<div id="ilrtrpg" style="text-align:right">'.
1615 $rating_gui->getHtml(
true,
true,
"il.LearningModule.saveRating(%rating%);").
1619 $this->tpl->setVariable(
"PAGE_CONTENT", $rating.$head.$ret.$foot);
1621 return $head.$ret.$foot;
1628 $pg_id =
$_GET[
"pgid"];
1629 if(!$this->ctrl->isAsynch() || !$pg_id)
1634 include_once
'./Services/Rating/classes/class.ilRating.php';
1635 $rating = (int)
$_POST[
"rating"];
1639 $pg_id,
"lm", $ilUser->getId(),
$_POST[
"rating"]);
1644 $pg_id,
"lm", $ilUser->getId());
1647 include_once
'./Services/Rating/classes/class.ilRatingGUI.php';
1649 $rating->setObject($this->lm->getId(),
"lm", $pg_id,
"lm", $ilUser->getId());
1650 $rating->setYourRatingText($this->lng->txt(
"lm_rate_page"));
1652 echo $rating->getHtml(
true,
true,
"il.LearningModule.saveRating(%rating%);");
1654 echo $this->tpl->getOnLoadCodeForAsynch();
1666 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1668 $this->lm->getStyleSheetId(),
"lm"));
1671 $a_page_gui->setOutputMode(
"presentation");
1672 $this->fill_on_load_code =
true;
1676 $a_page_gui->setOutputMode(
"offline");
1678 $this->fill_on_load_code =
false;
1680 $a_page_gui->setFileDownloadLink($this->
getLink(
$_GET[
"ref_id"],
"downloadFile"));
1681 $a_page_gui->setFullscreenLink($this->
getLink(
$_GET[
"ref_id"],
"fullscreen"));
1695 $this->tpl->setCurrentBlock(
"ContentStyle");
1698 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1703 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1705 $this->tpl->parseCurrentBlock();
1707 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_preconditions.html",
true);
1710 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
1711 foreach($conds as $cond)
1715 $this->tpl->setCurrentBlock(
"condition");
1716 $this->tpl->setVariable(
"ROWCOL", $rc = ($rc !=
"tblrow2") ?
"tblrow2" :
"tblrow1");
1718 $this->tpl->setVariable(
"LINK_ITEM", $obj_link);
1719 $this->tpl->setVariable(
"FRAME_ITEM", $obj_frame);
1720 if ($cond[
"operator"] ==
"passed")
1722 $cond_str = $this->lng->txt(
"passed");
1726 $cond_str = $cond[
"operator"];
1728 $this->tpl->setVariable(
"VAL_CONDITION", $cond_str.
" ".$cond[
"value"]);
1729 $this->tpl->parseCurrentBlock();
1731 $this->tpl->setCurrentBlock(
"pg_content");
1733 $this->tpl->setVariable(
"TXT_MISSING_PRECONDITIONS",
1734 sprintf($this->lng->txt(
"cont_missing_preconditions"),
1736 $this->tpl->setVariable(
"TXT_ITEM", $this->lng->txt(
"item"));
1737 $this->tpl->setVariable(
"TXT_CONDITION", $this->lng->txt(
"condition"));
1740 $parent = $this->lm_tree->getParentId($topchap);
1741 $childs = $this->lm_tree->getChildsByType($parent,
"st");
1744 foreach($childs as $child)
1746 if ($child[
"child"] == $topchap)
1752 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
1755 if($succ_node !=
"")
1757 $framestr = (!empty(
$_GET[
"frame"]))
1758 ?
"frame=".
$_GET[
"frame"].
"&"
1761 $showViewInFrameset =
true;
1762 $link =
"<br /><a href=\"".
1763 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]).
1764 "\">".$this->lng->txt(
"cont_skip_chapter").
"</a>";
1765 $this->tpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
1768 $this->tpl->parseCurrentBlock();
1780 $showViewInFrameset =
true;
1782 if ($a_layoutframes ==
"")
1784 $a_layoutframes = array();
1786 $link_info =
"<IntLinkInfos>";
1787 foreach ($a_int_links as $int_link)
1789 $target = $int_link[
"Target"];
1790 if (substr($target, 0, 4) ==
"il__")
1794 $type = $int_link[
"Type"];
1795 $targetframe = ($int_link[
"TargetFrame"] !=
"")
1796 ? $int_link[
"TargetFrame"]
1800 $anc = $anc_add =
"";
1801 if ($int_link[
"Anchor"] !=
"")
1803 $anc = $int_link[
"Anchor"];
1804 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
1810 case "StructureObject":
1812 if ($lm_id == $this->lm->getId() ||
1813 ($targetframe !=
"None" && $targetframe !=
"New"))
1815 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1819 $nframe = ($ltarget ==
"")
1824 if ($showViewInFrameset) {
1845 if ($type ==
"PageObject")
1847 $href =
"./goto.php?target=pg_".$target_id.$anc_add;
1851 $href =
"./goto.php?target=st_".$target_id;
1856 if ($type ==
"PageObject")
1858 $href = ILIAS_HTTP_PATH.
"/goto.php?target=pg_".
$target_id.$anc_add.
"&client_id=".CLIENT_ID;
1862 $href = ILIAS_HTTP_PATH.
"/goto.php?target=st_".
$target_id.
"&client_id=".CLIENT_ID;
1865 if ($targetframe !=
"New")
1871 $ltarget =
"_blank";
1876 case "GlossaryItem":
1877 if ($targetframe ==
"None")
1879 $targetframe =
"Glossary";
1881 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1882 $nframe = ($ltarget ==
"")
1890 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
1891 $nframe = ($ltarget ==
"")
1898 case "RepositoryItem":
1903 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
1907 $href = ILIAS_HTTP_PATH.
"/goto.php?target=".$obj_type.
"_".
$target_id.
"&client_id=".CLIENT_ID;
1913 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1920 $ilCtrl->setParameter($this,
"file_id",
"il__file_".
$target_id);
1921 $href = $ilCtrl->getLinkTarget($this,
"downloadFile");
1922 $ilCtrl->setParameter($this,
"file_id",
"");
1927 $anc_par =
'Anchor="'.$anc.
'"';
1929 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
1930 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
1941 $link_info.=
"</IntLinkInfos>";
1950 $link_info =
"<LinkTargets>";
1953 $link_info.=
"<LinkTarget TargetFrame=\"".$t[
"Type"].
"\" LinkTarget=\"".
$t[
"Frame"].
"\" OnClick=\"".
$t[
"OnClick"].
"\" />";
1955 $link_info.=
"</LinkTargets>";
1966 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
1970 $this->tpl->setCurrentBlock(
"ContentStyle");
1973 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1978 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
1980 $this->tpl->parseCurrentBlock();
1983 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1987 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1992 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1993 "syntaxhighlight.css");
1995 $this->tpl->parseCurrentBlock();
1997 $int_links = $term_gui->getInternalLinks();
2000 $term_gui->setLinkXML($link_xml);
2005 $ilCtrl->setParameter($this,
"pg_type",
"glo");
2007 $term_gui->output($this->
offlineMode(), $this->tpl);
2013 $ilCtrl->setParameter($this,
"pg_type",
"");
2024 $this->tpl->setCurrentBlock(
"ContentStyle");
2027 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2032 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2034 $this->tpl->parseCurrentBlock();
2045 $style_name = $ilUser->getPref(
"style").
".css";;
2046 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2049 $this->tpl->setCurrentBlock(
"ilMedia");
2056 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2058 if (!empty (
$_GET[
"pg_id"]))
2060 require_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
2062 $pg_obj->buildDom();
2067 $xml.= $pg_obj->getMediaAliasElement(
$_GET[
"mob_id"]);
2088 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2089 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
2104 $mode = (
$_GET[
"cmd"] ==
"fullscreen")
2109 $this->
getLink($this->lm->getRefId(),
"fullscreen");
2110 $params = array (
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2111 'link_params' =>
"ref_id=".$this->lm->getRefId(),
'fullscreen_link' => $fullscreen_link,
2112 'ref_id' => $this->lm->getRefId(),
'pg_frame' => $pg_frame,
'webspace_path' => $wb_path);
2113 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
2118 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2121 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
2130 if ($a_inline !=
"")
2132 $js_tpl =
new ilTemplate($a_inline,
true,
false, $a_location);
2133 $js = $js_tpl->get();
2134 $this->tpl->setVariable(
"INLINE_JS", $js);
2146 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
2148 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2158 if(!$this->lm_tree->isInTree($page_id))
2164 $limpos = strpos(
$_GET[
"back_pg"],
":");
2167 $back_pg = substr(
$_GET[
"back_pg"], 0, $limpos);
2171 $back_pg =
$_GET[
"back_pg"];
2173 if (!$this->lm->cleanFrames())
2176 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
$_GET[
"frame"],
2183 $this->
getLink($this->lm->getRefId(),
"layout", $back_pg,
"",
2185 $back_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2189 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2190 $this->tpl->setVariable(
"IMG_PREV", $back_img);
2191 $this->tpl->setVariable(
"HREF_PREV", $back_href);
2192 $this->tpl->setVariable(
"FRAME_PREV", $back_target);
2193 $this->tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
2194 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
2195 $this->tpl->setVariable(
"PREV_ACC_KEY",
2197 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2198 ?
"images/spacer.png"
2200 $this->tpl->parseCurrentBlock();
2201 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2202 $this->tpl->setVariable(
"IMG_PREV2", $back_img);
2203 $this->tpl->setVariable(
"HREF_PREV2", $back_href);
2204 $this->tpl->setVariable(
"FRAME_PREV2", $back_target);
2205 $this->tpl->setVariable(
"TXT_PREV2", $this->lng->txt(
"back"));
2206 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"back"));
2207 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2208 ?
"images/spacer.png"
2210 $this->tpl->parseCurrentBlock();
2218 if ($this->chapter_has_no_active_page &&
2221 $c_id =
$_GET[
"obj_id"];
2225 if ($this->deactivated_page)
2227 $c_id =
$_GET[
"obj_id"];
2236 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
2237 $c_id = $succ_node[
"obj_id"];
2240 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2242 if ($succ_node[
"obj_id"] > 0 &&
2244 ( $this->lm->getPublicAccessMode() ==
"selected" &&
2249 else if ($succ_node[
"obj_id"] > 0 && !$active)
2253 if ($act_data[
"show_activation_info"] &&
2269 $succ_str = ($succ_node !==
false)
2270 ?
" -> ".$succ_node[
"obj_id"].
"_".$succ_node[
"type"]
2275 if ($this->deactivated_page)
2277 $c_id =
$_GET[
"obj_id"];
2285 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
2286 $c_id = $pre_node[
"obj_id"];
2288 $this->lm->getType(), $this->lm_set->get(
"time_scheduled_page_activation"));
2289 if ($pre_node[
"obj_id"] > 0 &&
2291 ($this->lm->getPublicAccessMode() ==
"selected" &&
2296 else if ($pre_node[
"obj_id"] > 0 && !$active)
2300 if ($act_data[
"show_activation_info"] &&
2316 $pre_str = ($pre_node !==
false)
2317 ? $pre_node[
"obj_id"].
"_".$pre_node[
"type"].
" -> "
2321 $framestr = (!empty(
$_GET[
"frame"]))
2322 ?
"frame=".
$_GET[
"frame"].
"&"
2328 $showViewInFrameset =
true;
2334 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2335 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
2340 if (!$this->lm->cleanFrames())
2343 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"],
$_GET[
"frame"]);
2346 else if ($showViewInFrameset && !$this->
offlineMode())
2349 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2350 $prev_target =
'target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2355 $this->
getLink($this->lm->getRefId(),
"layout", $pre_node[
"obj_id"]);
2356 $prev_target =
'target="_top" ';
2362 $output = $this->lng->txt(
"msg_page_not_public");
2365 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev");
2366 $this->tpl->setVariable(
"IMG_PREV", $prev_img);
2367 $this->tpl->setVariable(
"HREF_PREV", $prev_href);
2368 $this->tpl->setVariable(
"FRAME_PREV", $prev_target);
2369 $this->tpl->setVariable(
"TXT_PREV", $prev_title);
2370 $this->tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
2371 $this->tpl->setVariable(
"SPACER_PREV", $this->
offlineMode()
2372 ?
"images/spacer.png"
2374 $this->tpl->setVariable(
"PREV_ACC_KEY",
2376 $this->tpl->parseCurrentBlock();
2377 $this->tpl->setCurrentBlock(
"ilLMNavigation_Prev2");
2378 $this->tpl->setVariable(
"IMG_PREV2", $prev_img);
2379 $this->tpl->setVariable(
"HREF_PREV2", $prev_href);
2380 $this->tpl->setVariable(
"FRAME_PREV2", $prev_target);
2381 $this->tpl->setVariable(
"TXT_PREV2", $prev_title);
2382 $this->tpl->setVariable(
"ALT_PREV2", $this->lng->txt(
"previous"));
2383 $this->tpl->setVariable(
"SPACER_PREV2", $this->
offlineMode()
2384 ?
"images/spacer.png"
2386 $this->tpl->parseCurrentBlock();
2388 if($succ_node !=
"")
2392 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2393 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
2397 if (!$this->lm->cleanFrames())
2400 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"],
$_GET[
"frame"]);
2403 else if ($showViewInFrameset && !$this->
offlineMode())
2406 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2407 $succ_target =
' target="'.ilFrameTargetInfo::_getFrame(
"MainContent").
'" ';
2412 $this->
getLink($this->lm->getRefId(),
"layout", $succ_node[
"obj_id"]);
2413 $succ_target =
' target="_top" ';
2419 $output = $this->lng->txt(
"msg_page_not_public");
2422 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next");
2423 $this->tpl->setVariable(
"IMG_SUCC", $succ_img);
2424 $this->tpl->setVariable(
"HREF_SUCC", $succ_href);
2425 $this->tpl->setVariable(
"FRAME_SUCC", $succ_target);
2426 $this->tpl->setVariable(
"TXT_SUCC", $succ_title);
2427 $this->tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
2428 $this->tpl->setVariable(
"SPACER_SUCC", $this->
offlineMode()
2429 ?
"images/spacer.png"
2431 $this->tpl->setVariable(
"NEXT_ACC_KEY",
2433 $this->tpl->parseCurrentBlock();
2434 $this->tpl->setCurrentBlock(
"ilLMNavigation_Next2");
2435 $this->tpl->setVariable(
"IMG_SUCC2", $succ_img);
2436 $this->tpl->setVariable(
"HREF_SUCC2", $succ_href);
2437 $this->tpl->setVariable(
"FRAME_SUCC2", $succ_target);
2438 $this->tpl->setVariable(
"TXT_SUCC2", $succ_title);
2439 $this->tpl->setVariable(
"ALT_SUCC2", $this->lng->txt(
"next"));
2440 $this->tpl->setVariable(
"SPACER_SUCC2", $this->
offlineMode()
2441 ?
"images/spacer.png"
2443 $this->tpl->parseCurrentBlock();
2450 $child_nodes = $a_node->child_nodes();
2451 foreach ($child_nodes as $child)
2453 if($child->node_name() ==
"ilFrame")
2455 $attributes = $this->
attrib2arr($child->attributes());
2457 if ((!empty($attributes[
"rows"])) || (!empty($attrubtes[
"cols"])))
2461 if(!empty($attributes[
"name"]))
2463 unset($attributes[
"template"]);
2464 unset($attributes[
"template_location"]);
2465 $attributes[
"src"] =
2466 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2467 "",
"keep",
"",
$_GET[
"srcstring"]);
2468 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2469 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2470 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2475 $a_content .= $this->
buildTag(
"start",
"frameset", $attributes);
2477 $a_content .= $this->
buildTag(
"end",
"frameset");
2482 unset($attributes[
"template"]);
2483 unset($attributes[
"template_location"]);
2484 $attributes[
"src"] =
2485 $this->
getLink($this->lm->getRefId(),
"layout",
$_GET[
"obj_id"], $attributes[
"name"],
2486 "",
"keep",
"",
$_GET[
"srcstring"]);
2487 $attributes[
"title"] = $this->lng->txt(
"cont_frame_".$attributes[
"name"]);
2488 if ($attributes[
"name"] ==
"toc")
2490 $attributes[
"src"].=
"#".$_GET[
"obj_id"];
2495 if (
$_GET[
"anchor"] !=
"")
2497 $attributes[
"src"].=
"#".rawurlencode(
$_GET[
"anchor"]);
2500 $a_content .= $this->
buildTag(
"",
"frame", $attributes);
2501 $this->frames[$attributes[
"name"]] = $attributes[
"name"];
2523 if (is_array($attr))
2525 while (list($k,$v) = each($attr))
2526 $tag.=
" ".$k.
"=\"$v\"";
2546 $this->tpl->setCurrentBlock(
"ContentStyle");
2549 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2554 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2556 $this->tpl->parseCurrentBlock();
2567 $style_name = $ilUser->getPref(
"style").
".css";;
2568 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
2572 $this->tpl->getStandardTemplate();
2575 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2578 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_toc.html",
"Modules/LearningModule");
2581 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
2582 $this->tpl->setTitle($this->lm->getTitle());
2596 include_once (
"./Modules/LearningModule/classes/class.ilLMTableOfContentsExplorer.php");
2598 $this->
getLink($this->lm->getRefId(),
""),
2601 $exp->setTargetGet(
"obj_id");
2603 $exp->forceExpandAll(
true,
false);
2611 if ($this->chapter_has_no_active_page &&
2614 $exp->highlightNode(
$_GET[
"obj_id"]);
2618 if ($this->lm->getTOCMode() ==
"pages")
2620 if ($this->deactivated_page)
2622 $exp->highlightNode(
$_GET[
"obj_id"]);
2626 $exp->highlightNode($page_id);
2631 $exp->highlightNode($this->lm_tree->getParentId($page_id));
2636 $tree = $this->lm->getTree();
2637 if (
$_GET[
"lmtocexpand"] ==
"")
2639 $expanded = $tree->readRootId();
2643 $expanded =
$_GET[
"lmtocexpand"];
2646 $exp->setExpand($expanded);
2650 $output = $exp->getOutput();
2652 $this->tpl->setVariable(
"EXPLORER", $output);
2653 $this->tpl->parseCurrentBlock();
2657 return $this->tpl->get();
2673 $this->ctrl->setCmd(
"showSummary");
2674 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2688 global $ilAccess, $ilLocator,
$ilUser;
2699 $style_name = $ilUser->getPref(
"style").
".css";;
2700 $this->tpl->setStyleSheetLocation(
"./".$style_name);
2703 $this->tpl->getStandardTemplate();
2704 $this->tpl->setTitle($this->lm->getTitle());
2707 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2711 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2717 $ilLocator->addRepositoryItems();
2718 $this->tpl->setLocator();
2731 $this->lng->loadLanguageModule(
"meta");
2733 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2736 $info->enablePrivateNotes();
2737 $info->enableLearningProgress();
2739 $info->enableNews();
2740 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2743 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
2745 $info->enableNewsEditing();
2747 if ($enable_internal_rss)
2749 $info->setBlockProperty(
"news",
"settings",
true);
2771 $info->addMetaDataSections($this->lm->getId(),0, $this->lm->getType());
2775 $this->tpl->setContent($info->getHTML());
2776 return $this->tpl->get();
2781 $this->ctrl->forwardCommand($info);
2794 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
2795 if (!$this->lm->isActivePrintView())
2800 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
2803 $this->tpl->setCurrentBlock(
"ContentStyle");
2806 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2811 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
2813 $this->tpl->parseCurrentBlock();
2817 $this->tpl->getStandardTemplate();
2819 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2823 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
2824 "tpl.lm_print_selection.html",
"Modules/LearningModule");
2827 $this->tpl->setTitle($this->lm->getTitle());
2835 $this->ctrl->setParameterByClass(
"illmpresentationgui",
"obj_id",
$_GET[
"obj_id"]);
2836 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
2838 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2840 if (!is_array(
$_POST[
"item"]))
2842 if (
$_GET[
"obj_id"] !=
"")
2854 foreach ($nodes as $node)
2859 $this->lm_set->get(
"time_scheduled_page_activation"));
2861 if ($node[
"type"] ==
"pg" &&
2867 $text = $img_scr = $img_alt =
"";
2871 switch ($node[
"type"])
2877 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2878 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
2881 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2886 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
2890 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"pg");
2895 $text = $this->lm->getTitle();
2897 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"obj_lm");
2904 $this->lm->isActiveNumbering(),
2905 $this->lm_set->get(
"time_scheduled_page_activation"), 0,
$this->lang);
2907 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2912 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
2916 $img_alt = $lng->txt(
"icon").
" ".$lng->txt(
"st");
2922 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
2925 $this->nl->addListNode($node[
"obj_id"], $text, $node[
"parent"], $checked, $disabled,
2926 $img_src, $img_alt);
2931 if (
$_GET[
"obj_id"] > 0 && !$this->lm_tree->isInTree(
$_GET[
"obj_id"]))
2935 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
2936 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
2939 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
2944 $text.=
" (".$this->lng->txt(
"cont_no_access").
")";
2948 $id =
$_GET[
"obj_id"];
2952 $this->nl->addListNode($id, $text, 0, $checked, $disabled,
2953 $img_src, $img_alt);
2956 $f = $this->form->getHTML();
2960 $tb->addFormButton($lng->txt(
"cont_show_print_view"),
"showPrintView");
2961 $this->tpl->setVariable(
"TOOLBAR", $tb->getHTML());
2963 $this->tpl->setVariable(
"ITEM_SELECTION", $f);
2975 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2981 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
2982 $radg->addOption($op1);
2983 $op2 =
new ilRadioOption($lng->txt(
"cont_current_chapter"),
"chapter");
2984 $radg->addOption($op2);
2985 $op3=
new ilRadioOption($lng->txt(
"cont_selected_pg_chap"),
"selection");
2986 $radg->addOption($op3);
2988 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
2991 $op3->addSubItem($nl);
2994 $this->form->addItem($radg);
2996 $this->form->addCommandButton(
"showPrintView", $lng->txt(
"cont_show_print_view"));
2997 $this->form->setOpenTag(
false);
2998 $this->form->setCloseTag(
false);
3000 $this->form->setTitle($lng->txt(
"cont_print_selection"));
3001 $this->form->setFormAction($ilCtrl->getFormAction($this));
3011 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3013 if (!$this->lm->isActivePrintView())
3022 if (
$_POST[
"sel_type"] ==
"page")
3024 if (!is_array(
$_POST[
"obj_id"]) || !in_array($c_obj_id,
$_POST[
"obj_id"]))
3026 $_POST[
"obj_id"][] = $c_obj_id;
3029 if (
$_POST[
"sel_type"] ==
"chapter" && $c_obj_id > 0)
3032 $path = $this->lm_tree->getPathFull($c_obj_id);
3033 $chap_id =
$path[1][
"child"];
3036 $_POST[
"obj_id"][] = $chap_id;
3049 $style_name = $ilUser->getPref(
"style").
".css";;
3050 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"./style/".$style_name);
3054 $this->tpl->setCurrentBlock(
"ContentStyle");
3057 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3062 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3064 $this->tpl->parseCurrentBlock();
3067 $this->tpl->setCurrentBlock(
"SyntaxStyle");
3068 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
3070 $this->tpl->parseCurrentBlock();
3073 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.lm_print_view.html",
true);
3076 $this->tpl->setVariable(
"HEADER", $this->lm->getTitle());
3078 $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
3080 include_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
3081 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3082 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
3087 $glossary_links = array();
3088 $output_header =
false;
3089 $media_links = array();
3092 if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint())
3096 $page_object_gui = $this->
getLMPageGUI($this->lm->getFooterPage());
3097 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3099 $this->lm->getStyleSheetId(),
"lm"));
3103 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3104 $page_object_gui->setOutputMode(
"print");
3105 $page_object_gui->setPresentationTitle(
"");
3106 $page_object_gui->setFileDownloadLink(
"#");
3107 $page_object_gui->setFullscreenLink(
"#");
3108 $page_object_gui->setSourceCodeDownloadScript(
"#");
3109 $footer_page_content = $page_object_gui->showPage();
3112 if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint())
3116 $page_object_gui = $this->
getLMPageGUI($this->lm->getHeaderPage());
3117 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3119 $this->lm->getStyleSheetId(),
"lm"));
3123 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3124 $page_object_gui->setOutputMode(
"print");
3125 $page_object_gui->setPresentationTitle(
"");
3126 $page_object_gui->setFileDownloadLink(
"#");
3127 $page_object_gui->setFullscreenLink(
"#");
3128 $page_object_gui->setSourceCodeDownloadScript(
"#");
3129 $header_page_content = $page_object_gui->showPage();
3134 if (is_array(
$_POST[
"obj_id"]))
3136 foreach(
$_POST[
"obj_id"] as $k)
3138 if ($k > 0 && !$this->lm_tree->isInTree($k))
3142 $nodes[] = array(
"obj_id" => $k,
"type" =>
"pg",
"free" =>
true);
3150 $ilCtrl->redirect($this,
"showPrintViewSelection");
3153 foreach ($nodes as $node_key => $node)
3157 $this->lm_set->get(
"time_scheduled_page_activation"));
3158 if ($node[
"type"] ==
"pg" && !$active)
3165 if ($node[
"depth"] <= $act_level)
3167 if (is_array(
$_POST[
"obj_id"]) && in_array($node[
"obj_id"],
$_POST[
"obj_id"]))
3169 $act_level = $node[
"depth"];
3183 if ($node[
"type"] ==
"du")
3185 $output_header =
true;
3189 if ($node[
"type"] ==
"st")
3192 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3201 $this->tpl->setCurrentBlock(
"print_chapter");
3203 $chapter_title = $chap->_getPresentationTitle($node[
"obj_id"],
3204 $this->lm->isActiveNumbering(),
3205 $this->lm_set->get(
"time_scheduled_page_activation"), 0,
$this->lang);
3206 $this->tpl->setVariable(
"CHAP_TITLE",
3211 if ($nodes[$node_key + 1][
"type"] ==
"pg")
3213 $this->tpl->setVariable(
"CHAP_HEADER",
3214 $header_page_content);
3215 $did_chap_page_header =
true;
3219 $this->tpl->parseCurrentBlock();
3220 $this->tpl->setCurrentBlock(
"print_block");
3221 $this->tpl->parseCurrentBlock();
3225 if ($node[
"type"] ==
"pg")
3228 $this->lm_gui->object->getPublicAccessMode() ==
"selected")
3236 $this->tpl->setCurrentBlock(
"print_item");
3239 $page_id = $node[
"obj_id"];
3241 $page_object = $page_object_gui->getPageObject();
3242 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3244 $this->lm->getStyleSheetId(),
"lm"));
3249 $lm_pg_obj->setLMId($this->lm->getId());
3252 $page_object_gui->setLinkFrame(
$_GET[
"frame"]);
3253 $page_object_gui->setOutputMode(
"print");
3254 $page_object_gui->setPresentationTitle(
"");
3256 if ($this->lm->getPageHeader() ==
IL_PAGE_TITLE || $node[
"free"] ===
true)
3259 $this->lm->getPageHeader(), $this->lm->isActiveNumbering(),
3260 $this->lm_set->get(
"time_scheduled_page_activation"),
false, 0,
$this->lang);
3264 if ($this->lm->isActiveNumbering())
3266 $chapter_title = trim(substr($chapter_title,
3267 strpos($chapter_title,
" ")));
3270 if ($page_title != $chapter_title)
3272 $page_object_gui->setPresentationTitle($page_title);
3277 $hcont = $header_page_content;
3278 $fcont = $footer_page_content;
3282 if ($did_chap_page_header)
3286 if ($nodes[$node_key + 1][
"type"] ==
"pg" &&
3287 !($nodes[$node_key + 1][
"depth"] <= $act_level
3288 && !in_array($nodes[$node_key + 1][
"obj_id"],
$_POST[
"obj_id"])))
3294 $page_object_gui->setFileDownloadLink(
"#");
3295 $page_object_gui->setFullscreenLink(
"#");
3296 $page_object_gui->setSourceCodeDownloadScript(
"#");
3297 $page_content = $page_object_gui->showPage();
3300 $this->tpl->setVariable(
"CONTENT",
3301 $hcont.$page_content.$fcont);
3305 $this->tpl->setVariable(
"CONTENT",
3306 $hcont.$page_content.$fcont.
"<br />");
3308 $chapter_title =
"";
3309 $this->tpl->parseCurrentBlock();
3310 $this->tpl->setCurrentBlock(
"print_block");
3311 $this->tpl->parseCurrentBlock();
3318 foreach ($int_links as $key => $link)
3320 if ($link[
"type"] ==
"git" &&
3321 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3323 $glossary_links[$key] = $link;
3325 if ($link[
"type"] ==
"mob" &&
3326 ($link[
"inst"] == IL_INST_ID || $link[
"inst"] == 0))
3329 $mob_links[$key] = $link;
3340 $page_object->buildDom();
3341 $links = $page_object->getInternalLinks();
3342 foreach($links as $link)
3344 if ($link[
"Type"] ==
"MediaObject"
3345 && $link[
"TargetFrame"] !=
""
3346 && $link[
"TargetFrame"] !=
"None")
3348 $media_links[] = $link;
3360 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix())
3362 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3363 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
3368 foreach($glossary_links as $key => $link)
3371 $terms[$term.
":".$key] = array(
"key" => $key,
"link" => $link,
"term" => $term);
3376 foreach($terms as
$t)
3384 foreach($defs as $def)
3387 if (count($defs) > 1)
3389 $this->tpl->setCurrentBlock(
"def_title");
3390 $this->tpl->setVariable(
"TXT_DEFINITION",
3391 $this->lng->txt(
"cont_definition").
" ".($def_cnt++));
3392 $this->tpl->parseCurrentBlock();
3394 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
3396 $page_gui->setTemplateOutput(
false);
3397 $page_gui->setOutputMode(
"print");
3399 $this->tpl->setCurrentBlock(
"definition");
3400 $page_gui->setFileDownloadLink(
"#");
3401 $page_gui->setFullscreenLink(
"#");
3402 $page_gui->setSourceCodeDownloadScript(
"#");
3403 $output = $page_gui->showPage();
3404 $this->tpl->setVariable(
"VAL_DEFINITION", $output);
3405 $this->tpl->parseCurrentBlock();
3409 $this->tpl->setCurrentBlock(
"term");
3410 $this->tpl->setVariable(
"VAL_TERM",
3412 $this->tpl->parseCurrentBlock();
3417 $this->tpl->setCurrentBlock(
"glossary");
3418 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3419 chr(64+$annex_cnt).
": ".$this->lng->txt(
"glo");
3420 $this->tpl->setVariable(
"TXT_GLOSSARY", $annex_title);
3421 $this->tpl->parseCurrentBlock();
3423 $annexes[] = $annex_title;
3427 if (count($media_links) > 0)
3429 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
3430 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
3432 foreach($media_links as $media)
3434 if (substr($media[
"Target"],0,4) ==
"il__")
3436 $arr = explode(
"_",$media[
"Target"]);
3437 $id = $arr[count($arr) - 1];
3440 $med_item = $med_obj->getMediaItem(
"Standard");
3441 if (is_object($med_item))
3443 if (is_int(strpos($med_item->getFormat(),
"image")))
3445 $this->tpl->setCurrentBlock(
"ref_image");
3448 if ($med_item->getLocationType() ==
"LocalFile")
3450 $this->tpl->setVariable(
"IMG_SOURCE",
3452 "/".$med_item->getLocation());
3456 $this->tpl->setVariable(
"IMG_SOURCE",
3457 $med_item->getLocation());
3460 if ($med_item->getCaption() !=
"")
3462 $this->tpl->setVariable(
"IMG_TITLE", $med_item->getCaption());
3466 $this->tpl->setVariable(
"IMG_TITLE", $med_obj->getTitle());
3468 $this->tpl->parseCurrentBlock();
3476 $this->tpl->setCurrentBlock(
"ref_images");
3477 $annex_title = $this->lng->txt(
"cont_annex").
" ".
3478 chr(64+$annex_cnt).
": ".$this->lng->txt(
"cont_ref_images");
3479 $this->tpl->setVariable(
"TXT_REF_IMAGES", $annex_title);
3480 $this->tpl->parseCurrentBlock();
3482 $annexes[] = $annex_title;
3488 $this->tpl->setCurrentBlock(
"print_header");
3489 $this->tpl->setVariable(
"LM_TITLE", $this->lm->getTitle());
3490 if ($this->lm->getDescription() !=
"none")
3492 include_once(
"Services/MetaData/classes/class.ilMD.php");
3493 $md =
new ilMD($this->lm->getId(), 0, $this->lm->getType());
3495 foreach($md_gen->getDescriptionIds() as $id)
3497 $md_des = $md_gen->getDescription($id);
3498 $description = $md_des->getDescription();
3501 $this->tpl->setVariable(
"LM_DESCRIPTION",
3504 $this->tpl->parseCurrentBlock();
3508 foreach ($nodes2 as $node2)
3510 if ($node2[
"type"] ==
"st"
3513 for ($j=1; $j < $node2[
"depth"]; $j++)
3515 $this->tpl->setCurrentBlock(
"indent");
3517 $this->tpl->parseCurrentBlock();
3519 $this->tpl->setCurrentBlock(
"toc_entry");
3520 $this->tpl->setVariable(
"TXT_TOC_TITLE",
3522 $this->lm->isActiveNumbering(),
3523 $this->lm_set->get(
"time_scheduled_page_activation"), 0,
$this->lang));
3524 $this->tpl->parseCurrentBlock();
3529 foreach ($annexes as $annex)
3531 $this->tpl->setCurrentBlock(
"indent");
3533 $this->tpl->parseCurrentBlock();
3534 $this->tpl->setCurrentBlock(
"toc_entry");
3535 $this->tpl->setVariable(
"TXT_TOC_TITLE", $annex);
3536 $this->tpl->parseCurrentBlock();
3539 $this->tpl->setCurrentBlock(
"toc");
3540 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
3541 $this->tpl->parseCurrentBlock();
3543 $this->tpl->setCurrentBlock(
"print_start_block");
3544 $this->tpl->parseCurrentBlock();
3548 include_once
'Services/MetaData/classes/class.ilMD.php';
3549 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3550 if(is_object($lifecycle = $md->getLifecycle()))
3552 $sep = $author =
"";
3553 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
3555 $md_con = $lifecycle->getContribute($con_id);
3556 if ($md_con->getRole() ==
"Author")
3558 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
3560 $md_ent = $md_con->getEntity($ent_id);
3561 $author = $author.$sep.$md_ent->getEntity();
3568 $this->lng->loadLanguageModule(
"meta");
3569 $this->tpl->setCurrentBlock(
"author");
3570 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
3571 $this->tpl->setVariable(
"LM_AUTHOR", $author);
3572 $this->tpl->parseCurrentBlock();
3578 if (is_object($md_rights = $md->getRights()))
3580 $copyright = $md_rights->getDescription();
3581 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3584 if ($copyright !=
"")
3586 $this->lng->loadLanguageModule(
"meta");
3587 $this->tpl->setCurrentBlock(
"copyright");
3588 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3589 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3590 $this->tpl->parseCurrentBlock();
3594 $this->tpl->show(
false);
3604 require_once(
"./Modules/File/classes/class.ilObjFile.php");
3605 $fileObj =
new ilObjFile($file_id,
false);
3606 $fileObj->sendFile();
3615 require_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3617 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
3626 $this->tpl->setCurrentBlock(
"ContentStyle");
3629 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
3634 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
3636 $this->tpl->parseCurrentBlock();
3640 $this->tpl->getStandardTemplate();
3642 $this->tpl->setVariable(
"TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
3647 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_download_list.html",
"Modules/LearningModule");
3650 $this->tpl->setTitle($this->lm->getTitle());
3660 include_once
'Services/MetaData/classes/class.ilMD.php';
3661 $md =
new ilMD($this->lm->getId(),0, $this->lm->getType());
3662 if (is_object($md_rights = $md->getRights()))
3664 $copyright = $md_rights->getDescription();
3666 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
3669 if ($copyright !=
"")
3671 $this->lng->loadLanguageModule(
"meta");
3672 $this->tpl->setCurrentBlock(
"copyright");
3673 $this->tpl->setVariable(
"TXT_COPYRIGHT", $this->lng->txt(
"meta_copyright"));
3674 $this->tpl->setVariable(
"LM_COPYRIGHT", $copyright);
3675 $this->tpl->parseCurrentBlock();
3680 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
3684 $this->tpl->addBlockfile(
"DOWNLOAD_TABLE",
"download_table",
"tpl.table.html");
3687 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.download_file_row.html",
"Modules/LearningModule");
3689 $export_files = array();
3690 $types = array(
"xml",
"html",
"scorm");
3691 foreach($types as $type)
3693 if ($this->lm->getPublicExportFile($type) !=
"")
3695 if (is_file($this->lm->getExportDirectory($type).
"/".
3696 $this->lm->getPublicExportFile($type)))
3698 $dir = $this->lm->getExportDirectory($type);
3699 $size = filesize($this->lm->getExportDirectory($type).
"/".
3700 $this->lm->getPublicExportFile($type));
3701 $export_files[] = array(
"type" => $type,
3702 "file" => $this->lm->getPublicExportFile($type),
3710 $tbl->setTitle($this->lng->txt(
"download"));
3712 $tbl->setHeaderNames(array($this->lng->txt(
"cont_format"),
3713 $this->lng->txt(
"cont_file"),
3714 $this->lng->txt(
"size"), $this->lng->txt(
"date"),
3717 $cols = array(
"format",
"file",
"size",
"date",
"download");
3718 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
3719 "cmd" =>
"showDownloadList",
"cmdClass" => strtolower(get_class($this)));
3720 $tbl->setHeaderVars($cols, $header_params);
3721 $tbl->setColumnWidth(array(
"10%",
"30%",
"20%",
"20%",
"20%"));
3722 $tbl->disable(
"sort");
3725 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3726 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3727 $tbl->setLimit(
$_GET[
"limit"]);
3728 $tbl->setOffset(
$_GET[
"offset"]);
3729 $tbl->setMaxCount($this->maxcount);
3735 $tbl->disable(
"footer");
3737 $tbl->setMaxCount(count($export_files));
3738 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3741 if(count($export_files) > 0)
3744 foreach($export_files as $exp_file)
3746 if (!$exp_file[
"size"] > 0)
3751 $this->tpl->setCurrentBlock(
"tbl_content");
3752 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
3755 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3757 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
3758 $this->tpl->setVariable(
"TXT_FORMAT", strtoupper($exp_file[
"type"]));
3759 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
3761 $file_arr = explode(
"__", $exp_file[
"file"]);
3762 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
3764 $this->tpl->setVariable(
"TXT_DOWNLOAD", $this->lng->txt(
"download"));
3765 $this->ctrl->setParameter($this,
"type", $exp_file[
"type"]);
3766 $this->tpl->setVariable(
"LINK_DOWNLOAD",
3767 $this->ctrl->getLinkTarget($this,
"downloadExportFile"));
3769 $this->tpl->parseCurrentBlock();
3774 $this->tpl->setCurrentBlock(
"notfound");
3775 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3776 $this->tpl->setVariable(
"NUM_COLS", 5);
3777 $this->tpl->parseCurrentBlock();
3789 $file = $this->lm->getPublicExportFile(
$_GET[
"type"]);
3790 if ($this->lm->getPublicExportFile(
$_GET[
"type"]) !=
"")
3792 $dir = $this->lm->getExportDirectory(
$_GET[
"type"]);
3793 if (is_file($dir.
"/".
$file))
3804 function getLink($a_ref_id, $a_cmd =
"", $a_obj_id =
"", $a_frame =
"", $a_type =
"",
3805 $a_back_link =
"append", $a_anchor =
"", $a_srcstring =
"")
3816 $back_pg =
$_GET[
"back_pg"];
3817 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
3818 $a_back_link ==
"append")
3822 $back_pg = $cur_page_id.
":".$back_pg;
3826 $back_pg = $cur_page_id;
3831 if ($a_back_link ==
"reduce")
3833 $limpos = strpos(
$_GET[
"back_pg"],
":");
3837 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
3844 else if ($a_back_link !=
"keep")
3853 if (
$_GET[
"from_page"] ==
"")
3855 $this->ctrl->setParameter($this,
"from_page", $cur_page_id);
3861 if (!in_array($a_frame, array(
"",
"_blank")))
3863 $this->ctrl->setParameter($this,
"from_page",
$_GET[
"from_page"]);
3867 if ($a_anchor !=
"")
3869 $this->ctrl->setParameter($this,
"anchor", rawurlencode($a_anchor));
3871 if ($a_srcstring !=
"")
3873 $this->ctrl->setParameter($this,
"srcstring", $a_srcstring);
3878 $link = $this->ctrl->getLinkTarget($this,
"fullscreen",
"",
false,
false);
3885 $this->ctrl->setParameter($this,
"back_pg", $back_pg);
3889 $this->ctrl->setParameter($this,
"frame", $a_frame);
3891 if ($a_obj_id !=
"")
3896 $this->ctrl->setParameter($this,
"mob_id", $a_obj_id);
3900 $this->ctrl->setParameter($this,
"obj_id", $a_obj_id);
3901 $link.=
"&obj_id=".$a_obj_id;
3907 $this->ctrl->setParameter($this,
"obj_type", $a_type);
3909 $link = $this->ctrl->getLinkTarget($this, $a_cmd, $a_anchor);
3912 $this->ctrl->setParameter($this,
"frame",
"");
3913 $this->ctrl->setParameter($this,
"obj_id",
"");
3914 $this->ctrl->setParameter($this,
"mob_id",
"");
3922 case "downloadFile":
3926 $link =
"fullscreen.html";
3931 if ($a_obj_id ==
"")
3933 $a_obj_id = $this->lm_tree->getRootId();
3934 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3935 $a_obj_id = $pg_node[
"obj_id"];
3937 if ($a_type ==
"StructureObject")
3939 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
3940 $a_obj_id = $pg_node[
"obj_id"];
3942 if ($a_frame !=
"" && $a_frame !=
"_blank")
3944 if ($a_frame !=
"toc")
3946 $link =
"frame_".$a_obj_id.
"_".$a_frame.
".html";
3950 $link =
"frame_".$a_frame.
".html";
3958 $link =
"lm_pg_".$nid.
".html";
3962 $link =
"lm_pg_".$a_obj_id.
".html";
3968 $link =
"term_".$a_obj_id.
".html";
3972 $link =
"media_".$a_obj_id.
".html";
3980 $this->ctrl->clearParameters($this);
3992 $this->tpl->setCurrentBlock(
"ContentStyle");
3996 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
4001 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"content_style/content.css");
4004 $this->tpl->parseCurrentBlock();
4005 $this->tpl->addBlockFile(
"PAGE_CONTENT",
"pg_content",
"tpl.page_nopublicaccess.html",
"Modules/LearningModule");
4006 $this->tpl->setCurrentBlock(
"pg_content");
4007 $this->tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS",$this->lng->txt(
"msg_page_no_public_access"));
4008 $this->tpl->parseCurrentBlock();
4015 $target = $this->ctrl->getLinkTarget($this,
"");
4017 return $this->ctrl->getLinkTarget($this,
"");
4033 $this->offline_directory = $offdir;
4054 $file = $directory.
"/".$title;
4055 if (!($fp = @fopen(
$file,
"w+")))
4057 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
4058 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
4068 $this->tpl->setHeaderPageTitle($this->lm->getTitle());
4069 $this->tpl->fillWindowTitle();
4077 $set = $ilDB->query(
"SELECT * FROM lo_access WHERE ".
4078 "usr_id = ".$ilDB->quote($ilUser->getId(),
"integer").
" AND ".
4079 "lm_id = ".$ilDB->quote($this->lm->getRefId(),
"integer"));
4080 $res = $ilDB->fetchAssoc($set);
4083 include_once(
'Services/Tracking/classes/class.ilObjUserTracking.php');
4088 $pg_id =
$res[
"obj_id"];
4089 if(!$this->lm_tree->isInTree($pg_id))
4095 $time_diff = $read_diff = 0;
4098 if (($now-$pg_ts) <= $valid_timespan)
4100 $time_diff = $now-$pg_ts;
4108 $parent_st_ids = array();
4109 foreach($this->lm_tree->getPathFull($pg_id) as $item)
4111 if($item[
"type"] ==
"st")
4113 $parent_st_ids[] = $item[
"obj_id"];
4117 if($parent_st_ids && ($time_diff || $read_diff))
4121 $set = $ilDB->query(
"SELECT obj_id FROM lm_read_event".
4122 " WHERE ".$ilDB->in(
"obj_id", $parent_st_ids,
"",
"integer").
4123 " AND usr_id = ".$ilDB->quote($ilUser->getId(),
"integer"));
4124 while(
$row = $ilDB->fetchAssoc($set))
4126 $ex_st[] =
$row[
"obj_id"];
4130 $missing_st = array_diff($parent_st_ids, $ex_st);
4131 if(
sizeof($missing_st))
4133 foreach($missing_st as $st_id)
4136 "obj_id" => array(
"integer", $st_id),
4137 "usr_id" => array(
"integer", $ilUser->getId())
4139 $ilDB->insert(
"lm_read_event", $fields);
4144 $ilDB->manipulate(
"UPDATE lm_read_event SET".
4145 " read_count = read_count + ".$ilDB->quote($read_diff,
"integer").
4146 " , spent_seconds = spent_seconds + ".$ilDB->quote($time_diff,
"integer").
4147 " , last_access = ".$ilDB->quote($now,
"integer").
4148 " WHERE ".$ilDB->in(
"obj_id", $parent_st_ids,
"",
"integer").
4149 " AND usr_id = ".$ilDB->quote($ilUser->getId(),
"integer"));
4162 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
4163 include_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
4166 return new ilLMPageGUI($a_id, 0,
false, $this->lang);
4179 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
4182 return new ilLMPage($a_id, 0, $this->lang);