function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping) { // see ilStyleExporter::getXmlRepresentation() if (preg_match("/<StyleSheetExport><ImagePath>(.+)<\\/ImagePath>/", $a_xml, $hits)) { $path = $hits[1]; $a_xml = str_replace($hits[0], "", $a_xml); $a_xml = str_replace("</StyleSheetExport>", "", $a_xml); } // temp xml-file $tmp_file = $this->getImportDirectory() . "/sty_" . $a_id . ".xml"; file_put_contents($tmp_file, $a_xml); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet(); $style->createFromXMLFile($tmp_file); $new_id = $style->getId(); unlink($tmp_file); // images if ($path) { $source = $this->getImportDirectory() . "/" . $path; if (is_dir($source)) { $target = $style->getImagesDirectory(); if (!is_dir($target)) { ilUtil::makeDirParents($target); } ilUtil::rCopy($source, $target); } } $a_mapping->addMapping("Services/Style", "sty", $a_id, $new_id); }
public function getXmlRepresentation($a_entity, $a_schema_version, $a_id) { include_once "Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet($a_id, false); // images $target = $this->getAbsoluteExportDirectory(); if ($target && !is_dir($target)) { ilUtil::makeDirParents($target); } ilUtil::rCopy($style->getImagesDirectory(), $target); return "<StyleSheetExport>" . "<ImagePath>" . $this->getRelativeExportDirectory() . "</ImagePath>" . $style->getXML() . "</StyleSheetExport>"; }
/** * Constructor * * @param object $a_parent_obj * @param int $table_id * @param int $a_definition_id */ public function __construct($table_id, $a_definition_id = 0) { global $tpl; //TODO Permission-Check $this->table_id = $table_id; if (!$a_definition_id) { $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id); } // we always need a page object - create on demand if (!$a_definition_id) { $viewdef = new ilDataCollectionRecordViewViewdefinition(0, $this->table_id); $viewdef->create(); $a_definition_id = $viewdef->getId(); } parent::__construct("dclf", $a_definition_id); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // config $this->setPreventHTMLUnmasking(true); $this->setEnabledPCTabs(true); $this->setEnabledMaps(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledActivation(false); }
/** * Render COPage * * @see ilContainerGUI * @return string */ protected function getPageHTML() { global $tpl, $ilSetting, $ilUser; if (!$ilSetting->get("enable_cat_page_edit")) { return; } $page_id = $this->start_object->getObjId(); // if page does not exist, return nothing include_once "./Services/COPage/classes/class.ilPageUtil.php"; if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) { return; } include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); include_once "./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $page_gui = new ilContainerStartObjectsPageGUI($page_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $page_gui->setPresentationTitle(""); $page_gui->setTemplateOutput(false); $page_gui->setHeader(""); return $page_gui->showPage(); }
/** * Constructor */ public function __construct() { global $tpl; if (!ilImprint::_exists("impr", 1)) { $page = new ilImprint("impr"); $page->setId(1); $page->create(); } // there is only 1 imprint page parent::__construct("impr", 1); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // config $this->setPreventHTMLUnmasking(true); $this->setEnabledPCTabs(true); $this->setEnabledMaps(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledActivation(true); }
public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids) { $res = array(); // postings include_once "./Modules/Blog/classes/class.ilBlogPosting.php"; $pg_ids = array(); foreach ($a_ids as $id) { $pages = ilBlogPosting::getAllPostings($id); foreach (array_keys($pages) as $p) { $pg_ids[] = "blp:" . $p; } } if (sizeof($pg_ids)) { $res[] = array("component" => "Services/COPage", "entity" => "pg", "ids" => $pg_ids); } // style $style_ids = array(); foreach ($a_ids as $id) { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style_id = ilObjStyleSheet::lookupObjectStyle($id); if ($style_id > 0) { $style_ids[] = $style_id; } } if (sizeof($style_ids)) { $res[] = array("component" => "Services/Style", "entity" => "sty", "ids" => $style_ids); } return $res; }
/** * Constructor */ function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true) { global $tpl, $ilSetting; $this->portfolio_id = (int) $a_portfolio_id; $this->enable_comments = (bool) $a_enable_comments; parent::__construct("prtf", $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(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // #11190 $prfa_set = new ilSetting("prfa"); $this->setPreventHTMLUnmasking((bool) $prfa_set->get("mask", false)); // $this->setEnabledMaps(true); $this->setEnabledInternalLinks(false); $this->setEnabledPCTabs(true); $this->setEnabledProfile(true); if (!$ilSetting->get('disable_wsp_certificates')) { $this->setEnabledVerification(true); } /* embedding blog postings currently disabled if(!$ilSetting->get('disable_wsp_blogs')) { $this->setEnabledBlog(true); } */ $skmg_set = new ilSetting("skmg"); if ($skmg_set->get("enable_skmg")) { $this->setEnabledSkills(true); } }
/** * @param $table_id * @param int $a_definition_id */ public function __construct($table_id, $a_definition_id = 0) { global $tpl, $ilCtrl; /** * @var $ilCtrl ilCtrl */ $this->ctrl = $ilCtrl; //TODO Permission-Check $this->table_id = $table_id; if (!$a_definition_id) { $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id); } // we always need a page object - create on demand if (!$a_definition_id) { $viewdef = new ilDataCollectionRecordViewViewdefinition(); $viewdef->setTableId($this->table_id); $viewdef->setActive(false); $viewdef->create(); $a_definition_id = $viewdef->getId(); } parent::__construct("dclf", $a_definition_id); $this->getPageObject()->setTableId($this->table_id); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
public function forwardToPageObject() { global $lng, $ilTabs; $ilTabs->clearTargets(); $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top'); // page object include_once 'Services/COPage/classes/class.ilPageObject.php'; include_once 'Services/COPage/classes/class.ilPageObjectGUI.php'; $lng->loadLanguageModule('content'); include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0)); if (!ilPageObject::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID)) { // doesn't exist -> create new one $new_page_object = new ilPageObject('shop'); $new_page_object->setParentId(0); $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID); $new_page_object->createFromXML(); } $this->ctrl->setReturnByClass('ilpageobjectgui', 'edit'); $page_gui = new ilPageObjectGUI('shop', self::SHOP_PAGE_EDITOR_PAGE_ID); $page_gui->setIntLinkHelpDefault('StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID); $page_gui->setTemplateTargetVar('ADM_CONTENT'); $page_gui->setLinkXML(''); $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'downloadFile')); $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'displayMediaFullscreen')); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'download_paragraph')); $page_gui->setPresentationTitle(''); $page_gui->setTemplateOutput(false); $page_gui->setHeader(''); $page_gui->setEnabledRepositoryObjects(false); $page_gui->setEnabledFileLists(true); $page_gui->setEnabledMaps(true); $page_gui->setEnabledPCTabs(true); return $this->ctrl->forwardCommand($page_gui); }
public function forwardToPageObject() { /** * @var $ilTabs ilTabsGUI */ global $ilTabs; if (!(int) $_GET['pobject_id']) { ilUtil::sendInfo($this->lng->txt('paya_no_object_selected')); return $this->showObjects(); } $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']); $this->__initPaymentObject((int) $_GET['pobject_id']); $this->lng->loadLanguageModule('content'); $ilTabs->clearTargets(); $ilTabs->clearSubTabs(); $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'editDetails'), '_top'); // page objec include_once 'Services/Payment/classes/class.ilShopPage.php'; include_once 'Services/Payment/classes/class.ilShopPageGUI.php'; include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0)); if (!ilShopPage::_exists('shop', $this->pobject->getPobjectId())) { // doesn't exist -> create new one $new_page_object = new ilShopPage(); $new_page_object->setParentId(0); $new_page_object->setId($this->pobject->getPobjectId()); $new_page_object->createFromXML(); } $this->ctrl->setReturnByClass('ilshoppagegui', 'edit'); $page_gui = new ilShopPageGUI($this->pobject->getPobjectId()); $this->ctrl->setParameter($page_gui, 'pobject_id', (int) $_GET['pobject_id']); return $this->ctrl->forwardCommand($page_gui); }
public function executeCommand() { // $this->prepareOutput(); switch ($this->ctrl->getNextClass($this)) { case "ilcontainerstartobjectspagegui": $this->checkPermission("write"); $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "listStructure")); include_once "Services/Container/classes/class.ilContainerStartObjectsPage.php"; if (!ilContainerStartObjectsPage::_exists("cstr", $this->object->getId())) { // doesn't exist -> create new one $new_page_object = new ilContainerStartObjectsPage(); $new_page_object->setParentId($this->object->getId()); $new_page_object->setId($this->object->getId()); $new_page_object->createFromXML(); unset($new_page_object); } $this->ctrl->setReturnByClass("ilcontainerstartobjectspagegui", "edit"); include_once "Services/Container/classes/class.ilContainerStartObjectsPageGUI.php"; $pgui = new ilContainerStartObjectsPageGUI($this->object->getId()); // needed for editor? include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $pgui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0)); $ret = $this->ctrl->forwardCommand($pgui); if ($ret) { $this->tpl->setContent($ret); } break; default: $cmd = $this->ctrl->getCmd("listStructure"); $cmd .= "Object"; $this->{$cmd}(); break; } }
/** * Constructor * * @param int $a_node * @param object $a_access_handler * @param int $a_id * @param int $a_old_nr * @param bool $a_enable_notes * @param bool $a_may_contribute * @return ilBlogPostingGUI */ function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true) { global $tpl, $lng; $lng->loadLanguageModule("blog"); $this->node_id = $a_node_id; $this->access_handler = $a_access_handler; $this->enable_public_notes = (bool) $a_enable_public_notes; parent::__construct("blp", $a_id, $a_old_nr); // #11151 $this->may_contribute = (bool) $a_may_contribute; $this->setEnableEditing($a_may_contribute); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); // #11190 $blga_set = new ilSetting("blga"); $this->setPreventHTMLUnmasking((bool) $blga_set->get("mask", false)); $this->setEnabledMaps(true); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); $this->setEnabledPCTabs(true); $this->setEnabledActivation(true); }
/** * Get characteristics */ static function _getCharacteristics($a_style_id) { $chars = ilPCSectionGUI::_getStandardCharacteristics(); if ($a_style_id > 0 && ilObject::_lookupType($a_style_id) == "sty") { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet($a_style_id); $chars = $style->getCharacteristics("section"); $new_chars = array(); foreach ($chars as $char) { if ($chars[$char] != "") { $new_chars[$char] = $chars[$char]; } else { $new_chars[$char] = $char; } asort($new_chars); } $chars = $new_chars; } return $chars; }
/** * 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); parent::__construct("wpg", $a_id, $a_old_nr); $this->getPageObject()->setWikiRefId($this->getWikiRefId()); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false, $a_lang = "") { global $tpl; parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0) { global $tpl; parent::__construct("user", $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(false); $this->setEnabledPCTabs(true); // $this->initPageObject($a_id, $a_old_nr); }
function showPage() { if (!$this->getPageObject()) { return; } switch ($this->getPageObject()->getType()) { case ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE: return $this->renderBlogTemplate(); default: // needed for placeholders include_once "Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->addCss(ilObjStyleSheet::getPlaceHolderStylePath()); return parent::showPage(); } }
function &executeCommand() { global $ilTabs; $next_class = $this->ctrl->getNextClass($this); $this->prepareOutput(); switch ($next_class) { case 'ilpermissiongui': include_once "Services/AccessControl/classes/class.ilPermissionGUI.php"; $perm_gui =& new ilPermissionGUI($this); $ret =& $this->ctrl->forwardCommand($perm_gui); break; case 'ilimprintgui': // page editor will set its own tabs $ilTabs->clearTargets(); $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "")); include_once "./Services/Imprint/classes/class.ilImprintGUI.php"; $igui = new ilImprintGUI(); // needed for editor $igui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "impr")); if (!$this->checkPermissionBool("write")) { $igui->setEnableEditing(false); } $ret = $this->ctrl->forwardCommand($igui); if ($ret != "") { $this->tpl->setContent($ret); } break; case "ilobjectownershipmanagementgui": $this->setSystemCheckSubTabs("no_owner"); include_once "Services/Object/classes/class.ilObjectOwnershipManagementGUI.php"; $gui = new ilObjectOwnershipManagementGUI(0); $this->ctrl->forwardCommand($gui); break; case "ilcronmanagergui": $ilTabs->activateTab("cron_jobs"); include_once "Services/Cron/classes/class.ilCronManagerGUI.php"; $gui = new ilCronManagerGUI(); $this->ctrl->forwardCommand($gui); break; default: //var_dump($_POST); $cmd = $this->ctrl->getCmd("view"); $cmd .= "Object"; $this->{$cmd}(); break; } return true; }
/** * Constructor */ function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true) { global $tpl; $this->portfolio_id = (int) $a_portfolio_id; $this->enable_comments = (bool) $a_enable_comments; parent::__construct($this->getParentType(), $a_id, $a_old_nr); $this->getPageObject()->setPortfolioId($this->portfolio_id); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * showRecord * a_val = */ public function renderRecord() { global $ilTabs, $tpl, $ilCtrl, $lng; $rctpl = new ilTemplate("tpl.record_view.html", true, true, "Modules/DataCollection"); $ilTabs->setTabActive("id_content"); $view_id = self::_getViewDefinitionId($this->record_obj); if (!$view_id) { $ilCtrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords"); } // please do not use ilPageObjectGUI directly here, use derived class // ilDataCollectionRecordViewViewdefinitionGUI //$pageObj = new ilPageObjectGUI("dclf", $view_id); // see ilObjDataCollectionGUI->executeCommand about instantiation include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php"; $pageObj = new ilDataCollectionRecordViewViewdefinitionGUI($this->record_obj->getTableId(), $view_id); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $pageObj->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl")); $html = $pageObj->getHTML(); $rctpl->addCss("./Services/COPage/css/content.css"); $rctpl->fillCssFiles(); $table = ilDataCollectionCache::getTableCache($this->record_obj->getTableId()); foreach ($table->getFields() as $field) { //ILIAS_Ref_Links $pattern = '/\\[dcliln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dcliln\\]/'; if (preg_match($pattern, $html)) { $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->setOptions("\$1")), $html); } //DataCollection Ref Links $pattern = '/\\[dclrefln field="' . preg_quote($field->getTitle(), "/") . '"\\](.*?)\\[\\/dclrefln\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doReplace"), $html); } $pattern = '/\\[ext tableOf="' . preg_quote($field->getTitle(), "/") . '" field="(.*?)"\\]/'; if (preg_match($pattern, $html)) { $this->currentField = $field; $html = preg_replace_callback($pattern, array($this, "doExtReplace"), $html); } $html = str_ireplace("[" . $field->getTitle() . "]", $this->record_obj->getRecordFieldHTML($field->getId()), $html); } $rctpl->setVariable("CONTENT", $html); //Permanent Link include_once "./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php"; $perma_link = new ilPermanentLinkGUI("dcl", $_GET["ref_id"], "_" . $_GET['record_id']); $rctpl->setVariable("PERMA_LINK", $perma_link->getHTML()); $tpl->setContent($rctpl->get()); }
public function forwardToPageObject() { /** * @var $ilTabs ilTabsGUI */ global $ilTabs; if (!(int) $_GET['pobject_id']) { ilUtil::sendInfo($this->lng->txt('paya_no_object_selected')); return $this->showObjects(); } $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']); $this->__initPaymentObject((int) $_GET['pobject_id']); $this->lng->loadLanguageModule('content'); $ilTabs->clearTargets(); $ilTabs->clearSubTabs(); $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'editDetails'), '_top'); // page objec include_once 'Services/COPage/classes/class.ilPageObject.php'; include_once 'Services/COPage/classes/class.ilPageObjectGUI.php'; include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0)); if (!ilPageObject::_exists('shop', $this->pobject->getPobjectId())) { // doesn't exist -> create new one $new_page_object = new ilPageObject('shop'); $new_page_object->setParentId(0); $new_page_object->setId($this->pobject->getPobjectId()); $new_page_object->createFromXML(); } $this->ctrl->setReturnByClass('ilpageobjectgui', 'edit'); $page_gui = new ilPageObjectGUI('shop', $this->pobject->getPobjectId()); $this->ctrl->setParameter($page_gui, 'pobject_id', (int) $_GET['pobject_id']); $page_gui->setIntLinkHelpDefault('StructureObject', $this->pobject->getPobjectId()); $page_gui->setTemplateTargetVar('ADM_CONTENT'); $page_gui->setLinkXML(''); $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'downloadFile')); $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'displayMediaFullscreen')); $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'download_paragraph')); $page_gui->setPresentationTitle(''); $page_gui->setTemplateOutput(false); $page_gui->setHeader(''); $page_gui->setEnabledRepositoryObjects(false); $page_gui->setEnabledFileLists(true); $page_gui->setEnabledMaps(true); $page_gui->setEnabledPCTabs(true); return $this->ctrl->forwardCommand($page_gui); }
/** * execute command */ function &executeCommand() { global $ilCtrl, $tpl; $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); switch ($next_class) { case "ilscorm2004pagegui": $tpl->getStandardTemplate(); $this->setContentStyle(); $this->setLocator(); // 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; $ilCtrl->setReturn($this, "edit"); include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php"; $page_gui =& new ilSCORM2004PageGUI($this->slm_object->getType(), $this->node_object->getId(), 0, $this->getParentGUI()->object->getId(), $this->slm_object->getAssignedGlossary()); $page_gui->setEditPreview(true); $page_gui->setPresentationTitle($this->node_object->getTitle()); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->slm_object->getStyleSheetId(), "sahs")); if ($this->node_object->tree->getParentId($this->node_object->getId()) > 0) { $sco = new ilSCORM2004Sco($this->node_object->getSLMObject(), $this->node_object->tree->getParentId($this->node_object->getId())); if (count($sco->getGlossaryTermIds()) > 1) { include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php"; $page_gui->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $sco); } } $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", $_GET["obj_id"]); $page_gui->setExplorerUpdater("tree", "tree_div", $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showTree", "", true)); $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "active_node", ""); // set page view link $view_frame = ilFrameTargetInfo::_getFrame("MainContent"); $page_gui->setLinkParams("ref_id=" . $this->slm_object->getRefId()); $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png")); $page_gui->activateMetaDataEditor($this->slm_object->getID(), $this->node_object->getId(), $this->node_object->getType(), $this->node_object, 'MDUpdateListener'); $ret = $ilCtrl->forwardCommand($page_gui); $this->setTabs(); $tpl->setContent($ret); break; default: $ret =& $this->{$cmd}(); break; } return $ret; }
/** * Constructor */ function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false) { global $tpl; parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $this->setEnabledMaps(false); $this->setPreventHTMLUnmasking(false); $this->setEnabledInternalLinks(false); $this->setEnabledWikiLinks(false); }
/** * Fill table row */ protected function fillRow($a_set) { global $lng, $ilCtrl, $ilAccess, $rbacsystem; for ($i = -80; $i <= 80; $i += 20) { $this->tpl->setCurrentBlock("flavor"); $this->tpl->setVariable("FLAVOR_NAME", "(" . $i . ")"); $this->tpl->setVariable("FLAVOR_CODE", ilObjStyleSheet::_getColorFlavor($a_set["code"], $i)); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("COLOR_NAME_ENC", ilUtil::prepareFormOutput($a_set["name"])); $this->tpl->setVariable("COLOR_NAME", $a_set["name"]); $this->tpl->setVariable("COLOR_CODE", $a_set["code"]); if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])) { $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $ilCtrl->setParameter($this->parent_obj, "c_name", rawurlencode($a_set["name"])); $this->tpl->setVariable("LINK_EDIT_COLOR", $ilCtrl->getLinkTarget($this->parent_obj, "editColor")); } }
/** * Final processing * * @param array mapping array */ function finalProcessing($a_mapping) { $blp_map = $a_mapping->getMappingsOfEntity("Services/COPage", "pg"); foreach ($blp_map as $blp_id) { $blp_id = substr($blp_id, 4); $blog_id = ilBlogPosting::lookupBlogId($blp_id); ilBlogPosting::_writeParentId("blp", $blp_id, $blog_id); } include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $sty_map = $a_mapping->getMappingsOfEntity("Services/Style", "sty"); foreach ($sty_map as $old_sty_id => $new_sty_id) { if (is_array(ilBlogDataSet::$style_map[$old_sty_id])) { foreach (ilBlogDataSet::$style_map[$old_sty_id] as $blog_id) { ilObjStyleSheet::writeStyleUsage($blog_id, $new_sty_id); } } } }
/** * Constructor */ public function __construct() { global $tpl; if (!ilImprint::_exists("impr", 1)) { $page = new ilImprint("impr"); $page->setId(1); $page->create(); } // there is only 1 imprint page parent::__construct("impr", 1); // content style (using system defaults) include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * Export lm content css to a directory */ static function exportContentCSS($a_slm_object, $a_target_dir) { ilUtil::makeDir($a_target_dir . "/css"); ilUtil::makeDir($a_target_dir . "/css/images"); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $active_css = ilObjStyleSheet::getContentStylePath($a_slm_object->getStyleSheetId()); $active_css = split(@'\\?', $active_css, 2); $css = fread(fopen($active_css[0], 'r'), filesize($active_css[0])); preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files); $currdir = getcwd(); chdir(dirname($active_css[0])); foreach (array_unique($files[1]) as $fileref) { if (is_file($fileref)) { copy($fileref, $a_target_dir . "/css/images/" . basename($fileref)); } $css = str_replace($fileref, "images/" . basename($fileref), $css); } chdir($currdir); fwrite(fopen($a_target_dir . '/css/style.css', 'w'), $css); }
public function forwardToPageObject() { global $lng, $ilTabs; $ilTabs->clearTargets(); $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top'); // page object include_once 'Services/Payment/classes/class.ilShopPage.php'; include_once 'Services/Payment/classes/class.ilShopPageGUI.php'; $lng->loadLanguageModule('content'); include_once './Services/Style/classes/class.ilObjStyleSheet.php'; $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0)); if (!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID)) { // doesn't exist -> create new one $new_page_object = new ilShopPage(); $new_page_object->setParentId(0); $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID); $new_page_object->createFromXML(); } $this->ctrl->setReturnByClass('ilshoppagegui', 'edit'); $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID); return $this->ctrl->forwardCommand($page_gui); }
/** * Constructor * * @param int $a_node * @param object $a_access_handler * @param int $a_id * @param int $a_old_nr * @param bool $a_enable_notes * @param bool $a_may_contribute * @return ilBlogPostingGUI */ function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true) { global $tpl, $lng; $lng->loadLanguageModule("blog"); $this->node_id = $a_node_id; $this->access_handler = $a_access_handler; $this->enable_public_notes = (bool) $a_enable_public_notes; parent::__construct("blp", $a_id, $a_old_nr); // needed for notification $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace()); // #11151 $this->may_contribute = (bool) $a_may_contribute; $this->setEnableEditing($a_may_contribute); // content style include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("ContentStyle"); $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); $tpl->parseCurrentBlock(); }
/** * 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); }