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 (
"./Modules/LearningModule/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());
136 $page_gui->setExplorerUpdater(
"tree",
"tree_div",
137 $ilCtrl->getLinkTargetByClass($up_gui,
"explorer",
"",
true));
140 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
141 if ($this->content_object->getLayoutPerPage())
143 $page_gui->setTabHook($this,
"addPageTabs");
145 $ret = $this->ctrl->forwardCommand($page_gui);
146 $tpl->setContent(
$ret);
162 $this->ctrl->setCmdClass(
"ilLMPageGUI");
163 $this->ctrl->setCmd(
"edit");
173 $this->ctrl->setCmdClass(
"ilLMPageGUI");
174 $this->ctrl->setCmd(
"preview");
185 $this->obj->setType(
"pg");
188 $this->obj->setLMId($this->content_object->getId());
189 $this->obj->create();
194 if (
$_GET[
"obj_id"] != 0)
204 $up_gui = ($this->content_object->getType() ==
"dbk")
206 :
"ilobjlearningmodulegui";
207 $this->ctrl->redirectByClass($up_gui,
"pages");
215 if (
$_GET[
"obj_id"] != 0)
220 $up_gui = ($this->content_object->getType() ==
"dbk")
222 :
"ilobjlearningmodulegui";
223 $this->ctrl->redirectByClass($up_gui,
"pages");
231 if ($a_layoutframes ==
"")
233 $a_layoutframes = array();
235 $link_info =
"<IntLinkInfos>";
236 foreach ($a_int_links as $int_link)
238 $target = $int_link[
"Target"];
239 if (substr($target, 0, 4) ==
"il__")
243 $type = $int_link[
"Type"];
244 $targetframe = ($int_link[
"TargetFrame"] !=
"")
245 ? $int_link[
"TargetFrame"]
249 $anc = $anc_add =
"";
250 if ($int_link[
"Anchor"] !=
"")
252 $anc = $int_link[
"Anchor"];
253 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
259 case "StructureObject":
262 if ($lm_id == $cont_obj->getId())
265 if ($type ==
"PageObject")
267 $this->ctrl->setParameter($this,
"obj_id",
$target_id);
268 $href = $this->ctrl->getLinkTargetByClass(get_class($this),
"edit");
272 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$target_id);
273 $href = $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view");
275 $href = str_replace(
"&",
"&", $href);
276 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
280 if ($type ==
"PageObject")
282 $href =
"goto.php?target=pg_".$target_id.$anc_add;
286 $href =
"goto.php?target=st_".$target_id;
288 $ltarget =
"ilContObj".$lm_id;
293 $ltarget = $nframe =
"_blank";
294 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&".
295 "obj_type=$type&cmd=glossary&ref_id=".$_GET[
"ref_id"].
296 "&obj_id=".$target_id.
"&frame=$nframe";
300 $ltarget = $nframe =
"_blank";
301 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=".$_GET[
"ref_id"].
302 "&mob_id=".$target_id.
"&frame=$nframe";
305 case "RepositoryItem":
308 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
314 $anc_par =
'Anchor="'.$anc.
'"';
316 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
317 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
320 $link_info.=
"</IntLinkInfos>";
330 require_once(
"./Services/History/classes/class.ilHistory.php");
332 "", $this->content_object->getType().
":pg",
345 $first = strpos($a_target,
"_");
346 $second = strpos($a_target,
"_", $first + 1);
347 $page_id = substr($a_target, 0, $first);
350 $page_id = substr($a_target, 0, $first);
353 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
354 $anchor = substr($a_target, $second + 1);
358 $ref_id = substr($a_target, $first + 1);
363 $page_id = $a_target;
373 if (in_array(
$ref_id, $ref_ids))
375 $ref_ids = array_merge(array(
$ref_id), $ref_ids);
382 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
386 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
387 $_GET[
"obj_id"] = $page_id;
389 $_GET[
"anchor"] = $anchor;
390 include_once(
"ilias.php");
395 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
404 $lng->loadLanguageModule(
"content");
407 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
411 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
423 $page_gui->activateMetaDataEditor($this->content_object->getID(),
424 $this->obj->getId(), $this->obj->getType(),
426 $page_gui->setActivationListener($this,
"activatePage");
427 $page_gui->setTabHook($this,
"addPageTabs");
430 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
431 $ilCtrl->getHTML($page_gui);
432 $ilTabs->setTabActive(
"cont_layout");
434 $tpl->setContent($this->form->getHTML());
446 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
454 $im_tag =
ilUtil::img($im, $this->content_object->getLayout());
456 $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
457 $lng->txt(
"cont_lm_default_layout").
458 "</b>: ".$lng->txt(
"cont_layout_".$this->content_object->getLayout()).
459 "</td></tr></table>",
""));
468 $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
469 $lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".$l.
"_desc").
470 "</td></tr></table>", $l));
473 $layout->setValue($this->obj->getLayout());
474 $this->form->addItem($layout);
476 $this->form->addCommandButton(
"saveLayout", $lng->txt(
"save"));
478 $this->form->setTitle($lng->txt(
"cont_page_layout"));
479 $this->form->setFormAction($ilCtrl->getFormAction($this));
492 if ($this->form->checkInput())
496 $ilCtrl->redirect($this,
"editLayout");
498 $this->form->setValuesByPost();
499 $tpl->setContent($this->form->getHtml());
509 $ilTabs->addTarget(
"cont_layout",
510 $ilCtrl->getLinkTarget($this,
'editLayout'),
"editLayout");