ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLMNavigationRendererGUI Class Reference
+ Collaboration diagram for ilLMNavigationRendererGUI:

Public Member Functions

 __construct (ilLMPresentationService $service, ilLMPresentationGUI $parent_gui, ilLanguage $lng, ilObjUser $user, ilGlobalPageTemplate $main_tpl, int $requested_obj_id, string $requested_back_pg, string $requested_frame)
 Constructor. More...
 
 renderTop ()
 Render top. More...
 
 renderBottom ()
 Render bottom. More...
 

Protected Member Functions

 render ($top=true)
 Render. More...
 

Protected Attributes

 $user
 
 $current_page
 
 $lm
 
 $lng
 
 $offline
 
 $tracker
 
 $lm_tree
 
 $parent_gui
 
 $lm_set
 
 $main_tpl
 
 $lang
 
 $navigation_status
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

85 {
86 global $DIC;
87
88 $this->user = $user;
89 $this->lm_tree = $service->getLMTree();
90 $this->current_page = $service->getNavigationStatus()->getCurrentPage();
91 $this->lm = $service->getLearningModule();
92 $this->lm_set = $service->getSettings();
93 $this->lng = $lng;
94 $this->offline = $service->getPresentationStatus()->offline();
95 $this->tracker = $service->getTracker();
96 $this->parent_gui = $parent_gui;
97 $this->chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
98 $this->deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
99 $this->linker = $service->getLinker();
100 $this->navigation_status = $service->getNavigationStatus();
101 $this->requested_obj_id = $requested_obj_id;
102 $back_pg = explode(":", $requested_back_pg);
103 $this->requested_back_pg = (int) $back_pg[0];
104 $this->requested_frame = $requested_frame;
105 $this->main_tpl = $main_tpl;
106 $this->lang = $service->getPresentationStatus()->getLang();
107 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
$service
Definition: result.php:17

References $DIC, $lng, $main_tpl, $parent_gui, $service, $user, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ render()

ilLMNavigationRendererGUI::render (   $top = true)
protected

Render.

Returns
string

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

136 {
138
139 $page_id = $this->current_page;
140
141 $tpl = new ilTemplate("tpl.lm_navigation.html", true, true, "Modules/LearningModule/Presentation");
142
143 if (empty($page_id)) {
144 return "";
145 }
146
147 // process navigation for free page
148 $back_pg = $this->navigation_status->getBackPageId();
149 if ($back_pg > 0) {
150 $back_href =
151 $this->linker->getLink(
152 "layout",
153 $back_pg,
154 "",
155 "",
156 "reduce"
157 );
158 $back_img =
159 ilUtil::getImagePath("nav_arr2_L.png", false, "output", $this->offline);
160 $tpl->setCurrentBlock("ilLMNavigation_Prev");
161 $tpl->setVariable("IMG_PREV", $back_img);
162 $tpl->setVariable("HREF_PREV", $back_href);
163 $tpl->setVariable("TXT_PREV", $this->lng->txt("back"));
164 $tpl->setVariable("ALT_PREV", $this->lng->txt("back"));
165 $tpl->setVariable(
166 "PREV_ACC_KEY",
168 );
169 $tpl->setVariable("SPACER_PREV", $this->offline
170 ? "images/spacer.png"
171 : ilUtil::getImagePath("spacer.png"));
172 $tpl->parseCurrentBlock();
173 } else {
174 $pre_id = $this->navigation_status->getPredecessorPageId();
175 if ($pre_id > 0) {
176 // get presentation title
178 $pre_id,
179 $this->lm->getPageHeader(),
180 $this->lm->isActiveNumbering(),
181 $this->lm_set->get("time_scheduled_page_activation"),
182 false,
183 0,
184 $this->lang,
185 true
186 );
187 $prev_title = ilUtil::shortenText($prev_title, 50, true);
188 $prev_img =
189 ilUtil::getImagePath("nav_arr_L.png", false, "output", $this->offline);
190
191 if (!$this->lm->cleanFrames()) {
192 $prev_href =
193 $this->linker->getLink(
194 "layout",
195 $pre_id,
196 $this->requested_frame
197 );
198 $prev_target = "";
199 } else {
200 if (!$this->offline) {
201 $prev_href =
202 $this->linker->getLink("layout", $pre_id);
203 $prev_target = 'target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
204 } else {
205 $prev_href =
206 $this->linker->getLink("layout", $pre_id);
207 $prev_target = 'target="_top" ';
208 }
209 }
210
211 $tpl->setCurrentBlock("ilLMNavigation_Prev");
212 $tpl->setVariable("IMG_PREV", $prev_img);
213 $tpl->setVariable("HREF_PREV", $prev_href);
214 $tpl->setVariable("FRAME_PREV", $prev_target);
215 $tpl->setVariable("TXT_PREV", $prev_title);
216 $tpl->setVariable("ALT_PREV", $this->lng->txt("previous"));
217 $tpl->setVariable("SPACER_PREV", $this->offline
218 ? "images/spacer.png"
219 : ilUtil::getImagePath("spacer.png"));
220 $tpl->setVariable(
221 "PREV_ACC_KEY",
223 );
224 }
225
226 $succ_id = $this->navigation_status->getSuccessorPageId();
227 if ($succ_id > 0) {
228 // get presentation title
230 $succ_id,
231 $this->lm->getPageHeader(),
232 $this->lm->isActiveNumbering(),
233 $this->lm_set->get("time_scheduled_page_activation"),
234 false,
235 0,
236 $this->lang,
237 true
238 );
239 $succ_title = ilUtil::shortenText($succ_title, 50, true);
240 $succ_img =
241 ilUtil::getImagePath("nav_arr_R.png", false, "output", $this->offline);
242 if (!$this->lm->cleanFrames()) {
243 $succ_href =
244 $this->linker->getLink(
245 "layout",
246 $succ_id,
247 $this->requested_frame
248 );
249 $succ_target = "";
250 } else {
251 if (!$this->offline) {
252 $succ_href =
253 $this->linker->getLink("layout", $succ_id);
254 $succ_target = ' target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ';
255 } else {
256 $succ_href =
257 $this->linker->getLink("layout", $succ_id);
258 $succ_target = ' target="_top" ';
259 }
260 }
261
262 $tpl->setCurrentBlock("ilLMNavigation_Next");
263 $tpl->setVariable("IMG_SUCC", $succ_img);
264 $tpl->setVariable("HREF_SUCC", $succ_href);
265 $tpl->setVariable("FRAME_SUCC", $succ_target);
266 $tpl->setVariable("TXT_SUCC", $succ_title);
267 $tpl->setVariable("ALT_SUCC", $this->lng->txt("next"));
268 $tpl->setVariable("SPACER_SUCC", $this->offline
269 ? "images/spacer.png"
270 : ilUtil::getImagePath("spacer.png"));
271 $tpl->setVariable(
272 "NEXT_ACC_KEY",
274 );
275 $tpl->parseCurrentBlock();
276
277 // check if successor page is not restricted
278 if (!$this->offline) {
279 if ($this->lm->getRestrictForwardNavigation()) {
280 if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
281 $this->main_tpl->addOnLoadCode("$('.ilc_page_rnav_RightNavigation').addClass('ilNoDisplay');");
282 }
283 }
284 }
285 }
286 }
287
288 $tpl->setVariable("CLASS", ($top) ? "tnav_Top": "bnav_Bottom");
289
290 return $tpl->get();
291 }
static getAttribute($a_func_id)
Get accesskey HTML attribute.
static _getFrame($a_class, $a_type='')
Get content frame name.
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
special template class to simplify handling of ITX/PEAR
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $current_page, $ilUser, $tpl, $user, ilFrameTargetInfo\_getFrame(), ilLMPageObject\_getPresentationTitle(), ilAccessKeyGUI\getAttribute(), ilUtil\getImagePath(), ilAccessKey\NEXT, ilAccessKey\PREVIOUS, and ilUtil\shortenText().

Referenced by renderBottom(), and renderTop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBottom()

ilLMNavigationRendererGUI::renderBottom ( )

Render bottom.

Returns
string

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

125 {
126 return $this->render(false);
127 }

References render().

+ Here is the call graph for this function:

◆ renderTop()

ilLMNavigationRendererGUI::renderTop ( )

Render top.

Returns
string

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

115 {
116 return $this->render();
117 }

References render().

+ Here is the call graph for this function:

Field Documentation

◆ $current_page

ilLMNavigationRendererGUI::$current_page
protected

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

Referenced by render().

◆ $lang

ilLMNavigationRendererGUI::$lang
protected

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

◆ $lm

ilLMNavigationRendererGUI::$lm
protected

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

◆ $lm_set

ilLMNavigationRendererGUI::$lm_set
protected

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

◆ $lm_tree

ilLMNavigationRendererGUI::$lm_tree
protected

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

◆ $lng

ilLMNavigationRendererGUI::$lng
protected

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

Referenced by __construct().

◆ $main_tpl

ilLMNavigationRendererGUI::$main_tpl
protected

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

Referenced by __construct().

◆ $navigation_status

ilLMNavigationRendererGUI::$navigation_status
protected

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

◆ $offline

ilLMNavigationRendererGUI::$offline
protected

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

◆ $parent_gui

ilLMNavigationRendererGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tracker

ilLMNavigationRendererGUI::$tracker
protected

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

◆ $user

ilLMNavigationRendererGUI::$user
protected

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

Referenced by __construct(), and render().


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