Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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.

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

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

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