ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMNavigationRendererGUI Class Reference

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

+ Collaboration diagram for ilLMNavigationRendererGUI:

Public Member Functions

 __construct (ilLMPresentationService $service, ilLMPresentationGUI $parent_gui, ilLanguage $lng, ilObjUser $user, ilGlobalTemplateInterface $main_tpl, int $requested_obj_id, string $requested_back_pg, string $requested_frame)
 
 renderTop ()
 
 renderBottom ()
 

Protected Member Functions

 render (bool $top=true)
 

Protected Attributes

string $requested_frame
 
int $requested_back_pg
 
int $requested_obj_id
 
ilLMPresentationLinker $linker
 
bool $deactivated_page
 
bool $chapter_has_no_active_page
 
ilObjUser $user
 
int $current_page
 
ilObjLearningModule $lm
 
ilLanguage $lng
 
bool $offline
 
ilLMTracker $tracker
 
ilLMTree $lm_tree
 
ilLMPresentationGUI $parent_gui
 
ilSetting $lm_set
 
ilGlobalTemplateInterface $main_tpl
 
string $lang
 
ilLMNavigationStatus $navigation_status
 

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilLMNavigationRendererGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMNavigationRendererGUI::__construct ( ilLMPresentationService  $service,
ilLMPresentationGUI  $parent_gui,
ilLanguage  $lng,
ilObjUser  $user,
ilGlobalTemplateInterface  $main_tpl,
int  $requested_obj_id,
string  $requested_back_pg,
string  $requested_frame 
)

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

References $lng, $main_tpl, $parent_gui, $requested_frame, $requested_obj_id, $user, ilLMPresentationService\getLearningModule(), ilLMPresentationService\getLinker(), ilLMPresentationService\getLMTree(), ilLMPresentationService\getNavigationStatus(), ilLMPresentationService\getPresentationStatus(), ilLMPresentationService\getSettings(), ilLMPresentationService\getTracker(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

52  {
53  $this->user = $user;
54  $this->lm_tree = $service->getLMTree();
55  $this->current_page = $service->getNavigationStatus()->getCurrentPage();
56  $this->lm = $service->getLearningModule();
57  $this->lm_set = $service->getSettings();
58  $this->lng = $lng;
59  $this->offline = $service->getPresentationStatus()->offline();
60  $this->tracker = $service->getTracker();
61  $this->parent_gui = $parent_gui;
62  $this->chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
63  $this->deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
64  $this->linker = $service->getLinker();
65  $this->navigation_status = $service->getNavigationStatus();
66  $this->requested_obj_id = $requested_obj_id;
67  $back_pg = explode(":", $requested_back_pg);
68  $this->requested_back_pg = (int) $back_pg[0];
69  $this->requested_frame = $requested_frame;
70  $this->main_tpl = $main_tpl;
71  $this->lang = $service->getPresentationStatus()->getLang();
72  }
getSettings()
Get learning module settings.
+ Here is the call graph for this function:

Member Function Documentation

◆ render()

ilLMNavigationRendererGUI::render ( bool  $top = true)
protected

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

References $current_page, $lang, $tpl, ilFrameTargetInfo\_getFrame(), ilLMPageObject\_getPresentationTitle(), ilUtil\getImagePath(), ILIAS\Repository\lng(), and ilStr\shortenTextExtended().

Referenced by renderBottom(), and renderTop().

84  : string
85  {
86  $page_id = $this->current_page;
87 
88  $tpl = new ilTemplate("tpl.lm_navigation.html", true, true, "Modules/LearningModule/Presentation");
89 
90  if (empty($page_id)) {
91  return "";
92  }
93 
94  // process navigation for free page
95  $back_pg = $this->navigation_status->getBackPageId();
96  if ($back_pg > 0) {
97  $back_href =
98  $this->linker->getLink(
99  "layout",
100  $back_pg,
101  "",
102  "",
103  "reduce"
104  );
105  $back_img =
106  ilUtil::getImagePath("nav_arr2_L.png", false, "output", $this->offline);
107  $tpl->setCurrentBlock("ilLMNavigation_Prev");
108  $tpl->setVariable("IMG_PREV", $back_img);
109  $tpl->setVariable("HREF_PREV", $back_href);
110  $tpl->setVariable("TXT_PREV", $this->lng->txt("back"));
111  $tpl->setVariable("ALT_PREV", $this->lng->txt("back"));
112  $tpl->setVariable("SPACER_PREV", $this->offline
113  ? "images/spacer.png"
114  : ilUtil::getImagePath("spacer.png"));
115  $tpl->parseCurrentBlock();
116  } else {
117  $pre_id = $this->navigation_status->getPredecessorPageId();
118  if ($pre_id > 0) {
119  // get presentation title
121  $pre_id,
122  $this->lm->getPageHeader(),
123  $this->lm->isActiveNumbering(),
124  (bool) $this->lm_set->get("time_scheduled_page_activation"),
125  false,
126  0,
127  $this->lang,
128  true
129  );
130  $prev_title = ilStr::shortenTextExtended($prev_title, 50, true);
131  $prev_img =
132  ilUtil::getImagePath("nav_arr_L.png", false, "output", $this->offline);
133 
134  if (!$this->lm->cleanFrames()) {
135  $prev_href =
136  $this->linker->getLink(
137  "layout",
138  $pre_id,
139  $this->requested_frame
140  );
141  $prev_target = "";
142  } else {
143  if (!$this->offline) {
144  $prev_href =
145  $this->linker->getLink("layout", $pre_id);
146  $prev_target = 'target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
147  } else {
148  $prev_href =
149  $this->linker->getLink("layout", $pre_id);
150  $prev_target = 'target="_top" ';
151  }
152  }
153 
154  $tpl->setCurrentBlock("ilLMNavigation_Prev");
155  $tpl->setVariable("IMG_PREV", $prev_img);
156  $tpl->setVariable("HREF_PREV", $prev_href);
157  $tpl->setVariable("FRAME_PREV", $prev_target);
158  $tpl->setVariable("TXT_PREV", $prev_title);
159  $tpl->setVariable("ALT_PREV", $this->lng->txt("previous"));
160  $tpl->setVariable("SPACER_PREV", $this->offline
161  ? "images/spacer.png"
162  : ilUtil::getImagePath("spacer.png"));
163  }
164 
165  $succ_id = $this->navigation_status->getSuccessorPageId();
166  if ($succ_id > 0) {
167  // get presentation title
169  $succ_id,
170  $this->lm->getPageHeader(),
171  $this->lm->isActiveNumbering(),
172  (bool) $this->lm_set->get("time_scheduled_page_activation"),
173  false,
174  0,
175  $this->lang,
176  true
177  );
178  $succ_title = ilStr::shortenTextExtended($succ_title, 50, true);
179  $succ_img =
180  ilUtil::getImagePath("nav_arr_R.png", false, "output", $this->offline);
181  if (!$this->lm->cleanFrames()) {
182  $succ_href =
183  $this->linker->getLink(
184  "layout",
185  $succ_id,
186  $this->requested_frame
187  );
188  $succ_target = "";
189  } else {
190  if (!$this->offline) {
191  $succ_href =
192  $this->linker->getLink("layout", $succ_id);
193  $succ_target = ' target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
194  } else {
195  $succ_href =
196  $this->linker->getLink("layout", $succ_id);
197  $succ_target = ' target="_top" ';
198  }
199  }
200 
201  $tpl->setCurrentBlock("ilLMNavigation_Next");
202  $tpl->setVariable("IMG_SUCC", $succ_img);
203  $tpl->setVariable("HREF_SUCC", $succ_href);
204  $tpl->setVariable("FRAME_SUCC", $succ_target);
205  $tpl->setVariable("TXT_SUCC", $succ_title);
206  $tpl->setVariable("ALT_SUCC", $this->lng->txt("next"));
207  $tpl->setVariable("SPACER_SUCC", $this->offline
208  ? "images/spacer.png"
209  : ilUtil::getImagePath("spacer.png"));
210  $tpl->parseCurrentBlock();
211 
212  // check if successor page is not restricted
213  if (!$this->offline) {
214  if ($this->lm->getRestrictForwardNavigation()) {
215  if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
216  $this->main_tpl->addOnLoadCode("$('.ilc_page_rnav_RightNavigation').addClass('ilNoDisplay');");
217  }
218  }
219  }
220  }
221  }
222 
223  $tpl->setVariable("CLASS", ($top) ? "tnav_Top" : "bnav_Bottom");
224 
225  return $tpl->get();
226  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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 shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static _getFrame(string $a_class)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBottom()

ilLMNavigationRendererGUI::renderBottom ( )

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

References render().

79  : string
80  {
81  return $this->render(false);
82  }
+ Here is the call graph for this function:

◆ renderTop()

ilLMNavigationRendererGUI::renderTop ( )

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

References render().

74  : string
75  {
76  return $this->render();
77  }
+ Here is the call graph for this function:

Field Documentation

◆ $chapter_has_no_active_page

bool ilLMNavigationRendererGUI::$chapter_has_no_active_page
protected

Definition at line 29 of file class.ilLMNavigationRendererGUI.php.

◆ $current_page

int ilLMNavigationRendererGUI::$current_page
protected

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

Referenced by render().

◆ $deactivated_page

bool ilLMNavigationRendererGUI::$deactivated_page
protected

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

◆ $lang

string ilLMNavigationRendererGUI::$lang
protected

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

Referenced by render().

◆ $linker

ilLMPresentationLinker ilLMNavigationRendererGUI::$linker
protected

Definition at line 27 of file class.ilLMNavigationRendererGUI.php.

◆ $lm

ilObjLearningModule ilLMNavigationRendererGUI::$lm
protected

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

◆ $lm_set

ilSetting ilLMNavigationRendererGUI::$lm_set
protected

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

◆ $lm_tree

ilLMTree ilLMNavigationRendererGUI::$lm_tree
protected

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

◆ $lng

ilLanguage ilLMNavigationRendererGUI::$lng
protected

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

Referenced by __construct().

◆ $main_tpl

ilGlobalTemplateInterface ilLMNavigationRendererGUI::$main_tpl
protected

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

Referenced by __construct().

◆ $navigation_status

ilLMNavigationStatus ilLMNavigationRendererGUI::$navigation_status
protected

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

◆ $offline

bool ilLMNavigationRendererGUI::$offline
protected

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

◆ $parent_gui

ilLMPresentationGUI ilLMNavigationRendererGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $requested_back_pg

int ilLMNavigationRendererGUI::$requested_back_pg
protected

Definition at line 25 of file class.ilLMNavigationRendererGUI.php.

◆ $requested_frame

string ilLMNavigationRendererGUI::$requested_frame
protected

Definition at line 24 of file class.ilLMNavigationRendererGUI.php.

Referenced by __construct().

◆ $requested_obj_id

int ilLMNavigationRendererGUI::$requested_obj_id
protected

Definition at line 26 of file class.ilLMNavigationRendererGUI.php.

Referenced by __construct().

◆ $tracker

ilLMTracker ilLMNavigationRendererGUI::$tracker
protected

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

◆ $user

ilObjUser ilLMNavigationRendererGUI::$user
protected

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

Referenced by __construct().


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