Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
navigation_json Class Reference

Simple class used to output a navigation branch in XML. More...

Public Member Functions

 convert ($branch)
 Turns a branch and all of its children into XML.
 
 set_expandable ($expandable)
 Set the expandable items in the array so that we have enough information to attach AJAX events.
 

Protected Member Functions

 convert_child ($child, $depth=1)
 Recusively converts a child node and its children to XML for output.
 

Protected Attributes

array $expandable = array()
 An array of node keys and types.
 
array $nodetype = array('node','branch')
 An array of different node types.
 

Detailed Description

Simple class used to output a navigation branch in XML.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ convert()

navigation_json::convert ( $branch)

Turns a branch and all of its children into XML.

Parameters
navigation_node$branch
Return values
stringXML string

◆ convert_child()

navigation_json::convert_child ( $child,
$depth = 1 )
protected

Recusively converts a child node and its children to XML for output.

Parameters
navigation_node$childThe child to convert
int$depthPointlessly used to track the depth of the XML structure
Return values
stringJSON

◆ set_expandable()

navigation_json::set_expandable ( $expandable)

Set the expandable items in the array so that we have enough information to attach AJAX events.

Parameters
array$expandable

The documentation for this class was generated from the following file: