What happens when you call elgg_view_menu of elgg core of some of the existing or your own menus?
In this short article I will go through the most important steps the ELGG engine doas when the menu is created for calling view.
As you probably know the individual menu item or the menu in elgg is created by calling function elgg_register_menu_item('menu_name', array(menu parameters)). More info you can find on elgg documentation.
If the named menu doesn't exist it is created. The menu "object" in Elgg is not a real object from OOP point of view. It is an array containing information about the menu as styling, sections and the actual individual menu items. These Menu items are the only objects in the menu array.
On the simple schema above is explained how elgg_menu_is created.
blue indicates elgg core functions or fields, red indicates user views (or default views)
light arrow indicates calling function bold arrows is returning to original calling view.
view calls
elgg_view_menu('menu_to_display', array(additional parameters)):
core function elgg_view_menu() queries from
$CONFIG->menus['menu_to_display']
calls
ElggMenuBuilder with information how to order menu items in the menu and reorders the items as required. Here as well passes to menu additional parameters if found.
calls
elgg_view with '
menu_to_display' view as parameter. If no '
menu_to_display' exists
default view is called. Menu with additional parameters is passed as parameter
Here you can do whatever you wish with custom
'menu_to_display' view
. Default view looks for sections in the menu (at least one - default section is found) and calls view section.
Section view calls item view.
The default menu view calls the section view which calls item view.
Default section and item views are available to be overridden by any plug-in or theme.
in next topic explained:
ElggMenuBuilder
ElggMenuItem
Css