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: afficheur.admin.php,v 1.23 2007-06-26 13:30:48 jp_milcent Exp $ |
// CVS : $Id: afficheur.admin.php,v 1.22 2007-01-03 11:28:34 ddelon Exp $ |
/** |
* Gestion de la rédaction du contenu pour Papyrus. |
* |
32,7 → 32,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.23 $ $Date: 2007-06-26 13:30:48 $ |
*@version $Revision: 1.22 $ $Date: 2007-01-03 11:28:34 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
88,24 → 88,42 |
return $this->sortie_xhtml; |
} |
|
function _redigerContenu($db, $url, $adme_site_id, $adme_menu_id, $adme_action) |
{ |
function _redigerContenu($db, $url, $adme_site_id, $adme_menu_id, $adme_action) { |
|
|
$contenu=''; |
|
//------------------------------------------------------------------------------------------------------------------- |
// Initialisation de variable |
$contenu = ''; |
$donnees = array(); |
$url->addQueryString('adme_site_id', $adme_site_id); |
$url->addQueryString('adme_menu_id', $adme_menu_id); |
$url->addQueryString('adme_action', $adme_action); |
|
|
$ligne_dernier_contenu = GEN_rechercheContenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC); |
|
|
$ligne_dernier_contenu=GEN_rechercheContenu($db,$adme_menu_id,DB_FETCHMODE_ASSOC); |
|
|
// Hack : |
|
$retour = '<h1>'.'Rédaction'.'</h1>'."\n"; |
//------------------------------------------------------------------------------------------------------------------- |
// Récupération des données |
$donnees['form_url'] = str_replace('&', '&', $url->getUrl()); |
|
// Gestion de FckEditor |
$donnees['fck_editor'] = ''; |
// Création du formulaire |
$form =& new HTML_QuickForm('form_modifier_contenu', 'post', str_replace('&', '&', $url->getUrl())); |
$tab_index = 1000; |
$squelette =& $form->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'<ul>'."\n".'{content}'."\n".'</ul>'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<li>'."\n". |
'{label}'."\n". |
'{element}'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</li>'."\n"); |
//$squelette->setHeaderTemplate('<p>{header}</p>'); |
//$form->addElement('header', 'Entete', 'REDACTION');.liste_bouton li{display:inline;} |
$aso_options = array(); |
$form->addElement('hidden','gmc_ce_type_contenu',1); |
|
if ($GLOBALS['_AFFI_']['fckeditor']['utilisation']) { |
/** Inclusion du fichier de FCKeditor*/ |
require_once AFFI_CHEMIN_FCKEDITOR.'fckeditor.php'; |
112,13 → 130,16 |
$fckeditor = new FCKeditor('gmc_contenu'); |
if ($ligne_dernier_contenu['gmc_contenu']) { |
$fckeditor->Value = $ligne_dernier_contenu['gmc_contenu']; |
} else { |
} |
else { |
if ($contenu) { |
$fckeditor->Value = $contenu; |
} else { |
} |
else { |
$fckeditor->Value = ''; |
} |
} |
|
$fckeditor->Height = $GLOBALS['_AFFI_']['fckeditor']['hauteur']; |
$fckeditor->ToolbarSet = $GLOBALS['_AFFI_']['fckeditor']['barre']; |
$fckeditor->Config['CustomConfigurationsPath']=$GLOBALS['_AFFI_']['fckeditor']['CustomConfigurationsPath']; |
126,36 → 147,54 |
$fckeditor->Config['DefaultLanguage'] = $GLOBALS['_AFFI_']['fckeditor']['langue']; |
$fckeditor->BasePath = AFFI_CHEMIN_FCKEDITOR; |
if ($fckeditor->IsCompatible()) { |
$donnees['fck_editor'] = $fckeditor->CreateHtml(); |
$form->addElement('html', '<li>'.$fckeditor->CreateHtml().'</li>'); |
} else { |
$GLOBALS['_AFFI_']['fckeditor']['utilisation'] = false; |
} |
} |
|
// Identifiant du menu |
$donnees['gmc_ce_menu'] = $adme_menu_id; |
|
// Type de contenu |
// Par défaut c'est du XHTML (donc 1) |
$donnees['gmc_ce_type_contenu'] = 1; |
if (isset($ligne_dernier_contenu['gmc_ce_type_contenu'])) { |
$donnees['gmc_ce_type_contenu'] = $ligne_dernier_contenu['gmc_ce_type_contenu']; |
} |
|
//+------------------------------------------------------------------------------------------------------------+ |
// Extrait les variables et les ajoutes à l'espace de noms local |
// Gestion des squelettes |
extract($donnees); |
// Démarre le buffer |
ob_start(); |
// Inclusion du fichier |
include(AFFI_CHEMIN_SQUELETTE.'formulaire.tpl.html'); |
// Récupérer le contenu du buffer |
$contenu = ob_get_contents(); |
// Arrête et détruit le buffer |
ob_end_clean(); |
if (!$GLOBALS['_AFFI_']['fckeditor']['utilisation']) { |
$id = 'gmc_contenu'; |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => 20, 'cols' => 100); |
$label = '<label for="'.$id.'">'.'Contenu : '.'</label>'; |
$form->addElement('textarea', $id, $label, $aso_attributs); |
} |
|
return $contenu; |
$aso_options = array(); |
$aso_options[1] = 'Mineure'; |
$aso_options[2] = 'Majeure'; |
$id = 'gmc_ce_type_modification'; |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++); |
$label = '<label for="'.$id.'">'.'Type de modification : '.'</label>'; |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs); |
|
$id = 'gmc_resume_modification'; |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => 45, 'maxlength' => 255); |
$label = '<label for="'.$id.'">'.'Resumé modification : '.'</label>'; |
$form->addElement('text', $id, $label, $aso_attributs); |
$ligne_dernier_contenu['gmc_ce_menu']=$adme_menu_id; |
$form->addElement('hidden','gmc_ce_menu',$ligne_dernier_contenu['gmc_ce_menu']); |
$form->addElement('hidden','gmc_ce_type_contenu_table',$ligne_dernier_contenu['gmc_ce_type_contenu']); |
|
// .liste_bouton li{display:inline;} |
|
$liste_bouton_debut = '<ul class="liste_bouton">'."\n"; |
$form->addElement('html', $liste_bouton_debut); |
$form->addElement('submit', 'afficheur_enregistrer_quitter', 'Enregistrer et quitter'); |
$form->addElement('submit', 'afficheur_enregistrer_rester', 'Enregistrer et rester en édition'); |
$form->addElement('submit', 'afficheur_annuler', 'Annuler'); |
$liste_bouton_fin = '</ul>'."\n"; |
$form->addElement('html', $liste_bouton_fin); |
|
$form->setDefaults($ligne_dernier_contenu); |
|
$retour .= $form->toHTML()."\n"; |
|
return $retour; |
|
|
} |
|
|
/** Méthode ajouterContenu() - Enregistre les infos du formulaire de saisie d'un menu |
* |
* |
166,6 → 205,7 |
//------------------------------------------------------------------------------------------------------------------- |
// Récupération des informations du contenu concerné. |
$ligne_menu = GEN_lireInfoMenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC); |
|
|
if ($ligne_menu == false) { |
die('ERREUR Papyrus Administrateur de Menus: impossible de lire les infos du menu.<br />'. |
218,9 → 258,6 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.22 2007-01-03 11:28:34 ddelon |
* correction bug multilinguisme (portage bug livraison) |
* |
* Revision 1.21 2006/12/01 16:59:45 florian |
* Ajout d'une variable parametrant la recherche de balise d'applette dans le contenu généré par l'appli. |
* |