32 string $export_format,
33 bool $export_all_languages,
38 $this->ctrl = is_null($ctrl)
42 $this->lm_tree = $lm_tree;
44 $this->current_page = $current_page;
45 $this->back_pg = $back_pg;
46 $this->from_page = $from_pg;
47 $this->export_all_languages = $export_all_languages;
49 $this->requested_ref_id = $ref_id;
51 $this->export_format = $export_format;
64 $this->profile_back_url =
$url;
75 $a_back_link =
"append",
83 $cur_page_id = $this->current_page;
84 $back_pg = $this->back_pg;
85 if ($a_obj_id !=
"" && !$this->lm_tree->isInTree($a_obj_id) && $cur_page_id !=
"" &&
86 $a_back_link ==
"append") {
88 $back_pg = $cur_page_id .
":" . $back_pg;
90 $back_pg = $cur_page_id;
93 if ($a_back_link ==
"reduce") {
94 $limpos = strpos($this->back_pg,
":");
97 $back_pg = substr($back_pg, strpos($back_pg,
":") + 1);
101 } elseif ($a_back_link !=
"keep") {
107 if (!$this->offline) {
108 if ($this->from_page ==
"") {
110 if (!in_array($a_frame, array(
"",
"_blank"))) {
111 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $cur_page_id);
116 if (!in_array($a_frame, array(
"",
"_blank"))) {
117 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"from_page", $this->from_page);
121 if ($a_anchor !=
"") {
122 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"anchor", rawurlencode($a_anchor));
124 if ($a_srcstring !=
"") {
125 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"srcstring", $a_srcstring);
129 $link = $this->ctrl->getLinkTargetByClass(self::TARGET_GUI,
"fullscreen",
"",
false,
false);
132 case "sourcecodeDownload":
133 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
134 $link = $this->ctrl->getLinkTargetByClass([self::TARGET_GUI,
"ilLMPageGUI"],
"",
"",
false,
false);
139 if ($back_pg !=
"") {
140 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"back_pg", $back_pg);
142 if ($a_frame !=
"") {
143 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"frame", $a_frame);
145 if ($a_obj_id !=
"") {
148 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id", $a_obj_id);
152 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $a_obj_id);
153 $link .=
"&obj_id=" . $a_obj_id;
158 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_type",
$a_type);
160 $link = $this->ctrl->getLinkTargetByClass(
169 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"frame",
"");
170 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
"");
171 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"mob_id",
"");
176 if ($this->export_all_languages) {
177 if ($this->lang !=
"" && $this->lang !=
"-") {
187 $link =
"fullscreen.html";
192 if ($a_obj_id ==
"") {
193 $a_obj_id = $this->lm_tree->getRootId();
194 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
195 $a_obj_id = $pg_node[
"obj_id"];
197 if (
$a_type ==
"StructureObject") {
198 $pg_node = $this->lm_tree->fetchSuccessorNode($a_obj_id,
"pg");
199 $a_obj_id = $pg_node[
"obj_id"];
201 if ($a_frame !=
"" && $a_frame !=
"_blank") {
202 if ($a_frame !=
"toc") {
203 $link =
"frame_" . $a_obj_id .
"_" . $a_frame . $lang_suffix .
".html";
205 $link =
"frame_" . $a_frame . $lang_suffix .
".html";
210 $link =
"lm_pg_" . $nid . $lang_suffix .
".html";
212 $link =
"lm_pg_" . $a_obj_id . $lang_suffix .
".html";
218 $link =
"term_" . $a_obj_id .
".html";
222 $link =
"media_" . $a_obj_id .
".html";
230 $this->ctrl->clearParametersByClass(self::TARGET_GUI);
245 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'faq');"],
247 "Type" =>
"Glossary",
248 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'glossary');"],
252 "OnClick" =>
"return il.LearningModule.showContentFrame(event, 'media');"]
263 $link_info =
"<LinkTargets>";
265 $link_info .=
"<LinkTarget TargetFrame=\"" . $t[
"Type"] .
"\" LinkTarget=\"" . $t[
"Frame"] .
"\" OnClick=\"" . $t[
"OnClick"] .
"\" />";
267 $link_info .=
"</LinkTargets>";
282 $showViewInFrameset =
true;
284 if ($a_layoutframes ==
"") {
285 $a_layoutframes = array();
287 $link_info =
"<IntLinkInfos>";
288 foreach ($a_int_links as $int_link) {
289 $target = $int_link[
"Target"];
290 if (substr($target, 0, 4) ==
"il__") {
293 $type = $int_link[
"Type"];
294 $targetframe = ($int_link[
"TargetFrame"] !=
"")
295 ? $int_link[
"TargetFrame"]
299 $anc = $anc_add =
"";
300 if ($int_link[
"Anchor"] !=
"") {
301 $anc = $int_link[
"Anchor"];
302 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
307 case "StructureObject":
309 if ($lm_id == $this->lm->getId() ||
310 ($targetframe !=
"None" && $targetframe !=
"New")) {
311 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
312 $nframe = ($ltarget ==
"")
315 if ($ltarget ==
"") {
316 if ($showViewInFrameset) {
317 $ltarget =
"_parent";
324 if ($this->export_format ==
"scorm" &&
330 if ($nframe !=
"" && $nframe !=
"_blank") {
346 if (!$this->offline) {
347 if (
$type ==
"PageObject") {
348 $href =
"./goto.php?target=pg_" .
$target_id . $anc_add;
353 if (
$type ==
"PageObject") {
360 if ($targetframe ==
"New") {
367 if ($targetframe ==
"None") {
368 $targetframe =
"Glossary";
370 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
371 $nframe = ($ltarget ==
"")
379 $ltarget = $a_layoutframes[$targetframe][
"Frame"];
380 $nframe = ($ltarget ==
"")
385 if ($this->offline) {
388 $this->ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
$target_id);
389 $href = $this->ctrl->getLinkTargetByClass(
396 $this->ctrl->setParameterByClass(
"illmpagegui",
"mob_id",
"");
400 case "RepositoryItem":
403 if (!$this->offline) {
404 $href =
"./goto.php?target=" . $obj_type .
"_" .
$target_id;
416 if (!$this->offline) {
417 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
418 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"il__file_" .
$target_id);
419 $href =
$ilCtrl->getLinkTargetByClass(
426 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"file_id",
"");
427 $ilCtrl->setParameterByClass(self::TARGET_GUI,
"obj_id",
$_GET[
"obj_id"]);
433 if ($obj_type ==
"usr") {
434 $this->ctrl->setParameterByClass(self::TARGET_GUI,
"obj_id", $this->current_page);
435 $back = $this->ctrl->getLinkTargetByClass(
443 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
$target_id);
444 $this->ctrl->setParameterByClass(
445 "ilpublicuserprofilegui",
451 $href = $this->ctrl->getLinkTargetByClass(
452 "ilpublicuserprofilegui",
459 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
"");
466 $anc_par =
'Anchor="' . $anc .
'"';
469 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
470 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
474 $link_info .=
"</IntLinkInfos>";
485 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)
Constructor.
Learning module presentation linker.
setOffline($offline=true)
static getGotoForWikiPageTarget($a_target, $a_offline=false)
Get goto href for internal wiki page link target.