89 $this->ctrl = is_null(
$ctrl)
97 $this->from_page = $from_pg;
100 $this->requested_ref_id = $ref_id;
116 $this->profile_back_url =
$url;
127 $a_back_link =
"append",
137 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
138 $a_back_link ==
"append") {
145 if ($a_back_link ==
"reduce") {
146 $limpos = strpos($this->back_pg,
":");
153 } elseif ($a_back_link !=
"keep") {
159 if ($this->embed_mode && in_array($a_cmd, [
"downloadFile",
"download_paragraph",
"fullscreen"])) {
160 $this->ctrl->setParameterByClass(\ilLMPresentationGUI::class,
"ref_id", $this->lm->getRefId());
161 $base = $this->ctrl->getLinkTargetByClass([
162 \ilLMPresentationGUI::class, \ilLMPageGUI::class
166 return $base .
"&cmd=downloadFile";
167 case "download_paragraph":
168 return $base .
"&cmd=download_paragraph";
170 return $base .
"&cmd=displayMediaFullscreen";
174 } elseif (!$this->offline) {
175 if ($this->from_page ==
"") {
177 if (!in_array($a_frame, array(
"",
"_blank"))) {
178 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $cur_page_id);
183 if (!in_array($a_frame, array(
"",
"_blank"))) {
184 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $this->from_page);
188 if ($a_anchor !=
"") {
189 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"anchor", rawurlencode($a_anchor));
191 if ($a_srcstring !=
"") {
192 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"srcstring", $a_srcstring);
194 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"ref_id", $this->lm->getRefId());
197 $link = $this->ctrl->getLinkTargetByClass(self::TARGET_GUI,
"fullscreen",
"",
false,
false);
200 case "sourcecodeDownload":
201 case "download_paragraph":
202 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
203 $link = $this->ctrl->getLinkTargetByClass([self::TARGET_GUI,
"ilLMPageGUI"],
"",
"",
false,
false);
209 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"back_pg",
$back_pg);
211 if ($a_frame !=
"") {
212 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"frame", $a_frame);
214 if ($a_obj_id !=
"") {
217 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id", $a_obj_id);
221 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
222 $link .=
"&obj_id=" . $a_obj_id;
227 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_type", $a_type);
229 $link = $this->ctrl->getLinkTargetByClass(
238 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"frame",
"");
239 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
"");
240 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id",
"");
245 if ($this->export_all_languages) {
246 if ($this->lang !=
"" && $this->lang !=
"-") {
256 $link =
"fullscreen.html";
261 if ($a_obj_id ==
"") {
262 $a_obj_id = $this->lm_tree->getRootId();
263 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
264 $a_obj_id = $pg_node[
"obj_id"];
266 if ($a_type ==
"StructureObject") {
267 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
268 $a_obj_id = $pg_node[
"obj_id"];
270 if ($a_frame !=
"" && $a_frame !=
"_blank") {
271 if ($a_frame !=
"toc") {
272 $link =
"frame_" . $a_obj_id .
"_" . $a_frame . $lang_suffix .
".html";
274 $link =
"frame_" . $a_frame . $lang_suffix .
".html";
279 $link =
"lm_pg_" . $nid . $lang_suffix .
".html";
281 $link =
"lm_pg_" . $a_obj_id . $lang_suffix .
".html";
287 $link =
"term_" . $a_obj_id .
".html";
291 $link =
"media_" . $a_obj_id .
".html";
298 $this->ctrl->clearParametersByClass(self::TARGET_GUI);
313 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'faq');"],
315 "Type" =>
"Glossary",
316 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'glossary');"],
320 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'media');"]
331 $link_info =
"<LinkTargets>";
333 $link_info .=
"<LinkTarget TargetFrame=\"" . $t[
"Type"] .
"\" LinkTarget=\"" . $t[
"Frame"] .
"\" OnClick=\"" . $t[
"OnClick"] .
"\" />";
335 $link_info .=
"</LinkTargets>";
350 $showViewInFrameset =
true;
352 if ($a_layoutframes ==
"") {
353 $a_layoutframes = array();
355 $link_info =
"<IntLinkInfos>";
356 foreach ($a_int_links as $int_link) {
357 $target = $int_link[
"Target"];
358 if (substr($target, 0, 4) ==
"il__") {
361 $type = $int_link[
"Type"];
362 $targetframe = ($int_link[
"TargetFrame"] !=
"")
363 ? $int_link[
"TargetFrame"]
367 $anc = $anc_add =
"";
368 if ($int_link[
"Anchor"] !=
"") {
369 $anc = $int_link[
"Anchor"];
370 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
375 case "StructureObject":
377 if ($lm_id == $this->lm->getId() ||
378 ($targetframe !=
"None" && $targetframe !=
"New")) {
379 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
380 $nframe = ($ltarget ==
"")
383 if ($ltarget ==
"") {
384 if ($showViewInFrameset) {
385 $ltarget =
"_parent";
392 if ($this->export_format ==
"scorm" &&
398 if ($nframe !=
"" && $nframe !=
"_blank") {
413 if ($this->embed_mode) {
417 if (!$this->offline) {
418 if (
$type ==
"PageObject") {
419 $href =
"./goto.php?target=pg_" .
$target_id . $anc_add;
424 if (
$type ==
"PageObject") {
425 $href = ILIAS_HTTP_PATH .
"/goto.php?target=pg_" .
$target_id . $anc_add .
"&client_id=" .
CLIENT_ID;
427 $href = ILIAS_HTTP_PATH .
"/goto.php?target=st_" .
$target_id .
"&client_id=" .
CLIENT_ID;
431 if ($targetframe ==
"New" || $this->embed_mode) {
438 if ($targetframe ==
"None") {
439 $targetframe =
"Glossary";
441 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
442 $nframe = ($ltarget ==
"")
450 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
451 $nframe = ($ltarget ==
"")
456 if ($this->offline) {
459 $this->ctrl->setParameterByClass(
"illmpagegui",
"ref_id", $this->lm->getRefId());
460 $this->ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
$target_id);
461 $href = $this->ctrl->getLinkTargetByClass(
468 $this->ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
"");
472 case "RepositoryItem":
475 if (!$this->offline) {
476 $href =
"./goto.php?target=" . $obj_type .
"_" .
$target_id;
478 $href = ILIAS_HTTP_PATH .
"/goto.php?target=" . $obj_type .
"_" .
$target_id .
"&client_id=" .
CLIENT_ID;
481 if ($this->embed_mode) {
488 if ($int_link[
"Anchor"] !=
"") {
489 $wiki_anc =
"#".rawurlencode($int_link[
"Anchor"]);
492 if ($this->embed_mode) {
498 if (!$this->offline) {
499 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
500 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"il__file_" .
$target_id);
501 $href = $ilCtrl->getLinkTargetByClass(
508 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"");
509 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
$_GET[
"obj_id"]);
515 if ($obj_type ==
"usr") {
516 if (!$this->embed_mode) {
517 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
518 $back = $this->ctrl->getLinkTargetByClass(
527 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
$target_id);
528 $this->ctrl->setParameterByClass(
529 "ilpublicuserprofilegui",
535 $href = $this->ctrl->getLinkTargetByClass(
536 "ilpublicuserprofilegui",
543 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
"");
550 $anc_par =
'Anchor="' . $anc .
'"';
553 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
554 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
558 $link_info .=
"</IntLinkInfos>";
569 return $this->
getLink(
"fullscreen");
getLinkXML($a_int_links)
get xml for links
This class provides processing control methods.
Class ilObjLearningModule.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static hasPublicProfile($a_user_id)
Has public profile.
static _lookupObjId($a_id)
getLinkTargetsXML()
Get XMl for Link Targets.
getLink( $a_cmd="", $a_obj_id="", $a_frame="", $a_type="", $a_back_link="append", $a_anchor="", $a_srcstring="")
handles links for learning module presentation
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _lookupType($a_id, $a_reference=false)
lookup object type
__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, $embed_mode=false)
Constructor.
Learning module presentation linker.
setOffline($offline=true)
static getGotoForWikiPageTarget($a_target, $a_offline=false)
Get goto href for internal wiki page link target.