90 : string
91 {
93
94 $tpl =
new ilTemplate(
"tpl.lm_navigation.html",
true,
true,
"components/ILIAS/LearningModule/Presentation");
95
96 if (empty($page_id)) {
97 return "";
98 }
99
100
101 $back_pg = $this->navigation_status->getBackPageId();
102 if ($back_pg > 0) {
103 $back_href =
104 $this->linker->getLink(
105 "layout",
106 $back_pg,
107 "",
108 "",
109 "reduce"
110 );
111 $back_img =
113 $tpl->setCurrentBlock("ilLMNavigation_Prev");
114 $tpl->setVariable("IMG_PREV", $back_img);
115 $tpl->setVariable("HREF_PREV", $back_href);
116 $tpl->setVariable(
"TXT_PREV", $this->
lng->txt(
"back"));
117 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"back"));
118 $tpl->setVariable("SPACER_PREV", $this->offline
119 ? "images/media/spacer.png"
121 $tpl->parseCurrentBlock();
122 if ($top) {
123 $b = $this->
ui->factory()->button()->standard(
124 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
125 $back_href
126 );
128 }
129 } else {
130 $pre_id = $this->navigation_status->getPredecessorPageId();
131 if ($pre_id > 0) {
132
134 $pre_id,
135 $this->lm->getPageHeader(),
136 $this->lm->isActiveNumbering(),
137 (bool) $this->lm_set->get("time_scheduled_page_activation"),
138 false,
139 0,
140 $this->lang,
141 true
142 );
144 $prev_img =
146
147 if (!$this->lm->cleanFrames()) {
148 $prev_href =
149 $this->linker->getLink(
150 "layout",
151 $pre_id,
152 $this->requested_frame
153 );
154 $prev_target = "";
155 } else {
156 if (!$this->offline) {
157 $prev_href =
158 $this->linker->getLink("layout", $pre_id);
159 } else {
160 $prev_href =
161 $this->linker->getLink("layout", $pre_id);
162 }
163 }
164
165 $tpl->setCurrentBlock("ilLMNavigation_Prev");
166 $tpl->setVariable("IMG_PREV", $prev_img);
167 $tpl->setVariable("HREF_PREV", $prev_href);
168 $tpl->setVariable("TXT_PREV", $prev_title);
169 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"previous"));
170 $tpl->setVariable("SPACER_PREV", $this->offline
171 ? "images/media/spacer.png"
173
174 if ($top) {
175 $b = $this->
ui->factory()->button()->standard(
176 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
177 $prev_href
178 );
180 }
181 } else {
182 if ($top) {
183 $b = $this->
ui->factory()->button()->standard(
184 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
185 "#"
186 )->withUnavailableAction();
188 }
189 }
190
192
193 $succ_id = $this->navigation_status->getSuccessorPageId();
194 if ($succ_id > 0) {
195
197 $succ_id,
198 $this->lm->getPageHeader(),
199 $this->lm->isActiveNumbering(),
200 (bool) $this->lm_set->get("time_scheduled_page_activation"),
201 false,
202 0,
203 $this->lang,
204 true
205 );
207 $succ_img =
209 if (!$this->lm->cleanFrames()) {
210 $succ_href =
211 $this->linker->getLink(
212 "layout",
213 $succ_id,
214 $this->requested_frame
215 );
216 $succ_target = "";
217 } else {
218 if (!$this->offline) {
219 $succ_href =
220 $this->linker->getLink("layout", $succ_id);
221 } else {
222 $succ_href =
223 $this->linker->getLink("layout", $succ_id);
224 }
225 }
226
227 $tpl->setCurrentBlock("ilLMNavigation_Next");
228 $tpl->setVariable("IMG_SUCC", $succ_img);
229 $tpl->setVariable("HREF_SUCC", $succ_href);
230 $tpl->setVariable("TXT_SUCC", $succ_title);
231 $tpl->setVariable(
"ALT_SUCC", $this->
lng->txt(
"next"));
232 $tpl->setVariable("SPACER_SUCC", $this->offline
233 ? "images/media/spacer.png"
235 $tpl->parseCurrentBlock();
236
237
238 if (!$this->offline) {
239 if ($this->lm->getRestrictForwardNavigation()) {
240 if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
241 $this->main_tpl->addOnLoadCode("il.LearningModule.hideNextNavigation();");
242 }
243 }
244 }
245 if ($top) {
246 $b = $this->
ui->factory()->button()->standard(
247 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
248 $succ_href
249 );
251 }
252 } else {
253 if ($top) {
254 $b = $this->
ui->factory()->button()->standard(
255 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
256 "#"
257 )->withUnavailableAction();
259 }
260 }
261 }
262 $tpl->setVariable("CLASS", ($top) ? "tnav_Top" : "bnav_Bottom");
263
264 return $tpl->get();
265 }
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
special template class to simplify handling of ITX/PEAR
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)