class JHtmlMenu

Utility class working with menu select lists

Methods

static  array
menus( int $clientId)

Get a list of the available menus.

static  array
menuItems( array $config = array())

Returns an array of menu items grouped by menu.

static  string
menuItemList( string $name, string $selected = null, string $attribs = null, array $config = array())

Displays an HTML select list of menu items.

static  string
ordering( object $row, integer $id)

Build the select list for Menu Ordering

static  string
linkOptions( boolean $all = false, boolean $unassigned = false, int $clientId)

Build the multiple select list for Menu Links/Pages

static  array
treerecurse( integer $id, string $indent, array $list, array $children, integer $maxlevel = 9999, integer $level, int $type = 1)

Build the list representing the menu tree

Details

static array menus( int $clientId)

Get a list of the available menus.

Parameters

int $clientId The client id

Return Value

array

static array menuItems( array $config = array())

Returns an array of menu items grouped by menu.

Parameters

array $config An array of configuration options [published, checkacl, clientid].

Return Value

array

static string menuItemList( string $name, string $selected = null, string $attribs = null, array $config = array())

Displays an HTML select list of menu items.

Parameters

string $name The name of the control.
string $selected The value of the selected option.
string $attribs Attributes for the control.
array $config An array of options for the control [id, published, checkacl, clientid].

Return Value

string

static string ordering( object $row, integer $id)

Build the select list for Menu Ordering

Parameters

object $row &$row The row object
integer $id The id for the row. Must exist to enable menu ordering

Return Value

string

static string linkOptions( boolean $all = false, boolean $unassigned = false, int $clientId)

Build the multiple select list for Menu Links/Pages

Parameters

boolean $all True if all can be selected
boolean $unassigned True if unassigned can be selected
int $clientId The client id

Return Value

string

static array treerecurse( integer $id, string $indent, array $list, array $children, integer $maxlevel = 9999, integer $level, int $type = 1)

Build the list representing the menu tree

Parameters

integer $id Id of the menu item
string $indent The indentation string
array $list The list to process
array $children &$children The children of the current item
integer $maxlevel The maximum number of levels in the tree
integer $level The starting level
int $type Set the type of spacer to use. Use 1 for |_ or 0 for -

Return Value

array