ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilLMPresentationGUI Class Reference

Class ilLMPresentationGUI GUI class for learning module presentation. 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...
 
 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...
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. 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
 
LOMServices $lom_services
 
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
 
Translations $ot
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Service $cs = null
 

Detailed Description

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

105 {
106 global $DIC;
107
108 $this->offline = ($a_export_format != "");
109 $this->export_all_languages = $a_all_languages;
110 $this->export_format = $a_export_format; // html/scorm
111 $this->offline_directory = $a_export_dir;
112
113 $this->tabs = $DIC->tabs();
114 $this->toolbar = $DIC->toolbar();
115 $this->user = $DIC->user();
116 $this->rbacsystem = $DIC->rbac()->system();
117 $this->nav_history = $DIC["ilNavigationHistory"];
118 $this->access = $DIC->access();
119 $this->settings = $DIC->settings();
120 $this->locator = $DIC["ilLocator"];
121 $this->tree = $DIC->repositoryTree();
122 $this->help = $DIC["ilHelp"];
123 $this->global_screen = $DIC->globalScreen();
124 $this->lom_services = $DIC->learningObjectMetadata();
125
126 $lng = $DIC->language();
127 $rbacsystem = $DIC->rbac()->system();
128 $ilCtrl = $DIC->ctrl();
129 $ilErr = $DIC["ilErr"];
130
131 // load language vars
132 $lng->loadLanguageModule("content");
133
134 $this->lng = $lng;
135 $this->ui = $DIC->ui();
136 $this->tpl = $DIC->ui()->mainTemplate();
137 $this->frames = array();
138 $this->ctrl = $ilCtrl;
139 $this->ctrl->saveParameter($this, array("ref_id", "transl", "focus_id", "focus_return"));
140
141 $this->cs = $DIC->contentStyle();
142
143 $this->initByRequest($query_params, $embed_mode);
144
145 // check, if learning module is online
146 if (!$rbacsystem->checkAccess("write", $this->requested_ref_id)) {
147 if ($this->lm->getOfflineStatus()) {
148 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->WARNING);
149 }
150 }
151
152 if ($claim_repo_context) {
153 $DIC->globalScreen()->tool()->context()->claim()->repository();
154 }
155
156 if (!$ilCtrl->isAsynch()) {
157 // moved this into the if due to #0027200
158 if (!$embed_mode) {
159 if ($this->service->getPresentationStatus()->isTocNecessary()) {
160 $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
162 true
163 );
164 }
165 }
166 $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
168 true
169 );
170 }
171
172 if ($embed_mode) {
173 $ilCtrl->setParameter($this, "embed_mode", 1);
174 $params = [
175 "obj_id" => $this->requested_obj_id,
176 "ref_id" => $this->lm->getRefId(),
177 "frame" => ""
178 ];
179 $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
181 $params
182 );
183 }
184 $this->reading_time_manager = new \ILIAS\LearningModule\ReadingTime\ReadingTimeManager();
185 $this->notes = $DIC->notes()->domain();
186 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
187 $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
188 $this->notes_gui = $DIC->notes()->gui();
189 }
initByRequest(?array $query_params=null, bool $embed_mode=false)
Init services and this class by request params.
loadLanguageModule(string $a_module)
Load language module.
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...
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 ...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26

References $DIC, $embed_mode, $ilErr, $lng, $params, $rbacsystem, $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().

+ Here is the call graph for this function:

Member Function Documentation

◆ addHeaderAction()

ilLMPresentationGUI::addHeaderAction ( )

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

811 : void
812 {
813 //$this->tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
814 $this->tpl->setHeaderActionMenu($this->getHeaderAction());
815 }
getHeaderAction(bool $a_redraw=false)

◆ addResourceFiles()

ilLMPresentationGUI::addResourceFiles ( )
protected

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

619 : void
620 {
621 iljQueryUtil::initjQuery($this->tpl);
622 //iljQueryUtil::initjQueryUI($this->tpl);
623
624 if (!$this->offlineMode()) {
627
628 $this->tpl->addJavaScript("assets/js/LearningModule.js");
629
630 // handle initial content
631 if ($this->requested_frame == "") {
632 $store = new ilSessionIStorage("lm");
633 $last_frame_url = $store->get("cf_" . $this->lm->getId());
634 if ($last_frame_url != "") {
635 $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
636 }
637
638 $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" .
639 $this->ctrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');
640 il.LearningModule.openInitFrames();
641 ");
642
643 $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" .
644 $this->ctrl->getLinkTarget($this, "refreshToc", "", false, false) . "');
645 ");
646 }
647
648 // from main menu
649 // $this->tpl->addJavascript("assets/js/Basic.js");
650 }
651 }
static addCss()
Add required css.
static addJavaScript(?ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
offlineMode()
checks whether offline content generation is activated
Session based immediate storage.
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

References ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), ILIAS\Repository\ctrl(), and iljQueryUtil\initjQuery().

+ Here is the call graph for this function:

◆ attrib2arr()

ilLMPresentationGUI::attrib2arr ( ?DOMNamedNodeMap  $a_attributes)

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

440 : array
441 {
442 $attr = array();
443 if (!is_null($a_attributes)) {
444 foreach ($a_attributes as $attribute) {
445 $attr[$attribute->name] = $attribute->value;
446 }
447 }
448 return $attr;
449 }

◆ basicPageGuiInit()

ilLMPresentationGUI::basicPageGuiInit ( \ilPageObjectGUI  $a_page_gui)

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

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

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

+ Here is the call graph for this function:

◆ determineLayout()

ilLMPresentationGUI::determineLayout ( )

Determine layout.

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

462 : string
463 {
464 return "standard";
465 }

◆ downloadFile()

ilLMPresentationGUI::downloadFile ( )

download file of file lists

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

2142 : void
2143 {
2144 $page_gui = $this->getLMPageGUI($this->getCurrentPageId());
2145 $page_gui->downloadFile();
2146 }

◆ executeCommand()

ilLMPresentationGUI::executeCommand ( )
Exceptions
ilCtrlException
ilLMPresentationException
ilPermissionException

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

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

References $lng, ILIAS\Repository\ctrl(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilNotification\setNotification(), ilNotification\TYPE_LM, ilNotification\TYPE_LM_PAGE, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ filterNonAccessibleNode()

ilLMPresentationGUI::filterNonAccessibleNode ( array  $nodes)
protected

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

1582 : array {
1583 $tracker = $this->getTracker();
1584 // if navigation is restricted based on correct answered questions
1585 // check if we have preceeding pages including unsanswered/incorrect answered questions
1586 if (!$this->offlineMode()) {
1587 if ($this->lm->getRestrictForwardNavigation()) {
1588 $nodes = array_filter($nodes, function ($node) use ($tracker) {
1589 return !$tracker->hasPredIncorrectAnswers($node["child"]);
1590 });
1591 }
1592 }
1593 return $nodes;
1594 }
hasPredIncorrectAnswers(int $a_obj_id, bool $a_ignore_unlock=false)
Has predecessing incorrect answers.

References ilLMTracker\hasPredIncorrectAnswers().

+ Here is the call graph for this function:

◆ fullscreen()

ilLMPresentationGUI::fullscreen ( )

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

659 : string
660 {
661 return $this->media();
662 }

◆ getContent()

ilLMPresentationGUI::getContent ( bool  $skip_nav = false)

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

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

◆ getCurrentFrameSet()

ilLMPresentationGUI::getCurrentFrameSet ( )

get frames of current frame set

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

454 : array
455 {
456 return $this->frames;
457 }

◆ getCurrentPageId()

ilLMPresentationGUI::getCurrentPageId ( )

Get the current page id.

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

1080 : ?int
1081 {
1082 return $this->service->getNavigationStatus()->getCurrentPage();
1083 }

◆ getExportFormat()

ilLMPresentationGUI::getExportFormat ( )

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

428 : string
429 {
431 }

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

2158 : string {
2159 return "ilias.php?baseClass=ilLMPresentationGUI&ref_id=" . $a_ref_id . "&obj_id=" . $a_obj_id . "&focus_id=" .
2160 $a_obj_id . "&focus_return=" . $a_return_ref_id;
2161 }

◆ getHeaderAction()

ilLMPresentationGUI::getHeaderAction ( bool  $a_redraw = false)

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

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

◆ getHTML()

ilLMPresentationGUI::getHTML ( array  $pars)

Get HTML (called by kiosk mode through ilCtrl)

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

2350 : string
2351 {
2352 $this->addResourceFiles();
2353 switch ($pars["cmd"]) {
2354 case "layout":
2355 $tpl = new ilTemplate("tpl.embedded_view.html", true, true, "components/ILIAS/LearningModule");
2356 $tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
2357 $tpl->setVariable("PAGE_RATING", $this->renderRating());
2358 $tpl->setVariable("PAGE", $this->getContent(true));
2359 $tpl->setVariable("COMMENTS", $this->ilLMNotes());
2360 return $tpl->get();
2361 }
2362 return "";
2363 }
ilLMNotes()
output notes of page
getContent(bool $skip_nav=false)

References ILIAS\UICore\GlobalTemplate\get(), ILIAS\UI\Implementation\Component\Input\ViewControl\getContent(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ getLMPage()

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

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

2257 : ilPageObject {
2258 $type = ($a_type == "mep")
2259 ? "mep"
2260 : "lm";
2261
2263 if (!ilPageObject::_exists($type, $a_id, $lang)) {
2264 $lang = "-";
2265 if ($this->lang != "-" && ilPageObject::_exists($type, $a_id, $this->ot->getDefaultLanguage())) {
2266 $lang = $this->ot->getDefaultLanguage();
2267 }
2268 }
2269
2270 switch ($type) {
2271 case "mep":
2272 return new ilMediaPoolPage($a_id, 0, $lang);
2273 default:
2274 return new ilLMPage($a_id, 0, $lang);
2275 }
2276 }
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...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.

References ilPageObject\_exists().

+ Here is the call graph for this function:

◆ getLMPageGUI()

ilLMPresentationGUI::getLMPageGUI ( int  $a_id)

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

2242 : ilLMPageGUI
2243 {
2244 $concrete_lang = $this->service->getPresentationStatus()->getConcreteLang();
2245 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
2246 return new ilLMPageGUI($a_id, 0, false, $this->lang, $concrete_lang);
2247 }
2248 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->ot->getDefaultLanguage())) {
2249 return new ilLMPageGUI($a_id, 0, false, $this->ot->getDefaultLanguage(), $concrete_lang);
2250 }
2251 return new ilLMPageGUI($a_id, 0, false, "", $concrete_lang);
2252 }
Extension of ilPageObjectGUI for learning modules.

References ilPageObject\_exists().

+ Here is the call graph for this function:

◆ getLMPresentationTitle()

ilLMPresentationGUI::getLMPresentationTitle ( )

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

748 : string
749 {
750 return $this->service->getPresentationStatus()->getLMPresentationTitle();
751 }

◆ getOfflineDirectory()

ilLMPresentationGUI::getOfflineDirectory ( )

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

2209 : string
2210 {
2212 }

◆ getPageContent()

ilLMPresentationGUI::getPageContent ( )
protected

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

1138 : string
1139 {
1140 $content_renderer = new ilLMContentRendererGUI(
1141 $this->service,
1142 $this,
1143 $this->lng,
1144 $this->ot,
1145 $this->ctrl,
1146 $this->access,
1147 $this->user,
1148 $this->help,
1149 $this->requested_obj_id
1150 );
1151
1152 return $content_renderer->render();
1153 }

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

+ Here is the call 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 196 of file class.ilLMPresentationGUI.php.

196 : array
197 {
198 return [
199 "showPrintView",
200 ];
201 }

◆ getService()

ilLMPresentationGUI::getService ( )

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

275 {
276 return $this->service;
277 }
ilLMPresentationService $service
Main service init and factory.

References $service.

◆ getSourcecodeDownloadLink()

ilLMPresentationGUI::getSourcecodeDownloadLink ( )

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

2200 : string
2201 {
2202 if (!$this->offlineMode()) {
2203 return $this->ctrl->getLinkTarget($this, "");
2204 } else {
2205 return "";
2206 }
2207 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getTracker()

ilLMPresentationGUI::getTracker ( )
protected

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

285 {
286 return $this->service->getTracker();
287 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

191 : array
192 {
193 return [];
194 }

◆ glossary()

ilLMPresentationGUI::glossary ( )

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

681 : string
682 {
683 $this->tpl = new ilGlobalTemplate("tpl.glossary_term_output.html", true, true, "components/ILIAS/LearningModule");
684 $this->renderPageTitle();
685
686 iljQueryUtil::initjQuery($this->tpl);
687 //iljQueryUtil::initjQueryUI($this->tpl);
689 ilAccordionGUI::addCss($this->tpl);
690
691 // set style sheets
692 $this->setContentStyles();
693 $this->setSystemStyle();
694
695 $this->ilGlossary();
696
697 $js = $this->global_screen->layout()->meta()->getJs();
698 foreach ($js->getItemsInOrderOfDelivery() as $item) {
699 $this->tpl->addJavaScript($item->getContent());
700 }
701
702 if (!$this->offlineMode()) {
703 $this->tpl->printToStdout();
704 } else {
705 return $this->tpl->printToString();
706 }
707
708 return "";
709 }
special template class to simplify handling of ITX/PEAR

References ilAccordionGUI\addCss(), ilAccordionGUI\addJavaScript(), and iljQueryUtil\initjQuery().

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

2223 : void {
2224 $directory = $this->getOfflineDirectory() . "/codefiles/" . $page_id . "/" . $paragraph_id;
2225 ilFileUtils::makeDirParents($directory);
2226 $file = $directory . "/" . $title;
2227 if (!($fp = fopen($file, "w+"))) {
2228 die("<strong>Error</strong>: Could not open \"" . $file . "\" for writing" .
2229 " in <strong>" . __FILE__ . "</strong> on line <strong>" . __LINE__ . "</strong><br />");
2230 }
2231 chmod($file, 0770);
2232 fwrite($fp, $text);
2233 fclose($fp);
2234 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
$text
Definition: xapiexit.php:21

◆ ilGlossary()

ilLMPresentationGUI::ilGlossary ( )

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

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

◆ ilJavaScript()

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

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

1329 : void {
1330 if ($a_inline != "") {
1331 $js_tpl = new ilTemplate($a_inline, true, false, $a_location);
1332 $js = $js_tpl->get();
1333 $this->tpl->setVariable("INLINE_JS", $js);
1334 }
1335 }

◆ ilLMMenu()

ilLMPresentationGUI::ilLMMenu ( )

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

753 : void
754 {
755 $this->renderTabs("content", $this->getCurrentPageId());
756 }
renderTabs(string $active_tab, int $current_page_id)

◆ ilLMNotes()

ilLMPresentationGUI::ilLMNotes ( )

output notes of page

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

939 : string
940 {
941 $ilAccess = $this->access;
943
944 // no notes in offline (export) mode
945 if ($this->offlineMode()) {
946 return "";
947 }
948
949 // now output comments
950
951 if ($ilSetting->get("disable_comments")) {
952 return "";
953 }
954 if (!$this->lm->publicNotes()) {
955 return "";
956 }
957
958 $next_class = $this->ctrl->getNextClass($this);
959
960 $pg_id = $this->getCurrentPageId();
961
962 if ($pg_id == 0) {
963 return "";
964 }
965 $notes_gui = $this->notes_gui->getCommentsGUI($this->lm->getId(), $this->getCurrentPageId(), "pg");
966 $notes_gui->setUseObjectTitleHeader(false);
967
968 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
969 $ilSetting->get("comments_del_tutor", '1')) {
970 $notes_gui->enablePublicNotesDeletion(true);
971 }
972
973 $this->ctrl->setParameter($this, "frame", $this->requested_frame);
974 $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
975
976 $notes_gui->enablePrivateNotes();
977 if ($this->lm->publicNotes()) {
978 $notes_gui->enablePublicNotes();
979 }
980
981 $callback = array($this, "observeNoteAction");
982 $notes_gui->addObserver($callback);
983
984 if ($next_class == "ilcommentgui") {
985 $html = $this->ctrl->forwardCommand($notes_gui);
986 } else {
987 $html = $notes_gui->getListHTML();
988 }
989 return $html;
990 }
ILIAS Notes GUIService $notes_gui

References $ilSetting, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ ilLMSubMenu()

ilLMPresentationGUI::ilLMSubMenu ( )

output learning module submenu

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

767 : void
768 {
770 if ($this->abstract) {
771 return;
772 }
773
774
775 $tpl_menu = new ilTemplate("tpl.lm_sub_menu.html", true, true, "components/ILIAS/LearningModule");
776
777 $pg_id = $this->getCurrentPageId();
778 if ($pg_id == 0) {
779 return;
780 }
781
782 // edit learning module
783 if (!$this->offlineMode()) {
784 if ($rbacsystem->checkAccess("write", $this->requested_ref_id)) {
785 $tpl_menu->setCurrentBlock("edit_page");
786 $page_id = $this->getCurrentPageId();
787 $tpl_menu->setVariable(
788 "EDIT_LINK",
789 ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
790 "&obj_id=" . $page_id . "&to_page=1"
791 );
792 $tpl_menu->setVariable("EDIT_TXT", $this->lng->txt("edit_page"));
793 $tpl_menu->parseCurrentBlock();
794 }
795
796 $page_id = $this->getCurrentPageId();
797
798 // permanent link
799 $this->tpl->setPermanentLink("pg", null, $page_id . "_" . $this->lm->getRefId());
800 }
801
802 $this->tpl->setVariable("SUBMENU", $tpl_menu->get());
803 }

References ilRbacSystem\checkAccess(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ ilLocator()

ilLMPresentationGUI::ilLocator ( )

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

992 : void
993 {
994 global $DIC;
995 $ltiview = $DIC["lti"];
996 $ilLocator = $this->locator;
997
998 if (empty($this->requested_obj_id)) {
999 $a_id = $this->lm_tree->getRootId();
1000 } else {
1002 }
1003
1004 if (!$this->lm->cleanFrames()) {
1005 $frame_param = $this->requested_frame;
1006 $frame_target = "";
1007 } elseif (!$this->offlineMode()) {
1008 $frame_param = "";
1009 $frame_target = ilFrameTargetInfo::_getFrame("MainContent");
1010 } else {
1011 $frame_param = "";
1012 $frame_target = "_top";
1013 }
1014
1015 if (!$this->offlineMode()) {
1016 // LTI
1017 if ($ltiview->isActive()) {
1018 // Do nothing, its complicated...
1019 } else {
1020 $ilLocator->addRepositoryItems();
1021 }
1022 } else {
1023 $ilLocator->setOffline(true);
1024 }
1025
1026 if ($this->lm_tree->isInTree($a_id)) {
1027 $path = $this->lm_tree->getPathFull($a_id);
1028
1029 foreach ($path as $key => $row) {
1030 if ($row["type"] != "pg") {
1031 if ($row["child"] != $this->lm_tree->getRootId()) {
1032 $ilLocator->addItem(
1035 $row["child"],
1037 $this->lm->isActiveNumbering(),
1038 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1039 false,
1040 0,
1041 $this->lang
1042 ),
1043 50,
1044 true
1045 ),
1046 $this->linker->getLink("layout", $row["child"], $frame_param, "StructureObject"),
1047 $frame_target
1048 );
1049 } else {
1050 $ilLocator->addItem(
1052 $this->linker->getLink("layout", 0, $frame_param),
1053 $frame_target,
1054 $this->requested_ref_id
1055 );
1056 }
1057 }
1058 }
1059 } else { // lonely page
1060 $ilLocator->addItem(
1061 $this->getLMPresentationTitle(),
1062 $this->linker->getLink("layout", 0, $this->requested_frame)
1063 );
1064
1065 $lm_obj = ilLMObjectFactory::getInstance($this->lm, $a_id);
1066
1067 $ilLocator->addItem(
1068 $lm_obj->getTitle(),
1069 $this->linker->getLink("layout", $a_id, $frame_param),
1070 $frame_target
1071 );
1072 }
1073
1074 $this->tpl->setLocator();
1075 }
static _getFrame(string $a_class)
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
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)
$path
Definition: ltiservices.php:30

References $DIC, $path, ilFrameTargetInfo\_getFrame(), ilStructureObject\_getPresentationTitle(), ilLMObject\CHAPTER_TITLE, ilLMObjectFactory\getInstance(), and ilStr\shortenTextExtended().

+ Here is the call graph for this function:

◆ ilMedia()

ilLMPresentationGUI::ilMedia ( )

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

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

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

+ Here is the call graph for this function:

◆ ilTOC()

ilLMPresentationGUI::ilTOC ( )

table of contents

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

741 {
742 $fac = new ilLMTOCExplorerGUIFactory();
743 $exp = $fac->getExplorer($this->service, "ilTOC");
744 $exp->handleCommand();
745 return $exp;
746 }
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...

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

1342 : void
1343 {
1344 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1345 }

References ILIAS\Repository\ctrl().

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

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initPrintViewSelectionForm()

ilLMPresentationGUI::initPrintViewSelectionForm ( )

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

1596 : void
1597 {
1598 $lng = $this->lng;
1599 $ilCtrl = $this->ctrl;
1600
1601 $this->form = new ilPropertyFormGUI();
1602 $this->form->setForceTopButtons(true);
1603
1604 // selection type
1605 $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1606 $radg->setValue("page");
1607 $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
1608 $radg->addOption($op1);
1609 $op2 = new ilRadioOption($lng->txt("cont_current_chapter"), "chapter");
1610 $radg->addOption($op2);
1611 $op3 = new ilRadioOption($lng->txt("cont_selected_pg_chap"), "selection");
1612 $radg->addOption($op3);
1613
1614 $nl = new ilNestedListInputGUI("", "obj_id");
1615 $this->nl = $nl;
1616 $op3->addSubItem($nl);
1617
1618 $this->form->addItem($radg);
1619
1620 $this->form->addCommandButton("showPrintView", $lng->txt("cont_show_print_view"));
1621 $this->form->setOpenTag(false);
1622 $this->form->setCloseTag(false);
1623
1624 $this->form->setTitle(" ");
1625 $this->form->setFormAction($ilCtrl->getFormAction($this));
1626 }
This class represents a (nested) list of checkboxes (could be extended for radio items,...
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
form(?array $class_path, string $cmd, string $submit_caption="")

References $lng, ILIAS\Repository\form(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ initScreenHead()

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

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

1357 : void {
1358 $ilAccess = $this->access;
1359 $ilLocator = $this->locator;
1360
1361 $this->renderPageTitle();
1362
1363 $this->tpl->loadStandardTemplate();
1364 $this->tpl->setTitle($this->getLMPresentationTitle());
1365 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
1366
1367 $this->renderTabs($a_active_tab, 0);
1368
1369 // Full locator, if read permission is given
1370 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1371 $this->ilLocator();
1372 } else {
1373 $ilLocator->addRepositoryItems();
1374 $this->tpl->setLocator();
1375 }
1376 }

◆ injectTemplate()

ilLMPresentationGUI::injectTemplate ( ilGlobalTemplateInterface  $tpl)

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

279 : void
280 {
281 $this->tpl = $tpl;
282 }

◆ layout()

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

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

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

◆ media()

ilLMPresentationGUI::media ( )

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

664 : string
665 {
666 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "components/ILIAS/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 }

◆ nop()

ilLMPresentationGUI::nop ( )

this dummy function is needed for offline package creation

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

436 : void
437 {
438 }

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

2300 : void {
2301 $note = $this->notes->getById($a_note_id);
2302 $text = $note->getText();
2303
2304 $notification = new ilLearningModuleNotification(
2307 $this->lm,
2308 $a_page_id,
2309 $text
2310 );
2311
2312 $notification->send();
2313 }
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 423 of file class.ilLMPresentationGUI.php.

423 : bool
424 {
425 return $this->offline;
426 }

◆ outputInfoScreen()

ilLMPresentationGUI::outputInfoScreen ( )

info screen

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

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

References $info, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ page()

ilLMPresentationGUI::page ( )

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

711 : string
712 {
713 $ilUser = $this->user;
714 $this->tpl = new ilGlobalTemplate("tpl.page_fullscreen.html", true, true, "components/ILIAS/LearningModule");
715 $GLOBALS["tpl"] = $this->tpl;
716 $this->renderPageTitle();
717
718 $this->setContentStyles();
719
720 // set style sheets
721 if (!$this->offlineMode()) {
722 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
723 } else {
724 $style_name = $ilUser->getPref("style") . ".css";
725 $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
726 }
727
728 $this->tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
729 if (!$this->offlineMode()) {
730 $this->tpl->printToStdout();
731 } else {
732 return $this->tpl->get();
733 }
734 return "";
735 }
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilLMPresentationGUI::redrawHeaderAction ( )

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

805 : void
806 {
807 echo $this->getHeaderAction(true);
808 exit;
809 }
exit

References exit.

◆ refreshToc()

ilLMPresentationGUI::refreshToc ( )

Refresh toc (called if questions have been answered correctly)

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

2281 : void
2282 {
2283 $exp = $this->ilTOC();
2284
2285 echo $exp->getHTML() .
2286 "<script>" . $exp->getOnLoadCode() . "</script>";
2287 exit;
2288 }

References exit.

◆ renderPageTitle()

ilLMPresentationGUI::renderPageTitle ( )
protected

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

2237 : void
2238 {
2239 $this->tpl->setHeaderPageTitle($this->getLMPresentationTitle());
2240 }

◆ renderRating()

ilLMPresentationGUI::renderRating ( )
protected

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

1155 : string
1156 {
1157 // rating
1158 $rating = "";
1159 if ($this->lm->hasRatingPages() && !$this->offlineMode()) {
1160 $rating_gui = new ilRatingGUI();
1161 $rating_gui->setObject($this->lm->getId(), "lm", $this->getCurrentPageId(), "lm");
1162 $rating_gui->setYourRatingText($this->lng->txt("lm_rate_page"));
1163
1164 $this->ctrl->setParameter($this, "pg_id", $this->getCurrentPageId());
1165 $this->tpl->addOnLoadCode("il.LearningModule.setRatingUrl('" .
1166 $this->ctrl->getLinkTarget($this, "updatePageRating", "", true, false) .
1167 "')");
1168 $this->ctrl->setParameter($this, "pg_id", "");
1169
1170 $rating = '<div id="ilrtrpg" style="text-align:right">' .
1171 $rating_gui->getHTML(true, true, "il.LearningModule.saveRating(%rating%);") .
1172 "</div>";
1173 }
1174 return $rating;
1175 }

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

+ Here is the call graph for this function:

◆ renderTabs()

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

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

2319 : void {
2320 $menu_editor = new ilLMMenuEditor();
2321 $menu_editor->setObjId($this->lm->getId());
2322
2323 $navigation_renderer = new ilLMMenuRendererGUI(
2324 $this->getService(),
2325 $this->tabs,
2326 $this->toolbar,
2328 $active_tab,
2329 $this->getExportFormat(),
2330 $this->export_all_languages,
2331 $this->lm,
2332 $this->offlineMode(),
2333 $menu_editor,
2334 $this->lang,
2335 $this->ctrl,
2336 $this->access,
2337 $this->user,
2338 $this->lng,
2339 $this->tpl,
2340 function ($additional_content) {
2341 $this->additional_content[] = $additional_content;
2342 }
2343 );
2344 $navigation_renderer->render();
2345 }
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...

◆ resume()

ilLMPresentationGUI::resume ( )
Exceptions
ilLMPresentationException

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

470 : void
471 {
472 $this->layout();
473 }

◆ saveFrameUrl()

ilLMPresentationGUI::saveFrameUrl ( )

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

653 : void
654 {
655 $store = new ilSessionIStorage("lm");
656 $store->set("cf_" . $this->lm->getId(), $this->requested_url);
657 }

◆ setContentStyles()

ilLMPresentationGUI::setContentStyles ( )
protected

Set content style.

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

1088 : void
1089 {
1090 // content style
1091 $this->content_style_gui->addCss(
1092 $this->tpl,
1093 $this->lm->getRefId()
1094 );
1095 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
1096 }

References ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ setHeader()

ilLMPresentationGUI::setHeader ( )

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

758 : void
759 {
760 $this->tpl->setTitle($this->getLMPresentationTitle());
761 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
762 }

References ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ setSystemStyle()

ilLMPresentationGUI::setSystemStyle ( )
protected

Set system style.

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

1101 : void
1102 {
1103 $this->tpl->addCss(ilUtil::getStyleSheetLocation());
1104 }

References ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ showInfoScreen()

ilLMPresentationGUI::showInfoScreen ( )

info screen call from inside learning module

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

1350 : void
1351 {
1352 $this->outputInfoScreen();
1353 }

◆ showMessageScreen()

ilLMPresentationGUI::showMessageScreen ( string  $a_content)

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

2165 : void {
2166 // content style
2167 $this->setContentStyles();
2168
2169 $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "components/ILIAS/LearningModule");
2170 $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
2171
2172 $this->tpl->setVariable("PAGE_CONTENT", $tpl->get());
2173 }

◆ showNavRestrictionDueToQuestions()

ilLMPresentationGUI::showNavRestrictionDueToQuestions ( )

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

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

2195 : void
2196 {
2197 $this->showMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
2198 }
showMessageScreen(string $a_content)

References ILIAS\Repository\lng().

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

2186 : void
2187 {
2188 $this->showMessageScreen($this->lng->txt("msg_no_page_access"));
2189 }

References ILIAS\Repository\lng().

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

2178 : void
2179 {
2180 $this->showMessageScreen($this->lng->txt("msg_page_no_public_access"));
2181 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showPrintView()

ilLMPresentationGUI::showPrintView ( )

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

1628 : void
1629 {
1630 $ilUser = $this->user;
1631 $lng = $this->lng;
1632 $ilCtrl = $this->ctrl;
1634 $header_page_content = "";
1635 $footer_page_content = "";
1636 $chapter_title = "";
1637 $did_chap_page_header = false;
1638
1639 $lom_paths = $this->lom_services->paths();
1640 $lom_data_helper = $this->lom_services->dataHelper();
1641 $lom_cp_helper = $this->lom_services->copyrightHelper();
1642 $lom_reader = $this->lom_services->read($this->lm->getId(), 0, $this->lm->getType());
1643
1644 if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1645 return;
1646 }
1647
1648 $this->renderPageTitle();
1649
1651 $lng->txt("back"),
1652 $ilCtrl->getLinkTarget($this, "layout")
1653 );
1654
1655 $c_obj_id = $this->getCurrentPageId();
1656 // set values according to selection
1657 $sel_type = $this->service->getRequest()->getSelectedType();
1658 $sel_obj_ids = $this->service->getRequest()->getSelectedObjIds();
1659 if ($sel_type == "page") {
1660 if (!in_array($c_obj_id, $sel_obj_ids)) {
1661 $sel_obj_ids[] = $c_obj_id;
1662 }
1663 }
1664 if ($sel_type == "chapter" && $c_obj_id > 0) {
1665 $path = $this->lm_tree->getPathFull($c_obj_id);
1666 $chap_id = $path[1]["child"];
1667 if ($chap_id > 0) {
1668 $sel_obj_ids[] = $chap_id;
1669 }
1670 }
1671
1672 $this->setContentStyles();
1673 $this->tpl->addCss(ilObjStyleSheet::getContentPrintStyle());
1674
1675 $tpl = new ilTemplate("tpl.lm_print_view.html", true, true, "components/ILIAS/LearningModule");
1676
1677 // set title header
1678 $this->tpl->setTitle($this->getLMPresentationTitle());
1679
1680 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1681
1682 $act_level = 99999;
1683 $activated = false;
1684
1685 $glossary_links = array();
1686 $output_header = false;
1687 $media_links = array();
1688 $last_page_title = "";
1689
1690 // get header and footer
1691 if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1692 if (ilLMObject::_exists($this->lm->getFooterPage())) {
1693 $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
1694 $page_object_gui->setStyleId(
1695 $this->content_style_domain->getEffectiveStyleId()
1696 );
1697
1698 // determine target frames for internal links
1699 $page_object_gui->setLinkFrame($this->requested_frame);
1700 $page_object_gui->setOutputMode("print");
1701 $page_object_gui->setPresentationTitle("");
1702 $page_object_gui->setFileDownloadLink("#");
1703 $page_object_gui->setFullscreenLink("#");
1704 $page_object_gui->setSourcecodeDownloadScript("#");
1705 $footer_page_content = $page_object_gui->showPage();
1706 }
1707 }
1708 if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1709 if (ilLMObject::_exists($this->lm->getHeaderPage())) {
1710 $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
1711 $page_object_gui->setStyleId(
1712 $this->content_style_domain->getEffectiveStyleId()
1713 );
1714
1715 // determine target frames for internal links
1716 $page_object_gui->setLinkFrame($this->requested_frame);
1717 $page_object_gui->setOutputMode("print");
1718 $page_object_gui->setPresentationTitle("");
1719 $page_object_gui->setFileDownloadLink("#");
1720 $page_object_gui->setFullscreenLink("#");
1721 $page_object_gui->setSourcecodeDownloadScript("#");
1722 $header_page_content = $page_object_gui->showPage();
1723 }
1724 }
1725
1726 // add free selected pages
1727 if (count($sel_obj_ids) > 0) {
1728 foreach ($sel_obj_ids as $k) {
1729 if ($k > 0 && !$this->lm_tree->isInTree($k)) {
1730 if (ilLMObject::_lookupType($k) == "pg") {
1731 $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
1732 }
1733 }
1734 }
1735 } else {
1736 $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_print_no_page_selected"), true);
1737 $ilCtrl->redirect($this, "showPrintViewSelection");
1738 }
1739
1740 foreach ($nodes as $node_key => $node) {
1741 // check page activation
1742 $active = ilLMPage::_lookupActive(
1743 $node["obj_id"],
1744 $this->lm->getType(),
1745 (bool) $this->lm_set->get("time_scheduled_page_activation")
1746 );
1747 if ($node["type"] == "pg" && !$active) {
1748 continue;
1749 }
1750
1751 // print all subchapters/subpages if higher chapter
1752 // has been selected
1753 if ($node["depth"] <= $act_level) {
1754 if (in_array($node["obj_id"], $sel_obj_ids)) {
1755 $act_level = $node["depth"];
1756 $activated = true;
1757 } else {
1758 $act_level = 99999;
1759 $activated = false;
1760 }
1761 }
1762 if ($this->lm->getRestrictForwardNavigation()) {
1763 if ($this->getTracker()->hasPredIncorrectAnswers($node["obj_id"])) {
1764 continue;
1765 }
1766 }
1767 if ($activated &&
1769 $this->lm->getRefId(),
1770 $this->lm->getId(),
1771 $node["obj_id"]
1772 )) {
1773 // output learning module header
1774 if ($node["type"] == "du") {
1775 $output_header = true;
1776 }
1777
1778 // output chapter title
1779 if ($node["type"] == "st") {
1780
1781 $chap = new ilStructureObject($this->lm, $node["obj_id"]);
1782 $tpl->setCurrentBlock("print_chapter");
1783
1784 $chapter_title = $chap->_getPresentationTitle(
1785 $node["obj_id"],
1787 $this->lm->isActiveNumbering(),
1788 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1789 false,
1790 0,
1791 $this->lang
1792 );
1794 "CHAP_TITLE",
1795 $chapter_title
1796 );
1797
1798 if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1799 if ($nodes[$node_key + 1]["type"] == "pg") {
1801 "CHAP_HEADER",
1802 $header_page_content
1803 );
1804 $did_chap_page_header = true;
1805 }
1806 }
1807
1809 $tpl->setCurrentBlock("print_block");
1811 }
1812
1813 // output page
1814 if ($node["type"] === "pg") {
1815
1816 $tpl->setCurrentBlock("print_item");
1817
1818 // get page
1819 $page_id = $node["obj_id"];
1820 $page_object_gui = $this->getLMPageGUI($page_id);
1821 $page_object = $page_object_gui->getPageObject();
1822 $page_object_gui->setStyleId(
1823 $this->content_style_domain->getEffectiveStyleId()
1824 );
1825
1826 // get lm page
1827 $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
1828 $lm_pg_obj->setLMId($this->lm->getId());
1829
1830 // determine target frames for internal links
1831 $page_object_gui->setLinkFrame($this->requested_frame);
1832 $page_object_gui->setOutputMode("print");
1833 $page_object_gui->setPresentationTitle("");
1834
1835 // if ($this->lm->getPageHeader() == ilLMObject::PAGE_TITLE || ($node["free"] ?? false) === true) {
1836 if (true) {
1838 $lm_pg_obj->getId(),
1839 $this->lm->getPageHeader(),
1840 $this->lm->isActiveNumbering(),
1841 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1842 false,
1843 0,
1844 $this->lang
1845 );
1846
1847 if ($this->lm->getPageHeader() === ilLMObject::CHAPTER_TITLE) {
1848 // remove the suffic (x/n)
1849 $page_title = trim(substr($page_title, 0, strrpos($page_title, " ")));
1850 }
1851
1852 // prevent page title after chapter title
1853 // that have the same content
1854 if ($this->lm->isActiveNumbering()) {
1855 $chapter_title = trim(substr(
1856 $chapter_title,
1857 strpos($chapter_title, " ")
1858 ));
1859 }
1860
1861 if ($page_title != $chapter_title && $page_title !== $last_page_title) {
1862 $page_object_gui->setPresentationTitle($page_title);
1863 }
1864 $last_page_title = $page_title;
1865 }
1866
1867 // handle header / footer
1868 $hcont = $header_page_content;
1869 $fcont = $footer_page_content;
1870
1871 if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1872 if ($did_chap_page_header) {
1873 $hcont = "";
1874 }
1875 if (($nodes[$node_key + 1]["type"] ?? "") == "pg" &&
1876 !($nodes[$node_key + 1]["depth"] <= $act_level
1877 && !in_array($nodes[$node_key + 1]["obj_id"], $sel_obj_ids))) {
1878 $fcont = "";
1879 }
1880 }
1881
1882 $page_object_gui->setFileDownloadLink("#");
1883 $page_object_gui->setFullscreenLink("#");
1884 $page_object_gui->setSourcecodeDownloadScript("#");
1885 $page_content = $page_object_gui->showPage();
1886 if ($this->lm->getPageHeader() != ilLMObject::PAGE_TITLE) {
1888 "CONTENT",
1889 $hcont . $page_content . $fcont
1890 );
1891 } else {
1893 "CONTENT",
1894 $hcont . $page_content . $fcont . "<br />"
1895 );
1896 }
1897 $chapter_title = "";
1899 $tpl->setCurrentBlock("print_block");
1901
1902 // get internal links
1903 $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]);
1904
1905 $got_mobs = false;
1906
1907 foreach ($int_links as $key => $link) {
1908 if ($link["type"] == "git" &&
1909 ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1910 $glossary_links[$key] = $link;
1911 }
1912 if ($link["type"] == "mob" &&
1913 ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1914 $got_mobs = true;
1915 $mob_links[$key] = $link;
1916 }
1917 }
1918
1919 // this is not cool because of performance reasons
1920 // unfortunately the int link table does not
1921 // store the target frame (we want to append all linked
1922 // images but not inline images (i.e. mobs with no target
1923 // frame))
1924 if ($got_mobs) {
1925 $page_object->buildDom();
1926 $links = $page_object->getInternalLinks();
1927 $tf = $link["TargetFrame"] ?? "";
1928 foreach ($links as $link) {
1929 if ($link["Type"] === "MediaObject"
1930 && $tf !== ""
1931 && $tf !== "None") {
1932 $media_links[] = $link;
1933 }
1934 }
1935 }
1936 }
1937 }
1938 }
1939
1940 $annex_cnt = 0;
1941 $annexes = array();
1942
1943 // glossary
1944 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) {
1945 // sort terms
1946 $terms = array();
1947
1948 foreach ($glossary_links as $key => $link) {
1949 $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]);
1950 $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term);
1951 }
1952 $terms = ilArrayUtil::sortArray($terms, "term", "asc");
1953 //ksort($terms);
1954
1955 foreach ($terms as $t) {
1956 $link = $t["link"];
1957 $key = $t["key"];
1958
1959 try {
1960 // output definition of term
1961 $page_gui = new ilGlossaryDefPageGUI($link["id"]);
1962 $page_gui->setTemplateOutput(false);
1963 $page_gui->setOutputMode("print");
1964
1965 $tpl->setCurrentBlock("definition");
1966 $page_gui->setFileDownloadLink("#");
1967 $page_gui->setFullscreenLink("#");
1968 $page_gui->setSourcecodeDownloadScript("#");
1969 $output = $page_gui->showPage();
1970 $tpl->setVariable("VAL_DEFINITION", $output);
1972
1973 // output term
1974 $tpl->setCurrentBlock("term");
1976 "VAL_TERM",
1977 $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])
1978 );
1980 } catch (Exception $e) {
1981
1982 }
1983 }
1984
1985 // output glossary header
1986 $annex_cnt++;
1987 $tpl->setCurrentBlock("glossary");
1988 $annex_title = $this->lng->txt("cont_annex") . " " .
1989 chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo");
1990 $tpl->setVariable("TXT_GLOSSARY", $annex_title);
1992
1993 $annexes[] = $annex_title;
1994 }
1995
1996 // referenced images
1997 if (count($media_links) > 0) {
1998 foreach ($media_links as $media) {
1999 if (substr($media["Target"], 0, 4) == "il__") {
2000 $arr = explode("_", $media["Target"]);
2001 $id = $arr[count($arr) - 1];
2002
2003 $med_obj = new ilObjMediaObject($id);
2004 $med_item = $med_obj->getMediaItem("Standard");
2005 if (is_object($med_item)) {
2006 if (is_int(strpos($med_item->getFormat(), "image"))) {
2007 $tpl->setCurrentBlock("ref_image");
2008
2009 // image source
2010 if ($med_item->getLocationType() == "LocalFile") {
2012 "IMG_SOURCE",
2013 ilFileUtils::getWebspaceDir("output") . "/mobs/mm_" . $id .
2014 "/" . $med_item->getLocation()
2015 );
2016 } else {
2018 "IMG_SOURCE",
2019 $med_item->getLocation()
2020 );
2021 }
2022
2023 if ($med_item->getCaption() != "") {
2024 $tpl->setVariable("IMG_TITLE", $med_item->getCaption());
2025 } else {
2026 $tpl->setVariable("IMG_TITLE", $med_obj->getTitle());
2027 }
2029 }
2030 }
2031 }
2032 }
2033
2034 // output glossary header
2035 $annex_cnt++;
2036 $tpl->setCurrentBlock("ref_images");
2037 $annex_title = $this->lng->txt("cont_annex") . " " .
2038 chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images");
2039 $tpl->setVariable("TXT_REF_IMAGES", $annex_title);
2041
2042 $annexes[] = $annex_title;
2043 }
2044
2045 // output learning module title and toc
2046 if ($output_header) {
2047 $tpl->setCurrentBlock("print_header");
2048 $tpl->setVariable("LM_TITLE", $this->getLMPresentationTitle());
2049 if ($this->lm->getDescription() != "none") {
2051 "LM_DESCRIPTION",
2052 $lom_reader->firstData($lom_paths->firstDescription())->value()
2053 );
2054 }
2056
2057 // output toc
2058 $nodes2 = $nodes;
2059 foreach ($nodes2 as $node2) {
2060 if ($node2["type"] == "st"
2062 $this->lm->getRefId(),
2063 $this->lm->getId(),
2064 $node2["obj_id"]
2065 )) {
2066 for ($j = 1; $j < $node2["depth"]; $j++) {
2067 $tpl->setCurrentBlock("indent");
2068 $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2070 }
2071 $tpl->setCurrentBlock("toc_entry");
2073 "TXT_TOC_TITLE",
2075 $node2["obj_id"],
2077 $this->lm->isActiveNumbering(),
2078 (bool) $this->lm_set->get("time_scheduled_page_activation"),
2079 false,
2080 0,
2081 $this->lang
2082 )
2083 );
2085 }
2086 }
2087
2088 // annexes
2089 foreach ($annexes as $annex) {
2090 $tpl->setCurrentBlock("indent");
2091 $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2093 $tpl->setCurrentBlock("toc_entry");
2094 $tpl->setVariable("TXT_TOC_TITLE", $annex);
2096 }
2097
2098 $tpl->setCurrentBlock("toc");
2099 $tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
2101
2102 $tpl->setCurrentBlock("print_start_block");
2104 }
2105
2106 // output author information
2107 $authors = $lom_data_helper->makePresentableAsList(
2108 ", ",
2109 ...$lom_reader->allData($lom_paths->authors())
2110 );
2111 if ($authors != "") {
2112 $this->lng->loadLanguageModule("meta");
2113 $tpl->setCurrentBlock("author");
2114 $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2115 $tpl->setVariable("LM_AUTHOR", $authors);
2117 }
2118
2119 // output copyright information
2120 if ($lom_cp_helper->hasPresetCopyright($lom_reader)) {
2121 $copyright = $this->ui->renderer()->render(
2122 $lom_cp_helper->readPresetCopyright($lom_reader)->presentAsUIComponents()
2123 );
2124 } else {
2125 $copyright = $lom_cp_helper->readCustomCopyright($lom_reader);
2126 }
2127 if ($copyright != "") {
2128 $this->lng->loadLanguageModule("meta");
2129 $tpl->setCurrentBlock("copyright");
2130 $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2131 $tpl->setVariable("LM_COPYRIGHT", $copyright);
2133 }
2134 $this->tpl->setContent($tpl->get());
2135 $this->tpl->addOnLoadCode("il.Util.print();");
2136 $this->tpl->printToStdout();
2137 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _lookGlossaryTerm(int $term_id)
get glossary term
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
static _lookupType(int $a_obj_id, int $a_lm_id=0)
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't have to be page title, it may be chapter title + page title or chapter tit...
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 _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBackTarget(string $a_title, string $a_target, string $a_frame="")
const IL_INST_ID
Definition: constants.php:40
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.

References Vendor\Package\$e, $id, $lng, $path, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_exists(), ilLMPageObject\_getPresentationTitle(), ilStructureObject\_getPresentationTitle(), ilInternalLink\_getTargetsOfSource(), ilGlossaryTerm\_lookGlossaryTerm(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilLMObject\CHAPTER_TITLE, ILIAS\UICore\GlobalTemplate\get(), ilObjStyleSheet\getContentPrintStyle(), ilUtil\getImagePath(), ilFileUtils\getWebspaceDir(), IL_INST_ID, ILIAS\Repository\lng(), ilLMObject\PAGE_TITLE, ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ilTabsGUI\setBackTarget(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), ilArrayUtil\sortArray(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ showPrintViewSelection()

ilLMPresentationGUI::showPrintViewSelection ( )

show selection screen for print view

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

1435 : void
1436 {
1437 $ilUser = $this->user;
1438 $lng = $this->lng;
1439
1440 if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1441 return;
1442 }
1443
1444 $disabled = false;
1445 $img_alt = "";
1446
1447 $tpl = new ilTemplate("tpl.lm_print_selection.html", true, true, "components/ILIAS/LearningModule");
1448
1449 $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
1450 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1451
1452 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1453 $nodes = $this->filterNonAccessibleNode($nodes);
1454
1456
1457 foreach ($nodes as $node) {
1458 $img_src = "";
1459 $disabled = false;
1460 $img_alt = "";
1461
1462 // check page activation
1463 $active = ilLMPage::_lookupActive(
1464 $node["obj_id"],
1465 $this->lm->getType(),
1466 (bool) $this->lm_set->get("time_scheduled_page_activation")
1467 );
1468
1469 if ($node["type"] == "pg" &&
1470 !$active) {
1471 continue;
1472 }
1473
1474 $text = "";
1475 $img_alt = "";
1476 $checked = false;
1477
1478 switch ($node["type"]) {
1479 // page
1480 case "pg":
1481 $text =
1483 $node["obj_id"],
1484 $this->lm->getPageHeader(),
1485 $this->lm->isActiveNumbering(),
1486 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1487 false,
1488 0,
1489 $this->lang
1490 );
1491
1492 $img_src = ilUtil::getImagePath("standard/icon_pg.svg");
1493 $img_alt = $lng->txt("icon") . " " . $lng->txt("pg");
1494 break;
1495
1496 // learning module
1497 case "du":
1498 $text = $this->getLMPresentationTitle();
1499 $img_src = ilUtil::getImagePath("standard/icon_lm.svg");
1500 $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm");
1501 break;
1502
1503 // chapter
1504 case "st":
1505 $text =
1507 $node["obj_id"],
1509 $this->lm->isActiveNumbering(),
1510 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1511 false,
1512 0,
1513 $this->lang
1514 );
1515 $img_src = ilUtil::getImagePath("standard/icon_st.svg");
1516 $img_alt = $lng->txt("icon") . " " . $lng->txt("st");
1517 break;
1518 }
1519
1521 $this->lm->getRefId(),
1522 $this->lm->getId(),
1523 $node["obj_id"]
1524 )) {
1525 $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1526 }
1527
1528 $this->nl->addListNode(
1529 $node["obj_id"],
1530 $text,
1531 $node["parent"],
1532 $checked,
1533 $disabled,
1534 $img_src,
1535 $img_alt
1536 );
1537 }
1538
1539 // check for free page
1540 if ($this->requested_obj_id > 0 && !$this->lm_tree->isInTree($this->requested_obj_id)) {
1541 $text =
1543 $this->requested_obj_id,
1544 $this->lm->getPageHeader(),
1545 $this->lm->isActiveNumbering(),
1546 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1547 false,
1548 0,
1549 $this->lang
1550 );
1551
1552 $img_src = ilUtil::getImagePath("standard/icon_pg.svg");
1554
1555 $checked = true;
1556
1557 $this->nl->addListNode(
1558 $id,
1559 $text,
1560 0,
1561 $checked,
1562 $disabled,
1563 $img_src,
1564 $img_alt
1565 );
1566 }
1567
1568 $f = $this->form->getHTMLAsync();
1569
1570 $tpl->setVariable("ITEM_SELECTION", $f);
1571
1572 $modal = $this->ui->factory()->modal()->roundtrip(
1573 $this->lng->txt("cont_print_view"),
1574 $this->ui->factory()->legacy()->content($tpl->get())
1575 );
1576 echo $this->ui->renderer()->render($modal);
1577 exit();
1578 }

References Vendor\Package\$f, $id, $lng, $text, ilObjContentObject\_checkPreconditionsOfPage(), ilLMPageObject\_getPresentationTitle(), ilStructureObject\_getPresentationTitle(), ilPageObject\_lookupActive(), ilLMObject\CHAPTER_TITLE, ILIAS\Repository\ctrl(), exit, ILIAS\Repository\form(), ILIAS\UICore\GlobalTemplate\get(), ilUtil\getImagePath(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setVariable(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ updatePageRating()

ilLMPresentationGUI::updatePageRating ( )

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

1177 : void
1178 {
1179 $ilUser = $this->user;
1180 $pg_id = $this->service->getRequest()->getPgId();
1181 if (!$this->ctrl->isAsynch() || !$pg_id) {
1182 exit();
1183 }
1184
1185 $rating = $this->service->getRequest()->getRating();
1186 if ($rating) {
1188 $this->lm->getId(),
1189 "lm",
1190 $pg_id,
1191 "lm",
1192 $ilUser->getId(),
1193 $rating
1194 );
1195 } else {
1197 $this->lm->getId(),
1198 "lm",
1199 $pg_id,
1200 "lm",
1201 $ilUser->getId()
1202 );
1203 }
1204
1205 $rating = new ilRatingGUI();
1206 $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm");
1207 $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
1208
1209 echo $rating->getHTML(true, true, "il.LearningModule.saveRating(%rating%);");
1210
1211 echo $this->tpl->getOnLoadCodeForAsynch();
1212 exit();
1213 }
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.

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

+ Here is the call graph for this function:

Field Documentation

◆ $abstract

bool ilLMPresentationGUI::$abstract = false
protected

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

◆ $access

ilAccessHandler ilLMPresentationGUI::$access
protected

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

◆ $additional_content

array ilLMPresentationGUI::$additional_content = []
protected

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

◆ $chapter_has_no_active_page

bool ilLMPresentationGUI::$chapter_has_no_active_page = false

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

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilLMPresentationGUI::$content_style_domain
protected

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

◆ $content_style_gui

ILIAS Style Content GUIService ilLMPresentationGUI::$content_style_gui
protected

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

◆ $cs

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

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

◆ $ctrl

ilCtrl ilLMPresentationGUI::$ctrl
protected

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

◆ $current_page_id

int ilLMPresentationGUI::$current_page_id = 0
protected

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

◆ $deactivated_page

bool ilLMPresentationGUI::$deactivated_page = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilLMPresentationGUI::$dom_util
protected

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

◆ $embed_mode

bool ilLMPresentationGUI::$embed_mode = false
protected

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

Referenced by __construct().

◆ $export_all_languages

bool ilLMPresentationGUI::$export_all_languages = false
protected

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

◆ $export_format

string ilLMPresentationGUI::$export_format
protected

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

◆ $fill_on_load_code

bool ilLMPresentationGUI::$fill_on_load_code
protected

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

◆ $focus_id

int ilLMPresentationGUI::$focus_id = 0
protected

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

◆ $form

ilPropertyFormGUI ilLMPresentationGUI::$form
protected

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

◆ $frames

array ilLMPresentationGUI::$frames
protected

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

◆ $global_screen

ILIAS GlobalScreen Services ilLMPresentationGUI::$global_screen
protected

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

◆ $help

ilHelpGUI ilLMPresentationGUI::$help
protected

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

◆ $lang

string ilLMPresentationGUI::$lang

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

◆ $layout_doc

DOMDocument ilLMPresentationGUI::$layout_doc

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

◆ $linker

ilLMPresentationLinker ilLMPresentationGUI::$linker
protected

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

◆ $lm

ilObjLearningModule ilLMPresentationGUI::$lm
protected

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

◆ $lm_gui

ilObjLearningModuleGUI ilLMPresentationGUI::$lm_gui
protected

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

◆ $lm_set

ilSetting ilLMPresentationGUI::$lm_set
protected

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

◆ $lm_tree

ilLMTree ilLMPresentationGUI::$lm_tree
protected

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

◆ $lng

ilLanguage ilLMPresentationGUI::$lng

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

Referenced by __construct().

◆ $locator

ilLocatorGUI ilLMPresentationGUI::$locator
protected

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

◆ $lom_services

LOMServices ilLMPresentationGUI::$lom_services
protected

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

◆ $nav_history

ilNavigationHistory ilLMPresentationGUI::$nav_history
protected

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

◆ $nl

ilNestedListInputGUI ilLMPresentationGUI::$nl
protected

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

◆ $notes

ILIAS Notes DomainService ilLMPresentationGUI::$notes
protected

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

◆ $notes_gui

ILIAS Notes GUIService ilLMPresentationGUI::$notes_gui
protected

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

◆ $offline

bool ilLMPresentationGUI::$offline

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

◆ $offline_directory

string ilLMPresentationGUI::$offline_directory

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

◆ $ot

Translations ilLMPresentationGUI::$ot
protected

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

◆ $rbacsystem

ilRbacSystem ilLMPresentationGUI::$rbacsystem
protected

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

Referenced by __construct().

◆ $reading_time_manager

ILIAS LearningModule ReadingTime ReadingTimeManager ilLMPresentationGUI::$reading_time_manager
protected

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

◆ $requested_back_pg

string ilLMPresentationGUI::$requested_back_pg
protected

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

◆ $requested_cmd

string ilLMPresentationGUI::$requested_cmd = ""
protected

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

◆ $requested_focus_return

string ilLMPresentationGUI::$requested_focus_return
protected

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

◆ $requested_frame

string ilLMPresentationGUI::$requested_frame
protected

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

◆ $requested_mob_id

int ilLMPresentationGUI::$requested_mob_id = 0
protected

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

◆ $requested_notification_switch

int ilLMPresentationGUI::$requested_notification_switch = 0
protected

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

◆ $requested_obj_id

int ilLMPresentationGUI::$requested_obj_id
protected

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

Referenced by __construct().

◆ $requested_obj_type

string ilLMPresentationGUI::$requested_obj_type
protected

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

◆ $requested_pg_id

int ilLMPresentationGUI::$requested_pg_id = 0
protected

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

◆ $requested_pg_type

string ilLMPresentationGUI::$requested_pg_type = ""
protected

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

◆ $requested_ref_id

int ilLMPresentationGUI::$requested_ref_id
protected

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

◆ $requested_search_string

string ilLMPresentationGUI::$requested_search_string
protected

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

◆ $requested_transl

string ilLMPresentationGUI::$requested_transl
protected

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

◆ $requested_type

string ilLMPresentationGUI::$requested_type
protected

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

◆ $requested_url

string ilLMPresentationGUI::$requested_url
protected

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

◆ $service

ilLMPresentationService ilLMPresentationGUI::$service
protected

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

◆ $settings

ilSetting ilLMPresentationGUI::$settings
protected

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

◆ $tabs

ilTabsGUI ilLMPresentationGUI::$tabs
protected

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

◆ $toolbar

ilToolbarGUI ilLMPresentationGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLMPresentationGUI::$tpl

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

◆ $tracker

ilLMTracker ilLMPresentationGUI::$tracker
protected

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

◆ $tree

ilTree ilLMPresentationGUI::$tree
protected

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

◆ $ui

ILIAS DI UIServices ilLMPresentationGUI::$ui
protected

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

◆ $user

ilObjUser ilLMPresentationGUI::$user
protected

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

◆ $xsl

ILIAS COPage Xsl XslManager ilLMPresentationGUI::$xsl
protected

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


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