Lines Matching refs:tree
20 $tree = $this->_groupByNs($tab);
21 $trimmedTree = $this->_getTrimmedTree($tree);
27 * We received the nodes all ordered together, but building the tree has probably
30 function _orderTree($tree) {
33 // build the tree preserves the order of the pages.
42 $this->_sorter->sort($tree->children);
44 foreach($tree->children as $subTree){
49 return $tree;
53 $tree = new NspagesTreeNsNode(':');
55 $this->_fillTree($tree, $this->_getNS($item), $item, '', ':');
57 return $tree;
61 * Get rid of the "trunk" of the tree. ie: remove the first "empty" nodes. It prevents printing
71 private function _getTrimmedTree($tree){
72 if ($tree->id === $this->rootNS){
73 return $tree;
75 if (is_null($tree->children)) {
78 return $tree;
80 $firstAndOnlyChild = reset($tree->children);
140 private function _fillTree($tree, $keys, $item, $parentId, $myNs) {
143 $tree->self = $item;
146 $tree->self = $item;
148 if (!isset($tree->children[$item['id']])) {
150 $tree->children[$item['id']] = new NspagesTreeNsNode($item['id']);
151 $tree->children[$item['id']]->self = $item;
153 $tree->children[$item['id']] = $item;
156 $tree->children[$item['id']]->self = $item;
160 } else { // We're not at the place of $item in the tree yet, we continue to go down
164 if (!array_key_exists($nsKey, $tree->children)){
166 $tree->children[$nsKey] = $node;
169 $this->_fillTree($tree->children[$nsKey], $keys, $item, $currentId, $item['ns']);
173 private function _printTree($tree) {
176 foreach($tree->children as $subTree){
187 private function _printSubTree($tree, $level) {
188 $this->_printElementOpen($tree->self, $level);
189 if ( !is_null($tree->self) ){
190 $this->_printElementContent($tree->self, $level);
192 $this->renderer->doc .= '<div>' . $tree->id . '</div>';
195 $hasInnerData = !empty($tree->children);
199 foreach($tree->children as $subTree){
227 * - when this instance represents the root of the tree (because nspages doesn't display it)