|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($definition= '', $currentlanguage=null) | |
| override_children (array $children) | |
Static Public Member Functions | |
| static | convert_text_to_menu_nodes ($text, $language=null) |
| static | sort_custom_menu_items (custom_menu_item $itema, custom_menu_item $itemb) |
Protected Attributes | |
| $currentlanguage = null | |
Custom menu class
This class is used to operate a custom menu that can be rendered for the page. The custom menu is built using $CFG->custommenuitems and is a structured collection of custom_menu_item nodes that can be rendered by the core renderer.
To configure the custom menu: Settings: Administration > Appearance > Themes > Theme settings
Definition at line 2416 of file outputcomponents.php.
| __construct | ( | $ | definition = '', |
| $ | currentlanguage = null |
||
| ) |
Creates the custom menu
| string | $definition | the menu items definition in syntax required by convert_text_to_menu_nodes() |
| string | $language | the current language code, null disables multilang support |
Definition at line 2427 of file outputcomponents.php.

| static convert_text_to_menu_nodes | ( | $ | text, |
| $ | language = null |
||
| ) | [static] |
Converts a string into a structured array of custom_menu_items which can then be added to a custom menu.
Structure: text|url|title|langs The number of hyphens at the start determines the depth of the item. The languages are optional, comma separated list of languages the line is for.
Example structure: First level first item|http://www.moodle.com/ -Second level first item|http://www.moodle.com/partners/ -Second level second item|http://www.moodle.com/hq/ --Third level first item|http://www.moodle.com/jobs/ -Second level third item|http://www.moodle.com/development/ First level second item|http://www.moodle.com/feedback/ First level third item English only|http://moodle.com|English only item|en German only|http://moodle.de|Deutsch|de,de_du,de_kids
| string | $text | the menu items definition |
| string | $language | the language code, null disables multilang support |
Definition at line 2475 of file outputcomponents.php.
| override_children | ( | array $ | children | ) |
Overrides the children of this custom menu. Useful when getting children from $CFG->custommenuitems
Definition at line 2440 of file outputcomponents.php.

| static sort_custom_menu_items | ( | custom_menu_item $ | itema, |
| custom_menu_item $ | itemb | ||
| ) | [static] |
Sorts two custom menu items
This function is designed to be used with the usort method usort($this->children, array('custom_menu','sort_custom_menu_items'));
| custom_menu_item | $itema | |
| custom_menu_item | $itemb |
Definition at line 2561 of file outputcomponents.php.

$currentlanguage = null [protected] |
Definition at line 2419 of file outputcomponents.php.