52 string $export_format,
53 bool $export_all_languages,
55 bool $embed_mode =
false,
61 $this->
ctrl = is_null($ctrl)
69 $this->from_page = $from_pg;
72 $this->requested_ref_id =
$ref_id;
88 $this->profile_back_url =
$url;
99 string $a_back_link =
"append",
100 string $a_anchor =
"",
101 string $a_srcstring =
"" 112 if ($a_obj_id !== 0 && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !== 0 &&
113 $a_back_link ==
"append") {
114 if ($back_pg !=
"") {
115 $back_pg = $cur_page_id .
":" .
$back_pg;
117 $back_pg = $cur_page_id;
120 if ($a_back_link ==
"reduce") {
121 $limpos = strpos($this->back_pg,
":");
124 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
128 } elseif ($a_back_link !=
"keep") {
134 if ($this->embed_mode && in_array($a_cmd, [
"downloadFile",
"download_paragraph",
"fullscreen"])) {
135 $this->
ctrl->setParameterByClass(\ilLMPresentationGUI::class,
"ref_id", $this->lm->getRefId());
136 $base = $this->
ctrl->getLinkTargetByClass([
137 \ilLMPresentationGUI::class, \ilLMPageGUI::class
141 return $base .
"&cmd=downloadFile";
142 case "download_paragraph":
143 return $base .
"&cmd=download_paragraph";
145 return $base .
"&cmd=displayMediaFullscreen";
149 } elseif (!$this->offline) {
150 if ($this->from_page ==
"") {
152 if (!in_array($a_frame, array(
"",
"_blank"))) {
153 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $cur_page_id);
158 if (!in_array($a_frame, array(
"",
"_blank"))) {
159 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $this->from_page);
163 if ($a_anchor !=
"") {
164 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"anchor", rawurlencode($a_anchor));
166 if ($a_srcstring !=
"") {
167 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"srcstring", $a_srcstring);
169 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"ref_id", $this->lm->getRefId());
172 $link = $this->
ctrl->getLinkTargetByClass(self::TARGET_GUI,
"fullscreen",
"",
false,
false);
175 case "sourcecodeDownload":
176 case "download_paragraph":
177 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
178 $link = $this->
ctrl->getLinkTargetByClass([self::TARGET_GUI,
"ilLMPageGUI"],
"",
"",
false,
false);
183 if ($back_pg !=
"") {
184 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"back_pg", $back_pg);
186 if ($a_frame !=
"") {
187 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame", $a_frame);
192 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id", $a_obj_id);
196 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
197 $link .=
"&obj_id=" . $a_obj_id;
202 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_type", $a_type);
204 if ($a_anchor !==
"") {
205 $a_anchor =
"copganc_" . $a_anchor;
207 $link = $this->
ctrl->getLinkTargetByClass(
216 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame",
null);
217 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
null);
218 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id",
null);
223 if ($this->export_all_languages) {
224 if ($this->lang !=
"" && $this->lang !=
"-") {
231 $link =
"fullscreen.html";
236 if ($a_obj_id === 0) {
237 $a_obj_id = $this->lm_tree->getRootId();
238 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
239 $a_obj_id = $pg_node[
"obj_id"];
241 if ($a_type ==
"StructureObject") {
242 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
243 $a_obj_id = $pg_node[
"obj_id"];
245 if ($a_frame !=
"" && $a_frame !=
"_blank") {
246 if ($a_frame !=
"toc") {
247 $link =
"frame_" . $a_obj_id .
"_" . $a_frame . $lang_suffix .
".html";
249 $link =
"frame_" . $a_frame . $lang_suffix .
".html";
254 $link =
"lm_pg_" . $nid . $lang_suffix .
".html";
256 $link =
"lm_pg_" . $a_obj_id . $lang_suffix .
".html";
262 $link =
"term_" . $a_obj_id .
".html";
266 $link =
"media_" . $a_obj_id .
".html";
274 $this->
ctrl->clearParametersByClass(self::TARGET_GUI);
288 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'faq');"],
290 "Type" =>
"Glossary",
291 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'glossary');"],
295 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'media');"]
306 $link_info =
"<LinkTargets>";
308 $link_info .=
"<LinkTarget TargetFrame=\"" . $t[
"Type"] .
"\" LinkTarget=\"" . ($t[
"Frame"] ??
"") .
"\" OnClick=\"" . $t[
"OnClick"] .
"\" />";
310 $link_info .=
"</LinkTargets>";
325 $showViewInFrameset =
true;
327 if ($a_layoutframes ==
"") {
328 $a_layoutframes = array();
330 $link_info =
"<IntLinkInfos>";
331 foreach ($int_links as $int_link) {
335 $target = $int_link[
"Target"];
336 if (substr($target, 0, 4) ==
"il__") {
337 $target_arr = explode(
"_", $target);
338 $target_id = $target_arr[count($target_arr) - 1];
339 $type = $int_link[
"Type"];
340 $targetframe = ($int_link[
"TargetFrame"] !=
"")
341 ? $int_link[
"TargetFrame"]
345 $anc = $anc_add =
"";
346 if (($int_link[
"Anchor"] ??
"") !=
"") {
347 $anc = $int_link[
"Anchor"];
348 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
353 case "StructureObject":
355 if ($lm_id == $this->lm->getId() ||
356 ($targetframe !=
"None" && $targetframe !=
"New")) {
357 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
358 $nframe = ($ltarget ==
"")
361 if ($ltarget ==
"") {
362 $ltarget =
"_parent";
366 if ($nframe !=
"" && $nframe !=
"_blank") {
381 if ($this->embed_mode) {
385 if (!$this->offline) {
386 if ($type ==
"PageObject") {
387 $href =
"./goto.php?target=pg_" . $target_id . $anc_add;
389 $href =
"./goto.php?target=st_" . $target_id;
392 if ($type ==
"PageObject") {
393 $href = ILIAS_HTTP_PATH .
"/goto.php?target=pg_" . $target_id . $anc_add .
"&client_id=" .
CLIENT_ID;
395 $href = ILIAS_HTTP_PATH .
"/goto.php?target=st_" . $target_id .
"&client_id=" .
CLIENT_ID;
399 if ($targetframe ==
"New" || $this->embed_mode) {
406 if ($targetframe ==
"None") {
407 $targetframe =
"Glossary";
409 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
410 $nframe = ($ltarget ==
"")
416 $this->
getLink($a_cmd =
"glossary", (
int) $target_id, $nframe, $type);
421 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
422 $nframe = ($ltarget ==
"")
426 $this->
getLink($a_cmd =
"media", $target_id, $nframe, $type);
427 if ($this->offline) {
428 $href =
"media_" . $target_id .
".html";
430 $this->
ctrl->setParameterByClass(
"illmpagegui",
"ref_id", $this->lm->getRefId());
431 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id", $target_id);
432 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
433 $href = $this->
ctrl->getLinkTargetByClass(
440 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
"");
441 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
445 case "RepositoryItem":
448 if (!$this->offline) {
449 $href =
"./goto.php?target=" . $obj_type .
"_" . $target_id;
451 $href = ILIAS_HTTP_PATH .
"/goto.php?target=" . $obj_type .
"_" . $target_id .
"&client_id=" .
CLIENT_ID;
453 if ($this->embed_mode) {
460 if (($int_link[
"Anchor"] ??
"") !=
"") {
461 $wiki_anc =
"#" . rawurlencode($int_link[
"Anchor"]);
464 if ($this->embed_mode) {
470 if (!$this->offline) {
471 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
472 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"il__file_" . $target_id);
473 $href = $ilCtrl->getLinkTargetByClass(
480 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"");
481 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
487 if ($obj_type ==
"usr") {
488 if (!$this->embed_mode) {
489 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
490 $back = $this->
ctrl->getLinkTargetByClass(
499 $this->
ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id", $target_id);
500 $this->
ctrl->setParameterByClass(
501 "ilpublicuserprofilegui",
507 $href = $this->
ctrl->getLinkTargetByClass(
508 "ilpublicuserprofilegui",
515 $this->
ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
"");
521 $anc_par =
'Anchor="' . $anc .
'"';
524 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
525 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
529 $link_info .=
"</IntLinkInfos>";
537 return $this->
getLink(
"fullscreen");
setProfileBackUrl(string $url)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
getLinkXML(array $int_links)
get xml for links
setOffline(bool $offline=true)
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
getLinkTargetsXML()
Get XMl for Link Targets.
__construct(ilObjLearningModule $lm, ilLMTree $lm_tree, int $current_page, int $ref_id, string $lang, string $back_pg, string $from_pg, bool $offline, string $export_format, bool $export_all_languages, ?ilCtrl $ctrl=null, bool $embed_mode=false, string $frame="", int $obj_id=0)
static getGotoForWikiPageTarget(string $a_target, bool $a_offline=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasPublicProfile(int $a_user_id)
static _lookupContObjID(int $a_id)
get learning module id for lm object
getLink(string $a_cmd="", int $a_obj_id=0, string $a_frame="", string $a_type="", string $a_back_link="append", string $a_anchor="", string $a_srcstring="")
handles links for learning module presentation
static _lookupType(int $id, bool $reference=false)
bool $export_all_languages