diff --git a/ChangeLog b/ChangeLog index 9dec0ba77d9..6668752bdcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,8 @@ For developers: - More comments in code. - Uniformize some code. - First delete of useless pre.inc.php files. -- Fix W3C errors in page forging. +- Fix W3C errors in page forging. +- Qual: Mutualize code of menu managers. ***** ChangeLog for 2.8 compared to 2.7 ***** diff --git a/htdocs/includes/menus/barre_left/auguria.lib.php b/htdocs/includes/menus/barre_left/auguria.lib.php new file mode 100644 index 00000000000..65fcf46c60b --- /dev/null +++ b/htdocs/includes/menus/barre_left/auguria.lib.php @@ -0,0 +1,195 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/includes/menus/barre_left/auguria.lib.php + * \brief Library for file auguria menus + * \version $Id$ + */ + + + +/** + * Core function to output left menu auguria + * + * @param unknown_type $db + */ +function print_left_auguria_menu($db,$menu_array) +{ + global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; + + $overwritemenufor = array(); + $newmenu = new Menu(); + + // Read mainmenu and leftmenu that define which menu to show + if (isset($_GET["mainmenu"])) { + // On sauve en session le menu principal choisi + $mainmenu=$_GET["mainmenu"]; + $_SESSION["mainmenu"]=$mainmenu; + $_SESSION["leftmenuopened"]=""; + } else { + // On va le chercher en session si non defini par le lien + $mainmenu=$_SESSION["mainmenu"]; + } + + if (isset($_GET["leftmenu"])) { + // On sauve en session le menu principal choisi + $leftmenu=$_GET["leftmenu"]; + $_SESSION["leftmenu"]=$leftmenu; + if ($_SESSION["leftmenuopened"]==$leftmenu) { + //$leftmenu=""; + $_SESSION["leftmenuopened"]=""; + } + else { + $_SESSION["leftmenuopened"]=$leftmenu; + } + } else { + // On va le chercher en session si non defini par le lien + $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; + } + + //this->menu_array contains menu in pre.inc.php + + + // Show logo company + if (! empty($conf->global->MAIN_SHOW_LOGO)) + { + $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); + print "\n".''."\n"; + print '