ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLMPresentationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLMPresentationGUI:
+ Collaboration diagram for ilLMPresentationGUI:

Public Member Functions

 __construct (string $a_export_format="", bool $a_all_languages=false, string $a_export_dir="", bool $claim_repo_context=true, array $query_params=null, bool $embed_mode=false)
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 
 initByRequest (?array $query_params=null, bool $embed_mode=false)
 Init services and this class by request params. More...
 
 getService ()
 
 injectTemplate (ilGlobalTemplateInterface $tpl)
 
 executeCommand ()
 
 offlineMode ()
 checks whether offline content generation is activated More...
 
 getExportFormat ()
 
 nop ()
 this dummy function is needed for offline package creation More...
 
 attrib2arr (?DOMNamedNodeMap $a_attributes)
 
 getCurrentFrameSet ()
 get frames of current frame set More...
 
 determineLayout ()
 Determine layout. More...
 
 resume ()
 
 layout (string $a_xml="main.xml", bool $doShow=true)
 
 saveFrameUrl ()
 
 fullscreen ()
 
 media ()
 
 glossary ()
 
 page ()
 
 ilTOC ()
 table of contents More...
 
 getLMPresentationTitle ()
 
 ilLMMenu ()
 
 setHeader ()
 
 ilLMSubMenu ()
 output learning module submenu More...
 
 redrawHeaderAction ()
 
 addHeaderAction ()
 
 getHeaderAction (bool $a_redraw=false)
 
 ilLMNotes ()
 output notes of page More...
 
 ilLocator ()
 
 getCurrentPageId ()
 Get the current page id. More...
 
 getContent (bool $skip_nav=false)
 
 updatePageRating ()
 
 basicPageGuiInit (\ilPageObjectGUI $a_page_gui)
 
 ilGlossary ()
 
 ilMedia ()
 
 ilJavaScript (string $a_inline="", string $a_file="", string $a_location="")
 
 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 ()
 info screen More...
 
 showPrintViewSelection ()
 show selection screen for print view More...
 
 initPrintViewSelectionForm ()
 
 showPrintView ()
 
 downloadFile ()
 download file of file lists More...
 
 showDownloadList ()
 show download list More...
 
 downloadExportFile ()
 send download file (xml/html) More...
 
 getFocusLink (int $a_ref_id, int $a_obj_id, int $a_return_ref_id)
 Get focused link (used in learning objectives courses) More...
 
 showMessageScreen (string $a_content)
 
 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 ()
 
 handleCodeParagraph (int $page_id, int $paragraph_id, string $title, string $text)
 store paragraph into file directory files/codefile_$pg_id_$paragraph_id/downloadtitle More...
 
 getLMPageGUI (int $a_id)
 
 getLMPage (int $a_id, string $a_type="")
 
 refreshToc ()
 Refresh toc (called if questions have been answered correctly) More...
 
 observeNoteAction (int $a_lm_id, int $a_page_id, string $a_type, string $a_action, int $a_note_id)
 Generate new ilNote and send Notifications to the users informing that there are new comments in the LM. More...
 
 getHTML (array $pars)
 Get HTML (called by kiosk mode through ilCtrl) More...
 

Data Fields

string $lang
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
DOMDocument $layout_doc
 
bool $offline
 
string $offline_directory
 
bool $chapter_has_no_active_page = false
 
bool $deactivated_page = false
 

Protected Member Functions

 getTracker ()
 
 addResourceFiles ()
 
 setContentStyles ()
 Set content style. More...
 
 setSystemStyle ()
 Set system style. More...
 
 getPageContent ()
 
 renderRating ()
 
 initScreenHead (string $a_active_tab="info")
 
 filterNonAccessibleNode (array $nodes)
 
 renderPageTitle ()
 
 renderTabs (string $active_tab, int $current_page_id)
 

Protected Attributes

ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage Xsl XslManager $xsl
 
ILIAS Notes GUIService $notes_gui
 
ILIAS GlobalScreen Services $global_screen
 
ILIAS Notes DomainService $notes
 
ILIAS LearningModule ReadingTime ReadingTimeManager $reading_time_manager
 
string $requested_url
 
string $requested_type
 
ilLMTracker $tracker
 
ilTabsGUI $tabs
 
ilNestedListInputGUI $nl
 
ilSetting $lm_set
 
ilObjLearningModuleGUI $lm_gui
 
bool $fill_on_load_code
 
ilLMTree $lm_tree
 
array $frames
 
string $export_format
 
ilPropertyFormGUI $form
 
ilObjUser $user
 
ilRbacSystem $rbacsystem
 
ilCtrl $ctrl
 
ilNavigationHistory $nav_history
 
ilAccessHandler $access
 
ilSetting $settings
 
ilLocatorGUI $locator
 
ilTree $tree
 
ilHelpGUI $help
 
ilObjLearningModule $lm
 
bool $embed_mode = false
 
int $current_page_id = 0
 
int $focus_id = 0
 
bool $export_all_languages = false
 
string $requested_back_pg
 
string $requested_search_string
 
string $requested_focus_return
 
int $requested_ref_id
 
int $requested_obj_id
 
string $requested_obj_type
 
string $requested_transl
 
string $requested_frame
 
ilLMPresentationLinker $linker
 
ilLMPresentationService $service
 
ILIAS DI UIServices $ui
 
ilToolbarGUI $toolbar
 
array $additional_content = []
 
string $requested_cmd = ""
 
int $requested_pg_id = 0
 
string $requested_pg_type = ""
 
int $requested_mob_id = 0
 
int $requested_notification_switch = 0
 
bool $abstract = false
 
ilObjectTranslation $ot
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Service $cs = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilLMPresentationGUI GUI class for learning module presentation

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilLMPresentationGUI: ilCommentGUI, ilInfoScreenGUI ilLMPresentationGUI: ilLMPageGUI, ilGlossaryDefPageGUI, ilCommonActionDispatcherGUI ilLMPresentationGUI: ilLearningProgressGUI, ilAssGenFeedbackPageGUI ilLMPresentationGUI: ilRatingGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLMPresentationGUI::__construct ( string  $a_export_format = "",
bool  $a_all_languages = false,
string  $a_export_dir = "",
bool  $claim_repo_context = true,
array  $query_params = null,
bool  $embed_mode = false 
)

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

References $DIC, $ilErr, $lng, $params, $requested_obj_id, ILIAS\Repository\access(), ilRbacSystem\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), initByRequest(), ilLMGSToolProvider\LM_QUERY_PARAMS, ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ILIAS\Repository\settings(), ilLMGSToolProvider\SHOW_LINK_SLATES, ilLMGSToolProvider\SHOW_TOC_TOOL, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

101  {
102  global $DIC;
103 
104  $this->offline = ($a_export_format != "");
105  $this->export_all_languages = $a_all_languages;
106  $this->export_format = $a_export_format; // html/scorm
107  $this->offline_directory = $a_export_dir;
108 
109  $this->tabs = $DIC->tabs();
110  $this->toolbar = $DIC->toolbar();
111  $this->user = $DIC->user();
112  $this->rbacsystem = $DIC->rbac()->system();
113  $this->nav_history = $DIC["ilNavigationHistory"];
114  $this->access = $DIC->access();
115  $this->settings = $DIC->settings();
116  $this->locator = $DIC["ilLocator"];
117  $this->tree = $DIC->repositoryTree();
118  $this->help = $DIC["ilHelp"];
119  $this->global_screen = $DIC->globalScreen();
120 
121  $lng = $DIC->language();
122  $rbacsystem = $DIC->rbac()->system();
123  $ilCtrl = $DIC->ctrl();
124  $ilErr = $DIC["ilErr"];
125 
126  // load language vars
127  $lng->loadLanguageModule("content");
128 
129  $this->lng = $lng;
130  $this->ui = $DIC->ui();
131  $this->tpl = $DIC->ui()->mainTemplate();
132  $this->frames = array();
133  $this->ctrl = $ilCtrl;
134  $this->ctrl->saveParameter($this, array("ref_id", "transl", "focus_id", "focus_return"));
135 
136  $this->cs = $DIC->contentStyle();
137 
138  $this->initByRequest($query_params, $embed_mode);
139 
140  // check, if learning module is online
141  if (!$rbacsystem->checkAccess("write", $this->requested_ref_id)) {
142  if ($this->lm->getOfflineStatus()) {
143  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->WARNING);
144  }
145  }
146 
147  if ($claim_repo_context) {
148  $DIC->globalScreen()->tool()->context()->claim()->repository();
149  }
150 
151  if (!$ilCtrl->isAsynch()) {
152  // moved this into the if due to #0027200
153  if (!$embed_mode) {
154  if ($this->service->getPresentationStatus()->isTocNecessary()) {
155  $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
157  true
158  );
159  }
160  }
161  $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
163  true
164  );
165  }
166 
167  if ($embed_mode) {
168  $ilCtrl->setParameter($this, "embed_mode", 1);
169  $params = [
170  "obj_id" => $this->requested_obj_id,
171  "ref_id" => $this->lm->getRefId(),
172  "frame" => ""
173  ];
174  $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
176  $params
177  );
178  }
179  $this->reading_time_manager = new \ILIAS\LearningModule\ReadingTime\ReadingTimeManager();
180  $this->notes = $DIC->notes()->domain();
181  $this->xsl = $DIC->copage()->internal()->domain()->xsl();
182  $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
183  $this->notes_gui = $DIC->notes()->gui();
184  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
loadLanguageModule(string $a_module)
Load language module.
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: feed.php:28
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
initByRequest(?array $query_params=null, bool $embed_mode=false)
Init services and this class by request params.
+ Here is the call graph for this function:

Member Function Documentation

◆ addHeaderAction()

ilLMPresentationGUI::addHeaderAction ( )

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

References getHeaderAction().

Referenced by layout().

814  : void
815  {
816  //$this->tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
817  $this->tpl->setHeaderActionMenu($this->getHeaderAction());
818  }
getHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addResourceFiles()

ilLMPresentationGUI::addResourceFiles ( )
protected

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

References ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), ILIAS\Repository\ctrl(), ilUIFramework\init(), ilYuiUtil\initConnection(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), and offlineMode().

Referenced by getHTML(), and layout().

617  : void
618  {
619  iljQueryUtil::initjQuery($this->tpl);
620  iljQueryUtil::initjQueryUI($this->tpl);
621  ilUIFramework::init($this->tpl);
622 
623  if (!$this->offlineMode()) {
626 
627  $this->tpl->addJavaScript("./Modules/LearningModule/js/LearningModule.js");
628 
629  // handle initial content
630  if ($this->requested_frame == "") {
631  $store = new ilSessionIStorage("lm");
632  $last_frame_url = $store->get("cf_" . $this->lm->getId());
633  if ($last_frame_url != "") {
634  $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
635  }
636 
637  $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" .
638  $this->ctrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');
639  il.LearningModule.openInitFrames();
640  ");
641 
642  $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" .
643  $this->ctrl->getLinkTarget($this, "refreshToc", "", false, false) . "');
644  ");
645  }
646 
647  // from main menu
648  // $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
649  ilYuiUtil::initConnection($this->tpl);
650  }
651  }
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
offlineMode()
checks whether offline content generation is activated
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static init(ilGlobalTemplateInterface $template=null)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attrib2arr()

ilLMPresentationGUI::attrib2arr ( ?DOMNamedNodeMap  $a_attributes)

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

Referenced by layout().

435  : array
436  {
437  $attr = array();
438  if (!is_null($a_attributes)) {
439  foreach ($a_attributes as $attribute) {
440  $attr[$attribute->name] = $attribute->value;
441  }
442  }
443  return $attr;
444  }
+ Here is the caller graph for this function:

◆ basicPageGuiInit()

ilLMPresentationGUI::basicPageGuiInit ( \ilPageObjectGUI  $a_page_gui)

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

References ILIAS\Repository\ctrl(), getCurrentPageId(), getOfflineDirectory(), offlineMode(), ilPageObjectGUI\setFileDownloadLink(), ilPageObjectGUI\setFullscreenLink(), ilPageObjectGUI\setOfflineDirectory(), ilPageObjectGUI\setOutputMode(), ilPageObjectGUI\setSourcecodeDownloadScript(), and ilPageObjectGUI\setStyleId().

Referenced by executeCommand().

1217  : void
1218  {
1219  $a_page_gui->setStyleId(
1220  $this->content_style_domain->getEffectiveStyleId()
1221  );
1222  if (!$this->offlineMode()) {
1223  $a_page_gui->setOutputMode("presentation");
1224  $this->fill_on_load_code = true;
1225  } else {
1226  $a_page_gui->setOutputMode("offline");
1227  $a_page_gui->setOfflineDirectory($this->getOfflineDirectory());
1228  $this->fill_on_load_code = false;
1229  }
1230  if (!$this->offlineMode()) {
1231  $this->ctrl->setParameter($this, "obj_id", $this->getCurrentPageId()); // see #22403
1232  }
1233  $a_page_gui->setFileDownloadLink($this->linker->getLink("downloadFile"));
1234  $a_page_gui->setSourcecodeDownloadScript($this->linker->getLink(
1235  "sourcecodeDownload",
1236  $this->getCurrentPageId()
1237  ));
1238  if (!$this->offlineMode()) {
1239  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
1240  }
1241  $a_page_gui->setFullscreenLink($this->linker->getLink("fullscreen"));
1242  $a_page_gui->setSourcecodeDownloadScript($this->linker->getLink("download_paragraph"));
1243  }
offlineMode()
checks whether 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:

◆ determineLayout()

ilLMPresentationGUI::determineLayout ( )

Determine layout.

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

Referenced by layout().

457  : string
458  {
459  return "standard";
460  }
+ Here is the caller graph for this function:

◆ downloadExportFile()

ilLMPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

References $requested_type, ilFileDelivery\deliverFileLegacy(), and exit.

2237  : void
2238  {
2239  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2240  return;
2241  }
2242 
2243  $type = $this->requested_type;
2244  $base_type = explode("_", $type);
2245  $base_type = $base_type[0];
2246  $file = $this->lm->getPublicExportFile($base_type);
2247  if ($this->lm->getPublicExportFile($base_type) != "") {
2248  $dir = $this->lm->getExportDirectory($type);
2249  if (is_file($dir . "/" . $file)) {
2250  ilFileDelivery::deliverFileLegacy($dir . "/" . $file, $file);
2251  exit;
2252  }
2253  }
2254  }
exit
Definition: login.php:29
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPresentationGUI::downloadFile ( )

download file of file lists

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

References getCurrentPageId(), and getLMPageGUI().

2190  : void
2191  {
2192  $page_gui = $this->getLMPageGUI($this->getCurrentPageId());
2193  $page_gui->downloadFile();
2194  }
getCurrentPageId()
Get the current page id.
+ Here is the call graph for this function:

◆ executeCommand()

ilLMPresentationGUI::executeCommand ( )
Exceptions
ilCtrlException
ilLMPresentationException
ilPermissionException

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

References $access, $ctrl, $lng, $nav_history, $requested_obj_id, $user, basicPageGuiInit(), ILIAS\Repository\ctrl(), getCurrentPageId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getLMPageGUI(), initScreenHead(), layout(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), ilNotification\setNotification(), ilLanguage\txt(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, and ILIAS\Repository\user().

289  : void
290  {
291  $ilNavigationHistory = $this->nav_history;
292  $ilAccess = $this->access;
293  $lng = $this->lng;
294  $ilCtrl = $this->ctrl;
295  $ilUser = $this->user;
296 
297  // check read permission and parent conditions
298  // todo: replace all this by ilAccess call
299  if (!$ilAccess->checkAccess("read", "", $this->requested_ref_id) &&
300  (!(($this->ctrl->getCmd() == "infoScreen" || $this->ctrl->getNextClass() == "ilinfoscreengui")
301  && $ilAccess->checkAccess("visible", "", $this->requested_ref_id)))) {
302  throw new ilPermissionException($lng->txt("permission_denied"));
303  }
304 
305  $next_class = $this->ctrl->getNextClass($this);
306  $cmd = $this->ctrl->getCmd("layout");
307 
308  $obj_id = $this->requested_obj_id;
309  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
310  $ilNavigationHistory->addItem($this->requested_ref_id, $this->ctrl->getLinkTarget($this), "lm");
311  $this->ctrl->setParameter($this, "obj_id", $obj_id);
312 
313  switch ($next_class) {
314  case "ilcommentgui":
315  $ret = $this->layout();
316  break;
317 
318  case "ilinfoscreengui":
319  $ret = $this->outputInfoScreen();
320  break;
321 
322  case "ilcommonactiondispatchergui":
324  $gui->enableCommentsSettings(false);
325  $this->ctrl->forwardCommand($gui);
326  break;
327 
328  case "illmpagegui":
329  $page_gui = $this->getLMPageGUI($this->requested_obj_id);
330  $this->basicPageGuiInit($page_gui);
331  $ret = $ilCtrl->forwardCommand($page_gui);
332  break;
333 
334  case "ilassgenfeedbackpagegui":
335  $page_gui = new ilAssGenFeedbackPageGUI($this->requested_pg_id);
336  //$this->basicPageGuiInit($page_gui);
337  $ret = $ilCtrl->forwardCommand($page_gui);
338  break;
339 
340  case "ilglossarydefpagegui":
341  // see #32198
342  //$page_gui = new ilGlossaryDefPageGUI($this->requested_obj_id);
343  $page_gui = new ilGlossaryDefPageGUI($this->requested_pg_id);
344  $this->basicPageGuiInit($page_gui);
345  $ret = $ilCtrl->forwardCommand($page_gui);
346  break;
347 
348  case "illearningprogressgui":
349  $this->initScreenHead("learning_progress");
350  $new_gui = new ilLearningProgressGUI(
352  $this->requested_ref_id,
353  $ilUser->getId()
354  );
355  $this->ctrl->forwardCommand($new_gui);
356  // this is nasty, but the LP classes do "sometimes" a printToStdout
357  // sometimes not, (here editManual does, other commands not)
358  if ($this->ctrl->getCmd() !== "editManual") {
359  $this->tpl->printToStdout();
360  }
361  break;
362 
363  case "ilratinggui":
364  $rating_gui = new ilRatingGUI();
365  $rating_gui->setObject($this->lm->getId(), "lm", $this->requested_obj_id, "lm");
366  $this->ctrl->forwardCommand($rating_gui);
367  break;
368 
369  default:
370  if ($this->requested_notification_switch > 0) {
371  switch ($this->requested_notification_switch) {
372  case 1:
375  $this->user->getId(),
376  $this->lm->getId(),
377  false
378  );
379  break;
380 
381  case 2:
384  $this->user->getId(),
385  $this->lm->getId(),
386  true
387  );
388  break;
389 
390  case 3:
393  $this->user->getId(),
394  $this->getCurrentPageId(),
395  false
396  );
397  break;
398 
399  case 4:
402  $this->user->getId(),
403  $this->getCurrentPageId(),
404  true
405  );
406  break;
407  }
408  $ilCtrl->redirect($this, "layout");
409  }
410  $ret = $this->$cmd();
411  break;
412  }
413  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initScreenHead(string $a_active_tab="info")
ilNavigationHistory $nav_history
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
layout(string $a_xml="main.xml", bool $doShow=true)
getCurrentPageId()
Get the current page id.
basicPageGuiInit(\ilPageObjectGUI $a_page_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ filterNonAccessibleNode()

ilLMPresentationGUI::filterNonAccessibleNode ( array  $nodes)
protected

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

References getTracker(), ilLMTracker\hasPredIncorrectAnswers(), and offlineMode().

Referenced by showPrintViewSelection().

1607  : array {
1608  $tracker = $this->getTracker();
1609  // if navigation is restricted based on correct answered questions
1610  // check if we have preceeding pages including unsanswered/incorrect answered questions
1611  if (!$this->offlineMode()) {
1612  if ($this->lm->getRestrictForwardNavigation()) {
1613  $nodes = array_filter($nodes, function ($node) use ($tracker) {
1614  return !$tracker->hasPredIncorrectAnswers($node["child"]);
1615  });
1616  }
1617  }
1618  return $nodes;
1619  }
hasPredIncorrectAnswers(int $a_obj_id, bool $a_ignore_unlock=false)
Has predecessing incorrect answers.
offlineMode()
checks whether 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 659 of file class.ilLMPresentationGUI.php.

References media().

659  : string
660  {
661  return $this->media();
662  }
+ Here is the call graph for this function:

◆ getContent()

ilLMPresentationGUI::getContent ( bool  $skip_nav = false)

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

References ilGlobalTemplateInterface\get(), getPageContent(), ILIAS\Repository\lng(), renderRating(), setContentStyles(), ilGlobalTemplateInterface\setVariable(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by getHTML(), and layout().

1111  : string {
1112  $this->fill_on_load_code = true;
1113  $this->setContentStyles();
1114 
1115  $tpl = new ilTemplate("tpl.lm_content.html", true, true, "Modules/LearningModule/Presentation");
1116 
1117  if (!$skip_nav) {
1118  $navigation_renderer = new ilLMNavigationRendererGUI(
1119  $this->service,
1120  $this,
1121  $this->lng,
1122  $this->user,
1123  $this->tpl,
1124  $this->requested_obj_id,
1125  $this->requested_back_pg,
1126  $this->requested_frame,
1127  $this->toolbar,
1128  $this->ui
1129  );
1130 
1131  $navigation_renderer->renderTop();
1132  //$tpl->setVariable("TOP_NAVIGATION", $navigation_renderer->renderTop());
1133  //$tpl->setVariable("BOTTOM_NAVIGATION", $navigation_renderer->renderBottom());
1134  }
1135  $tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
1136  $tpl->setVariable("RATING", $this->renderRating());
1137 
1138  return $tpl->get();
1139  }
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 449 of file class.ilLMPresentationGUI.php.

References $frames.

449  : array
450  {
451  return $this->frames;
452  }

◆ getCurrentPageId()

ilLMPresentationGUI::getCurrentPageId ( )

Get the current page id.

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

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

1083  : ?int
1084  {
1085  return $this->service->getNavigationStatus()->getCurrentPage();
1086  }
+ Here is the caller graph for this function:

◆ getExportFormat()

ilLMPresentationGUI::getExportFormat ( )

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

References $export_format.

Referenced by renderTabs().

423  : string
424  {
425  return $this->export_format;
426  }
+ Here is the caller graph for this function:

◆ getFocusLink()

ilLMPresentationGUI::getFocusLink ( int  $a_ref_id,
int  $a_obj_id,
int  $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

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

2266  : string {
2267  return "ilias.php?baseClass=ilLMPresentationGUI&ref_id=" . $a_ref_id . "&obj_id=" . $a_obj_id . "&focus_id=" .
2268  $a_obj_id . "&focus_return=" . $a_return_ref_id;
2269  }

◆ getHeaderAction()

ilLMPresentationGUI::getHeaderAction ( bool  $a_redraw = false)

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

References $access, $embed_mode, $ilSetting, $settings, $tpl, ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), getCurrentPageId(), ilUtil\getImagePath(), ilGlobalTemplateInterface\getOnLoadCodeForAsynch(), ilNotification\hasNotification(), ilNotification\hasOptOut(), ILIAS\Repository\lng(), offlineMode(), ilObjectListGUI\prepareJsLinks(), ilCommonActionDispatcherGUI\setSubObject(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, ilCommonActionDispatcherGUI\TYPE_REPOSITORY, and ILIAS\Repository\user().

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

822  : string {
823  if ($this->offline) {
824  return "";
825  }
826  $ilAccess = $this->access;
828  $tpl = $this->tpl;
829 
830  $lm_id = $this->lm->getId();
831  $pg_id = $this->getCurrentPageId();
832 
833  $this->lng->loadLanguageModule("content");
834 
835  $dispatcher = new ilCommonActionDispatcherGUI(
837  $ilAccess,
838  $this->lm->getType(),
839  $this->lm->getRefId(),
840  $this->lm->getId()
841  );
842  $dispatcher->setSubObject("pg", $this->getCurrentPageId());
843 
844  $this->ctrl->setParameter($this, "embed_mode", (int) $this->embed_mode);
845  $this->ctrl->setParameterByClass("ilcommentgui", "embed_mode", (int) $this->embed_mode);
846  $this->ctrl->setParameterByClass("iltagginggui", "embed_mode", (int) $this->embed_mode);
848  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
849  "",
850  $this->ctrl->getLinkTargetByClass(
851  array("ilcommonactiondispatchergui", "iltagginggui"),
852  "",
853  "",
854  true,
855  false
856  ),
857  $this->tpl
858  );
859 
860  $lg = $dispatcher->initHeaderAction();
861  if (!$ilSetting->get("disable_notes")) {
862  $lg->enableNotes(true);
863  if (!$this->embed_mode) {
864  $lg->enableComments($this->lm->publicNotes(), false);
865  }
866  }
867 
868  if ($this->lm->hasRating() && !$this->offlineMode()) {
869  $lg->enableRating(
870  true,
871  $this->lng->txt("lm_rating"),
872  false,
873  array("ilcommonactiondispatchergui", "ilratinggui"),
874  true
875  );
876  }
877 
878  // notification
879  if ($this->user->getId() != ANONYMOUS_USER_ID && !$this->embed_mode) {
880  if (ilNotification::hasNotification(ilNotification::TYPE_LM, $this->user->getId(), $lm_id)) {
881  $this->ctrl->setParameter($this, "ntf", 1);
882  if (ilNotification::hasOptOut($lm_id)) {
883  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_lm");
884  }
885 
886  $lg->addHeaderIcon(
887  "not_icon",
888  ilUtil::getImagePath("object/notification_on.svg"),
889  $this->lng->txt("cont_notification_activated")
890  );
891  } else {
892  $this->ctrl->setParameter($this, "ntf", 2);
893  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_lm");
894 
895  if (ilNotification::hasNotification(ilNotification::TYPE_LM_PAGE, $this->user->getId(), $pg_id)) {
896  $this->ctrl->setParameter($this, "ntf", 3);
897  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_page");
898 
899  $lg->addHeaderIcon(
900  "not_icon",
901  ilUtil::getImagePath("object/notification_on.svg"),
902  $this->lng->txt("cont_page_notification_activated")
903  );
904  } else {
905  $this->ctrl->setParameter($this, "ntf", 4);
906  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_page");
907 
908  $lg->addHeaderIcon(
909  "not_icon",
910  ilUtil::getImagePath("object/notification_off.svg"),
911  $this->lng->txt("cont_notification_deactivated")
912  );
913  }
914  }
915  $this->ctrl->setParameter($this, "ntf", "");
916  }
917 
918  if (!$this->offline) {
919  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
920  if ($this->getCurrentPageId() <= 0) {
921  $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
922  } else {
923  $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
924  "&obj_id=" . $this->getCurrentPageId() . "&to_page=1";
925  }
926  $lg->addCustomCommand($link, "edit_page");
927  }
928  }
929 
930  if (!$a_redraw) {
931  return $lg->getHeaderAction($this->tpl);
932  } else {
933  // we need to add onload code manually (rating, comments, etc.)
934  return $lg->getHeaderAction() .
936  }
937  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
offlineMode()
checks whether offline content generation is activated
getCurrentPageId()
Get the current page id.
global $ilSetting
Definition: privfeed.php:18
ilGlobalTemplateInterface $tpl
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
setSubObject(?string $sub_obj_type, ?int $sub_obj_id)
Set sub object attributes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilLMPresentationGUI::getHTML ( array  $pars)

Get HTML (called by kiosk mode through ilCtrl)

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

References addResourceFiles(), ilGlobalTemplateInterface\get(), getContent(), getHeaderAction(), ilLMNotes(), renderRating(), and ilGlobalTemplateInterface\setVariable().

2458  : string
2459  {
2460  $this->addResourceFiles();
2461  switch ($pars["cmd"]) {
2462  case "layout":
2463  $tpl = new ilTemplate("tpl.embedded_view.html", true, true, "Modules/LearningModule");
2464  $tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
2465  $tpl->setVariable("PAGE_RATING", $this->renderRating());
2466  $tpl->setVariable("PAGE", $this->getContent(true));
2467  $tpl->setVariable("COMMENTS", $this->ilLMNotes());
2468  return $tpl->get();
2469  }
2470  return "";
2471  }
getHeaderAction(bool $a_redraw=false)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
getContent(bool $skip_nav=false)
ilGlobalTemplateInterface $tpl
ilLMNotes()
output notes of page
+ Here is the call graph for this function:

◆ getLMPage()

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

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

References $lang, and ilPageObject\_exists().

Referenced by ilMedia().

2365  : ilPageObject {
2366  $type = ($a_type == "mep")
2367  ? "mep"
2368  : "lm";
2369 
2370  $lang = $this->lang;
2371  if (!ilPageObject::_exists($type, $a_id, $lang)) {
2372  $lang = "-";
2373  if ($this->lang != "-" && ilPageObject::_exists($type, $a_id, $this->ot->getFallbackLanguage())) {
2374  $lang = $this->ot->getFallbackLanguage();
2375  }
2376  }
2377 
2378  switch ($type) {
2379  case "mep":
2380  return new ilMediaPoolPage($a_id, 0, $lang);
2381  default:
2382  return new ilLMPage($a_id, 0, $lang);
2383  }
2384  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLMPageGUI()

ilLMPresentationGUI::getLMPageGUI ( int  $a_id)

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

References ilPageObject\_exists().

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

2350  : ilLMPageGUI
2351  {
2352  $concrete_lang = $this->service->getPresentationStatus()->getConcreteLang();
2353  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
2354  return new ilLMPageGUI($a_id, 0, false, $this->lang, $concrete_lang);
2355  }
2356  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->ot->getFallbackLanguage())) {
2357  return new ilLMPageGUI($a_id, 0, false, $this->ot->getFallbackLanguage(), $concrete_lang);
2358  }
2359  return new ilLMPageGUI($a_id, 0, false, "", $concrete_lang);
2360  }
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $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 ( )

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

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

749  : string
750  {
751  return $this->service->getPresentationStatus()->getLMPresentationTitle();
752  }
+ Here is the caller graph for this function:

◆ getOfflineDirectory()

ilLMPresentationGUI::getOfflineDirectory ( )

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

References $offline_directory.

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

2317  : string
2318  {
2319  return $this->offline_directory;
2320  }
+ Here is the caller graph for this function:

◆ getPageContent()

ilLMPresentationGUI::getPageContent ( )
protected

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

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by getContent(), and page().

1141  : string
1142  {
1143  $content_renderer = new ilLMContentRendererGUI(
1144  $this->service,
1145  $this,
1146  $this->lng,
1147  $this->ctrl,
1148  $this->access,
1149  $this->user,
1150  $this->help,
1151  $this->requested_obj_id
1152  );
1153 
1154  return $content_renderer->render();
1155  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSafePostCommands()

ilLMPresentationGUI::getSafePostCommands ( )

This method must return a list of safe POST commands.

Safe post commands returned by this method will no longer be CSRF protected and will NOT be appended by an ilCtrlToken.

Returns
string[]

Implements ilCtrlSecurityInterface.

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

191  : array
192  {
193  return [
194  "showPrintView",
195  ];
196  }

◆ getService()

ilLMPresentationGUI::getService ( )

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

References $service.

Referenced by renderTabs().

270  {
271  return $this->service;
272  }
ilLMPresentationService $service
Main service init and factory.
+ Here is the caller graph for this function:

◆ getSourcecodeDownloadLink()

ilLMPresentationGUI::getSourcecodeDownloadLink ( )

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

References ILIAS\Repository\ctrl(), and offlineMode().

2308  : string
2309  {
2310  if (!$this->offlineMode()) {
2311  return $this->ctrl->getLinkTarget($this, "");
2312  } else {
2313  return "";
2314  }
2315  }
offlineMode()
checks whether offline content generation is activated
+ Here is the call graph for this function:

◆ getTracker()

ilLMPresentationGUI::getTracker ( )
protected

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

Referenced by filterNonAccessibleNode(), and showPrintView().

279  : ilLMTracker
280  {
281  return $this->service->getTracker();
282  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getUnsafeGetCommands()

ilLMPresentationGUI::getUnsafeGetCommands ( )

This method must return a list of unsafe GET commands.

Unsafe get commands returned by this method will now be CSRF protected, which means an ilCtrlToken is appended each time a link-target is generated to the class implementing this interface with a command from that list.

Tokens will be validated in

See also
ilCtrlInterface::getCmd(), whereas the fallback command will be used if the CSRF validation fails.
Returns
string[]

Implements ilCtrlSecurityInterface.

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

186  : array
187  {
188  return [];
189  }

◆ glossary()

ilLMPresentationGUI::glossary ( )

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

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

681  : string
682  {
683  $this->tpl = new ilGlobalTemplate("tpl.glossary_term_output.html", true, true, "Modules/LearningModule");
684  $this->renderPageTitle();
685 
686  iljQueryUtil::initjQuery($this->tpl);
687  iljQueryUtil::initjQueryUI($this->tpl);
688  ilUIFramework::init($this->tpl);
689  ilAccordionGUI::addJavaScript($this->tpl);
690  ilAccordionGUI::addCss($this->tpl);
691 
692  // set style sheets
693  $this->setContentStyles();
694  $this->setSystemStyle();
695 
696  $this->ilGlossary();
697 
698  $js = $this->global_screen->layout()->meta()->getJs();
699  foreach ($js->getItemsInOrderOfDelivery() as $item) {
700  $this->tpl->addJavaScript($item->getContent());
701  }
702 
703  if (!$this->offlineMode()) {
704  $this->tpl->printToStdout();
705  } else {
706  return $this->tpl->printToString();
707  }
708 
709  return "";
710  }
special template class to simplify handling of ITX/PEAR
setSystemStyle()
Set system style.
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
offlineMode()
checks whether offline content generation is activated
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static init(ilGlobalTemplateInterface $template=null)
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ handleCodeParagraph()

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

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

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

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

2331  : void {
2332  $directory = $this->getOfflineDirectory() . "/codefiles/" . $page_id . "/" . $paragraph_id;
2333  ilFileUtils::makeDirParents($directory);
2334  $file = $directory . "/" . $title;
2335  if (!($fp = fopen($file, "w+"))) {
2336  die("<strong>Error</strong>: Could not open \"" . $file . "\" for writing" .
2337  " in <strong>" . __FILE__ . "</strong> on line <strong>" . __LINE__ . "</strong><br />");
2338  }
2339  chmod($file, 0770);
2340  fwrite($fp, $text);
2341  fclose($fp);
2342  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
+ Here is the call graph for this function:

◆ ilGlossary()

ilLMPresentationGUI::ilGlossary ( )

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

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

Referenced by glossary(), and layout().

1245  : void
1246  {
1247  $ilCtrl = $this->ctrl;
1248 
1249  $term_gui = new ilGlossaryTermGUI($this->requested_obj_id);
1250 
1251  // content style
1252  $this->setContentStyles();
1253 
1254  $term_gui->setPageLinker($this->linker);
1255 
1256  $term_gui->setOfflineDirectory($this->getOfflineDirectory());
1257  if (!$this->offlineMode()) {
1258  $ilCtrl->setParameter($this, "pg_type", "glo");
1259  }
1260  $term_gui->output($this->offlineMode(), $this->tpl);
1261 
1262  if (!$this->offlineMode()) {
1263  $ilCtrl->setParameter($this, "pg_type", "");
1264  }
1265  }
offlineMode()
checks whether offline content generation is activated
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilJavaScript()

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

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

Referenced by layout().

1331  : void {
1332  if ($a_inline != "") {
1333  $js_tpl = new ilTemplate($a_inline, true, false, $a_location);
1334  $js = $js_tpl->get();
1335  $this->tpl->setVariable("INLINE_JS", $js);
1336  }
1337  }
+ Here is the caller graph for this function:

◆ ilLMMenu()

ilLMPresentationGUI::ilLMMenu ( )

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

References getCurrentPageId(), and renderTabs().

Referenced by layout().

754  : void
755  {
756  $this->renderTabs("content", $this->getCurrentPageId());
757  }
getCurrentPageId()
Get the current page id.
renderTabs(string $active_tab, int $current_page_id)
+ 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 942 of file class.ilLMPresentationGUI.php.

References $access, $ilSetting, $settings, ILIAS\Repository\ctrl(), getCurrentPageId(), and offlineMode().

Referenced by getHTML(), and layout().

942  : string
943  {
944  $ilAccess = $this->access;
946 
947  // no notes in offline (export) mode
948  if ($this->offlineMode()) {
949  return "";
950  }
951 
952  // now output comments
953 
954  if ($ilSetting->get("disable_comments")) {
955  return "";
956  }
957  if (!$this->lm->publicNotes()) {
958  return "";
959  }
960 
961  $next_class = $this->ctrl->getNextClass($this);
962 
963  $pg_id = $this->getCurrentPageId();
964 
965  if ($pg_id == 0) {
966  return "";
967  }
968  $notes_gui = $this->notes_gui->getCommentsGUI($this->lm->getId(), $this->getCurrentPageId(), "pg");
969  $notes_gui->setUseObjectTitleHeader(false);
970 
971  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
972  $ilSetting->get("comments_del_tutor", '1')) {
973  $notes_gui->enablePublicNotesDeletion(true);
974  }
975 
976  $this->ctrl->setParameter($this, "frame", $this->requested_frame);
977  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
978 
979  $notes_gui->enablePrivateNotes();
980  if ($this->lm->publicNotes()) {
981  $notes_gui->enablePublicNotes();
982  }
983 
984  $callback = array($this, "observeNoteAction");
985  $notes_gui->addObserver($callback);
986 
987  if ($next_class == "ilcommentgui") {
988  $html = $this->ctrl->forwardCommand($notes_gui);
989  } else {
990  $html = $notes_gui->getListHTML();
991  }
992  return $html;
993  }
offlineMode()
checks whether offline content generation is activated
getCurrentPageId()
Get the current page id.
ILIAS Notes GUIService $notes_gui
global $ilSetting
Definition: privfeed.php:18
+ 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 768 of file class.ilLMPresentationGUI.php.

References $rbacsystem, ilFrameTargetInfo\_getFrame(), ilRbacSystem\checkAccess(), getCurrentPageId(), ILIAS\Repository\lng(), and offlineMode().

Referenced by layout().

768  : void
769  {
771  if ($this->abstract) {
772  return;
773  }
774 
775  $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent");
776 
777  $tpl_menu = new ilTemplate("tpl.lm_sub_menu.html", true, true, "Modules/LearningModule");
778 
779  $pg_id = $this->getCurrentPageId();
780  if ($pg_id == 0) {
781  return;
782  }
783 
784  // edit learning module
785  if (!$this->offlineMode()) {
786  if ($rbacsystem->checkAccess("write", $this->requested_ref_id)) {
787  $tpl_menu->setCurrentBlock("edit_page");
788  $page_id = $this->getCurrentPageId();
789  $tpl_menu->setVariable(
790  "EDIT_LINK",
791  ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
792  "&obj_id=" . $page_id . "&to_page=1"
793  );
794  $tpl_menu->setVariable("EDIT_TXT", $this->lng->txt("edit_page"));
795  $tpl_menu->setVariable("EDIT_TARGET", $buttonTarget);
796  $tpl_menu->parseCurrentBlock();
797  }
798 
799  $page_id = $this->getCurrentPageId();
800 
801  // permanent link
802  $this->tpl->setPermanentLink("pg", null, $page_id . "_" . $this->lm->getRefId());
803  }
804 
805  $this->tpl->setVariable("SUBMENU", $tpl_menu->get());
806  }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
offlineMode()
checks whether offline content generation is activated
getCurrentPageId()
Get the current page id.
static _getFrame(string $a_class)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLocator()

ilLMPresentationGUI::ilLocator ( )

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

References $DIC, ILIAS\LTI\ToolProvider\$key, $lang, $locator, $path, $requested_frame, $requested_obj_id, $requested_ref_id, ilFrameTargetInfo\_getFrame(), ilStructureObject\_getPresentationTitle(), ilLMObject\CHAPTER_TITLE, ilLMObjectFactory\getInstance(), getLMPresentationTitle(), offlineMode(), and ilStr\shortenTextExtended().

Referenced by initScreenHead(), and layout().

995  : void
996  {
997  global $DIC;
998  $ltiview = $DIC["lti"];
999  $ilLocator = $this->locator;
1000 
1001  if (empty($this->requested_obj_id)) {
1002  $a_id = $this->lm_tree->getRootId();
1003  } else {
1004  $a_id = $this->requested_obj_id;
1005  }
1006 
1007  if (!$this->lm->cleanFrames()) {
1008  $frame_param = $this->requested_frame;
1009  $frame_target = "";
1010  } elseif (!$this->offlineMode()) {
1011  $frame_param = "";
1012  $frame_target = ilFrameTargetInfo::_getFrame("MainContent");
1013  } else {
1014  $frame_param = "";
1015  $frame_target = "_top";
1016  }
1017 
1018  if (!$this->offlineMode()) {
1019  // LTI
1020  if ($ltiview->isActive()) {
1021  // Do nothing, its complicated...
1022  } else {
1023  $ilLocator->addRepositoryItems();
1024  }
1025  } else {
1026  $ilLocator->setOffline(true);
1027  }
1028 
1029  if ($this->lm_tree->isInTree($a_id)) {
1030  $path = $this->lm_tree->getPathFull($a_id);
1031 
1032  foreach ($path as $key => $row) {
1033  if ($row["type"] != "pg") {
1034  if ($row["child"] != $this->lm_tree->getRootId()) {
1035  $ilLocator->addItem(
1038  $row["child"],
1040  $this->lm->isActiveNumbering(),
1041  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1042  false,
1043  0,
1044  $this->lang
1045  ),
1046  50,
1047  true
1048  ),
1049  $this->linker->getLink("layout", $row["child"], $frame_param, "StructureObject"),
1050  $frame_target
1051  );
1052  } else {
1053  $ilLocator->addItem(
1055  $this->linker->getLink("layout", 0, $frame_param),
1056  $frame_target,
1058  );
1059  }
1060  }
1061  }
1062  } else { // lonely page
1063  $ilLocator->addItem(
1064  $this->getLMPresentationTitle(),
1065  $this->linker->getLink("layout", 0, $this->requested_frame)
1066  );
1067 
1068  $lm_obj = ilLMObjectFactory::getInstance($this->lm, $a_id);
1069 
1070  $ilLocator->addItem(
1071  $lm_obj->getTitle(),
1072  $this->linker->getLink("layout", $a_id, $frame_param),
1073  $frame_target
1074  );
1075  }
1076 
1077  $this->tpl->setLocator();
1078  }
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
offlineMode()
checks whether offline content generation is activated
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static _getFrame(string $a_class)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilMedia()

ilLMPresentationGUI::ilMedia ( )

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

References $params, ilMediaItem\_getMapAreasIntLinks(), ilUtil\getImagePath(), getLMPage(), ilFileUtils\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObjectGUI\includePresentationJS(), ilObjMediaObject\isTypeAllowed(), offlineMode(), renderPageTitle(), and setContentStyles().

Referenced by media().

1267  : void
1268  {
1269  $pg_frame = "";
1270  $this->setContentStyles();
1271 
1272  $this->renderPageTitle();
1273 
1274  $this->tpl->setCurrentBlock("ilMedia");
1275  $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
1276  $link_xml = $this->linker->getLinkXML($med_links);
1277 
1278  $media_obj = new ilObjMediaObject($this->requested_mob_id);
1279  if (!empty($this->requested_pg_id)) {
1280  $pg_obj = $this->getLMPage($this->requested_pg_id, $this->requested_pg_type);
1281  $pg_obj->buildDom();
1282 
1283  $xml = "<dummy>";
1284  // todo: we get always the first alias now (problem if mob is used multiple
1285  // times in page)
1286  $xml .= $pg_obj->getMediaAliasElement($this->requested_mob_id);
1287  } else {
1288  $xml = "<dummy>";
1289  // todo: we get always the first alias now (problem if mob is used multiple
1290  // times in page)
1291  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
1292  }
1293  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1294  $xml .= $link_xml;
1295  $xml .= "</dummy>";
1296 
1297  if (!$this->offlineMode()) {
1298  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1299  } else {
1300  $wb_path = "";
1301  }
1302 
1303  $mode = ($this->requested_cmd == "fullscreen")
1304  ? "fullscreen"
1305  : "media";
1306  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg", false, "output", $this->offlineMode());
1307  $fullscreen_link =
1308  $this->linker->getLink("fullscreen");
1309  $params = array('mode' => $mode,
1310  'enlarge_path' => $enlarge_path,
1311  'link_params' => "ref_id=" . $this->lm->getRefId(),
1312  'fullscreen_link' => $fullscreen_link,
1313  'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
1314  'ref_id' => $this->lm->getRefId(),
1315  'pg_frame' => $pg_frame,
1316  'webspace_path' => $wb_path
1317  );
1318  $output = $this->xsl->process($xml, $params);
1319 
1320  // unmask user html
1321  $this->tpl->setVariable("MEDIA_CONTENT", $output);
1322 
1323  // add js
1325  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
static includePresentationJS(ilGlobalTemplateInterface $a_tpl=null)
Include media object presentation JS.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getLMPage(int $a_id, string $a_type="")
static isTypeAllowed(string $a_type)
offlineMode()
checks whether offline content generation is activated
static _getMapAreasIntLinks(int $a_mob_id)
get all internal links of map areas of a mob
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
setContentStyles()
Set content style.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilTOC()

ilLMPresentationGUI::ilTOC ( )

table of contents

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

Referenced by refreshToc().

742  {
743  $fac = new ilLMTOCExplorerGUIFactory();
744  $exp = $fac->getExplorer($this->service, "ilTOC");
745  $exp->handleCommand();
746  return $exp;
747  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 1344 of file class.ilLMPresentationGUI.php.

References ILIAS\Repository\ctrl(), and outputInfoScreen().

1344  : void
1345  {
1346  $this->ctrl->setCmd("showSummary");
1347  $this->ctrl->setCmdClass("ilinfoscreengui");
1348  $this->outputInfoScreen();
1349  }
+ Here is the call graph for this function:

◆ initByRequest()

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

Init services and this class by request params.

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

Parameters
array$query_paramsrequest query params

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

References $DIC, $embed_mode, $post, ilObjectTranslation\getInstance(), and ILIAS\Repository\user().

Referenced by __construct().

207  : void {
208  global $DIC;
209 
210  $this->service = new ilLMPresentationService(
211  $this->user,
212  $query_params,
213  $this->offline,
214  $this->export_all_languages,
215  $this->export_format,
216  null,
218  );
219 
220  $post = is_null($query_params)
221  ? null
222  : [];
223 
224  $request = $DIC->learningModule()
225  ->internal()
226  ->gui()
227  ->presentation()
228  ->request(
229  $query_params,
230  $post
231  );
232 
233  $this->requested_obj_type = $request->getObjType();
234  $this->requested_ref_id = $request->getRefId();
235  $this->requested_transl = $request->getTranslation(); // handled by presentation status
236  $this->requested_obj_id = $request->getObjId(); // handled by navigation status
237  $this->requested_back_pg = $request->getBackPage();
238  $this->requested_frame = $request->getFrame();
239  $this->requested_search_string = $request->getSearchString();
240  $this->requested_focus_return = $request->getFocusReturn();
241  $this->requested_mob_id = $request->getMobId();
242  $this->requested_cmd = $request->getCmd();
243  $this->requested_pg_id = $request->getPgId();
244  $this->requested_pg_type = $request->getPgType();
245  $this->requested_notification_switch = $request->getNotificationSwitch();
246  $this->requested_type = $request->getType();
247  $this->requested_url = $request->getUrl();
248 
249  $this->lm_set = $this->service->getSettings();
250  $this->lm_gui = $this->service->getLearningModuleGUI();
251  $this->lm = $this->service->getLearningModule();
252  $this->tracker = $this->service->getTracker();
253  $this->linker = $this->service->getLinker();
254  $this->embed_mode = $embed_mode;
255  if ($request->getEmbedMode()) {
256  $this->embed_mode = true;
257  }
258 
259  // language translation
260  $this->lang = $this->service->getPresentationStatus()->getLang();
261 
262  $this->lm_tree = $this->service->getLMTree();
263  $this->focus_id = $this->service->getPresentationStatus()->getFocusId();
264  $this->ot = ilObjectTranslation::getInstance($this->lm->getId());
265  $this->content_style_gui = $this->cs->gui();
266  $this->content_style_domain = $this->cs->domain()->styleForRefId($this->lm->getRefId());
267  }
global $DIC
Definition: feed.php:28
static getInstance(int $obj_id)
$post
Definition: ltitoken.php:49
Main service init and factory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPrintViewSelectionForm()

ilLMPresentationGUI::initPrintViewSelectionForm ( )

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

References $ctrl, $lng, $nl, ILIAS\Repository\form(), ilRadioGroupInputGUI\setValue(), and ilLanguage\txt().

Referenced by showPrintViewSelection().

1621  : void
1622  {
1623  $lng = $this->lng;
1624  $ilCtrl = $this->ctrl;
1625 
1626  $this->form = new ilPropertyFormGUI();
1627  $this->form->setForceTopButtons(true);
1628 
1629  // selection type
1630  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1631  $radg->setValue("page");
1632  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
1633  $radg->addOption($op1);
1634  $op2 = new ilRadioOption($lng->txt("cont_current_chapter"), "chapter");
1635  $radg->addOption($op2);
1636  $op3 = new ilRadioOption($lng->txt("cont_selected_pg_chap"), "selection");
1637  $radg->addOption($op3);
1638 
1639  $nl = new ilNestedListInputGUI("", "obj_id");
1640  $this->nl = $nl;
1641  $op3->addSubItem($nl);
1642 
1643  $this->form->addItem($radg);
1644 
1645  $this->form->addCommandButton("showPrintView", $lng->txt("cont_show_print_view"));
1646  $this->form->setOpenTag(false);
1647  $this->form->setCloseTag(false);
1648 
1649  $this->form->setTitle(" ");
1650  $this->form->setFormAction($ilCtrl->getFormAction($this));
1651  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a property in a property form.
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initScreenHead()

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

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

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

Referenced by executeCommand(), and outputInfoScreen().

1361  : void {
1362  $ilAccess = $this->access;
1363  $ilLocator = $this->locator;
1364 
1365  $this->renderPageTitle();
1366 
1367  $this->tpl->loadStandardTemplate();
1368  $this->tpl->setTitle($this->getLMPresentationTitle());
1369  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
1370 
1371  $this->renderTabs($a_active_tab, 0);
1372 
1373  // Full locator, if read permission is given
1374  if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1375  $this->ilLocator();
1376  } else {
1377  $ilLocator->addRepositoryItems();
1378  $this->tpl->setLocator();
1379  }
1380  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
renderTabs(string $active_tab, int $current_page_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ injectTemplate()

ilLMPresentationGUI::injectTemplate ( ilGlobalTemplateInterface  $tpl)

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

References $tpl.

274  : void
275  {
276  $this->tpl = $tpl;
277  }
ilGlobalTemplateInterface $tpl

◆ layout()

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

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

References $path, $requested_obj_type, $tpl, $user, addHeaderAction(), addResourceFiles(), attrib2arr(), determineLayout(), getContent(), ilUtil\getStyleSheetLocation(), ilGlossary(), ilJavaScript(), ilLMMenu(), ilLMNotes(), ilLMSubMenu(), ilLocator(), media(), offlineMode(), ilGlobalTemplateInterface\printToStdout(), ilGlobalTemplateInterface\printToString(), renderPageTitle(), setHeader(), and ILIAS\Repository\ui().

Referenced by executeCommand(), and resume().

473  : string {
474  $content = "";
475  $tpl = $this->tpl;
476  $ilUser = $this->user;
477  $layout = $this->determineLayout();
478 
479  // xmldocfile is deprecated! Use domxml_open_file instead.
480  // But since using relative pathes with domxml under windows don't work,
481  // we need another solution:
482  $xmlfile = file_get_contents("./Modules/LearningModule/layouts/lm/" . $layout . "/" . $a_xml);
483 
484  $error = null;
485  $doc = $this->dom_util->docFromString($xmlfile, $error);
486  $this->layout_doc = $doc;
487 
488  // get current frame node
489  $path = (empty($this->requested_frame) || ($this->requested_frame == "_blank"))
490  ? "/ilLayout/ilFrame[1]"
491  : "//ilFrame[@name='" . $this->requested_frame . "']";
492  $nodes = $this->dom_util->path($doc, $path);
493  if (count($nodes) != 1) {
494  throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Found " . count($nodes) . " nodes for " .
495  " path " . $path . " in " . $layout . "/" . $a_xml . ". LM Layout is " . $this->lm->getLayout());
496  }
497  $node = $nodes->item(0);
498 
499  // ProcessFrameset
500  // node is frameset, if it has cols or rows attribute
501  $attributes = $this->attrib2arr($node->attributes);
502 
503  $this->frames = array();
504 
505  // ProcessContentTag
506  if ((empty($attributes["template"]) || !empty($this->requested_obj_type))
507  && ($this->requested_frame != "_blank" || $this->requested_obj_type != "MediaObject")) {
508  // we got a variable content frame (can display different
509  // object types (PageObject, MediaObject, GlossarItem)
510  // and contains elements for them)
511 
512  // determine object type
513  if (empty($this->requested_obj_type)) {
514  $obj_type = "PageObject";
515  } else {
516  $obj_type = $this->requested_obj_type;
517  }
518 
519  // get object specific node
520  $found = false;
521  foreach ($node->childNodes as $child) {
522  if ($child->nodeName == $obj_type) {
523  $found = true;
524  $attributes = $this->attrib2arr($child->attributes);
525  $node = $child;
526  //echo "<br>2node:".$node->node_name();
527  break;
528  }
529  }
530  if (!$found) {
531  throw new ilLMPresentationException("ilLMPresentation: No template specified for frame '" .
532  $this->requested_frame . "' and object type '" . $obj_type . "'.");
533  }
534  }
535 
536  // set style sheets
537  if (!$this->offlineMode()) {
538  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
539  } else {
540  $style_name = $ilUser->getPref("style") . ".css";
541  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
542  }
543 
544  // to make e.g. advanced seletions lists work:
545  // $GLOBALS["tpl"] = $this->tpl;
546 
547  foreach ($node->childNodes as $child) {
548  $child_attr = $this->attrib2arr($child->attributes);
549 
550  switch ($child->nodeName) {
551  case "ilPage":
552  $this->renderPageTitle();
553  $this->setHeader();
554  $this->addHeaderAction();
555  $content = $this->getContent();
556  $this->ilLMMenu();
557  $content .= $this->ilLMNotes();
558  $additional = $this->ui->renderer()->render($this->additional_content);
559  $this->tpl->setContent($content . $additional);
560  break;
561 
562  case "ilGlossary":
563  $this->ilGlossary();
564  break;
565 
566  case "ilLMNavigation":
567  // @todo 6.0
568  // $this->ilLMNavigation();
569  break;
570 
571  case "ilMedia":
572  $this->media();
573  break;
574 
575  case "ilLocator":
576  $this->ilLocator();
577  break;
578 
579  case "ilJavaScript":
580  $this->ilJavaScript(
581  $child_attr["inline"],
582  $child_attr["file"],
583  $child_attr["location"]
584  );
585  break;
586 
587  case "ilLMMenu":
588  //$this->ilLMMenu();
589  break;
590 
591  case "ilLMHead":
592  // @todo 6.0
593  // $this->ilLMHead();
594  break;
595 
596  case "ilLMSubMenu":
597  $this->ilLMSubMenu();
598  break;
599 
600  case "ilLMNotes":
601  $this->ilLMNotes();
602  break;
603  }
604  }
605 
606  $this->addResourceFiles();
607 
608  if ($doShow) {
609  $tpl->printToStdout();
610  } else {
611  $content = $tpl->printToString();
612  }
613 
614  return ($content);
615  }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
determineLayout()
Determine layout.
printToString()
Use this method to get the finally rendered page as string.
attrib2arr(?DOMNamedNodeMap $a_attributes)
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
$path
Definition: ltiservices.php:32
ilLMSubMenu()
output learning module submenu
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
offlineMode()
checks whether offline content generation is activated
ilJavaScript(string $a_inline="", string $a_file="", string $a_location="")
getContent(bool $skip_nav=false)
ilGlobalTemplateInterface $tpl
ilLMNotes()
output notes of page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ media()

ilLMPresentationGUI::media ( )

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

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

Referenced by fullscreen(), and layout().

664  : string
665  {
666  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Modules/LearningModule");
667 
668  // set style sheets
669  $this->setContentStyles();
670  $this->setSystemStyle();
671 
672  $this->ilMedia();
673  if (!$this->offlineMode()) {
674  $this->tpl->printToStdout();
675  } else {
676  return $this->tpl->printToString();
677  }
678  return "";
679  }
special template class to simplify handling of ITX/PEAR
setSystemStyle()
Set system style.
offlineMode()
checks whether 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 431 of file class.ilLMPresentationGUI.php.

431  : void
432  {
433  }

◆ observeNoteAction()

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

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

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

References ilLearningModuleNotification\ACTION_COMMENT, and ilNotification\TYPE_LM_PAGE.

2408  : void {
2409  $note = $this->notes->getById($a_note_id);
2410  $text = $note->getText();
2411 
2412  $notification = new ilLearningModuleNotification(
2415  $this->lm,
2416  $a_page_id,
2417  $text
2418  );
2419 
2420  $notification->send();
2421  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ offlineMode()

ilLMPresentationGUI::offlineMode ( )

checks whether offline content generation is activated

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

References $offline.

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

418  : bool
419  {
420  return $this->offline;
421  }
+ Here is the caller graph for this function:

◆ outputInfoScreen()

ilLMPresentationGUI::outputInfoScreen ( )

info screen

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

References $access, ILIAS\Repository\ctrl(), initScreenHead(), ILIAS\Repository\lng(), and offlineMode().

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

1385  : string
1386  {
1387  $ilAccess = $this->access;
1388 
1389  if (!$this->lm->isInfoEnabled()) {
1390  return "";
1391  }
1392 
1393  $this->initScreenHead();
1394 
1395  $this->lng->loadLanguageModule("meta");
1396 
1397  $info = new ilInfoScreenGUI($this->lm_gui);
1398  $info->enablePrivateNotes();
1399  //$info->enableLearningProgress();
1400  $info->enableNews();
1401  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1402  $news_set = new ilSetting("news");
1403  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1404 
1405  $info->enableNewsEditing();
1406 
1407  if ($enable_internal_rss) {
1408  $info->setBlockProperty("news", "settings", true);
1409  }
1410  }
1411 
1412  // show standard meta data section
1413  $info->addMetaDataSections($this->lm->getId(), 0, $this->lm->getType());
1414 
1415  $this->lng->loadLanguageModule("copg");
1416  $est_reading_time = $this->reading_time_manager->getReadingTime($this->lm->getId());
1417  if (!is_null($est_reading_time)) {
1418  $info->addProperty(
1419  $this->lng->txt("copg_est_reading_time"),
1420  sprintf($this->lng->txt("copg_x_minutes"), $est_reading_time)
1421  );
1422  }
1423 
1424  if ($this->offlineMode()) {
1425  $this->tpl->setContent($info->getHTML());
1426  return $this->tpl->get();
1427  } else {
1428  // forward the command
1429  $this->ctrl->forwardCommand($info);
1430  //$this->tpl->setContent("aa");
1431  $this->tpl->printToStdout();
1432  }
1433  return "";
1434  }
Class ilInfoScreenGUI.
initScreenHead(string $a_active_tab="info")
offlineMode()
checks whether offline content generation is activated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ page()

ilLMPresentationGUI::page ( )

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

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

712  : string
713  {
714  $ilUser = $this->user;
715  $this->tpl = new ilGlobalTemplate("tpl.page_fullscreen.html", true, true, "Modules/LearningModule");
716  $GLOBALS["tpl"] = $this->tpl;
717  $this->renderPageTitle();
718 
719  $this->setContentStyles();
720 
721  // set style sheets
722  if (!$this->offlineMode()) {
723  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
724  } else {
725  $style_name = $ilUser->getPref("style") . ".css";
726  $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
727  }
728 
729  $this->tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
730  if (!$this->offlineMode()) {
731  $this->tpl->printToStdout();
732  } else {
733  return $this->tpl->get();
734  }
735  return "";
736  }
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
$GLOBALS["DIC"]
Definition: wac.php:31
offlineMode()
checks whether offline content generation is activated
ilGlobalTemplateInterface $tpl
setContentStyles()
Set content style.
+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilLMPresentationGUI::redrawHeaderAction ( )

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

References exit, and getHeaderAction().

808  : void
809  {
810  echo $this->getHeaderAction(true);
811  exit;
812  }
exit
Definition: login.php:29
getHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:

◆ refreshToc()

ilLMPresentationGUI::refreshToc ( )

Refresh toc (called if questions have been answered correctly)

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

References exit, and ilTOC().

2389  : void
2390  {
2391  $exp = $this->ilTOC();
2392 
2393  echo $exp->getHTML() .
2394  "<script>" . $exp->getOnLoadCode() . "</script>";
2395  exit;
2396  }
exit
Definition: login.php:29
+ Here is the call graph for this function:

◆ renderPageTitle()

ilLMPresentationGUI::renderPageTitle ( )
protected

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

References getLMPresentationTitle().

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

2345  : void
2346  {
2347  $this->tpl->setHeaderPageTitle($this->getLMPresentationTitle());
2348  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderRating()

ilLMPresentationGUI::renderRating ( )
protected

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

References ILIAS\Repository\ctrl(), getCurrentPageId(), ILIAS\Repository\lng(), and offlineMode().

Referenced by getContent(), and getHTML().

1157  : string
1158  {
1159  // rating
1160  $rating = "";
1161  if ($this->lm->hasRatingPages() && !$this->offlineMode()) {
1162  $rating_gui = new ilRatingGUI();
1163  $rating_gui->setObject($this->lm->getId(), "lm", $this->getCurrentPageId(), "lm");
1164  $rating_gui->setYourRatingText($this->lng->txt("lm_rate_page"));
1165 
1166  $this->ctrl->setParameter($this, "pg_id", $this->getCurrentPageId());
1167  $this->tpl->addOnLoadCode("il.LearningModule.setRatingUrl('" .
1168  $this->ctrl->getLinkTarget($this, "updatePageRating", "", true, false) .
1169  "')");
1170  $this->ctrl->setParameter($this, "pg_id", "");
1171 
1172  $rating = '<div id="ilrtrpg" style="text-align:right">' .
1173  $rating_gui->getHTML(true, true, "il.LearningModule.saveRating(%rating%);") .
1174  "</div>";
1175  }
1176  return $rating;
1177  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
offlineMode()
checks whether 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 ( string  $active_tab,
int  $current_page_id 
)
protected

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

References $additional_content, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), getExportFormat(), getService(), ILIAS\Repository\lng(), offlineMode(), ilLMMenuRendererGUI\render(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

Referenced by ilLMMenu(), and initScreenHead().

2427  : void {
2428  $menu_editor = new ilLMMenuEditor();
2429  $menu_editor->setObjId($this->lm->getId());
2430 
2431  $navigation_renderer = new ilLMMenuRendererGUI(
2432  $this->getService(),
2433  $this->tabs,
2434  $this->toolbar,
2436  $active_tab,
2437  $this->getExportFormat(),
2438  $this->export_all_languages,
2439  $this->lm,
2440  $this->offlineMode(),
2441  $menu_editor,
2442  $this->lang,
2443  $this->ctrl,
2444  $this->access,
2445  $this->user,
2446  $this->lng,
2447  $this->tpl,
2448  function ($additional_content) {
2449  $this->additional_content[] = $additional_content;
2450  }
2451  );
2452  $navigation_renderer->render();
2453  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
offlineMode()
checks whether offline content generation is activated
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resume()

ilLMPresentationGUI::resume ( )
Exceptions
ilLMPresentationException

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

References layout().

465  : void
466  {
467  $this->layout();
468  }
layout(string $a_xml="main.xml", bool $doShow=true)
+ Here is the call graph for this function:

◆ saveFrameUrl()

ilLMPresentationGUI::saveFrameUrl ( )

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

References $requested_url.

653  : void
654  {
655  $store = new ilSessionIStorage("lm");
656  $store->set("cf_" . $this->lm->getId(), $this->requested_url);
657  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setContentStyles()

ilLMPresentationGUI::setContentStyles ( )
protected

Set content style.

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

References ilObjStyleSheet\getSyntaxStylePath().

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

1091  : void
1092  {
1093  // content style
1094  $this->content_style_gui->addCss(
1095  $this->tpl,
1096  $this->lm->getRefId()
1097  );
1098  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
1099  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHeader()

ilLMPresentationGUI::setHeader ( )

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

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

Referenced by layout().

759  : void
760  {
761  $this->tpl->setTitle($this->getLMPresentationTitle());
762  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
763  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $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 1104 of file class.ilLMPresentationGUI.php.

References ilUtil\getStyleSheetLocation().

Referenced by glossary(), and media().

1104  : void
1105  {
1106  $this->tpl->addCss(ilUtil::getStyleSheetLocation());
1107  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $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 2199 of file class.ilLMPresentationGUI.php.

References ilMDUtils\_parseCopyright(), exit, ilGlobalTemplateInterface\get(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\ui().

2199  : void
2200  {
2201  if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2202  return;
2203  }
2204  $tpl = new ilTemplate("tpl.lm_download_list.html", true, true, "Modules/LearningModule");
2205 
2206  // output copyright information
2207  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2208  if (is_object($md_rights = $md->getRights())) {
2209  $copyright = $md_rights->getDescription();
2210 
2211  $copyright = ilMDUtils::_parseCopyright($copyright);
2212 
2213  if ($copyright != "") {
2214  $this->lng->loadLanguageModule("meta");
2215  $tpl->setCurrentBlock("copyright");
2216  $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2217  $tpl->setVariable("LM_COPYRIGHT", $copyright);
2219  }
2220  }
2221 
2222  $download_table = new ilLMDownloadTableGUI($this, "showDownloadList", $this->lm);
2223  $tpl->setVariable("DOWNLOAD_TABLE", $download_table->getHTML());
2224  //$this->tpl->printToStdout();
2225 
2226  $modal = $this->ui->factory()->modal()->roundtrip(
2227  $this->lng->txt("download"),
2228  $this->ui->factory()->legacy($tpl->get())
2229  );
2230  echo $this->ui->renderer()->render($modal);
2231  exit();
2232  }
exit
Definition: login.php:29
static _parseCopyright(string $a_copyright)
Returns an empty string if copyright selection is not active, regardless of input.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
ilGlobalTemplateInterface $tpl
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:

◆ showInfoScreen()

ilLMPresentationGUI::showInfoScreen ( )

info screen call from inside learning module

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

References outputInfoScreen().

1354  : void
1355  {
1356  $this->outputInfoScreen();
1357  }
+ Here is the call graph for this function:

◆ showMessageScreen()

ilLMPresentationGUI::showMessageScreen ( string  $a_content)

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

References ilGlobalTemplateInterface\get(), setContentStyles(), and ilGlobalTemplateInterface\setVariable().

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

2273  : void {
2274  // content style
2275  $this->setContentStyles();
2276 
2277  $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
2278  $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
2279 
2280  $this->tpl->setVariable("PAGE_CONTENT", $tpl->get());
2281  }
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
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 2303 of file class.ilLMPresentationGUI.php.

References ILIAS\Repository\lng(), and showMessageScreen().

2303  : void
2304  {
2305  $this->showMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
2306  }
showMessageScreen(string $a_content)
+ 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 2294 of file class.ilLMPresentationGUI.php.

References ILIAS\Repository\lng(), and showMessageScreen().

2294  : void
2295  {
2296  $this->showMessageScreen($this->lng->txt("msg_no_page_access"));
2297  }
showMessageScreen(string $a_content)
+ 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 2286 of file class.ilLMPresentationGUI.php.

References ILIAS\Repository\lng(), and showMessageScreen().

2286  : void
2287  {
2288  $this->showMessageScreen($this->lng->txt("msg_page_no_public_access"));
2289  }
showMessageScreen(string $a_content)
+ Here is the call graph for this function:

◆ showPrintView()

ilLMPresentationGUI::showPrintView ( )

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

References $ctrl, Vendor\Package\$e, $id, ILIAS\LTI\ToolProvider\$key, $lang, $lifecycle, $lng, $path, $tabs, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_exists(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilInternalLink\_getTargetsOfSource(), ilLMObject\_isPagePublic(), ilGlossaryTerm\_lookGlossaryTerm(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilMDUtils\_parseCopyright(), ANONYMOUS_USER_ID, ilLMObject\CHAPTER_TITLE, ilGlobalTemplateInterface\get(), ilObjStyleSheet\getContentPrintStyle(), getCurrentPageId(), ilMD\getGeneral(), ilUtil\getImagePath(), getLMPageGUI(), getLMPresentationTitle(), getTracker(), ilFileUtils\getWebspaceDir(), IL_INST_ID, ILIAS\Repository\lng(), ilLMObject\PAGE_TITLE, ilGlobalTemplateInterface\parseCurrentBlock(), renderPageTitle(), ilTabsGUI\setBackTarget(), setContentStyles(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), ilArrayUtil\sortArray(), and ilLanguage\txt().

1653  : void
1654  {
1655  $ilUser = $this->user;
1656  $lng = $this->lng;
1657  $ilCtrl = $this->ctrl;
1658  $tabs = $this->tabs;
1659  $header_page_content = "";
1660  $footer_page_content = "";
1661  $chapter_title = "";
1662  $did_chap_page_header = false;
1663  $description = "";
1664 
1665  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1666  return;
1667  }
1668 
1669  $this->renderPageTitle();
1670 
1672  $lng->txt("back"),
1673  $ilCtrl->getLinkTarget($this, "layout")
1674  );
1675 
1676  $c_obj_id = $this->getCurrentPageId();
1677  // set values according to selection
1678  $sel_type = $this->service->getRequest()->getSelectedType();
1679  $sel_obj_ids = $this->service->getRequest()->getSelectedObjIds();
1680  if ($sel_type == "page") {
1681  if (!in_array($c_obj_id, $sel_obj_ids)) {
1682  $sel_obj_ids[] = $c_obj_id;
1683  }
1684  }
1685  if ($sel_type == "chapter" && $c_obj_id > 0) {
1686  $path = $this->lm_tree->getPathFull($c_obj_id);
1687  $chap_id = $path[1]["child"];
1688  if ($chap_id > 0) {
1689  $sel_obj_ids[] = $chap_id;
1690  }
1691  }
1692 
1693  $this->setContentStyles();
1694  $this->tpl->addCss(ilObjStyleSheet::getContentPrintStyle());
1695 
1696  $tpl = new ilTemplate("tpl.lm_print_view.html", true, true, "Modules/LearningModule");
1697 
1698  // set title header
1699  $this->tpl->setTitle($this->getLMPresentationTitle());
1700 
1701  $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1702 
1703  $act_level = 99999;
1704  $activated = false;
1705 
1706  $glossary_links = array();
1707  $output_header = false;
1708  $media_links = array();
1709  $last_page_title = "";
1710 
1711  // get header and footer
1712  if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1713  if (ilLMObject::_exists($this->lm->getFooterPage())) {
1714  $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
1715  $page_object_gui->setStyleId(
1716  $this->content_style_domain->getEffectiveStyleId()
1717  );
1718 
1719  // determine target frames for internal links
1720  $page_object_gui->setLinkFrame($this->requested_frame);
1721  $page_object_gui->setOutputMode("print");
1722  $page_object_gui->setPresentationTitle("");
1723  $page_object_gui->setFileDownloadLink("#");
1724  $page_object_gui->setFullscreenLink("#");
1725  $page_object_gui->setSourcecodeDownloadScript("#");
1726  $footer_page_content = $page_object_gui->showPage();
1727  }
1728  }
1729  if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1730  if (ilLMObject::_exists($this->lm->getHeaderPage())) {
1731  $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
1732  $page_object_gui->setStyleId(
1733  $this->content_style_domain->getEffectiveStyleId()
1734  );
1735 
1736  // determine target frames for internal links
1737  $page_object_gui->setLinkFrame($this->requested_frame);
1738  $page_object_gui->setOutputMode("print");
1739  $page_object_gui->setPresentationTitle("");
1740  $page_object_gui->setFileDownloadLink("#");
1741  $page_object_gui->setFullscreenLink("#");
1742  $page_object_gui->setSourcecodeDownloadScript("#");
1743  $header_page_content = $page_object_gui->showPage();
1744  }
1745  }
1746 
1747  // add free selected pages
1748  if (count($sel_obj_ids) > 0) {
1749  foreach ($sel_obj_ids as $k) {
1750  if ($k > 0 && !$this->lm_tree->isInTree($k)) {
1751  if (ilLMObject::_lookupType($k) == "pg") {
1752  $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
1753  }
1754  }
1755  }
1756  } else {
1757  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_print_no_page_selected"), true);
1758  $ilCtrl->redirect($this, "showPrintViewSelection");
1759  }
1760 
1761  foreach ($nodes as $node_key => $node) {
1762  // check page activation
1763  $active = ilLMPage::_lookupActive(
1764  $node["obj_id"],
1765  $this->lm->getType(),
1766  (bool) $this->lm_set->get("time_scheduled_page_activation")
1767  );
1768  if ($node["type"] == "pg" && !$active) {
1769  continue;
1770  }
1771 
1772  // print all subchapters/subpages if higher chapter
1773  // has been selected
1774  if ($node["depth"] <= $act_level) {
1775  if (in_array($node["obj_id"], $sel_obj_ids)) {
1776  $act_level = $node["depth"];
1777  $activated = true;
1778  } else {
1779  $act_level = 99999;
1780  $activated = false;
1781  }
1782  }
1783  if ($this->lm->getRestrictForwardNavigation()) {
1784  if ($this->getTracker()->hasPredIncorrectAnswers($node["obj_id"])) {
1785  continue;
1786  }
1787  }
1788  if ($activated &&
1790  $this->lm->getRefId(),
1791  $this->lm->getId(),
1792  $node["obj_id"]
1793  )) {
1794  // output learning module header
1795  if ($node["type"] == "du") {
1796  $output_header = true;
1797  }
1798 
1799  // output chapter title
1800  if ($node["type"] == "st") {
1801  if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1802  $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1803  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1804  continue;
1805  }
1806  }
1807 
1808  $chap = new ilStructureObject($this->lm, $node["obj_id"]);
1809  $tpl->setCurrentBlock("print_chapter");
1810 
1811  $chapter_title = $chap->_getPresentationTitle(
1812  $node["obj_id"],
1814  $this->lm->isActiveNumbering(),
1815  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1816  false,
1817  0,
1818  $this->lang
1819  );
1820  $tpl->setVariable(
1821  "CHAP_TITLE",
1822  $chapter_title
1823  );
1824 
1825  if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1826  if ($nodes[$node_key + 1]["type"] == "pg") {
1827  $tpl->setVariable(
1828  "CHAP_HEADER",
1829  $header_page_content
1830  );
1831  $did_chap_page_header = true;
1832  }
1833  }
1834 
1836  $tpl->setCurrentBlock("print_block");
1838  }
1839 
1840  // output page
1841  if ($node["type"] === "pg") {
1842  if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1843  $this->lm_gui->getObject()->getPublicAccessMode() === "selected") {
1844  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1845  continue;
1846  }
1847  }
1848 
1849  $tpl->setCurrentBlock("print_item");
1850 
1851  // get page
1852  $page_id = $node["obj_id"];
1853  $page_object_gui = $this->getLMPageGUI($page_id);
1854  $page_object = $page_object_gui->getPageObject();
1855  $page_object_gui->setStyleId(
1856  $this->content_style_domain->getEffectiveStyleId()
1857  );
1858 
1859  // get lm page
1860  $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
1861  $lm_pg_obj->setLMId($this->lm->getId());
1862 
1863  // determine target frames for internal links
1864  $page_object_gui->setLinkFrame($this->requested_frame);
1865  $page_object_gui->setOutputMode("print");
1866  $page_object_gui->setPresentationTitle("");
1867 
1868  // if ($this->lm->getPageHeader() == ilLMObject::PAGE_TITLE || ($node["free"] ?? false) === true) {
1869  if (true) {
1871  $lm_pg_obj->getId(),
1872  $this->lm->getPageHeader(),
1873  $this->lm->isActiveNumbering(),
1874  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1875  false,
1876  0,
1877  $this->lang
1878  );
1879 
1880  if ($this->lm->getPageHeader() === ilLMObject::CHAPTER_TITLE) {
1881  // remove the suffic (x/n)
1882  $page_title = trim(substr($page_title, 0, strrpos($page_title, " ")));
1883  }
1884 
1885  // prevent page title after chapter title
1886  // that have the same content
1887  if ($this->lm->isActiveNumbering()) {
1888  $chapter_title = trim(substr(
1889  $chapter_title,
1890  strpos($chapter_title, " ")
1891  ));
1892  }
1893 
1894  if ($page_title != $chapter_title && $page_title !== $last_page_title) {
1895  $page_object_gui->setPresentationTitle($page_title);
1896  }
1897  $last_page_title = $page_title;
1898  }
1899 
1900  // handle header / footer
1901  $hcont = $header_page_content;
1902  $fcont = $footer_page_content;
1903 
1904  if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1905  if ($did_chap_page_header) {
1906  $hcont = "";
1907  }
1908  if (($nodes[$node_key + 1]["type"] ?? "") == "pg" &&
1909  !($nodes[$node_key + 1]["depth"] <= $act_level
1910  && !in_array($nodes[$node_key + 1]["obj_id"], $sel_obj_ids))) {
1911  $fcont = "";
1912  }
1913  }
1914 
1915  $page_object_gui->setFileDownloadLink("#");
1916  $page_object_gui->setFullscreenLink("#");
1917  $page_object_gui->setSourcecodeDownloadScript("#");
1918  $page_content = $page_object_gui->showPage();
1919  if ($this->lm->getPageHeader() != ilLMObject::PAGE_TITLE) {
1920  $tpl->setVariable(
1921  "CONTENT",
1922  $hcont . $page_content . $fcont
1923  );
1924  } else {
1925  $tpl->setVariable(
1926  "CONTENT",
1927  $hcont . $page_content . $fcont . "<br />"
1928  );
1929  }
1930  $chapter_title = "";
1932  $tpl->setCurrentBlock("print_block");
1934 
1935  // get internal links
1936  $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]);
1937 
1938  $got_mobs = false;
1939 
1940  foreach ($int_links as $key => $link) {
1941  if ($link["type"] == "git" &&
1942  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1943  $glossary_links[$key] = $link;
1944  }
1945  if ($link["type"] == "mob" &&
1946  ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1947  $got_mobs = true;
1948  $mob_links[$key] = $link;
1949  }
1950  }
1951 
1952  // this is not cool because of performance reasons
1953  // unfortunately the int link table does not
1954  // store the target frame (we want to append all linked
1955  // images but not inline images (i.e. mobs with no target
1956  // frame))
1957  if ($got_mobs) {
1958  $page_object->buildDom();
1959  $links = $page_object->getInternalLinks();
1960  $tf = $link["TargetFrame"] ?? "";
1961  foreach ($links as $link) {
1962  if ($link["Type"] === "MediaObject"
1963  && $tf !== ""
1964  && $tf !== "None") {
1965  $media_links[] = $link;
1966  }
1967  }
1968  }
1969  }
1970  }
1971  }
1972 
1973  $annex_cnt = 0;
1974  $annexes = array();
1975 
1976  // glossary
1977  if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) {
1978  // sort terms
1979  $terms = array();
1980 
1981  foreach ($glossary_links as $key => $link) {
1982  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]);
1983  $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term);
1984  }
1985  $terms = ilArrayUtil::sortArray($terms, "term", "asc");
1986  //ksort($terms);
1987 
1988  foreach ($terms as $t) {
1989  $link = $t["link"];
1990  $key = $t["key"];
1991 
1992  try {
1993  // output definition of term
1994  $page_gui = new ilGlossaryDefPageGUI($link["id"]);
1995  $page_gui->setTemplateOutput(false);
1996  $page_gui->setOutputMode("print");
1997 
1998  $tpl->setCurrentBlock("definition");
1999  $page_gui->setFileDownloadLink("#");
2000  $page_gui->setFullscreenLink("#");
2001  $page_gui->setSourcecodeDownloadScript("#");
2002  $output = $page_gui->showPage();
2003  $tpl->setVariable("VAL_DEFINITION", $output);
2005 
2006  // output term
2007  $tpl->setCurrentBlock("term");
2008  $tpl->setVariable(
2009  "VAL_TERM",
2010  $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])
2011  );
2013  } catch (Exception $e) {
2014 
2015  }
2016  }
2017 
2018  // output glossary header
2019  $annex_cnt++;
2020  $tpl->setCurrentBlock("glossary");
2021  $annex_title = $this->lng->txt("cont_annex") . " " .
2022  chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo");
2023  $tpl->setVariable("TXT_GLOSSARY", $annex_title);
2025 
2026  $annexes[] = $annex_title;
2027  }
2028 
2029  // referenced images
2030  if (count($media_links) > 0) {
2031  foreach ($media_links as $media) {
2032  if (substr($media["Target"], 0, 4) == "il__") {
2033  $arr = explode("_", $media["Target"]);
2034  $id = $arr[count($arr) - 1];
2035 
2036  $med_obj = new ilObjMediaObject($id);
2037  $med_item = $med_obj->getMediaItem("Standard");
2038  if (is_object($med_item)) {
2039  if (is_int(strpos($med_item->getFormat(), "image"))) {
2040  $tpl->setCurrentBlock("ref_image");
2041 
2042  // image source
2043  if ($med_item->getLocationType() == "LocalFile") {
2044  $tpl->setVariable(
2045  "IMG_SOURCE",
2046  ilFileUtils::getWebspaceDir("output") . "/mobs/mm_" . $id .
2047  "/" . $med_item->getLocation()
2048  );
2049  } else {
2050  $tpl->setVariable(
2051  "IMG_SOURCE",
2052  $med_item->getLocation()
2053  );
2054  }
2055 
2056  if ($med_item->getCaption() != "") {
2057  $tpl->setVariable("IMG_TITLE", $med_item->getCaption());
2058  } else {
2059  $tpl->setVariable("IMG_TITLE", $med_obj->getTitle());
2060  }
2062  }
2063  }
2064  }
2065  }
2066 
2067  // output glossary header
2068  $annex_cnt++;
2069  $tpl->setCurrentBlock("ref_images");
2070  $annex_title = $this->lng->txt("cont_annex") . " " .
2071  chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images");
2072  $tpl->setVariable("TXT_REF_IMAGES", $annex_title);
2074 
2075  $annexes[] = $annex_title;
2076  }
2077 
2078  // output learning module title and toc
2079  if ($output_header) {
2080  $tpl->setCurrentBlock("print_header");
2081  $tpl->setVariable("LM_TITLE", $this->getLMPresentationTitle());
2082  if ($this->lm->getDescription() != "none") {
2083  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2084  $md_gen = $md->getGeneral();
2085  foreach ($md_gen->getDescriptionIds() as $id) {
2086  $md_des = $md_gen->getDescription($id);
2087  $description = $md_des->getDescription();
2088  }
2089 
2090  $tpl->setVariable(
2091  "LM_DESCRIPTION",
2092  $description
2093  );
2094  }
2096 
2097  // output toc
2098  $nodes2 = $nodes;
2099  foreach ($nodes2 as $node2) {
2100  if ($node2["type"] == "st"
2102  $this->lm->getRefId(),
2103  $this->lm->getId(),
2104  $node2["obj_id"]
2105  )) {
2106  for ($j = 1; $j < $node2["depth"]; $j++) {
2107  $tpl->setCurrentBlock("indent");
2108  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2110  }
2111  $tpl->setCurrentBlock("toc_entry");
2112  $tpl->setVariable(
2113  "TXT_TOC_TITLE",
2115  $node2["obj_id"],
2117  $this->lm->isActiveNumbering(),
2118  (bool) $this->lm_set->get("time_scheduled_page_activation"),
2119  false,
2120  0,
2121  $this->lang
2122  )
2123  );
2125  }
2126  }
2127 
2128  // annexes
2129  foreach ($annexes as $annex) {
2130  $tpl->setCurrentBlock("indent");
2131  $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2133  $tpl->setCurrentBlock("toc_entry");
2134  $tpl->setVariable("TXT_TOC_TITLE", $annex);
2136  }
2137 
2138  $tpl->setCurrentBlock("toc");
2139  $tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
2141 
2142  $tpl->setCurrentBlock("print_start_block");
2144  }
2145 
2146  // output author information
2147  $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2148  if (is_object($lifecycle = $md->getLifecycle())) {
2149  $sep = $author = "";
2150  foreach (($ids = $lifecycle->getContributeIds()) as $con_id) {
2151  $md_con = $lifecycle->getContribute($con_id);
2152  if ($md_con->getRole() == "Author") {
2153  foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2154  $md_ent = $md_con->getEntity($ent_id);
2155  $author = $author . $sep . $md_ent->getEntity();
2156  $sep = ", ";
2157  }
2158  }
2159  }
2160  if ($author != "") {
2161  $this->lng->loadLanguageModule("meta");
2162  $tpl->setCurrentBlock("author");
2163  $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2164  $tpl->setVariable("LM_AUTHOR", $author);
2166  }
2167  }
2168 
2169  // output copyright information
2170  if (is_object($md_rights = $md->getRights())) {
2171  $copyright = $md_rights->getDescription();
2172  $copyright = ilMDUtils::_parseCopyright($copyright);
2173 
2174  if ($copyright != "") {
2175  $this->lng->loadLanguageModule("meta");
2176  $tpl->setCurrentBlock("copyright");
2177  $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2178  $tpl->setVariable("LM_COPYRIGHT", $copyright);
2180  }
2181  }
2182  $this->tpl->setContent($tpl->get());
2183  $this->tpl->addOnLoadCode("il.Util.print();");
2184  $this->tpl->printToStdout();
2185  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
static _parseCopyright(string $a_copyright)
Returns an empty string if copyright selection is not active, regardless of input.
const IL_INST_ID
Definition: constants.php:40
const ANONYMOUS_USER_ID
Definition: constants.php:27
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _checkPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
checks whether the preconditions of a page are fulfilled or not
static _lookGlossaryTerm(int $term_id)
get glossary term
setBackTarget(string $a_title, string $a_target, string $a_frame="")
string $key
Consumer key/client ID value.
Definition: System.php:193
getCurrentPageId()
Get the current page id.
$lifecycle
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
ilGlobalTemplateInterface $tpl
getGeneral()
Definition: class.ilMD.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $a_obj_id, int $a_lm_id=0)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setContentStyles()
Set content style.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

◆ showPrintViewSelection()

ilLMPresentationGUI::showPrintViewSelection ( )

show selection screen for print view

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

References Vendor\Package\$f, $id, $lang, $lng, $requested_obj_id, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ANONYMOUS_USER_ID, ilLMObject\CHAPTER_TITLE, ILIAS\Repository\ctrl(), exit, filterNonAccessibleNode(), ILIAS\Repository\form(), ilGlobalTemplateInterface\get(), ilUtil\getImagePath(), getLMPresentationTitle(), initPrintViewSelectionForm(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setVariable(), ilLanguage\txt(), and ILIAS\Repository\ui().

1439  : void
1440  {
1441  $ilUser = $this->user;
1442  $lng = $this->lng;
1443 
1444  if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1445  return;
1446  }
1447 
1448  $disabled = false;
1449  $img_alt = "";
1450 
1451  $tpl = new ilTemplate("tpl.lm_print_selection.html", true, true, "Modules/LearningModule");
1452 
1453  $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
1454  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1455 
1456  $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1457  $nodes = $this->filterNonAccessibleNode($nodes);
1458 
1459  $this->initPrintViewSelectionForm();
1460 
1461  foreach ($nodes as $node) {
1462  $img_src = "";
1463  $disabled = false;
1464  $img_alt = "";
1465 
1466  // check page activation
1467  $active = ilLMPage::_lookupActive(
1468  $node["obj_id"],
1469  $this->lm->getType(),
1470  (bool) $this->lm_set->get("time_scheduled_page_activation")
1471  );
1472 
1473  if ($node["type"] == "pg" &&
1474  !$active) {
1475  continue;
1476  }
1477 
1478  $text = "";
1479  $img_alt = "";
1480  $checked = false;
1481 
1482  switch ($node["type"]) {
1483  // page
1484  case "pg":
1485  $text =
1487  $node["obj_id"],
1488  $this->lm->getPageHeader(),
1489  $this->lm->isActiveNumbering(),
1490  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1491  false,
1492  0,
1493  $this->lang
1494  );
1495 
1496  if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1497  $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1498  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1499  $disabled = true;
1500  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1501  }
1502  }
1503  $img_src = ilUtil::getImagePath("standard/icon_pg.svg");
1504  $img_alt = $lng->txt("icon") . " " . $lng->txt("pg");
1505  break;
1506 
1507  // learning module
1508  case "du":
1509  $text = $this->getLMPresentationTitle();
1510  $img_src = ilUtil::getImagePath("standard/icon_lm.svg");
1511  $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm");
1512  break;
1513 
1514  // chapter
1515  case "st":
1516  $text =
1518  $node["obj_id"],
1520  $this->lm->isActiveNumbering(),
1521  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1522  false,
1523  0,
1524  $this->lang
1525  );
1526  if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1527  $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1528  if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1529  $disabled = true;
1530  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1531  }
1532  }
1533  $img_src = ilUtil::getImagePath("standard/icon_st.svg");
1534  $img_alt = $lng->txt("icon") . " " . $lng->txt("st");
1535  break;
1536  }
1537 
1539  $this->lm->getRefId(),
1540  $this->lm->getId(),
1541  $node["obj_id"]
1542  )) {
1543  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1544  }
1545 
1546  $this->nl->addListNode(
1547  $node["obj_id"],
1548  $text,
1549  $node["parent"],
1550  $checked,
1551  $disabled,
1552  $img_src,
1553  $img_alt
1554  );
1555  }
1556 
1557  // check for free page
1558  if ($this->requested_obj_id > 0 && !$this->lm_tree->isInTree($this->requested_obj_id)) {
1559  $text =
1561  $this->requested_obj_id,
1562  $this->lm->getPageHeader(),
1563  $this->lm->isActiveNumbering(),
1564  (bool) $this->lm_set->get("time_scheduled_page_activation"),
1565  false,
1566  0,
1567  $this->lang
1568  );
1569 
1570  if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1571  $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1572  if (!ilLMObject::_isPagePublic($this->requested_obj_id)) {
1573  $disabled = true;
1574  $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1575  }
1576  }
1577  $img_src = ilUtil::getImagePath("standard/icon_pg.svg");
1579 
1580  $checked = true;
1581 
1582  $this->nl->addListNode(
1583  $id,
1584  $text,
1585  0,
1586  $checked,
1587  $disabled,
1588  $img_src,
1589  $img_alt
1590  );
1591  }
1592 
1593  $f = $this->form->getHTMLAsync();
1594 
1595  $tpl->setVariable("ITEM_SELECTION", $f);
1596 
1597  $modal = $this->ui->factory()->modal()->roundtrip(
1598  $this->lng->txt("cont_print_view"),
1599  $this->ui->factory()->legacy($tpl->get())
1600  );
1601  echo $this->ui->renderer()->render($modal);
1602  exit();
1603  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
exit
Definition: login.php:29
const ANONYMOUS_USER_ID
Definition: constants.php:27
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static _checkPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
checks whether the preconditions of a page are fulfilled or not
form( $class_path, string $cmd, string $submit_caption="")
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
ilGlobalTemplateInterface $tpl
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ updatePageRating()

ilLMPresentationGUI::updatePageRating ( )

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

References $user, ILIAS\Repository\ctrl(), exit, ILIAS\Repository\lng(), ilRating\resetRatingForUserAndObject(), and ilRating\writeRatingForUserAndObject().

1179  : void
1180  {
1181  $ilUser = $this->user;
1182  $pg_id = $this->service->getRequest()->getPgId();
1183  if (!$this->ctrl->isAsynch() || !$pg_id) {
1184  exit();
1185  }
1186 
1187  $rating = $this->service->getRequest()->getRating();
1188  if ($rating) {
1190  $this->lm->getId(),
1191  "lm",
1192  $pg_id,
1193  "lm",
1194  $ilUser->getId(),
1195  $rating
1196  );
1197  } else {
1199  $this->lm->getId(),
1200  "lm",
1201  $pg_id,
1202  "lm",
1203  $ilUser->getId()
1204  );
1205  }
1206 
1207  $rating = new ilRatingGUI();
1208  $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm");
1209  $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
1210 
1211  echo $rating->getHTML(true, true, "il.LearningModule.saveRating(%rating%);");
1212 
1213  echo $this->tpl->getOnLoadCodeForAsynch();
1214  exit();
1215  }
exit
Definition: login.php:29
static resetRatingForUserAndObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id, string $a_sub_obj_type, int $a_user_id)
Reset rating for a user and an object.
static writeRatingForUserAndObject(int $a_obj_id, string $a_obj_type, ?int $a_sub_obj_id, ?string $a_sub_obj_type, int $a_user_id, int $a_rating, int $a_category_id=0)
Write rating for a user and an object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Field Documentation

◆ $abstract

bool ilLMPresentationGUI::$abstract = false
protected

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

◆ $access

ilAccessHandler ilLMPresentationGUI::$access
protected

◆ $additional_content

array ilLMPresentationGUI::$additional_content = []
protected

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

Referenced by renderTabs().

◆ $chapter_has_no_active_page

bool ilLMPresentationGUI::$chapter_has_no_active_page = false

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

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilLMPresentationGUI::$content_style_domain
protected

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

◆ $content_style_gui

ILIAS Style Content GUIService ilLMPresentationGUI::$content_style_gui
protected

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

◆ $cs

ILIAS Style Content Service ilLMPresentationGUI::$cs = null
protected

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

◆ $ctrl

ilCtrl ilLMPresentationGUI::$ctrl
protected

◆ $current_page_id

int ilLMPresentationGUI::$current_page_id = 0
protected

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

◆ $deactivated_page

bool ilLMPresentationGUI::$deactivated_page = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilLMPresentationGUI::$dom_util
protected

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

◆ $embed_mode

bool ilLMPresentationGUI::$embed_mode = false
protected

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

Referenced by getHeaderAction(), and initByRequest().

◆ $export_all_languages

bool ilLMPresentationGUI::$export_all_languages = false
protected

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

◆ $export_format

string ilLMPresentationGUI::$export_format
protected

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

Referenced by getExportFormat().

◆ $fill_on_load_code

bool ilLMPresentationGUI::$fill_on_load_code
protected

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

◆ $focus_id

int ilLMPresentationGUI::$focus_id = 0
protected

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

◆ $form

ilPropertyFormGUI ilLMPresentationGUI::$form
protected

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

◆ $frames

array ilLMPresentationGUI::$frames
protected

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

Referenced by getCurrentFrameSet().

◆ $global_screen

ILIAS GlobalScreen Services ilLMPresentationGUI::$global_screen
protected

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

◆ $help

ilHelpGUI ilLMPresentationGUI::$help
protected

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

◆ $lang

string ilLMPresentationGUI::$lang

◆ $layout_doc

DOMDocument ilLMPresentationGUI::$layout_doc

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

◆ $linker

ilLMPresentationLinker ilLMPresentationGUI::$linker
protected

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

◆ $lm

ilObjLearningModule ilLMPresentationGUI::$lm
protected

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

◆ $lm_gui

ilObjLearningModuleGUI ilLMPresentationGUI::$lm_gui
protected

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

◆ $lm_set

ilSetting ilLMPresentationGUI::$lm_set
protected

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

◆ $lm_tree

ilLMTree ilLMPresentationGUI::$lm_tree
protected

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

◆ $lng

◆ $locator

ilLocatorGUI ilLMPresentationGUI::$locator
protected

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

Referenced by ilLocator(), and initScreenHead().

◆ $nav_history

ilNavigationHistory ilLMPresentationGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $nl

ilNestedListInputGUI ilLMPresentationGUI::$nl
protected

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

Referenced by initPrintViewSelectionForm().

◆ $notes

ILIAS Notes DomainService ilLMPresentationGUI::$notes
protected

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

◆ $notes_gui

ILIAS Notes GUIService ilLMPresentationGUI::$notes_gui
protected

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

◆ $offline

bool ilLMPresentationGUI::$offline

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

Referenced by offlineMode().

◆ $offline_directory

string ilLMPresentationGUI::$offline_directory

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

Referenced by getOfflineDirectory().

◆ $ot

ilObjectTranslation ilLMPresentationGUI::$ot
protected

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

◆ $rbacsystem

ilRbacSystem ilLMPresentationGUI::$rbacsystem
protected

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

Referenced by ilLMSubMenu().

◆ $reading_time_manager

ILIAS LearningModule ReadingTime ReadingTimeManager ilLMPresentationGUI::$reading_time_manager
protected

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

◆ $requested_back_pg

string ilLMPresentationGUI::$requested_back_pg
protected

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

◆ $requested_cmd

string ilLMPresentationGUI::$requested_cmd = ""
protected

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

◆ $requested_focus_return

string ilLMPresentationGUI::$requested_focus_return
protected

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

◆ $requested_frame

string ilLMPresentationGUI::$requested_frame
protected

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

Referenced by ilLocator().

◆ $requested_mob_id

int ilLMPresentationGUI::$requested_mob_id = 0
protected

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

◆ $requested_notification_switch

int ilLMPresentationGUI::$requested_notification_switch = 0
protected

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

◆ $requested_obj_id

int ilLMPresentationGUI::$requested_obj_id
protected

◆ $requested_obj_type

string ilLMPresentationGUI::$requested_obj_type
protected

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

Referenced by layout().

◆ $requested_pg_id

int ilLMPresentationGUI::$requested_pg_id = 0
protected

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

◆ $requested_pg_type

string ilLMPresentationGUI::$requested_pg_type = ""
protected

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

◆ $requested_ref_id

int ilLMPresentationGUI::$requested_ref_id
protected

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

Referenced by ilLocator().

◆ $requested_search_string

string ilLMPresentationGUI::$requested_search_string
protected

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

◆ $requested_transl

string ilLMPresentationGUI::$requested_transl
protected

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

◆ $requested_type

string ilLMPresentationGUI::$requested_type
protected

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

Referenced by downloadExportFile().

◆ $requested_url

string ilLMPresentationGUI::$requested_url
protected

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

Referenced by saveFrameUrl().

◆ $service

ilLMPresentationService ilLMPresentationGUI::$service
protected

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

Referenced by getService().

◆ $settings

ilSetting ilLMPresentationGUI::$settings
protected

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

Referenced by getHeaderAction(), and ilLMNotes().

◆ $tabs

ilTabsGUI ilLMPresentationGUI::$tabs
protected

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

Referenced by showPrintView().

◆ $toolbar

ilToolbarGUI ilLMPresentationGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLMPresentationGUI::$tpl

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

Referenced by getHeaderAction(), injectTemplate(), layout(), and page().

◆ $tracker

ilLMTracker ilLMPresentationGUI::$tracker
protected

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

◆ $tree

ilTree ilLMPresentationGUI::$tree
protected

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

◆ $ui

ILIAS DI UIServices ilLMPresentationGUI::$ui
protected

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

◆ $user

ilObjUser ilLMPresentationGUI::$user
protected

◆ $xsl

ILIAS COPage Xsl XslManager ilLMPresentationGUI::$xsl
protected

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


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