4 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectGUI.php");
5 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
6 require_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
7 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
45 $this->obj = $a_pg_obj;
46 $this->obj->setLMId($this->content_object->getId());
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
69 $showViewInFrameset =
true;
72 $this->ctrl->setReturn($this,
"edit");
76 if (
$_GET[
"totransl"] ==
"")
79 $ilCtrl->setCmd(
"switchToLanguage");
81 $ilCtrl->setCmdClass(
"illmpagegui");
82 $page_gui =
new ilLMPageGUI($this->obj->getId(), 0,
false,
"-");
89 $page_gui->activateMetaDataEditor($this->content_object->getID(),
90 $this->obj->getId(), $this->obj->getType(),
92 if ($ilSetting->get(
"block_activated_news"))
94 $page_gui->setEnabledNews(
true, $this->obj->content_object->getId(),
95 $this->obj->content_object->getType());
99 if ($showViewInFrameset)
105 $view_frame =
"ilContObj".$this->content_object->getID();
107 $page_gui->setViewPageLink(ILIAS_HTTP_PATH.
"/goto.php?target=pg_".$this->obj->getId().
111 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
113 $this->content_object->getStyleSheetId(),
"lm"));
114 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
115 $page_gui->getPageObject()->buildDom();
116 $int_links = $page_gui->getPageObject()->getInternalLinks();
118 $page_gui->setLinkXML($link_xml);
120 $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
121 $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
122 $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
123 $page_gui->setLinkParams(
"ref_id=".$this->content_object->getRefId());
124 $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
125 $page_gui->setPresentationTitle(
127 $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
128 $page_gui->setLocator($contObjLocator);
129 $page_gui->setHeader($this->lng->txt(
"page").
": ".$this->obj->getTitle());
130 $page_gui->setActivationListener($this,
"activatePage");
132 $up_gui = ($this->content_object->getType() ==
"dbk")
134 :
"ilobjlearningmodulegui";
135 $ilCtrl->setParameterByClass($up_gui,
"active_node", $this->obj->getId());
138 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
139 if ($this->content_object->getLayoutPerPage())
141 $page_gui->setTabHook($this,
"addPageTabs");
143 $ret = $this->ctrl->forwardCommand($page_gui);
144 $tpl->setContent(
$ret);
160 $this->ctrl->setCmdClass(
"ilLMPageGUI");
161 $this->ctrl->setCmd(
"edit");
171 $this->ctrl->setCmdClass(
"ilLMPageGUI");
172 $this->ctrl->setCmd(
"preview");
183 $this->obj->setType(
"pg");
186 $this->obj->setLMId($this->content_object->getId());
187 $this->obj->create();
192 if (
$_GET[
"obj_id"] != 0)
202 $up_gui = ($this->content_object->getType() ==
"dbk")
204 :
"ilobjlearningmodulegui";
205 $this->ctrl->redirectByClass($up_gui,
"pages");
213 if (
$_GET[
"obj_id"] != 0)
218 $up_gui = ($this->content_object->getType() ==
"dbk")
220 :
"ilobjlearningmodulegui";
221 $this->ctrl->redirectByClass($up_gui,
"pages");
229 if ($a_layoutframes ==
"")
231 $a_layoutframes = array();
233 $link_info =
"<IntLinkInfos>";
234 foreach ($a_int_links as $int_link)
236 $target = $int_link[
"Target"];
237 if (substr($target, 0, 4) ==
"il__")
241 $type = $int_link[
"Type"];
242 $targetframe = ($int_link[
"TargetFrame"] !=
"")
243 ? $int_link[
"TargetFrame"]
247 $anc = $anc_add =
"";
248 if ($int_link[
"Anchor"] !=
"")
250 $anc = $int_link[
"Anchor"];
251 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
257 case "StructureObject":
260 if ($lm_id == $cont_obj->getId())
263 if ($type ==
"PageObject")
265 $this->ctrl->setParameter($this,
"obj_id",
$target_id);
266 $href = $this->ctrl->getLinkTargetByClass(get_class($this),
"edit");
270 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$target_id);
271 $href = $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view");
273 $href = str_replace(
"&",
"&", $href);
274 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
278 if ($type ==
"PageObject")
280 $href =
"goto.php?target=pg_".$target_id.$anc_add;
284 $href =
"goto.php?target=st_".$target_id;
286 $ltarget =
"ilContObj".$lm_id;
291 $ltarget = $nframe =
"_blank";
292 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&".
293 "obj_type=$type&cmd=glossary&ref_id=".$_GET[
"ref_id"].
294 "&obj_id=".$target_id.
"&frame=$nframe";
298 $ltarget = $nframe =
"_blank";
299 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=".$_GET[
"ref_id"].
300 "&mob_id=".$target_id.
"&frame=$nframe";
303 case "RepositoryItem":
306 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
312 $anc_par =
'Anchor="'.$anc.
'"';
314 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
315 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
318 $link_info.=
"</IntLinkInfos>";
328 require_once(
"./Services/History/classes/class.ilHistory.php");
330 "", $this->content_object->getType().
":pg",
339 public static function _goto($a_target)
343 $first = strpos($a_target,
"_");
344 $second = strpos($a_target,
"_", $first + 1);
345 $page_id = substr($a_target, 0, $first);
348 $page_id = substr($a_target, 0, $first);
351 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
352 $anchor = substr($a_target, $second + 1);
356 $ref_id = substr($a_target, $first + 1);
361 $page_id = $a_target;
371 if (in_array(
$ref_id, $ref_ids))
373 $ref_ids = array_merge(array(
$ref_id), $ref_ids);
380 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
384 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
385 $_GET[
"obj_id"] = $page_id;
387 $_GET[
"anchor"] = $anchor;
388 include_once(
"ilias.php");
393 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
402 $lng->loadLanguageModule(
"content");
405 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
409 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
421 $page_gui->activateMetaDataEditor($this->content_object->getID(),
422 $this->obj->getId(), $this->obj->getType(),
424 $page_gui->setActivationListener($this,
"activatePage");
425 $page_gui->setTabHook($this,
"addPageTabs");
428 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
429 $ilCtrl->getHTML($page_gui);
430 $ilTabs->setTabActive(
"cont_layout");
432 $tpl->setContent($this->form->getHTML());
444 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
452 $im_tag =
ilUtil::img($im, $this->content_object->getLayout());
454 $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
455 $lng->txt(
"cont_lm_default_layout").
456 "</b>: ".$lng->txt(
"cont_layout_".$this->content_object->getLayout()).
457 "</td></tr></table>",
""));
466 $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
467 $lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".$l.
"_desc").
468 "</td></tr></table>", $l));
471 $layout->setValue($this->obj->getLayout());
472 $this->form->addItem($layout);
474 $this->form->addCommandButton(
"saveLayout", $lng->txt(
"save"));
476 $this->form->setTitle($lng->txt(
"cont_page_layout"));
477 $this->form->setFormAction($ilCtrl->getFormAction($this));
490 if ($this->form->checkInput())
494 $ilCtrl->redirect($this,
"editLayout");
496 $this->form->setValuesByPost();
497 $tpl->setContent($this->form->getHtml());
507 $ilTabs->addTarget(
"cont_layout",
508 $ilCtrl->getLinkTarget($this,
'editLayout'),
"editLayout");