Menus system: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 35: Line 35:
== To develop your own '''top menu''' ==
== To develop your own '''top menu''' ==
# Copy file htdocs/core/menus/standard/eldy_backoffice.php into a file with a name like htdocs/core/menus/standard/mymenu.php
# Copy file htdocs/core/menus/standard/eldy_backoffice.php into a file with a name like htdocs/core/menus/standard/mymenu.php
# Edit this file mymenu.php. Function showmenu() of class MenuTop is the function called by Dolibarr, when generating a page, to show the top menu. You can put here the code you want, this function does not change any external vairable and must show using "print" the menu to show. So you can get menu to show from a configuration file, a database and personalized it according to environment. Environment Dolibarr is stored into 3 global variables: $user, $conf, $langs.
# Edit this file mymenu.php. Function showmenu() of class MenuTop is the function called by Dolibarr, when generating a page, to show the top menu. You can put here the code you want, this function does not change any external variable and must show using "print" the menu to show. So you can get menu to show from a configuration file, a database and personalized it according to environment. Environment Dolibarr is stored into global variables: {{TemplateGlobalVariables}}.
  $user contains information about current user.
  $user contains information about current user.
  $conf contains information about setup (activated modules, permissions, options, etc...)
  $conf contains information about setup (activated modules, permissions, options, etc...)
Line 44: Line 44:
     function showmenu()
     function showmenu()
     {
     {
         global $user,$conf,$langs;
         global $user, $conf, $langs;
         global $dolibarr_main_db_name;
         global $dolibarr_main_db_name;
          
          

Navigation menu