User Tools

Site Tools


Menu Helper


Objective Showing user and admin section menu
Name menu_helper
Script /applications/helpers/menu_helper.php
Tables setup_menu
Dependency nothing in particular

What are we talking about

This feature is about the mechanism we use to create the user menu and the admin section menu.

In WManager we have created a Codeigniter helper to dynamically handle menu from the database. Wmanager Admin side has a menu settings page where you can add new menu or change order of the menu through simple forms.In this section we see how the menu works in WManager. In WManager we populate the menu from the database.

How does it work

  • The admin and front-end template includes all the css classes for the menu;
  • By calling in the page views:
    top_menu()  or admin_menu()

    the system will provide the entries list based on roles.

  • Admin menu is configured using entries in setup_menu tables (having setup_menu.template='Admin');
  • Top menu is configured using entries in setup_menu tables (having setup_menu.template='Wmanager');

The admin section inclides a configuration page to update only the Top menu entries.

If your extension will need to add a new entry in the Admin menu you can do that by including the sql script onboard of your extension.

Coding detail

The system differentiates the menu for admin and user through the template field in setup_menu table.

wmanager/dummy_helper_menu.txt · Last modified: 2018/04/27 07:27 by Gianluca Pelliccioli