Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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