Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: menu.php,v 1.23 2006-03-02 10:49:49 ddelon Exp $
|
22 |
// CVS : $Id: menu.php,v 1.24 2006-03-13 21:00:20 ddelon Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Applette : menu
|
24 |
* Applette : menu
|
25 |
*
|
25 |
*
|
26 |
* Génère une liste de listes comportant tous les niveaux des menus "classiques" d'un site.
|
26 |
* Génère une liste de listes comportant tous les niveaux des menus "classiques" d'un site.
|
27 |
* Nécessite :
|
27 |
* Nécessite :
|
Line 36... |
Line 36... |
36 |
//Auteur original :
|
36 |
//Auteur original :
|
37 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
37 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
38 |
//Autres auteurs :
|
38 |
//Autres auteurs :
|
39 |
*@author Aucun
|
39 |
*@author Aucun
|
40 |
*@copyright Tela-Botanica 2000-2004
|
40 |
*@copyright Tela-Botanica 2000-2004
|
41 |
*@version $Revision: 1.23 $ $Date: 2006-03-02 10:49:49 $
|
41 |
*@version $Revision: 1.24 $ $Date: 2006-03-13 21:00:20 $
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
43 |
*/
|
43 |
*/
|
Line 44... |
Line 44... |
44 |
|
44 |
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
Line 126... |
Line 126... |
126 |
default:
|
126 |
default:
|
127 |
$menu_type = 'classique';
|
127 |
$menu_type = 'classique';
|
128 |
}
|
128 |
}
|
Line 129... |
Line 129... |
129 |
|
129 |
|
130 |
//Construction du menu
|
130 |
//Construction du menu
|
131 |
$xhtml_menu = afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url ,$niveau_depart,
|
131 |
$xhtml_menu = afficherListeNiveauMultiple( $objet_pear_db, $id_site,$niveau_depart,
|
132 |
$profondeur, $menu_depart, 1, $menu_type, $indent_origine,
|
132 |
$profondeur, $menu_depart, 1, $menu_type, $indent_origine,
|
Line 133... |
Line 133... |
133 |
$indent_pas, $_GEN_commun, $num_menu);
|
133 |
$indent_pas, $_GEN_commun, $num_menu);
|
134 |
|
134 |
|
Line 168... |
Line 168... |
168 |
* @param integer niveau de départ.
|
168 |
* @param integer niveau de départ.
|
169 |
* @param integer niveau d'arrivée (profondeur max demandée).
|
169 |
* @param integer niveau d'arrivée (profondeur max demandée).
|
170 |
* @param integer identifiant d'un menu pére.
|
170 |
* @param integer identifiant d'un menu pére.
|
171 |
* @return string les listes de menus au format XHTML.
|
171 |
* @return string les listes de menus au format XHTML.
|
172 |
*/
|
172 |
*/
|
173 |
function afficherListeNiveauMultiple( &$objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart, $profondeur,
|
173 |
function afficherListeNiveauMultiple( &$objet_pear_db, $id_site, $niveau_depart, $profondeur,
|
174 |
$id_pere_menu_a_deployer, $position, $menu_type, $indent_origine = 12,
|
174 |
$id_pere_menu_a_deployer, $position, $menu_type, $indent_origine = 12,
|
175 |
$indent_pas = 4, $_GEN_commun, $num_menu)
|
175 |
$indent_pas = 4, $_GEN_commun, $num_menu)
|
176 |
{
|
176 |
{
|
177 |
// Initialisation des variables
|
177 |
// Initialisation des variables
|
178 |
static $niveau_actuel = 1;
|
178 |
static $niveau_actuel = 1;
|
Line 286... |
Line 286... |
286 |
$liste_menu[]=$ligne;
|
286 |
$liste_menu[]=$ligne;
|
287 |
}
|
287 |
}
|
Line 288... |
Line 288... |
288 |
|
288 |
|
Line 289... |
Line 289... |
289 |
}
|
289 |
}
|
290 |
|
290 |
|
291 |
if (!function_exists(cmp)) {
|
291 |
if (!function_exists('cmp')) {
|
292 |
function cmp($a, $b) {
|
292 |
function cmp($a, $b) {
|
293 |
if ($a->gmr_ordre == $b->gmr_ordre) {
|
293 |
if ($a->gmr_ordre == $b->gmr_ordre) {
|
294 |
return 0;
|
294 |
return 0;
|
Line 318... |
Line 318... |
318 |
}
|
318 |
}
|
Line 319... |
Line 319... |
319 |
|
319 |
|
320 |
// Affichage du menu
|
320 |
// Affichage du menu
|
321 |
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).
|
321 |
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).
|
322 |
'<li id="menu_'.$num_menu.'_'.$id_menu_inf.'" class="'.$classe.'">'."\n";
|
322 |
'<li id="menu_'.$num_menu.'_'.$id_menu_inf.'" class="'.$classe.'">'."\n";
|
323 |
$corps .= afficherEntreeListeMenu( $objet_pear_db, $id_menu_inf, $i18n_url, $niveau_actuel,
|
323 |
$corps .= afficherEntreeListeMenu( $objet_pear_db, $id_menu_inf, $niveau_actuel,
|
324 |
$ligne->gmr_ordre, $position, $menu_type, $indent_origine, $indent_pas, $_GEN_commun, $num_menu);
|
324 |
$ligne->gmr_ordre, $position, $menu_type, $indent_origine, $indent_pas, $_GEN_commun, $num_menu);
|
325 |
}
|
325 |
}
|
326 |
// Pour chaque menu on regarde s'il y a des fils. Si oui, on les déploie.
|
326 |
// Pour chaque menu on regarde s'il y a des fils. Si oui, on les déploie.
|
327 |
$requete_fils = 'SELECT gm_id_menu '.
|
327 |
$requete_fils = 'SELECT gm_id_menu '.
|
Line 346... |
Line 346... |
346 |
|
346 |
|
347 |
if (isset($_GEN_commun['info_menu'])) {
|
347 |
if (isset($_GEN_commun['info_menu'])) {
|
348 |
if ($resultat_fils->numRows() != 0 && $ligne->gm_id_menu == $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu
|
348 |
if ($resultat_fils->numRows() != 0 && $ligne->gm_id_menu == $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu
|
349 |
|| GEN_etreAncetre($ligne->gm_id_menu, $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu) || $menu_type == 'deroulant') {
|
349 |
|| GEN_etreAncetre($ligne->gm_id_menu, $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu) || $menu_type == 'deroulant') {
|
350 |
$niveau_actuel++;
|
350 |
$niveau_actuel++;
|
351 |
$corps .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart,
|
351 |
$corps .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $niveau_depart,
|
352 |
$profondeur, $ligne->gm_id_menu, ($position + 3), $menu_type,
|
352 |
$profondeur, $ligne->gm_id_menu, ($position + 3), $menu_type,
|
353 |
null, null, $_GEN_commun, $num_menu);
|
353 |
null, null, $_GEN_commun, $num_menu);
|
354 |
// On ramène $niveau_actuel un cran plus bas
|
354 |
// On ramène $niveau_actuel un cran plus bas
|
355 |
$niveau_actuel--;
|
355 |
$niveau_actuel--;
|
Line 391... |
Line 391... |
391 |
* @param mixed objet Pear DB de connexion à la base de données.
|
391 |
* @param mixed objet Pear DB de connexion à la base de données.
|
392 |
* @param integer niveau du menu.
|
392 |
* @param integer niveau du menu.
|
393 |
* @param integer ordre du menu dans le niveau.
|
393 |
* @param integer ordre du menu dans le niveau.
|
394 |
* @return string liste représentant le menu duHTML
|
394 |
* @return string liste représentant le menu duHTML
|
395 |
*/
|
395 |
*/
|
396 |
function afficherEntreeListeMenu($db, $menu_id, $i18n, $niveau, $ordre, $position, $menu_type, $indent_origine = 12, $indent_pas = 4, $_GEN_commun, $num_menu)
|
396 |
function afficherEntreeListeMenu($db, $menu_id, $niveau, $ordre, $position, $menu_type, $indent_origine = 12, $indent_pas = 4, $_GEN_commun, $num_menu)
|
397 |
{
|
397 |
{
|
Line 398... |
Line 398... |
398 |
|
398 |
|
Line 457... |
Line 457... |
457 |
|
457 |
|
458 |
|
458 |
|
459 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
459 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
460 |
*
|
- |
|
461 |
* $Log: not supported by cvs2svn $
|
- |
|
462 |
* Revision 1.23 2006/03/02 10:49:49 ddelon
|
460 |
*
|
463 |
* Fusion branche multilinguisme dans branche principale
|
461 |
* $Log: not supported by cvs2svn $
|
464 |
*
|
462 |
* Revision 1.22.2.2 2006/02/28 14:02:11 ddelon
|
465 |
* Revision 1.22.2.2 2006/02/28 14:02:11 ddelon
|
463 |
* Finition multilinguisme
|
466 |
* Finition multilinguisme
|
464 |
*
|
467 |
*
|