Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Defines profile page navigation tree.

Copyright: 2015 onwards Ankit Agarwal
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 158 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

tree:: (6 methods):
  add_node()
  add_category()
  sort_categories()
  attach_nodes_to_categories()
  find_categories_after()
  __get()


Class: tree  - X-Ref

Defines my profile page navigation tree.

add_node(node $node)   X-Ref
Add a node to the tree.

param: node $node node object.

add_category(category $cat)   X-Ref
Add a category to the tree.

param: category $cat category object.

sort_categories()   X-Ref
Sort categories and nodes. Builds the tree structure that would be displayed to the user.


attach_nodes_to_categories()   X-Ref
Attach various nodes to their respective categories.


find_categories_after($category)   X-Ref
Find all category nodes that should be displayed after a given a category node.

return: category[] array of category objects
param: category $category category object

__get($prop)   X-Ref
Magic get method.

return: mixed
param: string $prop property to get.