Elgg
Version master
|
Go to the source code of this file.
Functions | |
elgg_register_menu_item (string $menu_name, array|\ElggMenuItem $menu_item) | |
Elgg navigation library Functions for managing menus and other navigational elements. More... | |
elgg_unregister_menu_item (string $menu_name, string $item_name) | |
Remove an item from a menu. More... | |
elgg_register_title_button (string $name= 'add', string $entity_type= '', string $entity_subtype= '') | |
Convenience function for registering a button to the title menu. More... | |
elgg_register_menu_item | ( | string | $menu_name, |
array|\ElggMenuItem | $menu_item | ||
) |
Elgg navigation library Functions for managing menus and other navigational elements.
Pagination Automatically handled by Elgg when using elgg_list_entities* functions.
Tabs
Menus Elgg uses a single interface to manage its menus. Menu items are added with elgg_register_menu_item(). This is generally used for menus that appear only once per page. For dynamic menus (such as the hover menu for user's avatar), an event is emitted when the menu is being created. The event is 'register', 'menu:<menu_name>'. For more details on this,
Menus supported by the Elgg core Standard menus: site Site navigation shown on every page. page Page menu usually shown in a sidebar. Uses Elgg's context. topbar Topbar menu shown on every page. The default has two sections. footer Like the topbar but in the footer.
Dynamic menus (also called just-in-time menus): user_hover Avatar hover menu. The user entity is passed as a parameter. entity The set of links shown in the summary of an entity. river Links shown on river items. owner_block Links shown for a user or group in their owner block. filter The tab filter for content (all, mine, friends) title The buttons shown next to a content title. longtext The links shown above the input/longtext view. login Menu of links at bottom of login box Register an item for an Elgg menu
The constructor and factory support the following array of menu item options: 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. 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 ES 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.
string | $menu_name | The name of the menu: site, page, userhover, userprofile, groupprofile, or any custom menu |
mixed | $menu_item | A object or an array of options |
Definition at line 83 of file navigation.php.
elgg_register_title_button | ( | string | $name = 'add' , |
string | $entity_type = '' , |
||
string | $entity_subtype = '' |
||
) |
Convenience function for registering a button to the title menu.
The URL must be resolvable in a route definition with the name "$name:$entity_type:$entity_subtype". The label of the button is "$name:$entity_type:$entity_subtype" so that must be defined in a language file.
This is used primarily to support adding an add content button
string | $name | Name of the button (defaults to 'add') |
string | $entity_type | Optional entity type to be added (used to verify canWriteToContainer permission) |
string | $entity_subtype | Optional entity subtype to be added (used to verify canWriteToContainer permission) |
Definition at line 120 of file navigation.php.
elgg_unregister_menu_item | ( | string | $menu_name, |
string | $item_name | ||
) |
Remove an item from a menu.
string | $menu_name | The name of the menu |
string | $item_name | The unique identifier for this menu item |
Definition at line 100 of file navigation.php.