31,040
edits
| Line 19: | Line 19: | ||
== To develop your own '''top menu''' == | == To develop your own '''top menu''' == | ||
# Copy file htdocs/includes/menus/standard/eldy_backoffice.php into a file with a name like htdocs/includes/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. | ||
# | $user contains information about current user. | ||
$user | $conf contains information about setup (activated modules, permissions, options, etc...) | ||
$conf | $langs contains information about active language. | ||
$langs | |||
Example of a function showmenu() into file htdocs/includes/menus/standard/mymenu.php | |||
<source lang="php"> | <source lang="php"> | ||
function showmenu() | function showmenu() | ||