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.12 2004-12-02 10:42:15 jpm Exp $
|
22 |
// CVS : $Id: menu.php,v 1.13 2005-02-08 19:03:03 alex 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.12 $ $Date: 2004-12-02 10:42:15 $
|
41 |
*@version $Revision: 1.13 $ $Date: 2005-02-08 19:03:03 $
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
43 |
*/
|
43 |
*/
|
Line 44... |
Line 44... |
44 |
|
44 |
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// | ENTÊTE du PROGRAMME |
|
46 |
// | ENTÊTE du PROGRAMME |
|
Line 47... |
Line 47... |
47 |
// +------------------------------------------------------------------------------------------------------+
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
48 |
|
48 |
|
49 |
require_once 'papyrus/bibliotheque/fonctions/pap_menu.fonct.php';
|
49 |
require_once 'papyrus/bibliotheque/fonctions/pap_menu.fonct.php';
|
50 |
$GLOBALS['_MENU_']['nom_fonction'] = 'afficherMenuNiveauMultiple';
|
50 |
$GLOBALS['_MENU_']['nom_fonction'] = 'afficherMenuNiveauMultiple';
|
Line 51... |
Line 51... |
51 |
$_GEN_commun['info_applette_nom_fonction'] = $GLOBALS['_MENU_']['nom_fonction'];
|
51 |
$_GEN_commun['info_applette_nom_fonction'] = $GLOBALS['_MENU_']['nom_fonction'];
|
52 |
$_GEN_commun['info_applette_balise'] = 'MENU_?(?:(|CLASSIQUE|COMMUN)_([0-9]+)_([0-9]+)(|_ID_([0-9]+))|(UNIQUE)_([0-9]+))';
|
52 |
$_GEN_commun['info_applette_balise'] = 'MENU_?(?:(|CLASSIQUE|COMMUN|DEROULANT)_([0-9]+)_([0-9]+)(|_ID_([0-9]+))|(UNIQUE)_([0-9]+))';
|
53 |
|
53 |
|
Line 102... |
Line 102... |
102 |
$menu_type = $tab_applette_arguments[7];
|
102 |
$menu_type = $tab_applette_arguments[7];
|
103 |
}
|
103 |
}
|
104 |
if (isset($tab_applette_arguments[8])) {
|
104 |
if (isset($tab_applette_arguments[8])) {
|
105 |
$menu_depart = $tab_applette_arguments[8];
|
105 |
$menu_depart = $tab_applette_arguments[8];
|
106 |
}
|
106 |
}
|
107 |
|
107 |
|
108 |
// Gestion du type de menu
|
108 |
// Gestion du type de menu
|
109 |
switch ($menu_type) {
|
109 |
switch ($menu_type) {
|
110 |
case '' :
|
110 |
case '' :
|
111 |
$menu_type = 'classique';
|
111 |
$menu_type = 'classique';
|
112 |
break;
|
112 |
break;
|
Line 117... |
Line 117... |
117 |
$menu_type = 'commun';
|
117 |
$menu_type = 'commun';
|
118 |
break;
|
118 |
break;
|
119 |
case 'UNIQUE' :
|
119 |
case 'UNIQUE' :
|
120 |
$menu_type = 'unique';
|
120 |
$menu_type = 'unique';
|
121 |
break;
|
121 |
break;
|
- |
|
122 |
case 'DEROULANT' :
|
- |
|
123 |
$menu_type = 'deroulant';
|
- |
|
124 |
break;
|
122 |
default:
|
125 |
default:
|
123 |
$menu_type = 'classique';
|
126 |
$menu_type = 'classique';
|
124 |
}
|
127 |
}
|
125 |
|
128 |
|
126 |
//Construction du menu
|
129 |
//Construction du menu
|
127 |
$xhtml_menu = afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url ,$niveau_depart,
|
130 |
$xhtml_menu = afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url ,$niveau_depart,
|
128 |
$profondeur, $menu_depart, 1, $menu_type, $indent_origine,
|
131 |
$profondeur, $menu_depart, 1, $menu_type, $indent_origine,
|
129 |
$indent_pas, $_GEN_commun, $num_menu);
|
132 |
$indent_pas, $_GEN_commun, $num_menu);
|
130 |
|
133 |
|
- |
|
134 |
// Si le menu est déroulant il faut stocker un peu de javascript pour IE
|
- |
|
135 |
if ($menu_type == 'deroulant') {
|
- |
|
136 |
GEN_stockerCodeScript ('sfHover = function() {
|
- |
|
137 |
var sfEls = document.getElementById("groupe_menu_1_0").getElementsByTagName("LI");
|
- |
|
138 |
for (var i=0; i<sfEls.length; i++) {
|
- |
|
139 |
sfEls[i].onmouseover=function() {
|
- |
|
140 |
this.className+=" sfhover";
|
- |
|
141 |
}
|
- |
|
142 |
sfEls[i].onmouseout=function() {
|
- |
|
143 |
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
|
- |
|
144 |
}
|
- |
|
145 |
}
|
- |
|
146 |
}
|
- |
|
147 |
if (window.attachEvent) window.attachEvent("onload", sfHover);') ;
|
- |
|
148 |
}
|
131 |
//Si nous avons un
|
149 |
//Si nous avons un
|
132 |
if (! empty($xhtml_menu)) {
|
150 |
if (! empty($xhtml_menu)) {
|
133 |
$retour = $xhtml_menu;
|
151 |
$retour = $xhtml_menu;
|
134 |
} else {
|
152 |
} else {
|
135 |
$retour = '<!-- '.$balise.' : aucun menu trouvé ! -->';
|
153 |
$retour = '<!-- '.$balise.' : aucun menu trouvé ! -->';
|
Line 202... |
Line 220... |
202 |
'AND GMR01.gmr_id_valeur = 1 '.// 1 = "avoir père"
|
220 |
'AND GMR01.gmr_id_valeur = 1 '.// 1 = "avoir père"
|
203 |
'AND GMR02.gmr_id_menu_02 = gm_id_menu '.
|
221 |
'AND GMR02.gmr_id_menu_02 = gm_id_menu '.
|
204 |
'AND GMR02.gmr_id_menu_01 = GMR02.gmr_id_menu_02 ';
|
222 |
'AND GMR02.gmr_id_menu_01 = GMR02.gmr_id_menu_02 ';
|
205 |
$requete .= 'AND GMR01.gmr_id_menu_02 = '.$id_pere_menu_a_deployer.' ';
|
223 |
$requete .= 'AND GMR01.gmr_id_menu_02 = '.$id_pere_menu_a_deployer.' ';
|
Line 206... |
Line 224... |
206 |
|
224 |
|
207 |
if ($menu_type == 'classique') {
|
225 |
if ($menu_type == 'classique' || $menu_type == 'deroulant') {
|
208 |
$requete .= 'AND gm_ce_site = '.$id_site.' '.
|
226 |
$requete .= 'AND gm_ce_site = '.$id_site.' '.
|
209 |
'AND GMR02.gmr_id_valeur = 100 '.// 100 = type "menu classique"
|
227 |
'AND GMR02.gmr_id_valeur = 100 '.// 100 = type "menu classique"
|
210 |
'ORDER BY GMR01.gmr_ordre ASC';
|
228 |
'ORDER BY GMR01.gmr_ordre ASC';
|
211 |
} else if ($menu_type == 'commun') {
|
229 |
} else if ($menu_type == 'commun') {
|
Line 271... |
Line 289... |
271 |
(DB::isError($resultat_fils))
|
289 |
(DB::isError($resultat_fils))
|
272 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_fils->getMessage(), $requete_fils))
|
290 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_fils->getMessage(), $requete_fils))
|
273 |
: '';
|
291 |
: '';
|
Line 274... |
Line 292... |
274 |
|
292 |
|
275 |
if ($resultat_fils->numRows() != 0 && $ligne->gm_id_menu == $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu
|
293 |
if ($resultat_fils->numRows() != 0 && $ligne->gm_id_menu == $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu
|
276 |
|| GEN_etreAncetre($ligne->gm_id_menu, $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu)) {
|
294 |
|| GEN_etreAncetre($ligne->gm_id_menu, $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu) || $menu_type == 'deroulant') {
|
277 |
$niveau_actuel++;
|
295 |
$niveau_actuel++;
|
278 |
$corps .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart,
|
296 |
$corps .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart,
|
279 |
$profondeur, $ligne->gm_id_menu, ($position + 3), $menu_type,
|
297 |
$profondeur, $ligne->gm_id_menu, ($position + 3), $menu_type,
|
280 |
null, null, $_GEN_commun, $num_menu);
|
298 |
null, null, $_GEN_commun, $num_menu);
|
281 |
// On ramène $niveau_actuel un cran plus bas
|
299 |
// On ramène $niveau_actuel un cran plus bas
|
282 |
$niveau_actuel--;
|
300 |
$niveau_actuel--;
|
Line -... |
Line 301... |
- |
|
301 |
}
|
283 |
}
|
302 |
|
284 |
|
303 |
|
285 |
if ($niveau_actuel >= $niveau_depart && $niveau_actuel <= $profondeur) {
|
304 |
if ($niveau_actuel >= $niveau_depart && $niveau_actuel <= $profondeur) {
|
Line 286... |
Line 305... |
286 |
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).'</li>'."\n";
|
305 |
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).'</li>'."\n";
|
Line 380... |
Line 399... |
380 |
|
399 |
|
381 |
|
400 |
|
382 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
401 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
402 |
*
|
- |
|
403 |
* $Log: not supported by cvs2svn $
|
- |
|
404 |
* Revision 1.12 2004/12/02 10:42:15 jpm
|
383 |
*
|
405 |
* Correction bogue liste ul vide si pas de menu.
|
384 |
* $Log: not supported by cvs2svn $
|
406 |
*
|
385 |
* Revision 1.11 2004/11/26 19:02:22 jpm
|
407 |
* Revision 1.11 2004/11/26 19:02:22 jpm
|
386 |
* Correction bogue li surnuméraires.
|
408 |
* Correction bogue li surnuméraires.
|
387 |
*
|
409 |
*
|