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


PHP ilTree::getNodePath方法代码示例

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


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

示例1: getQuestionPoolPathString

 /**
  * @param integer $poolId
  * @return string
  */
 public function getQuestionPoolPathString($poolId)
 {
     $nodePath = $this->tree->getNodePath(current(ilObject::_getAllReferences($poolId)));
     $questionPoolPathString = '';
     $i = 0;
     $j = count($nodePath) - 2;
     foreach ($nodePath as $node) {
         if ($i > 0) {
             $questionPoolPathString .= ' > ';
         }
         $questionPoolPathString .= $node['title'];
         if ($i == $j) {
             break;
         }
         $i++;
     }
     return $questionPoolPathString;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:22,代码来源:class.ilTestQuestionSetConfig.php

示例2: testAllOthers

 /**
  * get path ids (adjacenca and nested set)
  * @group IL_Init
  * @param
  * @return
  */
 public function testAllOthers()
 {
     $tree = new ilTree(ROOT_FOLDER_ID);
     $d = $tree->getDepth(24);
     $this->assertEquals($d, 4);
     $node = $tree->getNodeData(24);
     $this->assertEquals($node['title'], 'Public chat');
     $bool = $tree->isInTree(24);
     $this->assertEquals($bool, true);
     $bool = $tree->isInTree(24242424);
     $this->assertEquals($bool, false);
     /* ref_id 14 => obj_id 98 does not exist
     		$node = $tree->getParentNodeData(24);
     		$this->assertEquals($node['title'],'Chat-Server');
     		*/
     $bool = $tree->isGrandChild(9, 24);
     $this->assertEquals($bool, 1);
     /* see above
     		$node = $tree->getNodeDataByType('chac');
     		$this->assertEquals($node[0]['title'],'Chat-Server');
     		*/
     $bool = $tree->isDeleted(24);
     $this->assertEquals($bool, false);
     $id = $tree->getParentId(24);
     $this->assertEquals($id, 14);
     $lft = $tree->getLeftValue(24);
     $this->assertEquals($lft, 14);
     $seq = $tree->getChildSequenceNumber($tree->getNodeData(24));
     $this->assertEquals($seq, 1);
     $tree->getNodePath(9, 1);
     $max_depth = $tree->getMaximumDepth();
     // Round trip
     $tree = new ilTree(ROOT_FOLDER_ID);
     $suc = $tree->fetchSuccessorNode(16);
     // cals
     $cals = $tree->fetchPredecessorNode($suc['child']);
     $this->assertEquals($cals['child'], 16);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:44,代码来源:ilTreeTest.php


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