X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fsignatures.php;h=89cbb4e214c036fb834808bc511bc22ab96191e8;hp=f4fcfae6fee58bb9fba329cfc15a55d6ca97f955;hb=e99f0878011913365e49b30d90e496c24c301393;hpb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed diff --git a/www/ecrire/inc/signatures.php b/www/ecrire/inc/signatures.php index f4fcfae..89cbb4e 100644 --- a/www/ecrire/inc/signatures.php +++ b/www/ecrire/inc/signatures.php @@ -3,7 +3,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2011 * + * Copyright (c) 2001-2014 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -99,15 +99,8 @@ function signatures_edit($script, $id, $arg, $row) { if (!$nom_site) $nom_site = _T('info_site'); $res .= "
"._T('info_site_web')." $nom_site
\n"; } - if ($ad_email) { - $res .= "
" - ._T('info_adresse_email') - ." " - . (!email_valide($ad_email) - ? $ad_email : - ("$ad_email")) - . "
\n"; - } + + if ($ad_email) $res .= signatures_edit_mail($id_article, $ad_email, $row); $res .= "
" . message_de_signature($row) . "
"; @@ -122,7 +115,7 @@ function signatures_edit($script, $id, $arg, $row) { . $h2 . "'>" . typo($titre_a) - . "" + . "" . typo($titre_r) . " "; } @@ -144,4 +137,31 @@ function signatures_edit($script, $id, $arg, $row) { return $res; } + +function signatures_edit_mail($id_article, $ad_email, $row) { + + $email = attribut_html($ad_email); + if (email_valide($ad_email)) { + if ($row['statut'] != 'publie' + AND autoriser('modererpetition', 'article', $id_article)) { + include_spip('formulaires/signature'); + $url = generer_url_entite_absolue($id_article, 'article','','',true); + list($titre, $url) = signature_langue($id_article, $url); + + list($sujet, $corps) = signature_demande_confirmation($id_article, $url, $row['nom_email'], $row['nom_site'], $row['url_site'], $row['message'], $titre, $row['statut']); + + include_spip('inc/filtres'); + $sujet = rawurlencode(filtrer_entites($sujet)); + $corps = rawurlencode(filtrer_entites($corps)); + $corps = "?subject=$sujet&body=$corps"; + } else $corps = ''; + $email = "$email"; + } + return "
" + ._T('info_adresse_email') + ." " + . $email + . "
\n"; + +} ?>