Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 199 → Rev 200

/trunk/papyrus/applettes/menu/menu.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: menu.php,v 1.11 2004-11-26 19:02:22 jpm Exp $
// CVS : $Id: menu.php,v 1.12 2004-12-02 10:42:15 jpm Exp $
/**
* Applette : menu
*
38,7 → 38,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.11 $ $Date: 2004-11-26 19:02:22 $
*@version $Revision: 1.12 $ $Date: 2004-12-02 10:42:15 $
// +------------------------------------------------------------------------------------------------------+
*/
 
158,6 → 158,10
// Initialisation des variables
static $niveau_actuel = 1;
$retour = '';
$tete = '';
$corps = '';
$pied = '';
// Gestion des menus uniques
if ($menu_type == 'unique') {
$retour .= afficherEntreeListeMenu( $objet_pear_db, $id_pere_menu_a_deployer, $i18n_url,
172,7 → 176,7
// Nous regardons si nous devons afficher un menu racine
if ($id_pere_menu_a_deployer != 0 && $niveau_actuel == 1) {
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * $position)).
$tete .= str_repeat(' ', $indent_origine + ($indent_pas * $position)).
'<ul class="groupe_menu_'.$num_menu.'_'.$id_pere_menu_a_deployer.'" class="menu_'.$menu_type.'_'.'n'.$niveau_actuel.'">'."\n";
$id_menu_selectionne = $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu;
if (!empty($id_menu_selectionne) && (GEN_etreAncetre($id_pere_menu_a_deployer, $id_menu_selectionne) || $id_pere_menu_a_deployer == $id_menu_selectionne) ) {
181,14 → 185,14
$classe = 'menu_inactif';
}
// Pour un menu dont on spécifie l'identifiant du menu départ, on affiche ce menu.
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).
'<li id="menu_'.$num_menu.'_'.$id_pere_menu_a_deployer.'" class="'.$classe.'">'."\n";
$retour .= afficherEntreeListeMenu( $objet_pear_db, $id_pere_menu_a_deployer, $i18n_url,
$corps .= afficherEntreeListeMenu( $objet_pear_db, $id_pere_menu_a_deployer, $i18n_url,
$niveau_actuel, 1, $position, $menu_type, $indent_origine, $indent_pas, $_GEN_commun);
}
if ($niveau_actuel >= $niveau_depart && $niveau_actuel <= $profondeur) {
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).
$tete .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).
'<ul id="groupe_menu_'.$num_menu.'_'.$id_pere_menu_a_deployer.'" class="menu_'.$menu_type.'_'.'n'.$niveau_actuel.'">'."\n";
}
246,9 → 250,9
}
// Affichage du menu
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).
'<li id="menu_'.$num_menu.'_'.$id_menu_inf.'" class="'.$classe.'">'."\n";
$retour .= afficherEntreeListeMenu( $objet_pear_db, $id_menu_inf, $i18n_url, $niveau_actuel,
$corps .= afficherEntreeListeMenu( $objet_pear_db, $id_menu_inf, $i18n_url, $niveau_actuel,
$ligne->gmr_ordre, $position, $menu_type, $indent_origine, $indent_pas, $_GEN_commun);
}
// Pour chaque menu on regarde s'il y a des fils. Si oui, on les déploie.
271,7 → 275,7
if ($resultat_fils->numRows() != 0 && $ligne->gm_id_menu == $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu
|| GEN_etreAncetre($ligne->gm_id_menu, $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu)) {
$niveau_actuel++;
$retour .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart,
$corps .= afficherListeNiveauMultiple( $objet_pear_db, $id_site, $id_langue, $i18n_url, $niveau_depart,
$profondeur, $ligne->gm_id_menu, ($position + 3), $menu_type,
null, null, $_GEN_commun, $num_menu);
// On ramène $niveau_actuel un cran plus bas
279,7 → 283,7
}
if ($niveau_actuel >= $niveau_depart && $niveau_actuel <= $profondeur) {
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).'</li>'."\n";
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 2))).'</li>'."\n";
}
$resultat_fils->free();
287,16 → 291,21
$resultat->free();
if ($niveau_actuel >= $niveau_depart && $niveau_actuel <= $profondeur) {
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * $position+ 1)).'</ul>'."\n";
$pied .= str_repeat(' ', $indent_origine + ($indent_pas * $position+ 1)).'</ul>'."\n";
}
// Nous regardons si nous avons affiché le menu racine
if ($id_pere_menu_a_deployer != 0 && $niveau_actuel == 1) {
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).'</li>'."\n";
$retour .= str_repeat(' ', $indent_origine + ($indent_pas * $position)).'</ul>'."\n";
$corps .= str_repeat(' ', $indent_origine + ($indent_pas * ($position + 1))).'</li>'."\n";
$pied .= str_repeat(' ', $indent_origine + ($indent_pas * $position)).'</ul>'."\n";
}
return $retour;
if (empty($corps)) {
return $retour;
} else {
$retour = $tete.$corps.$pied;
return $retour;
}
}
 
/** Fonction afficherEntreeListeMenu() - Contruit une entrée dans une liste du menu d'un site.
373,6 → 382,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.11 2004/11/26 19:02:22 jpm
* Correction bogue li surnuméraires.
*
* Revision 1.10 2004/11/15 17:40:02 jpm
* Changement nom balise.
*