71 $this->from_page = $from_pg;
74 $this->requested_ref_id =
$ref_id;
90 $this->profile_back_url =
$url;
101 string $a_back_link =
"append",
102 string $a_anchor =
"",
103 string $a_srcstring =
""
112 $cur_page_id = $this->current_page;
113 $back_pg = $this->back_pg;
114 if ($a_obj_id !== 0 && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !== 0 &&
115 $a_back_link ==
"append") {
116 if ($back_pg !=
"") {
117 $back_pg = $cur_page_id .
":" . $back_pg;
119 $back_pg = $cur_page_id;
122 if ($a_back_link ==
"reduce") {
123 $limpos = strpos($this->back_pg,
":");
126 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
130 } elseif ($a_back_link !=
"keep") {
136 if ($this->embed_mode && in_array($a_cmd, [
"downloadFile",
"download_paragraph",
"fullscreen"])) {
137 $this->
ctrl->setParameterByClass(\ilLMPresentationGUI::class,
"ref_id", $this->lm->getRefId());
138 $base = $this->
ctrl->getLinkTargetByClass([
139 \ilLMPresentationGUI::class, \ilLMPageGUI::class
143 return $base .
"&cmd=downloadFile";
144 case "download_paragraph":
145 return $base .
"&cmd=download_paragraph";
147 return $base .
"&cmd=displayMediaFullscreen";
151 } elseif (!$this->offline) {
152 if ($this->from_page ==
"") {
154 if (!in_array($a_frame, array(
"",
"_blank"))) {
155 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $cur_page_id);
160 if (!in_array($a_frame, array(
"",
"_blank"))) {
161 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $this->from_page);
165 if ($a_anchor !=
"") {
166 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"anchor", rawurlencode($a_anchor));
168 if ($a_srcstring !=
"") {
169 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"srcstring", $a_srcstring);
171 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"ref_id", $this->lm->getRefId());
174 $link = $this->
ctrl->getLinkTargetByClass(self::TARGET_GUI,
"fullscreen",
"",
false,
false);
177 case "sourcecodeDownload":
178 case "download_paragraph":
179 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
180 $link = $this->
ctrl->getLinkTargetByClass([self::TARGET_GUI,
"ilLMPageGUI"],
"",
"",
false,
false);
185 if ($back_pg !=
"") {
186 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"back_pg", $back_pg);
188 if ($a_frame !=
"") {
189 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame", $a_frame);
194 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id", $a_obj_id);
198 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
199 $link .=
"&obj_id=" . $a_obj_id;
204 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_type", $a_type);
206 if ($a_anchor !==
"") {
207 $a_anchor =
"copganc_" . $a_anchor;
209 $link = $this->
ctrl->getLinkTargetByClass(
218 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"frame",
null);
219 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
null);
220 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id",
null);
225 if ($this->export_all_languages) {
226 if ($this->lang !=
"" && $this->lang !=
"-") {
233 $link =
"fullscreen.html";
238 if ($a_obj_id === 0) {
239 $a_obj_id = $this->lm_tree->getRootId();
240 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
241 $a_obj_id = $pg_node[
"obj_id"];
243 if ($a_type ==
"StructureObject") {
244 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
245 $a_obj_id = $pg_node[
"obj_id"];
247 if ($a_frame !=
"" && $a_frame !=
"_blank") {
248 if ($a_frame !=
"toc") {
249 $link =
"frame_" . $a_obj_id .
"_" . $a_frame . $lang_suffix .
".html";
251 $link =
"frame_" . $a_frame . $lang_suffix .
".html";
256 $link =
"lm_pg_" . $nid . $lang_suffix .
".html";
258 $link =
"lm_pg_" . $a_obj_id . $lang_suffix .
".html";
264 $link =
"term_" . $a_obj_id .
".html";
268 $link =
"media_" . $a_obj_id .
".html";
276 $this->
ctrl->clearParametersByClass(self::TARGET_GUI);
290 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'faq');"],
292 "Type" =>
"Glossary",
293 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'glossary');"],
297 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'media');"]
308 $link_info =
"<LinkTargets>";
309 foreach ($this->getLayoutLinkTargets() as $k => $t) {
310 $link_info .=
"<LinkTarget TargetFrame=\"" . $t[
"Type"] .
"\" LinkTarget=\"" . ($t[
"Frame"] ??
"") .
"\" OnClick=\"" . $t[
"OnClick"] .
"\" />";
312 $link_info .=
"</LinkTargets>";
322 $ilCtrl = $this->
ctrl;
323 $a_layoutframes = $this->getLayoutLinkTargets();
327 $showViewInFrameset =
true;
329 if ($a_layoutframes ==
"") {
330 $a_layoutframes = array();
332 $link_info =
"<IntLinkInfos>";
333 foreach ($int_links as $int_link) {
337 $target = $int_link[
"Target"];
338 if (substr($target, 0, 4) ==
"il__") {
339 $target_arr = explode(
"_", $target);
340 $target_id = $target_arr[count($target_arr) - 1];
341 $type = $int_link[
"Type"];
342 $targetframe = ($int_link[
"TargetFrame"] !=
"")
343 ? $int_link[
"TargetFrame"]
347 $anc = $anc_add =
"";
348 if (($int_link[
"Anchor"] ??
"") !=
"") {
349 $anc = $int_link[
"Anchor"];
350 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
355 case "StructureObject":
357 if ($lm_id == $this->lm->getId() ||
358 ($targetframe !=
"None" && $targetframe !=
"New")) {
359 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
360 $nframe = ($ltarget ==
"")
363 if ($ltarget ==
"") {
364 $ltarget =
"_parent";
368 if ($nframe !=
"" && $nframe !=
"_blank") {
383 if ($this->embed_mode) {
387 if (!$this->offline) {
388 if ($type ==
"PageObject") {
389 $href =
"./goto.php?target=pg_" . $target_id . $anc_add;
391 $href =
"./goto.php?target=st_" . $target_id;
394 if ($type ==
"PageObject") {
395 $href = ILIAS_HTTP_PATH .
"/goto.php?target=pg_" . $target_id . $anc_add .
"&client_id=" .
CLIENT_ID;
397 $href = ILIAS_HTTP_PATH .
"/goto.php?target=st_" . $target_id .
"&client_id=" .
CLIENT_ID;
401 if ($targetframe ==
"New" || $this->embed_mode) {
408 if ($targetframe ==
"None") {
409 $targetframe =
"Glossary";
411 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
412 $nframe = ($ltarget ==
"")
418 $this->getLink($a_cmd =
"glossary", (
int) $target_id, $nframe, $type);
423 $ltarget = $a_layoutframes[$targetframe][
"Frame"] ??
"";
424 $nframe = ($ltarget ==
"")
428 $this->getLink($a_cmd =
"media", $target_id, $nframe, $type);
429 if ($this->offline) {
430 $href =
"media_" . $target_id .
".html";
432 $this->
ctrl->setParameterByClass(
"illmpagegui",
"ref_id", $this->lm->getRefId());
433 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id", $target_id);
434 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
435 $href = $this->
ctrl->getLinkTargetByClass(
442 $this->
ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
"");
443 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
447 case "RepositoryItem":
450 if (!$this->offline) {
451 $href =
"./goto.php?target=" . $obj_type .
"_" . $target_id;
453 $href = ILIAS_HTTP_PATH .
"/goto.php?target=" . $obj_type .
"_" . $target_id .
"&client_id=" .
CLIENT_ID;
455 if ($this->embed_mode) {
462 if (($int_link[
"Anchor"] ??
"") !=
"") {
463 $wiki_anc =
"#" . rawurlencode($int_link[
"Anchor"]);
466 if ($this->embed_mode) {
472 if (!$this->offline) {
473 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
474 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"il__file_" . $target_id);
475 $href = $ilCtrl->getLinkTargetByClass(
482 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"");
483 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->obj_id);
489 if ($obj_type ==
"usr") {
490 if (!$this->embed_mode) {
491 $this->
ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
492 $back = $this->
ctrl->getLinkTargetByClass(
501 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id", $target_id);
502 $this->
ctrl->setParameterByClass(
503 PublicProfileGUI::class,
509 $href = $this->
ctrl->getLinkTargetByClass(
510 PublicProfileGUI::class,
517 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id",
"");
523 $anc_par =
'Anchor="' . $anc .
'"';
526 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
527 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
531 $link_info .=
"</IntLinkInfos>";
533 $link_info .= $this->getLinkTargetsXML();
539 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.
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 _lookupObjId(int $ref_id)
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)
if(!file_exists('../ilias.ini.php'))