ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMPresentationGUI Class Reference

Class ilLMPresentationGUI. More...

+ Collaboration diagram for ilLMPresentationGUI:

Public Member Functions

 initByRequest ($query_params, bool $embed_mode=false)
 Init services and this class by request params. More...
 
 getService ()
 Get service. More...
 
 injectTemplate ($tpl)
 Inject template. More...
 
 executeCommand ()
 
 offlineMode ()
 checks wether offline content generation is activated More...
 
 getExportFormat ()
 get export format More...
 
 nop ()
 this dummy function is needed for offline package creation More...
 
 attrib2arr ($a_attributes)
 
 getCurrentFrameSet ()
 get frames of current frame set More...
 
 determineLayout ()
 Determine layout. More...
 
 resume ()
 
 layout ($a_xml="main.xml", $doShow=true)
 generates frame layout More...
 
 saveFrameUrl ()
 Save frame url. More...
 
 fullscreen ()
 
 media ()
 
 glossary ()
 
 page ()
 
 ilMainMenu ()
 output main menu More...
 
 ilTOC ($a_get_explorer=false)
 table of contents More...
 
 getLMPresentationTitle ()
 Get lm presentationtitle. More...
 
 ilLMMenu ()
 output learning module menu More...
 
 setHeader ()
 output lm header More...
 
 ilLMSubMenu ()
 output learning module submenu More...
 
 redrawHeaderAction ()
 Redraw header action. More...
 
 addHeaderAction ()
 Add header action. More...
 
 getHeaderAction ($a_redraw=false)
 Add header action. More...
 
 ilLMNotes ()
 output notes of page More...
 
 ilLocator ($a_std_templ_loaded=false)
 locator More...
 
 getCurrentPageId ()
 Get the current page id. More...
 
 getLayoutLinkTargets ()
 
 getContent ($skip_nav=false)
 process <ilPage> content tag More...
 
 updatePageRating ()
 
 basicPageGuiInit (\ilLMPageGUI $a_page_gui)
 Basic page gui initialisation. More...
 
 ilGlossary ()
 show glossary term More...
 
 ilMedia ()
 output media More...
 
 ilJavaScript ($a_inline="", $a_file="", $a_location="")
 Puts JS into template. More...
 
 getSuccessorPage ()
 Get successor page. More...
 
 processNodes (&$a_content, &$a_node)
 
 buildTag ($type, $name, $attr="")
 generate a tag with given name and attributes More...
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 showInfoScreen ()
 info screen call from inside learning module More...
 
 outputInfoScreen ($a_standard_locator=false)
 info screen More...
 
 showPrintViewSelection ()
 show selection screen for print view More...
 
 initPrintViewSelectionForm ()
 Init print view selection form. More...
 
 showPrintView ()
 show print view More...
 
 downloadFile ()
 download file of file lists More...
 
 showDownloadList ()
 show download list More...
 
 downloadExportFile ()
 send download file (xml/html) More...
 
 getFocusLink ($a_ref_id, $a_obj_id, $a_return_ref_id)
 Get focused link (used in learning objectives courses) More...
 
 showMessageScreen ($a_content)
 Show message screen. More...
 
 showNoPublicAccess ()
 Show info message, if page is not accessible in public area. More...
 
 showNoPageAccess ()
 Show info message, if page is not accessible in public area. More...
 
 showNavRestrictionDueToQuestions ()
 Show message if navigation to page is not allowed due to unanswered questions. More...
 
 getSourcecodeDownloadLink ()
 
 getOfflineDirectory ()
 get offline directory More...
 
 handleCodeParagraph ($page_id, $paragraph_id, $title, $text)
 store paragraph into file directory files/codefile_$pg_id_$paragraph_id/downloadtitle More...
 
 getLMPageGUI ($a_id)
 Get lm page gui object. More...
 
 getLMPage ($a_id, $a_type="")
 Get lm page object. More...
 
 refreshToc ()
 Refresh toc (called if questions have been answered correctly) More...
 
 observeNoteAction ($a_lm_id, $a_page_id, $a_type, $a_action, $a_note_id)
 Generate new ilNote and send Notifications to the users informing that there are new comments in the LM. More...
 
 getHTML ($pars)
 Get HTML (called by kios mode through ilCtrl) More...
 

Data Fields

 $tpl
 
 $lng
 
 $layout_doc
 
 $offline
 
 $offline_directory
 
 $chapter_has_no_active_page = false
 
 $deactivated_page = false
 

Protected Member Functions

 getTracker ()
 Get tracker. More...
 
 addResourceFiles ()
 Add resource files. More...
 
 setContentStyles ()
 Set content style. More...
 
 setSystemStyle ()
 Set system style. More...
 
 getPageContent ()
 Get page content. More...
 
 renderRating ()
 Render rating. More...
 
 initScreenHead ($a_active_tab="info")
 
 filterNonAccessibleNode ($nodes)
 
 renderPageTitle ()
 
 renderTabs ($active_tab, $current_page_id)
 Render tabs. More...
 

Protected Attributes

 $user
 
 $rbacsystem
 
 $ctrl
 
 $error
 
 $nav_history
 
 $access
 
 $settings
 
 $main_menu
 
 $locator
 
 $tree
 
 $help
 
 $lm
 
 $embed_mode = false
 
 $current_page_id = 0
 
 $focus_id = 0
 
 $export_all_languages = false
 
 $requested_back_pg
 
 $requested_search_string
 
 $requested_focus_return
 
 $requested_ref_id
 
 $requested_obj_id
 
 $requested_obj_type
 
 $requested_transl
 
 $requested_frame
 
 $linker
 
 $service
 
 $ui
 
 $toolbar
 
 $additional_content = []
 
 $ot
 

Detailed Description

Member Function Documentation

◆ addHeaderAction()

ilLMPresentationGUI::addHeaderAction ( )

Add header action.

Definition at line 1020 of file class.ilLMPresentationGUI.php.

References getHeaderAction().

Referenced by layout().

1021  {
1022  $this->tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
1023  }
getHeaderAction($a_redraw=false)
Add header action.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addResourceFiles()

ilLMPresentationGUI::addResourceFiles ( )
protected

Add resource files.

Definition at line 730 of file class.ilLMPresentationGUI.php.

References $store, ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), ilGlyphGUI\CLOSE, ilGlyphGUI\get(), ilUIFramework\init(), ilYuiUtil\initConnection(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), and offlineMode().

Referenced by getHTML(), and layout().

731  {
732  iljQueryUtil::initjQuery($this->tpl);
733  iljQueryUtil::initjQueryUI($this->tpl);
734  ilUIFramework::init($this->tpl);
735 
736  if (!$this->offlineMode()) {
739 
740  $this->tpl->addJavascript("./Modules/LearningModule/js/LearningModule.js");
741  $close_call = "il.LearningModule.setCloseHTML('" . ilGlyphGUI::get(ilGlyphGUI::CLOSE) . "');";
742  $this->tpl->addOnLoadCode($close_call);
743 
744  //$store->set("cf_".$this->lm->getId());
745 
746  // handle initial content
747  if ($this->requested_frame == "") {
748  $store = new ilSessionIStorage("lm");
749  $last_frame_url = $store->get("cf_" . $this->lm->getId());
750  if ($last_frame_url != "") {
751  $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
752  }
753 
754  if (true) {
755  $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" .
756  $this->ctrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');
757  il.LearningModule.openInitFrames();
758  ");
759  }
760  $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" .
761  $this->ctrl->getLinkTarget($this, "refreshToc", "", false, false) . "');
762  ");
763  }
764 
765  // from main menu
766  // $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
767  $this->tpl->addJavascript("./Services/Navigation/js/ServiceNavigation.js");
768  ilYuiUtil::initConnection($this->tpl);
769  }
770  }
$store
Definition: metadata.php:90
static get($a_glyph, $a_text="")
Get glyph html.
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
offlineMode()
checks wether offline content generation is activated
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static init(ilGlobalTemplateInterface $a_tpl=null)
Init.
Session based immediate storage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attrib2arr()

ilLMPresentationGUI::attrib2arr (   $a_attributes)

Definition at line 483 of file class.ilLMPresentationGUI.php.

Referenced by layout(), and processNodes().

484  {
485  $attr = array();
486  if (!is_array($a_attributes)) {
487  return $attr;
488  }
489  foreach ($a_attributes as $attribute) {
490  $attr[$attribute->name()] = $attribute->value();
491  }
492  return $attr;
493  }
+ Here is the caller graph for this function:

◆ basicPageGuiInit()

ilLMPresentationGUI::basicPageGuiInit ( \ilLMPageGUI  $a_page_gui)

Basic page gui initialisation.

Parameters

Definition at line 1608 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), ilObjStyleSheet\getEffectiveContentStyleId(), getOfflineDirectory(), offlineMode(), ilPageObjectGUI\setFileDownloadLink(), ilPageObjectGUI\setFullscreenLink(), ilPageObjectGUI\setOfflineDirectory(), ilPageObjectGUI\setOutputMode(), ilPageObjectGUI\setSourcecodeDownloadScript(), and ilPageObjectGUI\setStyleId().

Referenced by executeCommand().

1609  {
1610  $a_page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
1611  $this->lm->getStyleSheetId(),
1612  "lm"
1613  ));
1614  if (!$this->offlineMode()) {
1615  $a_page_gui->setOutputMode("presentation");
1616  $this->fill_on_load_code = true;
1617  } else {
1618  $a_page_gui->setOutputMode("offline");
1619  $a_page_gui->setOfflineDirectory($this->getOfflineDirectory());
1620  $this->fill_on_load_code = false;
1621  }
1622  if (!$this->offlineMode()) {
1623  $this->ctrl->setParameter($this, "obj_id", $this->getCurrentPageId()); // see #22403
1624  }
1625  $a_page_gui->setFileDownloadLink($this->linker->getLink("downloadFile"));
1626  $a_page_gui->setSourcecodeDownloadScript($this->linker->getLink(
1627  "sourcecodeDownload",
1628  $this->getCurrentPageId()
1629  ));
1630  if (!$this->offlineMode()) {
1631  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1632  }
1633  $a_page_gui->setFullscreenLink($this->linker->getLink("fullscreen"));
1634  $a_page_gui->setSourcecodeDownloadScript($this->linker->getLink("download_paragraph"));
1635  }
getOfflineDirectory()
get offline directory
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTag()

ilLMPresentationGUI::buildTag (   $type,
  $name,
  $attr = "" 
)

generate a tag with given name and attributes

Parameters
string"start" | "end" | "" for starting or ending tag or complete tag
stringelement/tag name
arrayarray of attributes

Definition at line 1878 of file class.ilLMPresentationGUI.php.

References $name, and $type.

Referenced by processNodes().

1879  {
1880  $tag = "<";
1881 
1882  if ($type == "end") {
1883  $tag .= "/";
1884  }
1885 
1886  $tag .= $name;
1887 
1888  if (is_array($attr)) {
1889  foreach ($attr as $k => $v) {
1890  $tag .= " " . $k . "=\"$v\"";
1891  }
1892  }
1893 
1894  if ($type == "") {
1895  $tag .= "/";
1896  }
1897 
1898  $tag .= ">\n";
1899 
1900  return $tag;
1901  }
$type
if($format !==null) $name
Definition: metadata.php:230
+ Here is the caller graph for this function:

◆ determineLayout()

ilLMPresentationGUI::determineLayout ( )

Determine layout.

Returns
string

Definition at line 507 of file class.ilLMPresentationGUI.php.

Referenced by layout().

507  : string
508  {
509  return "standard";
510  }
+ Here is the caller graph for this function:

◆ downloadExportFile()

ilLMPresentationGUI::downloadExportFile ( )

send download file (xml/html)

Definition at line 2872 of file class.ilLMPresentationGUI.php.

References $_GET, ilUtil\deliverFile(), and exit.

2873  {
2874  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2875  return;
2876  }
2877 
2878  $base_type = explode("_", $_GET["type"]);
2879  $base_type = $base_type[0];
2880  $file = $this->lm->getPublicExportFile($base_type);
2881  if ($this->lm->getPublicExportFile($base_type) != "") {
2882  $dir = $this->lm->getExportDirectory($_GET["type"]);
2883  if (is_file($dir . "/" . $file)) {
2884  ilUtil::deliverFile($dir . "/" . $file, $file);
2885  exit;
2886  }
2887  }
2888  }
exit
Definition: login.php:29
$_GET["client_id"]
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPresentationGUI::downloadFile ( )

download file of file lists

Definition at line 2810 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), and getLMPageGUI().

2811  {
2812  $page_gui = $this->getLMPageGUI($this->getCurrentPageId());
2813  $page_gui->downloadFile();
2814  }
getLMPageGUI($a_id)
Get lm page gui object.
getCurrentPageId()
Get the current page id.
+ Here is the call graph for this function:

◆ executeCommand()

ilLMPresentationGUI::executeCommand ( )
Exceptions
ilCtrlException
ilLMPresentationException

Definition at line 354 of file class.ilLMPresentationGUI.php.

References $_GET, $access, $ctrl, $error, $ilErr, $ilUser, $lng, $nav_history, $requested_obj_id, $ret, $user, basicPageGuiInit(), getCurrentPageId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getLMPageGUI(), initScreenHead(), layout(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), ilNotification\setNotification(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, and user().

355  {
356  $ilNavigationHistory = $this->nav_history;
357  $ilAccess = $this->access;
358  $lng = $this->lng;
359  $ilCtrl = $this->ctrl;
362 
363  // check read permission and parent conditions
364  // todo: replace all this by ilAccess call
365  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id) &&
366  (!(($this->ctrl->getCmd() == "infoScreen" || $this->ctrl->getNextClass() == "ilinfoscreengui")
367  && $ilAccess->checkAccess("visible", "", $this->requested_ref_id)))) {
368  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->WARNING);
369  }
370 
371  $next_class = $this->ctrl->getNextClass($this);
372  $cmd = $this->ctrl->getCmd("layout", array("showPrintView"));
373 
374 
376  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
377  $ilNavigationHistory->addItem($this->requested_ref_id, $this->ctrl->getLinkTarget($this), "lm");
378  $this->ctrl->setParameter($this, "obj_id", $obj_id);
379 
380  switch ($next_class) {
381  case "ilnotegui":
382  $ret = $this->layout();
383  break;
384 
385  case "ilinfoscreengui":
386  $ret = $this->outputInfoScreen();
387  break;
388 
389  case "ilcommonactiondispatchergui":
391  $gui->enableCommentsSettings(false);
392  $this->ctrl->forwardCommand($gui);
393  break;
394 
395  case "illmpagegui":
396  $page_gui = $this->getLMPageGUI($this->requested_obj_id);
397  $this->basicPageGuiInit($page_gui);
398  $ret = $ilCtrl->forwardCommand($page_gui);
399  break;
400 
401  case "ilassgenfeedbackpagegui":
402  $page_gui = new ilAssGenFeedbackPageGUI($_GET["pg_id"]);
403  //$this->basicPageGuiInit($page_gui);
404  $ret = $ilCtrl->forwardCommand($page_gui);
405  break;
406 
407  case "ilglossarydefpagegui":
408  $page_gui = new ilGlossaryDefPageGUI($this->requested_obj_id);
409  $this->basicPageGuiInit($page_gui);
410  $ret = $ilCtrl->forwardCommand($page_gui);
411  break;
412 
413  case "illearningprogressgui":
414  $this->initScreenHead("learning_progress");
415  $new_gui = new ilLearningProgressGUI(
417  $this->requested_ref_id,
418  $ilUser->getId()
419  );
420  $this->ctrl->forwardCommand($new_gui);
421  break;
422 
423  case "ilratinggui":
424  $rating_gui = new ilRatingGUI();
425  $rating_gui->setObject($this->lm->getId(), "lm", $this->requested_obj_id, "lm");
426  $this->ctrl->forwardCommand($rating_gui);
427  break;
428 
429  default:
430  if ($_GET["ntf"]) {
431  switch ($_GET["ntf"]) {
432  case 1:
433  ilNotification::setNotification(ilNotification::TYPE_LM, $this->user->getId(), $this->lm->getId(), false);
434  break;
435 
436  case 2:
437  ilNotification::setNotification(ilNotification::TYPE_LM, $this->user->getId(), $this->lm->getId(), true);
438  break;
439 
440  case 3:
442  break;
443 
444  case 4:
446  break;
447  }
448  $ilCtrl->redirect($this, "layout");
449  }
450  $ret = $this->$cmd();
451  break;
452  }
453  }
outputInfoScreen($a_standard_locator=false)
info screen
Generic feedback page GUI class.
$_GET["client_id"]
getLMPageGUI($a_id)
Get lm page gui object.
user()
Definition: user.php:4
$ilErr
Definition: raiseError.php:18
Class ilRatingGUI.
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
getCurrentPageId()
Get the current page id.
initScreenHead($a_active_tab="info")
Glossary definition page GUI class.
$ret
Definition: parser.php:6
layout($a_xml="main.xml", $doShow=true)
generates frame layout
$ilUser
Definition: imgupload.php:18
Class ilObjUserTrackingGUI.
basicPageGuiInit(\ilLMPageGUI $a_page_gui)
Basic page gui initialisation.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ filterNonAccessibleNode()

ilLMPresentationGUI::filterNonAccessibleNode (   $nodes)
protected
Parameters
array$nodes
Returns
array

Definition at line 2229 of file class.ilLMPresentationGUI.php.

References getTracker(), and offlineMode().

Referenced by showPrintViewSelection().

2230  {
2231  $tracker = $this->getTracker();
2232  // if navigation is restricted based on correct answered questions
2233  // check if we have preceeding pages including unsanswered/incorrect answered questions
2234  if (!$this->offlineMode()) {
2235  if ($this->lm->getRestrictForwardNavigation()) {
2236  $nodes = array_filter($nodes, function ($node) use ($tracker) {
2237  return !$tracker->hasPredIncorrectAnswers($node["child"]);
2238  });
2239  }
2240  }
2241  return $nodes;
2242  }
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fullscreen()

ilLMPresentationGUI::fullscreen ( )

Definition at line 789 of file class.ilLMPresentationGUI.php.

References media().

790  {
791  return $this->media();
792  }
+ Here is the call graph for this function:

◆ getContent()

ilLMPresentationGUI::getContent (   $skip_nav = false)

process <ilPage> content tag

Parameters
$a_page_nodepage node
int$a_page_idheader / footer page id
Returns
string

Definition at line 1478 of file class.ilLMPresentationGUI.php.

References $tpl, getPageContent(), renderRating(), setContentStyles(), and user().

Referenced by getHTML(), and layout().

1479  {
1480  $this->fill_on_load_code = true;
1481  $this->setContentStyles();
1482 
1483  $tpl = new ilTemplate("tpl.lm_content.html", true, true, "Modules/LearningModule/Presentation");
1484 
1485  // call ilLMContentRendererGUI
1486 
1487  $navigation_renderer = new ilLMNavigationRendererGUI(
1488  $this->service,
1489  $this,
1490  $this->lng,
1491  $this->user,
1492  $this->tpl,
1493  $this->requested_obj_id,
1494  $this->requested_back_pg,
1495  $this->requested_frame
1496  );
1497 
1498 
1499  if (!$skip_nav) {
1500  $tpl->setVariable("TOP_NAVIGATION", $navigation_renderer->renderTop());
1501  $tpl->setVariable("BOTTOM_NAVIGATION", $navigation_renderer->renderBottom());
1502  }
1503  $tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
1504  $tpl->setVariable("RATING", $this->renderRating());
1505 
1506 
1507  return $tpl->get();
1508  }
user()
Definition: user.php:4
getPageContent()
Get page content.
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentFrameSet()

ilLMPresentationGUI::getCurrentFrameSet ( )

get frames of current frame set

Definition at line 498 of file class.ilLMPresentationGUI.php.

499  {
500  return $this->frames;
501  }

◆ getCurrentPageId()

ilLMPresentationGUI::getCurrentPageId ( )

Get the current page id.

Returns
bool|int current page id

Definition at line 1309 of file class.ilLMPresentationGUI.php.

References $current_page_id, $ilUser, $requested_obj_id, $user, ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ANONYMOUS_USER_ID, and offlineMode().

Referenced by basicPageGuiInit(), downloadFile(), executeCommand(), getHeaderAction(), getSuccessorPage(), ilLMMenu(), ilLMNotes(), ilLMSubMenu(), ilMainMenu(), renderRating(), and showPrintView().

1310  {
1311  return $this->service->getNavigationStatus()->getCurrentPage();
1312 
1313  $ilUser = $this->user;
1314 
1315  if (!$this->offlineMode() && $this->current_page_id !== false) {
1316  return $this->current_page_id;
1317  }
1318 
1319  $this->chapter_has_no_active_page = false;
1320  $this->deactivated_page = false;
1321 
1322  // determine object id
1323  if (empty($this->requested_obj_id)) {
1324  $obj_id = $this->lm_tree->getRootId();
1325  } else {
1327  $active = ilLMPage::_lookupActive(
1328  $obj_id,
1329  $this->lm->getType(),
1330  $this->lm_set->get("time_scheduled_page_activation")
1331  );
1332 
1333  if (!$active &&
1335  $this->deactivated_page = true;
1336  }
1337  }
1338 
1339  // obj_id not in tree -> it is a unassigned page -> return page id
1340  if (!$this->lm_tree->isInTree($obj_id)) {
1341  return $obj_id;
1342  }
1343 
1344  $curr_node = $this->lm_tree->getNodeData($obj_id);
1345 
1346  $active = ilLMPage::_lookupActive(
1347  $obj_id,
1348  $this->lm->getType(),
1349  $this->lm_set->get("time_scheduled_page_activation")
1350  );
1351 
1352  if ($curr_node["type"] == "pg" &&
1353  $active) { // page in tree -> return page id
1354  $page_id = $curr_node["obj_id"];
1355  } else { // no page -> search for next page and return its id
1356  $succ_node = true;
1357  $active = false;
1358  $page_id = $obj_id;
1359  while ($succ_node && !$active) {
1360  $succ_node = $this->lm_tree->fetchSuccessorNode($page_id, "pg");
1361  $page_id = $succ_node["obj_id"];
1362  $active = ilLMPage::_lookupActive(
1363  $page_id,
1364  $this->lm->getType(),
1365  $this->lm_set->get("time_scheduled_page_activation")
1366  );
1367  }
1368 
1369  if ($succ_node["type"] != "pg") {
1370  $this->chapter_has_no_active_page = true;
1371  return 0;
1372  }
1373 
1374  // if public access get first public page in chapter
1375  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
1376  $this->lm_gui->object->getPublicAccessMode() == 'selected') {
1377  $public = ilLMObject::_isPagePublic($page_id);
1378 
1379  while ($public === false && $page_id > 0) {
1380  $succ_node = $this->lm_tree->fetchSuccessorNode($page_id, 'pg');
1381  $page_id = $succ_node['obj_id'];
1382  $public = ilLMObject::_isPagePublic($page_id);
1383  }
1384  }
1385 
1386  // check whether page found is within "clicked" chapter
1387  if ($this->lm_tree->isInTree($page_id)) {
1388  $path = $this->lm_tree->getPathId($page_id);
1389  if (!in_array($this->requested_obj_id, $path)) {
1390  $this->chapter_has_no_active_page = true;
1391  }
1392  }
1393  }
1394 
1395  $this->current_page_id = $page_id;
1396  return $page_id;
1397  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
offlineMode()
checks wether offline content generation is activated
$ilUser
Definition: imgupload.php:18
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportFormat()

ilLMPresentationGUI::getExportFormat ( )

get export format

Returns
string export format

Definition at line 471 of file class.ilLMPresentationGUI.php.

Referenced by renderTabs().

472  {
473  return $this->export_format;
474  }
+ Here is the caller graph for this function:

◆ getFocusLink()

ilLMPresentationGUI::getFocusLink (   $a_ref_id,
  $a_obj_id,
  $a_return_ref_id 
)

Get focused link (used in learning objectives courses)

Parameters
int$a_ref_idreference id of learning module
int$a_obj_idchapter or page id
int$a_return_ref_idreturn ref id
Returns
string link

Definition at line 2899 of file class.ilLMPresentationGUI.php.

2900  {
2901  return "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $a_ref_id . "&amp;obj_id=" . $a_obj_id . "&amp;focus_id=" .
2902  $a_obj_id . "&amp;focus_return=" . $a_return_ref_id;
2903  }

◆ getHeaderAction()

ilLMPresentationGUI::getHeaderAction (   $a_redraw = false)

Add header action.

Definition at line 1028 of file class.ilLMPresentationGUI.php.

References $access, $embed_mode, $ilSetting, $settings, $tpl, ANONYMOUS_USER_ID, getCurrentPageId(), ilUtil\getImagePath(), ilNotification\hasNotification(), ilNotification\hasOptOut(), offlineMode(), ilCommonActionDispatcherGUI\setSubObject(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, ilCommonActionDispatcherGUI\TYPE_REPOSITORY, and user().

Referenced by addHeaderAction(), getHTML(), and redrawHeaderAction().

1029  {
1030  if ($this->offline) {
1031  return;
1032  }
1033  $ilAccess = $this->access;
1035  $tpl = $this->tpl;
1036 
1037  $lm_id = $this->lm->getId();
1038  $pg_id = $this->getCurrentPageId();
1039 
1040  $this->lng->loadLanguageModule("content");
1041 
1042  $dispatcher = new ilCommonActionDispatcherGUI(
1044  $ilAccess,
1045  $this->lm->getType(),
1046  $this->lm->getRefId(),
1047  $this->lm->getId()
1048  );
1049  $dispatcher->setSubObject("pg", $this->getCurrentPageId());
1050 
1051  $this->ctrl->setParameter($this, "embed_mode", $this->embed_mode);
1052  $this->ctrl->setParameterByClass("ilnotegui", "embed_mode", $this->embed_mode);
1053  $this->ctrl->setParameterByClass("iltagginggui", "embed_mode", $this->embed_mode);
1054  ilObjectListGUI::prepareJSLinks(
1055  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
1056  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
1057  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false),
1058  $this->tpl
1059  );
1060 
1061  $lg = $dispatcher->initHeaderAction();
1062  if (!$ilSetting->get("disable_notes")) {
1063  $lg->enableNotes(true);
1064  if (!$this->embed_mode) {
1065  $lg->enableComments($this->lm->publicNotes(), false);
1066  }
1067  }
1068 
1069  if ($this->lm->hasRating() && !$this->offlineMode()) {
1070  $lg->enableRating(
1071  true,
1072  $this->lng->txt("lm_rating"),
1073  false,
1074  array("ilcommonactiondispatchergui", "ilratinggui")
1075  );
1076  }
1077 
1078  // notification
1079  if ($this->user->getId() != ANONYMOUS_USER_ID && !$this->embed_mode) {
1080  if (ilNotification::hasNotification(ilNotification::TYPE_LM, $this->user->getId(), $lm_id)) {
1081  $this->ctrl->setParameter($this, "ntf", 1);
1082  if (ilNotification::hasOptOut($lm_id)) {
1083  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_lm");
1084  }
1085 
1086  $lg->addHeaderIcon(
1087  "not_icon",
1088  ilUtil::getImagePath("notification_on.svg"),
1089  $this->lng->txt("cont_notification_activated")
1090  );
1091  } else {
1092  $this->ctrl->setParameter($this, "ntf", 2);
1093  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_lm");
1094 
1095  if (ilNotification::hasNotification(ilNotification::TYPE_LM_PAGE, $this->user->getId(), $pg_id)) {
1096  $this->ctrl->setParameter($this, "ntf", 3);
1097  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_page");
1098 
1099  $lg->addHeaderIcon(
1100  "not_icon",
1101  ilUtil::getImagePath("notification_on.svg"),
1102  $this->lng->txt("cont_page_notification_activated")
1103  );
1104  } else {
1105  $this->ctrl->setParameter($this, "ntf", 4);
1106  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_page");
1107 
1108  $lg->addHeaderIcon(
1109  "not_icon",
1110  ilUtil::getImagePath("notification_off.svg"),
1111  $this->lng->txt("cont_notification_deactivated")
1112  );
1113  }
1114  }
1115  $this->ctrl->setParameter($this, "ntf", "");
1116  }
1117 
1118  if (!$this->offline) {
1119  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1120  if ($this->getCurrentPageId() <= 0) {
1121  $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
1122  } else {
1123  $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
1124  "&obj_id=" . $this->getCurrentPageId() . "&to_page=1";
1125  }
1126  $lg->addCustomCommand($link, "edit_page");
1127  }
1128  }
1129 
1130 
1131  if (!$a_redraw) {
1132  return $lg->getHeaderAction($this->tpl);
1133  } else {
1134  // we need to add onload code manually (rating, comments, etc.)
1135  return $lg->getHeaderAction() .
1136  $tpl->getOnLoadCodeForAsynch();
1137  }
1138  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
const ANONYMOUS_USER_ID
Definition: constants.php:25
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
user()
Definition: user.php:4
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
global $ilSetting
Definition: privfeed.php:17
Class ilCommonActionDispatcherGUI.
setSubObject($a_sub_obj_type, $a_sub_obj_id)
Set sub object attributes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilLMPresentationGUI::getHTML (   $pars)

Get HTML (called by kios mode through ilCtrl)

Parameters
$pars
Returns
string|void
Exceptions
ilLMPresentationException

Definition at line 3125 of file class.ilLMPresentationGUI.php.

References $tpl, addResourceFiles(), getContent(), getHeaderAction(), ilLMNotes(), and renderRating().

3126  {
3127  $this->addResourceFiles();
3128  switch ($pars["cmd"]) {
3129  case "layout":
3130  $tpl = new ilTemplate("tpl.embedded_view.html", true, true, "Modules/LearningModule");
3131  $tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
3132  $tpl->setVariable("PAGE_RATING", $this->renderRating());
3133  $tpl->setVariable("PAGE", $this->getContent(true));
3134  $tpl->setVariable("COMMENTS", $this->ilLMNotes());
3135  return $tpl->get();
3136  }
3137  return "";
3138  }
getContent($skip_nav=false)
process <ilPage> content tag
getHeaderAction($a_redraw=false)
Add header action.
addResourceFiles()
Add resource files.
ilLMNotes()
output notes of page
+ Here is the call graph for this function:

◆ getLayoutLinkTargets()

ilLMPresentationGUI::getLayoutLinkTargets ( )

Definition at line 1400 of file class.ilLMPresentationGUI.php.

References $i, $res, $type, exit, xpath_eval(), and xpath_new_context().

1401  {
1402  if (!is_object($this->layout_doc)) {
1403  return array();
1404  }
1405 
1406  $xpc = xpath_new_context($this->layout_doc);
1407 
1408  $path = "/ilLayout/ilLinkTargets/LinkTarget";
1409  $res = xpath_eval($xpc, $path);
1410  $targets = array();
1411  for ($i = 0; $i < count($res->nodeset); $i++) {
1412  $type = $res->nodeset[$i]->get_attribute("Type");
1413  $frame = $res->nodeset[$i]->get_attribute("Frame");
1414  $onclick = $res->nodeset[$i]->get_attribute("OnClick");
1415  $targets[$type] = array("Type" => $type, "Frame" => $frame, "OnClick" => $onclick);
1416  }
1417  var_dump($targets);
1418  exit;
1419  return $targets;
1420  }
exit
Definition: login.php:29
xpath_new_context($dom_document)
$type
xpath_eval($xpath_context, $eval_str, $contextnode=null)
foreach($_POST as $key=> $value) $res
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ getLMPage()

ilLMPresentationGUI::getLMPage (   $a_id,
  $a_type = "" 
)

Get lm page object.

Parameters

Definition at line 3026 of file class.ilLMPresentationGUI.php.

References $lang, $type, and ilPageObject\_exists().

Referenced by ilMedia().

3027  {
3028  $type = ($a_type == "mep")
3029  ? "mep"
3030  : "lm";
3031 
3032  $lang = $this->lang;
3033  if (!ilPageObject::_exists($type, $a_id, $lang)) {
3034  $lang = "-";
3035  if ($this->lang != "-" && ilPageObject::_exists($type, $a_id, $this->ot->getFallbackLanguage())) {
3036  $lang = $this->ot->getFallbackLanguage();
3037  }
3038  }
3039 
3040  switch ($type) {
3041  case "mep":
3042  return new ilMediaPoolPage($a_id, 0, $lang);
3043  default:
3044  return new ilLMPage($a_id, 0, $lang);
3045  }
3046  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
$type
Class ilMediaPoolPage.
$lang
Definition: xapiexit.php:8
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLMPageGUI()

ilLMPresentationGUI::getLMPageGUI (   $a_id)

Get lm page gui object.

Parameters

Definition at line 3008 of file class.ilLMPresentationGUI.php.

References ilPageObject\_exists().

Referenced by downloadFile(), executeCommand(), and showPrintView().

3009  {
3010  $concrete_lang = $this->service->getPresentationStatus()->getConcreteLang();
3011  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
3012  return new ilLMPageGUI($a_id, 0, false, $this->lang, $concrete_lang);
3013  }
3014  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->ot->getFallbackLanguage())) {
3015  return new ilLMPageGUI($a_id, 0, false, $this->ot->getFallbackLanguage(), $concrete_lang);
3016  }
3017  return new ilLMPageGUI($a_id, 0, false, "", $concrete_lang);
3018  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Extension of ilPageObjectGUI for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLMPresentationTitle()

ilLMPresentationGUI::getLMPresentationTitle ( )

Get lm presentationtitle.

Parameters

Definition at line 934 of file class.ilLMPresentationGUI.php.

Referenced by ilLocator(), initScreenHead(), renderPageTitle(), setHeader(), showPrintView(), and showPrintViewSelection().

935  {
936  return $this->service->getPresentationStatus()->getLMPresentationTitle();
937  }
+ Here is the caller graph for this function:

◆ getOfflineDirectory()

ilLMPresentationGUI::getOfflineDirectory ( )

get offline directory

Returns
directory where to store offline files

current used in code paragraph

Definition at line 2969 of file class.ilLMPresentationGUI.php.

References $offline_directory.

Referenced by basicPageGuiInit(), handleCodeParagraph(), and ilGlossary().

2970  {
2971  return $this->offline_directory;
2972  }
+ Here is the caller graph for this function:

◆ getPageContent()

ilLMPresentationGUI::getPageContent ( )
protected

Get page content.

Definition at line 1513 of file class.ilLMPresentationGUI.php.

References help(), and user().

Referenced by getContent(), and page().

1514  {
1515  $content_renderer = new ilLMContentRendererGUI(
1516  $this->service,
1517  $this,
1518  $this->lng,
1519  $this->ctrl,
1520  $this->access,
1521  $this->user,
1522  $this->help,
1523  $this->requested_obj_id
1524  );
1525 
1526  return $content_renderer->render();
1527  }
user()
Definition: user.php:4
help()
Definition: help.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getService()

ilLMPresentationGUI::getService ( )

Get service.

Returns
ilLMPresentationService

Definition at line 325 of file class.ilLMPresentationGUI.php.

References $service.

Referenced by renderTabs().

+ Here is the caller graph for this function:

◆ getSourcecodeDownloadLink()

ilLMPresentationGUI::getSourcecodeDownloadLink ( )

Definition at line 2949 of file class.ilLMPresentationGUI.php.

References ilUtil\appendUrlParameterString(), and offlineMode().

2950  {
2951  if (!$this->offlineMode()) {
2952  //$this->ctrl->setParameter($this, session_name(), session_id());
2953  $target = $this->ctrl->getLinkTarget($this, "");
2954  $target = ilUtil::appendUrlParameterString($target, session_name() . "=" . session_id());
2955  return $this->ctrl->getLinkTarget($this, "");
2956  } else {
2957  return "";
2958  }
2959  }
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
offlineMode()
checks wether offline content generation is activated
+ Here is the call graph for this function:

◆ getSuccessorPage()

ilLMPresentationGUI::getSuccessorPage ( )

Get successor page.

Parameters

Definition at line 1750 of file class.ilLMPresentationGUI.php.

References $ilUser, $requested_obj_id, $user, ilLMObject\_isPagePublic(), ilPageObject\_lookupActivationData(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ANONYMOUS_USER_ID, getCurrentPageId(), and ilUtil\now().

1751  {
1752  $ilUser = $this->user;
1753 
1754  $page_id = $this->getCurrentPageId();
1755 
1756  if (empty($page_id)) {
1757  return 0;
1758  }
1759 
1760  // determine successor page_id
1761  $found = false;
1762 
1763  // empty chapter
1764  if ($this->chapter_has_no_active_page &&
1765  ilLMObject::_lookupType($this->requested_obj_id) == "st") {
1766  $c_id = $this->requested_obj_id;
1767  } else {
1768  if ($this->deactivated_page) {
1769  $c_id = $this->requested_obj_id;
1770  } else {
1771  $c_id = $page_id;
1772  }
1773  }
1774  while (!$found) {
1775  $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
1776  $c_id = $succ_node["obj_id"];
1777 
1778  $active = ilLMPage::_lookupActive(
1779  $c_id,
1780  $this->lm->getType(),
1781  $this->lm_set->get("time_scheduled_page_activation")
1782  );
1783 
1784  if ($succ_node["obj_id"] > 0 &&
1785  $ilUser->getId() == ANONYMOUS_USER_ID &&
1786  ($this->lm->getPublicAccessMode() == "selected" &&
1787  !ilLMObject::_isPagePublic($succ_node["obj_id"]))) {
1788  $found = false;
1789  } elseif ($succ_node["obj_id"] > 0 && !$active) {
1790  // look, whether activation data should be shown
1791  $act_data = ilLMPage::_lookupActivationData((int) $succ_node["obj_id"], $this->lm->getType());
1792  if ($act_data["show_activation_info"] &&
1793  (ilUtil::now() < $act_data["activation_start"])) {
1794  $found = true;
1795  } else {
1796  $found = false;
1797  }
1798  } else {
1799  $found = true;
1800  }
1801  }
1802 
1803  if ($found) {
1804  return $succ_node["obj_id"];
1805  }
1806  return 0;
1807  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
const ANONYMOUS_USER_ID
Definition: constants.php:25
static now()
Return current timestamp in Y-m-d H:i:s format.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
getCurrentPageId()
Get the current page id.
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
$ilUser
Definition: imgupload.php:18
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:

◆ getTracker()

ilLMPresentationGUI::getTracker ( )
protected

Get tracker.

Returns
ilLMTracker

Definition at line 345 of file class.ilLMPresentationGUI.php.

Referenced by filterNonAccessibleNode(), and showPrintView().

346  {
347  return $this->service->getTracker();
348  }
+ Here is the caller graph for this function:

◆ glossary()

ilLMPresentationGUI::glossary ( )
Returns
string
Exceptions
ilException

Definition at line 820 of file class.ilLMPresentationGUI.php.

References ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), ilGlossary(), ilUIFramework\init(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), offlineMode(), renderPageTitle(), setContentStyles(), and setSystemStyle().

821  {
822  $this->tpl = new ilGlobalTemplate("tpl.glossary_term_output.html", true, true, "Modules/LearningModule");
823  //$GLOBALS["tpl"] = $this->tpl;
824  $this->renderPageTitle();
825 
826  iljQueryUtil::initjQuery($this->tpl);
827  iljQueryUtil::initjQueryUI($this->tpl);
828  ilUIFramework::init($this->tpl);
829  ilAccordionGUI::addJavaScript($this->tpl);
830  ilAccordionGUI::addCss($this->tpl);
831 
832  // set style sheets
833  $this->setContentStyles();
834  $this->setSystemStyle();
835 
836  $this->ilGlossary();
837  if (!$this->offlineMode()) {
838  $this->tpl->printToStdout();
839  } else {
840  return $this->tpl->printToString();
841  }
842 
843  return "";
844  }
special template class to simplify handling of ITX/PEAR
setSystemStyle()
Set system style.
ilGlossary()
show glossary term
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
offlineMode()
checks wether offline content generation is activated
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static init(ilGlobalTemplateInterface $a_tpl=null)
Init.
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ handleCodeParagraph()

ilLMPresentationGUI::handleCodeParagraph (   $page_id,
  $paragraph_id,
  $title,
  $text 
)

store paragraph into file directory files/codefile_$pg_id_$paragraph_id/downloadtitle

Definition at line 2978 of file class.ilLMPresentationGUI.php.

References getOfflineDirectory(), and ilUtil\makeDirParents().

2979  {
2980  $directory = $this->getOfflineDirectory() . "/codefiles/" . $page_id . "/" . $paragraph_id;
2981  ilUtil::makeDirParents($directory);
2982  $file = $directory . "/" . $title;
2983  if (!($fp = @fopen($file, "w+"))) {
2984  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2985  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2986  }
2987  chmod($file, 0770);
2988  fwrite($fp, $text);
2989  fclose($fp);
2990  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getOfflineDirectory()
get offline directory
+ Here is the call graph for this function:

◆ ilGlossary()

ilLMPresentationGUI::ilGlossary ( )

show glossary term

Definition at line 1641 of file class.ilLMPresentationGUI.php.

References $ctrl, getOfflineDirectory(), offlineMode(), and setContentStyles().

Referenced by glossary(), and layout().

1642  {
1643  $ilCtrl = $this->ctrl;
1644 
1645  $term_gui = new ilGlossaryTermGUI($this->requested_obj_id);
1646 
1647  // content style
1648  $this->setContentStyles();
1649 
1650  $term_gui->setPageLinker($this->linker);
1651 
1652  $term_gui->setOfflineDirectory($this->getOfflineDirectory());
1653  if (!$this->offlineMode()) {
1654  $ilCtrl->setParameter($this, "pg_type", "glo");
1655  }
1656  $term_gui->output($this->offlineMode(), $this->tpl);
1657 
1658 
1659  if (!$this->offlineMode()) {
1660  $ilCtrl->setParameter($this, "pg_type", "");
1661  }
1662  }
getOfflineDirectory()
get offline directory
offlineMode()
checks wether offline content generation is activated
GUI class for glossary terms.
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilJavaScript()

ilLMPresentationGUI::ilJavaScript (   $a_inline = "",
  $a_file = "",
  $a_location = "" 
)

Puts JS into template.

Definition at line 1735 of file class.ilLMPresentationGUI.php.

Referenced by layout().

1736  {
1737  if ($a_inline != "") {
1738  $js_tpl = new ilTemplate($a_inline, true, false, $a_location);
1739  $js = $js_tpl->get();
1740  $this->tpl->setVariable("INLINE_JS", $js);
1741  }
1742  }
+ Here is the caller graph for this function:

◆ ilLMMenu()

ilLMPresentationGUI::ilLMMenu ( )

output learning module menu

Definition at line 943 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), and renderTabs().

Referenced by layout().

944  {
945  $this->renderTabs("content", $this->getCurrentPageId());
946  /*$this->tpl->setVariable("MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
947  ,$this->getExportFormat(), "content", false, true, $this->getCurrentPageId(),
948  $this->lang, $this->export_all_languages));*/
949  }
getCurrentPageId()
Get the current page id.
renderTabs($active_tab, $current_page_id)
Render tabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLMNotes()

ilLMPresentationGUI::ilLMNotes ( )

output notes of page

Definition at line 1143 of file class.ilLMPresentationGUI.php.

References $access, $ilSetting, $settings, ilNoteGUI\enablePublicNotesDeletion(), getCurrentPageId(), and offlineMode().

Referenced by getHTML(), and layout().

1143  : string
1144  {
1145  $ilAccess = $this->access;
1147 
1148  // no notes in offline (export) mode
1149  if ($this->offlineMode()) {
1150  return "";
1151  }
1152 
1153  // now output comments
1154 
1155  if ($ilSetting->get("disable_comments")) {
1156  return "";
1157  }
1158  if (!$this->lm->publicNotes()) {
1159  return "";
1160  }
1161 
1162  $next_class = $this->ctrl->getNextClass($this);
1163 
1164  $pg_id = $this->getCurrentPageId();
1165 
1166  if ($pg_id == 0) {
1167  return "";
1168  }
1169  $notes_gui = new ilNoteGUI($this->lm->getId(), $this->getCurrentPageId(), "pg");
1170 
1171  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
1172  $ilSetting->get("comments_del_tutor", 1)) {
1173  $notes_gui->enablePublicNotesDeletion(true);
1174  }
1175 
1176  $this->ctrl->setParameter($this, "frame", $this->requested_frame);
1177  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1178 
1179  $notes_gui->enablePrivateNotes();
1180  if ($this->lm->publicNotes()) {
1181  $notes_gui->enablePublicNotes();
1182  }
1183 
1184  $callback = array($this, "observeNoteAction");
1185  $notes_gui->addObserver($callback);
1186 
1187  if ($next_class == "ilnotegui") {
1188  $html = $this->ctrl->forwardCommand($notes_gui);
1189  } else {
1190  $html = $notes_gui->getNotesHTML();
1191  }
1192  return $html;
1193  }
Notes GUI class.
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
enablePublicNotesDeletion($a_enable=true)
enable public notes
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLMSubMenu()

ilLMPresentationGUI::ilLMSubMenu ( )

output learning module submenu

Definition at line 963 of file class.ilLMPresentationGUI.php.

References $rbacsystem, ilFrameTargetInfo\_getFrame(), getCurrentPageId(), and offlineMode().

Referenced by layout().

964  {
966  if ($this->abstract) {
967  return;
968  }
969 
970  $showViewInFrameset = true;
971 
972  if ($showViewInFrameset) {
973  $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent");
974  } else {
975  $buttonTarget = "_top";
976  }
977 
978 
979  $tpl_menu = new ilTemplate("tpl.lm_sub_menu.html", true, true, "Modules/LearningModule");
980 
981  $pg_id = $this->getCurrentPageId();
982  if ($pg_id == 0) {
983  return;
984  }
985 
986  // edit learning module
987  if (!$this->offlineMode()) {
988  if ($rbacsystem->checkAccess("write", $this->requested_ref_id)) {
989  $tpl_menu->setCurrentBlock("edit_page");
990  $page_id = $this->getCurrentPageId();
991  $tpl_menu->setVariable("EDIT_LINK", ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
992  "&obj_id=" . $page_id . "&to_page=1");
993  $tpl_menu->setVariable("EDIT_TXT", $this->lng->txt("edit_page"));
994  $tpl_menu->setVariable("EDIT_TARGET", $buttonTarget);
995  $tpl_menu->parseCurrentBlock();
996  }
997 
998  $page_id = $this->getCurrentPageId();
999 
1000  // permanent link
1001  $this->tpl->setPermanentLink("pg", "", $page_id . "_" . $this->lm->getRefId());
1002  }
1003 
1004  $this->tpl->setVariable("SUBMENU", $tpl_menu->get());
1005  }
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLocator()

ilLMPresentationGUI::ilLocator (   $a_std_templ_loaded = false)

locator

Definition at line 1199 of file class.ilLMPresentationGUI.php.

References $_GET, $ctrl, $DIC, $lang, $locator, $requested_frame, $requested_obj_id, $requested_ref_id, $tree, ilFrameTargetInfo\_getFrame(), ilStructureObject\_getPresentationTitle(), ilLMObjectFactory\getInstance(), getLMPresentationTitle(), offlineMode(), and ilUtil\shortenText().

Referenced by initScreenHead(), and layout().

1200  {
1201  global $DIC;
1202  $ltiview = $DIC["lti"];
1203  $ilLocator = $this->locator;
1204  $tree = $this->tree;
1205  $ilCtrl = $this->ctrl;
1206 
1207  if (empty($this->requested_obj_id)) {
1208  $a_id = $this->lm_tree->getRootId();
1209  } else {
1210  $a_id = $this->requested_obj_id;
1211  }
1212 
1213 
1214  if (!$this->lm->cleanFrames()) {
1215  $frame_param = $this->requested_frame;
1216  $frame_target = "";
1217  } elseif (!$this->offlineMode()) {
1218  $frame_param = "";
1219  $frame_target = ilFrameTargetInfo::_getFrame("MainContent");
1220  } else {
1221  $frame_param = "";
1222  $frame_target = "_top";
1223  }
1224 
1225  if (!$this->offlineMode()) {
1226  // LTI
1227  if ($ltiview->isActive()) {
1228  $ilLocator->addRepositoryItems();
1229  } else {
1230  $ilLocator->addRepositoryItems();
1231  //$ilLocator->addItem("...", "");
1232 
1233  /*
1234  $par_id = $tree->getParentId($this->requested_ref_id);
1235  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $par_id);
1236  $ilLocator->addItem(
1237  ilObject::_lookupTitle(ilObject::_lookupObjId($par_id)),
1238  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"),
1239  ilFrameTargetInfo::_getFrame("MainContent"), $par_id);
1240  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);*/
1241  }
1242  } else {
1243  $ilLocator->setOffline(true);
1244  }
1245 
1246  if ($this->lm_tree->isInTree($a_id)) {
1247  $path = $this->lm_tree->getPathFull($a_id);
1248 
1249  foreach ($path as $key => $row) {
1250  if ($row["type"] != "pg") {
1251  if ($row["child"] != $this->lm_tree->getRootId()) {
1252  $ilLocator->addItem(
1255  $row["child"],
1256  ilLMOBject::CHAPTER_TITLE,
1257  $this->lm->isActiveNumbering(),
1258  $this->lm_set->get("time_scheduled_page_activation"),
1259  false,
1260  0,
1261  $this->lang
1262  ),
1263  50,
1264  true
1265  ),
1266  $this->linker->getLink("layout", $row["child"], $frame_param, "StructureObject"),
1267  $frame_target
1268  );
1269  } else {
1270  $ilLocator->addItem(
1271  ilUtil::shortenText($this->getLMPresentationTitle(), 50, true),
1272  $this->linker->getLink("layout", "", $frame_param),
1273  $frame_target,
1275  );
1276  }
1277  }
1278  }
1279  } else { // lonely page
1280  $ilLocator->addItem(
1281  $this->getLMPresentationTitle(),
1282  $this->linker->getLink("layout", "", $this->requested_frame)
1283  );
1284 
1285  $lm_obj = ilLMObjectFactory::getInstance($this->lm, $a_id);
1286 
1287  $ilLocator->addItem(
1288  $lm_obj->getTitle(),
1289  $this->linker->getLink("layout", $a_id, $frame_param),
1290  $frame_target
1291  );
1292  }
1293 
1294  if (DEBUG) {
1295  $debug = "DEBUG: <font color=\"red\">" . $this->type . "::" . $this->id . "::" . $_GET["cmd"] . "</font><br/>";
1296  }
1297 
1298  //$prop_name = $this->objDefinition->getPropertyName($_GET["cmd"],$this->type);
1299 
1300 
1301  $this->tpl->setLocator();
1302  }
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
$_GET["client_id"]
getLMPresentationTitle()
Get lm presentationtitle.
global $DIC
Definition: goto.php:24
static _getPresentationTitle( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
offlineMode()
checks wether offline content generation is activated
$lang
Definition: xapiexit.php:8
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilMainMenu()

ilLMPresentationGUI::ilMainMenu ( )

output main menu

Definition at line 885 of file class.ilLMPresentationGUI.php.

References $DIC, getCurrentPageId(), and offlineMode().

886  {
887  // LTI
888  global $DIC;
889  $ltiview = $DIC["lti"];
890  if ($ltiview->isActive()) {
891  $ilMainMenu = new LTI\ilMainMenuGUI("_top", false, $this->tpl);
892  } else {
893  $ilMainMenu = new ilMainMenuGUI("_top", false, $this->tpl);
894  }
895 
896  if ($this->offlineMode()) {
897  $this->tpl->touchBlock("pg_intro");
898  $this->tpl->touchBlock("pg_outro");
899  return;
900  }
901 
902  $page_id = $this->getCurrentPageId();
903  if ($page_id > 0) {
904  $ilMainMenu->setLoginTargetPar("pg_" . $page_id . "_" . $this->lm->getRefId());
905  }
906 
907  //$this->tpl->touchBlock("mm_intro");
908  //$this->tpl->touchBlock("mm_outro");
909  $this->tpl->touchBlock("pg_intro");
910  $this->tpl->touchBlock("pg_outro");
911  $this->tpl->setBodyClass("std");
912  $this->tpl->setVariable("MAINMENU", $ilMainMenu->getHTML());
913  // LTI
914  $this->tpl->setVariable("MAINMENU_SPACER", $ilMainMenu->getSpacerClass());
915  }
Handles display of the main menu.
global $DIC
Definition: goto.php:24
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
+ Here is the call graph for this function:

◆ ilMedia()

ilLMPresentationGUI::ilMedia ( )

output media

Definition at line 1667 of file class.ilLMPresentationGUI.php.

References $_GET, $xml, ilMediaItem\_getMapAreasIntLinks(), ilUtil\getImagePath(), getLMPage(), ilUtil\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObjectGUI\includePresentationJS(), ilObjMediaObject\isTypeAllowed(), offlineMode(), renderPageTitle(), setContentStyles(), xslt_create(), xslt_error(), and xslt_free().

Referenced by media().

1668  {
1669  $this->setContentStyles();
1670 
1671  $this->renderPageTitle();
1672 
1673  $this->tpl->setCurrentBlock("ilMedia");
1674  $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
1675  $link_xml = $this->linker->getLinkXML($med_links);
1676 
1677  $media_obj = new ilObjMediaObject($this->requested_mob_id);
1678  if (!empty($_GET["pg_id"])) {
1679  $pg_obj = $this->getLMPage($_GET["pg_id"], $_GET["pg_type"]);
1680  $pg_obj->buildDom();
1681 
1682  $xml = "<dummy>";
1683  // todo: we get always the first alias now (problem if mob is used multiple
1684  // times in page)
1685  $xml .= $pg_obj->getMediaAliasElement($this->requested_mob_id);
1686  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1687  $xml .= $link_xml;
1688  $xml .= "</dummy>";
1689  } else {
1690  $xml = "<dummy>";
1691  // todo: we get always the first alias now (problem if mob is used multiple
1692  // times in page)
1693  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
1694  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1695  $xml .= $link_xml;
1696  $xml .= "</dummy>";
1697  }
1698 
1699 
1700  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
1701  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
1702  $xh = xslt_create();
1703 
1704  if (!$this->offlineMode()) {
1705  $wb_path = ilUtil::getWebspaceDir("output") . "/";
1706  } else {
1707  $wb_path = "";
1708  }
1709 
1710  $mode = ($_GET["cmd"] == "fullscreen")
1711  ? "fullscreen"
1712  : "media";
1713  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output", $this->offlineMode());
1714  $fullscreen_link =
1715  $this->linker->getLink("fullscreen");
1716  $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
1717  'link_params' => "ref_id=" . $this->lm->getRefId(),'fullscreen_link' => $fullscreen_link,
1718  'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
1719  'ref_id' => $this->lm->getRefId(), 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
1720  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
1721 
1722  echo xslt_error($xh);
1723  xslt_free($xh);
1724 
1725  // unmask user html
1726  $this->tpl->setVariable("MEDIA_CONTENT", $output);
1727 
1728  // add js
1730  }
xslt_create()
static _getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
$_GET["client_id"]
getLMPage($a_id, $a_type="")
Get lm page object.
xslt_free(&$proc)
static includePresentationJS($a_tpl=null)
Include media object presentation JS.
static isTypeAllowed($a_type)
Is type allowed.
xslt_error(&$proc)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
offlineMode()
checks wether offline content generation is activated
$xml
Definition: metadata.php:332
Class ilObjMediaObject.
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
static getWebspaceDir($mode="filesystem")
get webspace directory
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilTOC()

ilLMPresentationGUI::ilTOC (   $a_get_explorer = false)

table of contents

Definition at line 920 of file class.ilLMPresentationGUI.php.

Referenced by refreshToc().

921  {
922  $fac = new ilLMTOCExplorerGUIFactory();
923  $exp = $fac->getExplorer($this->service, "ilTOC");
924  $exp->handleCommand();
925  return $exp;
926  }
+ Here is the caller graph for this function:

◆ infoScreen()

ilLMPresentationGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 1910 of file class.ilLMPresentationGUI.php.

References outputInfoScreen().

1911  {
1912  $this->ctrl->setCmd("showSummary");
1913  $this->ctrl->setCmdClass("ilinfoscreengui");
1914  $this->outputInfoScreen();
1915  }
outputInfoScreen($a_standard_locator=false)
info screen
+ Here is the call graph for this function:

◆ initByRequest()

ilLMPresentationGUI::initByRequest (   $query_params,
bool  $embed_mode = false 
)

Init services and this class by request params.

The request params are usually retrieved by HTTP request, but also adjusted during HTML exports, this is, why this method needs to be public.

Parameters
array$query_paramsrequest query params

Definition at line 280 of file class.ilLMPresentationGUI.php.

References $embed_mode, ilObjectTranslation\getInstance(), and user().

281  {
282  $this->service = new ilLMPresentationService(
283  $this->user,
284  $query_params,
285  $this->offline,
286  $this->export_all_languages,
287  $this->export_format,
288  null,
290  );
291 
292  $request = $this->service->getRequest();
293 
294  $this->requested_obj_type = $request->getRequestedObjType();
295  $this->requested_ref_id = $request->getRequestedRefId();
296  $this->requested_transl = $request->getRequestedTranslation(); // handled by presentation status
297  $this->requested_obj_id = $request->getRequestedObjId(); // handled by navigation status
298  $this->requested_back_pg = $request->getRequestedBackPage();
299  $this->requested_frame = $request->getRequestedFrame();
300  $this->requested_search_string = $request->getRequestedSearchString();
301  $this->requested_focus_return = $request->getRequestedFocusReturn();
302  $this->requested_mob_id = $request->getRequestedMobId();
303 
304  $this->lm_set = $this->service->getSettings();
305  $this->lm_gui = $this->service->getLearningModuleGUI();
306  $this->lm = $this->service->getLearningModule();
307  $this->tracker = $this->service->getTracker();
308  $this->linker = $this->service->getLinker();
309  $this->embed_mode = $embed_mode;
310  if ($request->getRequestedEmbedMode()) {
311  $this->embed_mode = true;
312  }
313 
314  // language translation
315  $this->lang = $this->service->getPresentationStatus()->getLang();
316  $this->lm_tree = $this->service->getLMTree();
317  $this->focus_id = $this->service->getPresentationStatus()->getFocusId();
318  $this->ot = ilObjectTranslation::getInstance($this->lm->getId());
319  }
user()
Definition: user.php:4
static getInstance($a_obj_id)
Get instance.
Main service init and factory.
+ Here is the call graph for this function:

◆ initPrintViewSelectionForm()

ilLMPresentationGUI::initPrintViewSelectionForm ( )

Init print view selection form.

Definition at line 2248 of file class.ilLMPresentationGUI.php.

References $ctrl, $lng, and ilRadioGroupInputGUI\setValue().

Referenced by showPrintViewSelection().

2249  {
2250  $lng = $this->lng;
2251  $ilCtrl = $this->ctrl;
2252 
2253  $this->form = new ilPropertyFormGUI();
2254  $this->form->setForceTopButtons(true);
2255 
2256  // selection type
2257  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
2258  $radg->setValue("page");
2259  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
2260  $radg->addOption($op1);
2261  $op2 = new ilRadioOption($lng->txt("cont_current_chapter"), "chapter");
2262  $radg->addOption($op2);
2263  $op3 = new ilRadioOption($lng->txt("cont_selected_pg_chap"), "selection");
2264  $radg->addOption($op3);
2265 
2266  $nl = new ilNestedListInputGUI("", "obj_id");
2267  $this->nl = $nl;
2268  $op3->addSubItem($nl);
2269 
2270 
2271  $this->form->addItem($radg);
2272 
2273  $this->form->addCommandButton("showPrintView", $lng->txt("cont_show_print_view"));
2274  $this->form->setOpenTag(false);
2275  $this->form->setCloseTag(false);
2276 
2277  $this->form->setTitle(" ");
2278  $this->form->setFormAction($ilCtrl->getFormAction($this));
2279  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents a (nested) list of checkboxes (could be extended for radio items, too)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initScreenHead()

ilLMPresentationGUI::initScreenHead (   $a_active_tab = "info")
protected

Definition at line 1925 of file class.ilLMPresentationGUI.php.

References $access, $ilUser, $locator, $user, ilUtil\getImagePath(), getLMPresentationTitle(), ilLocator(), renderPageTitle(), and renderTabs().

Referenced by executeCommand(), and outputInfoScreen().

1926  {
1927  $ilAccess = $this->access;
1928  $ilLocator = $this->locator;
1929  $ilUser = $this->user;
1930 
1931  $this->renderPageTitle();
1932 
1933  // set style sheets
1934  /*
1935  if (!$this->offlineMode())
1936  {
1937  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
1938  }
1939  else
1940  {
1941  $style_name = $ilUser->getPref("style").".css";;
1942  $this->tpl->setStyleSheetLocation("./".$style_name);
1943  }*/
1944 
1945  $this->tpl->loadStandardTemplate();
1946  $this->tpl->setTitle($this->getLMPresentationTitle());
1947  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
1948 
1949  $this->renderTabs($a_active_tab, 0);
1950  /*$this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
1951  ,$this->getExportFormat(), $a_active_tab, true, false, 0,
1952  $this->lang, $this->export_all_languages));*/
1953 
1954  // Full locator, if read permission is given
1955  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1956  $this->ilLocator(true);
1957  } else {
1958  $ilLocator->addRepositoryItems();
1959  $this->tpl->setLocator();
1960  }
1961  }
getLMPresentationTitle()
Get lm presentationtitle.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
ilLocator($a_std_templ_loaded=false)
locator
$ilUser
Definition: imgupload.php:18
renderTabs($active_tab, $current_page_id)
Render tabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ injectTemplate()

ilLMPresentationGUI::injectTemplate (   $tpl)

Inject template.

Parameters

Definition at line 336 of file class.ilLMPresentationGUI.php.

References $tpl.

337  {
338  $this->tpl = $tpl;
339  }

◆ layout()

ilLMPresentationGUI::layout (   $a_xml = "main.xml",
  $doShow = true 
)

generates frame layout

Definition at line 520 of file class.ilLMPresentationGUI.php.

References $additional, $attributes, $DIC, $ilUser, $requested_obj_type, $result, $tpl, $user, addHeaderAction(), addResourceFiles(), attrib2arr(), determineLayout(), domxml_open_mem(), getContent(), ilUtil\getStyleSheetLocation(), ilGlossary(), ilJavaScript(), ilLMMenu(), ilLMNotes(), ilLMSubMenu(), ilLocator(), media(), offlineMode(), renderPageTitle(), setHeader(), ui(), xpath_eval(), and xpath_new_context().

Referenced by executeCommand(), and resume().

521  {
522  global $DIC;
523 
524  $tpl = $this->tpl;
526  $layout = $this->determineLayout();
527 
528  // xmldocfile is deprecated! Use domxml_open_file instead.
529  // But since using relative pathes with domxml under windows don't work,
530  // we need another solution:
531  $xmlfile = file_get_contents("./Modules/LearningModule/layouts/lm/" . $layout . "/" . $a_xml);
532 
533  if (!$doc = domxml_open_mem($xmlfile)) {
534  throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Error reading " .
535  $layout . "/" . $a_xml . ".");
536  }
537  $this->layout_doc = $doc;
538  //echo ":".htmlentities($xmlfile).":$layout:$a_xml:";
539 
540  // get current frame node
541  $xpc = xpath_new_context($doc);
542  $path = (empty($this->requested_frame) || ($this->requested_frame == "_blank"))
543  ? "/ilLayout/ilFrame[1]"
544  : "//ilFrame[@name='" . $this->requested_frame . "']";
545  $result = xpath_eval($xpc, $path);
546  $found = $result->nodeset;
547  if (count($found) != 1) {
548  throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Found " . count($found) . " nodes for " .
549  " path " . $path . " in " . $layout . "/" . $a_xml . ". LM Layout is " . $this->lm->getLayout());
550  }
551  $node = $found[0];
552 
553  // ProcessFrameset
554  // node is frameset, if it has cols or rows attribute
555  $attributes = $this->attrib2arr($node->attributes());
556 
557  $this->frames = array();
558 
559  // ProcessContentTag
560  if ((empty($attributes["template"]) || !empty($this->requested_obj_type))
561  && ($this->requested_frame != "_blank" || $this->requested_obj_type != "MediaObject")) {
562  // we got a variable content frame (can display different
563  // object types (PageObject, MediaObject, GlossarItem)
564  // and contains elements for them)
565 
566  // determine object type
567  if (empty($this->requested_obj_type)) {
568  $obj_type = "PageObject";
569  } else {
570  $obj_type = $this->requested_obj_type;
571  }
572 
573  // get object specific node
574  $childs = $node->child_nodes();
575  $found = false;
576  foreach ($childs as $child) {
577  if ($child->node_name() == $obj_type) {
578  $found = true;
579  $attributes = $this->attrib2arr($child->attributes());
580  $node = $child;
581  //echo "<br>2node:".$node->node_name();
582  break;
583  }
584  }
585  if (!$found) {
586  throw new ilLMPresentationException("ilLMPresentation: No template specified for frame '" .
587  $this->requested_frame . "' and object type '" . $obj_type . "'.");
588  }
589  }
590 
591  // get template
592  $in_module = ($attributes["template_location"] == "module")
593  ? true
594  : false;
595  /* if ($in_module)
596  {
597  $this->tpl = new ilGlobalTemplate($attributes["template"], true, true, $in_module);
598  $this->tpl->setBodyClass("");
599  }
600  else
601  {
602  $this->tpl = $tpl;
603  }*/
604 
605  // set style sheets
606  if (!$this->offlineMode()) {
607  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
608  } else {
609  $style_name = $ilUser->getPref("style") . ".css";
610  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
611  }
612 
613 
614  // to make e.g. advanced seletions lists work:
615  // $GLOBALS["tpl"] = $this->tpl;
616 
617  $childs = $node->child_nodes();
618 
619  foreach ($childs as $child) {
620  $child_attr = $this->attrib2arr($child->attributes());
621 
622  switch ($child->node_name()) {
623  case "ilMainMenu":
624  // @todo 6.0
625 // $this->ilMainMenu();
626  break;
627 
628  case "ilTOC":
629  // @todo 6.0
630 // $this->ilTOC($child_attr["target_frame"]);
631  break;
632 
633  case "ilPage":
634  $this->renderPageTitle();
635  $this->setHeader();
636  $this->ilLMMenu();
637  $this->addHeaderAction();
638  $content = $this->getContent();
639  $content .= $this->ilLMNotes();
640  $additional = $this->ui->renderer() ->render($this->additional_content);
641  $this->tpl->setContent($content . $additional);
642  break;
643 
644  case "ilGlossary":
645  $content = $this->ilGlossary($child);
646  break;
647 
648  case "ilLMNavigation":
649  // @todo 6.0
650 // $this->ilLMNavigation();
651  break;
652 
653  case "ilMedia":
654  $this->media();
655  break;
656 
657  case "ilLocator":
658  $this->ilLocator();
659  break;
660 
661  case "ilJavaScript":
662  $this->ilJavaScript(
663  $child_attr["inline"],
664  $child_attr["file"],
665  $child_attr["location"]
666  );
667  break;
668 
669  case "ilLMMenu":
670  //$this->ilLMMenu();
671  break;
672 
673  case "ilLMHead":
674  // @todo 6.0
675 // $this->ilLMHead();
676  break;
677 
678  case "ilLMSubMenu":
679  $this->ilLMSubMenu();
680  break;
681 
682  case "ilLMNotes":
683  $this->ilLMNotes();
684  break;
685  }
686  }
687 
688  // TODO: Very dirty hack to force the import of JavaScripts in learning content in the FAQ frame (e.g. if jsMath is in the content)
689  // Unfortunately there is no standardized way to do this somewhere else. Calling fillJavaScripts always in ilTemplate causes multiple additions of the the js files.
690  // 19.7.2014: outcommented, since fillJavaScriptFiles is called in the next blocks, and the
691  // following lines would add the js files two times
692  // if (strcmp($this->requested_frame, "topright") == 0) $this->tpl->fillJavaScriptFiles();
693  // if (strcmp($this->requested_frame, "right") == 0) $this->tpl->fillJavaScriptFiles();
694  // if (strcmp($this->requested_frame, "botright") == 0) $this->tpl->fillJavaScriptFiles();
695 
696  $this->addResourceFiles();
697 
698  if ($doShow) {
699  // (horrible) workaround for preventing template engine
700  // from hiding paragraph text that is enclosed
701  // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
702 
703  // @todo 6.0
704  /*$this->tpl->fillTabs();
705  if ($this->fill_on_load_code)
706  {
707  $this->tpl->fillOnLoadCode();
708  }
709  $content = $this->tpl->get();
710  $content = str_replace("&#123;", "{", $content);
711  $content = str_replace("&#125;", "}", $content);
712 
713  header('Content-type: text/html; charset=UTF-8');
714  echo $content;*/
715  $tpl->printToStdout();
716  } else {
717  /*$tpl->printToStdout();
718  $this->tpl->fillLeftNav();
719  $this->tpl->fillOnLoadCode();*/
720 
721  $content = $tpl->printToString();
722  }
723 
724  return($content);
725  }
determineLayout()
Determine layout.
$attributes
Definition: metadata.php:231
getContent($skip_nav=false)
process <ilPage> content tag
$result
xpath_new_context($dom_document)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
domxml_open_mem($str, $mode=0, &$error=null)
ilLMMenu()
output learning module menu
xpath_eval($xpath_context, $eval_str, $contextnode=null)
ilGlossary()
show glossary term
addHeaderAction()
Add header action.
ilLMSubMenu()
output learning module submenu
Base exception class for learning module presentation.
ilJavaScript($a_inline="", $a_file="", $a_location="")
Puts JS into template.
global $DIC
Definition: goto.php:24
offlineMode()
checks wether offline content generation is activated
ui()
Definition: ui.php:5
ilLocator($a_std_templ_loaded=false)
locator
$additional
Definition: goto.php:52
addResourceFiles()
Add resource files.
$ilUser
Definition: imgupload.php:18
ilLMNotes()
output notes of page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ media()

ilLMPresentationGUI::media ( )
Returns
string
Exceptions
ilException

Definition at line 798 of file class.ilLMPresentationGUI.php.

References ilMedia(), offlineMode(), setContentStyles(), and setSystemStyle().

Referenced by fullscreen(), and layout().

799  {
800  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Modules/LearningModule");
801  //$GLOBALS["tpl"] = $this->tpl;
802 
803  // set style sheets
804  $this->setContentStyles();
805  $this->setSystemStyle();
806 
807  $this->ilMedia();
808  if (!$this->offlineMode()) {
809  $this->tpl->printToStdout();
810  } else {
811  return $this->tpl->printToString();
812  }
813  return "";
814  }
special template class to simplify handling of ITX/PEAR
setSystemStyle()
Set system style.
offlineMode()
checks wether offline content generation is activated
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nop()

ilLMPresentationGUI::nop ( )

this dummy function is needed for offline package creation

Definition at line 479 of file class.ilLMPresentationGUI.php.

480  {
481  }

◆ observeNoteAction()

ilLMPresentationGUI::observeNoteAction (   $a_lm_id,
  $a_page_id,
  $a_type,
  $a_action,
  $a_note_id 
)

Generate new ilNote and send Notifications to the users informing that there are new comments in the LM.

Parameters
$a_lm_id
$a_page_id
$a_type
$a_action
$a_note_id

Definition at line 3068 of file class.ilLMPresentationGUI.php.

References ilLearningModuleNotification\ACTION_COMMENT, and ilNotification\TYPE_LM_PAGE.

3069  {
3070  $note = new ilNote($a_note_id);
3071  $note = $note->getText();
3072 
3073  $notification = new ilLearningModuleNotification(
3076  $this->lm,
3077  $a_page_id,
3078  $note
3079  );
3080 
3081  $notification->send();
3082  }
Note class.
Class ilLearningModuleNotification class.

◆ offlineMode()

ilLMPresentationGUI::offlineMode ( )

◆ outputInfoScreen()

ilLMPresentationGUI::outputInfoScreen (   $a_standard_locator = false)

info screen

Definition at line 1966 of file class.ilLMPresentationGUI.php.

References $access, initScreenHead(), and offlineMode().

Referenced by executeCommand(), infoScreen(), and showInfoScreen().

1967  {
1968  $ilAccess = $this->access;
1969 
1970  $this->initScreenHead();
1971 
1972  $this->lng->loadLanguageModule("meta");
1973 
1974  $info = new ilInfoScreenGUI($this->lm_gui);
1975  $info->enablePrivateNotes();
1976  $info->enableLearningProgress();
1977 
1978  $info->enableNews();
1979  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1980  $news_set = new ilSetting("news");
1981  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1982 
1983  $info->enableNewsEditing();
1984 
1985  if ($enable_internal_rss) {
1986  $info->setBlockProperty("news", "settings", true);
1987  }
1988  }
1989 
1990  // add read / back button
1991  /*
1992  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id))
1993  {
1994  if ($this->requested_obj_id > 0)
1995  {
1996  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1997  $info->addButton($this->lng->txt("back"),
1998  $this->ctrl->getLinkTarget($this, "layout"));
1999  }
2000  else
2001  {
2002  $info->addButton($this->lng->txt("view"),
2003  $this->ctrl->getLinkTarget($this, "layout"));
2004  }
2005  }*/
2006 
2007  // show standard meta data section
2008  $info->addMetaDataSections($this->lm->getId(), 0, $this->lm->getType());
2009 
2010  if ($this->offlineMode()) {
2011  $this->tpl->setContent($info->getHTML());
2012  return $this->tpl->get();
2013  } else {
2014  // forward the command
2015  $this->ctrl->forwardCommand($info);
2016  //$this->tpl->setContent("aa");
2017  $this->tpl->printToStdout();
2018  }
2019  }
Class ilInfoScreenGUI.
offlineMode()
checks wether offline content generation is activated
initScreenHead($a_active_tab="info")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ page()

ilLMPresentationGUI::page ( )

Definition at line 846 of file class.ilLMPresentationGUI.php.

References $DIC, $GLOBALS, $ilUser, $tpl, $user, getPageContent(), ilUtil\getStyleSheetLocation(), offlineMode(), renderPageTitle(), and setContentStyles().

847  {
848  global $DIC;
849 
851 
852  //if ($this->requested_frame != "_blank")
853  //{
854  // $this->layout();
855  //}
856  //else
857  //{
858  $this->tpl = new ilGlobalTemplate("tpl.page_fullscreen.html", true, true, "Modules/LearningModule");
859  $GLOBALS["tpl"] = $this->tpl;
860  $this->renderPageTitle();
861 
862  $this->setContentStyles();
863 
864  // set style sheets
865  if (!$this->offlineMode()) {
866  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
867  } else {
868  $style_name = $ilUser->getPref("style") . ".css";
869  ;
870  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
871  }
872 
873  $this->tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
874  if (!$this->offlineMode()) {
875  $this->tpl->printToStdout();
876  } else {
877  return $this->tpl->get();
878  }
879  //}
880  }
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getPageContent()
Get page content.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
offlineMode()
checks wether offline content generation is activated
$ilUser
Definition: imgupload.php:18
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ processNodes()

ilLMPresentationGUI::processNodes ( $a_content,
$a_node 
)

Definition at line 1810 of file class.ilLMPresentationGUI.php.

References $_GET, $attributes, $requested_obj_id, attrib2arr(), and buildTag().

1811  {
1812  $child_nodes = $a_node->child_nodes();
1813  foreach ($child_nodes as $child) {
1814  if ($child->node_name() == "ilFrame") {
1815  $attributes = $this->attrib2arr($child->attributes());
1816  // node is frameset, if it has cols or rows attribute
1817  if ((!empty($attributes["rows"])) || (!empty($attrubtes["cols"]))) {
1818  // if framset has name, another http request is necessary
1819  // (html framesets don't have names, so we need a wrapper frame)
1820  if (!empty($attributes["name"])) {
1821  unset($attributes["template"]);
1822  unset($attributes["template_location"]);
1823  $attributes["src"] =
1824  $this->linker->getLink(
1825  "layout",
1826  $this->requested_obj_id,
1827  $attributes["name"],
1828  "",
1829  "keep",
1830  "",
1831  $_GET["srcstring"]
1832  );
1833  $attributes["title"] = $this->lng->txt("cont_frame_" . $attributes["name"]);
1834  $a_content .= $this->buildTag("", "frame", $attributes);
1835  $this->frames[$attributes["name"]] = $attributes["name"];
1836  //echo "<br>processNodes:add1 ".$attributes["name"];
1837  } else { // ok, no name means that we can easily output the frameset tag
1838  $a_content .= $this->buildTag("start", "frameset", $attributes);
1839  $this->processNodes($a_content, $child);
1840  $a_content .= $this->buildTag("end", "frameset");
1841  }
1842  } else { // frame with
1843  unset($attributes["template"]);
1844  unset($attributes["template_location"]);
1845  $attributes["src"] =
1846  $this->linker->getLink(
1847  "layout",
1848  $this->requested_obj_id,
1849  $attributes["name"],
1850  "",
1851  "keep",
1852  "",
1853  $_GET["srcstring"]
1854  );
1855  $attributes["title"] = $this->lng->txt("cont_frame_" . $attributes["name"]);
1856  if ($attributes["name"] == "toc") {
1857  $attributes["src"] .= "#" . $this->requested_obj_id;
1858  } else {
1859  // Handle Anchors
1860  if ($_GET["anchor"] != "") {
1861  $attributes["src"] .= "#" . rawurlencode($_GET["anchor"]);
1862  }
1863  }
1864  $a_content .= $this->buildTag("", "frame", $attributes);
1865  $this->frames[$attributes["name"]] = $attributes["name"];
1866  }
1867  }
1868  }
1869  }
$attributes
Definition: metadata.php:231
$_GET["client_id"]
buildTag($type, $name, $attr="")
generate a tag with given name and attributes
processNodes(&$a_content, &$a_node)
+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilLMPresentationGUI::redrawHeaderAction ( )

Redraw header action.

Definition at line 1011 of file class.ilLMPresentationGUI.php.

References exit, and getHeaderAction().

1012  {
1013  echo $this->getHeaderAction(true);
1014  exit;
1015  }
exit
Definition: login.php:29
getHeaderAction($a_redraw=false)
Add header action.
+ Here is the call graph for this function:

◆ refreshToc()

ilLMPresentationGUI::refreshToc ( )

Refresh toc (called if questions have been answered correctly)

Definition at line 3051 of file class.ilLMPresentationGUI.php.

References exit, and ilTOC().

3052  {
3053  $exp = $this->ilTOC(true);
3054 
3055  echo $exp->getHTML() .
3056  "<script>" . $exp->getOnLoadCode() . "</script>";
3057  exit;
3058  }
exit
Definition: login.php:29
ilTOC($a_get_explorer=false)
table of contents
+ Here is the call graph for this function:

◆ renderPageTitle()

ilLMPresentationGUI::renderPageTitle ( )
protected

Definition at line 2993 of file class.ilLMPresentationGUI.php.

References getLMPresentationTitle().

Referenced by glossary(), ilMedia(), initScreenHead(), layout(), page(), and showPrintView().

2994  {
2995  $this->tpl->setHeaderPageTitle($this->getLMPresentationTitle());
2996  // @todo 6.0
2997 // $this->tpl->fillWindowTitle();
2998 // $this->tpl->fillContentLanguage();
2999  }
getLMPresentationTitle()
Get lm presentationtitle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderRating()

ilLMPresentationGUI::renderRating ( )
protected

Render rating.

Returns
string

Definition at line 1534 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), and offlineMode().

Referenced by getContent(), and getHTML().

1535  {
1536  // rating
1537  $rating = "";
1538  if ($this->lm->hasRatingPages() && !$this->offlineMode()) {
1539  $rating_gui = new ilRatingGUI();
1540  $rating_gui->setObject($this->lm->getId(), "lm", $this->getCurrentPageId(), "lm");
1541  $rating_gui->setYourRatingText($this->lng->txt("lm_rate_page"));
1542 
1543  /*
1544  $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true,
1545  "il.ExcPeerReview.saveComments(".$a_set["peer_id"].", %rating%)"));
1546  */
1547 
1548  $this->ctrl->setParameter($this, "pgid", $this->getCurrentPageId());
1549  $this->tpl->addOnLoadCode("il.LearningModule.setRatingUrl('" .
1550  $this->ctrl->getLinkTarget($this, "updatePageRating", "", true, false) .
1551  "')");
1552  $this->ctrl->setParameter($this, "pgid", "");
1553 
1554  $rating = '<div id="ilrtrpg" style="text-align:right">' .
1555  $rating_gui->getHtml(true, true, "il.LearningModule.saveRating(%rating%);") .
1556  "</div>";
1557  }
1558  return $rating;
1559  }
Class ilRatingGUI.
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderTabs()

ilLMPresentationGUI::renderTabs (   $active_tab,
  $current_page_id 
)
protected

Render tabs.

Parameters
$active_tab
$current_page_id

Definition at line 3090 of file class.ilLMPresentationGUI.php.

References $additional_content, $current_page_id, getExportFormat(), getService(), offlineMode(), ilLMMenuRendererGUI\render(), and user().

Referenced by ilLMMenu(), and initScreenHead().

3091  {
3092  $menu_editor = new ilLMMenuEditor();
3093  $menu_editor->setObjId($this->lm->getId());
3094 
3095  $navigation_renderer = new ilLMMenuRendererGUI(
3096  $this->getService(),
3097  $this->tabs,
3098  $this->toolbar,
3100  $active_tab,
3101  (string) $this->getExportFormat(),
3102  $this->export_all_languages,
3103  $this->lm,
3104  $this->offlineMode(),
3105  $menu_editor,
3106  $this->lang,
3107  $this->ctrl,
3108  $this->access,
3109  $this->user,
3110  $this->lng,
3111  $this->tpl,
3112  function ($additional_content) {
3113  $this->additional_content[] = $additional_content;
3114  }
3115  );
3116  $navigation_renderer->render();
3117  }
Menu / Tabs renderer.
user()
Definition: user.php:4
getExportFormat()
get export format
offlineMode()
checks wether offline content generation is activated
class for editing lm menu
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resume()

ilLMPresentationGUI::resume ( )

Definition at line 512 of file class.ilLMPresentationGUI.php.

References layout().

513  {
514  $this->layout();
515  }
layout($a_xml="main.xml", $doShow=true)
generates frame layout
+ Here is the call graph for this function:

◆ saveFrameUrl()

ilLMPresentationGUI::saveFrameUrl ( )

Save frame url.

Parameters

Definition at line 778 of file class.ilLMPresentationGUI.php.

References $_GET, and $store.

779  {
780  $store = new ilSessionIStorage("lm");
781  if ($_GET["url"] != "") {
782  $store->set("cf_" . $this->lm->getId(), $_GET["url"]);
783  } else {
784  $store->set("cf_" . $this->lm->getId(), $_GET["url"]);
785  }
786  }
$store
Definition: metadata.php:90
$_GET["client_id"]
Session based immediate storage.

◆ setContentStyles()

ilLMPresentationGUI::setContentStyles ( )
protected

Set content style.

Definition at line 1425 of file class.ilLMPresentationGUI.php.

References ilObjStyleSheet\getContentStylePath(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by getContent(), glossary(), ilGlossary(), ilMedia(), media(), page(), showMessageScreen(), and showPrintView().

1426  {
1427  // content style
1428 
1429  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
1430  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
1431 
1432  /*
1433  $this->tpl->setCurrentBlock("ContentStyle");
1434  if (!$this->offlineMode())
1435  {
1436  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1437  ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
1438  }
1439  else
1440  {
1441  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css");
1442  }
1443  $this->tpl->parseCurrentBlock();
1444 
1445  // syntax style
1446  $this->tpl->setCurrentBlock("SyntaxStyle");
1447  if (!$this->offlineMode())
1448  {
1449  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1450  ilObjStyleSheet::getSyntaxStylePath());
1451  }
1452  else
1453  {
1454  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1455  "syntaxhighlight.css");
1456  }
1457  $this->tpl->parseCurrentBlock();*/
1458  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getSyntaxStylePath()
get syntax style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHeader()

ilLMPresentationGUI::setHeader ( )

output lm header

Definition at line 954 of file class.ilLMPresentationGUI.php.

References ilUtil\getImagePath(), and getLMPresentationTitle().

Referenced by layout().

955  {
956  $this->tpl->setTitle($this->getLMPresentationTitle());
957  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
958  }
getLMPresentationTitle()
Get lm presentationtitle.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSystemStyle()

ilLMPresentationGUI::setSystemStyle ( )
protected

Set system style.

Definition at line 1463 of file class.ilLMPresentationGUI.php.

References ilUtil\getStyleSheetLocation().

Referenced by glossary(), and media().

1464  {
1465  $this->tpl->addCss(ilUtil::getStyleSheetLocation());
1466  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDownloadList()

ilLMPresentationGUI::showDownloadList ( )

show download list

Definition at line 2819 of file class.ilLMPresentationGUI.php.

References $tpl, ilMDUtils\_parseCopyright(), exit, and ui().

2820  {
2821  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2822  return;
2823  }
2824 
2825  //$this->setContentStyles();
2826  //$this->renderPageTitle();
2827 
2828  //$this->tpl->loadStandardTemplate();
2829 
2830  //$this->renderTabs("download", 0);
2831 
2832  //$this->ilLocator(true);
2833  //$this->tpl->stopTitleFloating();
2834  $tpl = new ilTemplate("tpl.lm_download_list.html", true, true, "Modules/LearningModule");
2835 
2836  // set title header
2837  //$this->tpl->setTitle($this->getLMPresentationTitle());
2838  //$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
2839 
2840  // output copyright information
2841  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2842  if (is_object($md_rights = $md->getRights())) {
2843  $copyright = $md_rights->getDescription();
2844 
2845  $copyright = ilMDUtils::_parseCopyright($copyright);
2846 
2847  if ($copyright != "") {
2848  $this->lng->loadLanguageModule("meta");
2849  $tpl->setCurrentBlock("copyright");
2850  $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2851  $tpl->setVariable("LM_COPYRIGHT", $copyright);
2852  $tpl->parseCurrentBlock();
2853  }
2854  }
2855 
2856  $download_table = new ilLMDownloadTableGUI($this, "showDownloadList", $this->lm);
2857  $tpl->setVariable("DOWNLOAD_TABLE", $download_table->getHTML());
2858  //$this->tpl->printToStdout();
2859 
2860  $modal = $this->ui->factory()->modal()->roundtrip(
2861  $this->lng->txt("download"),
2862  $this->ui->factory()->legacy($tpl->get())
2863  );
2864  echo $this->ui->renderer()->render($modal);
2865  exit();
2866  }
static _parseCopyright($a_copyright)
Parse copyright.
exit
Definition: login.php:29
TableGUI class for lm download files.
ui()
Definition: ui.php:5
+ Here is the call graph for this function:

◆ showInfoScreen()

ilLMPresentationGUI::showInfoScreen ( )

info screen call from inside learning module

Definition at line 1920 of file class.ilLMPresentationGUI.php.

References outputInfoScreen().

1921  {
1922  $this->outputInfoScreen(true);
1923  }
outputInfoScreen($a_standard_locator=false)
info screen
+ Here is the call graph for this function:

◆ showMessageScreen()

ilLMPresentationGUI::showMessageScreen (   $a_content)

Show message screen.

Parameters

Definition at line 2911 of file class.ilLMPresentationGUI.php.

References $tpl, and setContentStyles().

Referenced by showNavRestrictionDueToQuestions(), showNoPageAccess(), and showNoPublicAccess().

2912  {
2913  // content style
2914  $this->setContentStyles();
2915 
2916  $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
2917  $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
2918 
2919  $this->tpl->setVariable("PAGE_CONTENT", $tpl->get());
2920  }
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showNavRestrictionDueToQuestions()

ilLMPresentationGUI::showNavRestrictionDueToQuestions ( )

Show message if navigation to page is not allowed due to unanswered questions.

Definition at line 2943 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

2944  {
2945  $this->showMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
2946  }
showMessageScreen($a_content)
Show message screen.
+ Here is the call graph for this function:

◆ showNoPageAccess()

ilLMPresentationGUI::showNoPageAccess ( )

Show info message, if page is not accessible in public area.

Definition at line 2934 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

2935  {
2936  $this->showMessageScreen($this->lng->txt("msg_no_page_access"));
2937  }
showMessageScreen($a_content)
Show message screen.
+ Here is the call graph for this function:

◆ showNoPublicAccess()

ilLMPresentationGUI::showNoPublicAccess ( )

Show info message, if page is not accessible in public area.

Definition at line 2926 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

2927  {
2928  $this->showMessageScreen($this->lng->txt("msg_page_no_public_access"));
2929  }
showMessageScreen($a_content)
Show message screen.
+ Here is the call graph for this function:

◆ showPrintView()

ilLMPresentationGUI::showPrintView ( )

show print view

Definition at line 2284 of file class.ilLMPresentationGUI.php.

References $_POST, $ctrl, $ilUser, $lang, $lng, $tpl, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_exists(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilInternalLink\_getTargetsOfSource(), ilLMObject\_isPagePublic(), ilGlossaryTerm\_lookGlossaryTerm(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilMDUtils\_parseCopyright(), ANONYMOUS_USER_ID, getCurrentPageId(), ilGlossaryDefinition\getDefinitionList(), ilObjStyleSheet\getEffectiveContentStyleId(), ilMD\getGeneral(), ilUtil\getImagePath(), getLMPageGUI(), getLMPresentationTitle(), getTracker(), ilUtil\getWebspaceDir(), IL_INST_ID, ilLMObject\PAGE_TITLE, renderPageTitle(), ilUtil\sendFailure(), setContentStyles(), and ilUtil\sortArray().

2285  {
2286  $ilUser = $this->user;
2287  $lng = $this->lng;
2288  $ilCtrl = $this->ctrl;
2289  $tabs = $this->tabs;
2290 
2291  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
2292  return;
2293  }
2294 
2295  $this->renderPageTitle();
2296 
2297  $tabs->setBackTarget(
2298  $lng->txt("back"),
2299  $ilCtrl->getLinkTarget($this, "layout")
2300  );
2301 
2302  $c_obj_id = $this->getCurrentPageId();
2303  // set values according to selection
2304  if ($_POST["sel_type"] == "page") {
2305  if (!is_array($_POST["obj_id"]) || !in_array($c_obj_id, $_POST["obj_id"])) {
2306  $_POST["obj_id"][] = $c_obj_id;
2307  }
2308  }
2309  if ($_POST["sel_type"] == "chapter" && $c_obj_id > 0) {
2310  $path = $this->lm_tree->getPathFull($c_obj_id);
2311  $chap_id = $path[1]["child"];
2312  if ($chap_id > 0) {
2313  $_POST["obj_id"][] = $chap_id;
2314  }
2315  }
2316 
2317  $this->setContentStyles();
2318 
2319  $tpl = new ilTemplate("tpl.lm_print_view.html", true, true, "Modules/LearningModule");
2320 
2321  // set title header
2322  $this->tpl->setTitle($this->getLMPresentationTitle());
2323 
2324  $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2325 
2326  $act_level = 99999;
2327  $activated = false;
2328 
2329  $glossary_links = array();
2330  $output_header = false;
2331  $media_links = array();
2332 
2333  // get header and footer
2334  if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
2335  if (ilLMObject::_exists($this->lm->getFooterPage())) {
2336  $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
2337  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2338  $this->lm->getStyleSheetId(),
2339  "lm"
2340  ));
2341 
2342 
2343  // determine target frames for internal links
2344  $page_object_gui->setLinkFrame($this->requested_frame);
2345  $page_object_gui->setOutputMode("print");
2346  $page_object_gui->setPresentationTitle("");
2347  $page_object_gui->setFileDownloadLink("#");
2348  $page_object_gui->setFullscreenLink("#");
2349  $page_object_gui->setSourceCodeDownloadScript("#");
2350  $footer_page_content = $page_object_gui->showPage();
2351  }
2352  }
2353  if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
2354  if (ilLMObject::_exists($this->lm->getHeaderPage())) {
2355  $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
2356  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2357  $this->lm->getStyleSheetId(),
2358  "lm"
2359  ));
2360 
2361 
2362  // determine target frames for internal links
2363  $page_object_gui->setLinkFrame($this->requested_frame);
2364  $page_object_gui->setOutputMode("print");
2365  $page_object_gui->setPresentationTitle("");
2366  $page_object_gui->setFileDownloadLink("#");
2367  $page_object_gui->setFullscreenLink("#");
2368  $page_object_gui->setSourceCodeDownloadScript("#");
2369  $header_page_content = $page_object_gui->showPage();
2370  }
2371  }
2372 
2373  // add free selected pages
2374  if (is_array($_POST["obj_id"])) {
2375  foreach ($_POST["obj_id"] as $k) {
2376  if ($k > 0 && !$this->lm_tree->isInTree($k)) {
2377  if (ilLMObject::_lookupType($k) == "pg") {
2378  $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
2379  }
2380  }
2381  }
2382  } else {
2383  ilUtil::sendFailure($lng->txt("cont_print_no_page_selected"), true);
2384  $ilCtrl->redirect($this, "showPrintViewSelection");
2385  }
2386 
2387  foreach ($nodes as $node_key => $node) {
2388  // check page activation
2389  $active = ilLMPage::_lookupActive(
2390  $node["obj_id"],
2391  $this->lm->getType(),
2392  $this->lm_set->get("time_scheduled_page_activation")
2393  );
2394  if ($node["type"] == "pg" && !$active) {
2395  continue;
2396  }
2397 
2398  // print all subchapters/subpages if higher chapter
2399  // has been selected
2400  if ($node["depth"] <= $act_level) {
2401  if (is_array($_POST["obj_id"]) && in_array($node["obj_id"], $_POST["obj_id"])) {
2402  $act_level = $node["depth"];
2403  $activated = true;
2404  } else {
2405  $act_level = 99999;
2406  $activated = false;
2407  }
2408  }
2409  if ($this->lm->getRestrictForwardNavigation()) {
2410  if ($this->getTracker()->hasPredIncorrectAnswers($node["obj_id"])) {
2411  continue;
2412  }
2413  }
2414  if ($activated &&
2415  ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) {
2416  // output learning module header
2417  if ($node["type"] == "du") {
2418  $output_header = true;
2419  }
2420 
2421  // output chapter title
2422  if ($node["type"] == "st") {
2423  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2424  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2425  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2426  continue;
2427  }
2428  }
2429 
2430  $chap = new ilStructureObject($this->lm, $node["obj_id"]);
2431  $tpl->setCurrentBlock("print_chapter");
2432 
2433  $chapter_title = $chap->_getPresentationTitle(
2434  $node["obj_id"],
2435  $this->lm->isActiveNumbering(),
2436  $this->lm_set->get("time_scheduled_page_activation"),
2437  0,
2438  $this->lang
2439  );
2440  $tpl->setVariable(
2441  "CHAP_TITLE",
2442  $chapter_title
2443  );
2444 
2445  if ($this->lm->getPageHeader() == ilLMOBject::CHAPTER_TITLE) {
2446  if ($nodes[$node_key + 1]["type"] == "pg") {
2447  $tpl->setVariable(
2448  "CHAP_HEADER",
2449  $header_page_content
2450  );
2451  $did_chap_page_header = true;
2452  }
2453  }
2454 
2455  $tpl->parseCurrentBlock();
2456  $tpl->setCurrentBlock("print_block");
2457  $tpl->parseCurrentBlock();
2458  }
2459 
2460  // output page
2461  if ($node["type"] == "pg") {
2462  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2463  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2464  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2465  continue;
2466  }
2467  }
2468 
2469  $tpl->setCurrentBlock("print_item");
2470 
2471  // get page
2472  $page_id = $node["obj_id"];
2473  $page_object_gui = $this->getLMPageGUI($page_id);
2474  $page_object = $page_object_gui->getPageObject();
2475  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2476  $this->lm->getStyleSheetId(),
2477  "lm"
2478  ));
2479 
2480 
2481  // get lm page
2482  $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
2483  $lm_pg_obj->setLMId($this->lm->getId());
2484 
2485  // determine target frames for internal links
2486  $page_object_gui->setLinkFrame($this->requested_frame);
2487  $page_object_gui->setOutputMode("print");
2488  $page_object_gui->setPresentationTitle("");
2489 
2490  if ($this->lm->getPageHeader() == ilLMObject::PAGE_TITLE || $node["free"] === true) {
2492  $lm_pg_obj->getId(),
2493  $this->lm->getPageHeader(),
2494  $this->lm->isActiveNumbering(),
2495  $this->lm_set->get("time_scheduled_page_activation"),
2496  false,
2497  0,
2498  $this->lang
2499  );
2500 
2501  // prevent page title after chapter title
2502  // that have the same content
2503  if ($this->lm->isActiveNumbering()) {
2504  $chapter_title = trim(substr(
2505  $chapter_title,
2506  strpos($chapter_title, " ")
2507  ));
2508  }
2509 
2510  if ($page_title != $chapter_title) {
2511  $page_object_gui->setPresentationTitle($page_title);
2512  }
2513  }
2514 
2515  // handle header / footer
2516  $hcont = $header_page_content;
2517  $fcont = $footer_page_content;
2518 
2519  if ($this->lm->getPageHeader() == ilLMOBject::CHAPTER_TITLE) {
2520  if ($did_chap_page_header) {
2521  $hcont = "";
2522  }
2523  if ($nodes[$node_key + 1]["type"] == "pg" &&
2524  !($nodes[$node_key + 1]["depth"] <= $act_level
2525  && !in_array($nodes[$node_key + 1]["obj_id"], $_POST["obj_id"]))) {
2526  $fcont = "";
2527  }
2528  }
2529 
2530  $page_object_gui->setFileDownloadLink("#");
2531  $page_object_gui->setFullscreenLink("#");
2532  $page_object_gui->setSourceCodeDownloadScript("#");
2533  $page_content = $page_object_gui->showPage();
2534  if ($this->lm->getPageHeader() != ilLMObject::PAGE_TITLE) {
2535  $tpl->setVariable(
2536  "CONTENT",
2537  $hcont . $page_content . $fcont
2538  );
2539  } else {
2540  $tpl->setVariable(
2541  "CONTENT",
2542  $hcont . $page_content . $fcont . "<br />"
2543  );
2544  }
2545  $chapter_title = "";
2546  $tpl->parseCurrentBlock();
2547  $tpl->setCurrentBlock("print_block");
2548  $tpl->parseCurrentBlock();
2549 
2550  // get internal links
2551  $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]);
2552 
2553  $got_mobs = false;
2554 
2555  foreach ($int_links as $key => $link) {
2556  if ($link["type"] == "git" &&
2557  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
2558  $glossary_links[$key] = $link;
2559  }
2560  if ($link["type"] == "mob" &&
2561  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
2562  $got_mobs = true;
2563  $mob_links[$key] = $link;
2564  }
2565  }
2566 
2567  // this is not cool because of performance reasons
2568  // unfortunately the int link table does not
2569  // store the target frame (we want to append all linked
2570  // images but not inline images (i.e. mobs with no target
2571  // frame))
2572  if ($got_mobs) {
2573  $page_object->buildDom();
2574  $links = $page_object->getInternalLinks();
2575  foreach ($links as $link) {
2576  if ($link["Type"] == "MediaObject"
2577  && $link["TargetFrame"] != ""
2578  && $link["TargetFrame"] != "None") {
2579  $media_links[] = $link;
2580  }
2581  }
2582  }
2583  }
2584  }
2585  }
2586 
2587  $annex_cnt = 0;
2588  $annexes = array();
2589 
2590  // glossary
2591  if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) {
2592  // sort terms
2593  $terms = array();
2594 
2595  foreach ($glossary_links as $key => $link) {
2596  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]);
2597  $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term);
2598  }
2599  $terms = ilUtil::sortArray($terms, "term", "asc");
2600  //ksort($terms);
2601 
2602  foreach ($terms as $t) {
2603  $link = $t["link"];
2604  $key = $t["key"];
2605  $defs = ilGlossaryDefinition::getDefinitionList($link["id"]);
2606  $def_cnt = 1;
2607 
2608  // output all definitions of term
2609  foreach ($defs as $def) {
2610  // definition + number, if more than 1 definition
2611  if (count($defs) > 1) {
2612  $tpl->setCurrentBlock("def_title");
2613  $tpl->setVariable(
2614  "TXT_DEFINITION",
2615  $this->lng->txt("cont_definition") . " " . ($def_cnt++)
2616  );
2617  $tpl->parseCurrentBlock();
2618  }
2619  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
2620  $page_gui->setTemplateOutput(false);
2621  $page_gui->setOutputMode("print");
2622 
2623  $tpl->setCurrentBlock("definition");
2624  $page_gui->setFileDownloadLink("#");
2625  $page_gui->setFullscreenLink("#");
2626  $page_gui->setSourceCodeDownloadScript("#");
2627  $output = $page_gui->showPage();
2628  $tpl->setVariable("VAL_DEFINITION", $output);
2629  $tpl->parseCurrentBlock();
2630  }
2631 
2632  // output term
2633  $tpl->setCurrentBlock("term");
2634  $tpl->setVariable(
2635  "VAL_TERM",
2636  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])
2637  );
2638  $tpl->parseCurrentBlock();
2639  }
2640 
2641  // output glossary header
2642  $annex_cnt++;
2643  $tpl->setCurrentBlock("glossary");
2644  $annex_title = $this->lng->txt("cont_annex") . " " .
2645  chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo");
2646  $tpl->setVariable("TXT_GLOSSARY", $annex_title);
2647  $tpl->parseCurrentBlock();
2648 
2649  $annexes[] = $annex_title;
2650  }
2651 
2652  // referenced images
2653  if (count($media_links) > 0) {
2654  foreach ($media_links as $media) {
2655  if (substr($media["Target"], 0, 4) == "il__") {
2656  $arr = explode("_", $media["Target"]);
2657  $id = $arr[count($arr) - 1];
2658 
2659  $med_obj = new ilObjMediaObject($id);
2660  $med_item = $med_obj->getMediaItem("Standard");
2661  if (is_object($med_item)) {
2662  if (is_int(strpos($med_item->getFormat(), "image"))) {
2663  $tpl->setCurrentBlock("ref_image");
2664 
2665  // image source
2666  if ($med_item->getLocationType() == "LocalFile") {
2667  $tpl->setVariable(
2668  "IMG_SOURCE",
2669  ilUtil::getWebspaceDir("output") . "/mobs/mm_" . $id .
2670  "/" . $med_item->getLocation()
2671  );
2672  } else {
2673  $tpl->setVariable(
2674  "IMG_SOURCE",
2675  $med_item->getLocation()
2676  );
2677  }
2678 
2679  if ($med_item->getCaption() != "") {
2680  $tpl->setVariable("IMG_TITLE", $med_item->getCaption());
2681  } else {
2682  $tpl->setVariable("IMG_TITLE", $med_obj->getTitle());
2683  }
2684  $tpl->parseCurrentBlock();
2685  }
2686  }
2687  }
2688  }
2689 
2690  // output glossary header
2691  $annex_cnt++;
2692  $tpl->setCurrentBlock("ref_images");
2693  $annex_title = $this->lng->txt("cont_annex") . " " .
2694  chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images");
2695  $tpl->setVariable("TXT_REF_IMAGES", $annex_title);
2696  $tpl->parseCurrentBlock();
2697 
2698  $annexes[] = $annex_title;
2699  }
2700 
2701  // output learning module title and toc
2702  if ($output_header) {
2703  $tpl->setCurrentBlock("print_header");
2704  $tpl->setVariable("LM_TITLE", $this->getLMPresentationTitle());
2705  if ($this->lm->getDescription() != "none") {
2706  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2707  $md_gen = $md->getGeneral();
2708  foreach ($md_gen->getDescriptionIds() as $id) {
2709  $md_des = $md_gen->getDescription($id);
2710  $description = $md_des->getDescription();
2711  }
2712 
2713  $tpl->setVariable(
2714  "LM_DESCRIPTION",
2715  $description
2716  );
2717  }
2718  $tpl->parseCurrentBlock();
2719 
2720  // output toc
2721  $nodes2 = $nodes;
2722  foreach ($nodes2 as $node2) {
2723  if ($node2["type"] == "st"
2724  && ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node2["obj_id"])) {
2725  for ($j = 1; $j < $node2["depth"]; $j++) {
2726  $tpl->setCurrentBlock("indent");
2727  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2728  $tpl->parseCurrentBlock();
2729  }
2730  $tpl->setCurrentBlock("toc_entry");
2731  $tpl->setVariable(
2732  "TXT_TOC_TITLE",
2734  $node2["obj_id"],
2735  ilLMOBject::CHAPTER_TITLE,
2736  $this->lm->isActiveNumbering(),
2737  $this->lm_set->get("time_scheduled_page_activation"),
2738  false,
2739  0,
2740  $this->lang
2741  )
2742  );
2743  $tpl->parseCurrentBlock();
2744  }
2745  }
2746 
2747  // annexes
2748  foreach ($annexes as $annex) {
2749  $tpl->setCurrentBlock("indent");
2750  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2751  $tpl->parseCurrentBlock();
2752  $tpl->setCurrentBlock("toc_entry");
2753  $tpl->setVariable("TXT_TOC_TITLE", $annex);
2754  $tpl->parseCurrentBlock();
2755  }
2756 
2757  $tpl->setCurrentBlock("toc");
2758  $tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
2759  $tpl->parseCurrentBlock();
2760 
2761  $tpl->setCurrentBlock("print_start_block");
2762  $tpl->parseCurrentBlock();
2763  }
2764 
2765  // output author information
2766  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2767  if (is_object($lifecycle = $md->getLifecycle())) {
2768  $sep = $author = "";
2769  foreach (($ids = $lifecycle->getContributeIds()) as $con_id) {
2770  $md_con = $lifecycle->getContribute($con_id);
2771  if ($md_con->getRole() == "Author") {
2772  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2773  $md_ent = $md_con->getEntity($ent_id);
2774  $author = $author . $sep . $md_ent->getEntity();
2775  $sep = ", ";
2776  }
2777  }
2778  }
2779  if ($author != "") {
2780  $this->lng->loadLanguageModule("meta");
2781  $tpl->setCurrentBlock("author");
2782  $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2783  $tpl->setVariable("LM_AUTHOR", $author);
2784  $tpl->parseCurrentBlock();
2785  }
2786  }
2787 
2788 
2789  // output copyright information
2790  if (is_object($md_rights = $md->getRights())) {
2791  $copyright = $md_rights->getDescription();
2792  $copyright = ilMDUtils::_parseCopyright($copyright);
2793 
2794  if ($copyright != "") {
2795  $this->lng->loadLanguageModule("meta");
2796  $tpl->setCurrentBlock("copyright");
2797  $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2798  $tpl->setVariable("LM_COPYRIGHT", $copyright);
2799  $tpl->parseCurrentBlock();
2800  }
2801  }
2802 
2803  $this->tpl->setContent($tpl->get());
2804  $this->tpl->printToStdout();
2805  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _parseCopyright($a_copyright)
Parse copyright.
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
static getDefinitionList($a_term_id)
static
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
const IL_INST_ID
Definition: constants.php:38
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
getLMPageGUI($a_id)
Get lm page gui object.
getLMPresentationTitle()
Get lm presentationtitle.
Class ilLMPageObject.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static _getPresentationTitle( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
& getGeneral()
Definition: class.ilMD.php:40
getCurrentPageId()
Get the current page id.
Class ilObjMediaObject.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$lang
Definition: xapiexit.php:8
Class ilStructreObject.
Glossary definition page GUI class.
$ilUser
Definition: imgupload.php:18
static _isPagePublic($a_node_id, $a_check_public_mode=false)
static getWebspaceDir($mode="filesystem")
get webspace directory
static _lookGlossaryTerm($term_id)
get glossary term
$_POST["username"]
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ showPrintViewSelection()

ilLMPresentationGUI::showPrintViewSelection ( )

show selection screen for print view

Definition at line 2024 of file class.ilLMPresentationGUI.php.

References $_POST, Vendor\Package\$f, $ilUser, $lang, $lng, $requested_obj_id, $tpl, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ANONYMOUS_USER_ID, exit, filterNonAccessibleNode(), ilUtil\getImagePath(), getLMPresentationTitle(), initPrintViewSelectionForm(), and ui().

2025  {
2026  $ilUser = $this->user;
2027  $lng = $this->lng;
2028 
2029  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
2030  return;
2031  }
2032 
2033 
2034 
2035 // $this->setContentStyles();
2036 // $this->renderPageTitle();
2037 
2038 // $this->tpl->loadStandardTemplate();
2039 
2040 // $this->renderTabs("print", 0);
2041  /*$this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
2042  ,$this->getExportFormat(), "print", true,false, 0,
2043  $this->lang, $this->export_all_languages));*/
2044 
2045 
2046  $tpl = new ilTemplate("tpl.lm_print_selection.html", true, true, "Modules/LearningModule");
2047 
2048 // $this->ilLocator(true);
2049  /* $this->tpl->addBlockFile(
2050  "ADM_CONTENT",
2051  "adm_content",
2052  "tpl.lm_print_selection.html",
2053  "Modules/LearningModule"
2054  );*/
2055 
2056  // set title header
2057 // $this->tpl->setTitle($this->getLMPresentationTitle());
2058 // $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
2059 
2060  /*$this->tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
2061  $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
2062  $this->tpl->setVariable("LINK_BACK",
2063  $this->ctrl->getLinkTargetByClass("illmpresentationgui", ""));*/
2064 
2065  $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
2066  $tpl->setVariable("FORMACTION", $this->ctrl->getFormaction($this));
2067 
2068  $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2069  $nodes = $this->filterNonAccessibleNode($nodes);
2070 
2071  if (!is_array($_POST["item"])) {
2072  if ($this->requested_obj_id != "") {
2073  $_POST["item"][$this->requested_obj_id] = "y";
2074  } else {
2075  $_POST["item"][1] = "y";
2076  }
2077  }
2078 
2079  $this->initPrintViewSelectionForm();
2080 
2081  foreach ($nodes as $node) {
2082 
2083  // check page activation
2084  $active = ilLMPage::_lookupActive(
2085  $node["obj_id"],
2086  $this->lm->getType(),
2087  $this->lm_set->get("time_scheduled_page_activation")
2088  );
2089 
2090  if ($node["type"] == "pg" &&
2091  !$active) {
2092  continue;
2093  }
2094 
2095  $text = $img_scr = $img_alt = "";
2096  $disabled = false;
2097  $checked = false;
2098 
2099  switch ($node["type"]) {
2100  // page
2101  case "pg":
2102  $text =
2104  $node["obj_id"],
2105  $this->lm->getPageHeader(),
2106  $this->lm->isActiveNumbering(),
2107  $this->lm_set->get("time_scheduled_page_activation"),
2108  false,
2109  0,
2110  $this->lang
2111  );
2112 
2113  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2114  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2115  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2116  $disabled = true;
2117  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2118  }
2119  }
2120  $img_src = ilUtil::getImagePath("icon_pg.svg");
2121  $img_alt = $lng->txt("icon") . " " . $lng->txt("pg");
2122  break;
2123 
2124  // learning module
2125  case "du":
2126  $text = $this->getLMPresentationTitle();
2127  $img_src = ilUtil::getImagePath("icon_lm.svg");
2128  $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm");
2129  break;
2130 
2131  // chapter
2132  case "st":
2133  $text =
2135  $node["obj_id"],
2136  ilLMOBject::CHAPTER_TITLE,
2137  $this->lm->isActiveNumbering(),
2138  $this->lm_set->get("time_scheduled_page_activation"),
2139  false,
2140  0,
2141  $this->lang
2142  );
2143  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2144  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2145  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2146  $disabled = true;
2147  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2148  }
2149  }
2150  $img_src = ilUtil::getImagePath("icon_st.svg");
2151  $img_alt = $lng->txt("icon") . " " . $lng->txt("st");
2152  break;
2153  }
2154 
2155  if (!ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) {
2156  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2157  }
2158 
2159  $this->nl->addListNode(
2160  $node["obj_id"],
2161  $text,
2162  $node["parent"],
2163  $checked,
2164  $disabled,
2165  $img_src,
2166  $img_alt
2167  );
2168  }
2169 
2170 
2171  // check for free page
2172  if ($this->requested_obj_id > 0 && !$this->lm_tree->isInTree($this->requested_obj_id)) {
2173  $text =
2175  $this->requested_obj_id,
2176  $this->lm->getPageHeader(),
2177  $this->lm->isActiveNumbering(),
2178  $this->lm_set->get("time_scheduled_page_activation"),
2179  false,
2180  0,
2181  $this->lang
2182  );
2183 
2184  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2185  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2186  if (!ilLMObject::_isPagePublic($this->requested_obj_id)) {
2187  $disabled = true;
2188  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2189  }
2190  }
2191  $img_src = ilUtil::getImagePath("icon_pg.svg");
2193 
2194  $checked = true;
2195 
2196  $this->nl->addListNode(
2197  $id,
2198  $text,
2199  0,
2200  $checked,
2201  $disabled,
2202  $img_src,
2203  $img_alt
2204  );
2205  }
2206 
2207  $f = $this->form->getHTML();
2208 
2209  // submit toolbar
2210 // $tb = new ilToolbarGUI();
2211 // $tb->addFormButton($lng->txt("cont_show_print_view"), "showPrintView");
2212 // $tpl->setVariable("TOOLBAR", $tb->getHTML());
2213 
2214  $tpl->setVariable("ITEM_SELECTION", $f);
2215 // $this->tpl->printToStdout();
2216 
2217  $modal = $this->ui->factory()->modal()->roundtrip(
2218  $this->lng->txt("cont_print_view"),
2219  $this->ui->factory()->legacy($tpl->get())
2220  );
2221  echo $this->ui->renderer()->render($modal);
2222  exit();
2223  }
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
exit
Definition: login.php:29
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
getLMPresentationTitle()
Get lm presentationtitle.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _getPresentationTitle( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
ui()
Definition: ui.php:5
$lang
Definition: xapiexit.php:8
$ilUser
Definition: imgupload.php:18
static _isPagePublic($a_node_id, $a_check_public_mode=false)
$_POST["username"]
initPrintViewSelectionForm()
Init print view selection form.
+ Here is the call graph for this function:

◆ updatePageRating()

ilLMPresentationGUI::updatePageRating ( )

Definition at line 1563 of file class.ilLMPresentationGUI.php.

References $_GET, $_POST, $ilUser, $user, exit, ilRating\resetRatingForUserAndObject(), and ilRating\writeRatingForUserAndObject().

1564  {
1565  $ilUser = $this->user;
1566 
1567  $pg_id = $_GET["pgid"];
1568  if (!$this->ctrl->isAsynch() || !$pg_id) {
1569  exit();
1570  }
1571 
1572  $rating = (int) $_POST["rating"];
1573  if ($rating) {
1575  $this->lm->getId(),
1576  "lm",
1577  $pg_id,
1578  "lm",
1579  $ilUser->getId(),
1580  $_POST["rating"]
1581  );
1582  } else {
1584  $this->lm->getId(),
1585  "lm",
1586  $pg_id,
1587  "lm",
1588  $ilUser->getId()
1589  );
1590  }
1591 
1592  $rating = new ilRatingGUI();
1593  $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId());
1594  $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
1595 
1596  echo $rating->getHtml(true, true, "il.LearningModule.saveRating(%rating%);");
1597 
1598  echo $this->tpl->getOnLoadCodeForAsynch();
1599  exit();
1600  }
static writeRatingForUserAndObject( $a_obj_id, $a_obj_type, $a_sub_obj_id, $a_sub_obj_type, $a_user_id, $a_rating, $a_category_id=0)
Write rating for a user and an object.
exit
Definition: login.php:29
$_GET["client_id"]
Class ilRatingGUI.
static resetRatingForUserAndObject( $a_obj_id, $a_obj_type, $a_sub_obj_id, $a_sub_obj_type, $a_user_id)
Reset rating for a user and an object.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilLMPresentationGUI::$access
protected

◆ $additional_content

ilLMPresentationGUI::$additional_content = []
protected

Definition at line 183 of file class.ilLMPresentationGUI.php.

Referenced by renderTabs().

◆ $chapter_has_no_active_page

ilLMPresentationGUI::$chapter_has_no_active_page = false

Definition at line 113 of file class.ilLMPresentationGUI.php.

◆ $ctrl

ilLMPresentationGUI::$ctrl
protected

◆ $current_page_id

ilLMPresentationGUI::$current_page_id = 0
protected

Definition at line 98 of file class.ilLMPresentationGUI.php.

Referenced by getCurrentPageId(), and renderTabs().

◆ $deactivated_page

ilLMPresentationGUI::$deactivated_page = false

Definition at line 118 of file class.ilLMPresentationGUI.php.

◆ $embed_mode

ilLMPresentationGUI::$embed_mode = false
protected

Definition at line 93 of file class.ilLMPresentationGUI.php.

Referenced by getHeaderAction(), and initByRequest().

◆ $error

ilLMPresentationGUI::$error
protected

Definition at line 41 of file class.ilLMPresentationGUI.php.

Referenced by executeCommand().

◆ $export_all_languages

ilLMPresentationGUI::$export_all_languages = false
protected

Definition at line 108 of file class.ilLMPresentationGUI.php.

◆ $focus_id

ilLMPresentationGUI::$focus_id = 0
protected

Definition at line 103 of file class.ilLMPresentationGUI.php.

◆ $help

ilLMPresentationGUI::$help
protected

Definition at line 76 of file class.ilLMPresentationGUI.php.

◆ $layout_doc

ilLMPresentationGUI::$layout_doc

Definition at line 89 of file class.ilLMPresentationGUI.php.

◆ $linker

ilLMPresentationGUI::$linker
protected

Definition at line 163 of file class.ilLMPresentationGUI.php.

◆ $lm

ilLMPresentationGUI::$lm
protected

Definition at line 81 of file class.ilLMPresentationGUI.php.

◆ $lng

ilLMPresentationGUI::$lng

◆ $locator

ilLMPresentationGUI::$locator
protected

Definition at line 66 of file class.ilLMPresentationGUI.php.

Referenced by ilLocator(), and initScreenHead().

◆ $main_menu

ilLMPresentationGUI::$main_menu
protected

Definition at line 61 of file class.ilLMPresentationGUI.php.

◆ $nav_history

ilLMPresentationGUI::$nav_history
protected

Definition at line 46 of file class.ilLMPresentationGUI.php.

Referenced by executeCommand().

◆ $offline

ilLMPresentationGUI::$offline

Definition at line 90 of file class.ilLMPresentationGUI.php.

Referenced by offlineMode().

◆ $offline_directory

ilLMPresentationGUI::$offline_directory

Definition at line 91 of file class.ilLMPresentationGUI.php.

Referenced by getOfflineDirectory().

◆ $ot

ilLMPresentationGUI::$ot
protected

Definition at line 188 of file class.ilLMPresentationGUI.php.

◆ $rbacsystem

ilLMPresentationGUI::$rbacsystem
protected

Definition at line 31 of file class.ilLMPresentationGUI.php.

Referenced by ilLMSubMenu().

◆ $requested_back_pg

ilLMPresentationGUI::$requested_back_pg
protected

Definition at line 123 of file class.ilLMPresentationGUI.php.

◆ $requested_focus_return

ilLMPresentationGUI::$requested_focus_return
protected

Definition at line 133 of file class.ilLMPresentationGUI.php.

◆ $requested_frame

ilLMPresentationGUI::$requested_frame
protected

Definition at line 158 of file class.ilLMPresentationGUI.php.

Referenced by ilLocator().

◆ $requested_obj_id

ilLMPresentationGUI::$requested_obj_id
protected

◆ $requested_obj_type

ilLMPresentationGUI::$requested_obj_type
protected

Definition at line 148 of file class.ilLMPresentationGUI.php.

Referenced by layout().

◆ $requested_ref_id

ilLMPresentationGUI::$requested_ref_id
protected

Definition at line 138 of file class.ilLMPresentationGUI.php.

Referenced by ilLocator().

◆ $requested_search_string

ilLMPresentationGUI::$requested_search_string
protected

Definition at line 128 of file class.ilLMPresentationGUI.php.

◆ $requested_transl

ilLMPresentationGUI::$requested_transl
protected

Definition at line 153 of file class.ilLMPresentationGUI.php.

◆ $service

ilLMPresentationGUI::$service
protected

Definition at line 168 of file class.ilLMPresentationGUI.php.

Referenced by getService().

◆ $settings

ilLMPresentationGUI::$settings
protected

Definition at line 56 of file class.ilLMPresentationGUI.php.

Referenced by getHeaderAction(), and ilLMNotes().

◆ $toolbar

ilLMPresentationGUI::$toolbar
protected

Definition at line 178 of file class.ilLMPresentationGUI.php.

◆ $tpl

◆ $tree

ilLMPresentationGUI::$tree
protected

Definition at line 71 of file class.ilLMPresentationGUI.php.

Referenced by ilLocator().

◆ $ui

ilLMPresentationGUI::$ui
protected

Definition at line 173 of file class.ilLMPresentationGUI.php.

◆ $user


The documentation for this class was generated from the following file: