PHP 클래스 ElggMenuBuilder, Elgg

부터: 1.8.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$menu ElggMenuItem[]
$selected

공개 메소드들

메소드 설명
__construct ( array $menu ) \ElggMenuBuilder constructor
compareByName ( ElggMenuItem $a, ElggMenuItem $b ) : boolean Compare two menu items by their identifiers
compareByPriority ( ElggMenuItem $a, ElggMenuItem $b ) : boolean Compare two menu items by their priority
compareByText ( ElggMenuItem $a, ElggMenuItem $b ) : boolean Compare two menu items by their display text HTML tags are stripped before comparison
getMenu ( mixed $sort_by = 'text' ) : array Get a prepared menu array
getSelected ( ) : ElggMenuItem Get the selected menu item

보호된 메소드들

메소드 설명
findSelected ( ) : ElggMenuItem Find the menu item that is currently selected
selectFromContext ( ) : void Select menu items for the current context
setupSections ( ) : void Group the menu items into sections
setupTrees ( ) : void Create trees for each menu section
sort ( mixed $sort_by ) : void Sort the menu sections and trees

메소드 상세

__construct() 공개 메소드

\ElggMenuBuilder constructor
public __construct ( array $menu )
$menu array Array of \ElggMenuItem objects

compareByName() 공개 정적인 메소드

Compare two menu items by their identifiers
public static compareByName ( ElggMenuItem $a, ElggMenuItem $b ) : boolean
$a ElggMenuItem Menu item
$b ElggMenuItem Menu item
리턴 boolean

compareByPriority() 공개 정적인 메소드

Compare two menu items by their priority
부터: 1.9.0
public static compareByPriority ( ElggMenuItem $a, ElggMenuItem $b ) : boolean
$a ElggMenuItem Menu item
$b ElggMenuItem Menu item
리턴 boolean

compareByText() 공개 정적인 메소드

Compare two menu items by their display text HTML tags are stripped before comparison
public static compareByText ( ElggMenuItem $a, ElggMenuItem $b ) : boolean
$a ElggMenuItem Menu item
$b ElggMenuItem Menu item
리턴 boolean

findSelected() 보호된 메소드

Find the menu item that is currently selected
protected findSelected ( ) : ElggMenuItem
리턴 ElggMenuItem

getMenu() 공개 메소드

Get a prepared menu array
public getMenu ( mixed $sort_by = 'text' ) : array
$sort_by mixed Method to sort the menu by. @see \ElggMenuBuilder::sort()
리턴 array

getSelected() 공개 메소드

Get the selected menu item
public getSelected ( ) : ElggMenuItem
리턴 ElggMenuItem

selectFromContext() 보호된 메소드

Select menu items for the current context
protected selectFromContext ( ) : void
리턴 void

setupSections() 보호된 메소드

Group the menu items into sections
protected setupSections ( ) : void
리턴 void

setupTrees() 보호된 메소드

Create trees for each menu section
protected setupTrees ( ) : void
리턴 void

sort() 보호된 메소드

Sort the menu sections and trees
protected sort ( mixed $sort_by ) : void
$sort_by mixed Sort type as string or php callback
리턴 void

프로퍼티 상세

$menu 보호되어 있는 프로퍼티

protected ElggMenuItem[] $menu
리턴 ElggMenuItem[]

$selected 보호되어 있는 프로퍼티

protected $selected