| Line 19... |
Line 19... |
| 19 |
// | |
|
19 |
// | |
|
| 20 |
// | You should have received a copy of the GNU General Public License |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
| 21 |
// | along with Foobar; if not, write to the Free Software |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
| 22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
| 24 |
// CVS : $Id: adme_menu_commun.fonct.php,v 1.5 2004-11-09 17:48:35 jpm Exp $
|
24 |
// CVS : $Id: adme_menu_commun.fonct.php,v 1.6 2004-11-10 17:26:07 jpm Exp $
|
| 25 |
/**
|
25 |
/**
|
| 26 |
* Application de gestion des menus communs
|
26 |
* Application de gestion des menus communs
|
| 27 |
*
|
27 |
*
|
| 28 |
* Permet de lister, d'ajouter, de modifier, et de déplacer des menus communs.
|
28 |
* Permet de lister, d'ajouter, de modifier, et de déplacer des menus communs.
|
| 29 |
* Par menus communs, nous entendons tous les menus devant paraitre sur l'ensemble des pages de plusieurs site,
|
29 |
* Par menus communs, nous entendons tous les menus devant paraitre sur l'ensemble des pages de plusieurs site,
|
| Line 35... |
Line 35... |
| 35 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
35 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
| 36 |
//Autres auteurs :
|
36 |
//Autres auteurs :
|
| 37 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
37 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
| 38 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
38 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| 39 |
*@copyright Tela-Botanica 2000-2004
|
39 |
*@copyright Tela-Botanica 2000-2004
|
| 40 |
*@version $Revision: 1.5 $ $Date: 2004-11-09 17:48:35 $
|
40 |
*@version $Revision: 1.6 $ $Date: 2004-11-10 17:26:07 $
|
| 41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
| 42 |
*/
|
42 |
*/
|
| Line 43... |
Line 43... |
| 43 |
|
43 |
|
| 44 |
// +------------------------------------------------------------------------------------------------------+
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 89... |
Line 89... |
| 89 |
if (DB::isError($resultat_sous_menu)) {
|
89 |
if (DB::isError($resultat_sous_menu)) {
|
| 90 |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_sous_menu->getMessage(), $requete_sous_menu));
|
90 |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_sous_menu->getMessage(), $requete_sous_menu));
|
| 91 |
}
|
91 |
}
|
| Line 92... |
Line 92... |
| 92 |
|
92 |
|
| 93 |
// Gestion du stockage ou déstockage des menus ouverts
|
93 |
// Gestion du stockage ou déstockage des menus ouverts
|
| 94 |
if (($adme_action == 'adme_menu_ouvrir' || $adme_action == 'menu_commun_ajouter') && $id_menu_a_deployer != 0) {
|
94 |
if (($adme_action == ADME_LG_ACTION_DEPLIER || $adme_action == ADME_LG_ACTION_COMMUN_AJOUTER) && $id_menu_a_deployer != 0) {
|
| 95 |
$_SESSION['adme_menus_communs_ouverts'][$adme_menu_id] = $adme_menu_id;
|
95 |
$_SESSION['adme_menus_communs_ouverts'][$adme_menu_id] = $adme_menu_id;
|
| 96 |
}
|
96 |
}
|
| 97 |
if ($adme_action == 'adme_menu_fermer' && $id_menu_a_deployer != 0) {
|
97 |
if ($adme_action == ADME_LG_ACTION_PLIER && $id_menu_a_deployer != 0) {
|
| 98 |
unset($_SESSION['adme_menus_communs_ouverts'][$adme_menu_id]);
|
98 |
unset($_SESSION['adme_menus_communs_ouverts'][$adme_menu_id]);
|
| 99 |
foreach ($_SESSION['adme_menus_communs_ouverts'] as $val) {
|
99 |
foreach ($_SESSION['adme_menus_communs_ouverts'] as $val) {
|
| 100 |
if (GEN_etreAncetre($adme_menu_id, $val)) {
|
100 |
if (GEN_etreAncetre($adme_menu_id, $val)) {
|
| 101 |
unset($_SESSION['adme_menus_communs_ouverts'][$val]);
|
101 |
unset($_SESSION['adme_menus_communs_ouverts'][$val]);
|
| Line 108... |
Line 108... |
| 108 |
// Ici, on sait qu'un menu a des sous menus, on commence par l'afficher:
|
108 |
// Ici, on sait qu'un menu a des sous menus, on commence par l'afficher:
|
| 109 |
if ($bln_premier_appel == false) {
|
109 |
if ($bln_premier_appel == false) {
|
| 110 |
$retour .= '<li>'."\n";
|
110 |
$retour .= '<li>'."\n";
|
| Line 111... |
Line 111... |
| 111 |
|
111 |
|
| 112 |
if (GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
112 |
if (GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
| 113 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == 'adme_menu_ouvrir') ||
|
113 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == ADME_LG_ACTION_DEPLIER) ||
|
| 114 |
isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
114 |
isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
| 115 |
){
|
115 |
){
|
| 116 |
// Affiche un -
|
116 |
// Affiche un -
|
| 117 |
$retour .= ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $id_menu_a_deployer, 1);
|
117 |
$retour .= ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $id_menu_a_deployer, 1);
|
| 118 |
} else if ( !GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
118 |
} else if ( !GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
| 119 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == 'adme_menu_fermer') ||
|
119 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == ADME_LG_ACTION_PLIER) ||
|
| 120 |
!isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
120 |
!isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
| 121 |
){
|
121 |
){
|
| 122 |
// Affiche un +
|
122 |
// Affiche un +
|
| 123 |
$retour .= ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $id_menu_a_deployer, 2);
|
123 |
$retour .= ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $id_menu_a_deployer, 2);
|
| 124 |
}
|
124 |
}
|
| 125 |
}
|
125 |
}
|
| 126 |
if ($bln_premier_appel == true || GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
126 |
if ($bln_premier_appel == true || GEN_etreAncetre($id_menu_a_deployer, $adme_menu_id) ||
|
| 127 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == 'adme_menu_ouvrir') ||
|
127 |
($id_menu_a_deployer == $adme_menu_id && $adme_action == ADME_LG_ACTION_DEPLIER) ||
|
| 128 |
isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
128 |
isset($_SESSION['adme_menus_communs_ouverts'][$id_menu_a_deployer])
|
| 129 |
){
|
129 |
){
|
| 130 |
$retour .= '<ul>'."\n";
|
130 |
$retour .= '<ul>'."\n";
|
| 131 |
while ($ligne_sous_menu = $resultat_sous_menu->fetchRow(DB_FETCHMODE_OBJECT)) {
|
131 |
while ($ligne_sous_menu = $resultat_sous_menu->fetchRow(DB_FETCHMODE_OBJECT)) {
|
| Line 158... |
Line 158... |
| 158 |
* @return string une ligne de liste XHTML
|
158 |
* @return string une ligne de liste XHTML
|
| 159 |
*/
|
159 |
*/
|
| 160 |
function ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $adme_menu_id, $int_deplier)
|
160 |
function ADME_retournerXhtmlMenuCommun($db, $url, $adme_site_id, $adme_menu_id, $int_deplier)
|
| 161 |
{
|
161 |
{
|
| 162 |
//-------------------------------------------------------------------------------------------------------------------
|
162 |
//-------------------------------------------------------------------------------------------------------------------
|
| 163 |
// Initialisation des variables
|
- |
|
| 164 |
$etiquette_annuler = 'Annuler';
|
- |
|
| 165 |
$etiquette_alt_modifier = 'Modifier';
|
- |
|
| 166 |
$etiquette_title_modifier = 'Modifier ce menu';
|
- |
|
| 167 |
$etiquette_alt_supprimer = 'Supprimer';
|
- |
|
| 168 |
$etiquette_title_supprimer = 'Supprimer ce menu';
|
- |
|
| 169 |
$etiquette_alt_ajouter = 'Ajouter';
|
- |
|
| 170 |
$etiquette_title_ajouter = 'Ajouter un menu inférieur';
|
- |
|
| 171 |
$etiquette_alt_monter = 'Monter';
|
- |
|
| 172 |
$etiquette_title_monter = 'Monter ce menu';
|
- |
|
| 173 |
$etiquette_alt_descendre = 'Descendre';
|
- |
|
| 174 |
$etiquette_title_descendre = 'Descendre ce menu';
|
- |
|
| 175 |
$etiquette_alt_administrer = 'Administrer';
|
- |
|
| 176 |
$etiquette_title_administrer = 'Administrer l\'application de ce menu';
|
- |
|
| 177 |
$etiquette_deplier = 'Déplier';
|
- |
|
| 178 |
$etiquette_plier = 'Plier';
|
- |
|
| 179 |
|
- |
|
| 180 |
//-------------------------------------------------------------------------------------------------------------------
|
- |
|
| 181 |
// Récupération des infos concernant l'administrateur d'un menu
|
163 |
// Récupération des infos concernant l'administrateur d'un menu
|
| 182 |
$requete = 'SELECT gen_menu.*, ga_prenom '.
|
164 |
$requete = 'SELECT gen_menu.*, ga_prenom '.
|
| 183 |
'FROM gen_menu, gen_annuaire '.
|
165 |
'FROM gen_menu, gen_annuaire '.
|
| 184 |
'WHERE gm_id_menu = '.$adme_menu_id.' '.
|
166 |
'WHERE gm_id_menu = '.$adme_menu_id.' '.
|
| 185 |
'AND gm_ce_admin = ga_id_administrateur';
|
167 |
'AND gm_ce_admin = ga_id_administrateur';
|
| Line 202... |
Line 184... |
| 202 |
$xhtml_pd = '';
|
184 |
$xhtml_pd = '';
|
| 203 |
if ($int_deplier != 0) {
|
185 |
if ($int_deplier != 0) {
|
| 204 |
if ($int_deplier == 1) {
|
186 |
if ($int_deplier == 1) {
|
| 205 |
// Afficher un -
|
187 |
// Afficher un -
|
| 206 |
$image_plier_deplier = ADME_IMAGE_MOINS;
|
188 |
$image_plier_deplier = ADME_IMAGE_MOINS;
|
| 207 |
$alt = $etiquette_plier;
|
189 |
$alt = ADME_LG_ACTION_PLIER_ALT;
|
| 208 |
$url->addQueryString('adme_action', 'adme_menu_fermer');
|
190 |
$url->addQueryString('adme_action', ADME_LG_ACTION_PLIER);
|
| 209 |
$url_plier_deplier = $url->getURL();
|
191 |
$url_plier_deplier = $url->getURL();
|
| 210 |
} else if ($int_deplier == 2) {
|
192 |
} else if ($int_deplier == 2) {
|
| 211 |
// Afficher un +
|
193 |
// Afficher un +
|
| 212 |
$image_plier_deplier = ADME_IMAGE_PLUS;
|
194 |
$image_plier_deplier = ADME_IMAGE_PLUS;
|
| 213 |
$alt = $etiquette_deplier;
|
195 |
$alt = ADME_LG_ACTION_DEPLIER_ALT;
|
| 214 |
$url->addQueryString('adme_action', 'adme_menu_ouvrir');
|
196 |
$url->addQueryString('adme_action', ADME_LG_ACTION_DEPLIER);
|
| 215 |
$url_plier_deplier = $url->getURL();
|
197 |
$url_plier_deplier = $url->getURL();
|
| 216 |
}
|
198 |
}
|
| 217 |
$xhtml_pd = '<a href="'.$url_plier_deplier.'" title="'.$alt.'">'.
|
199 |
$xhtml_pd = '<a href="'.$url_plier_deplier.'" title="'.$alt.'">'.
|
| 218 |
'<img class="'.ADME_CLASS_IMG_PD.'" src="'.$image_plier_deplier.'" alt="'.$alt.'" />'.
|
200 |
'<img class="'.ADME_CLASS_IMG_PD.'" src="'.$image_plier_deplier.'" alt="'.$alt.'" />'.
|
| 219 |
'</a>'.' '."\n";
|
201 |
'</a>'.' '."\n";
|
| 220 |
}
|
202 |
}
|
| Line 221... |
Line 203... |
| 221 |
|
203 |
|
| 222 |
//-------------------------------------------------------------------------------------------------------------------
|
204 |
//-------------------------------------------------------------------------------------------------------------------
|
| 223 |
// XHTML du nom du menu et de ses infos
|
205 |
// XHTML du nom du menu et de ses infos
|
| 224 |
$xhtml_info = htmlentities(empty($ligne->gm_nom) ? '('.$ligne->gm_nom.')' : $ligne->gm_nom);
|
206 |
$xhtml_info = htmlentities(empty($ligne->gm_nom) ? ADME_LG_PARENTHESE_OUVRANTE.$ligne->gm_nom.ADME_LG_PARENTHESE_FERMANTE : $ligne->gm_nom);
|
| 225 |
$xhtml_info .= ' ';
|
207 |
$xhtml_info .= ' ';
|
| 226 |
$xhtml_info .= '('.$ligne_app->gap_nom.' / '.$ligne->ga_prenom.')';
|
208 |
$xhtml_info .= ADME_LG_PARENTHESE_OUVRANTE.$ligne_app->gap_nom.' '.ADME_LG_SLASH.' '.$ligne->ga_prenom.ADME_LG_PARENTHESE_FERMANTE;
|
| Line 227... |
Line 209... |
| 227 |
$xhtml_info .= ' '."\n";
|
209 |
$xhtml_info .= ' '."\n";
|
| 228 |
|
210 |
|
| 229 |
//-------------------------------------------------------------------------------------------------------------------
|
211 |
//-------------------------------------------------------------------------------------------------------------------
|
| 230 |
// XHTML actions
|
212 |
// XHTML actions
|
| 231 |
$url->removeQueryString('adme_action');
|
213 |
$url->removeQueryString('adme_action');
|
| 232 |
$url->addQueryString('adme_action', 'menu_commun_modifier');
|
214 |
$url->addQueryString('adme_action', ADME_LG_ACTION_COMMUN_MODIFIER);
|
| 233 |
$xhtml_action = '<a href="'.$url->getURL().'" title="'.$etiquette_title_modifier.'">'.
|
215 |
$xhtml_action = '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_COMMUN_MODIFIER_TITLE.'">'.
|
| 234 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_VOIR.'" alt="'.$etiquette_alt_modifier.'" />'.
|
216 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_VOIR.'" alt="'.ADME_LG_ACTION_COMMUN_MODIFIER_ALT.'" />'.
|
| 235 |
'</a> '."\n";
|
217 |
'</a> '."\n";
|
| 236 |
$url->removeQueryString('adme_action');
|
218 |
$url->removeQueryString('adme_action');
|
| 237 |
$url->addQueryString('adme_action', 'menu_commun_monter');
|
219 |
$url->addQueryString('adme_action', ADME_LG_ACTION_COMMUN_MONTER);
|
| 238 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.$etiquette_title_monter.'">'.
|
220 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_COMMUN_MONTER_TITLE.'">'.
|
| 239 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_FLECHE_HAUT.'" alt="'.$etiquette_alt_monter.'" />'.
|
221 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_FLECHE_HAUT.'" alt="'.ADME_LG_ACTION_COMMUN_MONTER_ALT.'" />'.
|
| 240 |
'</a> '."\n";
|
222 |
'</a> '."\n";
|
| 241 |
$url->removeQueryString('adme_action');
|
223 |
$url->removeQueryString('adme_action');
|
| 242 |
$url->addQueryString('adme_action', 'menu_commun_descendre');
|
224 |
$url->addQueryString('adme_action', ADME_LG_ACTION_COMMUN_DESCENDRE);
|
| 243 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.$etiquette_title_descendre.'">'.
|
225 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_COMMUN_DESCENDRE_TITLE.'">'.
|
| 244 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_FLECHE_BAS.'" alt="'.$etiquette_alt_descendre.'" />'.
|
226 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_FLECHE_BAS.'" alt="'.ADME_LG_ACTION_COMMUN_DESCENDRE_ALT.'" />'.
|
| 245 |
'</a> '."\n";
|
227 |
'</a> '."\n";
|
| 246 |
$url->removeQueryString('adme_action');
|
228 |
$url->removeQueryString('adme_action');
|
| 247 |
$url->addQueryString('adme_action', 'menu_commun_supprimer');
|
229 |
$url->addQueryString('adme_action', ADME_LG_ACTION_COMMUN_SUPPRIMER);
|
| 248 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.$etiquette_title_supprimer.'">'.
|
230 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_COMMUN_SUPPRIMER_TITLE.'">'.
|
| 249 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_SUPPRIMER.'" alt="'.$etiquette_alt_supprimer.'" />'.
|
231 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_SUPPRIMER.'" alt="'.ADME_LG_ACTION_COMMUN_SUPPRIMER_ALT.'" />'.
|
| 250 |
'</a> '."\n";
|
232 |
'</a> '."\n";
|
| 251 |
$url->removeQueryString('adme_action');
|
233 |
$url->removeQueryString('adme_action');
|
| 252 |
$url->addQueryString('adme_action', 'menu_commun_ajouter');
|
234 |
$url->addQueryString('adme_action', ADME_LG_ACTION_COMMUN_AJOUTER);
|
| 253 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.$etiquette_title_ajouter.'">'.
|
235 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_COMMUN_AJOUTER_TITLE.'">'.
|
| Line 254... |
Line 236... |
| 254 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_NOUVEAU.'" alt="'.$etiquette_alt_ajouter.'" />'.
|
236 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_NOUVEAU.'" alt="'.ADME_LG_ACTION_COMMUN_AJOUTER_ALT.'" />'.
|
| 255 |
'</a>'.' '."\n";
|
237 |
'</a>'.' '."\n";
|
| 256 |
|
238 |
|
| 257 |
// Si l'application liée est "texte simple", on ajoute un icone avec un lien vers
|
239 |
// Si l'application liée est "texte simple", on ajoute un icone avec un lien vers
|
| 258 |
// l'administration de cette application.
|
240 |
// l'administration de cette application.
|
| 259 |
if ($ligne_app->gap_id_application != 0 && GEN_verifierPresenceInterfaceAdmin($db, $ligne_app->gap_id_application)) { // l'appli afficheur a pour id 3
|
241 |
if ($ligne_app->gap_id_application != 0 && GEN_verifierPresenceInterfaceAdmin($db, $ligne_app->gap_id_application)) { // l'appli afficheur a pour id 3
|
| 260 |
$url->removeQueryString('adme_action');
|
242 |
$url->removeQueryString('adme_action');
|
| 261 |
$url->addQueryString('adme_action', 'administrer');
|
243 |
$url->addQueryString('adme_action', ADME_LG_ACTION_ADMINISTRER);
|
| 262 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.$etiquette_title_administrer.'">'.
|
244 |
$xhtml_action .= '<a href="'.$url->getURL().'" title="'.ADME_LG_ACTION_ADMINISTRER_TITLE.'">'.
|
| Line 263... |
Line 245... |
| 263 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_TEXTE.'" alt="'.$etiquette_alt_administrer.'" />'.
|
245 |
'<img class="'.ADME_CLASS_IMG_ICONE.'" src="'.ADME_IMAGE_TEXTE.'" alt="'.ADME_LG_ACTION_ADMINISTRER_ALT.'" />'.
|
| 264 |
'</a>'.' '."\n";
|
246 |
'</a>'.' '."\n";
|
| Line 284... |
Line 266... |
| 284 |
{
|
266 |
{
|
| 285 |
//----------------------------------------------------------------------------
|
267 |
//----------------------------------------------------------------------------
|
| 286 |
// Récupération d'infos sur le nouveau menu
|
268 |
// Récupération d'infos sur le nouveau menu
|
| 287 |
$objet_site = GEN_lireInfoSitePrincipal($db, $adme_site_id);
|
269 |
$objet_site = GEN_lireInfoSitePrincipal($db, $adme_site_id);
|
| 288 |
if ($objet_site == false) {
|
270 |
if ($objet_site == false) {
|
| 289 |
die('ERREUR Génésia Administrateur de Menus : impossible de lire les infos du site.<br />'.
|
271 |
die('ERREUR Génésia Administrateur de Menus : '.ADME_LG_ERREUR_INFO_SITE.'<br />'.
|
| 290 |
'ID du site : '.$adme_site_id.'<br />'.
|
272 |
'ID du site : '.$adme_site_id.'<br />'.
|
| 291 |
'Ligne n° : '. __LINE__ .'<br />'.
|
273 |
'Ligne n° : '. __LINE__ .'<br />'.
|
| 292 |
'Fichier n° : '. __FILE__ .'<br />');
|
274 |
'Fichier n° : '. __FILE__ .'<br />');
|
| 293 |
}
|
275 |
}
|
| 294 |
$nouveau_id_menu = SQL_obtenirNouveauId($db, 'gen_menu', 'gm_id_menu');
|
276 |
$nouveau_id_menu = SQL_obtenirNouveauId($db, 'gen_menu', 'gm_id_menu');
|
| Line 399... |
Line 381... |
| 399 |
// Initialisation de variable
|
381 |
// Initialisation de variable
|
| 400 |
$url->addQueryString('adme_site_id', $adme_site_id);
|
382 |
$url->addQueryString('adme_site_id', $adme_site_id);
|
| 401 |
$url->addQueryString('adme_menu_id', $adme_menu_id);
|
383 |
$url->addQueryString('adme_menu_id', $adme_menu_id);
|
| Line 402... |
Line 384... |
| 402 |
|
384 |
|
| 403 |
// Récupération des informations du menu concerné.
|
385 |
// Récupération des informations du menu concerné.
|
| 404 |
if (!isset($aso_valeurs['menu_commun_verifier'])) {
|
386 |
if (!isset($aso_valeurs[ADME_LG_ACTION_COMMUN_VERIFIER])) {
|
| Line 405... |
Line 387... |
| 405 |
$aso_valeurs = GEN_lireInfoMenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC);
|
387 |
$aso_valeurs = GEN_lireInfoMenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC);
|
| 406 |
|
388 |
|
| 407 |
if ($aso_valeurs == false) {
|
389 |
if ($aso_valeurs === false) {
|
| 408 |
die('ERREUR Génésia Administrateur de Menus : impossible de lire les infos du menu.<br />'.
|
390 |
die('ERREUR Papyrus Administrateur de Menus : '.ADME_LG_ERREUR_INFO_MENU.'<br />'.
|
| 409 |
'Idenitifiant du menu n° : '. $adme_menu_id .'<br />'.
|
391 |
'Idenitifiant du menu n° : '. $adme_menu_id .'<br />'.
|
| 410 |
'Ligne n° : '. __LINE__ .'<br />'.
|
392 |
'Ligne n° : '. __LINE__ .'<br />'.
|
| 411 |
'Fichier n° : '. __FILE__ .'<br />');
|
393 |
'Fichier n° : '. __FILE__ .'<br />');
|
| Line 412... |
Line 394... |
| 412 |
}
|
394 |
}
|
| 413 |
}
|
395 |
}
|
| - |
|
396 |
|
| Line 414... |
Line 397... |
| 414 |
|
397 |
// Titre de la page
|
| 415 |
// Titre de la page
|
398 |
$retour = '<h1>'.ADME_LG_FORM_MENU_COMMUN_TITRE_GENERAL.'</h1>'."\n";
|
| 416 |
$retour = '<h1>'.'Modification menu commun'.'</h1>'."\n";
|
399 |
$retour .= '<p class="adme_menu_id" >'.ADME_LG_FORM_MENU_ID.'<span id="adme_menu_id">'.$aso_valeurs['gm_id_menu'].'</span></p>'."\n";
|
| 417 |
|
400 |
|
| 418 |
// Création du formulaire
|
401 |
// Création du formulaire
|
| 419 |
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()...
|
402 |
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()...
|
| 420 |
$form =& new HTML_QuickForm('form_menu_commun', 'post', str_replace('&', '&', $url->getUrl()));
|
403 |
$form =& new HTML_QuickForm('form_menu_commun', 'post', str_replace('&', '&', $url->getUrl()));
|
| 421 |
$tab_index = 1000;
|
404 |
$tab_index = 1000;
|
| 422 |
$squelette =& $form->defaultRenderer();
|
405 |
$squelette =& $form->defaultRenderer();
|
| 423 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n"."\n".'{content}'."\n"."\n".'</form>'."\n");
|
406 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n"."\n".'{content}'."\n"."\n".'</form>'."\n");
|
| 424 |
$squelette->setElementTemplate( '<li>'."\n".
|
407 |
$squelette->setElementTemplate( '<li>'."\n".
|
| 425 |
'{label}'."\n".
|
408 |
'{label}'."\n".
|
| 426 |
'{element}'."\n".
|
409 |
'{element}'."\n".
|
| Line 427... |
Line 410... |
| 427 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
410 |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.ADME_LG_FORM_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'."\n".
|
| 428 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
411 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
| Line 429... |
Line 412... |
| 429 |
'</li>'."\n");
|
412 |
'</li>'."\n");
|
| 430 |
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">*</span> {requiredNote}</p>'."\n");
|
413 |
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADME_LG_FORM_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
|
| 431 |
|
414 |
|
| 432 |
$partie_menu_debut = '<fieldset>'."\n".'<legend>Configuration du menu commun</legend>'."\n".'<ul>'."\n";
|
415 |
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.ADME_LG_FORM_MENU_COMMUN_TITRE_CONFIG.'</legend>'."\n".'<ul>'."\n";
|
| 433 |
$form->addElement('html', $partie_menu_debut);
|
416 |
$form->addElement('html', $partie_menu_debut);
|
| Line 434... |
Line 417... |
| 434 |
|
417 |
|
| 435 |
$id = 'gm_code_num';
|
418 |
$id = 'gm_code_num';
|
| 436 |
$aso_attributs = array('id'=>$id, 'tabindex' => $tab_index++, 'size' => 5, 'maxlength' => 100);
|
419 |
$aso_attributs = array('id'=>$id, 'tabindex' => $tab_index++, 'size' => 5, 'maxlength' => 100);
|
| 437 |
$label = '<label for="'.$id.'">'.'Code numérique du menu'.'</label>';
|
420 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_CODE_NUM.'</label>';
|
| 438 |
$form->addElement('text', $id, $label, $aso_attributs);
|
421 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 439... |
Line 422... |
| 439 |
$form->addRule($id, 'Un code numérique est requis pour le menu !', 'required', '', 'client');
|
422 |
$form->addRule($id, ADME_LG_FORM_MENU_REGLE_CODE_NUM, 'required', '', 'client');
|
| 440 |
|
423 |
|
| 441 |
$id = 'gm_code_alpha';
|
424 |
$id = 'gm_code_alpha';
|
| 442 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 20, 'maxlength' => 20);
|
425 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 20, 'maxlength' => 20);
|
| 443 |
$label = '<label for="'.$id.'">'.'Code alphanumérique du menu'.'</label>';
|
426 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_CODE_ALPHA.'</label>';
|
| 444 |
$form->addElement('text', $id, $label, $aso_attributs);
|
427 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 445... |
Line 428... |
| 445 |
$form->addRule($id, 'Un code alphanumérique est requis pour le menu !', 'required', '', 'client');
|
428 |
$form->addRule($id, ADME_LG_FORM_MENU_REGLE_CODE_ALPHA, 'required', '', 'client');
|
| 446 |
|
429 |
|
| 447 |
$id = 'gm_nom';
|
430 |
$id = 'gm_nom';
|
| 448 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 50, 'maxlength' => 100);
|
431 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 50, 'maxlength' => 100);
|
| Line 449... |
Line 432... |
| 449 |
$label = '<label for="'.$id.'">'.'Nom du menu'.'</label>';
|
432 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_NOM.'</label>';
|
| 450 |
$form->addElement('text', $id, $label, $aso_attributs);
|
433 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 451 |
$form->addRule($id, 'Un nom est requis pour le menu !', 'required', '', 'client');
|
434 |
$form->addRule($id, ADME_LG_FORM_MENU_REGLE_NOM, 'required', '', 'client');
|
| 452 |
$form->applyFilter($id, 'trim');
|
435 |
$form->applyFilter($id, 'trim');
|
| Line 453... |
Line 436... |
| 453 |
|
436 |
|
| 454 |
$id = 'gm_raccourci_clavier';
|
437 |
$id = 'gm_raccourci_clavier';
|
| 455 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 1, 'maxlength' => 1);
|
438 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 1, 'maxlength' => 1);
|
| 456 |
$label = '<label for="'.$id.'">'.'Raccourci clavier'.'</label>';
|
439 |
$label = '<label for="'.$id.'">'.'Raccourci clavier'.'</label>';
|
| 457 |
$form->addElement('text', $id, $label, $aso_attributs);
|
440 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 458... |
Line 441... |
| 458 |
|
441 |
|
| 459 |
$id = 'gm_fichier_squelette';
|
442 |
$id = 'gm_fichier_squelette';
|
| 460 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 50, 'maxlength' => 255);
|
443 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 50, 'maxlength' => 255);
|
| 461 |
$label = '<label for="'.$id.'">'.'Fichier squelette'.'</label>';
|
444 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_FICHIER_SQUELETTE.'</label>';
|
| Line 479... |
Line 462... |
| 479 |
$aso_options[$ligne->gap_id_application] = $ligne->gap_nom;
|
462 |
$aso_options[$ligne->gap_id_application] = $ligne->gap_nom;
|
| 480 |
}
|
463 |
}
|
| 481 |
$resultat->free();
|
464 |
$resultat->free();
|
| 482 |
$id = 'gm_ce_application';
|
465 |
$id = 'gm_ce_application';
|
| 483 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
466 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| 484 |
$label = '<label for="'.$id.'">'.'Application'.'</label>';
|
467 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_APPLI.'</label>';
|
| 485 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
468 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
| Line 486... |
Line 469... |
| 486 |
|
469 |
|
| 487 |
$id = 'gm_application_arguments';
|
470 |
$id = 'gm_application_arguments';
|
| 488 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
471 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| 489 |
$label = '<label for="'.$id.'">'.'Arguments de l\'application'.'</label>';
|
472 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_APPLI_ARGUMENT.'</label>';
|
| Line 490... |
Line 473... |
| 490 |
$form->addElement('text', $id, $label, $aso_attributs);
|
473 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 491 |
|
474 |
|
| Line 492... |
Line 475... |
| 492 |
$partie_menu_fin = '</ul>'."\n".'</fieldset>'."\n";
|
475 |
$partie_menu_fin = '</ul>'."\n".'</fieldset>'."\n";
|
| 493 |
$form->addElement('html', $partie_menu_fin);
|
476 |
$form->addElement('html', $partie_menu_fin);
|
| Line 494... |
Line 477... |
| 494 |
|
477 |
|
| 495 |
$partie_entete_debut = '<fieldset>'."\n".'<legend>Entête des pages du menu commun</legend>'."\n".'<ul>'."\n";
|
478 |
$partie_entete_debut = '<fieldset>'."\n".'<legend>'.ADME_LG_FORM_MENU_COMMUN_TITRE_ENTETE.'</legend>'."\n".'<ul>'."\n";
|
| 496 |
$form->addElement('html', $partie_entete_debut);
|
479 |
$form->addElement('html', $partie_entete_debut);
|
| 497 |
|
480 |
|
| 498 |
$id = 'gm_robot';
|
481 |
$id = 'gm_robot';
|
| 499 |
$aso_options = array( 'index,follow' => 'Indexer cette page et les suivantes',
|
482 |
$aso_options = array( 'index,follow' => ADME_LG_FORM_MENU_INDEX_FOLLOW,
|
| 500 |
'index' => 'Indexer seulement cette page',
|
483 |
'index' => ADME_LG_FORM_MENU_INDEX,
|
| 501 |
'noindex' => 'Ne pas indexer cette page',
|
484 |
'noindex' => ADME_LG_FORM_MENU_NOINDEX,
|
| 502 |
'noindex,nofollow' => 'Ne pas indexer cette page et les suivantes',
|
485 |
'noindex,nofollow' => ADME_LG_FORM_MENU_NOINDEX_NOFOLLOW,
|
| Line 503... |
Line 486... |
| 503 |
'' => 'Auncune');
|
486 |
'' => ADME_LG_FORM_MENU_INDEX_VIDE);
|
| 504 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
487 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| 505 |
$label = '<label for="'.$id.'">'.'Indexation par robots'.'</label>';
|
488 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_ROBOT.'</label>';
|
| 506 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
489 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
| Line 507... |
Line 490... |
| 507 |
|
490 |
|
| 508 |
$id = 'gm_titre';
|
491 |
$id = 'gm_titre';
|
| 509 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
492 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| 510 |
$label = '<label for="'.$id.'">'.'Titre de la page'.'</label>';
|
493 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_TITRE.'</label>';
|
| Line 511... |
Line 494... |
| 511 |
$form->addElement('text', $id, $label, $aso_attributs);
|
494 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 512 |
|
495 |
|
| 513 |
$id = 'gm_titre_alternatif';
|
496 |
$id = 'gm_titre_alternatif';
|
| 514 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
497 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| Line 515... |
Line 498... |
| 515 |
$label = '<label for="'.$id.'">'.'Titre alternatif de la page'.'</label>';
|
498 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_TITRE_ALTERNATIF.'</label>';
|
| 516 |
$form->addElement('text', $id, $label, $aso_attributs);
|
499 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 517 |
|
500 |
|
| 518 |
$id = 'gm_mots_cles';
|
501 |
$id = 'gm_mots_cles';
|
| Line 519... |
Line 502... |
| 519 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 50);
|
502 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 50);
|
| 520 |
$label = '<label for="'.$id.'">'.'Mots-clés'.'</label>';
|
503 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_MOT_CLE.'</label>';
|
| 521 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
504 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
| 522 |
|
505 |
|
| Line 523... |
Line 506... |
| 523 |
$id = 'gm_description_libre';
|
506 |
$id = 'gm_description_libre';
|
| 524 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 45);
|
507 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 45);
|
| 525 |
$label = '<label for="'.$id.'">'.'Description du contenu '.'</label>';
|
508 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_DESCRIPTION.'</label>';
|
| 526 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
509 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
| Line 527... |
Line 510... |
| 527 |
|
510 |
|
| 528 |
$id = 'gm_description_table_matieres';
|
511 |
$id = 'gm_description_table_matieres';
|
| 529 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 45);
|
512 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 3, 'cols' => 45);
|
| 530 |
$label = '<label for="'.$id.'">'.'Table des matières'.'</label>';
|
513 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_TABLE_MATIERE.'</label>';
|
| Line 531... |
Line 514... |
| 531 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
514 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
| 532 |
|
515 |
|
| 533 |
$id = 'gm_source';
|
516 |
$id = 'gm_source';
|
| 534 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
517 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| Line 535... |
Line 518... |
| 535 |
$label = '<label for="'.$id.'">'.'Source'.'</label>';
|
518 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_SOURCE.'</label>';
|
| 536 |
$form->addElement('text', $id, $label, $aso_attributs);
|
519 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 537 |
|
520 |
|
| 538 |
$id = 'gm_auteur';
|
521 |
$id = 'gm_auteur';
|
| Line 539... |
Line 522... |
| 539 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
522 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| 540 |
$label = '<label for="'.$id.'">'.'Auteur'.'</label>';
|
523 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_AUTEUR.'</label>';
|
| 541 |
$form->addElement('text', $id, $label, $aso_attributs);
|
524 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 542 |
|
525 |
|
| Line 543... |
Line 526... |
| 543 |
$id = 'gm_contributeur';
|
526 |
$id = 'gm_contributeur';
|
| 544 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 2, 'cols' => 45);
|
527 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 2, 'cols' => 45);
|
| 545 |
$label = '<label for="'.$id.'">'.'Contributeur'.'</label>';
|
528 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_CONTRIBUTEUR.'</label>';
|
| 546 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
529 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
| Line 547... |
Line 530... |
| 547 |
|
530 |
|
| 548 |
$id = 'gm_editeur';
|
531 |
$id = 'gm_editeur';
|
| 549 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 2, 'cols' => 45);
|
532 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 2, 'cols' => 45);
|
| 550 |
$label = '<label for="'.$id.'">'.'Editeur'.'</label>';
|
533 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_EDITEUR.'</label>';
|
| Line 551... |
Line 534... |
| 551 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
534 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
| 552 |
|
535 |
|
| 553 |
$id = 'gm_date_debut_validite';
|
536 |
$id = 'gm_date_debut_validite';
|
| 554 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
537 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
| Line 555... |
Line 538... |
| 555 |
$label = '<label for="'.$id.'">'.'Date de début de validité'.'</label>';
|
538 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_DATE_VALIDITE_DEBUT.'</label>';
|
| 556 |
$form->addElement('text', $id, $label, $aso_attributs);
|
539 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 557 |
|
540 |
|
| 558 |
$id = 'gm_date_fin_validite';
|
541 |
$id = 'gm_date_fin_validite';
|
| Line 559... |
Line 542... |
| 559 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
542 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
| 560 |
$label = '<label for="'.$id.'">'.'Date de fin de validité'.'</label>';
|
543 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_DATE_VALIDITE_FIN.'</label>';
|
| 561 |
$form->addElement('text', $id, $label, $aso_attributs);
|
544 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 562 |
|
545 |
|
| Line 563... |
Line 546... |
| 563 |
$id = 'gm_date_copyright';
|
546 |
$id = 'gm_date_copyright';
|
| 564 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
547 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 19, 'maxlength' => 19);
|
| 565 |
$label = '<label for="'.$id.'">'.'Année pour le copyright'.'</label>';
|
548 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_DATE_COPYRIGHT.'</label>';
|
| 566 |
$form->addElement('text', $id, $label, $aso_attributs);
|
549 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 567... |
Line 550... |
| 567 |
|
550 |
|
| 568 |
$id = 'gm_licence';
|
551 |
$id = 'gm_licence';
|
| 569 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
552 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| 570 |
$label = '<label for="'.$id.'">'.'URL de la licence'.'</label>';
|
553 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_URL_LICENCE.'</label>';
|
| 571 |
$form->addElement('text', $id, $label, $aso_attributs);
|
554 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 572 |
|
555 |
|
| 573 |
$id = 'gm_categorie';
|
556 |
$id = 'gm_categorie';
|
| 574 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 100);
|
557 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 100);
|
| 575 |
$label = '<label for="'.$id.'">'.'Catégorie'.'</label>';
|
558 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_CATEGORIE.'</label>';
|
| Line 576... |
Line 559... |
| 576 |
$form->addElement('text', $id, $label, $aso_attributs);
|
559 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 577 |
|
560 |
|
| 578 |
$id = 'gm_public';
|
561 |
$id = 'gm_public';
|
| 579 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
562 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
| Line 580... |
Line 563... |
| 580 |
$label = '<label for="'.$id.'">'.'Public pour la page'.'</label>';
|
563 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_PUBLIC.'</label>';
|
| 581 |
$form->addElement('text', $id, $label, $aso_attributs);
|
564 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 582 |
|
565 |
|
| 583 |
$id = 'gm_public_niveau';
|
566 |
$id = 'gm_public_niveau';
|
| 584 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 25, 'maxlength' => 45);
|
567 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 25, 'maxlength' => 45);
|
| 585 |
$label = '<label for="'.$id.'">'.'Niveau du public pour la page'.'</label>';
|
568 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_PUBLIC_NIVEAU.'</label>';
|
| 586 |
$form->addElement('text', $id, $label, $aso_attributs);
|
569 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 587... |
Line 570... |
| 587 |
|
570 |
|
| 588 |
$id = 'gm_ce_type_portee_spatiale';
|
571 |
$id = 'gm_ce_type_portee_spatiale';
|
| 589 |
$aso_options = array( '' => 'Aucun',
|
572 |
$aso_options = array( '' => ADME_LG_FORM_MENU_ZG_VIDE,
|
| 590 |
'iso3166' => 'Code de pays sur deux lettres (iso3166)',
|
573 |
'iso3166' => ADME_LG_FORM_MENU_ZG_ISO,
|
| Line 591... |
Line 574... |
| 591 |
'Point' => 'Point géographique',
|
574 |
'Point' => ADME_LG_FORM_MENU_ZG_POINT,
|
| 592 |
'Box' => 'Représenation des régions géographiques du Dublin Core',
|
575 |
'Box' => ADME_LG_FORM_MENU_ZG_DC,
|
| Line 593... |
Line 576... |
| 593 |
'TGN' => 'Noms issus du Getty Thesaurus of Geographic Names');
|
576 |
'TGN' => ADME_LG_FORM_MENU_ZG_GTGN);
|
| 594 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
577 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| Line 595... |
Line 578... |
| 595 |
$label = '<label for="'.$id.'">'.'Type de portée spatiale'.'</label>';
|
578 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_ZG_TYPE.'</label>';
|
| 596 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
579 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
| 597 |
|
580 |
|
| Line 598... |
Line 581... |
| 598 |
$id = 'gm_portee_spatiale';
|
581 |
$id = 'gm_portee_spatiale';
|
| 599 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 100);
|
582 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 100);
|
| Line 600... |
Line 583... |
| 600 |
$label = '<label for="'.$id.'">'.'Portée spatiale de la page'.'</label>';
|
583 |
$label = '<label for="'.$id.'">'.ADME_LG_FORM_MENU_ZG_VALEUR.'</label>';
|
| Line 601... |
Line -... |
| 601 |
$form->addElement('text', $id, $label, $aso_attributs);
|
- |
|
| 602 |
|
- |
|
| 603 |
$id = 'gm_ce_type_portee_temporelle';
|
- |
|
| 604 |
$aso_options = array( '' => 'Aucun',
|
- |
|
| 605 |
'W3CDTF' => 'Codage des dates et heures du W3C',
|
- |
|
| 606 |
'Period' => 'Représentation des intervalles de temps du Dublin Core');
|
- |
|
| 607 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
- |
|
| 608 |
$label = '<label for="'.$id.'">'.'Type de portée temporelle'.'</label>';
|
584 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| Line 609... |
Line 585... |
| 609 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
585 |
|
| 610 |
|
586 |
$id = 'gm_ce_type_portee_temporelle';
|
| Line 611... |
Line 587... |
| 611 |
$id = 'gm_portee_temporelle';
|
587 |
$aso_options = array( '' => ADME_LG_FORM_MENU_TMP_VIDE,
|
| 612 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 100);
|
588 |
'W3CDTF' => ADME_LG_FORM_MENU_TMP_W3C,
|
| 613 |
$label = '<label for="'.$id.'">'.'Portée temporelle de la page'.'</label>';
|
589 |
'Period' => ADME_LG_FORM_MENU_TMP_DC);
|
| Line 653... |
Line 629... |
| 653 |
* @return string retourne les messages d'erreurs sinon rien.
|
629 |
* @return string retourne les messages d'erreurs sinon rien.
|
| 654 |
*/
|
630 |
*/
|
| 655 |
function ADME_validerFormAjouterMenuCommun($db, $aso_valeurs)
|
631 |
function ADME_validerFormAjouterMenuCommun($db, $aso_valeurs)
|
| 656 |
{
|
632 |
{
|
| 657 |
$message = '';
|
633 |
$message = '';
|
| - |
|
634 |
if ($aso_valeurs['gm_code_alpha'] == '') {
|
| - |
|
635 |
$message .= '<p class="pap_erreur">'.ADME_LG_FORM_MENU_REGLE_CODE_ALPHA.'</p>';
|
| - |
|
636 |
} else {
|
| 658 |
// Requete pour vérifier l'abscence du code numérique et alphanumérique de la table gen_menu
|
637 |
// Requete pour vérifier l'abscence du code alphanumérique de la table gen_menu
|
| 659 |
if (GEN_verifierPresenceCodeMenu($db, 'int', $aso_valeurs['gm_code_num'])) {
|
638 |
if (GEN_verifierPresenceCodeMenu($db, 'string', $aso_valeurs['gm_id_menu'], $aso_valeurs['gm_code_alpha']) === true) {
|
| 660 |
$message .= '<p class="pap_erreur">La valeur "'.$aso_valeurs['gm_code_num'].'" pour le champ "Code numérique" existe déjà.</p>';
|
639 |
$message .= '<p class="pap_erreur">'.sprintf(ADME_LG_ERREUR_CODE_ALPHA, $aso_valeurs['gm_code_alpha']).'</p>';
|
| - |
|
640 |
}
|
| 661 |
}
|
641 |
}
|
| - |
|
642 |
if ($aso_valeurs['gm_code_num'] == '') {
|
| - |
|
643 |
$message .= '<p class="pap_erreur">'.ADME_LG_FORM_MENU_REGLE_CODE_NUM.'</p>';
|
| - |
|
644 |
} else {
|
| - |
|
645 |
// Requete pour vérifier l'abscence du code numérique de la table gen_menu
|
| 662 |
if (GEN_verifierPresenceCodeMenu($db, 'int', $aso_valeurs['gm_code_alpha'])) {
|
646 |
if (GEN_verifierPresenceCodeMenu($db, 'int', $aso_valeurs['gm_id_menu'], $aso_valeurs['gm_code_num']) === true) {
|
| 663 |
$message .= '<p class="pap_erreur">La valeur "'.$aso_valeurs['gm_code_alpha'].'" pour le champ "Code alphanumérique" existe déjà.</p>';
|
647 |
$message .= '<p class="pap_erreur">'.sprintf(ADME_LG_ERREUR_CODE_NUM, $aso_valeurs['gm_code_num']).'</p>';
|
| - |
|
648 |
}
|
| - |
|
649 |
}
|
| - |
|
650 |
if ($aso_valeurs['gm_nom'] == '') {
|
| - |
|
651 |
$message .= '<p class="pap_erreur">'.ADME_LG_FORM_MENU_REGLE_NOM.'</p>';
|
| - |
|
652 |
}
|
| - |
|
653 |
if ($aso_valeurs['gm_description_resume'] == '') {
|
| - |
|
654 |
$message .= '<p class="pap_erreur">'.ADME_LG_FORM_MENU_REGLE_INFO_BULLE.'</p>';
|
| 664 |
}
|
655 |
}
|
| 665 |
return $message;
|
656 |
return $message;
|
| 666 |
}
|
657 |
}
|
| Line 667... |
Line 658... |
| 667 |
|
658 |
|
| Line 673... |
Line 664... |
| 673 |
* @param object objet Pear représentant l'authentification.
|
664 |
* @param object objet Pear représentant l'authentification.
|
| 674 |
* @param integer l'identifiant du menu à administrer.
|
665 |
* @param integer l'identifiant du menu à administrer.
|
| 675 |
* @param array le tableau des valeurs à modifier.
|
666 |
* @param array le tableau des valeurs à modifier.
|
| 676 |
* @return void les changement sont fait dans la base de données.
|
667 |
* @return void les changement sont fait dans la base de données.
|
| 677 |
*/
|
668 |
*/
|
| 678 |
function ADME_modifierMenuCommun($db, $auth, $adme_menu_id, $aso_valeurs)
|
669 |
function ADME_modifierMenuCommun($db, $auth, $adme_menu_id, $aso_valeurs)
|
| 679 |
{
|
670 |
{
|
| 680 |
$requete = 'UPDATE gen_menu SET '.
|
671 |
$requete = 'UPDATE gen_menu SET '.
|
| 681 |
'gm_ce_application = '.$_POST['gm_ce_application'].', '.
|
672 |
'gm_ce_application = '.$_POST['gm_ce_application'].', '.
|
| 682 |
'gm_application_arguments = "'.$_POST['gm_application_arguments'].'", '.
|
673 |
'gm_application_arguments = "'.$_POST['gm_application_arguments'].'", '.
|
| 683 |
'gm_fichier_squelette = "'.$_POST['gm_fichier_squelette'].'", '.
|
674 |
'gm_fichier_squelette = "'.$_POST['gm_fichier_squelette'].'", '.
|
| Line 727... |
Line 718... |
| 727 |
{
|
718 |
{
|
| 728 |
//-------------------------------------------------------------------------------------------------------------------
|
719 |
//-------------------------------------------------------------------------------------------------------------------
|
| 729 |
// Récupération d'informations sur les relations du menu courant.
|
720 |
// Récupération d'informations sur les relations du menu courant.
|
| 730 |
$ligne_menu_courant_relation = GEN_lireInfoMenuRelation($db, $adme_menu_id, '1'); // 1 = relation "avoir père"
|
721 |
$ligne_menu_courant_relation = GEN_lireInfoMenuRelation($db, $adme_menu_id, '1'); // 1 = relation "avoir père"
|
| 731 |
if ($ligne_menu_courant_relation == false) {
|
722 |
if ($ligne_menu_courant_relation == false) {
|
| 732 |
die('ERREUR Papyrus Administrateur de Menus : impossible de lire les infos sur les relations du menu.<br />'.
|
723 |
die('ERREUR Papyrus Administrateur de Menus : '.ADME_LG_ERREUR_INFO_MENU_RELATION.'<br />'.
|
| 733 |
'Identifiant menu : '. $adme_menu_id .'<br />'.
|
724 |
'Identifiant menu : '. $adme_menu_id .'<br />'.
|
| 734 |
'Identifiant valeur relation : 1 <br />'.
|
725 |
'Identifiant valeur relation : 1 <br />'.
|
| 735 |
'Ligne n° : '. __LINE__ .'<br />'.
|
726 |
'Ligne n° : '. __LINE__ .'<br />'.
|
| 736 |
'Fichier n° : '. __FILE__ .'<br />');
|
727 |
'Fichier n° : '. __FILE__ .'<br />');
|
| 737 |
}
|
728 |
}
|
| 738 |
//$id_pere = $ligne_menu_courant_relation->gmr_id_menu_02;
|
729 |
//$id_pere = $ligne_menu_courant_relation->gmr_id_menu_02;
|
| Line 739... |
Line 730... |
| 739 |
|
730 |
|
| 740 |
$id_pere = GEN_lireIdentifiantMenuPere($adme_menu_id);
|
731 |
$id_pere = GEN_lireIdentifiantMenuPere($adme_menu_id);
|
| 741 |
if ($id_pere == false) {
|
732 |
if ($id_pere == false) {
|
| 742 |
die('ERREUR Papyrus Administrateur de Menus : impossible de lire identifiant du menu père.<br />'.
|
733 |
die('ERREUR Papyrus Administrateur de Menus : '.ADME_LG_ERREUR_ID_MENU_PERE.'<br />'.
|
| 743 |
'Identifiant menu fils : '. $adme_menu_id .'<br />'.
|
734 |
'Identifiant menu fils : '. $adme_menu_id .'<br />'.
|
| 744 |
'Ligne n° : '. __LINE__ .'<br />'.
|
735 |
'Ligne n° : '. __LINE__ .'<br />'.
|
| 745 |
'Fichier n° : '. __FILE__ .'<br />');
|
736 |
'Fichier n° : '. __FILE__ .'<br />');
|
| Line 820... |
Line 811... |
| 820 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
|
811 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
|
| Line 821... |
Line 812... |
| 821 |
|
812 |
|
| Line 822... |
Line 813... |
| 822 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
|
813 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
|
| 823 |
|
814 |
|
| 824 |
if ($ligne && ($ligne->compte > 0)) {
|
815 |
if ($ligne && ($ligne->compte > 0)) {
|
| Line 825... |
Line 816... |
| 825 |
return 'Ce menu contient encore des sous menus. Veuillez commencez par supprimer ces sous menus.';
|
816 |
return ADME_LG_ERREUR_EXISTE_SOUS_MENU;
|
| 826 |
}
|
817 |
}
|
| 827 |
|
818 |
|
| Line 851... |
Line 842... |
| 851 |
|
842 |
|
| 852 |
|
843 |
|
| 853 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
844 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| - |
|
845 |
*
|
| - |
|
846 |
* $Log: not supported by cvs2svn $
|
| - |
|
847 |
* Revision 1.5 2004/11/09 17:48:35 jpm
|
| 854 |
*
|
848 |
* Gestion de différentes interfaces d'administration.
|
| 855 |
* $Log: not supported by cvs2svn $
|
849 |
*
|
| 856 |
* Revision 1.3 2004/09/23 17:45:13 jpm
|
850 |
* Revision 1.3 2004/09/23 17:45:13 jpm
|
| 857 |
* Amélioration de la gestion des liens annuler et du selecteur de sites.
|
851 |
* Amélioration de la gestion des liens annuler et du selecteur de sites.
|
| 858 |
*
|
852 |
*
|