72 $this->from_page = $from_pg;
75 $this->requested_ref_id =
$ref_id;
81 $this->static_url =
$DIC[
"static_url"];
92 $this->profile_back_url =
$url;
101 string $a_frame =
"",
103 string $a_back_link =
"append",
104 string $a_anchor =
"",
105 string $a_srcstring =
""
114 $cur_page_id = $this->current_page;
115 $back_pg = $this->back_pg;
116 if ($a_obj_id !== 0 && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !== 0 &&
117 $a_back_link ==
"append") {
118 if ($back_pg !=
"") {
119 $back_pg = $cur_page_id .
":" . $back_pg;
121 $back_pg = $cur_page_id;
124 if ($a_back_link ==
"reduce") {
125 $limpos = strpos($this->back_pg,
":");
128 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
132 } elseif ($a_back_link !=
"keep") {
138 if ($this->embed_mode && in_array($a_cmd, [
"downloadFile",
"download_paragraph",
"fullscreen"])) {
139 $this->
ctrl->setParameterByClass(\ilLMPresentationGUI::class,
"ref_id", $this->lm->getRefId());
140 $base = $this->
ctrl->getLinkTargetByClass([
141 \ilLMPresentationGUI::class, \ilLMPageGUI::class
145 return $base .
"&cmd=downloadFile";
146 case "download_paragraph":
147 return $base .
"&cmd=download_paragraph";
149 return $base .
"&cmd=displayMediaFullscreen";
153 } elseif (!$this->offline) {
154 if ($this->from_page ==
"") {
156 if (!in_array($a_frame, array(
"",
"_blank"))) {
157 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $cur_page_id);
162 if (!in_array($a_frame, array(
"",
"_blank"))) {
163 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $this->from_page);
167 if ($a_anchor !=
"") {
168 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"anchor", rawurlencode($a_anchor));
170 if ($a_srcstring !=
"") {
171 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"srcstring", $a_srcstring);
173 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"ref_id", $this->lm->getRefId());
176 $link = $this->
ctrl->getLinkTargetByClass(self::TARGET_GUI,
"fullscreen",
"",
false,
false);
179 case "sourcecodeDownload":
180 case "download_paragraph":
181 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
182 $link = $this->
ctrl->getLinkTargetByClass([self::TARGET_GUI,
"ilLMPageGUI"],
"",
"",
false,
false);
187 if ($back_pg !=
"") {
188 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"back_pg", $back_pg);
190 if ($a_frame !=
"") {
191 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame", $a_frame);
196 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id", $a_obj_id);
200 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
201 $link .=
"&obj_id=" . $a_obj_id;
206 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_type", $a_type);
208 if ($a_anchor !==
"") {
209 $a_anchor =
"copganc_" . $a_anchor;
211 $link = $this->
ctrl->getLinkTargetByClass(
220 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame",
null);
221 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
null);
222 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id",
null);
227 if ($this->export_all_languages) {
228 if ($this->lang !=
"" && $this->lang !=
"-") {
229 $lang_suffix =
"_" . $this->lang;
235 $link =
"fullscreen.html";
240 if ($a_obj_id === 0) {
241 $a_obj_id = $this->lm_tree->getRootId();
242 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
243 $a_obj_id = $pg_node[
"obj_id"];
245 if ($a_type ==
"StructureObject") {
246 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
247 $a_obj_id = $pg_node[
"obj_id"];
249 if ($a_frame !=
"" && $a_frame !=
"_blank") {
250 if ($a_frame !=
"toc") {
251 $link =
"frame_" . $a_obj_id .
"_" . $a_frame . $lang_suffix .
".html";
253 $link =
"frame_" . $a_frame . $lang_suffix .
".html";
258 $link =
"lm_pg_" . $nid . $lang_suffix .
".html";
260 $link =
"lm_pg_" . $a_obj_id . $lang_suffix .
".html";
266 $link =
"term_" . $a_obj_id .
".html";
270 $link =
"media_" . $a_obj_id .
".html";
278 $this->
ctrl->clearParametersByClass(self::TARGET_GUI);
292 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'faq');"],
294 "Type" =>
"Glossary",
295 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'glossary');"],
299 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'media');"]
310 $link_info =
"<LinkTargets>";
311 foreach ($this->getLayoutLinkTargets() as $k => $t) {
312 $link_info .=
"<LinkTarget TargetFrame=\"" . $t[
"Type"] .
"\" LinkTarget=\"" . ($t[
"Frame"] ??
"") .
"\" OnClick=\"" . $t[
"OnClick"] .
"\" />";
314 $link_info .=
"</LinkTargets>";
324 $ilCtrl = $this->
ctrl;
325 $a_layoutframes = $this->getLayoutLinkTargets();
329 $showViewInFrameset =
true;
331 if ($a_layoutframes ==
"") {
332 $a_layoutframes = array();
334 $link_info =
"<IntLinkInfos>";
335 foreach ($int_links as $int_link) {
339 $target = $int_link[
"Target"];
340 if (substr($target, 0, 4) ==
"il__") {
341 $target_arr = explode(
"_", $target);
342 $target_id = $target_arr[count($target_arr) - 1];
343 $type = $int_link[
"Type"];
344 $targetframe = ($int_link[
"TargetFrame"] !=
"")
345 ? $int_link[
"TargetFrame"]
349 $anc = $anc_add =
"";
350 if (($int_link[
"Anchor"] ??
"") !=
"") {
351 $anc = $int_link[
"Anchor"];
352 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
357 case "StructureObject":
359 if ($lm_id == $this->lm->getId() ||
360 ($targetframe !=
"None" && $targetframe !=
"New")) {
361 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
362 $nframe = ($ltarget ==
"")
365 if ($ltarget ==
"") {
366 $ltarget =
"_parent";
370 if ($nframe !=
"" && $nframe !=
"_blank") {
385 if ($this->embed_mode) {
389 if ($type ==
"PageObject") {
390 $href = (string) $this->static_url->builder()->build(
396 $href = (string) $this->static_url->builder()->build(
403 if ($targetframe ==
"New" || $this->embed_mode) {
410 if ($targetframe ==
"None") {
411 $targetframe =
"Glossary";
413 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
414 $nframe = ($ltarget ==
"")
420 $this->getLink($a_cmd =
"glossary", (
int) $target_id, $nframe, $type);
425 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
426 $nframe = ($ltarget ==
"")
430 $this->getLink($a_cmd =
"media", $target_id, $nframe, $type);
431 if ($this->offline) {
432 $href =
"media_" . $target_id .
".html";
434 $this->
ctrl->setParameterByClass(
"illmpagegui",
"ref_id", $this->lm->getRefId());
435 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id", $target_id);
436 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
437 $href = $this->
ctrl->getLinkTargetByClass(
444 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
"");
445 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
449 case "RepositoryItem":
451 if ((
int) $target_id > 0) {
452 $href = (string) $this->static_url->builder()->build(
454 new \
ILIAS\Data\ReferenceId($target_id)
459 if ($this->embed_mode) {
466 if (($int_link[
"Anchor"] ??
"") !=
"") {
467 $wiki_anc =
"#" . rawurlencode($int_link[
"Anchor"]);
470 if ($this->embed_mode) {
476 if (!$this->offline) {
477 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
478 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"il__file_" . $target_id);
479 $href = $ilCtrl->getLinkTargetByClass(
486 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"");
487 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
493 if ($obj_type ==
"usr") {
494 if (!$this->embed_mode) {
495 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
496 $back = $this->
ctrl->getLinkTargetByClass(
505 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id", $target_id);
506 $this->
ctrl->setParameterByClass(
507 PublicProfileGUI::class,
513 $href = $this->
ctrl->getLinkTargetByClass(
514 [ilPublicProfileBaseClassGUI::class, PublicProfileGUI::class],
521 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id",
"");
527 $anc_par =
'Anchor="' . $anc .
'"';
530 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
531 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
535 $link_info .=
"</IntLinkInfos>";
537 $link_info .= $this->getLinkTargetsXML();
543 return $this->getLink(
"fullscreen");
GUI class for public user profile presentation.
Class ilCtrl provides processing control methods.
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
static _lookupContObjID(int $a_id)
get learning module id for lm object
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
Learning module presentation linker.
getLinkXML(array $int_links)
get xml for links
setOffline(bool $offline=true)
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
getLinkTargetsXML()
Get XMl for Link Targets.
ILIAS StaticURL Services $static_url
bool $export_all_languages
setProfileBackUrl(string $url)
__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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
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=null)
Default behaviour is:
static hasPublicProfile(int $a_user_id)
static getGotoForWikiPageTarget(string $a_target, bool $a_offline=false)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))