ILIAS  release_8 Revision v8.24
ilLMPresentationGUI Class Reference

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

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

Public Member Functions

 __construct (string $a_export_format="", bool $a_all_languages=false, string $a_export_dir="", bool $claim_repo_context=true, array $query_params=null, bool $embed_mode=false)
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 
 initByRequest (?array $query_params=null, bool $embed_mode=false)
 Init services and this class by request params. More...
 
 getService ()
 
 injectTemplate (ilGlobalTemplateInterface $tpl)
 
 executeCommand ()
 
 offlineMode ()
 checks whether offline content generation is activated More...
 
 getExportFormat ()
 
 nop ()
 this dummy function is needed for offline package creation More...
 
 attrib2arr (?array $a_attributes)
 
 getCurrentFrameSet ()
 get frames of current frame set More...
 
 determineLayout ()
 Determine layout. More...
 
 resume ()
 
 layout (string $a_xml="main.xml", bool $doShow=true)
 
 saveFrameUrl ()
 
 fullscreen ()
 
 media ()
 
 glossary ()
 
 page ()
 
 ilTOC ()
 table of contents More...
 
 getLMPresentationTitle ()
 
 ilLMMenu ()
 
 setHeader ()
 
 ilLMSubMenu ()
 output learning module submenu More...
 
 redrawHeaderAction ()
 
 addHeaderAction ()
 
 getHeaderAction (bool $a_redraw=false)
 
 ilLMNotes ()
 output notes of page More...
 
 ilLocator ()
 
 getCurrentPageId ()
 Get the current page id. More...
 
 getContent (bool $skip_nav=false)
 
 updatePageRating ()
 
 basicPageGuiInit (\ilPageObjectGUI $a_page_gui)
 
 ilGlossary ()
 
 ilMedia ()
 
 ilJavaScript (string $a_inline="", string $a_file="", string $a_location="")
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 showInfoScreen ()
 info screen call from inside learning module More...
 
 outputInfoScreen ()
 info screen More...
 
 showPrintViewSelection ()
 show selection screen for print view More...
 
 initPrintViewSelectionForm ()
 
 showPrintView ()
 
 downloadFile ()
 download file of file lists More...
 
 showDownloadList ()
 show download list More...
 
 downloadExportFile ()
 send download file (xml/html) More...
 
 getFocusLink (int $a_ref_id, int $a_obj_id, int $a_return_ref_id)
 Get focused link (used in learning objectives courses) More...
 
 showMessageScreen (string $a_content)
 
 showNoPublicAccess ()
 Show info message, if page is not accessible in public area. More...
 
 showNoPageAccess ()
 Show info message, if page is not accessible in public area. More...
 
 showNavRestrictionDueToQuestions ()
 Show message if navigation to page is not allowed due to unanswered questions. More...
 
 getSourcecodeDownloadLink ()
 
 getOfflineDirectory ()
 
 handleCodeParagraph (int $page_id, int $paragraph_id, string $title, string $text)
 store paragraph into file directory files/codefile_$pg_id_$paragraph_id/downloadtitle More...
 
 getLMPageGUI (int $a_id)
 
 getLMPage (int $a_id, string $a_type="")
 
 refreshToc ()
 Refresh toc (called if questions have been answered correctly) More...
 
 observeNoteAction (int $a_lm_id, int $a_page_id, string $a_type, string $a_action, int $a_note_id)
 Generate new ilNote and send Notifications to the users informing that there are new comments in the LM. More...
 
 getHTML (array $pars)
 Get HTML (called by kiosk mode through ilCtrl) More...
 
 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
 
php4DOMDocument $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 GlobalScreen Services $global_screen
 
ILIAS Notes DomainService $notes
 
ILIAS LearningModule ReadingTime ReadingTimeManager $reading_time_manager
 
string $requested_url
 
string $requested_type
 
ilLMTracker $tracker
 
ilTabsGUI $tabs
 
ilNestedListInputGUI $nl
 
ilSetting $lm_set
 
ilObjLearningModuleGUI $lm_gui
 
bool $fill_on_load_code
 
ilLMTree $lm_tree
 
array $frames
 
string $export_format
 
ilPropertyFormGUI $form
 
ilObjUser $user
 
ilRbacSystem $rbacsystem
 
ilCtrl $ctrl
 
ilNavigationHistory $nav_history
 
ilAccessHandler $access
 
ilSetting $settings
 
ilLocatorGUI $locator
 
ilTree $tree
 
ilHelpGUI $help
 
ilObjLearningModule $lm
 
bool $embed_mode = false
 
int $current_page_id = 0
 
int $focus_id = 0
 
bool $export_all_languages = false
 
string $requested_back_pg
 
string $requested_search_string
 
string $requested_focus_return
 
int $requested_ref_id
 
int $requested_obj_id
 
string $requested_obj_type
 
string $requested_transl
 
string $requested_frame
 
ilLMPresentationLinker $linker
 
ilLMPresentationService $service
 
ILIAS DI UIServices $ui
 
ilToolbarGUI $toolbar
 
array $additional_content = []
 
string $requested_cmd = ""
 
int $requested_pg_id = 0
 
string $requested_pg_type = ""
 
int $requested_mob_id = 0
 
int $requested_notification_switch = 0
 
bool $abstract = false
 
ilObjectTranslation $ot
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Service $cs = null
 

Detailed Description

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

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

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

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

820 : void
821 {
822 //$this->tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
823 $this->tpl->setHeaderActionMenu($this->getHeaderAction());
824 }
getHeaderAction(bool $a_redraw=false)

◆ addResourceFiles()

ilLMPresentationGUI::addResourceFiles ( )
protected

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

618 : void
619 {
620 iljQueryUtil::initjQuery($this->tpl);
621 iljQueryUtil::initjQueryUI($this->tpl);
622 ilUIFramework::init($this->tpl);
623
624 if (!$this->offlineMode()) {
627
628 $this->tpl->addJavaScript("./Modules/LearningModule/js/LearningModule.js");
629 $close_call = "il.LearningModule.setCloseHTML('" . ilGlyphGUI::get(ilGlyphGUI::CLOSE) . "');";
630 $this->tpl->addOnLoadCode($close_call);
631
632 //$store->set("cf_".$this->lm->getId());
633
634 // handle initial content
635 if ($this->requested_frame == "") {
636 $store = new ilSessionIStorage("lm");
637 $last_frame_url = $store->get("cf_" . $this->lm->getId());
638 if ($last_frame_url != "") {
639 $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
640 }
641
642 $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" .
643 $this->ctrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');
644 il.LearningModule.openInitFrames();
645 ");
646
647 $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" .
648 $this->ctrl->getLinkTarget($this, "refreshToc", "", false, false) . "');
649 ");
650 }
651
652 // from main menu
653 // $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
654 $this->tpl->addJavaScript("./Services/Navigation/js/ServiceNavigation.js");
655 ilYuiUtil::initConnection($this->tpl);
656 }
657 }
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static addCss()
Add required css.
static get(string $a_glyph, string $a_text="")
offlineMode()
checks whether offline content generation is activated
Session based immediate storage.
static init(ilGlobalTemplateInterface $template=null)
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$store
Definition: metadata.php:107

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

+ Here is the call graph for this function:

◆ attrib2arr()

ilLMPresentationGUI::attrib2arr ( ?array  $a_attributes)

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

429 : array
430 {
431 $attr = array();
432 if (!is_array($a_attributes)) {
433 return $attr;
434 }
435 foreach ($a_attributes as $attribute) {
436 $attr[$attribute->name()] = $attribute->value();
437 }
438 return $attr;
439 }

◆ basicPageGuiInit()

ilLMPresentationGUI::basicPageGuiInit ( \ilPageObjectGUI  $a_page_gui)

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

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

452 : string
453 {
454 return "standard";
455 }

◆ downloadExportFile()

ilLMPresentationGUI::downloadExportFile ( )

send download file (xml/html)

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

2250 : void
2251 {
2252 if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2253 return;
2254 }
2255
2257 $base_type = explode("_", $type);
2258 $base_type = $base_type[0];
2259 $file = $this->lm->getPublicExportFile($base_type);
2260 if ($this->lm->getPublicExportFile($base_type) != "") {
2261 $dir = $this->lm->getExportDirectory($type);
2262 if (is_file($dir . "/" . $file)) {
2263 ilFileDelivery::deliverFileLegacy($dir . "/" . $file, $file);
2264 exit;
2265 }
2266 }
2267 }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
exit
Definition: login.php:28
$type

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

+ Here is the call graph for this function:

◆ downloadFile()

ilLMPresentationGUI::downloadFile ( )

download file of file lists

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

2203 : void
2204 {
2205 $page_gui = $this->getLMPageGUI($this->getCurrentPageId());
2206 $page_gui->downloadFile();
2207 }

◆ executeCommand()

ilLMPresentationGUI::executeCommand ( )
Exceptions
ilCtrlException
ilLMPresentationException
ilPermissionException

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

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

References $ilUser, $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 1620 of file class.ilLMPresentationGUI.php.

1622 : array {
1623 $tracker = $this->getTracker();
1624 // if navigation is restricted based on correct answered questions
1625 // check if we have preceeding pages including unsanswered/incorrect answered questions
1626 if (!$this->offlineMode()) {
1627 if ($this->lm->getRestrictForwardNavigation()) {
1628 $nodes = array_filter($nodes, function ($node) use ($tracker) {
1629 return !$tracker->hasPredIncorrectAnswers($node["child"]);
1630 });
1631 }
1632 }
1633 return $nodes;
1634 }
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 665 of file class.ilLMPresentationGUI.php.

665 : string
666 {
667 return $this->media();
668 }

◆ getContent()

ilLMPresentationGUI::getContent ( bool  $skip_nav = false)

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

1117 : string {
1118 $this->fill_on_load_code = true;
1119 $this->setContentStyles();
1120
1121 $tpl = new ilTemplate("tpl.lm_content.html", true, true, "Modules/LearningModule/Presentation");
1122
1123 $navigation_renderer = new ilLMNavigationRendererGUI(
1124 $this->service,
1125 $this,
1126 $this->lng,
1127 $this->user,
1128 $this->tpl,
1129 $this->requested_obj_id,
1130 $this->requested_back_pg,
1131 $this->requested_frame
1132 );
1133
1134 if (!$skip_nav) {
1135 $tpl->setVariable("TOP_NAVIGATION", $navigation_renderer->renderTop());
1136 $tpl->setVariable("BOTTOM_NAVIGATION", $navigation_renderer->renderBottom());
1137 }
1138 $tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
1139 $tpl->setVariable("RATING", $this->renderRating());
1140
1141 return $tpl->get();
1142 }
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 444 of file class.ilLMPresentationGUI.php.

444 : array
445 {
446 return $this->frames;
447 }

◆ getCurrentPageId()

ilLMPresentationGUI::getCurrentPageId ( )

Get the current page id.

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

1089 : ?int
1090 {
1091 return $this->service->getNavigationStatus()->getCurrentPage();
1092 }

◆ getExportFormat()

ilLMPresentationGUI::getExportFormat ( )

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

417 : string
418 {
420 }

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

2279 : string {
2280 return "ilias.php?baseClass=ilLMPresentationGUI&ref_id=" . $a_ref_id . "&obj_id=" . $a_obj_id . "&focus_id=" .
2281 $a_obj_id . "&focus_return=" . $a_return_ref_id;
2282 }

◆ getHeaderAction()

ilLMPresentationGUI::getHeaderAction ( bool  $a_redraw = false)

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

828 : string {
829 if ($this->offline) {
830 return "";
831 }
832 $ilAccess = $this->access;
835
836 $lm_id = $this->lm->getId();
837 $pg_id = $this->getCurrentPageId();
838
839 $this->lng->loadLanguageModule("content");
840
841 $dispatcher = new ilCommonActionDispatcherGUI(
843 $ilAccess,
844 $this->lm->getType(),
845 $this->lm->getRefId(),
846 $this->lm->getId()
847 );
848 $dispatcher->setSubObject("pg", $this->getCurrentPageId());
849
850 $this->ctrl->setParameter($this, "embed_mode", (int) $this->embed_mode);
851 $this->ctrl->setParameterByClass("ilnotegui", "embed_mode", (int) $this->embed_mode);
852 $this->ctrl->setParameterByClass("iltagginggui", "embed_mode", (int) $this->embed_mode);
854 $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
855 "",
856 $this->ctrl->getLinkTargetByClass(
857 array("ilcommonactiondispatchergui", "iltagginggui"),
858 "",
859 "",
860 true,
861 false
862 ),
863 $this->tpl
864 );
865
866 $lg = $dispatcher->initHeaderAction();
867 if (!$ilSetting->get("disable_notes")) {
868 $lg->enableNotes(true);
869 if (!$this->embed_mode) {
870 $lg->enableComments($this->lm->publicNotes(), false);
871 }
872 }
873
874 if ($this->lm->hasRating() && !$this->offlineMode()) {
875 $lg->enableRating(
876 true,
877 $this->lng->txt("lm_rating"),
878 false,
879 array("ilcommonactiondispatchergui", "ilratinggui"),
880 true
881 );
882 }
883
884 // notification
885 if ($this->user->getId() != ANONYMOUS_USER_ID && !$this->embed_mode) {
886 if (ilNotification::hasNotification(ilNotification::TYPE_LM, $this->user->getId(), $lm_id)) {
887 $this->ctrl->setParameter($this, "ntf", 1);
888 if (ilNotification::hasOptOut($lm_id)) {
889 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_lm");
890 }
891
892 $lg->addHeaderIcon(
893 "not_icon",
894 ilUtil::getImagePath("notification_on.svg"),
895 $this->lng->txt("cont_notification_activated")
896 );
897 } else {
898 $this->ctrl->setParameter($this, "ntf", 2);
899 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_lm");
900
902 $this->ctrl->setParameter($this, "ntf", 3);
903 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_deactivate_page");
904
905 $lg->addHeaderIcon(
906 "not_icon",
907 ilUtil::getImagePath("notification_on.svg"),
908 $this->lng->txt("cont_page_notification_activated")
909 );
910 } else {
911 $this->ctrl->setParameter($this, "ntf", 4);
912 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "cont_notification_activate_page");
913
914 $lg->addHeaderIcon(
915 "not_icon",
916 ilUtil::getImagePath("notification_off.svg"),
917 $this->lng->txt("cont_notification_deactivated")
918 );
919 }
920 }
921 $this->ctrl->setParameter($this, "ntf", "");
922 }
923
924 if (!$this->offline) {
925 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
926 if ($this->getCurrentPageId() <= 0) {
927 $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
928 } else {
929 $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
930 "&obj_id=" . $this->getCurrentPageId() . "&to_page=1";
931 }
932 $lg->addCustomCommand($link, "edit_page");
933 }
934 }
935
936 if (!$a_redraw) {
937 return $lg->getHeaderAction($this->tpl);
938 } else {
939 // we need to add onload code manually (rating, comments, etc.)
940 return $lg->getHeaderAction() .
942 }
943 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
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 $img, 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:17

◆ getHTML()

ilLMPresentationGUI::getHTML ( array  $pars)

Get HTML (called by kiosk mode through ilCtrl)

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

2471 : string
2472 {
2473 $this->addResourceFiles();
2474 switch ($pars["cmd"]) {
2475 case "layout":
2476 $tpl = new ilTemplate("tpl.embedded_view.html", true, true, "Modules/LearningModule");
2477 $tpl->setVariable("HEAD_ACTION", $this->getHeaderAction());
2478 $tpl->setVariable("PAGE_RATING", $this->renderRating());
2479 $tpl->setVariable("PAGE", $this->getContent(true));
2480 $tpl->setVariable("COMMENTS", $this->ilLMNotes());
2481 return $tpl->get();
2482 }
2483 return "";
2484 }
ilLMNotes()
output notes of page
getContent(bool $skip_nav=false)

References $tpl, ILIAS\UI\Implementation\Component\Input\ViewControl\getContent(), and ilGlobalTemplateInterface\setVariable().

+ Here is the call graph for this function:

◆ getLMPage()

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

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

2378 : ilPageObject {
2379 $type = ($a_type == "mep")
2380 ? "mep"
2381 : "lm";
2382
2384 if (!ilPageObject::_exists($type, $a_id, $lang)) {
2385 $lang = "-";
2386 if ($this->lang != "-" && ilPageObject::_exists($type, $a_id, $this->ot->getFallbackLanguage())) {
2387 $lang = $this->ot->getFallbackLanguage();
2388 }
2389 }
2390
2391 switch ($type) {
2392 case "mep":
2393 return new ilMediaPoolPage($a_id, 0, $lang);
2394 default:
2395 return new ilLMPage($a_id, 0, $lang);
2396 }
2397 }
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 $lang, $type, and ilPageObject\_exists().

+ Here is the call graph for this function:

◆ getLMPageGUI()

ilLMPresentationGUI::getLMPageGUI ( int  $a_id)

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

2363 : ilLMPageGUI
2364 {
2365 $concrete_lang = $this->service->getPresentationStatus()->getConcreteLang();
2366 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
2367 return new ilLMPageGUI($a_id, 0, false, $this->lang, $concrete_lang);
2368 }
2369 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->ot->getFallbackLanguage())) {
2370 return new ilLMPageGUI($a_id, 0, false, $this->ot->getFallbackLanguage(), $concrete_lang);
2371 }
2372 return new ilLMPageGUI($a_id, 0, false, "", $concrete_lang);
2373 }
Extension of ilPageObjectGUI for learning modules.

References ilPageObject\_exists().

+ Here is the call graph for this function:

◆ getLMPresentationTitle()

ilLMPresentationGUI::getLMPresentationTitle ( )

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

755 : string
756 {
757 return $this->service->getPresentationStatus()->getLMPresentationTitle();
758 }

◆ getOfflineDirectory()

ilLMPresentationGUI::getOfflineDirectory ( )

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

2330 : string
2331 {
2333 }

◆ getPageContent()

ilLMPresentationGUI::getPageContent ( )
protected

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

1144 : string
1145 {
1146 $content_renderer = new ilLMContentRendererGUI(
1147 $this->service,
1148 $this,
1149 $this->lng,
1150 $this->ctrl,
1151 $this->access,
1152 $this->user,
1153 $this->help,
1154 $this->requested_obj_id
1155 );
1156
1157 return $content_renderer->render();
1158 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

185 : array
186 {
187 return [
188 "showPrintView",
189 ];
190 }

◆ getService()

ilLMPresentationGUI::getService ( )

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

264 {
265 return $this->service;
266 }
ilLMPresentationService $service
Main service init and factory.

References $service.

◆ getSourcecodeDownloadLink()

ilLMPresentationGUI::getSourcecodeDownloadLink ( )

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

2321 : string
2322 {
2323 if (!$this->offlineMode()) {
2324 return $this->ctrl->getLinkTarget($this, "");
2325 } else {
2326 return "";
2327 }
2328 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getTracker()

ilLMPresentationGUI::getTracker ( )
protected

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

274 {
275 return $this->service->getTracker();
276 }
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 180 of file class.ilLMPresentationGUI.php.

180 : array
181 {
182 return [];
183 }

◆ glossary()

ilLMPresentationGUI::glossary ( )

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

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

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

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

2344 : void {
2345 $directory = $this->getOfflineDirectory() . "/codefiles/" . $page_id . "/" . $paragraph_id;
2346 ilFileUtils::makeDirParents($directory);
2347 $file = $directory . "/" . $title;
2348 if (!($fp = fopen($file, "w+"))) {
2349 die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2350 " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2351 }
2352 chmod($file, 0770);
2353 fwrite($fp, $text);
2354 fclose($fp);
2355 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.

◆ ilGlossary()

ilLMPresentationGUI::ilGlossary ( )

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

1248 : void
1249 {
1250 $ilCtrl = $this->ctrl;
1251
1252 $term_gui = new ilGlossaryTermGUI($this->requested_obj_id);
1253
1254 // content style
1255 $this->setContentStyles();
1256
1257 $term_gui->setPageLinker($this->linker);
1258
1259 $term_gui->setOfflineDirectory($this->getOfflineDirectory());
1260 if (!$this->offlineMode()) {
1261 $ilCtrl->setParameter($this, "pg_type", "glo");
1262 }
1263 $term_gui->output($this->offlineMode(), $this->tpl);
1264
1265 if (!$this->offlineMode()) {
1266 $ilCtrl->setParameter($this, "pg_type", "");
1267 }
1268 }
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 1336 of file class.ilLMPresentationGUI.php.

1340 : void {
1341 if ($a_inline != "") {
1342 $js_tpl = new ilTemplate($a_inline, true, false, $a_location);
1343 $js = $js_tpl->get();
1344 $this->tpl->setVariable("INLINE_JS", $js);
1345 }
1346 }

◆ ilLMMenu()

ilLMPresentationGUI::ilLMMenu ( )

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

760 : void
761 {
762 $this->renderTabs("content", $this->getCurrentPageId());
763 }
renderTabs(string $active_tab, int $current_page_id)

◆ ilLMNotes()

ilLMPresentationGUI::ilLMNotes ( )

output notes of page

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

948 : string
949 {
950 $ilAccess = $this->access;
952
953 // no notes in offline (export) mode
954 if ($this->offlineMode()) {
955 return "";
956 }
957
958 // now output comments
959
960 if ($ilSetting->get("disable_comments")) {
961 return "";
962 }
963 if (!$this->lm->publicNotes()) {
964 return "";
965 }
966
967 $next_class = $this->ctrl->getNextClass($this);
968
969 $pg_id = $this->getCurrentPageId();
970
971 if ($pg_id == 0) {
972 return "";
973 }
974 $notes_gui = new ilNoteGUI($this->lm->getId(), $this->getCurrentPageId(), "pg");
975 $notes_gui->setUseObjectTitleHeader(false);
976
977 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
978 $ilSetting->get("comments_del_tutor", '1')) {
979 $notes_gui->enablePublicNotesDeletion(true);
980 }
981
982 $this->ctrl->setParameter($this, "frame", $this->requested_frame);
983 $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
984
985 $notes_gui->enablePrivateNotes();
986 if ($this->lm->publicNotes()) {
987 $notes_gui->enablePublicNotes();
988 }
989
990 $callback = array($this, "observeNoteAction");
991 $notes_gui->addObserver($callback);
992
993 if ($next_class == "ilnotegui") {
994 $html = $this->ctrl->forwardCommand($notes_gui);
995 } else {
996 $html = $notes_gui->getCommentsHTML();
997 }
998 return $html;
999 }
Notes GUI class.

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

+ Here is the call graph for this function:

◆ ilLMSubMenu()

ilLMPresentationGUI::ilLMSubMenu ( )

output learning module submenu

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

774 : void
775 {
777 if ($this->abstract) {
778 return;
779 }
780
781 $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent");
782
783 $tpl_menu = new ilTemplate("tpl.lm_sub_menu.html", true, true, "Modules/LearningModule");
784
785 $pg_id = $this->getCurrentPageId();
786 if ($pg_id == 0) {
787 return;
788 }
789
790 // edit learning module
791 if (!$this->offlineMode()) {
792 if ($rbacsystem->checkAccess("write", $this->requested_ref_id)) {
793 $tpl_menu->setCurrentBlock("edit_page");
794 $page_id = $this->getCurrentPageId();
795 $tpl_menu->setVariable(
796 "EDIT_LINK",
797 ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
798 "&obj_id=" . $page_id . "&to_page=1"
799 );
800 $tpl_menu->setVariable("EDIT_TXT", $this->lng->txt("edit_page"));
801 $tpl_menu->setVariable("EDIT_TARGET", $buttonTarget);
802 $tpl_menu->parseCurrentBlock();
803 }
804
805 $page_id = $this->getCurrentPageId();
806
807 // permanent link
808 $this->tpl->setPermanentLink("pg", null, $page_id . "_" . $this->lm->getRefId());
809 }
810
811 $this->tpl->setVariable("SUBMENU", $tpl_menu->get());
812 }
static _getFrame(string $a_class)

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

+ Here is the call graph for this function:

◆ ilLocator()

ilLMPresentationGUI::ilLocator ( )

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

1001 : void
1002 {
1003 global $DIC;
1004 $ltiview = $DIC["lti"];
1005 $ilLocator = $this->locator;
1006
1007 if (empty($this->requested_obj_id)) {
1008 $a_id = $this->lm_tree->getRootId();
1009 } else {
1011 }
1012
1013 if (!$this->lm->cleanFrames()) {
1014 $frame_param = $this->requested_frame;
1015 $frame_target = "";
1016 } elseif (!$this->offlineMode()) {
1017 $frame_param = "";
1018 $frame_target = ilFrameTargetInfo::_getFrame("MainContent");
1019 } else {
1020 $frame_param = "";
1021 $frame_target = "_top";
1022 }
1023
1024 if (!$this->offlineMode()) {
1025 // LTI
1026 if ($ltiview->isActive()) {
1027 // Do nothing, its complicated...
1028 } else {
1029 $ilLocator->addRepositoryItems();
1030 }
1031 } else {
1032 $ilLocator->setOffline(true);
1033 }
1034
1035 if ($this->lm_tree->isInTree($a_id)) {
1036 $path = $this->lm_tree->getPathFull($a_id);
1037
1038 foreach ($path as $key => $row) {
1039 if ($row["type"] != "pg") {
1040 if ($row["child"] != $this->lm_tree->getRootId()) {
1041 $ilLocator->addItem(
1044 $row["child"],
1046 $this->lm->isActiveNumbering(),
1047 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1048 false,
1049 0,
1050 $this->lang
1051 ),
1052 50,
1053 true
1054 ),
1055 $this->linker->getLink("layout", $row["child"], $frame_param, "StructureObject"),
1056 $frame_target
1057 );
1058 } else {
1059 $ilLocator->addItem(
1061 $this->linker->getLink("layout", 0, $frame_param),
1062 $frame_target,
1063 $this->requested_ref_id
1064 );
1065 }
1066 }
1067 }
1068 } else { // lonely page
1069 $ilLocator->addItem(
1070 $this->getLMPresentationTitle(),
1071 $this->linker->getLink("layout", 0, $this->requested_frame)
1072 );
1073
1074 $lm_obj = ilLMObjectFactory::getInstance($this->lm, $a_id);
1075
1076 $ilLocator->addItem(
1077 $lm_obj->getTitle(),
1078 $this->linker->getLink("layout", $a_id, $frame_param),
1079 $frame_target
1080 );
1081 }
1082
1083 $this->tpl->setLocator();
1084 }
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:32
string $key
Consumer key/client ID value.
Definition: System.php:193

References $DIC, ILIAS\LTI\ToolProvider\$key, $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 1270 of file class.ilLMPresentationGUI.php.

1270 : void
1271 {
1272 $pg_frame = "";
1273 $this->setContentStyles();
1274
1275 $this->renderPageTitle();
1276
1277 $this->tpl->setCurrentBlock("ilMedia");
1278 $med_links = ilMediaItem::_getMapAreasIntLinks($this->requested_mob_id);
1279 $link_xml = $this->linker->getLinkXML($med_links);
1280
1281 $media_obj = new ilObjMediaObject($this->requested_mob_id);
1282 if (!empty($this->requested_pg_id)) {
1283 $pg_obj = $this->getLMPage($this->requested_pg_id, $this->requested_pg_type);
1284 $pg_obj->buildDom();
1285
1286 $xml = "<dummy>";
1287 // todo: we get always the first alias now (problem if mob is used multiple
1288 // times in page)
1289 $xml .= $pg_obj->getMediaAliasElement($this->requested_mob_id);
1290 } else {
1291 $xml = "<dummy>";
1292 // todo: we get always the first alias now (problem if mob is used multiple
1293 // times in page)
1294 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
1295 }
1296 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
1297 $xml .= $link_xml;
1298 $xml .= "</dummy>";
1299
1300 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
1301 $args = array('/_xml' => $xml, '/_xsl' => $xsl);
1302 $xh = xslt_create();
1303
1304 if (!$this->offlineMode()) {
1305 $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1306 } else {
1307 $wb_path = "";
1308 }
1309
1310 $mode = ($this->requested_cmd == "fullscreen")
1311 ? "fullscreen"
1312 : "media";
1313 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output", $this->offlineMode());
1314 $fullscreen_link =
1315 $this->linker->getLink("fullscreen");
1316 $params = array('mode' => $mode,
1317 'enlarge_path' => $enlarge_path,
1318 'link_params' => "ref_id=" . $this->lm->getRefId(),
1319 'fullscreen_link' => $fullscreen_link,
1320 'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
1321 'ref_id' => $this->lm->getRefId(),
1322 'pg_frame' => $pg_frame,
1323 'webspace_path' => $wb_path
1324 );
1325 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
1326
1327 xslt_free($xh);
1328
1329 // unmask user html
1330 $this->tpl->setVariable("MEDIA_CONTENT", $output);
1331
1332 // add js
1334 }
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)
xslt_free(&$proc)
xslt_create()
$xml
Definition: metadata.php:351

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

+ Here is the call graph for this function:

◆ ilTOC()

ilLMPresentationGUI::ilTOC ( )

table of contents

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

748 {
749 $fac = new ilLMTOCExplorerGUIFactory();
750 $exp = $fac->getExplorer($this->service, "ilTOC");
751 $exp->handleCommand();
752 return $exp;
753 }
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 1353 of file class.ilLMPresentationGUI.php.

1353 : void
1354 {
1355 $this->ctrl->setCmd("showSummary");
1356 $this->ctrl->setCmdClass("ilinfoscreengui");
1357 $this->outputInfoScreen();
1358 }

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

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initPrintViewSelectionForm()

ilLMPresentationGUI::initPrintViewSelectionForm ( )

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

1636 : void
1637 {
1638 $lng = $this->lng;
1639 $ilCtrl = $this->ctrl;
1640
1641 $this->form = new ilPropertyFormGUI();
1642 $this->form->setForceTopButtons(true);
1643
1644 // selection type
1645 $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
1646 $radg->setValue("page");
1647 $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
1648 $radg->addOption($op1);
1649 $op2 = new ilRadioOption($lng->txt("cont_current_chapter"), "chapter");
1650 $radg->addOption($op2);
1651 $op3 = new ilRadioOption($lng->txt("cont_selected_pg_chap"), "selection");
1652 $radg->addOption($op3);
1653
1654 $nl = new ilNestedListInputGUI("", "obj_id");
1655 $this->nl = $nl;
1656 $op3->addSubItem($nl);
1657
1658 $this->form->addItem($radg);
1659
1660 $this->form->addCommandButton("showPrintView", $lng->txt("cont_show_print_view"));
1661 $this->form->setOpenTag(false);
1662 $this->form->setCloseTag(false);
1663
1664 $this->form->setTitle(" ");
1665 $this->form->setFormAction($ilCtrl->getFormAction($this));
1666 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)

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

1370 : void {
1371 $ilAccess = $this->access;
1372 $ilLocator = $this->locator;
1373
1374 $this->renderPageTitle();
1375
1376 $this->tpl->loadStandardTemplate();
1377 $this->tpl->setTitle($this->getLMPresentationTitle());
1378 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
1379
1380 $this->renderTabs($a_active_tab, 0);
1381
1382 // Full locator, if read permission is given
1383 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
1384 $this->ilLocator();
1385 } else {
1386 $ilLocator->addRepositoryItems();
1387 $this->tpl->setLocator();
1388 }
1389 }

◆ injectTemplate()

ilLMPresentationGUI::injectTemplate ( ilGlobalTemplateInterface  $tpl)

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

268 : void
269 {
270 $this->tpl = $tpl;
271 }

References $tpl.

◆ layout()

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

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

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

◆ media()

ilLMPresentationGUI::media ( )

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

670 : string
671 {
672 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Modules/LearningModule");
673
674 // set style sheets
675 $this->setContentStyles();
676 $this->setSystemStyle();
677
678 $this->ilMedia();
679 if (!$this->offlineMode()) {
680 $this->tpl->printToStdout();
681 } else {
682 return $this->tpl->printToString();
683 }
684 return "";
685 }

◆ nop()

ilLMPresentationGUI::nop ( )

this dummy function is needed for offline package creation

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

425 : void
426 {
427 }

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

2421 : void {
2422 $note = $this->notes->getById($a_note_id);
2423 $text = $note->getText();
2424
2425 $notification = new ilLearningModuleNotification(
2428 $this->lm,
2429 $a_page_id,
2430 $text
2431 );
2432
2433 $notification->send();
2434 }
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 412 of file class.ilLMPresentationGUI.php.

412 : bool
413 {
414 return $this->offline;
415 }

◆ outputInfoScreen()

ilLMPresentationGUI::outputInfoScreen ( )

info screen

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

1394 : string
1395 {
1396 $ilAccess = $this->access;
1397
1398 $this->initScreenHead();
1399
1400 $this->lng->loadLanguageModule("meta");
1401
1402 $info = new ilInfoScreenGUI($this->lm_gui);
1403 $info->enablePrivateNotes();
1404 //$info->enableLearningProgress();
1405 $info->enableNews();
1406 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1407 $news_set = new ilSetting("news");
1408 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1409
1410 $info->enableNewsEditing();
1411
1412 if ($enable_internal_rss) {
1413 $info->setBlockProperty("news", "settings", true);
1414 }
1415 }
1416
1417 // show standard meta data section
1418 $info->addMetaDataSections($this->lm->getId(), 0, $this->lm->getType());
1419
1420 $this->lng->loadLanguageModule("copg");
1421 $est_reading_time = $this->reading_time_manager->getReadingTime($this->lm->getId());
1422 if (!is_null($est_reading_time)) {
1423 $info->addProperty(
1424 $this->lng->txt("copg_est_reading_time"),
1425 sprintf($this->lng->txt("copg_x_minutes"), $est_reading_time)
1426 );
1427 }
1428
1429 if ($this->offlineMode()) {
1430 $this->tpl->setContent($info->getHTML());
1431 return $this->tpl->get();
1432 } else {
1433 // forward the command
1434 $this->ctrl->forwardCommand($info);
1435 //$this->tpl->setContent("aa");
1436 $this->tpl->printToStdout();
1437 }
1438 return "";
1439 }
Class ilInfoScreenGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ page()

ilLMPresentationGUI::page ( )

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

718 : string
719 {
721 $this->tpl = new ilGlobalTemplate("tpl.page_fullscreen.html", true, true, "Modules/LearningModule");
722 $GLOBALS["tpl"] = $this->tpl;
723 $this->renderPageTitle();
724
725 $this->setContentStyles();
726
727 // set style sheets
728 if (!$this->offlineMode()) {
729 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
730 } else {
731 $style_name = $ilUser->getPref("style") . ".css";
732 $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
733 }
734
735 $this->tpl->setVariable("PAGE_CONTENT", $this->getPageContent());
736 if (!$this->offlineMode()) {
737 $this->tpl->printToStdout();
738 } else {
739 return $this->tpl->get();
740 }
741 return "";
742 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $GLOBALS, $ilUser, $tpl, and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilLMPresentationGUI::redrawHeaderAction ( )

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

814 : void
815 {
816 echo $this->getHeaderAction(true);
817 exit;
818 }

References exit.

◆ refreshToc()

ilLMPresentationGUI::refreshToc ( )

Refresh toc (called if questions have been answered correctly)

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

2402 : void
2403 {
2404 $exp = $this->ilTOC();
2405
2406 echo $exp->getHTML() .
2407 "<script>" . $exp->getOnLoadCode() . "</script>";
2408 exit;
2409 }

References exit.

◆ renderPageTitle()

ilLMPresentationGUI::renderPageTitle ( )
protected

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

2358 : void
2359 {
2360 $this->tpl->setHeaderPageTitle($this->getLMPresentationTitle());
2361 }

◆ renderRating()

ilLMPresentationGUI::renderRating ( )
protected

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

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

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

2440 : void {
2441 $menu_editor = new ilLMMenuEditor();
2442 $menu_editor->setObjId($this->lm->getId());
2443
2444 $navigation_renderer = new ilLMMenuRendererGUI(
2445 $this->getService(),
2446 $this->tabs,
2447 $this->toolbar,
2449 $active_tab,
2450 $this->getExportFormat(),
2451 $this->export_all_languages,
2452 $this->lm,
2453 $this->offlineMode(),
2454 $menu_editor,
2455 $this->lang,
2456 $this->ctrl,
2457 $this->access,
2458 $this->user,
2459 $this->lng,
2460 $this->tpl,
2461 function ($additional_content) {
2462 $this->additional_content[] = $additional_content;
2463 }
2464 );
2465 $navigation_renderer->render();
2466 }
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 460 of file class.ilLMPresentationGUI.php.

460 : void
461 {
462 $this->layout();
463 }

◆ saveFrameUrl()

ilLMPresentationGUI::saveFrameUrl ( )

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

659 : void
660 {
661 $store = new ilSessionIStorage("lm");
662 $store->set("cf_" . $this->lm->getId(), $this->requested_url);
663 }

References $store.

◆ setContentStyles()

ilLMPresentationGUI::setContentStyles ( )
protected

Set content style.

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

1097 : void
1098 {
1099 // content style
1100 $this->content_style_gui->addCss(
1101 $this->tpl,
1102 $this->lm->getRefId()
1103 );
1104 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
1105 }

References ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ setHeader()

ilLMPresentationGUI::setHeader ( )

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

765 : void
766 {
767 $this->tpl->setTitle($this->getLMPresentationTitle());
768 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
769 }

References ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ setSystemStyle()

ilLMPresentationGUI::setSystemStyle ( )
protected

Set system style.

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

1110 : void
1111 {
1112 $this->tpl->addCss(ilUtil::getStyleSheetLocation());
1113 }

References ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ showDownloadList()

ilLMPresentationGUI::showDownloadList ( )

show download list

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

2212 : void
2213 {
2214 if (!$this->lm->isActiveDownloads() || !$this->lm->isActiveLMMenu()) {
2215 return;
2216 }
2217 $tpl = new ilTemplate("tpl.lm_download_list.html", true, true, "Modules/LearningModule");
2218
2219 // output copyright information
2220 $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2221 if (is_object($md_rights = $md->getRights())) {
2222 $copyright = $md_rights->getDescription();
2223
2224 $copyright = ilMDUtils::_parseCopyright($copyright);
2225
2226 if ($copyright != "") {
2227 $this->lng->loadLanguageModule("meta");
2228 $tpl->setCurrentBlock("copyright");
2229 $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2230 $tpl->setVariable("LM_COPYRIGHT", $copyright);
2232 }
2233 }
2234
2235 $download_table = new ilLMDownloadTableGUI($this, "showDownloadList", $this->lm);
2236 $tpl->setVariable("DOWNLOAD_TABLE", $download_table->getHTML());
2237 //$this->tpl->printToStdout();
2238
2239 $modal = $this->ui->factory()->modal()->roundtrip(
2240 $this->lng->txt("download"),
2241 $this->ui->factory()->legacy($tpl->get())
2242 );
2243 echo $this->ui->renderer()->render($modal);
2244 exit();
2245 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _parseCopyright(string $a_copyright)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.

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

+ Here is the call graph for this function:

◆ showInfoScreen()

ilLMPresentationGUI::showInfoScreen ( )

info screen call from inside learning module

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

1363 : void
1364 {
1365 $this->outputInfoScreen();
1366 }

◆ showMessageScreen()

ilLMPresentationGUI::showMessageScreen ( string  $a_content)

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

2286 : void {
2287 // content style
2288 $this->setContentStyles();
2289
2290 $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
2291 $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
2292
2293 $this->tpl->setVariable("PAGE_CONTENT", $tpl->get());
2294 }

◆ showNavRestrictionDueToQuestions()

ilLMPresentationGUI::showNavRestrictionDueToQuestions ( )

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

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

2316 : void
2317 {
2318 $this->showMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
2319 }
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 2307 of file class.ilLMPresentationGUI.php.

2307 : void
2308 {
2309 $this->showMessageScreen($this->lng->txt("msg_no_page_access"));
2310 }

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

2299 : void
2300 {
2301 $this->showMessageScreen($this->lng->txt("msg_page_no_public_access"));
2302 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showPrintView()

ilLMPresentationGUI::showPrintView ( )

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

1668 : void
1669 {
1671 $lng = $this->lng;
1672 $ilCtrl = $this->ctrl;
1674 $header_page_content = "";
1675 $footer_page_content = "";
1676 $chapter_title = "";
1677 $did_chap_page_header = false;
1678 $description = "";
1679
1680 if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1681 return;
1682 }
1683
1684 $this->renderPageTitle();
1685
1687 $lng->txt("back"),
1688 $ilCtrl->getLinkTarget($this, "layout")
1689 );
1690
1691 $c_obj_id = $this->getCurrentPageId();
1692 // set values according to selection
1693 $sel_type = $this->service->getRequest()->getSelectedType();
1694 $sel_obj_ids = $this->service->getRequest()->getSelectedObjIds();
1695 if ($sel_type == "page") {
1696 if (!in_array($c_obj_id, $sel_obj_ids)) {
1697 $sel_obj_ids[] = $c_obj_id;
1698 }
1699 }
1700 if ($sel_type == "chapter" && $c_obj_id > 0) {
1701 $path = $this->lm_tree->getPathFull($c_obj_id);
1702 $chap_id = $path[1]["child"];
1703 if ($chap_id > 0) {
1704 $sel_obj_ids[] = $chap_id;
1705 }
1706 }
1707
1708 $this->setContentStyles();
1709
1710 $tpl = new ilTemplate("tpl.lm_print_view.html", true, true, "Modules/LearningModule");
1711
1712 // set title header
1713 $this->tpl->setTitle($this->getLMPresentationTitle());
1714
1715 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1716
1717 $act_level = 99999;
1718 $activated = false;
1719
1720 $glossary_links = array();
1721 $output_header = false;
1722 $media_links = array();
1723
1724 // get header and footer
1725 if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1726 if (ilLMObject::_exists($this->lm->getFooterPage())) {
1727 $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
1728 $page_object_gui->setStyleId(
1729 $this->content_style_domain->getEffectiveStyleId()
1730 );
1731
1732 // determine target frames for internal links
1733 $page_object_gui->setLinkFrame($this->requested_frame);
1734 $page_object_gui->setOutputMode("print");
1735 $page_object_gui->setPresentationTitle("");
1736 $page_object_gui->setFileDownloadLink("#");
1737 $page_object_gui->setFullscreenLink("#");
1738 $page_object_gui->setSourcecodeDownloadScript("#");
1739 $footer_page_content = $page_object_gui->showPage();
1740 }
1741 }
1742 if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
1743 if (ilLMObject::_exists($this->lm->getHeaderPage())) {
1744 $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
1745 $page_object_gui->setStyleId(
1746 $this->content_style_domain->getEffectiveStyleId()
1747 );
1748
1749 // determine target frames for internal links
1750 $page_object_gui->setLinkFrame($this->requested_frame);
1751 $page_object_gui->setOutputMode("print");
1752 $page_object_gui->setPresentationTitle("");
1753 $page_object_gui->setFileDownloadLink("#");
1754 $page_object_gui->setFullscreenLink("#");
1755 $page_object_gui->setSourcecodeDownloadScript("#");
1756 $header_page_content = $page_object_gui->showPage();
1757 }
1758 }
1759
1760 // add free selected pages
1761 if (count($sel_obj_ids) > 0) {
1762 foreach ($sel_obj_ids as $k) {
1763 if ($k > 0 && !$this->lm_tree->isInTree($k)) {
1764 if (ilLMObject::_lookupType($k) == "pg") {
1765 $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
1766 }
1767 }
1768 }
1769 } else {
1770 $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_print_no_page_selected"), true);
1771 $ilCtrl->redirect($this, "showPrintViewSelection");
1772 }
1773
1774 foreach ($nodes as $node_key => $node) {
1775 // check page activation
1776 $active = ilLMPage::_lookupActive(
1777 $node["obj_id"],
1778 $this->lm->getType(),
1779 (bool) $this->lm_set->get("time_scheduled_page_activation")
1780 );
1781 if ($node["type"] == "pg" && !$active) {
1782 continue;
1783 }
1784
1785 // print all subchapters/subpages if higher chapter
1786 // has been selected
1787 if ($node["depth"] <= $act_level) {
1788 if (in_array($node["obj_id"], $sel_obj_ids)) {
1789 $act_level = $node["depth"];
1790 $activated = true;
1791 } else {
1792 $act_level = 99999;
1793 $activated = false;
1794 }
1795 }
1796 if ($this->lm->getRestrictForwardNavigation()) {
1797 if ($this->getTracker()->hasPredIncorrectAnswers($node["obj_id"])) {
1798 continue;
1799 }
1800 }
1801 if ($activated &&
1803 $this->lm->getRefId(),
1804 $this->lm->getId(),
1805 $node["obj_id"]
1806 )) {
1807 // output learning module header
1808 if ($node["type"] == "du") {
1809 $output_header = true;
1810 }
1811
1812 // output chapter title
1813 if ($node["type"] == "st") {
1814 if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1815 $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1816 if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1817 continue;
1818 }
1819 }
1820
1821 $chap = new ilStructureObject($this->lm, $node["obj_id"]);
1822 $tpl->setCurrentBlock("print_chapter");
1823
1824 $chapter_title = $chap->_getPresentationTitle(
1825 $node["obj_id"],
1826 $this->lm->isActiveNumbering(),
1827 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1828 0,
1829 $this->lang
1830 );
1832 "CHAP_TITLE",
1833 $chapter_title
1834 );
1835
1836 if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1837 if ($nodes[$node_key + 1]["type"] == "pg") {
1839 "CHAP_HEADER",
1840 $header_page_content
1841 );
1842 $did_chap_page_header = true;
1843 }
1844 }
1845
1847 $tpl->setCurrentBlock("print_block");
1849 }
1850
1851 // output page
1852 if ($node["type"] === "pg") {
1853 if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1854 $this->lm_gui->getObject()->getPublicAccessMode() === "selected") {
1855 if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1856 continue;
1857 }
1858 }
1859
1860 $tpl->setCurrentBlock("print_item");
1861
1862 // get page
1863 $page_id = $node["obj_id"];
1864 $page_object_gui = $this->getLMPageGUI($page_id);
1865 $page_object = $page_object_gui->getPageObject();
1866 $page_object_gui->setStyleId(
1867 $this->content_style_domain->getEffectiveStyleId()
1868 );
1869
1870 // get lm page
1871 $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
1872 $lm_pg_obj->setLMId($this->lm->getId());
1873
1874 // determine target frames for internal links
1875 $page_object_gui->setLinkFrame($this->requested_frame);
1876 $page_object_gui->setOutputMode("print");
1877 $page_object_gui->setPresentationTitle("");
1878
1879 if ($this->lm->getPageHeader() == ilLMObject::PAGE_TITLE || ($node["free"] ?? false) === true) {
1881 $lm_pg_obj->getId(),
1882 $this->lm->getPageHeader(),
1883 $this->lm->isActiveNumbering(),
1884 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1885 false,
1886 0,
1887 $this->lang
1888 );
1889
1890 // prevent page title after chapter title
1891 // that have the same content
1892 if ($this->lm->isActiveNumbering()) {
1893 $chapter_title = trim(substr(
1894 $chapter_title,
1895 strpos($chapter_title, " ")
1896 ));
1897 }
1898
1899 if ($page_title != $chapter_title) {
1900 $page_object_gui->setPresentationTitle($page_title);
1901 }
1902 }
1903
1904 // handle header / footer
1905 $hcont = $header_page_content;
1906 $fcont = $footer_page_content;
1907
1908 if ($this->lm->getPageHeader() == ilLMObject::CHAPTER_TITLE) {
1909 if ($did_chap_page_header) {
1910 $hcont = "";
1911 }
1912 if (($nodes[$node_key + 1]["type"] ?? "") == "pg" &&
1913 !($nodes[$node_key + 1]["depth"] <= $act_level
1914 && !in_array($nodes[$node_key + 1]["obj_id"], $sel_obj_ids))) {
1915 $fcont = "";
1916 }
1917 }
1918
1919 $page_object_gui->setFileDownloadLink("#");
1920 $page_object_gui->setFullscreenLink("#");
1921 $page_object_gui->setSourcecodeDownloadScript("#");
1922 $page_content = $page_object_gui->showPage();
1923 if ($this->lm->getPageHeader() != ilLMObject::PAGE_TITLE) {
1925 "CONTENT",
1926 $hcont . $page_content . $fcont
1927 );
1928 } else {
1930 "CONTENT",
1931 $hcont . $page_content . $fcont . "<br />"
1932 );
1933 }
1934 $chapter_title = "";
1936 $tpl->setCurrentBlock("print_block");
1938
1939 // get internal links
1940 $int_links = ilInternalLink::_getTargetsOfSource($this->lm->getType() . ":pg", $node["obj_id"]);
1941
1942 $got_mobs = false;
1943
1944 foreach ($int_links as $key => $link) {
1945 if ($link["type"] == "git" &&
1946 ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1947 $glossary_links[$key] = $link;
1948 }
1949 if ($link["type"] == "mob" &&
1950 ($link["inst"] == IL_INST_ID || $link["inst"] == 0)) {
1951 $got_mobs = true;
1952 $mob_links[$key] = $link;
1953 }
1954 }
1955
1956 // this is not cool because of performance reasons
1957 // unfortunately the int link table does not
1958 // store the target frame (we want to append all linked
1959 // images but not inline images (i.e. mobs with no target
1960 // frame))
1961 if ($got_mobs) {
1962 $page_object->buildDom();
1963 $links = $page_object->getInternalLinks();
1964 $tf = $link["TargetFrame"] ?? "";
1965 foreach ($links as $link) {
1966 if ($link["Type"] === "MediaObject"
1967 && $tf !== ""
1968 && $tf !== "None") {
1969 $media_links[] = $link;
1970 }
1971 }
1972 }
1973 }
1974 }
1975 }
1976
1977 $annex_cnt = 0;
1978 $annexes = array();
1979
1980 // glossary
1981 if (count($glossary_links) > 0 && !$this->lm->isActivePreventGlossaryAppendix()) {
1982 // sort terms
1983 $terms = array();
1984
1985 foreach ($glossary_links as $key => $link) {
1986 $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"]);
1987 $terms[$term . ":" . $key] = array("key" => $key, "link" => $link, "term" => $term);
1988 }
1989 $terms = ilArrayUtil::sortArray($terms, "term", "asc");
1990 //ksort($terms);
1991
1992 foreach ($terms as $t) {
1993 $link = $t["link"];
1994 $key = $t["key"];
1995 $defs = ilGlossaryDefinition::getDefinitionList($link["id"]);
1996 $def_cnt = 1;
1997
1998 // output all definitions of term
1999 foreach ($defs as $def) {
2000 // definition + number, if more than 1 definition
2001 if (count($defs) > 1) {
2002 $tpl->setCurrentBlock("def_title");
2004 "TXT_DEFINITION",
2005 $this->lng->txt("cont_definition") . " " . ($def_cnt++)
2006 );
2008 }
2009 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
2010 $page_gui->setTemplateOutput(false);
2011 $page_gui->setOutputMode("print");
2012
2013 $tpl->setCurrentBlock("definition");
2014 $page_gui->setFileDownloadLink("#");
2015 $page_gui->setFullscreenLink("#");
2016 $page_gui->setSourcecodeDownloadScript("#");
2017 $output = $page_gui->showPage();
2018 $tpl->setVariable("VAL_DEFINITION", $output);
2020 }
2021
2022 // output term
2023 $tpl->setCurrentBlock("term");
2025 "VAL_TERM",
2026 $term = ilGlossaryTerm::_lookGlossaryTerm($link["id"])
2027 );
2029 }
2030
2031 // output glossary header
2032 $annex_cnt++;
2033 $tpl->setCurrentBlock("glossary");
2034 $annex_title = $this->lng->txt("cont_annex") . " " .
2035 chr(64 + $annex_cnt) . ": " . $this->lng->txt("glo");
2036 $tpl->setVariable("TXT_GLOSSARY", $annex_title);
2038
2039 $annexes[] = $annex_title;
2040 }
2041
2042 // referenced images
2043 if (count($media_links) > 0) {
2044 foreach ($media_links as $media) {
2045 if (substr($media["Target"], 0, 4) == "il__") {
2046 $arr = explode("_", $media["Target"]);
2047 $id = $arr[count($arr) - 1];
2048
2049 $med_obj = new ilObjMediaObject($id);
2050 $med_item = $med_obj->getMediaItem("Standard");
2051 if (is_object($med_item)) {
2052 if (is_int(strpos($med_item->getFormat(), "image"))) {
2053 $tpl->setCurrentBlock("ref_image");
2054
2055 // image source
2056 if ($med_item->getLocationType() == "LocalFile") {
2058 "IMG_SOURCE",
2059 ilFileUtils::getWebspaceDir("output") . "/mobs/mm_" . $id .
2060 "/" . $med_item->getLocation()
2061 );
2062 } else {
2064 "IMG_SOURCE",
2065 $med_item->getLocation()
2066 );
2067 }
2068
2069 if ($med_item->getCaption() != "") {
2070 $tpl->setVariable("IMG_TITLE", $med_item->getCaption());
2071 } else {
2072 $tpl->setVariable("IMG_TITLE", $med_obj->getTitle());
2073 }
2075 }
2076 }
2077 }
2078 }
2079
2080 // output glossary header
2081 $annex_cnt++;
2082 $tpl->setCurrentBlock("ref_images");
2083 $annex_title = $this->lng->txt("cont_annex") . " " .
2084 chr(64 + $annex_cnt) . ": " . $this->lng->txt("cont_ref_images");
2085 $tpl->setVariable("TXT_REF_IMAGES", $annex_title);
2087
2088 $annexes[] = $annex_title;
2089 }
2090
2091 // output learning module title and toc
2092 if ($output_header) {
2093 $tpl->setCurrentBlock("print_header");
2094 $tpl->setVariable("LM_TITLE", $this->getLMPresentationTitle());
2095 if ($this->lm->getDescription() != "none") {
2096 $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2097 $md_gen = $md->getGeneral();
2098 foreach ($md_gen->getDescriptionIds() as $id) {
2099 $md_des = $md_gen->getDescription($id);
2100 $description = $md_des->getDescription();
2101 }
2102
2104 "LM_DESCRIPTION",
2105 $description
2106 );
2107 }
2109
2110 // output toc
2111 $nodes2 = $nodes;
2112 foreach ($nodes2 as $node2) {
2113 if ($node2["type"] == "st"
2115 $this->lm->getRefId(),
2116 $this->lm->getId(),
2117 $node2["obj_id"]
2118 )) {
2119 for ($j = 1; $j < $node2["depth"]; $j++) {
2120 $tpl->setCurrentBlock("indent");
2121 $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2123 }
2124 $tpl->setCurrentBlock("toc_entry");
2126 "TXT_TOC_TITLE",
2128 $node2["obj_id"],
2130 $this->lm->isActiveNumbering(),
2131 (bool) $this->lm_set->get("time_scheduled_page_activation"),
2132 false,
2133 0,
2134 $this->lang
2135 )
2136 );
2138 }
2139 }
2140
2141 // annexes
2142 foreach ($annexes as $annex) {
2143 $tpl->setCurrentBlock("indent");
2144 $tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("browser/blank.png"));
2146 $tpl->setCurrentBlock("toc_entry");
2147 $tpl->setVariable("TXT_TOC_TITLE", $annex);
2149 }
2150
2151 $tpl->setCurrentBlock("toc");
2152 $tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
2154
2155 $tpl->setCurrentBlock("print_start_block");
2157 }
2158
2159 // output author information
2160 $md = new ilMD($this->lm->getId(), 0, $this->lm->getType());
2161 if (is_object($lifecycle = $md->getLifecycle())) {
2162 $sep = $author = "";
2163 foreach (($ids = $lifecycle->getContributeIds()) as $con_id) {
2164 $md_con = $lifecycle->getContribute($con_id);
2165 if ($md_con->getRole() == "Author") {
2166 foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
2167 $md_ent = $md_con->getEntity($ent_id);
2168 $author = $author . $sep . $md_ent->getEntity();
2169 $sep = ", ";
2170 }
2171 }
2172 }
2173 if ($author != "") {
2174 $this->lng->loadLanguageModule("meta");
2175 $tpl->setCurrentBlock("author");
2176 $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
2177 $tpl->setVariable("LM_AUTHOR", $author);
2179 }
2180 }
2181
2182 // output copyright information
2183 if (is_object($md_rights = $md->getRights())) {
2184 $copyright = $md_rights->getDescription();
2185 $copyright = ilMDUtils::_parseCopyright($copyright);
2186
2187 if ($copyright != "") {
2188 $this->lng->loadLanguageModule("meta");
2189 $tpl->setCurrentBlock("copyright");
2190 $tpl->setVariable("TXT_COPYRIGHT", $this->lng->txt("meta_copyright"));
2191 $tpl->setVariable("LM_COPYRIGHT", $copyright);
2193 }
2194 }
2195 $this->tpl->setContent($tpl->get());
2196 $this->tpl->addOnLoadCode("il.Util.print();");
2197 $this->tpl->printToStdout();
2198 }
$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 getDefinitionList(int $a_term_id)
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 _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
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

References $id, $ilUser, ILIAS\LTI\ToolProvider\$key, $lng, $path, $tpl, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_exists(), ilLMPageObject\_getPresentationTitle(), ilStructureObject\_getPresentationTitle(), ilInternalLink\_getTargetsOfSource(), ilLMObject\_isPagePublic(), ilGlossaryTerm\_lookGlossaryTerm(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilMDUtils\_parseCopyright(), ANONYMOUS_USER_ID, ilLMObject\CHAPTER_TITLE, ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), ilFileUtils\getWebspaceDir(), IL_INST_ID, ILIAS\Repository\lng(), ilLMObject\PAGE_TITLE, ilGlobalTemplateInterface\parseCurrentBlock(), ilTabsGUI\setBackTarget(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilArrayUtil\sortArray().

+ Here is the call graph for this function:

◆ showPrintViewSelection()

ilLMPresentationGUI::showPrintViewSelection ( )

show selection screen for print view

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

1444 : void
1445 {
1447 $lng = $this->lng;
1448
1449 if (!$this->lm->isActivePrintView() || !$this->lm->isActiveLMMenu()) {
1450 return;
1451 }
1452
1453 $disabled = false;
1454 $img_alt = "";
1455
1456 $tpl = new ilTemplate("tpl.lm_print_selection.html", true, true, "Modules/LearningModule");
1457
1458 $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
1459 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1460
1461 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
1462 $nodes = $this->filterNonAccessibleNode($nodes);
1463
1464 /* this was written to _POST["item"] before, but never used?
1465 $items = $this->service->getRequest()->getItems();
1466 if (count($items) == 0) {
1467 if ($this->requested_obj_id != "") {
1468 $items[$this->requested_obj_id] = "y";
1469 } else {
1470 $items[1] = "y";
1471 }
1472 }*/
1473
1475
1476 foreach ($nodes as $node) {
1477 $img_src = "";
1478 $disabled = false;
1479 $img_alt = "";
1480
1481 // check page activation
1482 $active = ilLMPage::_lookupActive(
1483 $node["obj_id"],
1484 $this->lm->getType(),
1485 (bool) $this->lm_set->get("time_scheduled_page_activation")
1486 );
1487
1488 if ($node["type"] == "pg" &&
1489 !$active) {
1490 continue;
1491 }
1492
1493 $text = "";
1494 $img_alt = "";
1495 $checked = false;
1496
1497 switch ($node["type"]) {
1498 // page
1499 case "pg":
1500 $text =
1502 $node["obj_id"],
1503 $this->lm->getPageHeader(),
1504 $this->lm->isActiveNumbering(),
1505 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1506 false,
1507 0,
1508 $this->lang
1509 );
1510
1511 if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1512 $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1513 if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1514 $disabled = true;
1515 $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1516 }
1517 }
1518 $img_src = ilUtil::getImagePath("icon_pg.svg");
1519 $img_alt = $lng->txt("icon") . " " . $lng->txt("pg");
1520 break;
1521
1522 // learning module
1523 case "du":
1524 $text = $this->getLMPresentationTitle();
1525 $img_src = ilUtil::getImagePath("icon_lm.svg");
1526 $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm");
1527 break;
1528
1529 // chapter
1530 case "st":
1531 $text =
1533 $node["obj_id"],
1535 $this->lm->isActiveNumbering(),
1536 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1537 false,
1538 0,
1539 $this->lang
1540 );
1541 if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1542 $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1543 if (!ilLMObject::_isPagePublic($node["obj_id"])) {
1544 $disabled = true;
1545 $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1546 }
1547 }
1548 $img_src = ilUtil::getImagePath("icon_st.svg");
1549 $img_alt = $lng->txt("icon") . " " . $lng->txt("st");
1550 break;
1551 }
1552
1554 $this->lm->getRefId(),
1555 $this->lm->getId(),
1556 $node["obj_id"]
1557 )) {
1558 $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1559 }
1560
1561 $this->nl->addListNode(
1562 $node["obj_id"],
1563 $text,
1564 $node["parent"],
1565 $checked,
1566 $disabled,
1567 $img_src,
1568 $img_alt
1569 );
1570 }
1571
1572 // check for free page
1573 if ($this->requested_obj_id > 0 && !$this->lm_tree->isInTree($this->requested_obj_id)) {
1574 $text =
1576 $this->requested_obj_id,
1577 $this->lm->getPageHeader(),
1578 $this->lm->isActiveNumbering(),
1579 (bool) $this->lm_set->get("time_scheduled_page_activation"),
1580 false,
1581 0,
1582 $this->lang
1583 );
1584
1585 if ($ilUser->getId() === ANONYMOUS_USER_ID &&
1586 $this->lm_gui->getObject()->getPublicAccessMode() == "selected") {
1587 if (!ilLMObject::_isPagePublic($this->requested_obj_id)) {
1588 $disabled = true;
1589 $text .= " (" . $this->lng->txt("cont_no_access") . ")";
1590 }
1591 }
1592 $img_src = ilUtil::getImagePath("icon_pg.svg");
1594
1595 $checked = true;
1596
1597 $this->nl->addListNode(
1598 $id,
1599 $text,
1600 0,
1601 $checked,
1602 $disabled,
1603 $img_src,
1604 $img_alt
1605 );
1606 }
1607
1608 $f = $this->form->getHTMLAsync();
1609
1610 $tpl->setVariable("ITEM_SELECTION", $f);
1611
1612 $modal = $this->ui->factory()->modal()->roundtrip(
1613 $this->lng->txt("cont_print_view"),
1614 $this->ui->factory()->legacy($tpl->get())
1615 );
1616 echo $this->ui->renderer()->render($modal);
1617 exit();
1618 }

References Vendor\Package\$f, $id, $ilUser, $lng, $tpl, ilObjContentObject\_checkPreconditionsOfPage(), ilLMPageObject\_getPresentationTitle(), ilStructureObject\_getPresentationTitle(), ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ANONYMOUS_USER_ID, ilLMObject\CHAPTER_TITLE, ILIAS\Repository\ctrl(), exit, ILIAS\Repository\form(), ilUtil\getImagePath(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ updatePageRating()

ilLMPresentationGUI::updatePageRating ( )

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

1182 : void
1183 {
1185 $pg_id = $this->service->getRequest()->getPgId();
1186 if (!$this->ctrl->isAsynch() || !$pg_id) {
1187 exit();
1188 }
1189
1190 $rating = $this->service->getRequest()->getRating();
1191 if ($rating) {
1193 $this->lm->getId(),
1194 "lm",
1195 $pg_id,
1196 "lm",
1197 $ilUser->getId(),
1198 $rating
1199 );
1200 } else {
1202 $this->lm->getId(),
1203 "lm",
1204 $pg_id,
1205 "lm",
1206 $ilUser->getId()
1207 );
1208 }
1209
1210 $rating = new ilRatingGUI();
1211 $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm");
1212 $rating->setYourRatingText($this->lng->txt("lm_rate_page"));
1213
1214 echo $rating->getHTML(true, true, "il.LearningModule.saveRating(%rating%);");
1215
1216 echo $this->tpl->getOnLoadCodeForAsynch();
1217 exit();
1218 }
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 $ilUser, 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 85 of file class.ilLMPresentationGUI.php.

◆ $access

ilAccessHandler ilLMPresentationGUI::$access
protected

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

◆ $additional_content

array ilLMPresentationGUI::$additional_content = []
protected

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

◆ $chapter_has_no_active_page

bool ilLMPresentationGUI::$chapter_has_no_active_page = false

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

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilLMPresentationGUI::$content_style_domain
protected

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

◆ $content_style_gui

ILIAS Style Content GUIService ilLMPresentationGUI::$content_style_gui
protected

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

◆ $cs

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

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

◆ $ctrl

ilCtrl ilLMPresentationGUI::$ctrl
protected

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

◆ $current_page_id

int ilLMPresentationGUI::$current_page_id = 0
protected

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

◆ $deactivated_page

bool ilLMPresentationGUI::$deactivated_page = false

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

◆ $embed_mode

bool ilLMPresentationGUI::$embed_mode = false
protected

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

Referenced by __construct().

◆ $export_all_languages

bool ilLMPresentationGUI::$export_all_languages = false
protected

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

◆ $export_format

string ilLMPresentationGUI::$export_format
protected

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

◆ $fill_on_load_code

bool ilLMPresentationGUI::$fill_on_load_code
protected

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

◆ $focus_id

int ilLMPresentationGUI::$focus_id = 0
protected

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

◆ $form

ilPropertyFormGUI ilLMPresentationGUI::$form
protected

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

◆ $frames

array ilLMPresentationGUI::$frames
protected

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

◆ $global_screen

ILIAS GlobalScreen Services ilLMPresentationGUI::$global_screen
protected

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

◆ $help

ilHelpGUI ilLMPresentationGUI::$help
protected

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

◆ $lang

string ilLMPresentationGUI::$lang

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

◆ $layout_doc

php4DOMDocument ilLMPresentationGUI::$layout_doc

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

◆ $linker

ilLMPresentationLinker ilLMPresentationGUI::$linker
protected

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

◆ $lm

ilObjLearningModule ilLMPresentationGUI::$lm
protected

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

◆ $lm_gui

ilObjLearningModuleGUI ilLMPresentationGUI::$lm_gui
protected

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

◆ $lm_set

ilSetting ilLMPresentationGUI::$lm_set
protected

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

◆ $lm_tree

ilLMTree ilLMPresentationGUI::$lm_tree
protected

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

◆ $lng

ilLanguage ilLMPresentationGUI::$lng

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

Referenced by __construct().

◆ $locator

ilLocatorGUI ilLMPresentationGUI::$locator
protected

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

◆ $nav_history

ilNavigationHistory ilLMPresentationGUI::$nav_history
protected

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

◆ $nl

ilNestedListInputGUI ilLMPresentationGUI::$nl
protected

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

◆ $notes

ILIAS Notes DomainService ilLMPresentationGUI::$notes
protected

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

◆ $offline

bool ilLMPresentationGUI::$offline

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

◆ $offline_directory

string ilLMPresentationGUI::$offline_directory

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

◆ $ot

ilObjectTranslation ilLMPresentationGUI::$ot
protected

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

◆ $rbacsystem

ilRbacSystem ilLMPresentationGUI::$rbacsystem
protected

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

Referenced by __construct().

◆ $reading_time_manager

ILIAS LearningModule ReadingTime ReadingTimeManager ilLMPresentationGUI::$reading_time_manager
protected

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

◆ $requested_back_pg

string ilLMPresentationGUI::$requested_back_pg
protected

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

◆ $requested_cmd

string ilLMPresentationGUI::$requested_cmd = ""
protected

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

◆ $requested_focus_return

string ilLMPresentationGUI::$requested_focus_return
protected

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

◆ $requested_frame

string ilLMPresentationGUI::$requested_frame
protected

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

◆ $requested_mob_id

int ilLMPresentationGUI::$requested_mob_id = 0
protected

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

◆ $requested_notification_switch

int ilLMPresentationGUI::$requested_notification_switch = 0
protected

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

◆ $requested_obj_id

int ilLMPresentationGUI::$requested_obj_id
protected

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

Referenced by __construct().

◆ $requested_obj_type

string ilLMPresentationGUI::$requested_obj_type
protected

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

◆ $requested_pg_id

int ilLMPresentationGUI::$requested_pg_id = 0
protected

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

◆ $requested_pg_type

string ilLMPresentationGUI::$requested_pg_type = ""
protected

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

◆ $requested_ref_id

int ilLMPresentationGUI::$requested_ref_id
protected

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

◆ $requested_search_string

string ilLMPresentationGUI::$requested_search_string
protected

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

◆ $requested_transl

string ilLMPresentationGUI::$requested_transl
protected

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

◆ $requested_type

string ilLMPresentationGUI::$requested_type
protected

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

◆ $requested_url

string ilLMPresentationGUI::$requested_url
protected

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

◆ $service

ilLMPresentationService ilLMPresentationGUI::$service
protected

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

◆ $settings

ilSetting ilLMPresentationGUI::$settings
protected

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

◆ $tabs

ilTabsGUI ilLMPresentationGUI::$tabs
protected

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

◆ $toolbar

ilToolbarGUI ilLMPresentationGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLMPresentationGUI::$tpl

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

◆ $tracker

ilLMTracker ilLMPresentationGUI::$tracker
protected

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

◆ $tree

ilTree ilLMPresentationGUI::$tree
protected

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

◆ $ui

ILIAS DI UIServices ilLMPresentationGUI::$ui
protected

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

◆ $user

ilObjUser ilLMPresentationGUI::$user
protected

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


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