X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fsignatures.php;fp=www%2Fecrire%2Finc%2Fsignatures.php;h=f4fcfae6fee58bb9fba329cfc15a55d6ca97f955;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c
diff --git a/www/ecrire/inc/signatures.php b/www/ecrire/inc/signatures.php
new file mode 100644
index 0000000..f4fcfae
--- /dev/null
+++ b/www/ecrire/inc/signatures.php
@@ -0,0 +1,147 @@
+ $pas) {
+ $res = navigation_pagination($t, $pas, generer_url_ecrire($script, $args), $debut, 'debut', false);
+ } else $res = '';
+
+ $limit = (!$pas AND !$debut) ? '' : (($debut ? "$debut," : "") . $pas);
+
+ $arg = "debut=$debut&type=$type";
+
+ $res .= "
\n";
+ include_spip('inc/urls');
+ $r = sql_allfetsel('*', 'spip_signatures', $where, '', $order, $limit);
+ foreach($r as $k => $row)
+ $r[$k] = signatures_edit($script, $id, $arg, $row);
+
+ return $res."
\n" . join("
\n", $r);
+}
+
+// http://doc.spip.org/@signatures_edit
+function signatures_edit($script, $id, $arg, $row) {
+
+ global $spip_lang_right, $spip_lang_left;
+ $id_signature = $row['id_signature'];
+ $id_article = $row['id_article'];
+ $date_time = $row['date_time'];
+ $nom_email= typo(echapper_tags($row['nom_email']));
+ $ad_email = echapper_tags($row['ad_email']);
+ $nom_site = typo(echapper_tags($row['nom_site']));
+ $url_site = echapper_tags($row['url_site']);
+ $statut = $row['statut'];
+
+ $res = !autoriser('modererpetition', 'article', $id_article) ? '' : true;
+
+ if ($res) {
+ if ($id) $arg .= "&id_article=$id_article";
+ $arg .= "#signature$id_signature";
+ $retour_s = redirige_action_auteur('editer_signatures', $id_signature, $script, $arg);
+ $retour_a = redirige_action_auteur('editer_signatures', "-$id_signature", $script, $arg);
+
+ if ($statut=="poubelle"){
+ $res = icone_inline (_T('icone_valider_signature'),
+ $retour_s,
+ "forum-interne-24.gif",
+ "creer.gif",
+ "right",
+ false);
+ } else {
+ $res = icone_inline (_T('icone_supprimer_signature'),
+ $retour_a,
+ "forum-interne-24.gif",
+ "supprimer.gif",
+ "right",
+ false);
+ if ($statut<>"publie") {
+ $res .= icone_inline (_T('icone_relancer_signataire'),
+ $retour_s,
+ "forum-interne-24.gif",
+ "creer.gif",
+ "right",
+ false);
+ }
+ }
+ $res = "
$res
";
+ }
+
+ $res .= "".date_interface($date_time)."
\n";
+ if ($statut=="poubelle"){
+ $res .= ""._T('info_message_efface')."
\n";
+ }
+ if (strlen($url_site)>6) {
+ if (!$nom_site) $nom_site = _T('info_site');
+ $res .= "\n";
+ }
+ if ($ad_email) {
+ $res .= ""
+ ._T('info_adresse_email')
+ ." "
+ . (!email_valide($ad_email)
+ ? $ad_email :
+ ("
$ad_email"))
+ . "
\n";
+ }
+
+ $res .= "" . message_de_signature($row) . "
";
+
+ if (!$id) {
+ if ($r = sql_fetsel("titre, id_rubrique", "spip_articles", "id_article=$id_article")) {
+ $id_rubrique = $r['id_rubrique'];
+ $titre_a = $r['titre'];
+ $titre_r = supprimer_numero(sql_getfetsel("titre", "spip_rubriques", "id_rubrique=$id_rubrique"));
+ $href = generer_url_ecrire('naviguer', "id_rubrique=" . $id_rubrique);
+ $h2 = generer_url_ecrire_article($id_article);
+ $res .= "";
+ }
+ }
+
+ $res = "\n"
+ . ($nom_site ? "$nom_site / " : "")
+ . $nom_email
+ . " |
"
+ . "\n"
+ . $res
+ . " |
\n";
+
+ if ($statut=="poubelle") {
+ $res = "";
+ }
+
+ return $res;
+}
+?>