PHP Class SideMenuModule, vanilla

Inheritance: extends Gdn_Module
显示文件 Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$AutoLinkGroups Should the group titles be autolinked to the first anchor in the group? Default TRUE.
$CssClass The class attribute to be applied to the root element of the breadcrumb. Default is none.
$EventName string | boolean
$HtmlId The html id attribute to be applied to the root element of the menu. Default is "Menu".
$Items An array of menu items.
$Sort An array of menu group names arranged in the order that the menu should be rendered.

Protected Properties

Property Type Description
$_Items array

Public Methods

Method Description
__construct ( string $Sender = '' )
addItem ( $Group, $Text, boolean $Permission = false, array $Attributes = [] )
addLink ( $Group, $Text, $Url, boolean $Permission = false, array $Attributes = [] )
assetTarget ( ) : string
checkPermissions ( )
clearGroups ( )
highlightRoute ( $Route )
removeGroup ( $Group ) Removes an entire group of links, and the group itself, from the menu.
removeLink ( $Group, $Text )
removeLinks ( $Group ) Removes all links from a specific group.
toString ( string $HighlightRoute = '' ) : string Render the menu.

Protected Methods

Method Description
_Compare ( $A, null $B = null ) : integer | void
_CompareSort ( array $A, array $All ) : integer The sort is determined by looking at: a) The item's sort.

Method Details

_Compare() protected method

protected _Compare ( $A, null $B = null ) : integer | void
$A
$B null
return integer | void

_CompareSort() protected method

b) Whether the item is after another. c) The order the item was added.
protected _CompareSort ( array $A, array $All ) : integer
$A array
$All array
return integer

__construct() public method

public __construct ( string $Sender = '' )
$Sender string

addItem() public method

public addItem ( $Group, $Text, boolean $Permission = false, array $Attributes = [] )
$Group
$Text
$Permission boolean
$Attributes array

assetTarget() public method

public assetTarget ( ) : string
return string

checkPermissions() public method

public checkPermissions ( )

clearGroups() public method

public clearGroups ( )

highlightRoute() public method

public highlightRoute ( $Route )
$Route

removeGroup() public method

Removes an entire group of links, and the group itself, from the menu.
public removeGroup ( $Group )

toString() public method

Render the menu.
public toString ( string $HighlightRoute = '' ) : string
$HighlightRoute string
return string

Property Details

$AutoLinkGroups public_oe property

Should the group titles be autolinked to the first anchor in the group? Default TRUE.
public $AutoLinkGroups

$CssClass public_oe property

The class attribute to be applied to the root element of the breadcrumb. Default is none.
public $CssClass

$EventName public_oe property

public string|bool $EventName
return string | boolean

$HtmlId public_oe property

The html id attribute to be applied to the root element of the menu. Default is "Menu".
public $HtmlId

$Items public_oe property

An array of menu items.
public $Items

$Sort public_oe property

An array of menu group names arranged in the order that the menu should be rendered.
public $Sort

$_Items protected_oe property

protected array $_Items
return array