當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilTree::isGrandChild方法代碼示例

本文整理匯總了PHP中ilTree::isGrandChild方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTree::isGrandChild方法的具體用法?PHP ilTree::isGrandChild怎麽用?PHP ilTree::isGrandChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilTree的用法示例。


在下文中一共展示了ilTree::isGrandChild方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: confirmedMove

 function confirmedMove()
 {
     global $ilUser;
     $tgt = (int) $_REQUEST["bmfmv_id"];
     $bm_ids = explode(";", $_REQUEST['bm_id_tgt']);
     if (!$bm_ids || !$tgt) {
         ilUtil::sendFailure($this->lng->txt("no_checkbox"));
         return $this->view();
     }
     $tree = new ilTree($ilUser->getId());
     $tree->setTableNames('bookmark_tree', 'bookmark_data');
     $tgt_node = $tree->getNodeData($tgt);
     // sanity check
     foreach ($bm_ids as $node_id) {
         if ($tree->isGrandChild($node_id, $tgt)) {
             ilUtil::sendFailure($this->lng->txt("error"), true);
             $this->ctrl->redirect($this, "view");
         }
         $node = $tree->getNodeData($node_id);
         // already at correct position
         if ($node["parent"] == $tgt) {
             continue;
         }
         $tree->moveTree($node_id, $tgt);
     }
     ilUtil::sendSuccess($this->lng->txt("bookmark_moved_ok"), true);
     $this->ctrl->setParameter($this, "bmf_id", $tgt);
     $this->ctrl->redirect($this, "view");
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:29,代碼來源:class.ilBookmarkAdministrationGUI.php


注:本文中的ilTree::isGrandChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。