Author: pierre.basson@gmail.com
Date: Mon Jul 17 12:04:23 2006
New Revision: 4040
Log:
- l'interface d'admin est en place mm s'il reste des améliorations à apporter sur l'ergonomie (demain !)
- à vos tests si ça vous intéresse...
Added:
_plugins_/_contenu_editorial_/spip-sondages/exec/choix_edition.php
_plugins_/_contenu_editorial_/spip-sondages/exec/sondages_edition.php
_plugins_/_contenu_editorial_/spip-sondages/exec/sondages_visualisation.php
_plugins_/_contenu_editorial_/spip-sondages/img_pack/choix.png (with props)
_plugins_/_contenu_editorial_/spip-sondages/img_pack/periode.png (with props)
Modified:
_plugins_/_contenu_editorial_/spip-sondages/base/sondages.php
_plugins_/_contenu_editorial_/spip-sondages/exec/sondages.php
_plugins_/_contenu_editorial_/spip-sondages/formulaire_sondage.html
_plugins_/_contenu_editorial_/spip-sondages/inc/sondages_admin.php
_plugins_/_contenu_editorial_/spip-sondages/inc/sondages_fonctions.php
_plugins_/_contenu_editorial_/spip-sondages/resultat_sondage.html
Modified: _plugins_/_contenu_editorial_/spip-sondages/base/sondages.php
--- _plugins_/_contenu_editorial_/spip-sondages/base/sondages.php (original)
+++ _plugins_/_contenu_editorial_/spip-sondages/base/sondages.php Mon Jul 17 12:04:23 2006
@@ -48,7 +48,7 @@
$spip_choix = array(
"id_choix" => "bigint(21) NOT NULL",
"id_sondage" => "bigint(21) NOT NULL",
- "id_parent" => "bigint(21) NOT NULL default '0'",
+ "ordre" => "bigint(21) NOT NULL default '0'",
"titre" => "text NOT NULL"
);
$spip_choix_key = array(
@@ -176,6 +176,21 @@
$boucle->where[]= array("'='", "'$id_table.statut'", "'\"publie\"'");
}
}
+
+ return calculer_boucle($id_boucle, $boucles);
+ }
+
+
+ //
+ // <BOUCLE(CHOIX)>
+ //
+ function boucle_CHOIX_dist($id_boucle, &$boucles) {
+ $boucle = &$boucles[$id_boucle];
+ $id_table = $boucle->id_table;
+ $boucle->from[$id_table] = "spip_choix";
+
+ $boucle->default_order[] = "'$id_table.ordre ASC'" ;
+
return calculer_boucle($id_boucle, $boucles);
}
Added: _plugins_/_contenu_editorial_/spip-sondages/exec/choix_edition.php
--- _plugins_/_contenu_editorial_/spip-sondages/exec/choix_edition.php (added)
+++ _plugins_/_contenu_editorial_/spip-sondages/exec/choix_edition.php Mon Jul 17 12:04:23 2006
@@ -0,0 +1,102 @@
+<?php
+
+
+ /**
+ * SPIP-Sondages : plugin de gestion de sondages
+ *
+ * Copyright (c) 2006
+ * Agence Artégo http://www.artego.fr
+ *
+ * Ce programme est un logiciel libre distribue sous licence GNU/GPL.
+ * Pour plus de details voir le fichier COPYING.txt.
+ *
+ **/
+
+
+ include_spip('inc/sondages_fonctions');
+ include_spip('inc/sondages_admin');
+ include_spip('inc/presentation');
+
+
+ function exec_choix_edition() {
+
+ sondages_verifier_droits();
+
+ if (empty($_GET['id_sondage'])) {
+ $url = generer_url_ecrire('sondages', '', '&');
+ sondages_rediriger_javascript($url);
+ }
+
+ $id_sondage = intval($_GET['id_sondage']);
+
+ if (!empty($_GET['id_choix'])) {
+ $id_choix = intval($_GET['id_choix']);
+ $result = spip_query('SELECT * FROM spip_choix WHERE id_choix="'.$id_choix.'"');
+ if (!$choix = spip_fetch_array($result)) die('erreur');
+ $titre = $choix['titre'];
+ $ordre = $choix['ordre'];
+ } else {
+ $new = true;
+ $id_choix = -1;
+ $resultat_nb_choix = spip_query('SELECT id_choix FROM spip_choix WHERE id_sondage="'.$id_sondage.'"');
+ $ordre = intval(spip_num_rows($resultat_nb_choix));
+ $titre = _T('sondages:nouveau_choix');
+ $onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
+ }
+
+ debut_page(_T('sondages:choix'), "naviguer", "sondages");
+
+ debut_gauche();
+
+
+ debut_droite();
+ echo "<br />";
+ debut_cadre_formulaire();
+ echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
+ echo "<tr width='100%'>";
+ echo "<td>";
+ icone(_T('icone_retour'), generer_url_ecrire("sondages_visualisation", "id_sondage=$id_sondage"), '../'._DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', "rien.gif");
+
+ echo "</td>";
+ echo "<td>". http_img_pack('rien.gif', " ", "width='10'") . "</td>\n";
+ echo "<td width='100%'>";
+ echo _T('sondages:editer_choix');
+ gros_titre($titre);
+ echo "</td></tr></table>";
+
+ echo "<P><HR></P>";
+
+ echo generer_url_post_ecrire("sondages_visualisation", "id_sondage=$id_sondage&id_choix=$id_choix", 'formulaire');
+
+ echo "<P><B>"._T('sondages:titre')."</B>";
+ echo "<BR><INPUT TYPE='text' NAME='titre' style='font-weight: bold; font-size: 13px;' CLASS='formo' VALUE=\"$titre\" SIZE='40' $onfocus>";
+
+ echo "<P>"._T('sondages:position')."<br />";
+ echo "<select name='position' CLASS='fondl'>";
+ $i = 0;
+ echo '<option value="'.$i++.'" ';
+ if ($ordre == 0) echo 'selected';
+ echo '>'._T('sondages:en_premier').'</option>';
+ $requete_autres_choix = 'SELECT * FROM spip_choix WHERE id_sondage="'.$id_sondage.'" AND id_choix!="'.$id_choix.'" ORDER BY ordre';
+ $resultat_autres_choix = spip_query($requete_autres_choix);
+ while ($arr = spip_fetch_array($resultat_autres_choix)) {
+ echo '<option value="'.$i.'" ';
+ if ($ordre == $i) echo 'selected';
+ echo '>'._T('sondages:apres').' '.$arr['titre'].'</option>';
+ $i++;
+ }
+ echo "</select></P>\n";
+
+ echo "<DIV ALIGN='right'>";
+ echo "<INPUT CLASS='fondo' TYPE='submit' NAME='enregistrer_choix' VALUE='"._T('sondages:enregistrer')."'>";
+ echo "</DIV></FORM>";
+
+ fin_cadre_formulaire();
+
+ fin_page();
+
+ }
+
+
+
+?>
\ No newline at end of file
Modified: _plugins_/_contenu_editorial_/spip-sondages/exec/sondages.php
--- _plugins_/_contenu_editorial_/spip-sondages/exec/sondages.php (original)
+++ _plugins_/_contenu_editorial_/spip-sondages/exec/sondages.php Mon Jul 17 12:04:23 2006
@@ -31,19 +31,21 @@
debut_page(_T('sondages:sondages'), "naviguer", "sondages");
+ debut_gauche();
-# debut_gauche();
-
-
-# debut_raccourcis();
-# fin_raccourcis();
+ sondages_afficher_statistiques_globales();
+# sondages_afficher_recherche('sondages');
+ debut_raccourcis();
+ sondages_afficher_raccourci_creer_sondage();
+ fin_raccourcis();
debut_droite();
- echo "<br />";
- gros_titre(_T('sondages:sondages'));
echo '<br />';
-
+ sondages_afficher_sondages(_T('sondages:sondages_hors_ligne'), _DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', 'non', 'brouillon', $recherche, 'position_hors_ligne');
+ sondages_afficher_sondages(_T('sondages:sondages_en_attente'), _DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', 'oui', 'en_attente', $recherche, 'position_en_attente');
+ sondages_afficher_sondages(_T('sondages:sondages_publies'), _DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', 'oui', 'publie', $recherche, 'position_publie');
+ sondages_afficher_sondages(_T('sondages:sondages_termines'), _DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', 'oui', 'termine', $recherche, 'position_termine');
fin_page();
Added: _plugins_/_contenu_editorial_/spip-sondages/exec/sondages_edition.php
--- _plugins_/_contenu_editorial_/spip-sondages/exec/sondages_edition.php (added)
+++ _plugins_/_contenu_editorial_/spip-sondages/exec/sondages_edition.php Mon Jul 17 12:04:23 2006
@@ -0,0 +1,118 @@
+<?php
+
+
+ /**
+ * SPIP-Sondages : plugin de gestion de sondages
+ *
+ * Copyright (c) 2006
+ * Agence Artégo http://www.artego.fr
+ *
+ * Ce programme est un logiciel libre distribue sous licence GNU/GPL.
+ * Pour plus de details voir le fichier COPYING.txt.
+ *
+ **/
+
+
+ include_spip('inc/sondages_fonctions');
+ include_spip('inc/sondages_admin');
+ include_spip('inc/presentation');
+ include_spip('inc/barre');
+ include_spip('inc/documents');
+ include_spip('inc/rubriques');
+
+
+ function exec_sondages_edition() {
+ global $champs_extra;
+
+ sondages_verifier_droits();
+
+ $id_sondage = intval($_GET['id_sondage']);
+
+ if (!empty($_GET['id_sondage'])) {
+ $result = spip_query('SELECT * FROM spip_sondages WHERE id_sondage="'.$id_sondage.'"');
+ if (!$sondage = spip_fetch_array($result)) die('erreur');
+ $id_rubrique = $sondage['id_rubrique'];
+ $titre = $sondage['titre'];
+ $texte = $sondage['texte'];
+ $type = $sondage['type'];
+ $extra = $sondage['extra'];
+ } else {
+ $new = true;
+ $id_sondage = -1;
+ $titre = _T('sondages:nouveau_sondage');
+ $onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
+ $lang = $GLOBALS['meta']['langue_site'];
+ }
+
+ debut_page(_T('sondages:sondages'), "naviguer", "sondages");
+
+ debut_gauche();
+ if (!$new) {
+ maj_documents($id_sondage, 'sondage');
+ afficher_documents_colonne($id_sondage, "sondage", true);
+ }
+
+
+ debut_droite();
+ echo "<br />";
+ debut_cadre_formulaire();
+ echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
+ echo "<tr width='100%'>";
+ echo "<td>";
+ if ($new)
+ icone(_T('icone_retour'), generer_url_ecrire("sondages"), '../'._DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', "rien.gif");
+ else
+ icone(_T('icone_retour'), generer_url_ecrire("sondages_visualisation", "id_sondage=$id_sondage"), '../'._DIR_PLUGIN_SONDAGES.'/img_pack/sondages-24.png', "rien.gif");
+
+ echo "</td>";
+ echo "<td>". http_img_pack('rien.gif', " ", "width='10'") . "</td>\n";
+ echo "<td width='100%'>";
+ echo _T('sondages:editer_sondage');
+ gros_titre($titre);
+ echo "</td></tr></table>";
+
+ echo "<P><HR></P>";
+
[... 1074 lines stripped ...]