* * 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_top/eldy.lib.php * \brief Library for file eldy menus * \version $Id$ */ /** * Core function to output top menu eldy * * @param unknown_type $db * @param unknown_type $atarget * @param unknown_type $hideifnotallowed */ function print_eldy_menu($db,$atarget,$hideifnotallowed) { global $user,$conf,$langs,$dolibarr_main_db_name; // On sauve en session le menu principal choisi if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; $_SESSION["leftmenuopened"]=""; $id='mainmenu'; print ''; // Home $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='home'; print ''; // Third parties if ($conf->societe->enabled || $conf->fournisseur->enabled) { $langs->load("companies"); $langs->load("suppliers"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='companies'; if (($conf->societe->enabled && $user->rights->societe->lire) || ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Products-Services if ($conf->produit->enabled || $conf->service->enabled) { $langs->load("products"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $chaine=""; if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } $idsel='products'; if ($user->rights->produit->lire || $user->rights->service->lire) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Commercial if ($conf->societe->enabled) { $langs->load("commercial"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='commercial'; if($user->rights->societe->lire || $user->rights->societe->contact->lire) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Financial if ($conf->compta->enabled || $conf->accounting->enabled || $conf->banque->enabled || $conf->facture->enabled || $conf->deplacement->enabled) { $langs->load("compta"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='accountancy'; if ($user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire || $user->rights->banque->lire) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Projects if ($conf->projet->enabled) { $langs->load("projects"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='project'; if ($user->rights->projet->lire) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Tools if ($conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->global->MAIN_MODULE_DOMAIN) { $langs->load("other"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='tools'; if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire || $user->rights->import->run) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // OSCommerce 1 if (! empty($conf->boutique->enabled)) { $langs->load("shop"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='shop'; print ''; } // OSCommerce WS if (! empty($conf->oscommercews->enabled)) { $langs->load("shop"); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='shop'; print ''; } // Members if ($conf->adherent->enabled) { // $langs->load("members"); Added in main file $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else { $classname = 'class="tmenu"'; } $idsel='members'; if ($user->rights->adherent->lire) { print ''; } else { if (! $hideifnotallowed) { print ''; } } } // Show personalized menus require_once(DOL_DOCUMENT_ROOT."/core/menubase.class.php"); $menuArbo = new Menubase($db,'eldy','top'); $tabMenu = $menuArbo->menuTopCharger($hideifnotallowed,$_SESSION['mainmenu'],'eldy'); for($i=0; $i'; print '
'; print ''; print $tabMenu[$i]['titre']; print ''; print ''; } else { if (! $hideifnotallowed) { print '
'; } } } } print '
'; print "\n"; } ?>