5 * Distribue sous licence GPL
10 if (!defined('_ECRIRE_INC_VERSION')) {
14 // Fonction appelee par divers pipelines
15 // http://code.spip.net/@notifications_instituerarticle_dist
16 function notifications_instituerarticle_dist($quoi, $id_article, $options) {
18 // ne devrait jamais se produire
19 if ($options['statut'] == $options['statut_ancien']) {
20 spip_log('statut inchange', 'notifications');
25 include_spip('inc/texte');
28 if ($options['statut'] == 'publie') {
29 if ($GLOBALS['meta']['post_dates'] == 'non'
30 and strtotime($options['date']) > time()
32 $modele = 'notifications/article_valide';
34 $modele = 'notifications/article_publie';
38 if ($options['statut'] == 'prop' and $options['statut_ancien'] != 'publie') {
39 $modele = 'notifications/article_propose';
43 $destinataires = array();
44 if ($GLOBALS['meta']['suivi_edito'] == 'oui') {
45 $destinataires = explode(',', $GLOBALS['meta']['adresse_suivi']);
49 $destinataires = pipeline(
50 'notifications_destinataires',
52 'args' => array('quoi' => $quoi, 'id' => $id_article, 'options' => $options),
53 'data' => $destinataires
57 $texte = email_notification_article($id_article, $modele);
58 notifications_envoyer_mails($destinataires, $texte);