当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjStyleSheet类代码示例

本文整理汇总了PHP中ilObjStyleSheet的典型用法代码示例。如果您正苦于以下问题:PHP ilObjStyleSheet类的具体用法?PHP ilObjStyleSheet怎么用?PHP ilObjStyleSheet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ilObjStyleSheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: importXmlRepresentation

 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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:29,代码来源:class.ilStyleImporter.php

示例2: getXmlRepresentation

 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>";
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilStyleExporter.php

示例3: __construct

 /**
  * 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);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:38,代码来源:class.ilDataCollectionRecordViewViewdefinitionGUI.php

示例4: getPageHTML

 /**
  * 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();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:32,代码来源:class.ilContainerStartObjectsContentGUI.php

示例5: __construct

 /**
  * 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);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:29,代码来源:class.ilImprintGUI.php

示例6: getXmlExportTailDependencies

 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:29,代码来源:class.ilBlogExporter.php

示例7: __construct

 /**
  * 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);
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:38,代码来源:class.ilPortfolioPageGUI.php

示例8: __construct

 /**
  * @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();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:35,代码来源:class.ilDataCollectionRecordViewViewdefinitionGUI.php

示例9: forwardToPageObject

 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);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:35,代码来源:class.ilShopInfoGUI.php

示例10: forwardToPageObject

 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);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:33,代码来源:class.ilPaymentObjectGUI.php

示例11: executeCommand

 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;
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:35,代码来源:class.ilContainerStartObjectsGUI.php

示例12: __construct

 /**
  * 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);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:39,代码来源:class.ilBlogPostingGUI.php

示例13: _getCharacteristics

 /**
  * 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilPCSectionGUI.php

示例14: __construct

 /**
  * 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();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:16,代码来源:class.ilWikiPageGUI.php

示例15: __construct

 /**
  * 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();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:16,代码来源:class.ilMediaPoolPageGUI.php


注:本文中的ilObjStyleSheet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。