Code: Select all
else if( $start_level > 1 ) {
$tmp = $hm->sureGetNodeById($gCms->get_content_id());
$arr = array();
$arr2 = array();
while( $tmp ) {
$id = $tmp->get_tag('id');
if( !$id ) break;
$arr[$id] = $tmp;
$arr2[] = $id;
$tmp = $tmp->get_parent();
}
if( $start_level - 2 < count($arr) ) {
//$number is the place of the good $id in array $arr2
$number=count($arr)-($start_level-1);
$id = $arr2[$number];
$tmp = $arr[$id];
if( $tmp->has_children() ) {
$children = $tmp->get_children();
foreach( $children as $one ) {
$rootnodes[] = $one;
}
}
}
}