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


PHP ilLMObject::_exists方法代码示例

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


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

示例1: getDuplicateExportIDs

 /**
  * Get duplicate export IDs (count export ID usages)
  */
 public static function getDuplicateExportIDs($a_lm_id, $a_type = "pg")
 {
     include_once "./Services/MetaData/classes/class.ilMDIdentifier.php";
     $entries = ilMDIdentifier::_getEntriesForRbacObj($a_lm_id, $a_type);
     $res = array();
     foreach ($entries as $e) {
         if ($e["catalog"] == "ILIAS_NID") {
             if (ilLMObject::_exists($e["obj_id"])) {
                 $res[trim($e["entry"])]++;
             }
         }
     }
     return $res;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:17,代码来源:class.ilLMObject.php

示例2: _exists

 /**
  * Check if internal link refers to a valid target
  *
  * @param	string		$a_type			target type ("PageObject" | "StructureObject" |
  *										"GlossaryItem" | "MediaObject")
  * @param	string		$a_target		target id, e.g. "il__pg_244")
  *
  * @return	boolean		true/false
  */
 function _exists($a_type, $a_target)
 {
     global $tree;
     switch ($a_type) {
         case "PageObject":
         case "StructureObject":
             return ilLMObject::_exists($a_target);
             break;
         case "GlossaryItem":
             return ilGlossaryTerm::_exists($a_target);
             break;
         case "MediaObject":
             return ilObjMediaObject::_exists($a_target);
             break;
         case "WikiPage":
             include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
             return ilWikiPage::_exists("wiki", (int) $a_target);
             break;
         case "RepositoryItem":
             if (is_int(strpos($a_target, "_"))) {
                 $ref_id = ilInternalLink::_extractObjIdOfTarget($a_target);
                 return $tree->isInTree($ref_id);
             }
             break;
     }
     return false;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:36,代码来源:class.ilInternalLink.php

示例3: showPrintView

 /**
  * show print view
  */
 function showPrintView()
 {
     global $ilUser, $lng, $ilCtrl;
     include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
     if (!$this->lm->isActivePrintView()) {
         return;
     }
     $this->renderPageTitle();
     $c_obj_id = $this->getCurrentPageId();
     // set values according to selection
     if ($_POST["sel_type"] == "page") {
         if (!is_array($_POST["obj_id"]) || !in_array($c_obj_id, $_POST["obj_id"])) {
             $_POST["obj_id"][] = $c_obj_id;
         }
     }
     if ($_POST["sel_type"] == "chapter" && $c_obj_id > 0) {
         $path = $this->lm_tree->getPathFull($c_obj_id);
         $chap_id = $path[1]["child"];
         if ($chap_id > 0) {
             $_POST["obj_id"][] = $chap_id;
         }
     }
     //var_dump($_GET);
     //var_dump($_POST);
     // set style sheets
     if (!$this->offlineMode()) {
         $this->tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
     } else {
         $style_name = $ilUser->getPref("style") . ".css";
         $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
     }
     // content style
     $this->tpl->setCurrentBlock("ContentStyle");
     if (!$this->offlineMode()) {
         $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
     } else {
         $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css");
     }
     $this->tpl->parseCurrentBlock();
     // syntax style
     $this->tpl->setCurrentBlock("SyntaxStyle");
     $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $this->tpl->parseCurrentBlock();
     //$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.lm_print_view.html", true);
     // set title header
     $this->tpl->setVariable("HEADER", $this->lm->getTitle());
     $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
     include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php";
     include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
     include_once "./Modules/LearningModule/classes/class.ilStructureObject.php";
     $act_level = 99999;
     $activated = false;
     $glossary_links = array();
     $output_header = false;
     $media_links = array();
     // get header and footer
     if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
         if (ilLMObject::_exists($this->lm->getFooterPage())) {
             $page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm"));
             // determine target frames for internal links
             $page_object_gui->setLinkFrame($_GET["frame"]);
             $page_object_gui->setOutputMode("print");
             $page_object_gui->setPresentationTitle("");
             $page_object_gui->setFileDownloadLink("#");
             $page_object_gui->setFullscreenLink("#");
             $page_object_gui->setSourceCodeDownloadScript("#");
             $footer_page_content = $page_object_gui->showPage();
         }
     }
     if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
         if (ilLMObject::_exists($this->lm->getHeaderPage())) {
             $page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm"));
             // determine target frames for internal links
             $page_object_gui->setLinkFrame($_GET["frame"]);
             $page_object_gui->setOutputMode("print");
             $page_object_gui->setPresentationTitle("");
             $page_object_gui->setFileDownloadLink("#");
             $page_object_gui->setFullscreenLink("#");
             $page_object_gui->setSourceCodeDownloadScript("#");
             $header_page_content = $page_object_gui->showPage();
         }
     }
     // add free selected pages
     if (is_array($_POST["obj_id"])) {
         foreach ($_POST["obj_id"] as $k) {
             if ($k > 0 && !$this->lm_tree->isInTree($k)) {
                 if (ilLMObject::_lookupType($k) == "pg") {
                     $nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
                 }
             }
         }
     } else {
//.........这里部分代码省略.........
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilLMPresentationGUI.php

示例4: _exists

 /**
  * Check if internal link refers to a valid target
  *
  * @param	string		$a_type			target type ("PageObject" | "StructureObject" |
  *										"GlossaryItem" | "MediaObject")
  * @param	string		$a_target		target id, e.g. "il__pg_244")
  *
  * @return	boolean		true/false
  */
 function _exists($a_type, $a_target)
 {
     global $tree;
     switch ($a_type) {
         case "PageObject":
         case "StructureObject":
             return ilLMObject::_exists($a_target);
             break;
         case "GlossaryItem":
             return ilGlossaryTerm::_exists($a_target);
             break;
         case "MediaObject":
             return ilObjMediaObject::_exists($a_target);
             break;
         case "RepositoryItem":
             if (is_int(strpos($a_target, "_"))) {
                 $ref_id = ilInternalLink::_extractObjIdOfTarget($a_target);
                 return $tree->isInTree($ref_id);
             }
             break;
     }
     return false;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilInternalLink.php

示例5: showHelp

 /**
  * Show online help
  */
 function showHelp()
 {
     global $ilHelp, $lng, $ilSetting;
     if ($_GET["help_screen_id"] != "") {
         ilSession::set("help_screen_id", $_GET["help_screen_id"]);
         $help_screen_id = $_GET["help_screen_id"];
     } else {
         $help_screen_id = ilSession::get("help_screen_id");
     }
     $this->resetCurrentPage();
     $id_arr = explode(".", $help_screen_id);
     include_once "./Services/Help/classes/class.ilHelpMapping.php";
     $help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
     $hm = (int) $ilSetting->get("help_module");
     if ((OH_REF_ID > 0 || $hm > 0) && count($help_arr) > 0) {
         if (OH_REF_ID > 0) {
             $oh_lm_id = ilObject::_lookupObjId(OH_REF_ID);
         } else {
             include_once "./Services/Help/classes/class.ilObjHelpSettings.php";
             $oh_lm_id = ilObjHelpSettings::lookupModuleLmId($hm);
         }
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->setId("oh_acc");
         $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
         foreach ($help_arr as $h_id) {
             include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
             $st_id = $h_id;
             if (!ilLMObject::_exists($st_id)) {
                 continue;
             }
             $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
             include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
             $grp_list = new ilGroupedListGUI();
             foreach ($pages as $pg) {
                 $grp_list->addEntry(ilLMObject::_lookupTitle($pg["child"]), "#", "", "return il.Help.showPage(" . $pg["child"] . ");");
             }
             $acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
         }
         $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
         $h_tpl->setVariable("HEAD", $lng->txt("help"));
         $h_tpl->setVariable("CONTENT", $acc->getHTML());
         $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
         echo $h_tpl->get();
     }
     exit;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:50,代码来源:class.ilHelpGUI.php

示例6: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     $this->tpl->setVariable("TXT_PAGE_TITLE", $a_set["title"]);
     $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $a_set["obj_id"]);
     $this->tpl->setVariable("HREF_PAGE", $ilCtrl->getLinkTargetByClass("illmpageobjectgui", "edit"));
     include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
     $page_object = new ilLMPage($a_set["obj_id"]);
     $page_object->buildDom();
     $int_links = $page_object->getInternalLinks();
     foreach ($int_links as $link) {
         $target = $link["Target"];
         if (substr($target, 0, 4) == "il__") {
             $target_arr = explode("_", $target);
             $target_id = $target_arr[count($target_arr) - 1];
             $type = $link["Type"];
             switch ($type) {
                 case "PageObject":
                     $this->tpl->setCurrentBlock("link");
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("pg"));
                     if (ilLMObject::_exists($target_id)) {
                         $lm_id = ilLMObject::_lookupContObjID($target_id);
                         $add_str = $lm_id != $this->lm_id ? " (" . ilObject::_lookupTitle($lm_id) . ")" : "";
                         $this->tpl->setVariable("TXT_LINK_TITLE", ilLMObject::_lookupTitle($target_id) . $add_str);
                     } else {
                         $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target_id . "]" . "</b>");
                     }
                     $this->tpl->parseCurrentBlock();
                     break;
                 case "StructureObject":
                     $this->tpl->setCurrentBlock("link");
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("st"));
                     if (ilLMObject::_exists($target_id)) {
                         $lm_id = ilLMObject::_lookupContObjID($target_id);
                         $add_str = $lm_id != $this->lm_id ? " (" . ilObject::_lookupTitle($lm_id) . ")" : "";
                         $this->tpl->setVariable("TXT_LINK_TITLE", ilLMObject::_lookupTitle($target_id) . $add_str);
                     } else {
                         $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target_id . "]" . "</b>");
                     }
                     $this->tpl->parseCurrentBlock();
                     break;
                 case "GlossaryItem":
                     $this->tpl->setCurrentBlock("link");
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("cont_term"));
                     include_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php";
                     if (ilGlossaryTerm::_exists($target_id)) {
                         $this->tpl->setVariable("TXT_LINK_TITLE", ilGlossaryTerm::_lookGlossaryTerm($target_id));
                     } else {
                         $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target_id . "]" . "</b>");
                     }
                     $this->tpl->parseCurrentBlock();
                     break;
                 case "MediaObject":
                     $this->tpl->setCurrentBlock("link");
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("mob"));
                     if (ilObject::_exists($target_id)) {
                         $this->tpl->setVariable("TXT_LINK_TITLE", ilObject::_lookupTitle($target_id));
                     } else {
                         $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target_id . "]" . "</b>");
                     }
                     $this->tpl->parseCurrentBlock();
                     break;
                 case "RepositoryItem":
                     $this->tpl->setCurrentBlock("link");
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("cont_repository_item"));
                     $obj_type = ilObject::_lookupType($target_id, true);
                     $obj_id = ilObject::_lookupObjId($target_id);
                     if (ilObject::_exists($obj_id)) {
                         $this->tpl->setVariable("TXT_LINK_TITLE", ilObject::_lookupTitle($obj_id) . " (" . $lng->txt("obj_" . $obj_type) . ")");
                     } else {
                         $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target_id . "]" . "</b>");
                     }
                     $this->tpl->parseCurrentBlock();
                     break;
             }
         } else {
             $type = $link["Type"];
             switch ($type) {
                 case "PageObject":
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("pg"));
                     break;
                 case "StructureObject":
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("st"));
                     break;
                 case "GlossaryItem":
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("cont_term"));
                     break;
                 case "MediaObject":
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("mob"));
                     break;
                 case "RepositoryItem":
                     $this->tpl->setVariable("TXT_LINK_TYPE", $lng->txt("cont_repository_item"));
                     break;
             }
             $this->tpl->setCurrentBlock("link");
             $this->tpl->setVariable("TXT_MISSING", "<b>" . $lng->txt("cont_target_missing") . " [" . $target . "]" . "</b>");
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilLinksTableGUI.php


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