/**
  * Constructor
  */
 function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0)
 {
     global $tpl;
     // needed for notifications
     $this->setWikiRefId($a_wiki_ref_id);
     $this->setPageToc(ilObjWiki::_lookupPageToc(ilObject::_lookupObjId($a_wiki_ref_id)));
     parent::__construct("wpg", $a_id, $a_old_nr);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $this->setEnabledMaps(true);
     $this->setPreventHTMLUnmasking(true);
     $this->setEnabledInternalLinks(true);
     $this->setEnableAnchors(true);
     $this->setEnabledWikiLinks(true);
     $this->setEnabledPCTabs(true);
     $cfg = new ilPageConfig();
     $cfg->setIntLinkFilterWhiteList(true);
     $cfg->addIntLinkFilter("RepositoryItem");
     $this->setPageConfig($cfg);
     $this->setIntLinkHelpDefault("RepositoryItem", 0);
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $tpl, $ilCtrl, $ilTabs, $ilSetting;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
     //	":nextClass:".$next_class.":"; flush();
     switch ($next_class) {
         case "ilpageobjectgui":
             // Determine whether the view of a learning resource should
             // be shown in the frameset of ilias, or in a separate window.
             //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
             $showViewInFrameset = true;
             $lm_set = new ilSetting("lm");
             $this->ctrl->setReturn($this, "edit");
             $page_gui =& new ilPageObjectGUI($this->obj->content_object->getType(), $this->obj->getId());
             $page_gui->setEditPreview(true);
             $page_gui->activateMetaDataEditor($this->content_object->getID(), $this->obj->getId(), $this->obj->getType(), $this->obj, "MDUpdateListener");
             $page_gui->setEnabledPCTabs(true);
             include_once "./Services/COPage/classes/class.ilPageConfig.php";
             $pconfig = new ilPageConfig();
             $pconfig->setPreventRteUsage(true);
             $pconfig->setUseAttachedContent(true);
             $page_gui->setPageConfig($pconfig);
             if ($ilSetting->get("block_activated_news")) {
                 $page_gui->setEnabledNews(true, $this->obj->content_object->getId(), $this->obj->content_object->getType());
             }
             // set page view link
             if ($showViewInFrameset) {
                 $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
             } else {
                 $view_frame = "ilContObj" . $this->content_object->getID();
             }
             $page_gui->setViewPageLink(ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() . "_" . $_GET["ref_id"], $view_frame);
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->content_object->getStyleSheetId(), "lm"));
             $page_gui->setIntLinkHelpDefault("StructureObject", $_GET["ref_id"]);
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->getPageObject()->buildDom();
             $int_links = $page_gui->getPageObject()->getInternalLinks();
             $link_xml = $this->getLinkXML($int_links);
             $page_gui->setLinkXML($link_xml);
             $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
             $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
             $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
             $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
             $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
             $page_gui->setPresentationTitle(ilLMPageObject::_getPresentationTitle($this->obj->getId(), $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
             $page_gui->setLocator($contObjLocator);
             $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
             $page_gui->setEnabledActivation(true);
             $page_gui->setEnabledSelfAssessment(true, false);
             $page_gui->setEnabledInternalLinks(true);
             $page_gui->setEnableKeywords(true);
             $page_gui->setEnabledInternalLinks(true);
             $page_gui->setEnableAnchors(true);
             if ($lm_set->get("time_scheduled_page_activation")) {
                 $page_gui->setEnabledScheduledActivation(true);
             }
             $page_gui->setActivationListener($this, "activatePage");
             $mset = new ilSetting("mobs");
             if ($mset->get("mep_activate_pages")) {
                 $page_gui->enableContentIncludes(true);
             }
             //$page_gui->setActivated($this->obj->getActive());
             $up_gui = $this->content_object->getType() == "dbk" ? "ilobjdlbookgui" : "ilobjlearningmodulegui";
             $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
             $page_gui->setExplorerUpdater("tree", "tree_div", $ilCtrl->getLinkTargetByClass($up_gui, "explorer", "", true));
             $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png"));
             $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
             if ($this->content_object->getLayoutPerPage()) {
                 $page_gui->setTabHook($this, "addPageTabs");
             }
             $ret = $this->ctrl->forwardCommand($page_gui);
             //$ret =& $page_gui->executeCommand();
             $tpl->setContent($ret);
             break;
         default:
             $ret =& $this->{$cmd}();
             break;
     }
 }