Lines Matching defs: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){
47 return $tree;
51 $tree = new NspagesTreeNsNode(':');
53 $this->_fillTree($tree, $this->_getNS($item), $item, '');
55 return $tree;
59 * Get rid of the "trunk" of the tree. ie: remove the first "empty" nodes. It prevents printing
69 private function _getTrimmedTree($tree){
70 if ($tree->id === $this->rootNS){
71 return $tree;
73 if (is_null($tree->children)) {
76 return $tree;
78 $firstAndOnlyChild = reset($tree->children);
138 private function _fillTree($tree, $keys, $item, $parentId) {
141 $tree->self = $item;
143 $tree->pages []= $item;
145 } else { // We're not at the place of $item in the tree yet, we continue to go down
148 if (!array_key_exists($key, $tree->children)){
150 $tree->children[$key] = $node;
153 $this->_fillTree($tree->children[$key], $keys, $item, $currentId);
157 private function _printTree($tree) {
160 foreach($tree->children as $subTree){
164 foreach($tree->pages as $page){
171 private function _printSubTree($tree, $level) {
172 $this->_printElementOpen($tree->self, $level);
173 if ( !is_null($tree->self) ){
174 $this->_printElementContent($tree->self, $level);
176 $this->renderer->doc .= '<div>' . $tree->id . '</div>';
179 $hasInnerData = !empty($tree->children) || !empty($tree->pages);
183 foreach($tree->children as $subTree){
186 foreach($tree->pages as $page){
213 * - when this instance represents the root of the tree (because nspages doesn't display it)