4require_once(
"./Modules/LearningModule/classes/class.ilLMObjectGUI.php");
 
    5require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
    6require_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
 
    7require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
 
   35                parent::ilLMObjectGUI($a_content_obj);
 
   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, 
"-");
 
   88                                $page_gui->setEditPreview(
true);
 
   89                                $page_gui->activateMetaDataEditor($this->content_object->getID(),
 
   90                                        $this->obj->getId(), $this->obj->getType(),
 
   91                                        $this->obj, 
"MDUpdateListener");
 
   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);
 
  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                                                $this->ctrl->setParameter($this, 
"file_id", 
"il__file_".
$target_id);
 
  313                                                $href = $this->ctrl->getLinkTarget($this, 
"downloadFile");
 
  314                                                $this->ctrl->setParameter($this, 
"file_id", 
"");
 
  319                                $anc_par = 
'Anchor="'.$anc.
'"';
 
  321                                $link_info.=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
 
  322                                        "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
 
  325                $link_info.= 
"</IntLinkInfos>";
 
  335                require_once(
"./Services/History/classes/class.ilHistory.php");
 
  337                        "", $this->content_object->getType().
":pg",
 
  346        public static function _goto($a_target)
 
  350                $first = strpos($a_target, 
"_");
 
  351                $second = strpos($a_target, 
"_", $first + 1);
 
  352                $page_id = substr($a_target, 0, $first);
 
  355                        $page_id = substr($a_target, 0, $first);
 
  358                                $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
 
  359                                $anchor = substr($a_target, $second + 1);
 
  363                                $ref_id = substr($a_target, $first + 1);
 
  368                        $page_id = $a_target;
 
  378                if (in_array(
$ref_id, $ref_ids))
 
  380                        $ref_ids = array_merge(array(
$ref_id), $ref_ids);
 
  387                        if ($ilAccess->checkAccess(
"read", 
"", 
$ref_id))
 
  391                                $_GET[
"baseClass"] = 
"ilLMPresentationGUI";
 
  392                                $_GET[
"obj_id"] = $page_id;
 
  394                                $_GET[
"anchor"] = $anchor;
 
  395                                include_once(
"ilias.php");
 
  400                if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
  409                                $lng->loadLanguageModule(
"content");
 
  412                        include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
  427                $page_gui->setEditPreview(
true);
 
  428                $page_gui->activateMetaDataEditor($this->content_object->getID(),
 
  429                        $this->obj->getId(), $this->obj->getType(),
 
  430                        $this->obj, 
"MDUpdateListener");
 
  431                $page_gui->setActivationListener($this, 
"activatePage");
 
  432                $page_gui->setTabHook($this, 
"addPageTabs");
 
  435                $tpl->setTitle($this->lng->txt(
"page").
": ".$this->obj->getTitle());
 
  437                $ilTabs->setTabActive(
"cont_layout");
 
  439                $tpl->setContent($this->form->getHTML());
 
  451                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  459                        $im_tag = 
ilUtil::img($im, $this->content_object->getLayout());
 
  461                $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
 
  462                        $lng->txt(
"cont_lm_default_layout").
 
  463                        "</b>: ".$lng->txt(
"cont_layout_".$this->content_object->getLayout()).
 
  464                        "</td></tr></table>", 
""));
 
  473                        $layout->addOption(
new ilRadioOption(
"<table><tr><td>".$im_tag.
"</td><td><b>".
 
  474                                $lng->txt(
"cont_layout_".$l).
"</b>: ".
$lng->txt(
"cont_layout_".$l.
"_desc").
 
  475                                "</td></tr></table>", $l));
 
  478                $layout->setValue($this->obj->getLayout());
 
  479                $this->form->addItem($layout);
 
  481                $this->form->addCommandButton(
"saveLayout", 
$lng->txt(
"save"));
 
  483                $this->form->setTitle(
$lng->txt(
"cont_page_layout"));
 
  484                $this->form->setFormAction(
$ilCtrl->getFormAction($this));
 
  497                if ($this->form->checkInput())
 
  501                        $ilCtrl->redirect($this, 
"editLayout");
 
  503                $this->form->setValuesByPost();
 
  504                $tpl->setContent($this->form->getHtml());
 
  514                $ilTabs->addTarget(
"cont_layout",
 
  515                         $ilCtrl->getLinkTarget($this, 
'editLayout'), 
"editLayout");
 
  523                $pg_obj = $this->obj->getPageObject();
 
  525                $int_links = $pg_obj->getInternalLinks();
 
  526                foreach ($int_links as $il)
 
  528                        if ($il[
"Target"] == str_replace(
"_file_", 
"_dfile_", 
$_GET[
"file_id"]))
 
  532                                require_once(
"./Modules/File/classes/class.ilObjFile.php");
 
  533                                $fileObj = 
new ilObjFile($file_id, 
false);
 
  534                                $fileObj->sendFile();
 
_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.
putInTree()
put this object into content object tree
checkTree()
check the content object tree
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
_lookupContObjID($a_id)
get learning module / digibook id for lm object
Extension of ilPageObjectGUI for learning modules.
& executeCommand()
execute command
editLayout()
Edit layout of page.
initEditLayoutForm()
Init edit layout form.
ilLMPageObjectGUI(&$a_content_obj)
Constructor.
setLMPageObject($a_pg_obj)
Set content object dependent page object (co page)
downloadFile()
download file of file lists
addPageTabs()
Add page tabs.
save()
save co page object
static _goto($a_target)
redirect script
getLinkXML($a_int_links)
get link targets
updateHistory()
update history
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...
getAvailableLayouts()
get all available lm layouts
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
This class represents an option in a radio group.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
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.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)