本文整理汇总了PHP中ilTree::fetchSuccessorNode方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTree::fetchSuccessorNode方法的具体用法?PHP ilTree::fetchSuccessorNode怎么用?PHP ilTree::fetchSuccessorNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTree
的用法示例。
在下文中一共展示了ilTree::fetchSuccessorNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
/**
* split page to next page at hierarchical id
*
* the main reason for this method being static is that a lm page
* object is not available within ilPageContentGUI where this method
* is called
*/
function _splitPageNext($a_page_id, $a_pg_parent_type, $a_hier_id)
{
// get content object (learning module / digilib book)
$lm_id = ilLMObject::_lookupContObjID($a_page_id);
$type = ilObject::_lookupType($lm_id, false);
switch ($type) {
case "lm":
include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
$cont_obj = new ilObjLearningModule($lm_id, false);
break;
case "dbk":
include_once "./Modules/LearningModule/classes/class.ilObjDlBook.php";
$cont_obj = new ilObjDlBook($lm_id, false);
break;
}
$tree = new ilTree($cont_obj->getId());
$tree->setTableNames('lm_tree', 'lm_data');
$tree->setTreeTablePK("lm_id");
$source_lm_page =& new ilLMPageObject($cont_obj, $a_page_id);
$source_page =& $source_lm_page->getPageObject();
// get next page
$succ = $tree->fetchSuccessorNode($a_page_id, "pg");
if ($succ["child"] > 0) {
$target_lm_page =& new ilLMPageObject($cont_obj, $succ["child"]);
$target_page =& $target_lm_page->getPageObject();
$target_page->buildDom();
$target_page->addHierIds();
// move nodes to target page
$source_page->buildDom();
$source_page->addHierIds();
ilLMPage::_moveContentAfterHierId($source_page, $target_page, $a_hier_id);
//$source_page->deleteContentFromHierId($a_hier_id);
return $succ["child"];
}
}
示例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);
}
示例3: hasSuccessorPage
/**
* checks if page has a successor page
*/
function hasSuccessorPage($a_cont_obj_id, $a_page_id)
{
$tree = new ilTree($a_cont_obj_id);
$tree->setTableNames('lm_tree', 'lm_data');
$tree->setTreeTablePK("lm_id");
if ($tree->isInTree($a_page_id)) {
$succ = $tree->fetchSuccessorNode($a_page_id, "pg");
if ($succ > 0) {
return true;
}
}
return false;
}