/** * forward command to page object */ function &forwardToPageObject() { global $lng, $ilTabs, $ilCtrl; $cmd = $ilCtrl->getCmd(); if (in_array($cmd, array("displayMediaFullscreen", "downloadFile"))) { $this->checkPermission("read"); } else { $this->checkPermission("write"); } $ilTabs->clearTargets(); if ($_GET["redirectSource"] == "ilinternallinkgui") { exit; } $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { $ilTabs->setBackTarget($lng->txt("cntr_back_to_old_editor"), $ilCtrl->getLinkTarget($this, "switchToOldEditor"), "_top"); } else { $ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=" . $this->object->getType() . "_" . $this->object->getRefId(), "_top"); } // page object include_once "./Services/Container/classes/class.ilContainerPage.php"; include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; $lng->loadLanguageModule("content"); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())); $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); if (!ilContainerPage::_exists("cont", $this->object->getId())) { // doesn't exist -> create new one $new_page_object = new ilContainerPage(); $new_page_object->setParentId($this->object->getId()); $new_page_object->setId($this->object->getId()); $new_page_object->createFromXML(); } // get page object $this->ctrl->setReturnByClass("ilcontainerpagegui", "edit"); $page_gui = new ilContainerPageGUI($this->object->getId()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), $this->object->getType())); $page_gui->setTemplateTargetVar("ADM_CONTENT"); $page_gui->setLinkXML($link_xml); $page_gui->setFileDownloadLink(""); $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen")); //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); // old editor information text $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { $wtpl = new ilTemplate("tpl.cntr_old_editor_message.html", true, true, "Services/Container"); $wtpl->setVariable("ALT_WARNING", $lng->txt("warning")); $wtpl->setVariable("IMG_WARNING", ilUtil::getImagePath("icon_alert.svg")); $wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message")); $wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message")); $wtpl->setVariable("HREF_SWITCH_TO_NEW_EDITOR", $ilCtrl->getLinkTarget($this, "useNewEditor")); $wtpl->setVariable("TXT_MIGRATION_SWITCH", $lng->txt("cntr_switch_to_new_editor_cmd")); $page_gui->setPrependingHtml($wtpl->get()); } // style tab $page_gui->setTabHook($this, "addPageTabs"); $ret = $this->ctrl->forwardCommand($page_gui); //$ret =& $page_gui->executeCommand(); return $ret; }
/** * Clone container settings * * @access public * @param int target ref_id * @param int copy id * @return object new object */ public function cloneObject($a_target_id, $a_copy_id = 0) { $new_obj = parent::cloneObject($a_target_id, $a_copy_id); include_once './Services/Container/classes/class.ilContainerSortingSettings.php'; $sorting = new ilContainerSortingSettings($new_obj->getId()); $sorting->setSortMode($this->getOrderType()); $sorting->update(); // copy content page include_once "./Services/Container/classes/class.ilContainerPage.php"; if (ilContainerPage::_exists("cont", $this->getId())) { $orig_page = new ilContainerPage($this->getId()); $new_page_object = new ilContainerPage(); $new_page_object->setParentId($new_obj->getId()); $new_page_object->setId($new_obj->getId()); $new_page_object->createFromXML(); $new_page_object->setXMLContent($orig_page->getXMLContent()); $new_page_object->buildDom(true); $new_page_object->update(); } return $new_obj; }