Render.
131 {
133
135
136 $tpl =
new ilTemplate(
"tpl.lm_navigation.html",
true,
true,
"Modules/LearningModule/Presentation");
137
138 if (empty($page_id)) {
139 return "";
140 }
141
142 $back_pg = $this->requested_back_pg;
143 $frame = $this->requested_frame;
144
145
146 if (!$this->lm_tree->isInTree($page_id)) {
147 if ($this->offline || $back_pg == 0) {
148 return "";
149 }
150
151 if (!$this->lm->cleanFrames()) {
152
153 $back_href =
154 $this->linker->getLink(
155 "layout",
156 $back_pg,
157 $frame,
158 "",
159 "reduce"
160 );
161 $back_target = "";
162 } else {
163 $back_href =
164 $this->linker->getLink(
165 "layout",
166 $back_pg,
167 "",
168 "",
169 "reduce"
170 );
172 }
173 $back_img =
175 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
176 $tpl->setVariable(
"IMG_PREV", $back_img);
177 $tpl->setVariable(
"HREF_PREV", $back_href);
178 $tpl->setVariable(
"FRAME_PREV", $back_target);
179 $tpl->setVariable(
"TXT_PREV", $this->lng->txt(
"back"));
180 $tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"back"));
182 "PREV_ACC_KEY",
184 );
185 $tpl->setVariable(
"SPACER_PREV", $this->offline
186 ? "images/spacer.png"
188 $tpl->parseCurrentBlock();
189 } else {
190
191 $found = false;
192
193
194 if ($this->chapter_has_no_active_page &&
196 $c_id = $this->requested_obj_id;
197 } else {
198 if ($this->deactivated_page) {
199 $c_id = $this->requested_obj_id;
200 } else {
201 $c_id = $page_id;
202 }
203 }
204 while (!$found) {
205 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
206 $c_id = $succ_node["obj_id"];
207
209 $c_id,
210 $this->lm->getType(),
211 $this->lm_set->get("time_scheduled_page_activation")
212 );
213
214 if ($succ_node["obj_id"] > 0 &&
215 $ilUser->getId() == ANONYMOUS_USER_ID &&
216 ($this->lm->getPublicAccessMode() == "selected" &&
218 $found = false;
219 } else {
220 if ($succ_node["obj_id"] > 0 && !$active) {
221
223 if ($act_data["show_activation_info"] &&
225 $found = true;
226 } else {
227 $found = false;
228 }
229 } else {
230 $found = true;
231 }
232 }
233 }
234
235
236 $found = false;
237 if ($this->deactivated_page) {
238 $c_id = $this->requested_obj_id;
239 } else {
240 $c_id = $page_id;
241 }
242 while (!$found) {
243 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id, "pg");
244 $c_id = $pre_node["obj_id"];
246 $c_id,
247 $this->lm->getType(),
248 $this->lm_set->get("time_scheduled_page_activation")
249 );
250 if ($pre_node["obj_id"] > 0 &&
251 $ilUser->getId() == ANONYMOUS_USER_ID &&
252 ($this->lm->getPublicAccessMode() == "selected" &&
254 $found = false;
255 } else {
256 if ($pre_node["obj_id"] > 0 && !$active) {
257
259 if ($act_data["show_activation_info"] &&
261 $found = true;
262 } else {
263 $found = false;
264 }
265 } else {
266 $found = true;
267 }
268 }
269 }
270
271
272
273
274 $showViewInFrameset = true;
275
276 if ($pre_node != "") {
277
279 $pre_node["obj_id"],
280 $this->lm->getPageHeader(),
281 $this->lm->isActiveNumbering(),
282 $this->lm_set->get("time_scheduled_page_activation"),
283 false,
284 0,
285 $this->lang,
286 true
287 );
289 $prev_img =
291
292 if (!$this->lm->cleanFrames()) {
293 $prev_href =
294 $this->linker->getLink(
295 "layout",
296 $pre_node["obj_id"],
297 $this->requested_frame
298 );
299 $prev_target = "";
300 } else {
301 if ($showViewInFrameset && !$this->offline) {
302 $prev_href =
303 $this->linker->getLink("layout", $pre_node["obj_id"]);
305 } else {
306 $prev_href =
307 $this->linker->getLink("layout", $pre_node["obj_id"]);
308 $prev_target = 'target="_top" ';
309 }
310 }
311
312 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
313 $tpl->setVariable(
"IMG_PREV", $prev_img);
314 $tpl->setVariable(
"HREF_PREV", $prev_href);
315 $tpl->setVariable(
"FRAME_PREV", $prev_target);
316 $tpl->setVariable(
"TXT_PREV", $prev_title);
317 $tpl->setVariable(
"ALT_PREV", $this->lng->txt(
"previous"));
318 $tpl->setVariable(
"SPACER_PREV", $this->offline
319 ? "images/spacer.png"
322 "PREV_ACC_KEY",
324 );
325 }
326 if ($succ_node != "") {
327
329 $succ_node["obj_id"],
330 $this->lm->getPageHeader(),
331 $this->lm->isActiveNumbering(),
332 $this->lm_set->get("time_scheduled_page_activation"),
333 false,
334 0,
335 $this->lang,
336 true
337 );
339 $succ_img =
341 if (!$this->lm->cleanFrames()) {
342 $succ_href =
343 $this->linker->getLink(
344 "layout",
345 $succ_node["obj_id"],
346 $this->requested_frame
347 );
348 $succ_target = "";
349 } else {
350 if (!$this->offline) {
351 $succ_href =
352 $this->linker->getLink("layout", $succ_node["obj_id"]);
354 } else {
355 $succ_href =
356 $this->linker->getLink("layout", $succ_node["obj_id"]);
357 $succ_target = ' target="_top" ';
358 }
359 }
360
361 $tpl->setCurrentBlock(
"ilLMNavigation_Next");
362 $tpl->setVariable(
"IMG_SUCC", $succ_img);
363 $tpl->setVariable(
"HREF_SUCC", $succ_href);
364 $tpl->setVariable(
"FRAME_SUCC", $succ_target);
365 $tpl->setVariable(
"TXT_SUCC", $succ_title);
366 $tpl->setVariable(
"ALT_SUCC", $this->lng->txt(
"next"));
367 $tpl->setVariable(
"SPACER_SUCC", $this->offline
368 ? "images/spacer.png"
371 "NEXT_ACC_KEY",
373 );
374 $tpl->parseCurrentBlock();
375
376
377 if (!$this->offline) {
378 if ($this->lm->getRestrictForwardNavigation()) {
379 if ($this->tracker->hasPredIncorrectAnswers($succ_node["obj_id"])) {
380 $this->main_tpl->addOnLoadCode("$('.ilc_page_rnav_RightNavigation').addClass('ilNoDisplay');");
381 }
382 }
383 }
384 }
385 }
386
387 $tpl->setVariable(
"CLASS", ($top) ?
"tnav_Top":
"bnav_Bottom");
388
390 }
static getAttribute($a_func_id)
Get accesskey HTML attribute.
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
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...
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
special template class to simplify handling of ITX/PEAR
static now()
Return current timestamp in Y-m-d H:i:s format.
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)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl