Elgg  Version 3.0
Namespaces | Functions | Variables
navigation.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 elgg_register_menu_item ($menu_name, $menu_item)
 Register an item for an Elgg menu. More...
 
 elgg_unregister_menu_item ($menu_name, $item_name)
 Remove an item from a menu. More...
 
 elgg_is_menu_item_registered ($menu_name, $item_name)
 Check if a menu item has been registered. More...
 
 elgg_get_menu_item ($menu_name, $item_name)
 Get a menu item registered for a menu. More...
 
 elgg_register_title_button ($handler=null, $name= 'add', $entity_type= 'all', $entity_subtype= 'all')
 Convenience function for registering a button to the title menu. More...
 
 elgg_push_breadcrumb ($text, $href=false)
 Adds a breadcrumb to the breadcrumbs stack. More...
 
 elgg_pop_breadcrumb ()
 Removes last breadcrumb entry. More...
 
 elgg_get_breadcrumbs (array $breadcrumbs=null)
 Returns all breadcrumbs as an array [ [ 'text' => 'Breadcrumb title', 'href' => '/path/to/page', ] ] More...
 
 elgg_prepare_breadcrumbs ($hook, $type, $breadcrumbs, $params)
 Prepare breadcrumbs before display. More...
 
 elgg_push_entity_breadcrumbs (ElggEntity $entity, $link_self=true)
 Resolves and pushes entity breadcrumbs based on named routes. More...
 
 elgg_push_collection_breadcrumbs ($entity_type, $entity_subtype, ElggEntity $container=null, $friends=false)
 Resolves and pushes collection breadcrumbs for a container. More...
 
 elgg_get_filter_tabs ($context=null, $selected=null, ElggUser $user=null, array $vars=[])
 Returns default filter tabs (All, Mine, Friends) for the user. More...
 
 _elgg_site_menu_init ($hook, $type, $return, $params)
 Init site menu. More...
 
 _elgg_site_menu_setup ($hook, $type, $menu, $params)
 Set up the site menu. More...
 
 _elgg_setup_vertical_menu (\Elgg\Hook $hook)
 Prepare vertically stacked menu. More...
 
 _elgg_entity_menu_setup ($hook, $type, $return, $params)
 Entity menu is list of links and info on any entity. More...
 
 _elgg_menu_transform_to_dropdown (\Elgg\Hook $hook)
 Moves default menu items into a dropdown. More...
 
 _elgg_entity_navigation_menu_setup (\Elgg\Hook $hook)
 Entity navigation menu is previous/next link for an entity. More...
 
 _elgg_widget_menu_setup ($hook, $type, $return, $params)
 Widget menu is a set of widget controls. More...
 
 _elgg_login_menu_setup ($hook, $type, $return, $params)
 Add the register and forgot password links to login menu. More...
 
 _elgg_rss_menu_setup ($hook, $type, $return, $params)
 Add the RSS link to the menu. More...
 
 _elgg_nav_init ()
 Navigation initialization. More...
 
 _elgg_nav_public_pages ($hook_name, $entity_type, $return_value, $params)
 Extend public pages. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_entity_menu_setup (   $hook,
  $type,
  $return,
  $params 
)

Entity menu is list of links and info on any entity.

Parameters
string$hook'register'
string$type'menu:entity'
MenuItems$returncurrent return value
array$paramssupplied params
Returns
MenuItems

Definition at line 722 of file navigation.php.

_elgg_entity_navigation_menu_setup ( \Elgg\Hook  $hook)

Entity navigation menu is previous/next link for an entity.

register menu:entity_navigation

Parameters
\Elgg\Hook$hookHook
Returns
MenuItems

Definition at line 835 of file navigation.php.

_elgg_login_menu_setup (   $hook,
  $type,
  $return,
  $params 
)

Add the register and forgot password links to login menu.

Parameters
string$hook'register'
string$type'menu:login'
MenuItems$returncurrent return value
array$paramssupplied params
Returns
MenuItems

Definition at line 979 of file navigation.php.

_elgg_menu_transform_to_dropdown ( \Elgg\Hook  $hook)

Moves default menu items into a dropdown.

Pass 'dropdown' => false to entity menu options to render the menu inline without a dropdown

prepare menu:entity prepare menu:river

Parameters
\Elgg\Hook$hookHook
Returns
void

Definition at line 790 of file navigation.php.

_elgg_nav_init ( )

Navigation initialization.

Returns
void

Definition at line 1042 of file navigation.php.

_elgg_nav_public_pages (   $hook_name,
  $entity_type,
  $return_value,
  $params 
)

Extend public pages.

Parameters
string$hook_name"public_pages"
string$entity_type"walled_garden"
string[]$return_value Paths accessible outside the "walled garden"
mixed$paramsunused
Returns
string[]

Definition at line 1091 of file navigation.php.

_elgg_rss_menu_setup (   $hook,
  $type,
  $return,
  $params 
)

Add the RSS link to the menu.

Parameters
string$hook'register'
string$type'menu:footer'
MenuItems$returncurrent return value
array$paramssupplied params
Returns
MenuItems

Definition at line 1012 of file navigation.php.

_elgg_setup_vertical_menu ( \Elgg\Hook  $hook)

Prepare vertically stacked menu.

Sets the display child menu option to "toggle" if not set Recursively marks parents of the selected item as selected (expanded)

prepare menu:page prepare menu:owner_block

Parameters
\Elgg\Hook$hookHook
Returns
PreparedMenu

Definition at line 673 of file navigation.php.

_elgg_site_menu_init (   $hook,
  $type,
  $return,
  $params 
)

Init site menu.

Registers custom menu items

Parameters
string$hook'register'
string$type'menu:site'
MenuItems$returnMenu
array$paramsHook params
Returns
MenuItems

Definition at line 547 of file navigation.php.

_elgg_site_menu_setup (   $hook,
  $type,
  $menu,
  $params 
)

Set up the site menu.

Handles default, featured, and custom menu items

Parameters
string$hook'prepare'
string$type'menu:site'
PreparedMenu$menucurrent return value
array$paramssupplied params
Returns
PreparedMenu

Definition at line 577 of file navigation.php.

_elgg_widget_menu_setup (   $hook,
  $type,
  $return,
  $params 
)

Widget menu is a set of widget controls.

Parameters
string$hook'register'
string$type'menu:widget'
MenuItems$returncurrent return value
array$paramssupplied params
Returns
MenuItems

Definition at line 930 of file navigation.php.

elgg_get_breadcrumbs ( array  $breadcrumbs = null)

Returns all breadcrumbs as an array [ [ 'text' => 'Breadcrumb title', 'href' => '/path/to/page', ] ]

Breadcrumbs are filtered through the plugin hook [prepare, breadcrumbs] before being returned.

Parameters
array$breadcrumbsAn array of breadcrumbs If set, will override breadcrumbs in the stack
Returns
array
Since
1.8.0
See also
elgg_prepare_breadcrumbs()

Definition at line 348 of file navigation.php.

elgg_get_filter_tabs (   $context = null,
  $selected = null,
ElggUser  $user = null,
array  $vars = [] 
)

Returns default filter tabs (All, Mine, Friends) for the user.

Parameters
string$contextContext to be used to prefix tab URLs
string$selectedName of the selected tab
ElggUser$userUser who owns the layout (defaults to logged in user)
array$varsAdditional vars
Returns
ElggMenuItem[]
Since
2.3
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 494 of file navigation.php.

elgg_get_menu_item (   $menu_name,
  $item_name 
)

Get a menu item registered for a menu.

Parameters
string$menu_nameThe name of the menu
string$item_nameThe unique identifier for this menu item
Returns
ElggMenuItem|null
Since
1.9.0

Definition at line 198 of file navigation.php.

elgg_is_menu_item_registered (   $menu_name,
  $item_name 
)

Check if a menu item has been registered.

Parameters
string$menu_nameThe name of the menu
string$item_nameThe unique identifier for this menu item
Returns
bool
Since
1.8.0

Definition at line 169 of file navigation.php.

elgg_pop_breadcrumb ( )

Removes last breadcrumb entry.

Returns
array popped breadcrumb array or empty array
Since
1.8.0

Definition at line 315 of file navigation.php.

elgg_prepare_breadcrumbs (   $hook,
  $type,
  $breadcrumbs,
  $params 
)

Prepare breadcrumbs before display.

This turns titles into 100-character excerpts, and also removes the last crumb if it's not a link.

Parameters
string$hook"prepare"
string$type"breadcrumbs"
array$breadcrumbsBreadcrumbs to be altered
array$paramsHook parameters
Returns
array
Since
1.11

Definition at line 404 of file navigation.php.

elgg_push_breadcrumb (   $text,
  $href = false 
)

Adds a breadcrumb to the breadcrumbs stack.

See elgg_get_breadcrumbs() and the navigation/breadcrumbs view.

Parameters
string$textThe title to display. During rendering this is HTML encoded.
false | string$hrefOptional. The href for the title. During rendering links are normalized via elgg_normalize_url().
Returns
void
Since
1.8.0
See also
elgg_get_breadcrumbs()

Definition at line 298 of file navigation.php.

elgg_push_collection_breadcrumbs (   $entity_type,
  $entity_subtype,
ElggEntity  $container = null,
  $friends = false 
)

Resolves and pushes collection breadcrumbs for a container.

Parameters
string$entity_typeEntity type in the collection
string$entity_subtypeEntity subtype in the collection
ElggEntity | null$containerContainer/page owner entity
bool$friendsCollection belongs to container's friends?
Returns
void

Definition at line 445 of file navigation.php.

elgg_push_entity_breadcrumbs ( ElggEntity  $entity,
  $link_self = true 
)

Resolves and pushes entity breadcrumbs based on named routes.

Parameters
ElggEntity$entityEntity
bool$link_selfUse entity link in the last crumb
Returns
void

Definition at line 426 of file navigation.php.

elgg_register_menu_item (   $menu_name,
  $menu_item 
)

Register an item for an Elgg menu.

Warning
Generally you should not use this in response to the plugin hook: 'register', 'menu:<menu_name>'. If you do, you may end up with many incorrect links on a dynamic menu.
A menu item's name must be unique per menu. If more than one menu item with the same name are registered, the last menu item takes priority.
See also
elgg_view_menu() for the plugin hooks available for modifying a menu as it is being rendered.
ElggMenuItem::factory() is used to turn an array value of $menu_item into an ElggMenuItem object.
Parameters
string$menu_nameThe name of the menu: site, page, userhover, userprofile, groupprofile, or any custom menu
mixed$menu_itemA object or an array of options in format: name => STR Menu item identifier (required) text => STR Menu item display text as HTML (required) href => STR Menu item URL (required) false = do not create a link. null = current URL. "" = current URL. "/" = site home page.
Warning
If href is false, the tag will not appear, so the link_class will not apply. If you put tags in manually through the 'text' option the default CSS selector .elgg-menu-$menu > li > a may affect formatting. Wrap in a if it does.) contexts => ARR Page context strings section => STR Menu section identifier title => STR Menu item tooltip selected => BOOL Is this menu item currently selected parent_name => STR Identifier of the parent menu item link_class => STR A class or classes for the tag item_class => STR A class or classes for the tag deps => STR One or more AMD modules to require

Additional options that the view output/url takes can be passed in the array. Custom options can be added by using the 'data' key with the value being an associative array.

Returns
bool False if the item could not be added
Since
1.8.0

Definition at line 100 of file navigation.php.

elgg_register_title_button (   $handler = null,
  $name = 'add',
  $entity_type = 'all',
  $entity_subtype = 'all' 
)

Convenience function for registering a button to the title menu.

The URL must be $handler/$name/$guid where $guid is the guid of the page owner. The label of the button is "$handler:$name" so that must be defined in a language file.

This is used primarily to support adding an add content button

Parameters
string$handlerThe handler to use or null to autodetect from context
string$nameName of the button (defaults to 'add')
string$entity_typeOptional entity type to be added (used to verify canWriteToContainer permission)
string$entity_subtypeOptional entity subtype to be added (used to verify canWriteToContainer permission)
Returns
void
Since
1.8.0

Definition at line 234 of file navigation.php.

elgg_unregister_menu_item (   $menu_name,
  $item_name 
)

Remove an item from a menu.

Parameters
string$menu_nameThe name of the menu
string$item_nameThe unique identifier for this menu item
Returns
|null
Since
1.8.0

Definition at line 137 of file navigation.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 1102 of file navigation.php.