Moodle  2.2.1
http://www.collinsharper.com
custom_menu_item Class Reference
Inheritance diagram for custom_menu_item:
Collaboration diagram for custom_menu_item:

Public Member Functions

 __construct ($text, moodle_url $url=null, $title=null, $sort=null, custom_menu_item $parent=null)
 add ($text, moodle_url $url=null, $title=null, $sort=null)
 get_text ()
 get_url ()
 get_title ()
 get_children ()
 get_sort_order ()
 get_parent ()
 sort ()
 has_children ()
 set_text ($text)
 set_title ($title)
 set_url (moodle_url $url)

Protected Attributes

 $text
 $url
 $title
 $sort
 $parent
 $children = array()
 $lastsort = 0

Detailed Description

Custom menu item

This class is used to represent one item within a custom menu that may or may not have children.

Since:
Moodle 2.0

Definition at line 2248 of file outputcomponents.php.


Constructor & Destructor Documentation

__construct ( text,
moodle_url url = null,
title = null,
sort = null,
custom_menu_item parent = null 
)

Constructs the new custom menu item

Parameters:
string$text
moodle_url$urlA moodle url to apply as the link for this item [Optional]
string$titleA title to apply to this item [Optional]
int$sortA sort or to use if we need to sort differently [Optional]
custom_menu_item$parentA reference to the parent custom_menu_item this child belongs to, only if the child has a parent. [Optional]

Definition at line 2294 of file outputcomponents.php.

Here is the call graph for this function:


Member Function Documentation

add ( text,
moodle_url url = null,
title = null,
sort = null 
)

Adds a custom menu item as a child of this node given its properties.

Parameters:
string$text
moodle_url$url
string$title
int$sort
Returns:
custom_menu_item

Definition at line 2311 of file outputcomponents.php.

Here is the caller graph for this function:

Sorts and returns the children for this item

Returns:
array

Definition at line 2345 of file outputcomponents.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Gets the parent this child belong to

Returns:
custom_menu_item

Definition at line 2360 of file outputcomponents.php.

Gets the sort order for this child

Returns:
int

Definition at line 2353 of file outputcomponents.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_text ( )

Returns the text for this item

Returns:
string

Definition at line 2324 of file outputcomponents.php.

Here is the caller graph for this function:

get_title ( )

Returns the title for this item

Returns:
string

Definition at line 2338 of file outputcomponents.php.

Here is the caller graph for this function:

get_url ( )

Returns the url for this item

Returns:
moodle_url

Definition at line 2331 of file outputcomponents.php.

Here is the caller graph for this function:

Returns true if this item has any children

Returns:
bool

Definition at line 2373 of file outputcomponents.php.

Here is the caller graph for this function:

set_text ( text)

Sets the text for the node

Parameters:
string$text

Definition at line 2381 of file outputcomponents.php.

set_title ( title)

Sets the title for the node

Parameters:
string$title

Definition at line 2389 of file outputcomponents.php.

set_url ( moodle_url url)

Sets the url for the node

Parameters:
moodle_url$url

Definition at line 2397 of file outputcomponents.php.

sort ( )

Sorts the children this item has

Definition at line 2366 of file outputcomponents.php.

Here is the caller graph for this function:


Field Documentation

$children = array() [protected]

Definition at line 2278 of file outputcomponents.php.

$lastsort = 0 [protected]

Definition at line 2283 of file outputcomponents.php.

$parent [protected]

Definition at line 2273 of file outputcomponents.php.

$sort [protected]

Definition at line 2268 of file outputcomponents.php.

$text [protected]

Definition at line 2253 of file outputcomponents.php.

$title [protected]

Definition at line 2263 of file outputcomponents.php.

$url [protected]

Definition at line 2258 of file outputcomponents.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations