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


PHP ilObjStyleSheet::_lookupStandard方法代码示例

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


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

示例1: cloneObject

 /**
  * Clone learning module
  *
  * @access public
  * @param int target ref_id
  * @param int copy id
  *
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     //$new_obj->createProperties();
     $new_obj->setTitle($this->getTitle());
     $new_obj->setDescription($this->getDescription());
     $new_obj->setLayoutPerPage($this->getLayoutPerPage());
     $new_obj->setLayout($this->getLayout());
     $new_obj->setTOCMode($this->getTOCMode());
     $new_obj->setActiveLMMenu($this->isActiveLMMenu());
     $new_obj->setActiveTOC($this->isActiveTOC());
     $new_obj->setActiveNumbering($this->isActiveNumbering());
     $new_obj->setActivePrintView($this->isActivePrintView());
     $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
     $new_obj->setActiveDownloads($this->isActiveDownloads());
     $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
     $new_obj->setPublicNotes($this->publicNotes());
     $new_obj->setCleanFrames($this->cleanFrames());
     $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
     $new_obj->setPublicAccessMode($this->getPublicAccessMode());
     $new_obj->setPageHeader($this->getPageHeader());
     $new_obj->setRating($this->hasRating());
     $new_obj->update();
     $new_obj->createLMTree();
     // copy style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $new_obj->setStyleSheetId($new_id);
         $new_obj->update();
     }
     // copy content
     $this->copyAllPagesAndChapters($new_obj);
     // Copy learning progress settings
     include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
     $obj_settings = new ilLPObjSettings($this->getId());
     $obj_settings->cloneSettings($new_obj->getId());
     unset($obj_settings);
     return $new_obj;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:52,代码来源:class.ilObjContentObject.php

示例2: saveStyleSettings

 function saveStyleSettings()
 {
     global $ilSetting;
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     if ($ilSetting->get("fixed_content_style_id") <= 0 && (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId()) || $this->object->getStyleSheetId() == 0)) {
         $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
         $this->object->update();
         ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     }
     $this->ctrl->redirect($this, "editStyleProperties");
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:11,代码来源:class.ilObjBlogGUI.php

示例3: copyAuthoredContent

 /**
  * Copy authored content (everything done with the editor
  *
  * @param
  * @return
  */
 function copyAuthoredContent($a_new_obj)
 {
     global $ilias;
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $a_new_obj->setStyleSheetId($new_id);
         $a_new_obj->update();
     }
     $a_new_obj->createScorm2004Tree();
     $source_tree = $this->getTree();
     $target_tree_root_id = $a_new_obj->getTree()->readRootId();
     $childs = $source_tree->getChilds($source_tree->readRootId());
     $a_copied_nodes = array();
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Node.php";
     foreach ($childs as $c) {
         ilSCORM2004Node::pasteTree($a_new_obj, $c["child"], $target_tree_root_id, IL_LAST_NODE, "", $a_copied_nodes, true, false);
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:28,代码来源:class.ilObjSCORM2004LearningModule.php

示例4: doCloneObject

 protected function doCloneObject(ilObjBlog $new_obj, $a_target_id, $a_copy_id = null)
 {
     // banner?
     $img = $this->getImage();
     if ($img) {
         $new_obj->setImage($img);
         $source = $this->initStorage($this->getId());
         $target = $new_obj->initStorage($new_obj->getId());
         copy($source . $img, $target . $img);
     }
     $new_obj->setNotesStatus($this->getNotesStatus());
     $new_obj->setProfilePicture($this->hasProfilePicture());
     $new_obj->setBackgroundColor($this->getBackgroundColor());
     $new_obj->setFontColor($this->getFontColor());
     $new_obj->setRSS($this->hasRSS());
     $new_obj->setApproval($this->hasApproval());
     $new_obj->update();
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $new_obj->setStyleSheetId($new_id);
         $new_obj->update();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:27,代码来源:class.ilObjBlog.php

示例5: clonePagesAndSettings

 /**
  * Build template from portfolio and vice versa
  * 
  * @param ilObjPortfolioBase $a_source
  * @param ilObjPortfolioBase $a_target
  * @param array $a_recipe
  */
 public static function clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, array $a_recipe = null)
 {
     global $lng, $ilUser;
     $source_id = $a_source->getId();
     $target_id = $a_target->getId();
     if ($a_source instanceof ilObjPortfolioTemplate && $a_target instanceof ilObjPortfolio) {
         $direction = "t2p";
     } else {
         if ($a_source instanceof ilObjPortfolio && $a_target instanceof ilObjPortfolioTemplate) {
             $direction = "p2t";
         } else {
             return;
         }
     }
     // copy portfolio properties
     $a_target->setPublicComments($a_source->hasPublicComments());
     $a_target->setProfilePicture($a_source->hasProfilePicture());
     $a_target->setFontColor($a_source->getFontColor());
     $a_target->setBackgroundColor($a_source->getBackgroundColor());
     $a_target->setImage($a_source->getImage());
     $a_target->update();
     // banner/images
     $source_dir = $a_source->initStorage($source_id);
     $target_dir = $a_target->initStorage($target_id);
     ilFSStoragePortfolio::_copyDirectory($source_dir, $target_dir);
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $a_source->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $a_target->setStyleSheetId($new_id);
         $a_target->update();
     }
     // copy pages
     $blog_count = 0;
     include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
     foreach (ilPortfolioPage::getAllPages($source_id) as $page) {
         $page_id = $page["id"];
         if ($direction == "t2p") {
             $source_page = new ilPortfolioTemplatePage($page_id);
             $target_page = new ilPortfolioPage();
         } else {
             $source_page = new ilPortfolioPage($page_id);
             $target_page = new ilPortfolioTemplatePage();
         }
         $source_page->setPortfolioId($source_id);
         $target_page->setPortfolioId($target_id);
         $page_type = $source_page->getType();
         $page_title = $source_page->getTitle();
         $page_recipe = null;
         if (is_array($a_recipe)) {
             $page_recipe = $a_recipe[$page_id];
         }
         $valid = false;
         switch ($page_type) {
             // blog => blog template
             case ilPortfolioTemplatePage::TYPE_BLOG:
                 if ($direction == "p2t") {
                     $page_type = ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE;
                     $page_title = $lng->txt("obj_blog") . " " . ++$blog_count;
                     $valid = true;
                 }
                 break;
                 // blog template => blog (needs recipe)
             // blog template => blog (needs recipe)
             case ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE:
                 if ($direction == "t2p" && is_array($page_recipe)) {
                     $page_type = ilPortfolioPage::TYPE_BLOG;
                     if ($page_recipe[0] == "blog") {
                         switch ($page_recipe[1]) {
                             case "create":
                                 $page_title = self::createBlogInPersonalWorkspace($page_recipe[2]);
                                 $valid = true;
                                 break;
                             case "reuse":
                                 $page_title = $page_recipe[2];
                                 $valid = true;
                                 break;
                             case "ignore":
                                 // do nothing
                                 break;
                         }
                     }
                 }
                 break;
                 // page editor
             // page editor
             default:
                 $target_page->setXMLContent($source_page->copyXmlContent(true));
                 // copy mobs
                 $target_page->buildDom(true);
                 // parse content / blocks
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjPortfolioBase.php

示例6: afterSave

 protected function afterSave(ilObject $a_new_object)
 {
     global $ilUser, $tree;
     // add default translation
     $a_new_object->addTranslation($a_new_object->getTitle(), $a_new_object->getDescription(), $ilUser->getPref("language"), true);
     // default: sort by title
     include_once 'Services/Container/classes/class.ilContainerSortingSettings.php';
     $settings = new ilContainerSortingSettings($a_new_object->getId());
     $settings->setSortMode(ilContainer::SORT_TITLE);
     $settings->save();
     // inherit parents content style, if not individual
     $parent_ref_id = $tree->getParentId($a_new_object->getRefId());
     $parent_id = ilObject::_lookupObjId($parent_ref_id);
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = ilObjStyleSheet::lookupObjectStyle($parent_id);
     if ($style_id > 0) {
         if (ilObjStyleSheet::_lookupStandard($style_id)) {
             ilObjStyleSheet::writeStyleUsage($a_new_object->getId(), $style_id);
         }
     }
     // always send a message
     ilUtil::sendSuccess($this->lng->txt("cat_added"), true);
     $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
     $this->redirectToRefId($a_new_object->getRefId(), "");
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:25,代码来源:class.ilObjCategoryGUI.php

示例7: cloneObject

 /**
  * Clone glossary
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     //copy online status if object is not the root copy object
     $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
     if (!$cp_options->isRootNode($this->getRefId())) {
         $new_obj->setOnline($this->getOnline());
     }
     //		$new_obj->setTitle($this->getTitle());
     $new_obj->setDescription($this->getDescription());
     $new_obj->setVirtualMode($this->getVirtualMode());
     $new_obj->setPresentationMode($this->getPresentationMode());
     $new_obj->setSnippetLength($this->getSnippetLength());
     $new_obj->update();
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $new_obj->setStyleSheetId($new_id);
         $new_obj->update();
     }
     // copy taxonomy
     if (($tax_id = $this->getTaxonomyId()) > 0) {
         // clone it
         include_once "./Services/Taxonomy/classes/class.ilObjTaxonomy.php";
         $tax = new ilObjTaxonomy($tax_id);
         $new_tax = $tax->cloneObject(0, 0, true);
         $map = $tax->getNodeMapping();
         // assign new taxonomy to new glossary
         ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
     }
     // assign new tax/new glossary
     // handle mapping
     // prepare tax node assignments objects
     include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php";
     if ($tax_id > 0) {
         $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
         $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
     }
     // copy terms
     foreach (ilGlossaryTerm::getTermList($this->getId()) as $term) {
         $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
         // copy tax node assignments
         if ($tax_id > 0) {
             $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
             foreach ($assignmts as $a) {
                 if ($map[$a["node_id"]] > 0) {
                     $new_tax_ass->addAssignment($map[$a["node_id"]], $new_term_id);
                 }
             }
         }
     }
     return $new_obj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:64,代码来源:class.ilObjGlossary.php

示例8: cloneObject

 /**
  * Clone wiki
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $new_obj->setTitle($this->getTitle());
     $new_obj->setStartPage($this->getStartPage());
     $new_obj->setShortTitle($this->getShortTitle());
     $new_obj->setRatingOverall($this->getRatingOverall());
     $new_obj->setRating($this->getRating());
     $new_obj->setRatingAsBlock($this->getRatingAsBlock());
     $new_obj->setRatingForNewPages($this->getRatingForNewPages());
     $new_obj->setRatingCategories($this->getRatingCategories());
     $new_obj->setPublicNotes($this->getPublicNotes());
     $new_obj->setIntroduction($this->getIntroduction());
     $new_obj->setImportantPages($this->getImportantPages());
     $new_obj->setPageToc($this->getPageToc());
     $new_obj->update();
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $new_obj->setStyleSheetId($new_id);
         $new_obj->update();
     }
     // copy content
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $pages = ilWikiPage::getAllPages($this->getId());
     if (count($pages) > 0) {
         // if we have any pages, delete the start page first
         $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
         $start_page = new ilWikiPage($pg_id);
         $start_page->delete();
     }
     $map = array();
     foreach ($pages as $p) {
         $page = new ilWikiPage($p["id"]);
         $new_page = new ilWikiPage();
         $new_page->setTitle($page->getTitle());
         $new_page->setWikiId($new_obj->getId());
         $new_page->setTitle($page->getTitle());
         $new_page->setBlocked($page->getBlocked());
         $new_page->setRating($page->getRating());
         $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
         $new_page->create();
         $page->copy($new_page->getId(), "", 0, true);
         //$new_page->setXMLContent($page->copyXMLContent(true));
         //$new_page->buildDom(true);
         //$new_page->update();
         $map[$p["id"]] = $new_page->getId();
     }
     // copy important pages
     foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip) {
         $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
     }
     // copy rating categories
     include_once "./Services/Rating/classes/class.ilRatingCategory.php";
     foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc) {
         $new_rc = new ilRatingCategory();
         $new_rc->setParentId($new_obj->getId());
         $new_rc->setTitle($rc["title"]);
         $new_rc->setDescription($rc["description"]);
         $new_rc->save();
     }
     return $new_obj;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:73,代码来源:class.ilObjWiki.php

示例9: cloneBasics

 /**
  * Clone basic settings 
  * 
  * @param ilObjPortfolioBase $a_source
  * @param ilObjPortfolioBase $a_target
  */
 protected static function cloneBasics(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target)
 {
     // copy portfolio properties
     $a_target->setPublicComments($a_source->hasPublicComments());
     $a_target->setProfilePicture($a_source->hasProfilePicture());
     $a_target->setFontColor($a_source->getFontColor());
     $a_target->setBackgroundColor($a_source->getBackgroundColor());
     $a_target->setImage($a_source->getImage());
     $a_target->update();
     // banner/images
     $source_dir = $a_source->initStorage($a_source->getId());
     $target_dir = $a_target->initStorage($a_target->getId());
     ilFSStoragePortfolio::_copyDirectory($source_dir, $target_dir);
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $a_source->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $a_target->setStyleSheetId($new_id);
         $a_target->update();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:29,代码来源:class.ilObjPortfolioBase.php


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