Skip to content
Snippets Groups Projects
Commit ea351ec4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Possibilité de choisir son gestionnaire pour le menu de gauche sur le...

New: Possibilité de choisir son gestionnaire pour le menu de gauche sur le même principe que celui du haut.
Les gestionnaires sont à placer dans le répertoire includes/menus/barre_left. Le gestionnaire par defaut ne fait
rien, ce qui équivaut à prendre la gestion courante des menus (basés sur les fichiers pre.inc.php)
parent bd3e3f77
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
* $Source$
*/
/*!
/**
\file htdocs/admin/ihm.php
\brief Page de configuration du de l'interface homme machine
\version $Revision$
......@@ -46,10 +46,12 @@ $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$lan
if ($_POST["action"] == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]);
dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]);
dolibarr_set_const($db, "MAIN_MENU_BARRELEFT", $_POST["main_menu_barreleft"]);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"]);
dolibarr_set_const($db, "SIZE_LISTE_LIMIT", $_POST["size_liste_limit"]);
dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]);
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]);
dolibarr_set_const($db, "MAIN_MOTD", trim($_POST["main_motd"]));
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",$_POST["main_searchform_contact"]);
......@@ -77,45 +79,52 @@ if ($_GET["action"] == 'edit')
{
print '<form method="post" action="ihm.php">';
clearstatcache();
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="impair"><td>'.$langs->trans("Skin").'</td>';
print '<td><select name="main_theme">';
clearstatcache();
$dir = "../theme/";
// Langue par defaut
print '<tr class="pair"><td width="50%">'.$langs->trans("DefaultLanguage").'</td><td>';
$html=new Form($db);
$html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default');
print '</td></tr>';
// Menu top
print '<tr class="impair"><td width="50%">'.$langs->trans("MenuTopManager").'</td>';
print '<td><select name="main_menu_barretop">';
$dir = "../includes/menus/barre_top/";
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
if (is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
if (is_file($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{
if ($file == MAIN_THEME)
$filelib=eregi_replace('\.php$','',$file);
if ($file == MAIN_MENU_BARRETOP)
{
print '<option value="'.$file.'" selected>'.$file;
print '<option value="'.$file.'" selected>'.$filelib.'</option>';
}
else
{
print '<option value="'.$file.'">'.$file;
print '<option value="'.$file.'">'.$filelib.'</option>';
}
}
}
print '</select>';
print '<input type="hidden" name="action" value="update">';
print '</td></tr>';
print '<tr class="pair"><td width="50%">'.$langs->trans("MaxSizeList").'</td><td><input name="size_liste_limit" size="20" value="' . SIZE_LISTE_LIMIT . '"></td></tr>';
print '<tr class="impair"><td width="50%">'.$langs->trans("MenuTopManager").'</td>';
print '<td><select name="main_menu_barretop">';
$dir = "../includes/menus/barre_top/";
// Menu left
print '<tr class="pair"><td width="50%">'.$langs->trans("MenuLeftManager").'</td>';
print '<td><select name="main_menu_barreleft">';
$dir = "../includes/menus/barre_left/";
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
if (is_file($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{
$filelib=eregi_replace('\.php$','',$file);
if ($file == MAIN_MENU_BARRETOP)
if ($file == MAIN_MENU_BARRELEFT)
{
print '<option value="'.$file.'" selected>'.$filelib.'</option>';
}
......@@ -129,10 +138,33 @@ if ($_GET["action"] == 'edit')
print '</select>';
print '</td></tr>';
print '<tr class="pair"><td width="50%">'.$langs->trans("DefaultLanguage").'</td><td>';
$html=new Form($db);
$html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default');
// Theme
print '<tr class="impair"><td>'.$langs->trans("Skin").'</td>';
print '<td><select name="main_theme">';
$dir = "../theme/";
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
if (is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{
if ($file == MAIN_THEME)
{
print '<option value="'.$file.'" selected>'.$file;
}
else
{
print '<option value="'.$file.'">'.$file;
}
}
}
print '</select>';
print '<input type="hidden" name="action" value="update">';
print '</td></tr>';
// Taille max des listes
print '<tr class="pair"><td width="50%">'.$langs->trans("MaxSizeList").'</td><td><input name="size_liste_limit" size="20" value="' . SIZE_LISTE_LIMIT . '"></td></tr>';
// Message of the day
print '<tr class="impair"><td width="50%">'.$langs->trans("MessageOfDay").'</td><td><textarea cols="40" rows="3" name="main_motd" size="20">' .stripslashes(MAIN_MOTD) . '</textarea></td></tr>';
print '</table><br>';
......@@ -160,13 +192,18 @@ else
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="impair"><td width="50%">'.$langs->trans("Skin").'</td><td>' . MAIN_THEME . '</td></tr>';
print '<tr class="pair"><td>'.$langs->trans("MaxSizeList").'</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>';
print '<tr class="pair"><td width="50%">'.$langs->trans("DefaultLanguage").'</td><td>' . MAIN_LANG_DEFAULT . '</td></tr>';
print '<tr class="impair"><td width="50%">'.$langs->trans("MenuTopManager").'</td><td>';
$filelib=eregi_replace('\.php$','',MAIN_MENU_BARRETOP);
print $filelib;
print '</td></tr>';
print '<tr class="pair"><td width="50%">'.$langs->trans("DefaultLanguage").'</td><td>' . MAIN_LANG_DEFAULT . '</td></tr>';
print '<tr class="pair"><td width="50%">'.$langs->trans("MenuLeftManager").'</td><td>';
$filelib=eregi_replace('\.php$','',MAIN_MENU_BARRELEFT);
print $filelib;
print '</td></tr>';
print '<tr class="impair"><td width="50%">'.$langs->trans("Skin").'</td><td>' . MAIN_THEME . '</td></tr>';
print '<tr class="pair"><td>'.$langs->trans("MaxSizeList").'</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>';
print '<tr class="impair"><td width="50%">'.$langs->trans("MessageOfDay").'</td><td>' . stripslashes(nl2br(MAIN_MOTD)) . '</td></tr>';
......
<?php
/* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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.
*
* $Id$
* $Source$
*
*/
/**
\file htdocs/includes/menus/barre_left/default.php
\brief Gestionnaire du menu de gauche
\version $Revision$
*/
// Le gestionnaire par defaut ne fait rien: C'est donc le menu défini dans les
// fichiers pre.inc.php du répertoire de la page qui sont utilisés.
?>
<?php
/* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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.
*
* $Id$
* $Source$
*
*/
/**
\file htdocs/includes/menus/barre_left/eldy.php
\brief Gestionnaire du menu de gauche
\version $Revision$
*/
// Ce gestionnaire de menu crase le tableau $menu pour le dfinir selon
// ces propres rgles prioritairement aux dfinitions des fichiers pre.inc.php
$newmenu = new Menu();
$newmenu->add(DOL_URL_ROOT."/comm/clients.php", $langs->trans("Customers"));
/*
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial")
{
$class='class="tmenu" id="sel"';
}
elseif (ereg("^".DOL_URL_ROOT."\/fourn\/",$_SERVER["PHP_SELF"]))
{
$class='class="tmenu" id="sel"';
}
else
{
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/fourn/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Fournisseur").'</a>';
*/
//$menu=$newmenu->liste;
?>
......@@ -71,6 +71,7 @@ PermanentLeftSearchForm=Permanent search form on left menu
Skin=Skin theme
MaxSizeList=Max length for list
MenuTopManager=Top menu manager
MenuLeftManager=Left menu manager
MessageOfDay=Message of day
DefaultLanguage=Default language to use (language code)
SystemSuccessfulyUpdated=Your sustem has been updated successfully
......
......@@ -71,6 +71,7 @@ PermanentLeftSearchForm=Zone de recherche permanente du menu de gauche
Skin=Thème visuel
MaxSizeList=Longueur maximale des listes
MenuTopManager=Gestionnaire du menu du haut
MenuLeftManager=Gestionnaire du menu de gauche
MessageOfDay=Message du jour
DefaultLanguage=Langue par défaut à utiliser (code langue)
SystemSuccessfulyUpdated=Votre système a été mis à jour avec succès
......
......@@ -24,7 +24,7 @@
*
*/
/*!
/**
\file htdocs/master.inc.php
\brief Fichier de formatage gnrique des ecrans Dolibarr
\version $Revision$
......@@ -107,7 +107,7 @@ if (defined("MAIN_NOT_INSTALLED"))
}
/*!
/**
* \brief Affiche en-tte html + la barre de menu suprieure
* \param head lignes d'en-tete head
* \param title titre page web
......@@ -213,24 +213,32 @@ function top_menu($head, $title="", $target="")
}
/*!
/**
* \brief Affiche barre de menu gauche
* \param menu Objet du menu gauche
* \param help_url Url pour le lien aide ('' par defaut)
* \param form_search Formulaire de recherche permanant
* \param author Auteur de la page pour ajout en en-tete html
* \param form_search Formulaire de recherche permanant supplmentaire
*/
function left_menu($menu, $help_url='', $form_search='', $author='')
function left_menu($menu, $help_url='', $form_search='')
{
global $user, $conf, $langs;
if (! defined(MAIN_MENU_BARRELEFT))
{
define("MAIN_MENU_BARRELEFT","default.php");
}
// Si un gestionnaire de menu gauche est actif, on l'utilise:
// Ce gestionnnaire est libre d'cras ou non l'objet $menu qui dtermine le menu afficher.
require(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".MAIN_MENU_BARRELEFT);
print '<div class="vmenuplusfiche" width="158">'."\n";
/*
* Colonne de gauche
*
*/
// Colonne de gauche
print "\n<!-- Debut left vertical menu -->\n";
print '<div class="vmenu">'."\n";
......@@ -253,9 +261,7 @@ function left_menu($menu, $help_url='', $form_search='', $author='')
print '</div>';
}
/*
* Affichage des zones de recherche permanantes
*/
// Affichage des zones de recherche permanantes
$addzonerecherche=0;
if ($conf->societe->enabled && defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0) $addzonerecherche=1;
if ($conf->societe->enabled && defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0) $addzonerecherche=1;
......@@ -286,19 +292,13 @@ function left_menu($menu, $help_url='', $form_search='', $author='')
print '</div>';
}
/*
* Zone de recherche supplmentaire
*/
// Zone de recherche supplmentaire
if (strlen($form_search) > 0)
{
print $form_search;
}
/*
* Lien vers l'aide en ligne
*/
// Lien vers l'aide en ligne
if (strlen($help_url) > 0)
{
......@@ -319,7 +319,7 @@ function left_menu($menu, $help_url='', $form_search='', $author='')
/*!
/**
* \brief Affiche une zone de recherche
* \param urlaction url du post
* \param urlobject url du lien sur titre de la zone de recherche
......@@ -340,7 +340,7 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$
}
/*!
/**
* \brief Impression du pied de page
* \param foot Non utilis
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment