4 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectGUI.php");
5 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
6 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.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();
64 case "ilpageobjectgui":
69 $showViewInFrameset =
true;
72 $this->ctrl->setReturn($this,
"edit");
76 $page_gui->activateMetaDataEditor($this->content_object->getID(),
77 $this->obj->getId(), $this->obj->getType(),
79 $page_gui->setEnabledPCTabs(
true);
81 include_once(
"./Services/COPage/classes/class.ilPageConfig.php");
83 $pconfig->setPreventRteUsage(
true);
84 $pconfig->setUseAttachedContent(
true);
85 $page_gui->setPageConfig($pconfig);
87 if ($ilSetting->get(
"block_activated_news"))
89 $page_gui->setEnabledNews(
true, $this->obj->content_object->getId(),
90 $this->obj->content_object->getType());
94 if ($showViewInFrameset)
100 $view_frame =
"ilContObj".$this->content_object->getID();
102 $page_gui->setViewPageLink(ILIAS_HTTP_PATH.
"/goto.php?target=pg_".$this->obj->getId().
106 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
108 $this->content_object->getStyleSheetId(),
"lm"));
109 $page_gui->setIntLinkHelpDefault(
"StructureObject",
$_GET[
"ref_id"]);
110 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
111 $page_gui->getPageObject()->buildDom();
112 $int_links = $page_gui->getPageObject()->getInternalLinks();
114 $page_gui->setLinkXML($link_xml);
116 $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
117 $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
118 $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
119 $page_gui->setLinkParams(
"ref_id=".$this->content_object->getRefId());
120 $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
121 $page_gui->setPresentationTitle(
123 $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
124 $page_gui->setLocator($contObjLocator);
125 $page_gui->setHeader($this->lng->txt(
"page").
": ".$this->obj->getTitle());
126 $page_gui->setEnabledActivation(
true);
127 $page_gui->setEnabledSelfAssessment(
true,
false);
128 $page_gui->setEnabledInternalLinks(
true);
129 $page_gui->setEnableKeywords(
true);
130 $page_gui->setEnabledInternalLinks(
true);
131 $page_gui->setEnableAnchors(
true);
132 if ($lm_set->get(
"time_scheduled_page_activation"))
134 $page_gui->setEnabledScheduledActivation(
true);
136 $page_gui->setActivationListener($this,
"activatePage");
139 if ($mset->get(
"mep_activate_pages"))
141 $page_gui->enableContentIncludes(
true);
146 $up_gui = ($this->content_object->getType() ==
"dbk")
148 :
"ilobjlearningmodulegui";
149 $ilCtrl->setParameterByClass($up_gui,
"active_node", $this->obj->getId());
150 $page_gui->setExplorerUpdater(
"tree",
"tree_div",
151 $ilCtrl->getLinkTargetByClass($up_gui,
"explorer",
"",
true));
154 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
155 if ($this->content_object->getLayoutPerPage())
157 $page_gui->setTabHook($this,
"addPageTabs");
159 $ret = $this->ctrl->forwardCommand($page_gui);
162 $tpl->setContent(
$ret);
178 $this->ctrl->setCmdClass(
"ilpageobjectgui");
179 $this->ctrl->setCmd(
"edit");
189 $this->ctrl->setCmdClass(
"ilpageobjectgui");
190 $this->ctrl->setCmd(
"preview");
201 $this->obj->setType(
"pg");
204 $this->obj->setLMId($this->content_object->getId());
205 $this->obj->create();
210 if (
$_GET[
"obj_id"] != 0)
220 $up_gui = ($this->content_object->getType() ==
"dbk")
222 :
"ilobjlearningmodulegui";
223 $this->ctrl->redirectByClass($up_gui,
"pages");
231 if (
$_GET[
"obj_id"] != 0)
236 $up_gui = ($this->content_object->getType() ==
"dbk")
238 :
"ilobjlearningmodulegui";
239 $this->ctrl->redirectByClass($up_gui,
"pages");
247 if ($a_layoutframes ==
"")
249 $a_layoutframes = array();
251 $link_info =
"<IntLinkInfos>";
252 foreach ($a_int_links as $int_link)
254 $target = $int_link[
"Target"];
255 if (substr($target, 0, 4) ==
"il__")
259 $type = $int_link[
"Type"];
260 $targetframe = ($int_link[
"TargetFrame"] !=
"")
261 ? $int_link[
"TargetFrame"]
265 $anc = $anc_add =
"";
266 if ($int_link[
"Anchor"] !=
"")
268 $anc = $int_link[
"Anchor"];
269 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
275 case "StructureObject":
278 if ($lm_id == $cont_obj->getId())
281 if ($type ==
"PageObject")
283 $this->ctrl->setParameter($this,
"obj_id",
$target_id);
284 $href = $this->ctrl->getLinkTargetByClass(get_class($this),
"edit");
288 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$target_id);
289 $href = $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view");
291 $href = str_replace(
"&",
"&", $href);
292 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
296 if ($type ==
"PageObject")
298 $href =
"goto.php?target=pg_".$target_id.$anc_add;
302 $href =
"goto.php?target=st_".$target_id;
304 $ltarget =
"ilContObj".$lm_id;
309 $ltarget = $nframe =
"_blank";
310 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&".
311 "obj_type=$type&cmd=glossary&ref_id=".$_GET[
"ref_id"].
312 "&obj_id=".$target_id.
"&frame=$nframe";
316 $ltarget = $nframe =
"_blank";
317 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=".$_GET[
"ref_id"].
318 "&mob_id=".$target_id.
"&frame=$nframe";
321 case "RepositoryItem":
324 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
330 $anc_par =
'Anchor="'.$anc.
'"';
332 $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
333 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
336 $link_info.=
"</IntLinkInfos>";
346 require_once(
"./Services/History/classes/class.ilHistory.php");
348 "", $this->content_object->getType().
":pg",
361 $first = strpos($a_target,
"_");
362 $second = strpos($a_target,
"_", $first + 1);
363 $page_id = substr($a_target, 0, $first);
366 $page_id = substr($a_target, 0, $first);
369 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
370 $anchor = substr($a_target, $second + 1);
374 $ref_id = substr($a_target, $first + 1);
379 $page_id = $a_target;
389 if (in_array(
$ref_id, $ref_ids))
391 $ref_ids = array_merge(array(
$ref_id), $ref_ids);
398 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
402 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
403 $_GET[
"obj_id"] = $page_id;
405 $_GET[
"anchor"] = $anchor;
406 include_once(
"ilias.php");
411 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
420 $lng->loadLanguageModule(
"content");
423 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
427 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
437 $page_gui =&
new ilPageObjectGUI($this->obj->content_object->getType(),
438 $this->obj->getId());
440 $page_gui->activateMetaDataEditor($this->content_object->getID(),
441 $this->obj->getId(), $this->obj->getType(),
443 $page_gui->setActivationListener($this,
"activatePage");
444 $page_gui->setTabHook($this,
"addPageTabs");
445 $page_gui->setEnabledActivation(
true);
447 if ($lm_set->get(
"time_scheduled_page_activation"))
449 $page_gui->setEnabledScheduledActivation(
true);
452 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
453 $ilCtrl->getHTML($page_gui);
454 $ilTabs->setTabActive(
"cont_layout");
456 $tpl->setContent($this->form->getHTML());
468 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
476 $im_tag =
ilUtil::img($im, $this->content_object->getLayout());
479 "<table><tr><td>".$im_tag.
"</td><td><b>".$lng->txt(
"cont_lm_default_layout").
480 "</b>: ".$lng->txt(
"cont_layout_".$this->content_object->getLayout()).
"</td></tr></table>";
488 $option[$l] =
"<table><tr><td>".$im_tag.
"</td><td><b>".$lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".$l.
"_desc").
"</td></tr></table>";
491 $layout->setValue($this->obj->getLayout());
492 $this->form->addItem($layout);
494 $this->form->addCommandButton(
"saveLayout", $lng->txt(
"save"));
496 $this->form->setTitle($lng->txt(
"cont_page_layout"));
497 $this->form->setFormAction($ilCtrl->getFormAction($this));
510 if ($this->form->checkInput())
514 $ilCtrl->redirect($this,
"editLayout");
516 $this->form->setValuesByPost();
517 $tpl->setContent($this->form->getHtml());
527 $ilTabs->addTarget(
"cont_layout",
528 $ilCtrl->getLinkTarget($this,
'editLayout'),
"editLayout");