From 905e1a8a64af27f0ac5699320b2ec44ffcbb1bdb Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Fri, 24 Sep 2010 19:32:36 +0000 Subject: [PATCH] #FORMULAIRE_CONFIGURER_BREVES remplace configuration/breves --- .gitattributes | 3 +- ecrire/configuration/breves.php | 46 ------------------- prive/formulaires/configurer_breves.html | 31 +++++++++++++ prive/formulaires/configurer_breves.php | 36 +++++++++++++++ .../contenu/page-configurer_contenu.html | 7 +-- 5 files changed, 73 insertions(+), 50 deletions(-) delete mode 100644 ecrire/configuration/breves.php create mode 100644 prive/formulaires/configurer_breves.html create mode 100644 prive/formulaires/configurer_breves.php diff --git a/.gitattributes b/.gitattributes index 6c5563ea65..592cb091c9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -79,7 +79,6 @@ ecrire/charsets/translit.php -text ecrire/charsets/translitcomplexe.php -text ecrire/configuration/annonces.php -text ecrire/configuration/avertisseur.php -text -ecrire/configuration/breves.php -text ecrire/configuration/documents.php -text ecrire/configuration/index.php -text ecrire/configuration/logos.php -text @@ -381,6 +380,8 @@ prive/editer/rubrique.html -text prive/editer/site.html -text prive/formulaires/configurer_articles.html -text prive/formulaires/configurer_articles.php -text +prive/formulaires/configurer_breves.html -text +prive/formulaires/configurer_breves.php -text prive/formulaires/configurer_identite.html -text prive/formulaires/configurer_identite.php -text prive/formulaires/configurer_langage.html -text diff --git a/ecrire/configuration/breves.php b/ecrire/configuration/breves.php deleted file mode 100644 index 233120792a..0000000000 --- a/ecrire/configuration/breves.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2010 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined("_ECRIRE_INC_VERSION")) return; - -include_spip('inc/presentation'); -include_spip('inc/config'); - -// -// Actives/desactiver les breves -// - -function configuration_breves_dist(){ - - $activer_breves = $GLOBALS['meta']["activer_breves"]; - - $res = "<table border='0' cellspacing='1' cellpadding='3' width=\"100%\">" - . "<tr><td class='verdana2'>" - . _T('texte_breves')."<br />\n" - . _T('info_breves') - . "</td></tr>" - . "<tr><td align='center' class='verdana2'>" - . afficher_choix('activer_breves', $activer_breves, - array('oui' => _T('item_utiliser_breves'), - 'non' => _T('item_non_utiliser_breves')), " ") - . "</td></tr>\n" - . "</table>\n"; - - $res = debut_cadre_trait_couleur("breve-24.png", true, "", _T('titre_breves').aide ("confbreves")) - . ajax_action_post('configuration', 'breves', 'configuration','#configurer-breves',$res) - . fin_cadre_trait_couleur(true); - - return ajax_action_greffe('configurer-breves', '', $res); - -} - -?> diff --git a/prive/formulaires/configurer_breves.html b/prive/formulaires/configurer_breves.html new file mode 100644 index 0000000000..5ad7c5eee5 --- /dev/null +++ b/prive/formulaires/configurer_breves.html @@ -0,0 +1,31 @@ +<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}"> +<h3 class='titrem'><img src="#CHEMIN_IMAGE{breve-24.png}" class="cadre-icone" /><:titre_breves:>#AIDER{confbreves}</h3> + [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>] + [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>] + [(#ENV{editable}) + <p><:texte_breves:></p> + <form method='post' action='#ENV{action}' enctype='multipart/form-data'><div> + [(#REM) declarer les hidden qui declencheront le service du formulaire + parametre : url d'action ] + #ACTION_FORMULAIRE{#ENV{action}} + <ul> + #SET{name,activer_breves}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} + <li class="long_label editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]"> + <label for="#GET{name}"><:info_breves:></label>[ + <span class='erreur_message'>(#GET{erreurs})</span> + ]<div class="choix"> + <input type="radio" name="#GET{name}" id="#GET{name}_oui" value="oui" + [(#ENV{#GET{name}}|=={oui}|oui)checked="checked"] /><label for="#GET{name}_oui"><:item_utiliser_breves:></label> + </div> + <div class="choix"> + <input type="radio" name="#GET{name}" id="#GET{name}_non" value="non" + [(#ENV{#GET{name}}|=={oui}|non)checked="checked"] /><label for="#GET{name}_non"><:item_non_utiliser_breves:></label> + </div> + </li> + </ul> + [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ] + <!--extra--> + <p class='boutons'><span class='image_loading'> </span><input type='submit' class='submit' value='<:bouton_enregistrer:>' /></p> + </div></form> + ] +</div> \ No newline at end of file diff --git a/prive/formulaires/configurer_breves.php b/prive/formulaires/configurer_breves.php new file mode 100644 index 0000000000..a03e2fc55d --- /dev/null +++ b/prive/formulaires/configurer_breves.php @@ -0,0 +1,36 @@ +<?php + +/***************************************************************************\ + * SPIP, Systeme de publication pour l'internet * + * * + * Copyright (c) 2001-2010 * + * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * + * * + * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * + * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * +\***************************************************************************/ + +if (!defined("_ECRIRE_INC_VERSION")) return; + +function formulaires_configurer_breves_charger_dist(){ + foreach(array( + "activer_breves", + ) as $m) + $valeurs[$m] = $GLOBALS['meta'][$m]; + + return $valeurs; +} + + +function formulaires_configurer_breves_traiter_dist(){ + $res = array('editable'=>true); + foreach(array( + "activer_breves", + ) as $m) + if (!is_null($v=_request($m))) + ecrire_meta($m, $v=='oui'?'oui':'non'); + + $res['message_ok'] = _T('config_info_enregistree'); + return $res; +} + diff --git a/prive/squelettes/contenu/page-configurer_contenu.html b/prive/squelettes/contenu/page-configurer_contenu.html index 5b30373897..1c08a6df42 100644 --- a/prive/squelettes/contenu/page-configurer_contenu.html +++ b/prive/squelettes/contenu/page-configurer_contenu.html @@ -8,12 +8,13 @@ #FORMULAIRE_CONFIGURER_RUBRIQUES </div> +<div class="ajax"> + #FORMULAIRE_CONFIGURER_BREVES +</div> + <?php include_spip('inc/presentation'); - $breves = charger_fonction('breves', 'configuration'); - echo $breves(); - $logos = charger_fonction('logos', 'configuration'); echo $logos(); -- GitLab