| 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: afficheur.admin.php,v 1.19 2006-10-16 15:49:07 ddelon Exp $
|
22 |
// CVS : $Id: afficheur.admin.php,v 1.20 2006-12-01 11:23:23 ddelon Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
* Gestion de la rédaction du contenu pour Papyrus.
|
24 |
* Gestion de la rédaction du contenu pour Papyrus.
|
| 25 |
*
|
25 |
*
|
| 26 |
* Contient les fonctions nécessaires à la gestion du contenu de Papyrus.
|
26 |
* Contient les fonctions nécessaires à la gestion du contenu de Papyrus.
|
| 27 |
*
|
27 |
*
|
| Line 30... |
Line 30... |
| 30 |
//Auteur original :
|
30 |
//Auteur original :
|
| 31 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
31 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| 32 |
//Autres auteurs :
|
32 |
//Autres auteurs :
|
| 33 |
*@author Aucun
|
33 |
*@author Aucun
|
| 34 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@copyright Tela-Botanica 2000-2004
|
| 35 |
*@version $Revision: 1.19 $ $Date: 2006-10-16 15:49:07 $
|
35 |
*@version $Revision: 1.20 $ $Date: 2006-12-01 11:23:23 $
|
| 36 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
| 37 |
*/
|
37 |
*/
|
| Line 38... |
Line 38... |
| 38 |
|
38 |
|
| 39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 77... |
Line 77... |
| 77 |
return false;
|
77 |
return false;
|
| 78 |
} else if (isset($_POST['afficheur_enregistrer_quitter'])) {
|
78 |
} else if (isset($_POST['afficheur_enregistrer_quitter'])) {
|
| 79 |
// Mise à jour du contenu
|
79 |
// Mise à jour du contenu
|
| 80 |
$this->_ajouterContenu($this->objet_pear_db, $this->objet_pear_url, $this->objet_pear_auth, $_GET['adme_menu_id'], $_POST);
|
80 |
$this->_ajouterContenu($this->objet_pear_db, $this->objet_pear_url, $this->objet_pear_auth, $_GET['adme_menu_id'], $_POST);
|
| 81 |
return false;
|
81 |
return false;
|
| 82 |
} else if (isset($_POST['afficheur_enregistrer_ss_entite'])) {
|
- |
|
| 83 |
$_POST['gmc_contenu'] = html_entity_decode($_POST['gmc_contenu']);
|
- |
|
| 84 |
// Mise à jour du contenu
|
- |
|
| 85 |
$this->_ajouterContenu($this->objet_pear_db, $this->objet_pear_url, $this->objet_pear_auth, $_GET['adme_menu_id'], $_POST);
|
- |
|
| 86 |
} else if (isset($_POST['afficheur_enregistrer_rester'])) {
|
82 |
} else if (isset($_POST['afficheur_enregistrer_rester'])) {
|
| 87 |
// Mise à jour du contenu
|
83 |
// Mise à jour du contenu
|
| 88 |
$this->_ajouterContenu($this->objet_pear_db, $this->objet_pear_url, $this->objet_pear_auth, $_GET['adme_menu_id'], $_POST);
|
84 |
$this->_ajouterContenu($this->objet_pear_db, $this->objet_pear_url, $this->objet_pear_auth, $_GET['adme_menu_id'], $_POST);
|
| 89 |
}
|
85 |
}
|
| 90 |
$this->sortie_xhtml .= $this->_redigerContenu($this->objet_pear_db, $this->objet_pear_url, $_GET['adme_site_id'], $_GET['adme_menu_id'], $_GET['adme_action']);
|
86 |
$this->sortie_xhtml .= $this->_redigerContenu($this->objet_pear_db, $this->objet_pear_url, $_GET['adme_site_id'], $_GET['adme_menu_id'], $_GET['adme_action']);
|
| Line 121... |
Line 117... |
| 121 |
'{element}'."\n".
|
117 |
'{element}'."\n".
|
| 122 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
118 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
| 123 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
119 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
| 124 |
'</li>'."\n");
|
120 |
'</li>'."\n");
|
| 125 |
//$squelette->setHeaderTemplate('<p>{header}</p>');
|
121 |
//$squelette->setHeaderTemplate('<p>{header}</p>');
|
| 126 |
//$form->addElement('header', 'Entete', 'REDACTION');
|
122 |
//$form->addElement('header', 'Entete', 'REDACTION');.liste_bouton li{display:inline;}
|
| 127 |
$aso_options = array();
|
123 |
$aso_options = array();
|
| 128 |
$aso_options[1] = 'XHTML';
|
- |
|
| 129 |
$aso_options[2] = 'WIKINI';
|
- |
|
| 130 |
$id = 'gmc_ce_type_contenu';
|
124 |
$form->addElement('hidden','gmc_ce_type_contenu',1);
|
| 131 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
- |
|
| 132 |
$label = '<label for="'.$id.'">'.'Type de contenu : '.'</label>';
|
- |
|
| 133 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
- |
|
| Line 134... |
Line 125... |
| 134 |
|
125 |
|
| 135 |
if ($GLOBALS['_AFFI_']['fckeditor']['utilisation']) {
|
126 |
if ($GLOBALS['_AFFI_']['fckeditor']['utilisation']) {
|
| 136 |
/** Inclusion du fichier de FCKeditor*/
|
127 |
/** Inclusion du fichier de FCKeditor*/
|
| 137 |
require_once AFFI_CHEMIN_FCKEDITOR.'fckeditor.php';
|
128 |
require_once AFFI_CHEMIN_FCKEDITOR.'fckeditor.php';
|
| Line 180... |
Line 171... |
| 180 |
$label = '<label for="'.$id.'">'.'Resumé modification : '.'</label>';
|
171 |
$label = '<label for="'.$id.'">'.'Resumé modification : '.'</label>';
|
| 181 |
$form->addElement('text', $id, $label, $aso_attributs);
|
172 |
$form->addElement('text', $id, $label, $aso_attributs);
|
| 182 |
$form->addElement('hidden','gmc_ce_menu',$ligne_dernier_contenu['gmc_ce_menu']);
|
173 |
$form->addElement('hidden','gmc_ce_menu',$ligne_dernier_contenu['gmc_ce_menu']);
|
| 183 |
$form->addElement('hidden','gmc_ce_type_contenu_table',$ligne_dernier_contenu['gmc_ce_type_contenu']);
|
174 |
$form->addElement('hidden','gmc_ce_type_contenu_table',$ligne_dernier_contenu['gmc_ce_type_contenu']);
|
| Line -... |
Line 175... |
| - |
|
175 |
|
| - |
|
176 |
// .liste_bouton li{display:inline;}
|
| 184 |
|
177 |
|
| 185 |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
178 |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
| 186 |
$form->addElement('html', $liste_bouton_debut);
|
179 |
$form->addElement('html', $liste_bouton_debut);
|
| 187 |
$form->addElement('submit', 'afficheur_enregistrer_quitter', 'Enregistrer et quitter');
|
180 |
$form->addElement('submit', 'afficheur_enregistrer_quitter', 'Enregistrer et quitter');
|
| 188 |
$form->addElement('submit', 'afficheur_enregistrer_rester', 'Enregistrer et rester en édition');
|
- |
|
| 189 |
$form->addElement('submit', 'afficheur_enregistrer_ss_entite', 'Remplacer les entités xhtml');
|
181 |
$form->addElement('submit', 'afficheur_enregistrer_rester', 'Enregistrer et rester en édition');
|
| 190 |
$form->addElement('submit', 'afficheur_annuler', 'Annuler');
|
182 |
$form->addElement('submit', 'afficheur_annuler', 'Annuler');
|
| 191 |
$liste_bouton_fin = '</ul>'."\n";
|
183 |
$liste_bouton_fin = '</ul>'."\n";
|
| Line 192... |
Line 184... |
| 192 |
$form->addElement('html', $liste_bouton_fin);
|
184 |
$form->addElement('html', $liste_bouton_fin);
|
| Line 198... |
Line 190... |
| 198 |
return $retour;
|
190 |
return $retour;
|
| Line 199... |
Line 191... |
| 199 |
|
191 |
|
| Line 200... |
Line -... |
| 200 |
|
- |
|
| 201 |
}
|
- |
|
| 202 |
|
- |
|
| 203 |
/** Méthode redigerContenu() - Enregistre les infos du formulaire de saisie d'un menu
|
- |
|
| 204 |
*
|
- |
|
| 205 |
*
|
- |
|
| 206 |
* @return void les données sont enregistrées dans la base de données.
|
- |
|
| 207 |
*/
|
- |
|
| 208 |
function _redigerContenuOld($db, $url, $adme_site_id, $adme_menu_id, $adme_action)
|
- |
|
| 209 |
{
|
- |
|
| 210 |
|
- |
|
| 211 |
$contenu='';
|
- |
|
| 212 |
|
- |
|
| 213 |
|
- |
|
| 214 |
|
- |
|
| 215 |
$id_langue = $GLOBALS['_GEN_commun']['i18n'];
|
- |
|
| 216 |
|
- |
|
| 217 |
if (isset($id_langue) && ($id_langue!='')) {
|
- |
|
| 218 |
$langue_test=$id_langue;
|
- |
|
| 219 |
} else {
|
- |
|
| 220 |
$langue_test=GEN_I18N_ID_DEFAUT;
|
- |
|
| 221 |
}
|
- |
|
| 222 |
|
- |
|
| 223 |
|
- |
|
| 224 |
|
- |
|
| 225 |
//-------------------------------------------------------------------------------------------------------------------
|
- |
|
| 226 |
// Initialisation de variable
|
- |
|
| 227 |
$url->addQueryString('adme_site_id', $adme_site_id);
|
- |
|
| 228 |
$url->addQueryString('adme_menu_id', $adme_menu_id);
|
- |
|
| 229 |
$url->addQueryString('adme_action', $adme_action);
|
- |
|
| 230 |
|
- |
|
| 231 |
//-------------------------------------------------------------------------------------------------------------------
|
- |
|
| 232 |
// Récupération des informations du contenu concerné.
|
- |
|
| 233 |
$ligne_menu = GEN_lireInfoMenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC);
|
- |
|
| 234 |
|
- |
|
| 235 |
if ($ligne_menu == false) {
|
- |
|
| 236 |
die('ERREUR Papyrus Administrateur de Menus: impossible de lire les infos du menu.<br />'.
|
- |
|
| 237 |
'Idenitifiant du menu n° : '. $adme_menu_id .'<br />'.
|
- |
|
| 238 |
'Ligne n° : '. __LINE__ .'<br />'.
|
- |
|
| 239 |
'Fichier n° : '. __FILE__ .'<br />');
|
- |
|
| 240 |
}
|
- |
|
| 241 |
|
- |
|
| 242 |
|
- |
|
| 243 |
$id_langue = $GLOBALS['_GEN_commun']['i18n'];
|
- |
|
| 244 |
|
- |
|
| 245 |
if (isset($id_langue) && ($id_langue!='')) {
|
- |
|
| 246 |
$langue_test=$id_langue;
|
- |
|
| 247 |
} else {
|
- |
|
| 248 |
$langue_test=GEN_I18N_ID_DEFAUT;
|
- |
|
| 249 |
}
|
- |
|
| 250 |
|
- |
|
| 251 |
|
- |
|
| 252 |
// Récupération du dernier contenu : cas d'un traduction
|
- |
|
| 253 |
|
- |
|
| 254 |
$requete = 'SELECT gmc_contenu , gmc_ce_type_contenu,gmc_ce_menu '.
|
- |
|
| 255 |
'FROM gen_menu_contenu '.
|
- |
|
| 256 |
'WHERE truncate((gmc_ce_type_contenu/10),0) = '. $adme_menu_id . ' '.
|
- |
|
| 257 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 258 |
|
- |
|
| 259 |
$resultat = $db->query($requete);
|
- |
|
| 260 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
|
- |
|
| 261 |
|
- |
|
| 262 |
// Cas historique
|
- |
|
| 263 |
|
- |
|
| 264 |
if ( $resultat->numRows() == 0 ) {
|
- |
|
| 265 |
|
- |
|
| 266 |
$requete = 'SELECT gmc_contenu , gmc_ce_type_contenu,gmc_ce_menu '.
|
- |
|
| 267 |
'FROM gen_menu_contenu '.
|
- |
|
| 268 |
'WHERE gmc_ce_menu = '.$adme_menu_id.' '.
|
- |
|
| 269 |
'AND gmc_ce_type_contenu in (1,2) '.
|
- |
|
| 270 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 271 |
|
- |
|
| 272 |
$resultat = $db->query($requete);
|
- |
|
| 273 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
|
- |
|
| 274 |
|
- |
|
| 275 |
}
|
- |
|
| 276 |
|
- |
|
| 277 |
// Pas de contenu, tentative de recuperation contenu non traduit (apres mutlilinguisme)
|
- |
|
| 278 |
|
- |
|
| 279 |
if ( $resultat->numRows() == 0 ) {
|
- |
|
| 280 |
|
- |
|
| 281 |
$requete_defaut = 'SELECT gm_id_menu, gm_code_num '.
|
- |
|
| 282 |
'FROM gen_menu '.
|
- |
|
| 283 |
'WHERE gm_code_num = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 284 |
'AND gm_ce_i18n = "'.$langue_test.'" ';
|
- |
|
| 285 |
|
- |
|
| 286 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 287 |
|
- |
|
| 288 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 289 |
|
- |
|
| 290 |
if ( $resultat_defaut->numRows() > 0 ) {
|
- |
|
| 291 |
|
- |
|
| 292 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 293 |
|
- |
|
| 294 |
$requete_defaut = 'SELECT gmc_contenu , gmc_ce_type_contenu, gmc_ce_menu '.
|
- |
|
| 295 |
'FROM gen_menu_contenu '.
|
- |
|
| 296 |
'WHERE gmc_ce_menu = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 297 |
'AND truncate((gmc_ce_type_contenu/10),0) = '. $ligne_defaut->gm_id_menu . ' '.
|
- |
|
| 298 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 299 |
|
- |
|
| 300 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 301 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 302 |
|
- |
|
| 303 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 304 |
|
- |
|
| 305 |
$contenu = $ligne_defaut->gmc_contenu;
|
- |
|
| 306 |
|
- |
|
| 307 |
// Pas de contenu, tentative de recuperation contenu non traduit (avant multilinguisme)
|
- |
|
| 308 |
}
|
- |
|
| 309 |
|
- |
|
| 310 |
if ( $resultat_defaut->numRows()== 0 ) {
|
- |
|
| 311 |
|
- |
|
| 312 |
$requete_defaut = 'SELECT gm_id_menu, gm_code_num '.
|
- |
|
| 313 |
'FROM gen_menu '.
|
- |
|
| 314 |
'WHERE gm_code_num = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 315 |
'AND gm_ce_i18n = "'.$langue_test.'" ';
|
- |
|
| 316 |
|
- |
|
| 317 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 318 |
|
- |
|
| 319 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 320 |
|
- |
|
| 321 |
if ( $resultat_defaut->numRows() > 0 ) {
|
- |
|
| 322 |
|
- |
|
| 323 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 324 |
|
- |
|
| 325 |
$requete_defaut = 'SELECT gmc_contenu , gmc_ce_type_contenu, gmc_ce_menu '.
|
- |
|
| 326 |
'FROM gen_menu_contenu '.
|
- |
|
| 327 |
'WHERE gmc_ce_menu = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 328 |
'AND gmc_ce_type_contenu in (1,2) '.
|
- |
|
| 329 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 330 |
|
- |
|
| 331 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 332 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 333 |
|
- |
|
| 334 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 335 |
|
- |
|
| 336 |
$contenu = $ligne_defaut->gmc_contenu;
|
- |
|
| 337 |
|
- |
|
| 338 |
}
|
- |
|
| 339 |
}
|
- |
|
| 340 |
|
- |
|
| 341 |
if ( $resultat_defaut->numRows()== 0 ) {
|
- |
|
| 342 |
|
- |
|
| 343 |
$requete_defaut = 'SELECT gm_id_menu, gm_code_num '.
|
- |
|
| 344 |
'FROM gen_menu '.
|
- |
|
| 345 |
'WHERE gm_code_num = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 346 |
'AND gm_ce_i18n = "'.GEN_I18N_ID_DEFAUT.'" ';
|
- |
|
| 347 |
|
- |
|
| 348 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 349 |
|
- |
|
| 350 |
if ( $resultat_defaut->numRows() > 0 ) {
|
- |
|
| 351 |
|
- |
|
| 352 |
|
- |
|
| 353 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 354 |
|
- |
|
| 355 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 356 |
|
- |
|
| 357 |
$requete_defaut = 'SELECT gmc_contenu , gmc_ce_type_contenu, gmc_ce_menu '.
|
- |
|
| 358 |
'FROM gen_menu_contenu '.
|
- |
|
| 359 |
'WHERE gmc_ce_menu = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 360 |
'AND truncate((gmc_ce_type_contenu/10),0) = '. $ligne_defaut->gm_id_menu . ' '.
|
- |
|
| 361 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 362 |
|
- |
|
| 363 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 364 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 365 |
|
- |
|
| 366 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 367 |
|
- |
|
| 368 |
$contenu = $ligne_defaut->gmc_contenu;
|
- |
|
| 369 |
|
- |
|
| 370 |
}
|
- |
|
| 371 |
}
|
- |
|
| 372 |
|
- |
|
| 373 |
if ( $resultat_defaut->numRows()== 0 ) {
|
- |
|
| 374 |
|
- |
|
| 375 |
$requete_defaut = 'SELECT gm_id_menu, gm_code_num '.
|
- |
|
| 376 |
'FROM gen_menu '.
|
- |
|
| 377 |
'WHERE gm_code_num = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 378 |
'AND gm_ce_i18n = "'.GEN_I18N_ID_DEFAUT.'" ';
|
- |
|
| 379 |
|
- |
|
| 380 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 381 |
|
- |
|
| 382 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 383 |
|
- |
|
| 384 |
if ( $resultat_defaut->numRows() > 0 ) {
|
- |
|
| 385 |
|
- |
|
| 386 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 387 |
|
- |
|
| 388 |
$requete_defaut = 'SELECT gmc_contenu , gmc_ce_type_contenu, gmc_ce_menu '.
|
- |
|
| 389 |
'FROM gen_menu_contenu '.
|
- |
|
| 390 |
'WHERE gmc_ce_menu = '.$ligne_menu['gm_code_num'].' '.
|
- |
|
| 391 |
'AND gmc_ce_type_contenu in (1,2) '.
|
- |
|
| 392 |
'AND gmc_bool_dernier = 1';
|
- |
|
| 393 |
|
- |
|
| 394 |
$resultat_defaut = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete_defaut);
|
- |
|
| 395 |
(DB::isError($resultat_defaut)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_defaut->getMessage(), $requete_defaut)) : '';
|
- |
|
| 396 |
|
- |
|
| 397 |
$ligne_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
| 398 |
|
- |
|
| 399 |
$contenu = $ligne_defaut->gmc_contenu;
|
- |
|
| 400 |
}
|
- |
|
| 401 |
}
|
- |
|
| 402 |
|
- |
|
| 403 |
}
|
- |
|
| 404 |
|
- |
|
| 405 |
|
- |
|
| 406 |
|
- |
|
| 407 |
$ligne_dernier_contenu = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
| 408 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
|
- |
|
| 409 |
|
- |
|
| 410 |
// Hack :
|
- |
|
| 411 |
|
- |
|
| 412 |
|
- |
|
| 413 |
|
- |
|
| 414 |
$retour = '<h1>'.'Rédaction'.'</h1>'."\n";
|
- |
|
| 415 |
//-------------------------------------------------------------------------------------------------------------------
|
- |
|
| 416 |
// Création du formulaire
|
- |
|
| 417 |
$form =& new HTML_QuickForm('form_modifier_contenu', 'post', str_replace('&', '&', $url->getUrl()));
|
- |
|
| 418 |
$tab_index = 1000;
|
- |
|
| 419 |
$squelette =& $form->defaultRenderer();
|
- |
|
| 420 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'<ul>'."\n".'{content}'."\n".'</ul>'."\n".'</form>'."\n");
|
- |
|
| 421 |
$squelette->setElementTemplate( '<li>'."\n".
|
- |
|
| 422 |
'{label}'."\n".
|
- |
|
| 423 |
'{element}'."\n".
|
- |
|
| 424 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
- |
|
| 425 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
- |
|
| 426 |
'</li>'."\n");
|
- |
|
| 427 |
//$squelette->setHeaderTemplate('<p>{header}</p>');
|
- |
|
| 428 |
//$form->addElement('header', 'Entete', 'REDACTION');
|
- |
|
| 429 |
$aso_options = array();
|
- |
|
| 430 |
$aso_options[1] = 'XHTML';
|
- |
|
| 431 |
$aso_options[2] = 'WIKINI';
|
- |
|
| 432 |
$id = 'gmc_ce_type_contenu';
|
- |
|
| 433 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
- |
|
| 434 |
$label = '<label for="'.$id.'">'.'Type de contenu : '.'</label>';
|
- |
|
| 435 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
- |
|
| 436 |
|
- |
|
| 437 |
if ($GLOBALS['_AFFI_']['fckeditor']['utilisation']) {
|
- |
|
| 438 |
/** Inclusion du fichier de FCKeditor*/
|
- |
|
| 439 |
require_once AFFI_CHEMIN_FCKEDITOR.'fckeditor.php';
|
- |
|
| 440 |
$fckeditor = new FCKeditor('gmc_contenu');
|
- |
|
| 441 |
if ($ligne_dernier_contenu['gmc_contenu']) {
|
- |
|
| 442 |
$fckeditor->Value = $ligne_dernier_contenu['gmc_contenu'];
|
- |
|
| 443 |
}
|
- |
|
| 444 |
else {
|
- |
|
| 445 |
if ($contenu) {
|
- |
|
| 446 |
$fckeditor->Value = $contenu;
|
- |
|
| 447 |
}
|
- |
|
| 448 |
else {
|
- |
|
| 449 |
$fckeditor->Value = '';
|
- |
|
| 450 |
}
|
- |
|
| 451 |
}
|
- |
|
| 452 |
|
- |
|
| 453 |
$fckeditor->Height = $GLOBALS['_AFFI_']['fckeditor']['hauteur'];
|
- |
|
| 454 |
$fckeditor->ToolbarSet = $GLOBALS['_AFFI_']['fckeditor']['barre'];
|
- |
|
| 455 |
$fckeditor->Config['CustomConfigurationsPath']=$GLOBALS['_AFFI_']['fckeditor']['CustomConfigurationsPath'];
|
- |
|
| 456 |
$fckeditor->Config['AutoDetectLanguage'] = false;
|
- |
|
| 457 |
$fckeditor->Config['DefaultLanguage'] = $GLOBALS['_AFFI_']['fckeditor']['langue'];
|
- |
|
| 458 |
$fckeditor->BasePath = AFFI_CHEMIN_FCKEDITOR;
|
- |
|
| 459 |
if ($fckeditor->IsCompatible()) {
|
- |
|
| 460 |
$form->addElement('html', '<li>'.$fckeditor->CreateHtml().'</li>');
|
- |
|
| 461 |
} else {
|
- |
|
| 462 |
$GLOBALS['_AFFI_']['fckeditor']['utilisation'] = false;
|
- |
|
| 463 |
}
|
- |
|
| 464 |
}
|
- |
|
| 465 |
if (!$GLOBALS['_AFFI_']['fckeditor']['utilisation']) {
|
- |
|
| 466 |
$id = 'gmc_contenu';
|
- |
|
| 467 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 20, 'cols' => 100);
|
- |
|
| 468 |
$label = '<label for="'.$id.'">'.'Contenu : '.'</label>';
|
- |
|
| 469 |
$form->addElement('textarea', $id, $label, $aso_attributs);
|
- |
|
| 470 |
}
|
- |
|
| 471 |
|
- |
|
| 472 |
$aso_options = array();
|
- |
|
| 473 |
$aso_options[1] = 'Mineure';
|
- |
|
| 474 |
$aso_options[2] = 'Majeure';
|
- |
|
| 475 |
$id = 'gmc_ce_type_modification';
|
- |
|
| 476 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
- |
|
| 477 |
$label = '<label for="'.$id.'">'.'Type de modification : '.'</label>';
|
- |
|
| 478 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
- |
|
| 479 |
|
- |
|
| 480 |
$id = 'gmc_resume_modification';
|
- |
|
| 481 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255);
|
- |
|
| 482 |
$label = '<label for="'.$id.'">'.'Resumé modification : '.'</label>';
|
- |
|
| 483 |
$form->addElement('text', $id, $label, $aso_attributs);
|
- |
|
| 484 |
$form->addElement('hidden','gmc_ce_menu',$ligne_dernier_contenu['gmc_ce_menu']);
|
- |
|
| 485 |
$form->addElement('hidden','gmc_ce_type_contenu_table',$ligne_dernier_contenu['gmc_ce_type_contenu']);
|
- |
|
| 486 |
|
- |
|
| 487 |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
- |
|
| 488 |
$form->addElement('html', $liste_bouton_debut);
|
- |
|
| 489 |
$form->addElement('submit', 'afficheur_enregistrer_quitter', 'Enregistrer et quitter');
|
- |
|
| 490 |
$form->addElement('submit', 'afficheur_enregistrer_rester', 'Enregistrer et rester en édition');
|
- |
|
| 491 |
$form->addElement('submit', 'afficheur_enregistrer_ss_entite', 'Remplacer les entités xhtml');
|
- |
|
| 492 |
$form->addElement('submit', 'afficheur_annuler', 'Annuler');
|
- |
|
| 493 |
$liste_bouton_fin = '</ul>'."\n";
|
- |
|
| 494 |
$form->addElement('html', $liste_bouton_fin);
|
- |
|
| 495 |
|
- |
|
| 496 |
$form->setDefaults($ligne_dernier_contenu);
|
- |
|
| 497 |
|
- |
|
| 498 |
$retour .= $form->toHTML()."\n";
|
- |
|
| 499 |
|
- |
|
| 500 |
return $retour;
|
- |
|
| Line 501... |
Line 192... |
| 501 |
}
|
192 |
|
| 502 |
|
193 |
}
|
| 503 |
|
194 |
|
| 504 |
|
195 |
|
| Line 563... |
Line 254... |
| 563 |
|
254 |
|
| 564 |
|
255 |
|
| 565 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
256 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| - |
|
257 |
*
|
| - |
|
258 |
* $Log: not supported by cvs2svn $
|
| - |
|
259 |
* Revision 1.19 2006/10/16 15:49:07 ddelon
|
| 566 |
*
|
260 |
* Refactorisation code mulitlinguisme et gestion menu invisibles
|
| 567 |
* $Log: not supported by cvs2svn $
|
261 |
*
|
| 568 |
* Revision 1.18 2006/04/28 12:41:49 florian
|
262 |
* Revision 1.18 2006/04/28 12:41:49 florian
|
| 569 |
* corrections erreurs chemin
|
263 |
* corrections erreurs chemin
|
| 570 |
*
|
264 |
*
|