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");
33 parent::__construct($a_content_obj);
43 $this->obj = $a_pg_obj;
44 $this->obj->setLMId($this->content_object->getId());
54 $next_class = $this->ctrl->getNextClass($this);
55 $cmd = $this->ctrl->getCmd();
67 $showViewInFrameset =
true;
70 $this->ctrl->setReturn($this,
"edit");
74 if (
$_GET[
"totransl"] ==
"")
77 $ilCtrl->setCmd(
"switchToLanguage");
79 $ilCtrl->setCmdClass(
"illmpagegui");
80 $page_gui =
new ilLMPageGUI($this->obj->getId(), 0,
false,
"-");
87 $page_gui->activateMetaDataEditor($this->content_object,
88 $this->obj->getType(), $this->obj->getId(),
90 if ($ilSetting->get(
"block_activated_news"))
92 $page_gui->setEnabledNews(
true, $this->obj->content_object->getId(),
93 $this->obj->content_object->getType());
97 if ($showViewInFrameset)
103 $view_frame =
"ilContObj".$this->content_object->getID();
105 $page_gui->setViewPageLink(ILIAS_HTTP_PATH.
"/goto.php?target=pg_".$this->obj->getId().
109 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
111 $this->content_object->getStyleSheetId(),
"lm"));
112 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
113 $page_gui->getPageObject()->buildDom();
114 $int_links = $page_gui->getPageObject()->getInternalLinks();
116 $page_gui->setLinkXML($link_xml);
118 $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
119 $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
120 $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
121 $page_gui->setLinkParams(
"ref_id=".$this->content_object->getRefId());
122 $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=".
$_GET[
"ref_id"].
"&baseClass=ilLMPresentationGUI");
123 $page_gui->setPresentationTitle(
125 $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
126 $page_gui->setLocator($contObjLocator);
127 $page_gui->setHeader($this->lng->txt(
"page").
": ".$this->obj->getTitle());
128 $page_gui->setActivationListener($this,
"activatePage");
130 $up_gui =
"ilobjlearningmodulegui";
131 $ilCtrl->setParameterByClass($up_gui,
"active_node", $this->obj->getId());
134 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
135 if ($this->content_object->getLayoutPerPage())
137 $page_gui->setTabHook($this,
"addPageTabs");
139 $ret = $this->ctrl->forwardCommand($page_gui);
140 $tpl->setContent(
$ret);
156 $this->ctrl->setCmdClass(
"ilLMPageGUI");
157 $this->ctrl->setCmd(
"edit");
167 $this->ctrl->setCmdClass(
"ilLMPageGUI");
168 $this->ctrl->setCmd(
"preview");
179 $this->obj->setType(
"pg");
182 $this->obj->setLMId($this->content_object->getId());
183 $this->obj->create();
188 if (
$_GET[
"obj_id"] != 0)
198 $up_gui =
"ilobjlearningmodulegui";
199 $this->ctrl->redirectByClass($up_gui,
"pages");
207 if (
$_GET[
"obj_id"] != 0)
212 $up_gui =
"ilobjlearningmodulegui";
213 $this->ctrl->redirectByClass($up_gui,
"pages");
221 if ($a_layoutframes ==
"")
223 $a_layoutframes =
array();
225 $link_info =
"<IntLinkInfos>";
226 foreach ($a_int_links as $int_link)
229 if (substr(
$target, 0, 4) ==
"il__")
233 $type = $int_link[
"Type"];
234 $targetframe = ($int_link[
"TargetFrame"] !=
"")
235 ? $int_link[
"TargetFrame"]
239 $anc = $anc_add =
"";
240 if ($int_link[
"Anchor"] !=
"")
242 $anc = $int_link[
"Anchor"];
243 $anc_add =
"_".rawurlencode($int_link[
"Anchor"]);
249 case "StructureObject":
252 if ($lm_id == $cont_obj->getId())
255 if ($type ==
"PageObject")
257 $this->ctrl->setParameter($this,
"obj_id",
$target_id);
258 $href = $this->ctrl->getLinkTargetByClass(get_class($this),
"edit");
262 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$target_id);
263 $href = $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view");
265 $href = str_replace(
"&",
"&", $href);
266 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
270 if ($type ==
"PageObject")
272 $href =
"goto.php?target=pg_".$target_id.$anc_add;
276 $href =
"goto.php?target=st_".$target_id;
278 $ltarget =
"ilContObj".$lm_id;
287 $ltarget = $nframe =
"_blank";
288 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&".
289 "obj_type=$type&cmd=glossary&ref_id=".$_GET[
"ref_id"].
290 "&obj_id=".$target_id.
"&frame=$nframe";
294 $ltarget = $nframe =
"_blank";
295 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=".$_GET[
"ref_id"].
296 "&mob_id=".$target_id.
"&frame=$nframe";
299 case "RepositoryItem":
302 $href =
"./goto.php?target=".$obj_type.
"_".
$target_id;
308 $this->ctrl->setParameter($this,
"file_id",
"il__file_".
$target_id);
309 $href = $this->ctrl->getLinkTarget($this,
"downloadFile");
310 $this->ctrl->setParameter($this,
"file_id",
"");
317 $anc_par =
'Anchor="' . $anc .
'"';
318 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
319 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
323 $link_info.=
"</IntLinkInfos>";
333 require_once(
"./Services/History/classes/class.ilHistory.php");
335 "", $this->content_object->getType().
":pg",
344 public static function _goto($a_target)
348 $first = strpos($a_target,
"_");
349 $second = strpos($a_target,
"_", $first + 1);
350 $page_id = substr($a_target, 0, $first);
353 $page_id = substr($a_target, 0, $first);
356 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
357 $anchor = substr($a_target, $second + 1);
361 $ref_id = substr($a_target, $first + 1);
366 $page_id = $a_target;
376 if (in_array(
$ref_id, $ref_ids))
385 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
389 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
390 $_GET[
"obj_id"] = $page_id;
392 $_GET[
"anchor"] = $anchor;
393 include_once(
"ilias.php");
398 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
407 $lng->loadLanguageModule(
"content");
410 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
414 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
426 $page_gui->activateMetaDataEditor($this->content_object,
427 $this->obj->getType(), $this->obj->getId(),
429 $page_gui->setActivationListener($this,
"activatePage");
430 $page_gui->setTabHook($this,
"addPageTabs");
433 $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
434 $ilCtrl->getHTML($page_gui);
435 $ilTabs->setTabActive(
"cont_layout");
437 $tpl->setContent($this->form->getHTML());
449 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
457 $im_tag =
ilUtil::img($im, $this->content_object->getLayout());
460 $lng->txt(
"cont_lm_default_layout").
461 "</b>: ".$lng->txt(
"cont_layout_".$this->content_object->getLayout()).
462 "</td></tr></table>",
""));
472 $lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".
$l.
"_desc").
473 "</td></tr></table>",
$l));
476 $layout->setValue($this->obj->getLayout());
479 $this->form->addCommandButton(
"saveLayout", $lng->txt(
"save"));
481 $this->form->setTitle($lng->txt(
"cont_page_layout"));
482 $this->form->setFormAction($ilCtrl->getFormAction($this));
495 if ($this->form->checkInput())
499 $ilCtrl->redirect($this,
"editLayout");
501 $this->form->setValuesByPost();
502 $tpl->setContent($this->form->getHtml());
512 $ilTabs->addTarget(
"cont_layout",
513 $ilCtrl->getLinkTarget($this,
'editLayout'),
"editLayout");
521 $pg_obj = $this->obj->getPageObject();
523 $int_links = $pg_obj->getInternalLinks();
524 foreach ($int_links as $il)
526 if ($il[
"Target"] == str_replace(
"_file_",
"_dfile_",
$_GET[
"file_id"]))
530 require_once(
"./Modules/File/classes/class.ilObjFile.php");
531 $fileObj =
new ilObjFile($file_id,
false);
532 $fileObj->sendFile();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
This class represents an option in a radio group.
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
checkTree()
check the content object tree
static getAvailableLayouts()
get all available lm layouts
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
__construct(&$a_content_obj)
Constructor.
static _getAllReferences($a_id)
get all reference ids of object
static _goto($a_target)
redirect script
setLMPageObject($a_pg_obj)
Set content object dependent page object (co page)
save()
save co page object
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
Extension of ilPageObjectGUI for learning modules.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
addPageTabs()
Add page tabs.
editLayout()
Edit layout of page.
putInTree()
put this object into content object tree
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
executeCommand()
execute command
initEditLayoutForm()
Init edit layout form.
getLinkXML($a_int_links)
get link targets
static _getPresentationTitle($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
downloadFile()
download file of file lists
updateHistory()
update history
static redirect($a_script)
http redirect to other script