Hello! I fased with the problem in Moodle 2.0. I need to set up tree structure with links (similar to the Navigation block) in my new block. I tried to create a class that inherits from block_tree, but I don't know how to add items to the tree.
That I found in the documentation:
- As of Moodle 2.0, if $this->content_type is BLOCK_TYPE_TREE, or if your block derives from block_tree, then $this->content is expected to have the following member variables:
- items This is an array of tree_item objects, representing the top level of the tree to be displayed. Each tree_item::children property may contain more tree_item objects for the next level down, which in turn contain more tree_item objects, and so on. Note that the tree block type has no footer.
Thank you in advance for your help!