ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMPresentationGUI Class Reference

Class ilLMPresentationGUI. More...

+ Collaboration diagram for ilLMPresentationGUI:

Public Member Functions

 __construct ( $a_export_format="", $a_all_languages=false, $a_export_dir="", bool $claim_repo_context=true)
 
 initByRequest ($query_params)
 Init services and this class by request params. 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 ($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 ()
 process <ilPage> content tag More...
 
 updatePageRating ()
 
 basicPageGuiInit ($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...
 

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...
 
 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
 
 $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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLMPresentationGUI::__construct (   $a_export_format = "",
  $a_all_languages = false,
  $a_export_dir = "",
bool  $claim_repo_context = true 
)

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

References $_GET, $DIC, $ilCtrl, $ilErr, $lng, $rbacsystem, help(), initByRequest(), settings(), ilLMGSToolProvider\SHOW_TOC_TOOL, and user().

169  {
170  global $DIC;
171 
172  $this->offline = ($a_export_format != "");
173  $this->export_all_languages = $a_all_languages;
174  $this->export_format = $a_export_format; // html/scorm
175  $this->offline_directory = $a_export_dir;
176 
177  $this->tabs = $DIC->tabs();
178  $this->user = $DIC->user();
179  $this->rbacsystem = $DIC->rbac()->system();
180  $this->error = $DIC["ilErr"];
181  $this->nav_history = $DIC["ilNavigationHistory"];
182  $this->access = $DIC->access();
183  $this->settings = $DIC->settings();
184  $this->locator = $DIC["ilLocator"];
185  $this->tree = $DIC->repositoryTree();
186  $this->help = $DIC["ilHelp"];
187 
188  $lng = $DIC->language();
189  $rbacsystem = $DIC->rbac()->system();
190  $ilCtrl = $DIC->ctrl();
191  $ilErr = $DIC["ilErr"];
192 
193  // load language vars
194  $lng->loadLanguageModule("content");
195 
196  $this->lng = $lng;
197  $this->tpl = $DIC->ui()->mainTemplate();
198  $this->frames = array();
199  $this->ctrl = $ilCtrl;
200  $this->ctrl->saveParameter($this, array("ref_id", "transl", "focus_id", "focus_return"));
201 
202  // note: using $DIC->http()->request()->getQueryParams() here will
203  // fail, since the goto magic currently relies on setting $_GET
204  $this->initByRequest($_GET);
205 
206  // check, if learning module is online
207  if (!$rbacsystem->checkAccess("write", $this->requested_ref_id)) {
208  if ($this->lm->getOfflineStatus()) {
209  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->WARNING);
210  }
211  }
212 
213  if ($claim_repo_context) {
214  $DIC->globalScreen()->tool()->context()->claim()->repository();
215 
216  // moved this into the if due to #0027200
217  if ($this->service->getPresentationStatus()->isTocNecessary()) {
218  $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
220  true
221  );
222  }
223  }
224  }
settings()
Definition: settings.php:2
$_GET["client_id"]
user()
Definition: user.php:4
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
initByRequest($query_params)
Init services and this class by request params.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addHeaderAction()

ilLMPresentationGUI::addHeaderAction (   $a_redraw = false)

Add header action.

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

References $access, $requested_ref_id, $tpl, getCurrentPageId(), ilUtil\getImagePath(), ilNotification\hasNotification(), ilNotification\hasOptOut(), ILIAS_HTTP_PATH, offlineMode(), ilCommonActionDispatcherGUI\setSubObject(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, ilCommonActionDispatcherGUI\TYPE_REPOSITORY, and user().

Referenced by ilLMNotes(), and redrawHeaderAction().

969  {
970  if ($this->offline) {
971  return;
972  }
973  $ilAccess = $this->access;
974  $tpl = $this->tpl;
975 
976  $lm_id = $this->lm->getId();
977  $pg_id = $this->getCurrentPageId();
978 
979  $this->lng->loadLanguageModule("content");
980 
981  $dispatcher = new ilCommonActionDispatcherGUI(
983  $ilAccess,
984  $this->lm->getType(),
986  $this->lm->getId()
987  );
988  $dispatcher->setSubObject("pg", $this->getCurrentPageId());
989 
990  ilObjectListGUI::prepareJSLinks(
991  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
992  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
993  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false),
994  $this->tpl
995  );
996 
997  $lg = $dispatcher->initHeaderAction();
998  $lg->enableNotes(true);
999  $lg->enableComments($this->lm->publicNotes(), false);
1000 
1001  if ($this->lm->hasRating() && !$this->offlineMode()) {
1002  $lg->enableRating(
1003  true,
1004  $this->lng->txt("lm_rating"),
1005  false,
1006  array("ilcommonactiondispatchergui", "ilratinggui")
1007  );
1008  }
1009 
1010  // notification
1011  if ($this->user->getId() != ANONYMOUS_USER_ID) {
1012  if (ilNotification::hasNotification(ilNotification::TYPE_LM, $this->user->getId(), $lm_id)) {
1013  $this->ctrl->setParameter($this, "ntf", 1);
1014  if (ilNotification::hasOptOut($lm_id)) {
1015  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_lm");
1016  }
1017 
1018  $lg->addHeaderIcon(
1019  "not_icon",
1020  ilUtil::getImagePath("notification_on.svg"),
1021  $this->lng->txt("cont_notification_activated")
1022  );
1023  } else {
1024  $this->ctrl->setParameter($this, "ntf", 2);
1025  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_lm");
1026 
1027  if (ilNotification::hasNotification(ilNotification::TYPE_LM_PAGE, $this->user->getId(), $pg_id)) {
1028  $this->ctrl->setParameter($this, "ntf", 3);
1029  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_page");
1030 
1031  $lg->addHeaderIcon(
1032  "not_icon",
1033  ilUtil::getImagePath("notification_on.svg"),
1034  $this->lng->txt("cont_page_notification_activated")
1035  );
1036  } else {
1037  $this->ctrl->setParameter($this, "ntf", 4);
1038  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_page");
1039 
1040  $lg->addHeaderIcon(
1041  "not_icon",
1042  ilUtil::getImagePath("notification_off.svg"),
1043  $this->lng->txt("cont_notification_deactivated")
1044  );
1045  }
1046  }
1047  $this->ctrl->setParameter($this, "ntf", "");
1048  }
1049 
1050  if (!$this->offline) {
1051  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1052  if ($this->getCurrentPageId() <= 0) {
1053  $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
1054  } else {
1055  $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
1056  "&obj_id=" . $this->getCurrentPageId() . "&to_page=1";
1057  }
1058  $lg->addCustomCommand($link, "edit_page");
1059  }
1060  }
1061 
1062 
1063  if (!$a_redraw) {
1064  $this->tpl->setVariable("HEAD_ACTION", $lg->getHeaderAction($this->tpl));
1065  } else {
1066  // we need to add onload code manually (rating, comments, etc.)
1067  return $lg->getHeaderAction() .
1068  $tpl->getOnLoadCodeForAsynch();
1069  }
1070  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
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.
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:

◆ attrib2arr()

ilLMPresentationGUI::attrib2arr (   $a_attributes)

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

Referenced by layout(), and processNodes().

417  {
418  $attr = array();
419  if (!is_array($a_attributes)) {
420  return $attr;
421  }
422  foreach ($a_attributes as $attribute) {
423  $attr[$attribute->name()] = $attribute->value();
424  }
425  return $attr;
426  }
+ Here is the caller graph for this function:

◆ basicPageGuiInit()

ilLMPresentationGUI::basicPageGuiInit (   $a_page_gui)

Basic page gui initialisation.

Parameters

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

References getCurrentPageId(), ilObjStyleSheet\getEffectiveContentStyleId(), getOfflineDirectory(), and offlineMode().

Referenced by executeCommand().

1545  {
1546  $a_page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
1547  $this->lm->getStyleSheetId(),
1548  "lm"
1549  ));
1550  if (!$this->offlineMode()) {
1551  $a_page_gui->setOutputMode("presentation");
1552  $this->fill_on_load_code = true;
1553  } else {
1554  $a_page_gui->setOutputMode("offline");
1555  $a_page_gui->setOfflineDirectory($this->getOfflineDirectory());
1556  $this->fill_on_load_code = false;
1557  }
1558  if (!$this->offlineMode()) {
1559  $this->ctrl->setParameter($this, "obj_id", $this->getCurrentPageId()); // see #22403
1560  }
1561  $a_page_gui->setFileDownloadLink($this->linker->getLink("downloadFile"));
1562  $a_page_gui->setSourcecodeDownloadScript($this->linker->getLink("sourcecodeDownload",
1563  $this->getCurrentPageId()));
1564  if (!$this->offlineMode()) {
1565  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1566  }
1567  $a_page_gui->setFullscreenLink($this->linker->getLink("fullscreen"));
1568  }
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 1811 of file class.ilLMPresentationGUI.php.

References $name, and $type.

Referenced by processNodes().

1812  {
1813  $tag = "<";
1814 
1815  if ($type == "end") {
1816  $tag .= "/";
1817  }
1818 
1819  $tag .= $name;
1820 
1821  if (is_array($attr)) {
1822  foreach ($attr as $k => $v) {
1823  $tag .= " " . $k . "=\"$v\"";
1824  }
1825  }
1826 
1827  if ($type == "") {
1828  $tag .= "/";
1829  }
1830 
1831  $tag .= ">\n";
1832 
1833  return $tag;
1834  }
$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 440 of file class.ilLMPresentationGUI.php.

Referenced by layout().

440  : string
441  {
442  return "standard";
443  }
+ Here is the caller graph for this function:

◆ downloadExportFile()

ilLMPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

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

2788  {
2789  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2790  return;
2791  }
2792 
2793  $base_type = explode("_", $_GET["type"]);
2794  $base_type = $base_type[0];
2795  $file = $this->lm->getPublicExportFile($base_type);
2796  if ($this->lm->getPublicExportFile($base_type) != "") {
2797  $dir = $this->lm->getExportDirectory($_GET["type"]);
2798  if (is_file($dir . "/" . $file)) {
2799  ilUtil::deliverFile($dir . "/" . $file, $file);
2800  exit;
2801  }
2802  }
2803  }
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 2731 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), and getLMPageGUI().

2732  {
2733  $page_gui = $this->getLMPageGUI($this->getCurrentPageId());
2734  $page_gui->downloadFile();
2735  }
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 293 of file class.ilLMPresentationGUI.php.

References $_GET, $access, $ctrl, $error, $ilCtrl, $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().

294  {
295  $ilNavigationHistory = $this->nav_history;
296  $ilAccess = $this->access;
297  $lng = $this->lng;
301 
302  // check read permission and parent conditions
303  // todo: replace all this by ilAccess call
304  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id) &&
305  (!(($this->ctrl->getCmd() == "infoScreen" || $this->ctrl->getNextClass() == "ilinfoscreengui")
306  && $ilAccess->checkAccess("visible", "", $this->requested_ref_id)))) {
307  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->WARNING);
308  }
309 
310  $next_class = $this->ctrl->getNextClass($this);
311  $cmd = $this->ctrl->getCmd("layout", array("showPrintView"));
312 
313 
314  $obj_id = $this->requested_obj_id;
315  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
316  $ilNavigationHistory->addItem($this->requested_ref_id, $this->ctrl->getLinkTarget($this), "lm");
317  $this->ctrl->setParameter($this, "obj_id", $obj_id);
318 
319  switch ($next_class) {
320  case "ilnotegui":
321  $ret = $this->layout();
322  break;
323 
324  case "ilinfoscreengui":
325  $ret = $this->outputInfoScreen();
326  break;
327 
328  case "ilcommonactiondispatchergui":
330  $gui->enableCommentsSettings(false);
331  $this->ctrl->forwardCommand($gui);
332  break;
333 
334  case "illmpagegui":
335  $page_gui = $this->getLMPageGUI($this->requested_obj_id);
336  $this->basicPageGuiInit($page_gui);
337  $ret = $ilCtrl->forwardCommand($page_gui);
338  break;
339 
340  case "ilglossarydefpagegui":
341  $page_gui = new ilGlossaryDefPageGUI($this->requested_obj_id);
342  $this->basicPageGuiInit($page_gui);
343  $ret = $ilCtrl->forwardCommand($page_gui);
344  break;
345 
346  case "illearningprogressgui":
347  $this->initScreenHead("learning_progress");
348  $new_gui = new ilLearningProgressGUI(
350  $this->requested_ref_id,
351  $ilUser->getId()
352  );
353  $this->ctrl->forwardCommand($new_gui);
354  break;
355 
356  case "ilratinggui":
357  $rating_gui = new ilRatingGUI();
358  $rating_gui->setObject($this->lm->getId(), "lm", $this->requested_obj_id, "lm");
359  $this->ctrl->forwardCommand($rating_gui);
360  break;
361 
362  default:
363  if ($_GET["ntf"]) {
364  switch ($_GET["ntf"]) {
365  case 1:
366  ilNotification::setNotification(ilNotification::TYPE_LM, $this->user->getId(), $this->lm->getId(), false);
367  break;
368 
369  case 2:
370  ilNotification::setNotification(ilNotification::TYPE_LM, $this->user->getId(), $this->lm->getId(), true);
371  break;
372 
373  case 3:
375  break;
376 
377  case 4:
379  break;
380  }
381  $ilCtrl->redirect($this, "layout");
382  }
383  $ret = $this->$cmd();
384  break;
385  }
386  }
outputInfoScreen($a_standard_locator=false)
info screen
$_GET["client_id"]
getLMPageGUI($a_id)
Get lm page gui object.
user()
Definition: user.php:4
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
Class ilRatingGUI.
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
$ilUser
Definition: imgupload.php:18
getCurrentPageId()
Get the current page id.
basicPageGuiInit($a_page_gui)
Basic page gui initialisation.
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
Class ilObjUserTrackingGUI.
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 2151 of file class.ilLMPresentationGUI.php.

References getTracker(), and offlineMode().

Referenced by showPrintViewSelection().

2152  {
2153  $tracker = $this->getTracker();
2154  // if navigation is restricted based on correct answered questions
2155  // check if we have preceeding pages including unsanswered/incorrect answered questions
2156  if (!$this->offlineMode()) {
2157  if ($this->lm->getRestrictForwardNavigation()) {
2158  $nodes = array_filter($nodes, function ($node) use ($tracker) {
2159  return !$tracker->hasPredIncorrectAnswers($node["child"]);
2160  });
2161  }
2162  }
2163  return $nodes;
2164  }
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 743 of file class.ilLMPresentationGUI.php.

References media().

744  {
745  return $this->media();
746  }
+ Here is the call graph for this function:

◆ getContent()

ilLMPresentationGUI::getContent ( )

process <ilPage> content tag

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

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

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

Referenced by layout().

1417  {
1418  $this->fill_on_load_code = true;
1419  $this->setContentStyles();
1420 
1421  $tpl = new ilTemplate("tpl.lm_content.html", true, true, "Modules/LearningModule/Presentation");
1422 
1423  // call ilLMContentRendererGUI
1424 
1425  $navigation_renderer = new ilLMNavigationRendererGUI(
1426  $this->service,
1427  $this,
1428  $this->lng,
1429  $this->user,
1430  $this->tpl,
1431  $this->requested_obj_id,
1432  $this->requested_back_pg,
1433  $this->requested_frame
1434  );
1435 
1436 
1437  $tpl->setVariable("TOP_NAVIGATION", $navigation_renderer->renderTop());
1438  $tpl->setVariable("BOTTOM_NAVIGATION", $navigation_renderer->renderBottom());
1439  $tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
1440  $tpl->setVariable("RATING", $this->renderRating());
1441 
1442 
1443  return $tpl->get();
1444  }
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 431 of file class.ilLMPresentationGUI.php.

432  {
433  return $this->frames;
434  }

◆ getCurrentPageId()

ilLMPresentationGUI::getCurrentPageId ( )

Get the current page id.

Returns
bool|int current page id

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

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

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

1248  {
1249  return $this->service->getNavigationStatus()->getCurrentPage();
1250 
1251  $ilUser = $this->user;
1252 
1253  if (!$this->offlineMode() && $this->current_page_id !== false) {
1254  return $this->current_page_id;
1255  }
1256 
1257  $this->chapter_has_no_active_page = false;
1258  $this->deactivated_page = false;
1259 
1260  // determine object id
1261  if (empty($this->requested_obj_id)) {
1262  $obj_id = $this->lm_tree->getRootId();
1263  } else {
1264  $obj_id = $this->requested_obj_id;
1265  $active = ilLMPage::_lookupActive(
1266  $obj_id,
1267  $this->lm->getType(),
1268  $this->lm_set->get("time_scheduled_page_activation")
1269  );
1270 
1271  if (!$active &&
1272  ilLMPageObject::_lookupType($obj_id) == "pg") {
1273  $this->deactivated_page = true;
1274  }
1275  }
1276 
1277  // obj_id not in tree -> it is a unassigned page -> return page id
1278  if (!$this->lm_tree->isInTree($obj_id)) {
1279  return $obj_id;
1280  }
1281 
1282  $curr_node = $this->lm_tree->getNodeData($obj_id);
1283 
1284  $active = ilLMPage::_lookupActive(
1285  $obj_id,
1286  $this->lm->getType(),
1287  $this->lm_set->get("time_scheduled_page_activation")
1288  );
1289 
1290  if ($curr_node["type"] == "pg" &&
1291  $active) { // page in tree -> return page id
1292  $page_id = $curr_node["obj_id"];
1293  } else { // no page -> search for next page and return its id
1294  $succ_node = true;
1295  $active = false;
1296  $page_id = $obj_id;
1297  while ($succ_node && !$active) {
1298  $succ_node = $this->lm_tree->fetchSuccessorNode($page_id, "pg");
1299  $page_id = $succ_node["obj_id"];
1300  $active = ilLMPage::_lookupActive(
1301  $page_id,
1302  $this->lm->getType(),
1303  $this->lm_set->get("time_scheduled_page_activation")
1304  );
1305  }
1306 
1307  if ($succ_node["type"] != "pg") {
1308  $this->chapter_has_no_active_page = true;
1309  return 0;
1310  }
1311 
1312  // if public access get first public page in chapter
1313  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
1314  $this->lm_gui->object->getPublicAccessMode() == 'selected') {
1315  $public = ilLMObject::_isPagePublic($page_id);
1316 
1317  while ($public === false && $page_id > 0) {
1318  $succ_node = $this->lm_tree->fetchSuccessorNode($page_id, 'pg');
1319  $page_id = $succ_node['obj_id'];
1320  $public = ilLMObject::_isPagePublic($page_id);
1321  }
1322  }
1323 
1324  // check whether page found is within "clicked" chapter
1325  if ($this->lm_tree->isInTree($page_id)) {
1326  $path = $this->lm_tree->getPathId($page_id);
1327  if (!in_array($this->requested_obj_id, $path)) {
1328  $this->chapter_has_no_active_page = true;
1329  }
1330  }
1331  }
1332 
1333  $this->current_page_id = $page_id;
1334  return $page_id;
1335  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
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 404 of file class.ilLMPresentationGUI.php.

Referenced by renderTabs().

405  {
406  return $this->export_format;
407  }
+ 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 2814 of file class.ilLMPresentationGUI.php.

2815  {
2816  return "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $a_ref_id . "&amp;obj_id=" . $a_obj_id . "&amp;focus_id=" .
2817  $a_obj_id . "&amp;focus_return=" . $a_return_ref_id;
2818  }

◆ getLayoutLinkTargets()

ilLMPresentationGUI::getLayoutLinkTargets ( )

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

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

1339  {
1340  if (!is_object($this->layout_doc)) {
1341  return array();
1342  }
1343 
1344  $xpc = xpath_new_context($this->layout_doc);
1345 
1346  $path = "/ilLayout/ilLinkTargets/LinkTarget";
1347  $res = xpath_eval($xpc, $path);
1348  $targets = array();
1349  for ($i = 0; $i < count($res->nodeset); $i++) {
1350  $type = $res->nodeset[$i]->get_attribute("Type");
1351  $frame = $res->nodeset[$i]->get_attribute("Frame");
1352  $onclick = $res->nodeset[$i]->get_attribute("OnClick");
1353  $targets[$type] = array("Type" => $type, "Frame" => $frame, "OnClick" => $onclick);
1354  }
1355  var_dump($targets);
1356  exit;
1357  return $targets;
1358  }
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 2937 of file class.ilLMPresentationGUI.php.

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

Referenced by ilMedia().

2938  {
2939  $type = ($a_type == "mep")
2940  ? "mep"
2941  : "lm";
2942 
2943  $lang = $this->lang;
2944  if (!ilPageObject::_exists($type, $a_id, $lang)) {
2945  $lang = "-";
2946  }
2947 
2948  switch ($type) {
2949  case "mep":
2950  return new ilMediaPoolPage($a_id, 0, $lang);
2951  default:
2952  return new ilLMPage($a_id, 0, $lang);
2953  }
2954  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
$type
Class ilMediaPoolPage.
$a_type
Definition: workflow.php:92
$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 2923 of file class.ilLMPresentationGUI.php.

References ilPageObject\_exists().

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

2924  {
2925  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
2926  return new ilLMPageGUI($a_id, 0, false, $this->lang);
2927  }
2928  return new ilLMPageGUI($a_id);
2929  }
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 882 of file class.ilLMPresentationGUI.php.

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

883  {
884  return $this->service->getPresentationStatus()->getLMPresentationTitle();
885  }
+ 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 2884 of file class.ilLMPresentationGUI.php.

References $offline_directory.

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

2885  {
2886  return $this->offline_directory;
2887  }
+ Here is the caller graph for this function:

◆ getPageContent()

ilLMPresentationGUI::getPageContent ( )
protected

Get page content.

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

References help(), and user().

Referenced by getContent(), and page().

1450  {
1451  $content_renderer = new ilLMContentRendererGUI(
1452  $this->service,
1453  $this,
1454  $this->lng,
1455  $this->ctrl,
1456  $this->access,
1457  $this->user,
1458  $this->help,
1459  $this->requested_obj_id
1460  );
1461 
1462  return $content_renderer->render();
1463  }
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:

◆ getSourcecodeDownloadLink()

ilLMPresentationGUI::getSourcecodeDownloadLink ( )

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

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

2865  {
2866  if (!$this->offlineMode()) {
2867  //$this->ctrl->setParameter($this, session_name(), session_id());
2868  $target = $this->ctrl->getLinkTarget($this, "");
2869  $target = ilUtil::appendUrlParameterString($target, session_name() . "=" . session_id());
2870  return $this->ctrl->getLinkTarget($this, "");
2871  } else {
2872  return "";
2873  }
2874  }
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 1683 of file class.ilLMPresentationGUI.php.

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

1684  {
1685  $ilUser = $this->user;
1686 
1687  $page_id = $this->getCurrentPageId();
1688 
1689  if (empty($page_id)) {
1690  return 0;
1691  }
1692 
1693  // determine successor page_id
1694  $found = false;
1695 
1696  // empty chapter
1697  if ($this->chapter_has_no_active_page &&
1698  ilLMObject::_lookupType($this->requested_obj_id) == "st") {
1699  $c_id = $this->requested_obj_id;
1700  } else {
1701  if ($this->deactivated_page) {
1702  $c_id = $this->requested_obj_id;
1703  } else {
1704  $c_id = $page_id;
1705  }
1706  }
1707  while (!$found) {
1708  $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
1709  $c_id = $succ_node["obj_id"];
1710 
1711  $active = ilLMPage::_lookupActive(
1712  $c_id,
1713  $this->lm->getType(),
1714  $this->lm_set->get("time_scheduled_page_activation")
1715  );
1716 
1717  if ($succ_node["obj_id"] > 0 &&
1718  $ilUser->getId() == ANONYMOUS_USER_ID &&
1719  ($this->lm->getPublicAccessMode() == "selected" &&
1720  !ilLMObject::_isPagePublic($succ_node["obj_id"]))) {
1721  $found = false;
1722  } elseif ($succ_node["obj_id"] > 0 && !$active) {
1723  // look, whether activation data should be shown
1724  $act_data = ilLMPage::_lookupActivationData((int) $succ_node["obj_id"], $this->lm->getType());
1725  if ($act_data["show_activation_info"] &&
1726  (ilUtil::now() < $act_data["activation_start"])) {
1727  $found = true;
1728  } else {
1729  $found = false;
1730  }
1731  } else {
1732  $found = true;
1733  }
1734  }
1735 
1736  if ($found) {
1737  return $succ_node["obj_id"];
1738  }
1739  return 0;
1740  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
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
$ilUser
Definition: imgupload.php:18
getCurrentPageId()
Get the current page id.
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
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 284 of file class.ilLMPresentationGUI.php.

Referenced by filterNonAccessibleNode(), and showPrintView().

285  {
286  return $this->service->getTracker();
287  }
+ Here is the caller graph for this function:

◆ glossary()

ilLMPresentationGUI::glossary ( )
Returns
string
Exceptions
ilException

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

References ilGlossary(), offlineMode(), renderPageTitle(), setContentStyles(), and setSystemStyle().

775  {
776  $this->tpl = new ilGlobalTemplate("tpl.glossary_term_output.html", true, true, "Modules/LearningModule");
777  //$GLOBALS["tpl"] = $this->tpl;
778  $this->renderPageTitle();
779 
780  // set style sheets
781  $this->setContentStyles();
782  $this->setSystemStyle();
783 
784  $this->ilGlossary();
785  if (!$this->offlineMode()) {
786  $this->tpl->printToStdout();
787  } else {
788  return $this->tpl->printToString();
789  }
790 
791  return "";
792  }
special template class to simplify handling of ITX/PEAR
setSystemStyle()
Set system style.
ilGlossary()
show glossary term
offlineMode()
checks wether offline content generation is activated
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 2893 of file class.ilLMPresentationGUI.php.

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

2894  {
2895  $directory = $this->getOfflineDirectory() . "/codefiles/" . $page_id . "/" . $paragraph_id;
2896  ilUtil::makeDirParents($directory);
2897  $file = $directory . "/" . $title;
2898  if (!($fp = @fopen($file, "w+"))) {
2899  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2900  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2901  }
2902  chmod($file, 0770);
2903  fwrite($fp, $text);
2904  fclose($fp);
2905  }
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 1574 of file class.ilLMPresentationGUI.php.

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

Referenced by glossary(), and layout().

1575  {
1576  $ilCtrl = $this->ctrl;
1577 
1578  $term_gui = new ilGlossaryTermGUI($this->requested_obj_id);
1579 
1580  // content style
1581  $this->setContentStyles();
1582 
1583  $term_gui->setPageLinker($this->linker);
1584 
1585  $term_gui->setOfflineDirectory($this->getOfflineDirectory());
1586  if (!$this->offlineMode()) {
1587  $ilCtrl->setParameter($this, "pg_type", "glo");
1588  }
1589  $term_gui->output($this->offlineMode(), $this->tpl);
1590 
1591 
1592  if (!$this->offlineMode()) {
1593  $ilCtrl->setParameter($this, "pg_type", "");
1594  }
1595  }
getOfflineDirectory()
get offline directory
global $ilCtrl
Definition: ilias.php:18
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 1668 of file class.ilLMPresentationGUI.php.

Referenced by layout().

1669  {
1670  if ($a_inline != "") {
1671  $js_tpl = new ilTemplate($a_inline, true, false, $a_location);
1672  $js = $js_tpl->get();
1673  $this->tpl->setVariable("INLINE_JS", $js);
1674  }
1675  }
+ Here is the caller graph for this function:

◆ ilLMMenu()

ilLMPresentationGUI::ilLMMenu ( )

output learning module menu

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

References getCurrentPageId(), and renderTabs().

Referenced by layout().

892  {
893  $this->renderTabs("content", $this->getCurrentPageId());
894  /*$this->tpl->setVariable("MENU", $this->lm_gui->setilLMMenu($this->offlineMode()
895  ,$this->getExportFormat(), "content", false, true, $this->getCurrentPageId(),
896  $this->lang, $this->export_all_languages));*/
897  }
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 1075 of file class.ilLMPresentationGUI.php.

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

Referenced by layout().

1075  : string
1076  {
1077  $ilAccess = $this->access;
1079 
1080  // no notes in offline (export) mode
1081  if ($this->offlineMode()) {
1082  return "";
1083  }
1084 
1085  // output notes (on top)
1086 
1087  if (!$ilSetting->get("disable_notes")) {
1088  $this->addHeaderAction();
1089  }
1090 
1091  // now output comments
1092 
1093  if ($ilSetting->get("disable_comments")) {
1094  return "";
1095  }
1096  if (!$this->lm->publicNotes()) {
1097  return "";
1098  }
1099 
1100  $next_class = $this->ctrl->getNextClass($this);
1101 
1102  $pg_id = $this->getCurrentPageId();
1103 
1104  if ($pg_id == 0) {
1105  return "";
1106  }
1107  $notes_gui = new ilNoteGUI($this->lm->getId(), $this->getCurrentPageId(), "pg");
1108 
1109  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
1110  $ilSetting->get("comments_del_tutor", 1)) {
1111  $notes_gui->enablePublicNotesDeletion(true);
1112  }
1113 
1114  $this->ctrl->setParameter($this, "frame", $this->requested_frame);
1115  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1116 
1117  $notes_gui->enablePrivateNotes();
1118  if ($this->lm->publicNotes()) {
1119  $notes_gui->enablePublicNotes();
1120  }
1121 
1122  $callback = array($this, "observeNoteAction");
1123  $notes_gui->addObserver($callback);
1124 
1125  if ($next_class == "ilnotegui") {
1126  $html = $this->ctrl->forwardCommand($notes_gui);
1127  } else {
1128  $html = $notes_gui->getNotesHTML();
1129  }
1130  return $html;
1131  }
addHeaderAction($a_redraw=false)
Add header action.
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 911 of file class.ilLMPresentationGUI.php.

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

Referenced by layout().

912  {
914  if ($this->abstract) {
915  return;
916  }
917 
918  $showViewInFrameset = true;
919 
920  if ($showViewInFrameset) {
921  $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent");
922  } else {
923  $buttonTarget = "_top";
924  }
925 
926 
927  $tpl_menu = new ilTemplate("tpl.lm_sub_menu.html", true, true, "Modules/LearningModule");
928 
929  $pg_id = $this->getCurrentPageId();
930  if ($pg_id == 0) {
931  return;
932  }
933 
934  // edit learning module
935  if (!$this->offlineMode()) {
936  if ($rbacsystem->checkAccess("write", $this->requested_ref_id)) {
937  $tpl_menu->setCurrentBlock("edit_page");
938  $page_id = $this->getCurrentPageId();
939  $tpl_menu->setVariable("EDIT_LINK", ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
940  "&obj_id=" . $page_id . "&to_page=1");
941  $tpl_menu->setVariable("EDIT_TXT", $this->lng->txt("edit_page"));
942  $tpl_menu->setVariable("EDIT_TARGET", $buttonTarget);
943  $tpl_menu->parseCurrentBlock();
944  }
945 
946  $page_id = $this->getCurrentPageId();
947 
948  // permanent link
949  $this->tpl->setPermanentLink("pg", "", $page_id . "_" . $this->lm->getRefId());
950  }
951 
952  $this->tpl->setVariable("SUBMENU", $tpl_menu->get());
953  }
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 1137 of file class.ilLMPresentationGUI.php.

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

Referenced by initScreenHead(), layout(), showDownloadList(), and showPrintViewSelection().

1138  {
1139  global $DIC;
1140  $ltiview = $DIC["lti"];
1141  $ilLocator = $this->locator;
1142  $tree = $this->tree;
1143  $ilCtrl = $this->ctrl;
1144 
1145  if (empty($this->requested_obj_id)) {
1146  $a_id = $this->lm_tree->getRootId();
1147  } else {
1148  $a_id = $this->requested_obj_id;
1149  }
1150 
1151 
1152  if (!$this->lm->cleanFrames()) {
1153  $frame_param = $this->requested_frame;
1154  $frame_target = "";
1155  } elseif (!$this->offlineMode()) {
1156  $frame_param = "";
1157  $frame_target = ilFrameTargetInfo::_getFrame("MainContent");
1158  } else {
1159  $frame_param = "";
1160  $frame_target = "_top";
1161  }
1162 
1163  if (!$this->offlineMode()) {
1164  // LTI
1165  if ($ltiview->isActive()) {
1166  $ilLocator->addRepositoryItems();
1167  } else {
1168  $ilLocator->addRepositoryItems();
1169  //$ilLocator->addItem("...", "");
1170 
1171  /*
1172  $par_id = $tree->getParentId($this->requested_ref_id);
1173  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $par_id);
1174  $ilLocator->addItem(
1175  ilObject::_lookupTitle(ilObject::_lookupObjId($par_id)),
1176  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"),
1177  ilFrameTargetInfo::_getFrame("MainContent"), $par_id);
1178  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);*/
1179  }
1180  } else {
1181  $ilLocator->setOffline(true);
1182  }
1183 
1184  if ($this->lm_tree->isInTree($a_id)) {
1185  $path = $this->lm_tree->getPathFull($a_id);
1186 
1187  foreach ($path as $key => $row) {
1188  if ($row["type"] != "pg") {
1189  if ($row["child"] != $this->lm_tree->getRootId()) {
1190  $ilLocator->addItem(
1193  $row["child"],
1194  ilLMOBject::CHAPTER_TITLE,
1195  $this->lm->isActiveNumbering(),
1196  $this->lm_set->get("time_scheduled_page_activation"),
1197  false,
1198  0,
1199  $this->lang
1200  ),
1201  50,
1202  true
1203  ),
1204  $this->linker->getLink("layout", $row["child"], $frame_param, "StructureObject"),
1205  $frame_target
1206  );
1207  } else {
1208  $ilLocator->addItem(
1209  ilUtil::shortenText($this->getLMPresentationTitle(), 50, true),
1210  $this->linker->getLink("layout", "", $frame_param),
1211  $frame_target,
1213  );
1214  }
1215  }
1216  }
1217  } else { // lonely page
1218  $ilLocator->addItem(
1219  $this->getLMPresentationTitle(),
1220  $this->linker->getLink("layout", "", $this->requested_frame)
1221  );
1222 
1223  $lm_obj = ilLMObjectFactory::getInstance($this->lm, $a_id);
1224 
1225  $ilLocator->addItem(
1226  $lm_obj->getTitle(),
1227  $this->linker->getLink("layout", $a_id, $frame_param),
1228  $frame_target
1229  );
1230  }
1231 
1232  if (DEBUG) {
1233  $debug = "DEBUG: <font color=\"red\">" . $this->type . "::" . $this->id . "::" . $_GET["cmd"] . "</font><br/>";
1234  }
1235 
1236  //$prop_name = $this->objDefinition->getPropertyName($_GET["cmd"],$this->type);
1237 
1238 
1239  $this->tpl->setLocator();
1240  }
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 $ilCtrl
Definition: ilias.php:18
const DEBUG
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.
$DIC
Definition: xapitoken.php:46
+ 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 833 of file class.ilLMPresentationGUI.php.

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

834  {
835  // LTI
836  global $DIC;
837  $ltiview = $DIC["lti"];
838  if ($ltiview->isActive()) {
839  $ilMainMenu = new LTI\ilMainMenuGUI("_top", false, $this->tpl);
840  } else {
841  $ilMainMenu = new ilMainMenuGUI("_top", false, $this->tpl);
842  }
843 
844  if ($this->offlineMode()) {
845  $this->tpl->touchBlock("pg_intro");
846  $this->tpl->touchBlock("pg_outro");
847  return;
848  }
849 
850  $page_id = $this->getCurrentPageId();
851  if ($page_id > 0) {
852  $ilMainMenu->setLoginTargetPar("pg_" . $page_id . "_" . $this->lm->getRefId());
853  }
854 
855  //$this->tpl->touchBlock("mm_intro");
856  //$this->tpl->touchBlock("mm_outro");
857  $this->tpl->touchBlock("pg_intro");
858  $this->tpl->touchBlock("pg_outro");
859  $this->tpl->setBodyClass("std");
860  $this->tpl->setVariable("MAINMENU", $ilMainMenu->getHTML());
861  // LTI
862  $this->tpl->setVariable("MAINMENU_SPACER", $ilMainMenu->getSpacerClass());
863  }
Handles display of the main menu.
offlineMode()
checks wether offline content generation is activated
getCurrentPageId()
Get the current page id.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ ilMedia()

ilLMPresentationGUI::ilMedia ( )

output media

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

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

Referenced by media().

1601  {
1602  $this->setContentStyles();
1603 
1604  $this->renderPageTitle();
1605 
1606  $this->tpl->setCurrentBlock("ilMedia");
1607 
1608  $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
1609  $link_xml = $this->linker->getLinkXML($med_links);
1610 
1611  $media_obj = new ilObjMediaObject($this->requested_mob_id);
1612  if (!empty($_GET["pg_id"])) {
1613  $pg_obj = $this->getLMPage($_GET["pg_id"], $_GET["pg_type"]);
1614  $pg_obj->buildDom();
1615 
1616  $xml = "<dummy>";
1617  // todo: we get always the first alias now (problem if mob is used multiple
1618  // times in page)
1619  $xml .= $pg_obj->getMediaAliasElement($this->requested_mob_id);
1620  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1621  $xml .= $link_xml;
1622  $xml .= "</dummy>";
1623  } else {
1624  $xml = "<dummy>";
1625  // todo: we get always the first alias now (problem if mob is used multiple
1626  // times in page)
1627  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
1628  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1629  $xml .= $link_xml;
1630  $xml .= "</dummy>";
1631  }
1632 
1633 
1634  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
1635  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
1636  $xh = xslt_create();
1637 
1638  if (!$this->offlineMode()) {
1639  $wb_path = ilUtil::getWebspaceDir("output") . "/";
1640  } else {
1641  $wb_path = "";
1642  }
1643 
1644  $mode = ($_GET["cmd"] == "fullscreen")
1645  ? "fullscreen"
1646  : "media";
1647  $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output", $this->offlineMode());
1648  $fullscreen_link =
1649  $this->linker->getLink("fullscreen");
1650  $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
1651  'link_params' => "ref_id=" . $this->lm->getRefId(),'fullscreen_link' => $fullscreen_link,
1652  'ref_id' => $this->lm->getRefId(), 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
1653  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
1654 
1655  echo xslt_error($xh);
1656  xslt_free($xh);
1657 
1658  // unmask user html
1659  $this->tpl->setVariable("MEDIA_CONTENT", $output);
1660 
1661  // add js
1663  }
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.
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 868 of file class.ilLMPresentationGUI.php.

Referenced by refreshToc().

869  {
870  $fac = new ilLMTOCExplorerGUIFactory();
871  $exp = $fac->getExplorer($this->service, "ilTOC");
872  $exp->handleCommand();
873  return $exp;
874  }
+ 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 1843 of file class.ilLMPresentationGUI.php.

References outputInfoScreen().

1844  {
1845  $this->ctrl->setCmd("showSummary");
1846  $this->ctrl->setCmdClass("ilinfoscreengui");
1847  $this->outputInfoScreen();
1848  }
outputInfoScreen($a_standard_locator=false)
info screen
+ Here is the call graph for this function:

◆ initByRequest()

ilLMPresentationGUI::initByRequest (   $query_params)

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 234 of file class.ilLMPresentationGUI.php.

References user().

Referenced by __construct().

235  {
236  $this->service = new ilLMPresentationService(
237  $this->user,
238  $query_params,
239  $this->offline,
240  $this->export_all_languages,
241  $this->export_format
242  );
243 
244  $request = $this->service->getRequest();
245 
246  $this->requested_obj_type = $request->getRequestedObjType();
247  $this->requested_ref_id = $request->getRequestedRefId();
248  $this->requested_transl = $request->getRequestedTranslation(); // handled by presentation status
249  $this->requested_obj_id = $request->getRequestedObjId(); // handled by navigation status
250  $this->requested_back_pg = $request->getRequestedBackPage();
251  $this->requested_frame = $request->getRequestedFrame();
252  $this->requested_search_string = $request->getRequestedSearchString();
253  $this->requested_focus_return = $request->getRequestedFocusReturn();
254  $this->requested_mob_id = $request->getRequestedMobId();
255 
256  $this->lm_set = $this->service->getSettings();
257  $this->lm_gui = $this->service->getLearningModuleGUI();
258  $this->lm = $this->service->getLearningModule();
259  $this->tracker = $this->service->getTracker();
260  $this->linker = $this->service->getLinker();
261 
262  // language translation
263  $this->lang = $this->service->getPresentationStatus()->getLang();
264 
265  $this->lm_tree = $this->service->getLMTree();
266  $this->focus_id = $this->service->getPresentationStatus()->getFocusId();
267  }
user()
Definition: user.php:4
Main service init and factory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPrintViewSelectionForm()

ilLMPresentationGUI::initPrintViewSelectionForm ( )

Init print view selection form.

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

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

Referenced by showPrintViewSelection().

2171  {
2172  $lng = $this->lng;
2173  $ilCtrl = $this->ctrl;
2174 
2175  $this->form = new ilPropertyFormGUI();
2176 
2177  // selection type
2178  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
2179  $radg->setValue("page");
2180  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
2181  $radg->addOption($op1);
2182  $op2 = new ilRadioOption($lng->txt("cont_current_chapter"), "chapter");
2183  $radg->addOption($op2);
2184  $op3 = new ilRadioOption($lng->txt("cont_selected_pg_chap"), "selection");
2185  $radg->addOption($op3);
2186 
2187  $nl = new ilNestedListInputGUI("", "obj_id");
2188  $this->nl = $nl;
2189  $op3->addSubItem($nl);
2190 
2191 
2192  $this->form->addItem($radg);
2193 
2194  $this->form->addCommandButton("showPrintView", $lng->txt("cont_show_print_view"));
2195  $this->form->setOpenTag(false);
2196  $this->form->setCloseTag(false);
2197 
2198  $this->form->setTitle($lng->txt("cont_print_selection"));
2199  $this->form->setFormAction($ilCtrl->getFormAction($this));
2200  }
This class represents an option in a radio group.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
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 1858 of file class.ilLMPresentationGUI.php.

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

Referenced by executeCommand(), and outputInfoScreen().

1859  {
1860  $ilAccess = $this->access;
1861  $ilLocator = $this->locator;
1862  $ilUser = $this->user;
1863 
1864  $this->renderPageTitle();
1865 
1866  // set style sheets
1867  /*
1868  if (!$this->offlineMode())
1869  {
1870  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
1871  }
1872  else
1873  {
1874  $style_name = $ilUser->getPref("style").".css";;
1875  $this->tpl->setStyleSheetLocation("./".$style_name);
1876  }*/
1877 
1878  $this->tpl->loadStandardTemplate();
1879  $this->tpl->setTitle($this->getLMPresentationTitle());
1880  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
1881 
1882  $this->renderTabs($a_active_tab, 0);
1883  /*$this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
1884  ,$this->getExportFormat(), $a_active_tab, true, false, 0,
1885  $this->lang, $this->export_all_languages));*/
1886 
1887  // Full locator, if read permission is given
1888  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1889  $this->ilLocator(true);
1890  } else {
1891  $ilLocator->addRepositoryItems();
1892  $this->tpl->setLocator();
1893  }
1894  }
getLMPresentationTitle()
Get lm presentationtitle.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
ilLocator($a_std_templ_loaded=false)
locator
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 275 of file class.ilLMPresentationGUI.php.

References $tpl.

276  {
277  $this->tpl = $tpl;
278  }

◆ layout()

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

generates frame layout

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

References $attributes, $ctrl, $DIC, $ilCtrl, $ilSetting, $ilUser, $requested_obj_type, $result, $settings, $store, $tpl, $user, ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), attrib2arr(), ilGlyphGUI\CLOSE, determineLayout(), domxml_open_mem(), ilGlyphGUI\get(), getContent(), ilUtil\getStyleSheetLocation(), ilGlossary(), ilJavaScript(), ilLMMenu(), ilLMNotes(), ilLMSubMenu(), ilLocator(), ilUIFramework\init(), ilYuiUtil\initConnection(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), media(), offlineMode(), renderPageTitle(), setHeader(), xpath_eval(), and xpath_new_context().

Referenced by executeCommand(), and resume().

454  {
455  global $DIC;
456 
457  $tpl = $this->tpl;
461  $layout = $this->determineLayout();
462 
463  // xmldocfile is deprecated! Use domxml_open_file instead.
464  // But since using relative pathes with domxml under windows don't work,
465  // we need another solution:
466  $xmlfile = file_get_contents("./Modules/LearningModule/layouts/lm/" . $layout . "/" . $a_xml);
467 
468  if (!$doc = domxml_open_mem($xmlfile)) {
469  throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Error reading " .
470  $layout . "/" . $a_xml . ".");
471  }
472  $this->layout_doc = $doc;
473  //echo ":".htmlentities($xmlfile).":$layout:$a_xml:";
474 
475  // get current frame node
476  $xpc = xpath_new_context($doc);
477  $path = (empty($this->requested_frame) || ($this->requested_frame == "_blank"))
478  ? "/ilLayout/ilFrame[1]"
479  : "//ilFrame[@name='" . $this->requested_frame . "']";
480  $result = xpath_eval($xpc, $path);
481  $found = $result->nodeset;
482  if (count($found) != 1) {
483  throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Found " . count($found) . " nodes for " .
484  " path " . $path . " in " . $layout . "/" . $a_xml . ". LM Layout is " . $this->lm->getLayout());
485  }
486  $node = $found[0];
487 
488  // ProcessFrameset
489  // node is frameset, if it has cols or rows attribute
490  $attributes = $this->attrib2arr($node->attributes());
491 
492  $this->frames = array();
493 
494  // ProcessContentTag
495  if ((empty($attributes["template"]) || !empty($this->requested_obj_type))
496  && ($this->requested_frame != "_blank" || $this->requested_obj_type != "MediaObject")) {
497  // we got a variable content frame (can display different
498  // object types (PageObject, MediaObject, GlossarItem)
499  // and contains elements for them)
500 
501  // determine object type
502  if (empty($this->requested_obj_type)) {
503  $obj_type = "PageObject";
504  } else {
505  $obj_type = $this->requested_obj_type;
506  }
507 
508  // get object specific node
509  $childs = $node->child_nodes();
510  $found = false;
511  foreach ($childs as $child) {
512  if ($child->node_name() == $obj_type) {
513  $found = true;
514  $attributes = $this->attrib2arr($child->attributes());
515  $node = $child;
516  //echo "<br>2node:".$node->node_name();
517  break;
518  }
519  }
520  if (!$found) {
521  throw new ilLMPresentationException("ilLMPresentation: No template specified for frame '" .
522  $this->requested_frame . "' and object type '" . $obj_type . "'.");
523  }
524  }
525 
526  // get template
527  $in_module = ($attributes["template_location"] == "module")
528  ? true
529  : false;
530  /* if ($in_module)
531  {
532  $this->tpl = new ilGlobalTemplate($attributes["template"], true, true, $in_module);
533  $this->tpl->setBodyClass("");
534  }
535  else
536  {
537  $this->tpl = $tpl;
538  }*/
539 
540  // set style sheets
541  if (!$this->offlineMode()) {
542  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
543  } else {
544  $style_name = $ilUser->getPref("style") . ".css";
545  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
546  }
547 
548  iljQueryUtil::initjQuery($this->tpl);
549  iljQueryUtil::initjQueryUI($this->tpl);
550 
551  ilUIFramework::init($this->tpl);
552 
553  // to make e.g. advanced seletions lists work:
554  // $GLOBALS["tpl"] = $this->tpl;
555 
556  $childs = $node->child_nodes();
557 
558  foreach ($childs as $child) {
559  $child_attr = $this->attrib2arr($child->attributes());
560 
561  switch ($child->node_name()) {
562  case "ilMainMenu":
563  // @todo 6.0
564 // $this->ilMainMenu();
565  break;
566 
567  case "ilTOC":
568  // @todo 6.0
569 // $this->ilTOC($child_attr["target_frame"]);
570  break;
571 
572  case "ilPage":
573  $this->renderPageTitle();
574  $this->setHeader();
575  $this->ilLMMenu();
576  $content = $this->getContent();
577  $content .= $this->ilLMNotes();
578  $this->tpl->setContent($content);
579  break;
580 
581  case "ilGlossary":
582  $content = $this->ilGlossary($child);
583  break;
584 
585  case "ilLMNavigation":
586  // @todo 6.0
587 // $this->ilLMNavigation();
588  break;
589 
590  case "ilMedia":
591  $this->media();
592  break;
593 
594  case "ilLocator":
595  $this->ilLocator();
596  break;
597 
598  case "ilJavaScript":
599  $this->ilJavaScript(
600  $child_attr["inline"],
601  $child_attr["file"],
602  $child_attr["location"]
603  );
604  break;
605 
606  case "ilLMMenu":
607  //$this->ilLMMenu();
608  break;
609 
610  case "ilLMHead":
611  // @todo 6.0
612 // $this->ilLMHead();
613  break;
614 
615  case "ilLMSubMenu":
616  $this->ilLMSubMenu();
617  break;
618 
619  case "ilLMNotes":
620  $this->ilLMNotes();
621  break;
622  }
623  }
624 
625  // 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)
626  // Unfortunately there is no standardized way to do this somewhere else. Calling fillJavaScripts always in ilTemplate causes multiple additions of the the js files.
627  // 19.7.2014: outcommented, since fillJavaScriptFiles is called in the next blocks, and the
628  // following lines would add the js files two times
629  // if (strcmp($this->requested_frame, "topright") == 0) $this->tpl->fillJavaScriptFiles();
630  // if (strcmp($this->requested_frame, "right") == 0) $this->tpl->fillJavaScriptFiles();
631  // if (strcmp($this->requested_frame, "botright") == 0) $this->tpl->fillJavaScriptFiles();
632 
633  if (!$this->offlineMode()) {
636 
637  $this->tpl->addJavascript("./Modules/LearningModule/js/LearningModule.js");
638  $close_call = "il.LearningModule.setCloseHTML('" . ilGlyphGUI::get(ilGlyphGUI::CLOSE) . "');";
639  $this->tpl->addOnLoadCode($close_call);
640 
641  //$store->set("cf_".$this->lm->getId());
642 
643  // handle initial content
644  if ($this->requested_frame == "") {
645  $store = new ilSessionIStorage("lm");
646  $last_frame_url = $store->get("cf_" . $this->lm->getId());
647  if ($last_frame_url != "") {
648  $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
649  }
650 
651  if (in_array($layout, array("toc2windyn"))) {
652  $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" .
653  $ilCtrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');
654  il.LearningModule.openInitFrames();
655  ");
656  }
657  $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" .
658  $ilCtrl->getLinkTarget($this, "refreshToc", "", false, false) . "');
659  ");
660  }
661 
662  // from main menu
663  // $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
664  $this->tpl->addJavascript("./Services/Navigation/js/ServiceNavigation.js");
665  ilYuiUtil::initConnection($this->tpl);
666 
667  // @todo 6.0
668  //$this->tpl->fillJavaScriptFiles();
669  //$this->tpl->fillScreenReaderFocus();
670  //$this->tpl->fillCssFiles();
671  } else {
672  // reset standard css files
673  /*
674  $this->tpl->resetJavascript();
675  $this->tpl->resetCss();
676  $this->tpl->setBodyClass("ilLMNoMenu");*/
677 
678  /*
679  foreach (ilObjContentObject::getSupplyingExportFiles() as $f)
680  {
681  if ($f["type"] == "js")
682  {
683  $this->tpl->addJavascript($f["target"]);
684  }
685  if ($f["type"] == "css")
686  {
687  $this->tpl->addCSS($f["target"]);
688  }
689  }
690  $this->tpl->fillJavaScriptFiles(true);
691  $this->tpl->fillCssFiles(true);*/
692  }
693 
694  // @todo 6.0
695  //$this->tpl->fillBodyClass();
696 
697  if ($doShow) {
698  // (horrible) workaround for preventing template engine
699  // from hiding paragraph text that is enclosed
700  // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
701 
702  // @todo 6.0
703  /*$this->tpl->fillTabs();
704  if ($this->fill_on_load_code)
705  {
706  $this->tpl->fillOnLoadCode();
707  }
708  $content = $this->tpl->get();
709  $content = str_replace("&#123;", "{", $content);
710  $content = str_replace("&#125;", "}", $content);
711 
712  header('Content-type: text/html; charset=UTF-8');
713  echo $content;*/
714  $tpl->printToStdout();
715  } else {
716  /*$tpl->printToStdout();
717  $this->tpl->fillLeftNav();
718  $this->tpl->fillOnLoadCode();*/
719 
720  $content = $tpl->printToString();
721  }
722 
723  return($content);
724  }
$store
Definition: metadata.php:90
determineLayout()
Determine layout.
$attributes
Definition: metadata.php:231
$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)
static get($a_glyph, $a_text="")
Get glyph html.
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
ilGlossary()
show glossary term
getContent()
process <ilPage> content tag
ilLMSubMenu()
output learning module submenu
Base exception class for learning module presentation.
ilJavaScript($a_inline="", $a_file="", $a_location="")
Puts JS into template.
global $ilCtrl
Definition: ilias.php:18
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
$ilUser
Definition: imgupload.php:18
ilLocator($a_std_templ_loaded=false)
locator
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
global $ilSetting
Definition: privfeed.php:17
static init(ilGlobalTemplateInterface $a_tpl=null)
Init.
$DIC
Definition: xapitoken.php:46
Session based immediate storage.
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 752 of file class.ilLMPresentationGUI.php.

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

Referenced by fullscreen(), and layout().

753  {
754  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Modules/LearningModule");
755  //$GLOBALS["tpl"] = $this->tpl;
756 
757  // set style sheets
758  $this->setContentStyles();
759  $this->setSystemStyle();
760 
761  $this->ilMedia();
762  if (!$this->offlineMode()) {
763  $this->tpl->printToStdout();
764  } else {
765  return $this->tpl->printToString();
766  }
767  return "";
768  }
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 412 of file class.ilLMPresentationGUI.php.

413  {
414  }

◆ 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 2976 of file class.ilLMPresentationGUI.php.

References ilLearningModuleNotification\ACTION_COMMENT, and ilNotification\TYPE_LM_PAGE.

2977  {
2978  $note = new ilNote($a_note_id);
2979  $note = $note->getText();
2980 
2981  $notification = new ilLearningModuleNotification(
2984  $this->lm,
2985  $a_page_id,
2986  $note
2987  );
2988 
2989  $notification->send();
2990  }
Note class.
Class ilLearningModuleNotification class.

◆ offlineMode()

ilLMPresentationGUI::offlineMode ( )

checks wether offline content generation is activated

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

References $offline.

Referenced by addHeaderAction(), basicPageGuiInit(), filterNonAccessibleNode(), getCurrentPageId(), getSourcecodeDownloadLink(), glossary(), ilGlossary(), ilLMNotes(), ilLMSubMenu(), ilLocator(), ilMainMenu(), ilMedia(), layout(), media(), outputInfoScreen(), page(), renderRating(), and renderTabs().

394  {
395  return $this->offline;
396  }
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilLMPresentationGUI::outputInfoScreen (   $a_standard_locator = false)

info screen

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

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

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

1900  {
1901  $ilAccess = $this->access;
1902 
1903  $this->initScreenHead();
1904 
1905  $this->lng->loadLanguageModule("meta");
1906 
1907  $info = new ilInfoScreenGUI($this->lm_gui);
1908  $info->enablePrivateNotes();
1909  $info->enableLearningProgress();
1910 
1911  $info->enableNews();
1912  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1913  $news_set = new ilSetting("news");
1914  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1915 
1916  $info->enableNewsEditing();
1917 
1918  if ($enable_internal_rss) {
1919  $info->setBlockProperty("news", "settings", true);
1920  }
1921  }
1922 
1923  // add read / back button
1924  /*
1925  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id))
1926  {
1927  if ($this->requested_obj_id > 0)
1928  {
1929  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1930  $info->addButton($this->lng->txt("back"),
1931  $this->ctrl->getLinkTarget($this, "layout"));
1932  }
1933  else
1934  {
1935  $info->addButton($this->lng->txt("view"),
1936  $this->ctrl->getLinkTarget($this, "layout"));
1937  }
1938  }*/
1939 
1940  // show standard meta data section
1941  $info->addMetaDataSections($this->lm->getId(), 0, $this->lm->getType());
1942 
1943  if ($this->offlineMode()) {
1944  $this->tpl->setContent($info->getHTML());
1945  return $this->tpl->get();
1946  } else {
1947  // forward the command
1948  $this->ctrl->forwardCommand($info);
1949  //$this->tpl->setContent("aa");
1950  $this->tpl->printToStdout();
1951  }
1952  }
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 794 of file class.ilLMPresentationGUI.php.

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

795  {
796  global $DIC;
797 
799 
800  //if ($this->requested_frame != "_blank")
801  //{
802  // $this->layout();
803  //}
804  //else
805  //{
806  $this->tpl = new ilGlobalTemplate("tpl.page_fullscreen.html", true, true, "Modules/LearningModule");
807  $GLOBALS["tpl"] = $this->tpl;
808  $this->renderPageTitle();
809 
810  $this->setContentStyles();
811 
812  // set style sheets
813  if (!$this->offlineMode()) {
814  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
815  } else {
816  $style_name = $ilUser->getPref("style") . ".css";
817  ;
818  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
819  }
820 
821  $this->tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
822  if (!$this->offlineMode()) {
823  $this->tpl->printToStdout();
824  } else {
825  return $this->tpl->get();
826  }
827  //}
828  }
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.
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
$DIC
Definition: xapitoken.php:46
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ processNodes()

ilLMPresentationGUI::processNodes ( $a_content,
$a_node 
)

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

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

1744  {
1745  $child_nodes = $a_node->child_nodes();
1746  foreach ($child_nodes as $child) {
1747  if ($child->node_name() == "ilFrame") {
1748  $attributes = $this->attrib2arr($child->attributes());
1749  // node is frameset, if it has cols or rows attribute
1750  if ((!empty($attributes["rows"])) || (!empty($attrubtes["cols"]))) {
1751  // if framset has name, another http request is necessary
1752  // (html framesets don't have names, so we need a wrapper frame)
1753  if (!empty($attributes["name"])) {
1754  unset($attributes["template"]);
1755  unset($attributes["template_location"]);
1756  $attributes["src"] =
1757  $this->linker->getLink(
1758  "layout",
1759  $this->requested_obj_id,
1760  $attributes["name"],
1761  "",
1762  "keep",
1763  "",
1764  $_GET["srcstring"]
1765  );
1766  $attributes["title"] = $this->lng->txt("cont_frame_" . $attributes["name"]);
1767  $a_content .= $this->buildTag("", "frame", $attributes);
1768  $this->frames[$attributes["name"]] = $attributes["name"];
1769  //echo "<br>processNodes:add1 ".$attributes["name"];
1770  } else { // ok, no name means that we can easily output the frameset tag
1771  $a_content .= $this->buildTag("start", "frameset", $attributes);
1772  $this->processNodes($a_content, $child);
1773  $a_content .= $this->buildTag("end", "frameset");
1774  }
1775  } else { // frame with
1776  unset($attributes["template"]);
1777  unset($attributes["template_location"]);
1778  $attributes["src"] =
1779  $this->linker->getLink(
1780  "layout",
1781  $this->requested_obj_id,
1782  $attributes["name"],
1783  "",
1784  "keep",
1785  "",
1786  $_GET["srcstring"]
1787  );
1788  $attributes["title"] = $this->lng->txt("cont_frame_" . $attributes["name"]);
1789  if ($attributes["name"] == "toc") {
1790  $attributes["src"] .= "#" . $this->requested_obj_id;
1791  } else {
1792  // Handle Anchors
1793  if ($_GET["anchor"] != "") {
1794  $attributes["src"] .= "#" . rawurlencode($_GET["anchor"]);
1795  }
1796  }
1797  $a_content .= $this->buildTag("", "frame", $attributes);
1798  $this->frames[$attributes["name"]] = $attributes["name"];
1799  }
1800  }
1801  }
1802  }
$attributes
Definition: metadata.php:231
$_GET["client_id"]
$a_content
Definition: workflow.php:93
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 959 of file class.ilLMPresentationGUI.php.

References addHeaderAction(), and exit.

960  {
961  echo $this->addHeaderAction(true);
962  exit;
963  }
exit
Definition: login.php:29
addHeaderAction($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 2959 of file class.ilLMPresentationGUI.php.

References exit, and ilTOC().

2960  {
2961  $exp = $this->ilTOC(true);
2962 
2963  echo $exp->getHTML() .
2964  "<script>" . $exp->getOnLoadCode() . "</script>";
2965  exit;
2966  }
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 2908 of file class.ilLMPresentationGUI.php.

References getLMPresentationTitle().

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

2909  {
2910  $this->tpl->setHeaderPageTitle($this->getLMPresentationTitle());
2911  // @todo 6.0
2912 // $this->tpl->fillWindowTitle();
2913 // $this->tpl->fillContentLanguage();
2914  }
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 1470 of file class.ilLMPresentationGUI.php.

References getCurrentPageId(), and offlineMode().

Referenced by getContent().

1471  {
1472  // rating
1473  $rating = "";
1474  if ($this->lm->hasRatingPages() && !$this->offlineMode()) {
1475  $rating_gui = new ilRatingGUI();
1476  $rating_gui->setObject($this->lm->getId(), "lm", $this->getCurrentPageId(), "lm");
1477  $rating_gui->setYourRatingText($this->lng->txt("lm_rate_page"));
1478 
1479  /*
1480  $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true,
1481  "il.ExcPeerReview.saveComments(".$a_set["peer_id"].", %rating%)"));
1482  */
1483 
1484  $this->ctrl->setParameter($this, "pgid", $this->getCurrentPageId());
1485  $this->tpl->addOnLoadCode("il.LearningModule.setRatingUrl('" .
1486  $this->ctrl->getLinkTarget($this, "updatePageRating", "", true, false) .
1487  "')");
1488  $this->ctrl->setParameter($this, "pgid", "");
1489 
1490  $rating = '<div id="ilrtrpg" style="text-align:right">' .
1491  $rating_gui->getHtml(true, true, "il.LearningModule.saveRating(%rating%);") .
1492  "</div>";
1493  }
1494  return $rating;
1495  }
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

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

References $current_page_id, getExportFormat(), offlineMode(), and user().

Referenced by ilLMMenu(), initScreenHead(), showDownloadList(), and showPrintViewSelection().

2999  {
3000  $menu_editor = new ilLMMenuEditor();
3001  $menu_editor->setObjId($this->lm->getId());
3002 
3003  $navigation_renderer = new ilLMMenuRendererGUI(
3004  $this->tabs,
3006  $active_tab,
3007  (string) $this->getExportFormat(),
3008  $this->export_all_languages,
3009  $this->lm,
3010  $this->offlineMode(),
3011  $menu_editor,
3012  $this->lang,
3013  $this->ctrl,
3014  $this->access,
3015  $this->user,
3016  $this->lng
3017  );
3018  $navigation_renderer->render();
3019  }
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 445 of file class.ilLMPresentationGUI.php.

References layout().

446  {
447  $this->layout();
448  }
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 732 of file class.ilLMPresentationGUI.php.

References $_GET, and $store.

733  {
734  $store = new ilSessionIStorage("lm");
735  if ($_GET["url"] != "") {
736  $store->set("cf_" . $this->lm->getId(), $_GET["url"]);
737  } else {
738  $store->set("cf_" . $this->lm->getId(), $_GET["url"]);
739  }
740  }
$store
Definition: metadata.php:90
$_GET["client_id"]
Session based immediate storage.

◆ setContentStyles()

ilLMPresentationGUI::setContentStyles ( )
protected

Set content style.

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

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

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

1364  {
1365  // content style
1366 
1367  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
1368  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
1369 
1370  /*
1371  $this->tpl->setCurrentBlock("ContentStyle");
1372  if (!$this->offlineMode())
1373  {
1374  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1375  ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
1376  }
1377  else
1378  {
1379  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css");
1380  }
1381  $this->tpl->parseCurrentBlock();
1382 
1383  // syntax style
1384  $this->tpl->setCurrentBlock("SyntaxStyle");
1385  if (!$this->offlineMode())
1386  {
1387  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1388  ilObjStyleSheet::getSyntaxStylePath());
1389  }
1390  else
1391  {
1392  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1393  "syntaxhighlight.css");
1394  }
1395  $this->tpl->parseCurrentBlock();*/
1396  }
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 902 of file class.ilLMPresentationGUI.php.

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

Referenced by layout().

903  {
904  $this->tpl->setTitle($this->getLMPresentationTitle());
905  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
906  }
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 1401 of file class.ilLMPresentationGUI.php.

References ilUtil\getStyleSheetLocation().

Referenced by glossary(), and media().

1402  {
1403  $this->tpl->addCss(ilUtil::getStyleSheetLocation());
1404  }
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 2740 of file class.ilLMPresentationGUI.php.

References ilMDUtils\_parseCopyright(), ilUtil\getImagePath(), getLMPresentationTitle(), ilLocator(), renderPageTitle(), renderTabs(), and setContentStyles().

2741  {
2742  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2743  return;
2744  }
2745 
2746  $this->setContentStyles();
2747  $this->renderPageTitle();
2748 
2749  $this->tpl->loadStandardTemplate();
2750 
2751  $this->renderTabs("download", 0);
2752 
2753  $this->ilLocator(true);
2754  //$this->tpl->stopTitleFloating();
2755  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_download_list.html", "Modules/LearningModule");
2756 
2757  // set title header
2758  $this->tpl->setTitle($this->getLMPresentationTitle());
2759  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
2760 
2761  // output copyright information
2762  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2763  if (is_object($md_rights = $md->getRights())) {
2764  $copyright = $md_rights->getDescription();
2765 
2766  $copyright = ilMDUtils::_parseCopyright($copyright);
2767 
2768  if ($copyright != "") {
2769  $this->lng->loadLanguageModule("meta");
2770  $this->tpl->setCurrentBlock("copyright");
2771  $this->tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2772  $this->tpl->setVariable("LM_COPYRIGHT", $copyright);
2773  $this->tpl->parseCurrentBlock();
2774  }
2775  }
2776 
2777 
2778  $download_table = new ilLMDownloadTableGUI($this, "showDownloadList", $this->lm);
2779  $this->tpl->setVariable("DOWNLOAD_TABLE", $download_table->getHTML());
2780  $this->tpl->printToStdout();
2781  }
static _parseCopyright($a_copyright)
Parse copyright.
getLMPresentationTitle()
Get lm presentationtitle.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
TableGUI class for lm download files.
ilLocator($a_std_templ_loaded=false)
locator
renderTabs($active_tab, $current_page_id)
Render tabs.
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ showInfoScreen()

ilLMPresentationGUI::showInfoScreen ( )

info screen call from inside learning module

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

References outputInfoScreen().

1854  {
1855  $this->outputInfoScreen(true);
1856  }
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 2826 of file class.ilLMPresentationGUI.php.

References $a_content, $tpl, and setContentStyles().

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

2827  {
2828  // content style
2829  $this->setContentStyles();
2830 
2831  $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
2832  $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
2833 
2834  $this->tpl->setVariable("PAGE_CONTENT", $tpl->get());
2835  }
$a_content
Definition: workflow.php:93
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 2858 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

2859  {
2860  $this->showMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
2861  }
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 2849 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

2850  {
2851  $this->showMessageScreen($this->lng->txt("msg_no_page_access"));
2852  }
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 2841 of file class.ilLMPresentationGUI.php.

References showMessageScreen().

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

◆ showPrintView()

ilLMPresentationGUI::showPrintView ( )

show print view

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

References $_POST, $ctrl, $ilCtrl, $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(), getCurrentPageId(), ilGlossaryDefinition\getDefinitionList(), ilObjStyleSheet\getEffectiveContentStyleId(), ilMD\getGeneral(), ilUtil\getImagePath(), getLMPageGUI(), getLMPresentationTitle(), getTracker(), ilUtil\getWebspaceDir(), ilLMObject\PAGE_TITLE, renderPageTitle(), ilUtil\sendFailure(), setContentStyles(), and ilUtil\sortArray().

2206  {
2207  $ilUser = $this->user;
2208  $lng = $this->lng;
2209  $ilCtrl = $this->ctrl;
2210  $tabs = $this->tabs;
2211 
2212  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
2213  return;
2214  }
2215 
2216  $this->renderPageTitle();
2217 
2218  $tabs->setBackTarget(
2219  $lng->txt("back"),
2220  $ilCtrl->getLinkTarget($this, "showPrintViewSelection")
2221  );
2222 
2223  $c_obj_id = $this->getCurrentPageId();
2224  // set values according to selection
2225  if ($_POST["sel_type"] == "page") {
2226  if (!is_array($_POST["obj_id"]) || !in_array($c_obj_id, $_POST["obj_id"])) {
2227  $_POST["obj_id"][] = $c_obj_id;
2228  }
2229  }
2230  if ($_POST["sel_type"] == "chapter" && $c_obj_id > 0) {
2231  $path = $this->lm_tree->getPathFull($c_obj_id);
2232  $chap_id = $path[1]["child"];
2233  if ($chap_id > 0) {
2234  $_POST["obj_id"][] = $chap_id;
2235  }
2236  }
2237 
2238  $this->setContentStyles();
2239 
2240  $tpl = new ilTemplate("tpl.lm_print_view.html", true, true, "Modules/LearningModule");
2241 
2242  // set title header
2243  $this->tpl->setTitle($this->getLMPresentationTitle());
2244 
2245  $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
2246 
2247  $act_level = 99999;
2248  $activated = false;
2249 
2250  $glossary_links = array();
2251  $output_header = false;
2252  $media_links = array();
2253 
2254  // get header and footer
2255  if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
2256  if (ilLMObject::_exists($this->lm->getFooterPage())) {
2257  $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
2258  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2259  $this->lm->getStyleSheetId(),
2260  "lm"
2261  ));
2262 
2263 
2264  // determine target frames for internal links
2265  $page_object_gui->setLinkFrame($this->requested_frame);
2266  $page_object_gui->setOutputMode("print");
2267  $page_object_gui->setPresentationTitle("");
2268  $page_object_gui->setFileDownloadLink("#");
2269  $page_object_gui->setFullscreenLink("#");
2270  $page_object_gui->setSourceCodeDownloadScript("#");
2271  $footer_page_content = $page_object_gui->showPage();
2272  }
2273  }
2274  if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
2275  if (ilLMObject::_exists($this->lm->getHeaderPage())) {
2276  $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
2277  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2278  $this->lm->getStyleSheetId(),
2279  "lm"
2280  ));
2281 
2282 
2283  // determine target frames for internal links
2284  $page_object_gui->setLinkFrame($this->requested_frame);
2285  $page_object_gui->setOutputMode("print");
2286  $page_object_gui->setPresentationTitle("");
2287  $page_object_gui->setFileDownloadLink("#");
2288  $page_object_gui->setFullscreenLink("#");
2289  $page_object_gui->setSourceCodeDownloadScript("#");
2290  $header_page_content = $page_object_gui->showPage();
2291  }
2292  }
2293 
2294  // add free selected pages
2295  if (is_array($_POST["obj_id"])) {
2296  foreach ($_POST["obj_id"] as $k) {
2297  if ($k > 0 && !$this->lm_tree->isInTree($k)) {
2298  if (ilLMObject::_lookupType($k) == "pg") {
2299  $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
2300  }
2301  }
2302  }
2303  } else {
2304  ilUtil::sendFailure($lng->txt("cont_print_no_page_selected"), true);
2305  $ilCtrl->redirect($this, "showPrintViewSelection");
2306  }
2307 
2308  foreach ($nodes as $node_key => $node) {
2309  // check page activation
2310  $active = ilLMPage::_lookupActive(
2311  $node["obj_id"],
2312  $this->lm->getType(),
2313  $this->lm_set->get("time_scheduled_page_activation")
2314  );
2315  if ($node["type"] == "pg" && !$active) {
2316  continue;
2317  }
2318 
2319  // print all subchapters/subpages if higher chapter
2320  // has been selected
2321  if ($node["depth"] <= $act_level) {
2322  if (is_array($_POST["obj_id"]) && in_array($node["obj_id"], $_POST["obj_id"])) {
2323  $act_level = $node["depth"];
2324  $activated = true;
2325  } else {
2326  $act_level = 99999;
2327  $activated = false;
2328  }
2329  }
2330  if ($this->lm->getRestrictForwardNavigation()) {
2331  if ($this->getTracker()->hasPredIncorrectAnswers($node["obj_id"])) {
2332  continue;
2333  }
2334  }
2335  if ($activated &&
2336  ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) {
2337  // output learning module header
2338  if ($node["type"] == "du") {
2339  $output_header = true;
2340  }
2341 
2342  // output chapter title
2343  if ($node["type"] == "st") {
2344  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2345  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2346  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2347  continue;
2348  }
2349  }
2350 
2351  $chap = new ilStructureObject($this->lm, $node["obj_id"]);
2352  $tpl->setCurrentBlock("print_chapter");
2353 
2354  $chapter_title = $chap->_getPresentationTitle(
2355  $node["obj_id"],
2356  $this->lm->isActiveNumbering(),
2357  $this->lm_set->get("time_scheduled_page_activation"),
2358  0,
2359  $this->lang
2360  );
2361  $tpl->setVariable(
2362  "CHAP_TITLE",
2363  $chapter_title
2364  );
2365 
2366  if ($this->lm->getPageHeader() == ilLMOBject::CHAPTER_TITLE) {
2367  if ($nodes[$node_key + 1]["type"] == "pg") {
2368  $tpl->setVariable(
2369  "CHAP_HEADER",
2370  $header_page_content
2371  );
2372  $did_chap_page_header = true;
2373  }
2374  }
2375 
2376  $tpl->parseCurrentBlock();
2377  $tpl->setCurrentBlock("print_block");
2378  $tpl->parseCurrentBlock();
2379  }
2380 
2381  // output page
2382  if ($node["type"] == "pg") {
2383  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2384  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2385  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2386  continue;
2387  }
2388  }
2389 
2390  $tpl->setCurrentBlock("print_item");
2391 
2392  // get page
2393  $page_id = $node["obj_id"];
2394  $page_object_gui = $this->getLMPageGUI($page_id);
2395  $page_object = $page_object_gui->getPageObject();
2396  $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2397  $this->lm->getStyleSheetId(),
2398  "lm"
2399  ));
2400 
2401 
2402  // get lm page
2403  $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
2404  $lm_pg_obj->setLMId($this->lm->getId());
2405 
2406  // determine target frames for internal links
2407  $page_object_gui->setLinkFrame($this->requested_frame);
2408  $page_object_gui->setOutputMode("print");
2409  $page_object_gui->setPresentationTitle("");
2410 
2411  if ($this->lm->getPageHeader() == ilLMObject::PAGE_TITLE || $node["free"] === true) {
2413  $lm_pg_obj->getId(),
2414  $this->lm->getPageHeader(),
2415  $this->lm->isActiveNumbering(),
2416  $this->lm_set->get("time_scheduled_page_activation"),
2417  false,
2418  0,
2419  $this->lang
2420  );
2421 
2422  // prevent page title after chapter title
2423  // that have the same content
2424  if ($this->lm->isActiveNumbering()) {
2425  $chapter_title = trim(substr(
2426  $chapter_title,
2427  strpos($chapter_title, " ")
2428  ));
2429  }
2430 
2431  if ($page_title != $chapter_title) {
2432  $page_object_gui->setPresentationTitle($page_title);
2433  }
2434  }
2435 
2436  // handle header / footer
2437  $hcont = $header_page_content;
2438  $fcont = $footer_page_content;
2439 
2440  if ($this->lm->getPageHeader() == ilLMOBject::CHAPTER_TITLE) {
2441  if ($did_chap_page_header) {
2442  $hcont = "";
2443  }
2444  if ($nodes[$node_key + 1]["type"] == "pg" &&
2445  !($nodes[$node_key + 1]["depth"] <= $act_level
2446  && !in_array($nodes[$node_key + 1]["obj_id"], $_POST["obj_id"]))) {
2447  $fcont = "";
2448  }
2449  }
2450 
2451  $page_object_gui->setFileDownloadLink("#");
2452  $page_object_gui->setFullscreenLink("#");
2453  $page_object_gui->setSourceCodeDownloadScript("#");
2454  $page_content = $page_object_gui->showPage();
2455  if ($this->lm->getPageHeader() != ilLMObject::PAGE_TITLE) {
2456  $tpl->setVariable(
2457  "CONTENT",
2458  $hcont . $page_content . $fcont
2459  );
2460  } else {
2461  $tpl->setVariable(
2462  "CONTENT",
2463  $hcont . $page_content . $fcont . "<br />"
2464  );
2465  }
2466  $chapter_title = "";
2467  $tpl->parseCurrentBlock();
2468  $tpl->setCurrentBlock("print_block");
2469  $tpl->parseCurrentBlock();
2470 
2471  // get internal links
2472  $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]);
2473 
2474  $got_mobs = false;
2475 
2476  foreach ($int_links as $key => $link) {
2477  if ($link["type"] == "git" &&
2478  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
2479  $glossary_links[$key] = $link;
2480  }
2481  if ($link["type"] == "mob" &&
2482  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
2483  $got_mobs = true;
2484  $mob_links[$key] = $link;
2485  }
2486  }
2487 
2488  // this is not cool because of performance reasons
2489  // unfortunately the int link table does not
2490  // store the target frame (we want to append all linked
2491  // images but not inline images (i.e. mobs with no target
2492  // frame))
2493  if ($got_mobs) {
2494  $page_object->buildDom();
2495  $links = $page_object->getInternalLinks();
2496  foreach ($links as $link) {
2497  if ($link["Type"] == "MediaObject"
2498  && $link["TargetFrame"] != ""
2499  && $link["TargetFrame"] != "None") {
2500  $media_links[] = $link;
2501  }
2502  }
2503  }
2504  }
2505  }
2506  }
2507 
2508  $annex_cnt = 0;
2509  $annexes = array();
2510 
2511  // glossary
2512  if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) {
2513  // sort terms
2514  $terms = array();
2515 
2516  foreach ($glossary_links as $key => $link) {
2517  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]);
2518  $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term);
2519  }
2520  $terms = ilUtil::sortArray($terms, "term", "asc");
2521  //ksort($terms);
2522 
2523  foreach ($terms as $t) {
2524  $link = $t["link"];
2525  $key = $t["key"];
2526  $defs = ilGlossaryDefinition::getDefinitionList($link["id"]);
2527  $def_cnt = 1;
2528 
2529  // output all definitions of term
2530  foreach ($defs as $def) {
2531  // definition + number, if more than 1 definition
2532  if (count($defs) > 1) {
2533  $tpl->setCurrentBlock("def_title");
2534  $tpl->setVariable(
2535  "TXT_DEFINITION",
2536  $this->lng->txt("cont_definition") . " " . ($def_cnt++)
2537  );
2538  $tpl->parseCurrentBlock();
2539  }
2540  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
2541  $page_gui->setTemplateOutput(false);
2542  $page_gui->setOutputMode("print");
2543 
2544  $tpl->setCurrentBlock("definition");
2545  $page_gui->setFileDownloadLink("#");
2546  $page_gui->setFullscreenLink("#");
2547  $page_gui->setSourceCodeDownloadScript("#");
2548  $output = $page_gui->showPage();
2549  $tpl->setVariable("VAL_DEFINITION", $output);
2550  $tpl->parseCurrentBlock();
2551  }
2552 
2553  // output term
2554  $tpl->setCurrentBlock("term");
2555  $tpl->setVariable(
2556  "VAL_TERM",
2557  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])
2558  );
2559  $tpl->parseCurrentBlock();
2560  }
2561 
2562  // output glossary header
2563  $annex_cnt++;
2564  $tpl->setCurrentBlock("glossary");
2565  $annex_title = $this->lng->txt("cont_annex") . " " .
2566  chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo");
2567  $tpl->setVariable("TXT_GLOSSARY", $annex_title);
2568  $tpl->parseCurrentBlock();
2569 
2570  $annexes[] = $annex_title;
2571  }
2572 
2573  // referenced images
2574  if (count($media_links) > 0) {
2575  foreach ($media_links as $media) {
2576  if (substr($media["Target"], 0, 4) == "il__") {
2577  $arr = explode("_", $media["Target"]);
2578  $id = $arr[count($arr) - 1];
2579 
2580  $med_obj = new ilObjMediaObject($id);
2581  $med_item = $med_obj->getMediaItem("Standard");
2582  if (is_object($med_item)) {
2583  if (is_int(strpos($med_item->getFormat(), "image"))) {
2584  $tpl->setCurrentBlock("ref_image");
2585 
2586  // image source
2587  if ($med_item->getLocationType() == "LocalFile") {
2588  $tpl->setVariable(
2589  "IMG_SOURCE",
2590  ilUtil::getWebspaceDir("output") . "/mobs/mm_" . $id .
2591  "/" . $med_item->getLocation()
2592  );
2593  } else {
2594  $tpl->setVariable(
2595  "IMG_SOURCE",
2596  $med_item->getLocation()
2597  );
2598  }
2599 
2600  if ($med_item->getCaption() != "") {
2601  $tpl->setVariable("IMG_TITLE", $med_item->getCaption());
2602  } else {
2603  $tpl->setVariable("IMG_TITLE", $med_obj->getTitle());
2604  }
2605  $tpl->parseCurrentBlock();
2606  }
2607  }
2608  }
2609  }
2610 
2611  // output glossary header
2612  $annex_cnt++;
2613  $tpl->setCurrentBlock("ref_images");
2614  $annex_title = $this->lng->txt("cont_annex") . " " .
2615  chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images");
2616  $tpl->setVariable("TXT_REF_IMAGES", $annex_title);
2617  $tpl->parseCurrentBlock();
2618 
2619  $annexes[] = $annex_title;
2620  }
2621 
2622  // output learning module title and toc
2623  if ($output_header) {
2624  $tpl->setCurrentBlock("print_header");
2625  $tpl->setVariable("LM_TITLE", $this->getLMPresentationTitle());
2626  if ($this->lm->getDescription() != "none") {
2627  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2628  $md_gen = $md->getGeneral();
2629  foreach ($md_gen->getDescriptionIds() as $id) {
2630  $md_des = $md_gen->getDescription($id);
2631  $description = $md_des->getDescription();
2632  }
2633 
2634  $tpl->setVariable(
2635  "LM_DESCRIPTION",
2636  $description
2637  );
2638  }
2639  $tpl->parseCurrentBlock();
2640 
2641  // output toc
2642  $nodes2 = $nodes;
2643  foreach ($nodes2 as $node2) {
2644  if ($node2["type"] == "st"
2645  && ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node2["obj_id"])) {
2646  for ($j = 1; $j < $node2["depth"]; $j++) {
2647  $tpl->setCurrentBlock("indent");
2648  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2649  $tpl->parseCurrentBlock();
2650  }
2651  $tpl->setCurrentBlock("toc_entry");
2652  $tpl->setVariable(
2653  "TXT_TOC_TITLE",
2655  $node2["obj_id"],
2656  ilLMOBject::CHAPTER_TITLE,
2657  $this->lm->isActiveNumbering(),
2658  $this->lm_set->get("time_scheduled_page_activation"),
2659  false,
2660  0,
2661  $this->lang
2662  )
2663  );
2664  $tpl->parseCurrentBlock();
2665  }
2666  }
2667 
2668  // annexes
2669  foreach ($annexes as $annex) {
2670  $tpl->setCurrentBlock("indent");
2671  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2672  $tpl->parseCurrentBlock();
2673  $tpl->setCurrentBlock("toc_entry");
2674  $tpl->setVariable("TXT_TOC_TITLE", $annex);
2675  $tpl->parseCurrentBlock();
2676  }
2677 
2678  $tpl->setCurrentBlock("toc");
2679  $tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
2680  $tpl->parseCurrentBlock();
2681 
2682  $tpl->setCurrentBlock("print_start_block");
2683  $tpl->parseCurrentBlock();
2684  }
2685 
2686  // output author information
2687  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2688  if (is_object($lifecycle = $md->getLifecycle())) {
2689  $sep = $author = "";
2690  foreach (($ids = $lifecycle->getContributeIds()) as $con_id) {
2691  $md_con = $lifecycle->getContribute($con_id);
2692  if ($md_con->getRole() == "Author") {
2693  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2694  $md_ent = $md_con->getEntity($ent_id);
2695  $author = $author . $sep . $md_ent->getEntity();
2696  $sep = ", ";
2697  }
2698  }
2699  }
2700  if ($author != "") {
2701  $this->lng->loadLanguageModule("meta");
2702  $tpl->setCurrentBlock("author");
2703  $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2704  $tpl->setVariable("LM_AUTHOR", $author);
2705  $tpl->parseCurrentBlock();
2706  }
2707  }
2708 
2709 
2710  // output copyright information
2711  if (is_object($md_rights = $md->getRights())) {
2712  $copyright = $md_rights->getDescription();
2713  $copyright = ilMDUtils::_parseCopyright($copyright);
2714 
2715  if ($copyright != "") {
2716  $this->lng->loadLanguageModule("meta");
2717  $tpl->setCurrentBlock("copyright");
2718  $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2719  $tpl->setVariable("LM_COPYRIGHT", $copyright);
2720  $tpl->parseCurrentBlock();
2721  }
2722  }
2723 
2724  $this->tpl->setContent($tpl->get());
2725  $this->tpl->printToStdout();
2726  }
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.
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.
global $ilCtrl
Definition: ilias.php:18
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
$ilUser
Definition: imgupload.php:18
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.
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 1957 of file class.ilLMPresentationGUI.php.

References $_POST, Vendor\Package\$f, $ilUser, $lang, $lng, $requested_obj_id, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), filterNonAccessibleNode(), ilUtil\getImagePath(), getLMPresentationTitle(), ilLocator(), initPrintViewSelectionForm(), renderPageTitle(), renderTabs(), and setContentStyles().

1958  {
1959  $ilUser = $this->user;
1960  $lng = $this->lng;
1961 
1962  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1963  return;
1964  }
1965 
1966 
1967  $this->setContentStyles();
1968  $this->renderPageTitle();
1969 
1970  $this->tpl->loadStandardTemplate();
1971 
1972  $this->renderTabs("print", 0);
1973  /*$this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode()
1974  ,$this->getExportFormat(), "print", true,false, 0,
1975  $this->lang, $this->export_all_languages));*/
1976 
1977  $this->ilLocator(true);
1978  $this->tpl->addBlockFile(
1979  "ADM_CONTENT",
1980  "adm_content",
1981  "tpl.lm_print_selection.html",
1982  "Modules/LearningModule"
1983  );
1984 
1985  // set title header
1986  $this->tpl->setTitle($this->getLMPresentationTitle());
1987  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
1988 
1989  /*$this->tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
1990  $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
1991  $this->tpl->setVariable("LINK_BACK",
1992  $this->ctrl->getLinkTargetByClass("illmpresentationgui", ""));*/
1993 
1994  $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
1995  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormaction($this));
1996 
1997  $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1998  $nodes = $this->filterNonAccessibleNode($nodes);
1999 
2000  if (!is_array($_POST["item"])) {
2001  if ($this->requested_obj_id != "") {
2002  $_POST["item"][$this->requested_obj_id] = "y";
2003  } else {
2004  $_POST["item"][1] = "y";
2005  }
2006  }
2007 
2008  $this->initPrintViewSelectionForm();
2009 
2010  foreach ($nodes as $node) {
2011 
2012  // check page activation
2013  $active = ilLMPage::_lookupActive(
2014  $node["obj_id"],
2015  $this->lm->getType(),
2016  $this->lm_set->get("time_scheduled_page_activation")
2017  );
2018 
2019  if ($node["type"] == "pg" &&
2020  !$active) {
2021  continue;
2022  }
2023 
2024  $text = $img_scr = $img_alt = "";
2025  $disabled = false;
2026  $checked = false;
2027 
2028  switch ($node["type"]) {
2029  // page
2030  case "pg":
2031  $text =
2033  $node["obj_id"],
2034  $this->lm->getPageHeader(),
2035  $this->lm->isActiveNumbering(),
2036  $this->lm_set->get("time_scheduled_page_activation"),
2037  false,
2038  0,
2039  $this->lang
2040  );
2041 
2042  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2043  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2044  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2045  $disabled = true;
2046  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2047  }
2048  }
2049  $img_src = ilUtil::getImagePath("icon_pg.svg");
2050  $img_alt = $lng->txt("icon") . " " . $lng->txt("pg");
2051  break;
2052 
2053  // learning module
2054  case "du":
2055  $text = $this->getLMPresentationTitle();
2056  $img_src = ilUtil::getImagePath("icon_lm.svg");
2057  $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm");
2058  break;
2059 
2060  // chapter
2061  case "st":
2062  $text =
2064  $node["obj_id"],
2065  ilLMOBject::CHAPTER_TITLE,
2066  $this->lm->isActiveNumbering(),
2067  $this->lm_set->get("time_scheduled_page_activation"),
2068  false,
2069  0,
2070  $this->lang
2071  );
2072  if ($ilUser->getId() == ANONYMOUS_USER_ID &&
2073  $this->lm_gui->object->getPublicAccessMode() == "selected") {
2074  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
2075  $disabled = true;
2076  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2077  }
2078  }
2079  $img_src = ilUtil::getImagePath("icon_st.svg");
2080  $img_alt = $lng->txt("icon") . " " . $lng->txt("st");
2081  break;
2082  }
2083 
2084  if (!ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) {
2085  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2086  }
2087 
2088  $this->nl->addListNode(
2089  $node["obj_id"],
2090  $text,
2091  $node["parent"],
2092  $checked,
2093  $disabled,
2094  $img_src,
2095  $img_alt
2096  );
2097  }
2098 
2099 
2100  // check for free page
2101  if ($this->requested_obj_id > 0 && !$this->lm_tree->isInTree($this->requested_obj_id)) {
2102  $text =
2104  $this->requested_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($this->requested_obj_id)) {
2116  $disabled = true;
2117  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
2118  }
2119  }
2120  $img_src = ilUtil::getImagePath("icon_pg.svg");
2122 
2123  $checked = true;
2124 
2125  $this->nl->addListNode(
2126  $id,
2127  $text,
2128  0,
2129  $checked,
2130  $disabled,
2131  $img_src,
2132  $img_alt
2133  );
2134  }
2135 
2136  $f = $this->form->getHTML();
2137 
2138  // submit toolbar
2139  $tb = new ilToolbarGUI();
2140  $tb->addFormButton($lng->txt("cont_show_print_view"), "showPrintView");
2141  $this->tpl->setVariable("TOOLBAR", $tb->getHTML());
2142 
2143  $this->tpl->setVariable("ITEM_SELECTION", $f);
2144  $this->tpl->printToStdout();
2145  }
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 _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
$ilUser
Definition: imgupload.php:18
ilLocator($a_std_templ_loaded=false)
locator
$lang
Definition: xapiexit.php:8
static _isPagePublic($a_node_id, $a_check_public_mode=false)
renderTabs($active_tab, $current_page_id)
Render tabs.
$_POST["username"]
setContentStyles()
Set content style.
initPrintViewSelectionForm()
Init print view selection form.
+ Here is the call graph for this function:

◆ updatePageRating()

ilLMPresentationGUI::updatePageRating ( )

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

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

1500  {
1501  $ilUser = $this->user;
1502 
1503  $pg_id = $_GET["pgid"];
1504  if (!$this->ctrl->isAsynch() || !$pg_id) {
1505  exit();
1506  }
1507 
1508  $rating = (int) $_POST["rating"];
1509  if ($rating) {
1511  $this->lm->getId(),
1512  "lm",
1513  $pg_id,
1514  "lm",
1515  $ilUser->getId(),
1516  $_POST["rating"]
1517  );
1518  } else {
1520  $this->lm->getId(),
1521  "lm",
1522  $pg_id,
1523  "lm",
1524  $ilUser->getId()
1525  );
1526  }
1527 
1528  $rating = new ilRatingGUI();
1529  $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId());
1530  $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
1531 
1532  echo $rating->getHtml(true, true, "il.LearningModule.saveRating(%rating%);");
1533 
1534  echo $this->tpl->getOnLoadCodeForAsynch();
1535  exit();
1536  }
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

◆ $chapter_has_no_active_page

ilLMPresentationGUI::$chapter_has_no_active_page = false

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

◆ $ctrl

ilLMPresentationGUI::$ctrl
protected

◆ $current_page_id

ilLMPresentationGUI::$current_page_id = 0
protected

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

Referenced by getCurrentPageId(), and renderTabs().

◆ $deactivated_page

ilLMPresentationGUI::$deactivated_page = false

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

◆ $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 102 of file class.ilLMPresentationGUI.php.

◆ $focus_id

ilLMPresentationGUI::$focus_id = 0
protected

Definition at line 97 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 85 of file class.ilLMPresentationGUI.php.

◆ $linker

ilLMPresentationGUI::$linker
protected

Definition at line 157 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 86 of file class.ilLMPresentationGUI.php.

Referenced by offlineMode().

◆ $offline_directory

ilLMPresentationGUI::$offline_directory

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

Referenced by getOfflineDirectory().

◆ $rbacsystem

ilLMPresentationGUI::$rbacsystem
protected

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

Referenced by __construct(), and ilLMSubMenu().

◆ $requested_back_pg

ilLMPresentationGUI::$requested_back_pg
protected

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

◆ $requested_focus_return

ilLMPresentationGUI::$requested_focus_return
protected

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

◆ $requested_frame

ilLMPresentationGUI::$requested_frame
protected

Definition at line 152 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 142 of file class.ilLMPresentationGUI.php.

Referenced by layout().

◆ $requested_ref_id

ilLMPresentationGUI::$requested_ref_id
protected

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

Referenced by addHeaderAction(), and ilLocator().

◆ $requested_search_string

ilLMPresentationGUI::$requested_search_string
protected

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

◆ $requested_transl

ilLMPresentationGUI::$requested_transl
protected

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

◆ $service

ilLMPresentationGUI::$service
protected

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

◆ $settings

ilLMPresentationGUI::$settings
protected

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

Referenced by ilLMNotes(), and layout().

◆ $tpl

ilLMPresentationGUI::$tpl

◆ $tree

ilLMPresentationGUI::$tree
protected

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

Referenced by ilLocator().

◆ $user


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