SproutCMS

This is the code documentation for the SproutCMS project

class Treenode

Represents a node in the tree

Source code (57 results)

/modules/Demo/Controllers/DemoController.php   Highlighted file source

Line 22: use Sprout\Helpers\TreenodeRedirectMatcher;
Line 54: Navigation::setPageNodeMatcher(new TreenodeRedirectMatcher('aaa'));
Line 69: Navigation::setPageNodeMatcher(new TreenodeRedirectMatcher('bbb'));

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 64: use Sprout\Helpers\Treenode;
Line 592: $new_root = new Treenode();
Line 600: self::renderPreviewTreenode($child);
Line 614: private static function renderPreviewTreenode($node)
Line 621: self::renderPreviewTreenode($child);
Line 735: $tree = new Treenode();
Line 736: $node = new Treenode();
Line 755: $new_root = new Treenode();
Line 770: $result = $this->createPageTreenode($child, (int)$_POST['parent_id'], $images, $headings, $operator);
Line 784: private function createPageTreenode($node, $parent_id, $images, $headings, $operator)
Line 840: $count += $this->createPageTreenode($child, $page_id, $images, $headings, $operator);

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 64: use Sprout\Helpers\Treenode;
Line 592: $new_root = new Treenode();
Line 600: self::renderPreviewTreenode($child);
Line 614: private static function renderPreviewTreenode($node)
Line 621: self::renderPreviewTreenode($child);
Line 735: $tree = new Treenode();
Line 736: $node = new Treenode();
Line 755: $new_root = new Treenode();
Line 770: $result = $this->createPageTreenode($child, (int)$_POST['parent_id'], $images, $headings, $operator);
Line 784: private function createPageTreenode($node, $parent_id, $images, $headings, $operator)
Line 840: $count += $this->createPageTreenode($child, $page_id, $images, $headings, $operator);

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 25: use Sprout\Helpers\Treenode;
Line 99: $root = Treenode::loadTree($this->table_name);
Line 108: $root = Treenode::loadTree($this->table_name);
Line 143: $root = Treenode::loadTree($this->table_name);
Line 360: $view->root = Treenode::loadTree($this->table_name, ['1'], 'record_order');

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 25: use Sprout\Helpers\Treenode;
Line 99: $root = Treenode::loadTree($this->table_name);
Line 108: $root = Treenode::loadTree($this->table_name);
Line 143: $root = Treenode::loadTree($this->table_name);
Line 360: $view->root = Treenode::loadTree($this->table_name, ['1'], 'record_order');

/sprout/Controllers/AdvancedSearchController.php   Highlighted file source

Line 29: use Sprout\Helpers\TreenodeFrontendMatcher;
Line 73: Navigation::setPageNodeMatcher(new TreenodeFrontendMatcher('advanced_search', 'form'));

/sprout/Controllers/AdvancedSearchController.php   Highlighted file source

Line 29: use Sprout\Helpers\TreenodeFrontendMatcher;
Line 73: Navigation::setPageNodeMatcher(new TreenodeFrontendMatcher('advanced_search', 'form'));

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 67: use Sprout\Helpers\TreenodeValueMatcher;
Line 2485: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $fake_node['id']));

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 67: use Sprout\Helpers\TreenodeValueMatcher;
Line 2485: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $fake_node['id']));

/sprout/Controllers/PageController.php   Highlighted file source

Line 42: use Sprout\Helpers\TreenodePathMatcher;
Line 43: use Sprout\Helpers\TreenodeValueMatcher;
Line 77: $matcher = new TreenodePathMatcher($name);
Line 250: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $page['id']));

/sprout/Controllers/PageController.php   Highlighted file source

Line 42: use Sprout\Helpers\TreenodePathMatcher;
Line 43: use Sprout\Helpers\TreenodeValueMatcher;
Line 77: $matcher = new TreenodePathMatcher($name);
Line 250: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $page['id']));

/sprout/Helpers/Admin.php   Highlighted file source

Line 283: * @param Treenode $node The node to render
Line 288: public static function navigationTreeNode($node, array $actions, $depth = 1)
Line 342: self::navigationTreeNode($child, $actions, $depth);

/sprout/Helpers/DocImport/DocImport.php   Highlighted file source

Line 23: use Sprout\Helpers\Treenode;
Line 157: * @return Treenode The tree of headings
Line 171: $root = new Treenode();
Line 177: $node = new Treenode();

/sprout/Helpers/DocImport/DocImport.php   Highlighted file source

Line 23: use Sprout\Helpers\Treenode;
Line 157: * @return Treenode The tree of headings
Line 171: $root = new Treenode();
Line 177: $node = new Treenode();

/sprout/Helpers/Fb.php   Highlighted file source

Line 1059: * Generates a dropdown selection menu from a Treenode and its children
Line 1066: * 'root' Treenode Tree root - Required
Line 1079: if (empty($options['root']) or !($options['root'] instanceof Treenode)) {
Line 1080: throw new InvalidArgumentException('Option "root" is required and must be a Treenode');

/sprout/Helpers/Fb.php   Highlighted file source

Line 1059: * Generates a dropdown selection menu from a Treenode and its children
Line 1066: * 'root' Treenode Tree root - Required
Line 1079: if (empty($options['root']) or !($options['root'] instanceof Treenode)) {
Line 1080: throw new InvalidArgumentException('Option "root" is required and must be a Treenode');

/sprout/Helpers/Navigation.php   Highlighted file source

Line 29: /** @var TreeNodeMatcher|null */
Line 39: * @param TreeNodeMatcher $page_node_matcher The matcher to use
Line 49: * @return TreeNodeMatcher The matcher being used.
Line 197: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 286: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 372: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 460: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 462: $page = self::$root_node->findNode(new TreenodePathMatcher($page_url));
Line 606: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 729: * Finds the node in the page tree which matched the specified {@see TreenodeMatcher}.
Line 731: * @return Treenode|null null if no node is found, or if the matcher does not exist
Line 758: self::$root_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Helpers/Navigation.php   Highlighted file source

Line 29: /** @var TreeNodeMatcher|null */
Line 39: * @param TreeNodeMatcher $page_node_matcher The matcher to use
Line 49: * @return TreeNodeMatcher The matcher being used.
Line 197: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 286: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 372: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 460: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 462: $page = self::$root_node->findNode(new TreenodePathMatcher($page_url));
Line 606: self::$root_node->filterChildren(new TreenodeInMenuMatcher());
Line 729: * Finds the node in the page tree which matched the specified {@see TreenodeMatcher}.
Line 731: * @return Treenode|null null if no node is found, or if the matcher does not exist
Line 758: self::$root_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Helpers/NavigationGroups.php   Highlighted file source

Line 68: * @param TreeNode $page_id The top-parent page id
Line 192: * Return an array of Treenode instances for the items in this group
Line 202: $root->filterChildren(new TreenodeInMenuMatcher());
Line 204: $items = $root->findAllNodes(new TreenodeValueMatcher('menu_group', $menu_group));

/sprout/Helpers/NavigationMenu.php   Highlighted file source

Line 57: $root->filterChildren(new TreenodeInMenuMatcher());
Line 91: $items = $root->findAllNodes(new TreenodeValueMatcher('menu_group', $group_id));
Line 149: * @param Treenode $node The node which is being rendered
Line 152: * @param Treenode $selected_node The page the user is currently looking at
Line 153: * @param array $selected_ancestors All ancestors of the selected node ({@see Treenode::find_ancestors})
Line 157: public static function determineClasses(Treenode $node, $depth, $index, $selected_node, array $selected_ancestors, $has_children) {
Line 177: * @param Treenode $parent_node The node which is being rendered
Line 178: * @param array $groups The groups of items to render, in the format [name => array of Treenode, ...]
Line 179: * @param Treenode $selected_node The page the user is currently looking at
Line 180: * @param array $selected_ancestors All ancestors of the selected node ({@see Treenode::find_ancestors})
Line 183: protected static function subMenu(Treenode $parent_node, array $groups, $selected_node, array $selected_ancestors) {

/sprout/Helpers/Page.php   Highlighted file source

Line 37: $matcher = new TreenodePathMatcher($url);
Line 78: $matcher = new TreenodeFrontendMatcher($class, $method);
Line 395: $matcher = new TreenodeIdsMatcher([$page_id]);
Line 404: $top_anc->filterChildren(new TreenodeInMenuMatcher());
Line 424: * @param TreeNode $node The node to traverse

/sprout/Helpers/Pagenode.php   Highlighted file source

Line 24: class Pagenode extends Treenode

/sprout/Helpers/PageRouting.php   Highlighted file source

Line 90: $matcher = new TreenodePathMatcher(Router::$current_uri);

/sprout/Helpers/SitemapGenPages.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 31: $root->filterChildren(new TreenodeInMenuMatcher());

/sprout/Helpers/SitemapGenPages.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 31: $root->filterChildren(new TreenodeInMenuMatcher());

/sprout/Helpers/Treenode.php   Highlighted file source

Line 27: class Treenode implements ArrayAccess
Line 70: * @return Treenode The loaded tree
Line 88: $nodes[] = new Treenode($row);
Line 93: $root_node = new Treenode(array('id' => 0));
Line 130: * @return TreeNode if found, null if not found.
Line 152: * @param TreenodeMatcher $matcher The matcher to use for finding the node.
Line 155: public function findNode(TreenodeMatcher $matcher)
Line 178: * @param TreenodeMatcher $matcher The matcher to use for finding the nodes.
Line 181: public function findAllNodes(TreenodeMatcher $matcher)
Line 238: * Filter the children of this node, removing any children which don't match the specified TreenodeMatcher.
Line 242: public function filterChildren(TreenodeMatcher $matcher)
Line 332: * Generic field getter for unknown properties - used for TreeNode->children
Line 348: * Generic field getter for unknown properties - used for TreeNode->children

/sprout/Helpers/Treenode.php   Highlighted file source

Line 27: class Treenode implements ArrayAccess
Line 70: * @return Treenode The loaded tree
Line 88: $nodes[] = new Treenode($row);
Line 93: $root_node = new Treenode(array('id' => 0));
Line 130: * @return TreeNode if found, null if not found.
Line 152: * @param TreenodeMatcher $matcher The matcher to use for finding the node.
Line 155: public function findNode(TreenodeMatcher $matcher)
Line 178: * @param TreenodeMatcher $matcher The matcher to use for finding the nodes.
Line 181: public function findAllNodes(TreenodeMatcher $matcher)
Line 238: * Filter the children of this node, removing any children which don't match the specified TreenodeMatcher.
Line 242: public function filterChildren(TreenodeMatcher $matcher)
Line 332: * Generic field getter for unknown properties - used for TreeNode->children
Line 348: * Generic field getter for unknown properties - used for TreeNode->children

/sprout/Helpers/TreenodeContainsMatcher.php   Highlighted file source

Line 23: class TreenodeContainsMatcher implements TreenodeMatcher
Line 44: * @param TreeNode $node The treenode to do matching against
Line 56: * @param TreeNode $node The treenode which is about to be descended into
Line 67: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeFrontendMatcher.php   Highlighted file source

Line 23: class TreenodeFrontendMatcher implements TreenodeMatcher
Line 40: * @param TreeNode $node The treenode to do matching against
Line 53: * @param TreeNode $node The treenode which is about to be descended into
Line 64: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeHasWidgetMatcher.php   Highlighted file source

Line 23: class TreenodeHasWidgetMatcher implements TreenodeMatcher
Line 49: * @param TreeNode $node The treenode to do matching against
Line 61: * @param TreeNode $node The treenode which is about to be descended into
Line 72: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeIdsMatcher.php   Highlighted file source

Line 23: class TreenodeIdsMatcher implements TreenodeMatcher
Line 40: * @param TreeNode $node The treenode to do matching against
Line 52: * @param TreeNode $node The treenode which is about to be descended into
Line 63: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeIdsMatcher.php   Highlighted file source

Line 23: class TreenodeIdsMatcher implements TreenodeMatcher
Line 40: * @param TreeNode $node The treenode to do matching against
Line 52: * @param TreeNode $node The treenode which is about to be descended into
Line 63: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeInMenuMatcher.php   Highlighted file source

Line 23: class TreenodeInMenuMatcher implements TreenodeMatcher
Line 29: * @param TreeNode $node The treenode to do matching against
Line 42: * @param TreeNode $node The treenode which is about to be descended into
Line 53: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeMatcher.php   Highlighted file source

Line 21: * Interface for matching nodes in the treenode
Line 23: interface TreenodeMatcher {
Line 28: * @param TreeNode $node The treenode to do matching against
Line 36: * @param TreeNode $node The treenode which is about to be descended into
Line 44: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodePageAttrMatcher.php   Highlighted file source

Line 23: class TreenodePageAttrMatcher implements TreenodeMatcher
Line 44: * @param TreeNode $node The treenode to do matching against
Line 56: * @param TreeNode $node The treenode which is about to be descended into
Line 67: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodePageAttrMatcher.php   Highlighted file source

Line 23: class TreenodePageAttrMatcher implements TreenodeMatcher
Line 44: * @param TreeNode $node The treenode to do matching against
Line 56: * @param TreeNode $node The treenode which is about to be descended into
Line 67: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodePathMatcher.php   Highlighted file source

Line 24: class TreenodePathMatcher implements TreenodeMatcher
Line 46: * @param TreeNode $node The treenode which is about to be descended into
Line 67: * @param TreeNode $node The treenode to do matching against
Line 89: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeRedirectMatcher.php   Highlighted file source

Line 23: class TreenodeRedirectMatcher implements TreenodeMatcher
Line 38: * @param TreeNode $node The treenode to do matching against
Line 52: * @param TreeNode $node The treenode which is about to be descended into
Line 63: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeRedirectMatcher.php   Highlighted file source

Line 23: class TreenodeRedirectMatcher implements TreenodeMatcher
Line 38: * @param TreeNode $node The treenode to do matching against
Line 52: * @param TreeNode $node The treenode which is about to be descended into
Line 63: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeRegexMatcher.php   Highlighted file source

Line 23: class TreenodeRegexMatcher implements TreenodeMatcher
Line 48: * @param TreeNode $node The treenode to do matching against
Line 62: * @param TreeNode $node The treenode which is about to be descended into
Line 73: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeRegexMatcher.php   Highlighted file source

Line 23: class TreenodeRegexMatcher implements TreenodeMatcher
Line 48: * @param TreeNode $node The treenode to do matching against
Line 62: * @param TreeNode $node The treenode which is about to be descended into
Line 73: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeValueMatcher.php   Highlighted file source

Line 23: class TreenodeValueMatcher implements TreenodeMatcher
Line 45: * @param TreeNode $node The treenode to do matching against
Line 57: * @param TreeNode $node The treenode which is about to be descended into
Line 68: * @param TreeNode $node The treenode which has just ascended.

/sprout/Helpers/TreenodeValueMatcher.php   Highlighted file source

Line 23: class TreenodeValueMatcher implements TreenodeMatcher
Line 45: * @param TreeNode $node The treenode to do matching against
Line 57: * @param TreeNode $node The treenode which is about to be descended into
Line 68: * @param TreeNode $node The treenode which has just ascended.

/sprout/tests/DocImport/docImportTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Treenode;
Line 130: * Test treenode building from headings
Line 138: $this->assertTrue($tree instanceof Treenode);
Line 140: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 211: * Test treenode building - three levels
Line 221: $this->assertTrue($node0 instanceof Treenode);
Line 227: $this->assertTrue($node1 instanceof Treenode);
Line 234: $this->assertTrue($node2 instanceof Treenode);
Line 246: * Test treenode building - include body
Line 254: $this->assertTrue($tree instanceof Treenode);
Line 256: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 262: $this->assertTrue($tree instanceof Treenode);
Line 264: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 270: $this->assertTrue($tree instanceof Treenode);
Line 272: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 275: $this->assertTrue($tree->children[1] instanceof Treenode);

/sprout/tests/DocImport/docImportTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Treenode;
Line 130: * Test treenode building from headings
Line 138: $this->assertTrue($tree instanceof Treenode);
Line 140: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 211: * Test treenode building - three levels
Line 221: $this->assertTrue($node0 instanceof Treenode);
Line 227: $this->assertTrue($node1 instanceof Treenode);
Line 234: $this->assertTrue($node2 instanceof Treenode);
Line 246: * Test treenode building - include body
Line 254: $this->assertTrue($tree instanceof Treenode);
Line 256: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 262: $this->assertTrue($tree instanceof Treenode);
Line 264: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 270: $this->assertTrue($tree instanceof Treenode);
Line 272: $this->assertTrue($tree->children[0] instanceof Treenode);
Line 275: $this->assertTrue($tree->children[1] instanceof Treenode);

/sprout/views/admin/style_guide/forms.php   Highlighted file source

Line 3: use Sprout\Helpers\Treenode;
Line 19: $dropdown_tree = new Treenode();
Line 20: $child = new Treenode(['id' => 10, 'name' => 'A']);

/sprout/views/admin/style_guide/forms.php   Highlighted file source

Line 3: use Sprout\Helpers\Treenode;
Line 19: $dropdown_tree = new Treenode();
Line 20: $child = new Treenode(['id' => 10, 'name' => 'A']);

/sprout/views/dbtools/skin_test_content.php   Highlighted file source

Line 3: use Sprout\Helpers\Treenode;
Line 241: $dropdown_tree = new Treenode();
Line 242: $child = new Treenode(['id' => 10, 'name' => 'A']);

/sprout/views/dbtools/skin_test_content.php   Highlighted file source

Line 3: use Sprout\Helpers\Treenode;
Line 241: $dropdown_tree = new Treenode();
Line 242: $child = new Treenode(['id' => 10, 'name' => 'A']);

/sprout/Widgets/ChildrenGalleryWidget.php   Highlighted file source

Line 19: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 20: use Sprout\Helpers\TreenodeValueMatcher;
Line 57: $matcher = new TreenodeValueMatcher('id', $this->settings['parent']);
Line 64: $page_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Widgets/ChildrenGalleryWidget.php   Highlighted file source

Line 19: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 20: use Sprout\Helpers\TreenodeValueMatcher;
Line 57: $matcher = new TreenodeValueMatcher('id', $this->settings['parent']);
Line 64: $page_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Widgets/ChildrenPagesWidget.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 48: $page_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Widgets/ChildrenPagesWidget.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 48: $page_node->filterChildren(new TreenodeInMenuMatcher());

/sprout/Widgets/RelatedLinksWidget.php   Highlighted file source

Line 20: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 52: $top_anc->filterChildren(new TreenodeInMenuMatcher());
Line 96: * @param TreeNode $node The node to draw

/sprout/Widgets/RelatedLinksWidget.php   Highlighted file source

Line 20: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 52: $top_anc->filterChildren(new TreenodeInMenuMatcher());
Line 96: * @param TreeNode $node The node to draw

/sprout/Widgets/SitemapWidget.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 40: $root_node->filterChildren(new TreenodeInMenuMatcher());
Line 57: * @param TreeNode $node The node to draw

/sprout/Widgets/SitemapWidget.php   Highlighted file source

Line 18: use Sprout\Helpers\TreenodeInMenuMatcher;
Line 40: $root_node->filterChildren(new TreenodeInMenuMatcher());
Line 57: * @param TreeNode $node The node to draw

A total of 279 lines in 57 files were found