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


PHP ilTree::getPathId方法代码示例

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


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

示例1: showTree

 /**
  * Show Editing Tree
  */
 function showTree()
 {
     global $ilUser, $ilias, $ilCtrl, $lng;
     $mtree = new ilTree($this->object->getId());
     $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $mtree->setTreeTablePK("slm_id");
     if ($_POST["expandAll"] != "") {
         $_GET["scexpand"] = "";
         $stree = $mtree->getSubTree($mtree->getNodeData($mtree->readRootId()));
         $n_arr = array();
         foreach ($stree as $n) {
             $n_arr[] = $n["child"];
         }
         $_SESSION["scexpand"] = $n_arr;
     }
     if ($_POST["collapseAll"] != "") {
         $_GET["scexpand"] = "";
         $_SESSION["scexpand"] = array($mtree->readRootId());
     }
     $this->tpl = new ilTemplate("tpl.main.html", true, true);
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
     $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
     $this->tpl->setCurrentBlock("exp2_button");
     $this->tpl->setVariable("CMD_EXP2_BTN", "expandAll");
     $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("expand_all"));
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("exp2_button");
     $this->tpl->setVariable("CMD_EXP2_BTN", "collapseAll");
     $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("collapse_all"));
     $this->tpl->parseCurrentBlock();
     require_once "./Modules/Scorm2004/classes/class.ilSCORM2004EditorExplorer.php";
     $exp = new ilSCORM2004EditorExplorer($this->ctrl->getLinkTarget($this, "edit"), $this->object);
     $exp->setFrameUpdater("content", "ilHierarchyFormUpdater");
     $exp->setTargetGet("obj_id");
     $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "showTree"));
     if ($_GET["scexpand"] == "") {
         $expanded = $mtree->readRootId();
     } else {
         $expanded = $_GET["scexpand"];
     }
     //echo "-".$_GET["active_node"]."-";
     if ($_GET["active_node"] != "") {
         $path = $mtree->getPathId($_GET["active_node"]);
         $exp->setForceOpenPath($path);
         $exp->highlightNode($_GET["active_node"]);
     }
     $exp->setExpand($expanded);
     // build html-output
     $exp->setOutput(0);
     $output = $exp->getOutput();
     // asynchronous output
     if ($ilCtrl->isAsynch()) {
         echo $output;
         exit;
     }
     $this->tpl->setCurrentBlock("content");
     $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("sahs_organization"));
     $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
     $this->tpl->setVariable("EXPLORER", $output);
     $this->ctrl->setParameter($this, "scexpand", $_GET["scexpand"]);
     $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "showTree"));
     $this->tpl->parseCurrentBlock();
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery($this->tpl);
     $this->tpl->show(false);
     exit;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:72,代码来源:class.ilObjSCORM2004LearningModuleGUI.php


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