Module mod_menu

Menu module.

Copyright © 2009-2015 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Menu module. Supports menus in Zotonic. Adds admin interface to define the menu.

Function Index

event/2
get_menu/1Fetch the default menu.
get_menu/2Fetch a menu structure from a rsc.
init/1Initializes the module (after the datamodel is installed).
manage_schema/2The datamodel for the menu routines.
menu_flat/2Flatten the menu structure in a list, used for display purposes in templates.
menu_flat/3
menu_subtree/3Find the subtree below a resource id.
menu_subtree/4
observe_admin_menu/3
observe_menu_get_rsc_ids/2Notifier handler to get all menu ids for the default menu.
observe_menu_save/2Observer the 'menu_save' notification.
remove_invisible/2
set_menu/3Save the current menu.

Function Details

event/2

event(Postback_notify, Context) -> any()

get_menu/1

get_menu(Context) -> list()

Fetch the default menu. Performs validation/visibility checking on the menu items.

get_menu/2

get_menu(Id, Context) -> list()

Fetch a menu structure from a rsc. Performs validation/visibility checking on the menu items.

init/1

init(Context) -> any()

Initializes the module (after the datamodel is installed).

manage_schema/2

manage_schema(Version, Context) -> any()

The datamodel for the menu routines.

menu_flat/2

menu_flat(Menu::list() | undefined | <<>>, Context::z:context()) -> [{integer() | undefined, LevelIndex::[integer()] | undefined, up | down | undefined}]

Flatten the menu structure in a list, used for display purposes in templates

menu_flat/3

menu_flat(Menu::list() | undefined | <<>>, MaxDepth::integer(), Context::z:context()) -> [{integer() | undefined, LevelIndex::[integer()] | undefined, up | down | undefined}]

menu_subtree/3

menu_subtree(Menu::list(), PageId::term(), Context::#context{}) -> list() | undefined

Find the subtree below a resource id. 'undefined' when not found.

menu_subtree/4

menu_subtree(Menu::list(), PageId::term(), AddSiblings::boolean(), Context::#context{}) -> list() | undefined

observe_admin_menu/3

observe_admin_menu(Admin_menu, Acc, Context) -> any()

observe_menu_get_rsc_ids/2

observe_menu_get_rsc_ids(X1, Context) -> any()

Notifier handler to get all menu ids for the default menu.

observe_menu_save/2

observe_menu_save(Menu_save, Context) -> any()

Observer the 'menu_save' notification

remove_invisible/2

remove_invisible(Menu, Context) -> any()

set_menu/3

set_menu(Id, Menu, Context) -> any()

Save the current menu.


Generated by EDoc