Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ElggMenuBuilder
  • ElggMenuItem
  • Overview
  • Package
  • Class
  • Tree

Class ElggMenuBuilder

Elgg Menu Builder

Package: Elgg\Core\Navigation
Since: 1.8.0
Located at ElggMenuBuilder.php
Methods summary
public
# __construct( array $menu )

ElggMenuBuilder constructor

ElggMenuBuilder constructor

Parameters

$menu
ElggMenuItem[]
$menu Array of ElggMenuItem objects
public array
# getMenu( mixed $sort_by = 'text' )

Get a prepared menu array

Get a prepared menu array

Parameters

$sort_by
mixed
$sort_by Method to sort the menu by. @see ElggMenuBuilder::sort()

Returns

array
public ElggMenuItem
# getSelected( )

Get the selected menu item

Get the selected menu item

Returns

ElggMenuItem
protected
# selectFromContext( )

Select menu items for the current context

Select menu items for the current context

protected
# setupSections( )

Group the menu items into sections

Group the menu items into sections

protected
# setupTrees( )

Create trees for each menu section

Create trees for each menu section

protected ElggMenuItem
# findSelected( )

Find the menu item that is currently selected

Find the menu item that is currently selected

Returns

ElggMenuItem
protected
# sort( mixed $sort_by )

Sort the menu sections and trees

Sort the menu sections and trees

Parameters

$sort_by
mixed
$sort_by Sort type as string or php callback
public static boolean
# compareByText( ElggMenuItem $a, ElggMenuItem $b )

Compare two menu items by their display text

Compare two menu items by their display text

Parameters

$a
ElggMenuItem
$a Menu item
$b
ElggMenuItem
$b Menu item

Returns

boolean
public static boolean
# compareByName( ElggMenuItem $a, ElggMenuItem $b )

Compare two menu items by their identifiers

Compare two menu items by their identifiers

Parameters

$a
ElggMenuItem
$a Menu item
$b
ElggMenuItem
$b Menu item

Returns

boolean
public static boolean
# compareByWeight( ElggMenuItem $a, ElggMenuItem $b )

Compare two menu items by their priority

Compare two menu items by their priority

Parameters

$a
ElggMenuItem
$a Menu item
$b
ElggMenuItem
$b Menu item

Returns

boolean
Properties summary
protected ElggMenuItem[] $menu array()
#
protected mixed $selected null
#
API documentation generated by ApiGen 2.8.0