[PLUGINS] +abomailman
authorLudovic CHEVALIER <tenshi20@no-log.org>
Sat, 1 Feb 2014 18:40:49 +0000 (19:40 +0100)
committerLudovic CHEVALIER <tenshi20@no-log.org>
Sat, 1 Feb 2014 18:40:49 +0000 (19:40 +0100)
129 files changed:
www/plugins/abomailmans/abomailman_template.html [new file with mode: 0644]
www/plugins/abomailmans/abomailmans_administrations.php [new file with mode: 0644]
www/plugins/abomailmans/abomailmans_autoriser.php [new file with mode: 0755]
www/plugins/abomailmans/abomailmans_fonctions.php [new file with mode: 0755]
www/plugins/abomailmans/abomailmans_pipelines.php [new file with mode: 0755]
www/plugins/abomailmans/base/abomailmans_install.php [new file with mode: 0755]
www/plugins/abomailmans/content/newsletter.html [new file with mode: 0644]
www/plugins/abomailmans/contenu/page-newsletter.html [new file with mode: 0644]
www/plugins/abomailmans/controleurs/abomailman_descriptif.html [new file with mode: 0644]
www/plugins/abomailmans/controleurs/abomailman_titre.html [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman.php [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman_envoi_liste.html [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman_envoi_liste.php [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.html [new file with mode: 0644]
www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.php [new file with mode: 0644]
www/plugins/abomailmans/formulaires/editer_abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/formulaires/editer_abomailman.php [new file with mode: 0644]
www/plugins/abomailmans/formulaires/inc-previsu_mail.html [new file with mode: 0644]
www/plugins/abomailmans/genie/abomailmans_envois.php [new file with mode: 0755]
www/plugins/abomailmans/inc/abomailmans.php [new file with mode: 0755]
www/plugins/abomailmans/lang/abomailmans.xml [new file with mode: 0644]
www/plugins/abomailmans/lang/abomailmans_de.php [new file with mode: 0644]
www/plugins/abomailmans/lang/abomailmans_en.php [new file with mode: 0755]
www/plugins/abomailmans/lang/abomailmans_es.php [new file with mode: 0644]
www/plugins/abomailmans/lang/abomailmans_fr.php [new file with mode: 0755]
www/plugins/abomailmans/lang/abomailmans_sk.php [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans.xml [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans_de.php [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans_en.php [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans_es.php [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans_fr.php [new file with mode: 0644]
www/plugins/abomailmans/lang/paquet-abomailmans_sk.php [new file with mode: 0644]
www/plugins/abomailmans/paquet.xml [new file with mode: 0644]
www/plugins/abomailmans/prive/listes/abomailman_mots.html [new file with mode: 0644]
www/plugins/abomailmans/prive/listes/abomailman_rubriques.html [new file with mode: 0644]
www/plugins/abomailmans/prive/listes/abomailman_templates.html [new file with mode: 0755]
www/plugins/abomailmans/prive/listes/listes_des_listes.html [new file with mode: 0644]
www/plugins/abomailmans/prive/objets/contenu/abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/prive/objets/infos/abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/contenu/abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/contenu/abomailman_edit.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/contenu/abomailman_envoyer.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/contenu/abomailmans.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/navigation/abomailman.html [new file with mode: 0644]
www/plugins/abomailmans/prive/squelettes/navigation/abomailmans.html [new file with mode: 0644]
www/plugins/abomailmans/prive/style_prive_plugin_abomailmans.html [new file with mode: 0644]
www/plugins/abomailmans/prive/themes/spip/images/abomailmans-16.png [new file with mode: 0755]
www/plugins/abomailmans/prive/themes/spip/images/abomailmans-24.png [new file with mode: 0644]
www/plugins/abomailmans/prive/themes/spip/images/abomailmans-32.png [new file with mode: 0644]
www/plugins/abomailmans/prive/themes/spip/images/abomailmans-envoyer-24.png [new file with mode: 0644]
www/plugins/abomailmans/prive/themes/spip/images/abomailmans-new-16.png [new file with mode: 0644]
www/plugins/abomailmans/svn.revision [new file with mode: 0644]
www/plugins/abomailmans/templates/nouveautes.html [new file with mode: 0755]
www/plugins/abomailmans/templates/nouveautes.txt.html [new file with mode: 0644]
www/plugins/abomailmans/templates/nouveautes_fr_en.html [new file with mode: 0644]
www/plugins/abomailmans/templates/nouveautes_fr_en.txt.html [new file with mode: 0644]
www/plugins/facteur/classes/facteur.php [new file with mode: 0755]
www/plugins/facteur/emails/css.html [new file with mode: 0755]
www/plugins/facteur/emails/inc-bas.html [new file with mode: 0755]
www/plugins/facteur/emails/inc-button.html [new file with mode: 0644]
www/plugins/facteur/emails/inc-haut.html [new file with mode: 0755]
www/plugins/facteur/emails/test_email_html.html [new file with mode: 0755]
www/plugins/facteur/emails/test_email_texte.html [new file with mode: 0755]
www/plugins/facteur/emails/texte.html [new file with mode: 0644]
www/plugins/facteur/erreurs et exceptions.txt [new file with mode: 0644]
www/plugins/facteur/facteur_administrations.php [new file with mode: 0755]
www/plugins/facteur/facteur_fonctions.php [new file with mode: 0755]
www/plugins/facteur/facteur_ieconfig_metas.php [new file with mode: 0644]
www/plugins/facteur/facteur_pipelines.php [new file with mode: 0644]
www/plugins/facteur/formulaires/configurer_facteur.html [new file with mode: 0644]
www/plugins/facteur/formulaires/configurer_facteur.php [new file with mode: 0644]
www/plugins/facteur/inc/envoyer_mail.php [new file with mode: 0644]
www/plugins/facteur/inc/facteur_classes.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur.xml [new file with mode: 0644]
www/plugins/facteur/lang/facteur_de.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_en.php [new file with mode: 0755]
www/plugins/facteur/lang/facteur_es.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_fr.php [new file with mode: 0755]
www/plugins/facteur/lang/facteur_nl.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_sk.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur.xml [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_de.php [new file with mode: 0755]
www/plugins/facteur/lang/paquet-facteur_en.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_es.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_fr.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_nl.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_ru.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_sk.php [new file with mode: 0644]
www/plugins/facteur/lib/markdownify/LICENSE_LGPL.txt [new file with mode: 0644]
www/plugins/facteur/lib/markdownify/markdownify.php [new file with mode: 0644]
www/plugins/facteur/lib/markdownify/markdownify_extra.php [new file with mode: 0644]
www/plugins/facteur/lib/markdownify/parsehtml/parsehtml.php [new file with mode: 0644]
www/plugins/facteur/paquet.xml [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/LICENSE [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/README [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/class.phpmailer.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/class.pop3.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/class.smtp.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ar.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-br.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ca.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ch.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-cz.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-de.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-dk.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-es.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-et.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fi.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fo.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fr.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hu.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-it.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ja.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-nl.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-no.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pl.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ro.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ru.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-se.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-tr.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh_cn.php [new file with mode: 0755]
www/plugins/facteur/prive/squelettes/contenu/configurer_facteur.html [new file with mode: 0644]
www/plugins/facteur/prive/themes/spip/images/facteur-16.png [new file with mode: 0644]
www/plugins/facteur/prive/themes/spip/images/facteur-24.png [new file with mode: 0644]
www/plugins/facteur/prive/themes/spip/images/facteur-32.png [new file with mode: 0644]
www/plugins/facteur/svn.revision [new file with mode: 0644]

diff --git a/www/plugins/abomailmans/abomailman_template.html b/www/plugins/abomailmans/abomailman_template.html
new file mode 100644 (file)
index 0000000..fa40a36
--- /dev/null
@@ -0,0 +1,6 @@
+#CACHE{0}\r
+[(#ENV{envoi_txt}|non)\r
+       <INCLURE{fond=templates/#ENV{template},env}>]\r
+[(#ENV{envoi_txt}|oui|et{#CHEMIN{templates/#ENV{template}.txt.html}|oui})\r
+       <INCLURE{fond=templates/#ENV{template}.txt,env}>\r
+]
\ No newline at end of file
diff --git a/www/plugins/abomailmans/abomailmans_administrations.php b/www/plugins/abomailmans/abomailmans_administrations.php
new file mode 100644 (file)
index 0000000..86fa3cf
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+function abomailmans_upgrade($nom_meta_base_version,$version_cible){
+       
+       $maj = array();
+       
+       $maj['create'] = array(
+               array('creer_base'),
+       );
+       
+       $maj['0.30'] = array(array('maj_tables',array('spip_abomailmans')));
+       $maj['0.31'] = array(array('maj_tables',array('spip_abomailmans')));
+       $maj['0.32'] = array(array('maj_tables',array('spip_abomailmans')));
+       $maj['0.33'] = array(array('maj_tables',array('spip_abomailmans')));
+       $maj['0.34'] = array(array('maj_tables',array('spip_abomailmans')));
+       include_spip('base/upgrade');
+       maj_plugin($nom_meta_base_version, $version_cible, $maj);
+}
+
+function abomailmans_vider_tables($nom_meta_base_version) {
+       include_spip('base/abstract_sql');
+       sql_drop_table("spip_abomailmans");
+       effacer_meta($nom_meta_base_version);
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/abomailmans_autoriser.php b/www/plugins/abomailmans/abomailmans_autoriser.php
new file mode 100755 (executable)
index 0000000..ec860f9
--- /dev/null
@@ -0,0 +1,32 @@
+<?php\r
+/**\r
+ * Abomailmans\r
+ * MaZiaR - NetAktiv\r
+ * tech@netaktiv.com\r
+ * © 2007 - 2012\r
+ */\r
+\r
+/**\r
+ * Fonction pour le pipeline, n'a rien a effectuer\r
+ *\r
+*/\r
+function abomailmans_autoriser(){}\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+// autorisation des boutons\r
+function autoriser_abomailman_bouton_dist($faire, $type, $id, $qui, $opt) {\r
+       spip_log('bouton autoriser','test');\r
+       return autoriser('modifier', $type, $id, $qui, $opt);\r
+}\r
+\r
+function autoriser_abomailman_creer_dist($faire, $type, $id, $qui, $opt){\r
+       spip_log('creer autoriser','test');\r
+       return autoriser('modifier', $type, $id, $qui, $opt);\r
+}\r
+\r
+function autoriser_abomailman_modifier_dist($faire, $type, $id, $qui, $opt){\r
+       return ($qui['statut']=='0minirezo')  AND !$qui['restreint'];\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/abomailmans_fonctions.php b/www/plugins/abomailmans/abomailmans_fonctions.php
new file mode 100755 (executable)
index 0000000..3b8aa9a
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/*
+ * Abomailmans
+ * MaZiaR - NetAktiv
+ * tech@netaktiv.com
+ * Printemps 2007 - 2012
+ * $Id: abomailmans_fonctions.php 58718 2012-02-20 13:00:39Z root $
+*/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+function nettoie_chemin($chemin){
+       $liste = explode ("/", $chemin);
+       $dernier=count($liste)-1;
+       $chemin = str_replace('.html','',$liste[$dernier]);
+       $liste2 = explode('&',$chemin);
+       $chemin = $liste2[0];
+       return $chemin;
+}
+
+function noextension($chemin){
+       return str_replace('.html','',$chemin);
+}
+
+function recup_param($chemin){
+       $a = explode('&', $chemin);
+       $i = 1;
+       while ($i < count($a)) { 
+           $retour.= "&".htmlspecialchars(urldecode($a[$i]));
+           $i++;
+       }       
+       return $retour;
+}
+
+function array_param($params){
+       parse_str($params,$output);
+       return $output; 
+}
+
+function moins30($date) {
+       $moins30 = date('Y-m-d h:m:s', time()-24*3600*30);  
+       return $moins30;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/abomailmans_pipelines.php b/www/plugins/abomailmans/abomailmans_pipelines.php
new file mode 100755 (executable)
index 0000000..4ab2a0d
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/*
+ * Abomailmans
+ * MaZiaR - NetAktiv
+ * tech@netaktiv.com
+ * Printemps 2007 - 2012
+ * $Id: abomailmans_interface.php 31752 2009-09-23 00:09:48Z kent1@arscenic.info $
+*/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+/**
+ * 
+ * Declarer la tache cron de abomailman lente (messagerie de l'espace prive)
+ * @param array $taches_generales
+ * @return array 
+ */
+function abomailmans_taches_generales_cron($taches_generales){
+       $taches_generales['abomailmans_envois'] = 60 * 10; // toutes les 10 minutes
+       return $taches_generales;
+}
+
+
+// Initialise les reglages sous forme de tableau
+function abomailmans_go($x) {
+       if (!is_array($GLOBALS['abomailmans']   = @unserialize($GLOBALS['meta']['abomailmans'])))
+               $GLOBALS['abomailmans'] = array();
+       return $x;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/base/abomailmans_install.php b/www/plugins/abomailmans/base/abomailmans_install.php
new file mode 100755 (executable)
index 0000000..390d9b0
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/*
+ * Abomailmans
+ * MaZiaR - NetAktiv
+ * tech@netaktiv.com
+ * © 2007 - 2012
+ * $Id: abomailmans_install.php 60007 2012-04-02 13:00:22Z root $
+*/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+function abomailmans_declarer_tables_interfaces($interface){
+       $interface['table_des_tables']['abomailmans'] = 'abomailmans';
+       return $interface;
+}
+
+function abomailmans_declarer_tables_objets_sql($tables){
+       $tables['spip_abomailmans'] = array(
+               'page' => 'abomailman',
+               'url_edit' => 'abomailman_edit',
+               'editable' => 'oui',
+               'texte_retour' => 'abomailmans:icone_retour_abomailman',
+               'texte_objet' => 'abomailmans:abomailman',
+               'texte_objets' => 'abomailmans:abomailmans',
+               'texte_modifier' => 'abomailmans:icone_modifier_abomailman',
+               'texte_creer' => 'abomailmans:nouveau_abomailman',
+               'info_aucun_objet'=> 'abomailmans:info_abomailman_aucun',
+               'info_1_objet' => 'abomailmans:info_abomailmans_1',
+               'info_nb_objets' => 'abomailmans:info_abomailmans_nb',
+               'icone_objet' => 'abomailmans-24',
+               'titre' => "titre, '' AS lang",
+               'principale' => 'oui',
+               'champs_editables' => array('titre','descriptif','abo_type','email','email_sympa','email_subscribe','email_unsubscribe','modele_defaut','periodicite','lang','desactive'),
+               'field'=> array(
+                       "id_abomailman" => "bigint(21) NOT NULL",
+                       "titre"         => "varchar(255) NOT NULL",
+                       "descriptif"    => "text",
+                       "abo_type" => "varchar(255) DEFAULT 'news' NOT NULL",
+                       "email"         => "varchar(255)",
+                       "email_sympa"   => "varchar(255) DEFAULT '' NOT NULL",
+                       "email_subscribe"   => "varchar(255)",
+                       "email_unsubscribe" => "varchar(255)",
+                       "modele_defaut" => "varchar(255) DEFAULT '' NOT NULL",
+                       "periodicite" => "varchar(255) DEFAULT '' NOT NULL",
+                       "maj"           => "TIMESTAMP",
+                       "date_envoi"    => "TIMESTAMP",
+                       "lang"          => "VARCHAR(10) DEFAULT '' NOT NULL",
+                       "desactive"     => "tinyint(4) NOT NULL default '0'"
+               ),
+               'key' => array(
+                       "PRIMARY KEY"   => "id_abomailman"
+               ),
+               'rechercher_champs' => array(
+                       'titre' => 8,
+                       'descriptif' => 8
+               ),
+               'champs_versionnes' => array('titre', 'descriptif', 'email', 'email_sympa', 'email_subscribe', 'email_unsubscribe', 'modele_defaut','periodicite','lang','desactive')
+       );
+       return $tables;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/content/newsletter.html b/www/plugins/abomailmans/content/newsletter.html
new file mode 100644 (file)
index 0000000..49cb394
--- /dev/null
@@ -0,0 +1,10 @@
+[(#REM) Fil d'Ariane ]
+<p id="hierarchie"><a href="#URL_SITE_SPIP/"><:accueil_site:></a><span class="sep"> &gt; </span><strong class="on"><:abomailmans:bouton_listes_diffusion:></strong></p>
+
+<div class="contenu-principal">
+       <div class="cartouche">
+    </div>
+    <div class="formulaire_abomailman ajax">\r
+        #FORMULAIRE_ABOMAILMAN\r
+    </div>
+</div>
diff --git a/www/plugins/abomailmans/contenu/page-newsletter.html b/www/plugins/abomailmans/contenu/page-newsletter.html
new file mode 100644 (file)
index 0000000..49cb394
--- /dev/null
@@ -0,0 +1,10 @@
+[(#REM) Fil d'Ariane ]
+<p id="hierarchie"><a href="#URL_SITE_SPIP/"><:accueil_site:></a><span class="sep"> &gt; </span><strong class="on"><:abomailmans:bouton_listes_diffusion:></strong></p>
+
+<div class="contenu-principal">
+       <div class="cartouche">
+    </div>
+    <div class="formulaire_abomailman ajax">\r
+        #FORMULAIRE_ABOMAILMAN\r
+    </div>
+</div>
diff --git a/www/plugins/abomailmans/controleurs/abomailman_descriptif.html b/www/plugins/abomailmans/controleurs/abomailman_descriptif.html
new file mode 100644 (file)
index 0000000..0a8dbaf
--- /dev/null
@@ -0,0 +1,13 @@
+[(#REM)
+
+       Controleur pour le crayon 'abomailman_descriptif' , uniquement html
+       
+       Permet de bénéficier du plugin multilang
+
+]
+#CACHE{0}
+<BOUCLE_a(ABOMAILMANS){id_abomailman}>
+<textarea class="crayon-active multilang" name="#ENV{name_descriptif}"
+ style="width:#ENV{largeur}px; height:#ENV{hauteur}px;#ENV{style}">
+[(#DESCRIPTIF**|entites_html)]</textarea>
+</BOUCLE_a>
diff --git a/www/plugins/abomailmans/controleurs/abomailman_titre.html b/www/plugins/abomailmans/controleurs/abomailman_titre.html
new file mode 100644 (file)
index 0000000..037d064
--- /dev/null
@@ -0,0 +1,13 @@
+[(#REM)
+
+       Controleur pour le crayon 'abomailman_titre', uniquement html
+
+       Permet de bénéficier du plugin multilang
+       
+]
+#CACHE{0}
+
+<BOUCLE_a(ABOMAILMANS){id_abomailman}>
+<input class="crayon-active multilang" name="#ENV{name_titre}"
+ style="width:#ENV{largeur}px;#ENV{style}" value="[(#TITRE**)]" />
+</BOUCLE_a>
diff --git a/www/plugins/abomailmans/formulaires/abomailman.html b/www/plugins/abomailmans/formulaires/abomailman.html
new file mode 100644 (file)
index 0000000..112a8cc
--- /dev/null
@@ -0,0 +1,72 @@
+<div class="formulaire_spip formulaire_#FORM" id="formulaire_#FORM">
+       [<div class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</div>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+       <BOUCLE_editable(CONDITION){si #ENV{editable}|oui}>
+       <B_listes>
+       #SET{abo_types,#ARRAY}
+       <BOUCLE_types(ABOMAILMANS){id_abomailman?}{desactive=0}{fusion abo_type}>
+       [(#SET{abo_types,[(#GET{abo_types}|push{#ABO_TYPE})]})]
+       </BOUCLE_types>
+       [(#GET{abo_types}|count|>{1}|oui)
+               [(#SET{legende,<:abomailmans:inscription_lettres_legende:>})]
+       ]
+       [(#GET{abo_types}|count|=={1}|oui)
+               [(#GRAND_TOTAL|>{1}|oui)
+                       [(#SET{legende,[(#VAL{abomailmans:legende_inscriptions_}|concat{#GET{abo_types}|table_valeur{0}}|_T)]})]
+               ]
+               [(#GRAND_TOTAL|>{1}|non)
+                       [(#SET{legende,[(#VAL{abomailmans:legende_inscription_}|concat{#GET{abo_types}|table_valeur{0}}|_T)]})]
+               ]
+       ]
+       <form method='post' action='#ENV{action}' enctype='multipart/form-data' id='abomailmansListes'>
+               <div>
+               [(#REM) declarer les hidden qui declencheront le service du formulaire
+               parametre : url d'action ]
+               #ACTION_FORMULAIRE{#ENV{action}}
+               <fieldset>
+                       <legend>#GET{legende}</legend>
+                               <ul>
+                                       <li class="editer abomailman_nom[ (#ENV**{erreurs}|table_valeur{nom}|oui)erreur]">
+                                               <label for="nom"><:abomailmans:nom:></label>
+                                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{nom})</span>]
+                                               <input name="nom" id="nom" type="text" class="text" value="#ENV{nom}" />
+                                       </li>
+                                       <li class="editer obligatoire abomailman_email[ (#ENV**{erreurs}|table_valeur{email}|oui)erreur]">
+                                               <label for="email_listes"><:abomailmans:email_abonnement:></label>
+                                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{email})</span>]
+                                               <input name="email" id="email_listes" type="text" class="text" value="#ENV{email}" />
+                                       </li>
+                                       
+                                       <li class="editer abomailman_listes[ (#ENV**{erreurs}|table_valeur{listes}|oui)erreur]">
+                                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{listes})</span>]
+                                               <ul>
+                                                       <li class="editer editer_listes">
+                                                       <BOUCLE_listes(ABOMAILMANS){id_abomailman ?}{desactive=0}{par num titre,titre}>
+                                                       <div class="choix">
+                                                               [<p class="explication #EDIT{descriptif}">
+                                                               (#DESCRIPTIF|PtoBR)
+                                                               </p>]
+                                                               <input name="listes[]" type="checkbox" id="liste_#ID_ABOMAILMAN" value="#ID_ABOMAILMAN"[(#GRAND_TOTAL|=={1}|oui) checked="checked"] />
+                                                               <label for="liste_#ID_ABOMAILMAN" class="#EDIT{titre}} #LANG" lang="#LANG"[ title="(#LANG|traduire_nom_langue)"]>#TITRE</label>
+                                                       </div>
+                                                       </BOUCLE_listes>
+                                                       </li>
+                                               </ul>
+                                       </li>
+                                               
+                               </ul>
+                               [(#REM) Piege a robots spammeurs, du moins on essaie]
+                               <p style="display:none;">
+                                       <label for="nobot_abomailman"><:antispam_champ_vide:></label>
+                                       <input type="text" class="text" name="nobot" id="nobot_abomailman" value="#ENV{nobot}" size="10" />
+                               </p>
+                               <p class="boutons">
+                       <input name="abonnement" type="submit" value="<:abomailmans:btn_abonnement:>" class="submit" />
+                                       <input name="desabonnement" type="submit" value="<:abomailmans:btn_desabonnement:>" class="submit" />
+                </p>
+               </fieldset>
+               </div>
+       </form>
+       </B_listes>
+       </BOUCLE_editable>
+</div>
diff --git a/www/plugins/abomailmans/formulaires/abomailman.php b/www/plugins/abomailmans/formulaires/abomailman.php
new file mode 100644 (file)
index 0000000..868c417
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+include_spip('base/abstract_sql');
+
+// chargement des valeurs par defaut des champs du formulaire
+//une seule liste = [(#FORMULAIRE_ABOMAILMAN{1})]
+function formulaires_abomailman_charger_dist($id_abomailman = ""){
+
+       //initialise les variables d'environnement pas défaut
+       $valeurs = array();
+
+       // Si le visiteur est logue au site on utilise ses informations de connexion par défaut
+       include_spip('inc/session');
+       $valeurs['email'] = _request('email') ? _request('email') : session_get('email');
+       $valeurs['nom'] = _request('nom') ? _request('nom') : session_get('nom');
+
+       //si id_abomailman est renseigne, on envoie qu'une liste
+       if(intval($id_abomailman)){
+               $valeurs['id_abomailman'] = $id_abomailman;
+               $ok=sql_getfetsel('id_abomailman','spip_abomailmans','id_abomailman ='.intval($id_abomailman).' AND desactive = 0');
+       }
+       else {
+               $valeurs['listes'] = _request('listes');
+               // on verifie s'il existe des listes disponibles
+               $ok=sql_count(sql_select('id_abomailman','spip_abomailmans'));
+       }
+       $valeurs['nobot'] = _request('nobot');
+       if ($ok)
+       return $valeurs;
+}
+
+
+function formulaires_abomailman_verifier_dist($id_abomailman = ""){
+
+       //initialise le tableau des erreurs
+       $erreurs = array();
+
+       // recuperation des valeurs du formulaire
+       $nom = _request('nom');
+       $email = _request('email');
+       $listes = _request('listes', true);
+       $abonnement = _request('abonnement');
+       $desabonnement = _request('desabonnement');
+
+       // Faire une fonction de verif sur le mail pour validite
+
+       if($email == ''){
+               $erreurs['email'] = _T("abomailmans:email_oublie");
+       }
+       else{
+               include_spip('inc/filtres'); # pour email_valide()
+               if (!email_valide($email)){
+                       $erreurs['email'] = _T("form_email_non_valide");
+               }
+               else{
+                       spip_log("Email = $email;","abomailmans");
+                       //TODO
+                       // stocker l'email dans un fichier ou la session, histoire de ne pas se presenter 2 fois
+               }
+       }
+
+       if(empty($listes)){
+               $erreurs['listes'] = _T("abomailmans:choisir_liste");
+       }
+
+    //message d'erreur generalise
+    if (count($erreurs)) {
+        $erreurs['message_erreur'] .= _T('abomailmans:verifier_formulaire');
+    }
+
+    return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera ressoumis
+}
+
+function formulaires_abomailman_traiter_dist($id_abomailman = ""){
+       // Pour l'envoi de l'email
+       include_spip('inc/abomailmans');
+
+       // Antispam basique :
+       // si l'input invisible a ete renseigne, ca ne peut etre qu'un bot
+       if (strlen(_request('nobot'))){
+               return array('message_erreur'=>_T('abomailmans:erreur_nobot'));
+       }
+
+       $nom = _request('nom');
+       $email = _request('email');
+       $listes = _request('listes', true);
+       $abonnement = _request('abonnement');
+       $desabonnement = _request('desabonnement');
+
+       $message = null;
+
+       $message_listes = "<ul>";
+
+       $nb_listes = 0;
+       foreach($listes as $id_abomailman) {
+               $nb_listes++;
+
+               //on initialise l'envoi
+               // on traite chaque liste via une fonction reutilisable ailleurs
+               $traiter=abomailman_traiter_abonnement($id_abomailman,$abonnement);
+               $titre = $traiter[0];
+               $proprio_email=$traiter[1];
+               $liste_email=$traiter[2];
+               $sujet=$traiter[3];
+               $body= array( 
+                       'texte' => $traiter[4], 
+                       'nom_envoyeur' => $nom 
+               ); 
+               $headers=$traiter[5];
+
+               // si on veut ajouter un mail de notification ou de test
+               /*
+               $liste_email = array(
+                       $liste_email,"verif@exemple.com"
+               );
+               */
+               if (abomailman_mail($nom, $email, $proprio_email,$liste_email, $sujet, $body,'',$headers)){
+                       $message_listes  .= "<li><strong>$titre</strong></li>";
+               }else{
+                       $message_listes .= "<li><strong>". _T('pass_erreur_probleme_technique')."</strong></li>";
+                       $probleme=true;
+               }
+       }
+
+       $message_listes .= "</ul><br class='nettoyeur' />";
+
+       if($abonnement){
+               if($nb_listes>1){
+                       $message .= _T("abomailmans:message_confirmation_a");
+               }else{
+                       $message .= _T("abomailmans:message_confirmation_unique_a");
+               }
+       } else{
+               if($nb_listes>1){
+                       $message .= _T("abomailmans:message_confirmation_d");
+               }else{
+                       $message .= _T("abomailmans:message_confirmation_unique_d");
+               }
+       }
+
+       $message .= $message_listes;
+       $message .= "<p>" . _T("abomailmans:message_confirm_suite") . "</p>";
+
+       if ($probleme==false)
+               return $message;
+       else
+               return $message_listes;
+}
+?>
diff --git a/www/plugins/abomailmans/formulaires/abomailman_envoi_liste.html b/www/plugins/abomailmans/formulaires/abomailman_envoi_liste.html
new file mode 100644 (file)
index 0000000..1860427
--- /dev/null
@@ -0,0 +1,72 @@
+<div class="formulaire_spip formulaire_abomailman_envoi_liste ajax" id="formulaire_abomailman_envoi_liste">\r
+[(#REM) pour IE qui sinon se perd dans l'ajax !, ne pas retirer]<br class='bugajaxie' />\r
+\r
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]\r
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]\r
+       [(#ENV{editable})\r
+       [(#REM)\r
+               Bloc de previsualisation\r
+       \r
+               Si on valide la previsu, on n'envoie pas en ajax \r
+       \r
+       ][<form action="#ENV{action}#formulaire_abomailman_envoi_liste" method="post" class="noajax">\r
+               <div>\r
+               [(#ACTION_FORMULAIRE{#ENV{action}})]\r
+               <input type="hidden" name="template" value="#ENV*{template}" />\r
+               <input type="hidden" name="sujet" value="#ENV*{sujet}" />\r
+               <input type="hidden" name="message" value="#ENV*{message}" />\r
+               <input type="hidden" name="date" value="#ENV*{date}" />\r
+               <input type="hidden" name="id_rubrique" value="#ENV*{id_rubrique}" />\r
+               <input type="hidden" name="id_mot" value="#ENV*{id_mot}" />\r
+               (#ENV*{erreurs}|table_valeur{previsu})\r
+               </div>\r
+       </form>]\r
+       <form action="#ENV{action}#formulaire_abomailman_envoi_liste" method="post" enctype='multipart/form-data'><div>\r
+               [(#ACTION_FORMULAIRE{#ENV{action}})]\r
+               <ul>\r
+                       <li class="choisir_template[ (#ENV**{erreurs}|table_valeur{template}|oui)erreur]">\r
+                               <label for="template"><:abomailmans:template:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{template})</span>]\r
+                               <select name="template" id="template">\r
+                                       <INCLURE{fond=prive/listes/abomailman_templates}{id_abomailman}{erreurs}{env}>\r
+                               </select>\r
+                       </li>\r
+                       <li class="editer_date choisir_date[ (#ENV**{erreurs}|table_valeur{date}|oui)erreur]" style="overflow:visible">\r
+                               <label for="date"><:abomailmans:contenu_date:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{date})</span>]\r
+                               <input name="date" id="date" class="text date" value="[(#ENV{date}|affdate{'d/m/Y'})]"/>\r
+                               #INCLURE{fond=formulaires/dateur/inc-dateur}\r
+                       </li>\r
+                       <li class="choisir_rubrique[ (#ENV**{erreurs}|table_valeur{id_rubrique}|oui)erreur]">\r
+                               <label for="id_rubrique"><:abomailmans:rubrique:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{id_rubrique})</span>]\r
+                               <select name="id_rubrique" id="id_rubrique">\r
+                                       <option value=""></option>\r
+                                       [(#INCLURE{fond=prive/listes/abomailman_rubriques}{id_rubrique_env=#ENV{id_rubrique}})]\r
+                               </select>\r
+                       </li>\r
+                       <li class="choisir_mot[ (#ENV**{erreurs}|table_valeur{id_mot}|oui)erreur]">\r
+                               <label for="id_mot"><:abomailmans:mot:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{id_mot})</span>]\r
+                               <select name="id_mot" id="id_mot">\r
+                                       <option value=""></option>\r
+                                       [(#INCLURE{fond=prive/listes/abomailman_mots}{id_mot=#ENV{id_mot}})]\r
+                               </select>\r
+                       </li>\r
+                       <li class="obligatoire choisir_sujet [ (#ENV**{erreurs}|table_valeur{sujet}|oui)erreur]">\r
+                               <label for='sujet'><:abomailmans:sujet:> <:info_obligatoire_02:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{sujet})</span>]\r
+                               <input type='text' name='sujet' id='sujet' class="text multilang" value="#ENV*{sujet}" size='40' />\r
+                       </li>\r
+                       <li class="choisir_message[ (#ENV**{erreurs}|table_valeur{message}|oui)erreur]">\r
+                               <label for="message"><:abomailmans:message:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{message})</span>]\r
+                               <textarea id="message" name="message" class="text porte_plume_partout multilang" rows="5" cols="40">#ENV*{message}</textarea>\r
+                       </li>\r
+               </ul>\r
+               <p class="boutons">\r
+                       <input type='submit' name='previsu_abomailman' value='<:abomailmans:envoi_apercu:>' class='submit' />\r
+               </p>\r
+               </div>\r
+       </form>]\r
+</div>\r
diff --git a/www/plugins/abomailmans/formulaires/abomailman_envoi_liste.php b/www/plugins/abomailmans/formulaires/abomailman_envoi_liste.php
new file mode 100644 (file)
index 0000000..9960860
--- /dev/null
@@ -0,0 +1,130 @@
+<?php\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+include_spip('inc/abomailmans');\r
+include_spip('inc/distant');\r
+\r
+// chargement des valeurs par defaut des champs du formulaire\r
+function formulaires_abomailman_envoi_liste_charger_dist(){\r
+       //initialise les variables d'environnement pas défaut\r
+       $valeurs = array(); \r
+       if (autoriser('modifier','abomailman')) {\r
+         $valeurs['editable']=true;\r
+       } else return $valeurs['editable']=false;\r
+\r
+       //$valeurs['id_abomailman'] = _request('id_abomailman');\r
+       $valeurs['sujet'] = _request('sujet');\r
+       $valeurs['template'] = _request('template');\r
+       $valeurs['message'] = _request('message');\r
+       $valeurs['date'] = _request('date');\r
+       $valeurs['id_rubrique'] = _request('id_rubrique');\r
+       $valeurs['id_mot'] = _request('id_mot');\r
+\r
+       return $valeurs;\r
+}\r
+\r
+function formulaires_abomailman_envoi_liste_verifier_dist(){\r
+       \r
+       //initialise le tableau des erreurs\r
+       $erreurs = array();\r
+       \r
+       //$valeurs['id_abomailman'] = _request('id_abomailman');\r
+       $valeurs['sujet'] = _request('sujet');\r
+       $valeurs['template'] = _request('template');\r
+       $valeurs['message'] = _request('message');\r
+       $valeurs['id_rubrique'] = _request('id_rubrique');\r
+       $valeurs['id_mot'] = _request('id_mot');\r
+\r
+       if ($date = recup_date(_request('date'))) {     //On met la date saisie au format MySql AAAA-MM-JJ                      \r
+               $valeurs['date'] = date("Y-m-d",mktime($date[3],$date[4],$date[5],$date[1],$date[2],$date[0]));\r
+       } else { // Devrait pas arriver mais bon\r
+               $valeurs['date'] = date("Y-m-d");\r
+       }\r
+       // On reinjecte dans le bon format\r
+       set_request('date', $valeurs['date']);\r
+       \r
+   if(!$valeurs['sujet']){ \r
+               $erreurs['sujet'] = _T('abomailmans:sujet_obligatoire');  \r
+   }\r
+   \r
+   if (count($erreurs)) {\r
+       refuser_traiter_formulaire_ajax();\r
+      $erreurs['message_erreur'] .= _T('abomailmans:verifier_formulaire');\r
+   }\r
\r
+       if (!count($erreurs) AND !_request('confirmer_previsu_abomailman')){\r
+               $previsu = abomailmain_inclure_previsu($valeurs);\r
+               $erreurs['previsu'] = $previsu;\r
+       }\r
\r
+       return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera resoumis\r
+}\r
+\r
+function abomailmain_inclure_previsu($datas){\r
+       $datas['bouton'] = _T('abomailmans:envoi_confirmer');\r
+       $datas['template_html'] = recuperer_fond('abomailman_template',$datas);\r
+       $datas['envoi_txt'] = "oui";\r
+       $datas['template_txt'] = recuperer_fond('abomailman_template',$datas);\r
+       return recuperer_fond('formulaires/inc-previsu_mail',$datas);\r
+}\r
+\r
+function formulaires_abomailman_envoi_liste_traiter_dist(){\r
+   refuser_traiter_formulaire_ajax();\r
+       \r
+       $query = array();\r
+       $nom_site = lire_meta("nom_site");\r
+       $email_webmaster = lire_meta("email_webmaster");\r
+       $charset = lire_meta('charset');\r
+       $email_receipt = _request('email_liste');\r
+       $sujet = _request('sujet');\r
+    \r
+   // Recuperation des donnees\r
+       //$query['id_abomailman'] = _request('id_abomailman'); \r
+       $query['template'] = _request('template');\r
+       $query['sujet'] = _request('sujet');\r
+       $query['message'] = _request('message');\r
+       $query['id_rubrique'] = _request('id_rubrique');\r
+       $query['id_mot'] = _request('id_mot');\r
+\r
+       if ($date = recup_date(_request('date'))) {     //On met la date saisie au format MySql AAAA-MM-JJ                      \r
+               $query['date'] = date("Y-m-d",mktime($date[3],$date[4],$date[5],$date[1],$date[2],$date[0]));\r
+       } else { // Devrait pas arriver mais bon\r
+               $query['date'] = date("Y-m-d");\r
+       }\r
+\r
+       $fond = recuperer_fond('abomailman_template',$query); \r
+       $body = array(\r
+               'html'=>$fond,\r
+       );\r
+       /* Format Texte */\r
+       $query['envoi_txt'] = "oui";\r
+       $body['texte'] = recuperer_fond('abomailman_template',$query);\r
+       \r
+       if (strlen($fond) > 10) {               \r
+               // email denvoi depuis config facteur\r
+               if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui'\r
+                         AND $GLOBALS['meta']['facteur_adresse_envoi_email'])\r
+                       $from_email = $GLOBALS['meta']['facteur_adresse_envoi_email'];\r
+               else\r
+                       $from_email = $email_webmaster;\r
+               // nom denvoi depuis config facteur\r
+               if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui'\r
+                         AND $GLOBALS['meta']['facteur_adresse_envoi_nom'])\r
+                       $from_nom = $GLOBALS['meta']['facteur_adresse_envoi_nom'];\r
+               else\r
+                       $from_nom = $nom_site;\r
+                               \r
+               if (abomailman_mail($from_nom, $from_email, "", $email_receipt, $sujet,$body, true, $charset)) {\r
+               $message = _T('abomailmans:email_envoye',array('liste'=>$email_receipt));\r
+               } else {\r
+                       $message = _T('pass_erreur_probleme_technique');\r
+               }\r
+       } else {\r
+               $message = _T('abomailmans:contenu_insuffisant');\r
+       }\r
+\r
+   return array('message_ok'=>$message);\r
+}\r
+\r
+?>\r
diff --git a/www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.html b/www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.html
new file mode 100644 (file)
index 0000000..13bd990
--- /dev/null
@@ -0,0 +1,27 @@
+#CACHE{0}\r
+<div class="formulaire_spip formulaire_#FORM" id="formulaire_#FORM[_(#ENV{id_abomailman})]">\r
+\r
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]\r
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]\r
+\r
+   [(#ENV*{editable}|oui)\r
+      <form method='post' action='#ENV{action}'>\r
+         <div class="abonnement">\r
+            #ACTION_FORMULAIRE{#ENV{action}}\r
+            <ul>\r
+               #SET{erreurs,#ENV**{erreurs}|table_valeur{la_demo}}\r
+               <li class="editer_email obligatoire[ (#GET{erreurs}|oui)erreur]">\r
+                  [<span class='erreur_message'>(#GET{erreurs})</span>]\r
+                  <input name="email" id="email" type="text" value="<:abomailmans:votre_email:>" onclick="this.value=''" />\r
+               </li>\r
+            </ul>\r
+            [(#REM) Piege a robots spammeurs, du moins on essaie]\r
+                       <p style="display:none;">\r
+                               <label for="nobot_abomailman"><:antispam_champ_vide:></label>\r
+                               <input type="text" class="text" name="nobot" id="nobot_abomailman" value="#ENV{nobot}" size="10" />\r
+                       </p>\r
+            <p class="boutons"><input type="submit" class="submit" value="<:bouton_valider:>" /></p>\r
+         </div>\r
+      </form>\r
+   ]\r
+</div>\r
diff --git a/www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.php b/www/plugins/abomailmans/formulaires/abomailman_mini_une_liste.php
new file mode 100644 (file)
index 0000000..747d423
--- /dev/null
@@ -0,0 +1,94 @@
+<?php\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+include_spip('base/abstract_sql');\r
+\r
+// chargement des valeurs par defaut des champs du formulaire\r
+function formulaires_abomailman_mini_une_liste_charger_dist($id_abomailman = ""){\r
+\r
+       //initialise les variables d'environnement pas defaut\r
+       $valeurs = array('email');\r
+\r
+       // On verifie que la liste est bien accessible\r
+       if (! sql_getfetsel('id_abomailman','spip_abomailmans','id_abomailman ='.intval($id_abomailman).' AND desactive = 0')) {\r
+               spip_log("Le numero de liste n'est pas valable : $id_abomailman","abomailmans");\r
+               $valeurs['message_erreur'] = _T("abomailmans:liste_non_existante");\r
+       }\r
+       return $valeurs;\r
+}\r
+\r
+\r
+function formulaires_abomailman_mini_une_liste_verifier_dist($id_abomailman = ""){\r
+\r
+       //initialise le tableau des erreurs\r
+       $erreurs = array();\r
+\r
+       // Faire une fonction de verif sur le mail pour validite\r
+       $email = _request('email');\r
+       \r
+       if($email == ''){\r
+               $erreurs['erreur_email'] = _T("abomailmans:email_oublie");\r
+               spip_log("Aucun email n'est insere","abomailmans");\r
+       }\r
+       else{\r
+               include_spip('inc/filtres'); # pour email_valide()\r
+               if (!email_valide($email)){\r
+                       $erreurs['erreur_email'] = _T("abomailmans:email_valide");\r
+                       spip_log("Email non valide $email","abomailmans");\r
+               }\r
+               else{\r
+                       spip_log("Email = $email;","abomailmans");\r
+               }\r
+       }\r
+\r
+   //message d'erreur\r
+   if (count($erreurs)) {\r
+      $erreurs['message_erreur'] .= _T('abomailmans:verifier_formulaire');\r
+   }\r
+\r
+   return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera resoumis\r
+}\r
+\r
+function formulaires_abomailman_mini_une_liste_traiter_dist($id_abomailman = ""){\r
+       include_spip('inc/abomailmans');\r
+       \r
+       $nom = _request('nom');\r
+       $email = _request('email');\r
+\r
+       // Antispam basique :\r
+       // si l'input invisible a ete renseigne, ca ne peut etre qu'un bot\r
+       if (strlen(_request('nobot'))){\r
+               return array('message_erreur'=>_T('abomailmans:erreur_nobot'));\r
+       }\r
+       \r
+       $message = null;\r
+\r
+   // on initialise l'envoi\r
+       // on traite chaque liste via une fonction reutilisable ailleurs\r
+       // on passe abonnement a true d'office\r
+       $traiter=abomailman_traiter_abonnement($id_abomailman,true);\r
+       $titre = $traiter[0];\r
+       $proprio_email=$traiter[1];\r
+       $liste_email=$traiter[2];\r
+       $sujet=$traiter[3];\r
+       $body="$nom - $email ".$traiter[4];\r
+       $headers=$traiter[5];\r
+       \r
+       if (abomailman_mail($nom, $email, $proprio_email,$liste_email, $sujet, $body,$headers)){\r
+               $message_listes  .= "<p><strong>$titre</strong><p>";\r
+       }else{\r
+               $message_listes .= "<p><strong>". _T('pass_erreur_probleme_technique')."</strong></p>";\r
+               $probleme=true;\r
+       } \r
+               \r
+       $message .= $body."". _T("abomailmans:message_confirmation_unique_a");\r
+       $message .= $message_listes;\r
+       $message .= "<p>" . _T("abomailmans:message_confirm_suite") . "</p>";\r
+\r
+       if ($probleme==false)\r
+               return $message;\r
+       else\r
+               return $message_listes;\r
+}\r
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/formulaires/editer_abomailman.html b/www/plugins/abomailmans/formulaires/editer_abomailman.html
new file mode 100644 (file)
index 0000000..7c74956
--- /dev/null
@@ -0,0 +1,136 @@
+<div class="formulaire_spip formulaire_editer formulaire_abomailman_creation[_(#ENV{id_abomailman})]">\r
+       <!-- <br class='bugajaxie' /> -->\r
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]\r
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]\r
+       [(#ENV{editable})\r
+       <form method='post' action='#ENV{action}' enctype='multipart/form-data'><div>\r
+               #ACTION_FORMULAIRE{#ENV{action}}\r
+               <ul>\r
+                       <li class="editer editer_titre obligatoire[ (#ENV**{erreurs}|table_valeur{titre}|oui)erreur] editer_type_input">\r
+                               <label for="titre" class="obligatoire"><:texte_titre_obligatoire:></label>\r
+                               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{titre})</span>]\r
+                               <input type="text" id="titre" name="titre" value="[(#ENV**{titre})]" class="text multilang" size="50" />\r
+                       </li>\r
+                       <li class='editer editer_descriptif[ (#ENV**{erreurs}|table_valeur{descriptif}|oui)erreur] editer_type_textarea'>\r
+                               <label for='descriptif'><:abomailmans:texte_descriptif:></label>[\r
+                               <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{descriptif})</span>\r
+                               ]<textarea name='descriptif' id='descriptif' class='text multilang porte_plume_partout' cols='40' rows='2'>[(#ENV**{descriptif})]</textarea>\r
+                       </li>\r
+                       <li class='editer editer_abo_type[ (#ENV**{erreurs}|table_valeur{abo_type}|oui)erreur]'>\r
+                               <label for="desactive_active"><:abomailmans:label_type_abo:></label>\r
+                               <div class="choix">\r
+                                       <input type="radio" value="news" id="abo_type_news" name="abo_type"[(#ENV{abo_type, news}|=={news}|oui)checked="checked"] />\r
+                                       <label for="abo_type_news"><:abomailmans:label_type_news:></label>\r
+                               </div>\r
+                               <div class="choix">\r
+                                       <input type="radio" value="ml" id="abo_type_ml" name="abo_type"[(#ENV{abo_type, news}|=={ml}|oui)checked="checked"] />\r
+                                       <label for="abo_type_ml"><:abomailmans:label_type_ml:></label>\r
+                               </div>\r
+                       </li>\r
+                       <li class="fieldset">\r
+                               <fieldset>\r
+                                       <h3 class="legend"><:abomailmans:emails_a_renseigner:></h3>\r
+               <ul>\r
+                  <li class="editer obligatoire editer_email[ (#ENV**{erreurs}|table_valeur{email}|oui)erreur]">\r
+                     <label for="email" class="obligatoire"><:abomailmans:destinataire:></label>\r
+                     <p class="explication"><:abomailmans:emailliste_abomailman:></p>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{email})</span>]\r
+                     <input type="text"  id="email" name="email" value="[(#ENV**{email})]" size="50" class="text" />\r
+                  </li>\r
+                  <li class="editer editer_email_subscribe[ (#ENV**{erreurs}|table_valeur{email_subscribe}|oui)erreur]">\r
+                     <label for="email_subscribe"><:abomailmans:emailliste_subscribe:></label>\r
+                     <p class="explication"><:abomailmans:explication_email_subscribe:></p>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{email_subscribe})</span>]\r
+                     <input type="text"  id="email_subscribe" name="email_subscribe" value="[(#ENV**{email_subscribe})]" size="50" class="text" />\r
+                  </li>\r
+                  <li class="editer editer_email_unsubscribe[ (#ENV**{erreurs}|table_valeur{email_unsubscribe}|oui)erreur]">\r
+                     <label for="email_unsubscribe"><:abomailmans:emailliste_unsubscribe:></label>\r
+                     <p class="explication"><:abomailmans:explication_email_unsubscribe:></p>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{email_unsubscribe})</span>]\r
+                     <input type="text"  id="email_unsubscribe" name="email_unsubscribe" value="[(#ENV**{email_unsubscribe})]" size="50" class="text" />\r
+                  </li>\r
+                  <li class="editer editer_email_sympa[ (#ENV**{erreurs}|table_valeur{email_sympa}|oui)erreur]">\r
+                     <label for="email_sympa"><:abomailmans:emailliste_abosympa:></label>\r
+                     <p class="explication"><:abomailmans:explication_email_sympa:></p>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{email_sympa})</span>]\r
+                     <input type="text"  id="email_sympa" name="email_sympa" value="[(#ENV**{email_sympa})]" size="50" class="text" />\r
+                  </li>\r
+                  [<li class="editer editer_langue[ (#ENV**{erreurs}|table_valeur{langue}|oui)erreur]">\r
+                     <label for="langue"><:abomailmans:langue_liste:></label>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{langue})</span>]\r
+                     <select name="langue" id="langue">\r
+                        <option value=""><:abomailmans:aucune_langue:></option>\r
+                        (#VAL{changer_lang}|liste_options_langues{#ENV*{langue}})\r
+                     </select>\r
+                  </li>]\r
+               </ul>\r
+                       </fieldset>\r
+                       </li>\r
+                       <li class="fieldset">\r
+                               <fieldset>\r
+                                       <h3 class="legend"><:abomailmans:envoi_regulier:></h3>\r
+                                       <ul>\r
+                  <li class="editer editer_periodicite">\r
+                     <label for='periodicite'><:abomailmans:envoi_regulier:></label>\r
+                     <p class="explication"><:abomailmans:envoi_regulier_info:></p>\r
+                     <div class='choix'>\r
+                        <label for="periodicite"><:abomailmans:envoi_regulier_tous_les:></label>\r
+                        <input type="text" size="4" value="[(#ENV{periodicite})]" id="periodicite" name="periodicite" />\r
+                        <label for="periodicite"><:abomailmans:periodicite:></label>\r
+                     </div>\r
+                  </li>\r
+                  <li class="editer choisir_template[ (#ENV**{erreurs}|table_valeur{template}|oui)erreur]">\r
+                     <label for="template"><:abomailmans:template_defaut:></label>\r
+                     <p class="explication"><:abomailmans:template_defaut_info:></p>\r
+                     [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{template})</span>]\r
+                     <select name="template" id="template">\r
+                        <INCLURE{fond=prive/listes/abomailman_templates}{id_abomailman}{erreurs}>\r
+                     </select>\r
+                  </li>\r
+                  <li class="editer editer_envoi_liste_parametres">\r
+                     <label for="envoi_liste_parametres"><:abomailmans:envoi_parametres:></label>\r
+                     <p class="explication">\r
+                        <:abomailmans:envoi_liste_parametres:>\r
+                        [(#ENV{modele_defaut}|oui)\r
+                           <br />\r
+                           [(#SET{date_ref,[(#DATE|moins30|affdate{annee})-][(#DATE|moins30|affdate{mois})]})]\r
+                           <:abomailmans:voir_modele_depuis:>[ (#DATE|moins30|affdate{nom_mois})][ (#DATE|moins30|affdate{annee})]&nbsp;: <a href="[(#URL_PAGE{abomailman_template}|parametre_url{template,[(#ENV{template})]}|parametre_url{date,#GET{date_ref}})][(#ENV**{envoi_liste_parametres})]"><:abomailmans:previsu_html:></a> | <a href="[(#URL_PAGE{abomailman_template}|parametre_url{template,[(#ENV{template})]}|parametre_url{date,#GET{date_ref}}|parametre_url{envoi_txt,oui})][(#ENV**{envoi_liste_parametres})]"><:abomailmans:previsu_txt:></a>.\r
+                        ]\r
+                     </p>\r
+                     <input type="text" id="envoi_liste_parametres" name="envoi_liste_parametres" value="[(#ENV**{envoi_liste_parametres})]" size="50"  class="text" />\r
+                  </li>\r
+               </ul>\r
+            </fieldset>\r
+         </li>\r
+         <li class="fieldset">\r
+            <fieldset>\r
+               <h3 class="legend"><:abomailmans:label_etat_liste:></h3>\r
+               <ul>\r
+                  <li class="editer editer_desactive obligatoire">\r
+                     <label for="desactive_active"><:abomailmans:activation:></label>\r
+                     <div class="choix">\r
+                        <input type="radio" value="0" id="desactive_active" name="desactive"[(#ENV{desactive, 0}|=={0}|oui) checked="checked"] />\r
+                        <label for="desactive_active"><:abomailmans:active:></label>\r
+                     </div>\r
+                     <div class="choix">\r
+                        <input type="radio" value="1" id="desactive_inactive" name="desactive"[(#ENV{desactive, 0}|=={1}|oui) checked="checked"] />\r
+                        <label for="desactive_inactive"><:abomailmans:desactive:></label>\r
+                     </div>\r
+                  </li>\r
+                  [(#ENV{id_abomailman}|intval|oui)\r
+                  <li class="editer editer_desactive_supprime">\r
+                     <label for="desactive_supprime"><:abomailmans:supprimer:></label>\r
+                     <div class="choix">\r
+                        <input type="checkbox" value="2" id="desactive_supprime" name="desactive"[(#ENV{desactive, 0}|=={2}|oui) checked="checked"] />\r
+                        <label for="desactive_supprime"><:abomailmans:suppression_definitive:></label>\r
+                     </div>\r
+                  </li>]\r
+               </ul>\r
+            </fieldset>\r
+         </li>\r
+      </ul>\r
+      <p class="boutons">\r
+         <input type="submit" class="submit" name="valider" value="[(#ENV{id_abomailman}|?{<:bouton_enregistrer:>,<:bouton_ajouter:>})]" />\r
+      </p>\r
+       </div></form>]\r
+</div>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/formulaires/editer_abomailman.php b/www/plugins/abomailmans/formulaires/editer_abomailman.php
new file mode 100644 (file)
index 0000000..5d746f8
--- /dev/null
@@ -0,0 +1,114 @@
+<?php\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+include_spip('inc/autoriser');\r
+include_spip('inc/actions');\r
+include_spip('inc/editer');\r
+\r
+// chargement des valeurs par defaut des champs du formulaire\r
+function formulaires_editer_abomailman_charger_dist($id_abomailman='new',$retour='', $config_fonc='', $row=array(), $hidden=''){\r
+       $valeurs = array();\r
+\r
+       //initialise les variables d'environnement pas défaut\r
+       if (!autoriser('creer', 'abomailman', 'oui')) {\r
+               $editable = false;\r
+       }else{\r
+               $valeurs = formulaires_editer_objet_charger('abomailman',$id_abomailman,0,0,$retour,$config_fonc,$row,$hidden);\r
+               $editable = true;\r
+       }\r
+\r
+       if(!$valeurs['langue']){\r
+               $valeurs['langue'] = lang_select();\r
+       }\r
+       unset($valeurs['lang']);\r
+\r
+       $recuptemplate = explode('&',_request('modele_defaut'));\r
+       $valeurs['template'] = $recuptemplate[0];\r
+       $valeurs['envoi_liste_parametres']=recup_param(_request('modele_defaut'));\r
+       $valeurs['editable'] = $editable;\r
+       return $valeurs;\r
+}\r
+\r
+/**\r
+ * Identifier le formulaire en faisant abstraction des parametres qui\r
+ * ne representent pas l'objet edite\r
+ */\r
+function formulaires_editer_abomailman_identifier_dist($id_abomailman='new', $retour='', $associer_objet='', $config_fonc='auteurs_edit_config', $row=array(), $hidden=''){\r
+       return serialize(array(intval($id_abomailman),$associer_objet));\r
+}\r
+\r
+function formulaires_editer_abomailman_verifier_dist($id_abomailman='new',$retour='', $config_fonc='', $row=array(), $hidden=''){\r
+\r
+       //initialise le tableau des erreurs\r
+       $erreurs = formulaires_editer_objet_verifier('abomailman',$id_abomailman,array('titre','email'));\r
+       spip_log($erreurs,'test');\r
+       // Faire une fonction de verif sur le mail et le titre pour validite\r
+       $desactive = _request('desactive');\r
+\r
+       // Si on fait une suppression, on ne vérifie pas le reste\r
+       if($desactive != '2'){\r
+               if (count($erreurs)<1){\r
+                       include_spip('inc/filtres'); # pour email_valide()\r
+                       if (!email_valide(_request('email'))){\r
+                               $erreurs['email'] = _T("abomailmans:email_valide");\r
+                       }\r
+               }\r
+       }\r
+       \r
+    //message d'erreur genéralisé\r
+    if (count($erreurs)>0) {\r
+        $erreurs['message_erreur'] .= _T('abomailmans:verifier_formulaire');\r
+    }\r
+\r
+    return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera resoumis\r
+}\r
+\r
+function formulaires_editer_abomailman_traiter_dist($id_abomailman='new',$retour='', $config_fonc='', $row=array(), $hidden=''){\r
+       $res = formulaires_editer_objet_traiter('abomailman',$id_abomailman,0,0,$retour,$config_fonc,$row,$hidden);\r
+   \r
+       $message = array();\r
+       $valeurs['envoi_liste_parametres'] = _request('envoi_liste_parametres');\r
+\r
+       $datas = array();\r
+\r
+    // Récupération des données\r
+       $datas['titre'] = _request('titre');\r
+       $datas['descriptif'] = _request('descriptif');\r
+       if(_request('abo_type') && in_array(_request('abo_type'), array('news','ml'))){\r
+               $datas['abo_type'] = _request('abo_type');\r
+       }\r
+       $datas['email'] = _request('email');\r
+       $datas['email_subscribe'] = _request('email_subscribe');\r
+       $datas['email_unsubscribe'] = _request('email_unsubscribe');\r
+       $datas['email_sympa'] = _request('email_sympa');\r
+       $datas['desactive'] = _request('desactive');\r
+       $datas['modele_defaut'] = str_replace('\'','',_request('template'))."".$valeurs['envoi_liste_parametres'];\r
+       $datas['periodicite'] = _request('periodicite');\r
+       $datas['lang'] = _request('langue');\r
+\r
+       // on récupère les données de la liste\r
+       if(intval($id_abomailman)){\r
+               if($datas['desactive'] == '2'){\r
+                       sql_delete("spip_abomailmans","id_abomailman = $id_abomailman");\r
+                       $message['message_ok'] = _T('abomailmans:liste_supprimee',array("id"=>$id_abomailman,"titre"=> $datas['titre']));\r
+                       $message['editable'] = false;\r
+               }else{\r
+                       sql_updateq("spip_abomailmans",$datas,"id_abomailman = $id_abomailman");\r
+                       $message['message_ok'] = _T('abomailmans:liste_updatee',array("id"=>$id_abomailman,"titre"=> $datas['titre']));\r
+               }\r
+       }else{\r
+               $message['message_ok'] = _T('abomailmans:liste_creee',array("id"=>$id_abomailman,"titre"=> $datas['titre']));\r
+               $message['editable'] = false;\r
+       }\r
+       \r
+       if (!$retour) {\r
+               $message['redirect'] = parametre_url(parametre_url(self(),'id_abomailman', $res['id_abomailman']),'abomailman','');\r
+       } else {\r
+               // sinon on utilise la redirection donnee.\r
+               $message['redirect'] = parametre_url($retour, 'id_abomailman', $res['id_abomailman']);\r
+       }\r
+   return $message;\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/formulaires/inc-previsu_mail.html b/www/plugins/abomailmans/formulaires/inc-previsu_mail.html
new file mode 100644 (file)
index 0000000..5e570ba
--- /dev/null
@@ -0,0 +1,30 @@
+<ul>\r
+       <li class="fieldset">\r
+               <fieldset class="previsu">\r
+         <h3 class="legend"><:previsualisation:> <:abomailmans:previsu_html:></h3>\r
+         <div class="abo_message">\r
+            #ENV*{template_html}\r
+         </div>\r
+         <h3 class="legend"><:previsualisation:> <:abomailmans:previsu_txt:></h3>\r
+         <div class="abo_message">\r
+            <pre width="80">#ENV*{template_txt, #VAL{abomailmans:pas_template_txt}|_T}</pre>\r
+         </div>\r
+         <h3 class="legend"><:abomailmans:destinataire:></h3>\r
+         <ul>\r
+            <li>\r
+               <label><:abomailmans:envoyer_courier_liste:></label>\r
+               <B_listes>\r
+               <select name="email_liste" id="email_liste" >\r
+               <BOUCLE_listes(ABOMAILMANS){par titre}>\r
+               <option value="#EMAIL">#TITRE -> #EMAIL</option>\r
+               </BOUCLE_listes>\r
+               </select>\r
+               </B_listes>\r
+            </li>\r
+       </ul>\r
+      </fieldset>\r
+       </li>\r
+</ul>\r
+[<p class="boutons">\r
+       <input name="confirmer_previsu_abomailman" type="submit" value="(#ENV{bouton})" />\r
+</p>]
\ No newline at end of file
diff --git a/www/plugins/abomailmans/genie/abomailmans_envois.php b/www/plugins/abomailmans/genie/abomailmans_envois.php
new file mode 100755 (executable)
index 0000000..0a5da56
--- /dev/null
@@ -0,0 +1,133 @@
+<?php\r
+/**\r
+ * Plugin Abomailmanss\r
+ * (c) 2009-2011 SPIP\r
+ * Distribue sous licence GPL\r
+ *\r
+ */\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+include_spip('inc/abomailmans');\r
+include_spip('inc/distant');\r
+\r
+/**\r
+ * Les abomailmans de chaque liste peuvent se faire par cron\r
+ * base sur les champs remplis de chaque liste\r
+ * automatique tout les /periodicite/ jours\r
+ * @param unknown_type $time\r
+ */\r
+function genie_abomailmans_envois_dist($time) {\r
+       \r
+       /**\r
+        * Les listes dont la date_envoi < maintenant+periodicite\r
+        * pour tester on peut mettre a MINUTE penser a remettre a DAY !!\r
+        */\r
+       $where = "periodicite!='' AND desactive='0' AND email!=''\r
+               AND date_envoi < DATE_SUB(NOW(), INTERVAL periodicite DAY)"; \r
+       $id_liste = sql_getfetsel("id_abomailman", "spip_abomailmans", $where, '', "date_envoi", "1");\r
+        \r
+       if ($id_liste) {\r
+               spip_log("il faut traiter liste id=$id_liste","abomailmans");\r
+               $res2 = liste_a_jour($id_liste);\r
+       } else $res2 = true;\r
+       \r
+       /**\r
+        * nul, si la tache n'a rien a faire\r
+        * positif, si la tache a ete traitee\r
+        * negatif, si la tache a commence, mais doit se poursuivre. \r
+        * Cela permet d'effectuer des taches par lots (pour eviter des timeout sur les executions des scripts PHP \r
+        * a cause de traitements trop longs).\r
+        * Dans ce cas la, le nombre negatif indique correspond au nombre de secondes d'intervalle \r
+        * pour la prochaine execution.\r
+        */\r
+       return ($res1 OR $res2) ? 0 : $id_liste;\r
+}       \r
+       \r
+       \r
+\r
+function liste_a_jour($id_liste) {\r
+       $envoi_ok=true;\r
+       $t = sql_fetsel("*", "spip_abomailmans", "id_abomailman=$id_liste");\r
+       if(!$t) { \r
+               spip_log("requete null ...","abomailmans");\r
+               return;\r
+       } else spip_log("envoi teste avec cron abomailmans","abomailmans");\r
+               \r
+       $datas = array();\r
+       $nom_site = lire_meta("nom_site");\r
+       $email_webmaster = lire_meta("email_webmaster");\r
+       $charset = lire_meta('charset');\r
+\r
+\r
+       $sujet=$t['titre']; \r
+       $date_envoi=$t['date_envoi']; \r
+       $email_receipt=$t['email'];\r
+       $modele_defaut=$t['modele_defaut'];\r
+       \r
+       $recuptemplate = explode('&',$modele_defaut);\r
+               \r
+       include_spip('abomailmans_fonctions');\r
+       $paramplus = recup_param($modele_defaut); //pour url\r
+       $periodicite=intval($t['periodicite']);\r
+\r
+       /**\r
+        * la page a envoyer doit etre testee a maintenant moins periodicite\r
+        */\r
+       $time = time() - (3600 * 24 * $periodicite);\r
+\r
+       /**\r
+        * construction du query\r
+        */\r
+       parse_str($paramplus,$query);\r
+       $query['id_abomailman'] = $t['id_abomailman'];\r
+       $query['template'] = $recuptemplate[0];\r
+       $query['date'] = date('Y-m-d H:i:s', $time);\r
+\r
+       /**\r
+        * on peut verifier le fond grace à l'url\r
+        */\r
+       $url_genere = generer_url_public('abomailman_template',$query,'&'); \r
+       $fond = recuperer_fond('abomailman_template',$query);\r
+\r
+       $body = array(\r
+               'html'=>$fond,\r
+       ); \r
+       /* Format Texte */\r
+       $query['envoi_txt'] = "oui";\r
+       $body['texte'] = recuperer_fond('abomailman_template',$query);\r
+\r
+       //Si la page renvoie un contenu\r
+       if (strlen($fond) > 10) {\r
+                               \r
+               // email denvoi depuis config facteur\r
+               if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui'\r
+                         AND $GLOBALS['meta']['facteur_adresse_envoi_email'])\r
+                       $from_email = $GLOBALS['meta']['facteur_adresse_envoi_email'];\r
+               else\r
+                       $from_email = $email_webmaster;\r
+               // nom denvoi depuis config facteur\r
+               if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui'\r
+                         AND $GLOBALS['meta']['facteur_adresse_envoi_nom'])\r
+                       $from_nom = $GLOBALS['meta']['facteur_adresse_envoi_nom'];\r
+               else\r
+                       $from_nom = $nom_site;\r
+                               \r
+               if (abomailman_mail($from_nom, $from_email, "", $email_receipt, $sujet,$body, true, $charset)) {\r
+                       spip_log("envoi ok = $url_genere tous les $periodicite jours sujet =".$sujet,"abomailmans");\r
+               } else {\r
+                       spip_log("!! envoi nok = $url_genere tous les $periodicite jours sujet =".$sujet,"abomailmans."._LOG_ERREUR);\r
+                       $envoi_ok=false;\r
+               }\r
+       }\r
+       else {\r
+               spip_log("maintenant=".date('Y-m-d H:i:s', time())." date demande = ".$query['date']." non envoye =$url_genere : rien de neuf depuis $periodicite jours","abomailmans"); \r
+       }\r
+       \r
+       if($envoi_ok) {\r
+               // Noter que l'envoi est OK meme si envoi echoue faute de contenu, on reessaiera dans /periodicite/ jours\r
+               sql_updateq("spip_abomailmans", array("date_envoi" => date('Y-m-d H:i:s', time())), "id_abomailman=".$t['id_abomailman']);\r
+       }\r
+       return false; # c'est bon\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/inc/abomailmans.php b/www/plugins/abomailmans/inc/abomailmans.php
new file mode 100755 (executable)
index 0000000..e4ba2d6
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+
+/*
+ * Abomailmans
+ * MaZiaR - NetAktiv
+ * tech@netaktiv.com
+ * Printemps 2007 - 2012
+ * Inspire de Spip-Listes
+ * $Id: abomailmans.php 59911 2012-03-29 10:00:37Z root $
+*/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+// a utiliser dans le form de son choix ...
+function abomailman_traiter_abonnement($id_liste,$abonnement){
+       $liste_data = sql_fetsel("*","spip_abomailmans","id_abomailman = $id_liste");
+       $sujet=null;
+       $dowhat=null;
+       $titre=$liste_data['titre'];
+       //Si on a les 2 emails
+       if($liste_data['email_subscribe'] AND $liste_data['email_unsubscribe']){
+               spip_log("Liste defini par mails","abomailmans");
+               $liste_email = !empty($abonnement)?$liste_data['email_subscribe']:$liste_data['email_unsubscribe'];
+       }else{
+               //sinon comme avant
+               // 1er cas : c'est une liste MAILMAN ? join et leave etrange  !!!
+               //ne serait-ce pas plutot subscribe et unsubscribe ?
+               if($liste_data['email_sympa'] == '') {
+                       spip_log("Liste -join ou -leave","abomailmans");
+                       $liste_email = explode ("@", $liste_data['email']);
+                       // abonnement ou desabonement : on rajoute -join ou -leave dans l'email de la liste
+                       $dowhat = !empty($abonnement)?"-join@":"-leave@";
+                       $liste_email = $liste_email[0]."$dowhat".$liste_email[1];
+               }
+               // 2eme cas : c'est une liste SYMPA (presence de deux @ à suivre)
+               else {
+                       spip_log("Liste sympa","abomailmans");
+                       $proprio_email = $liste_data['email_sympa'];
+                       $sujet = empty($abonnement)? 'UNSUBSCRIBE ' : 'SUBSCRIBE ';
+                       $sujet .= $liste_data['email'].' ';
+                       $sujet .= empty($desabonnement) ? $nom : '';
+                       $liste_email = $liste_data['titre'];
+               }
+       }
+       $sujet=isset($sujet)?$sujet:$liste_email;
+       $quoifait=!empty($abonnement)?_T("abomailmans:veut_s_abonner"):_T("abomailmans:veut_se_desabonner");
+       $body="$quoifait"."\n ".$titre."(".$liste_data['email'].") \n "._T("abomailmans:envoi_vers")." $liste_email";
+
+
+       return array($titre,$proprio_email,$liste_email, $sujet, $body,$headers);
+}
+
+
+//* Envoi de mail via facteur
+function abomailman_mail($nom, $email, $to_email,$liste_email, $sujet="", $body="", $html="", $headers="") {
+       // si $to_mail est plein, c'est Sympa, s'il est vide c'est Mailman et il faut alors utiliser $liste_email
+       if (!$to_email)
+               $to_email = $liste_email;
+       
+       // Pas beau mais faudrait reprendre le code plus en profondeur
+       // et rajouter une liste de choix du robot en page de config
+       // Modifier le destinataire d’envoi dans le cas ezmlm pour que 
+       // les inscriptions fonctionnent si facteur utilise l’envoi via
+       // la fonction mail() de php. En effet dans ce cas, le header return-path
+       // n’est pas renseigné. Or c’est ce header qui est utilisé par le robot
+       // pour répondre et non le champ from... Il faut modifier le destinataire
+       // comme ceci maliste-subscribe-lemail=ledomaine.tld@monsite.tld
+       if (defined('_ABOMAILMAN_ROBOT_EZMLM') && preg_match("/subscribe/",$to_email)) {
+               $souscripteur = str_replace("@" , "=" , $email ) ;
+               $to_email = str_replace("@" , "-".$souscripteur."@" , $to_email ) ;
+       }
+
+       $envoyer_mail = charger_fonction('envoyer_mail','inc/');
+       if($envoyer_mail($to_email, $sujet, $body, $email, $headers))
+               $retour=true;
+       else
+               $retour=false;
+
+       spip_log("abomailman_mail nom $nom, email $email, to_email $to_email, liste_email $liste_email, sujet $sujet, body $body, html $html, headers $headers, retour envoyer_mail : $retour","abomailmans");
+       return $retour ;
+}
+
+
+?>
diff --git a/www/plugins/abomailmans/lang/abomailmans.xml b/www/plugins/abomailmans/lang/abomailmans.xml
new file mode 100644 (file)
index 0000000..016cf4d
--- /dev/null
@@ -0,0 +1,15 @@
+<traduction module="abomailmans" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/abomailmans/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/abomailmans?lang_cible=de" total="99" traduits="66" relire="0" modifs="6" nouveaux="27" pourcent="66.67">
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/abomailmans?lang_cible=en" total="99" traduits="99" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/abomailmans?lang_cible=es" total="99" traduits="99" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
+       </langue>
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/abomailmans?lang_cible=fr" total="99" traduits="99" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/abomailmans?lang_cible=sk" total="99" traduits="99" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/abomailmans/lang/abomailmans_de.php b/www/plugins/abomailmans/lang/abomailmans_de.php
new file mode 100644 (file)
index 0000000..48358ad
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/abomailmans?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abonne' => 'Ich abonniere',
+       'active' => 'Aktiv',
+       'aucune_langue' => 'Keine ANgabn',
+
+       // B
+       'bouton_listes_diffusion' => 'Mailinglisten',
+       'btn_abonnement' => 'Abonnieren',
+       'btn_desabonnement' => 'Abbestellen',
+
+       // C
+       'choisir_liste' => 'Sie müssen eine Liste wählen.',
+       'contenu_date' => 'Inhalt ab diesem Datum', # MODIF
+       'creation_droits_insuffisants' => 'Sie haben kein Recht dazu ...',
+
+       // D
+       'desactive' => 'Abgeschaltet',
+
+       // E
+       'email' => 'E-Mail',
+       'email_abonnement' => 'Ihre E-Mail Adresse',
+       'email_envoye' => 'Die E-Mail wurde an die Mailingliste verschickt: @liste@.',
+       'email_oublie' => 'Sie haben ihre E-Mail Adresse vergessen',
+       'emailliste_abomailman' => 'E-Mail Adresse der Liste',
+       'emailliste_abosympa' => 'E-Mail Adresse des Sympa-Administrators',
+       'emailliste_subscribe' => 'Subscribe',
+       'emailliste_unsubscribe' => 'Unsubscribe', # MODIF
+       'envoi_apercu' => 'Vorschau',
+       'envoi_confirmer' => 'Bestätigen und absenden',
+       'envoi_liste_parametres' => 'Parameterliste',
+       'envoi_regulier' => 'Automatics mail',
+       'envoi_regulier_info' => 'Keep empty if you do not want to send automatically',
+       'envoi_regulier_tous_les' => 'Send each',
+       'envoi_vers' => 'send to',
+       'envoyer_courier' => 'Mail senden',
+       'envoyer_courier_liste' => 'Mail an diese Mailingliste senden:',
+       'envoyer_mailmans' => 'Modell und Inhalt auswählen', # MODIF
+       'erreur_email_liste_oublie' => 'Die E-Mail Adresse ist obligatorisch.',
+       'explication_email_subscribe' => 'Email for subscribe, something like <code>suffix+subscribe@exemple.org</code>',
+       'explication_email_sympa' => 'Wenn dieses Feld ausgefüllt ist, wird von einer Sympa-Liste ausgegangen,
+                                                       anderenfalls von einer Mailman-Liste.',
+       'explication_email_unsubscribe' => 'Email for unsubscribe',
+
+       // I
+       'icone_ajouter_liste' => 'Neue Liste hinzufügen',
+       'icone_envoyer_mail_liste' => 'Mail aus dem Inhalt dieser Website generieren und an die Buchstaben senden',
+       'info_sisympa' => '[Obligatorisch bei Sympa-Listen]',
+       'insciption_listes_legende' => 'Mailing-Listen Abonnements', # MODIF
+       'inscription_lettres_legende' => 'Abonnement bei Newslettern<br />und Diskussionslisten',
+
+       // J
+       'je_m_abonne' => 'Markieren um Abonnement zu bestellen oder zu kündigen.',
+
+       // L
+       'label_etat_liste' => 'Status der Liste',
+       'langue_liste' => 'Sprache der Liste',
+       'les_listes_mailmans' => 'Bekannte Mailman-Listen',
+       'lire_article' => 'Artikel lesen',
+       'liste_creee' => 'Die Liste Nummer @id@ (@titre@) wurde angelegt.',
+       'liste_non_existante' => 'Die Liste existiert nich oder wurde entfernt.',
+       'liste_oublie' => 'Sie habe vergessen, eine Liste auszuwählen!',
+       'liste_supprimee' => 'Die Liste Nummer @id@ (@titre@) wurde gelöscht.',
+       'liste_updatee' => 'Die Liste Nummer  @id@ (@titre@) wurde aktualisiert.',
+
+       // M
+       'message' => 'Einleitungstext vor den Inhalten ihrer Website',
+       'message_confirm_suite' => 'Um ihren Auftrag zu bestätigen beantworten sie bitte die Bestätigungsmail, die sie erhalten werden..',
+       'message_confirmation_a' => 'Aboanfragen an folgende Listen wurden gesendet:',
+       'message_confirmation_d' => 'Stornierungsaufträge an folgende Listen wurden gesendet. ',
+       'message_confirmation_unique_a' => 'Eine Aboanfragen an folgende Liste wurden gesendet:',
+       'message_confirmation_unique_d' => 'Stornierungsauftrag an folgende Liste wurden gesendet. ',
+       'mot' => 'Artikel zu diesem Schlagwort auflisten',
+
+       // N
+       'nom' => 'Name und Vorname (freiwillige Angabe)',
+
+       // P
+       'periodicite' => ' days.',
+       'prenom' => 'Vorname',
+
+       // R
+       'rubrique' => 'Artikel der Rubrik auflisten',
+
+       // S
+       'souhaite_rester' => 'Ich möchte auf dem Laufenden bleiben',
+       'sujet' => 'Thema der Mail',
+       'sujet_obligatoire' => 'Es muss ein Thema angegeben werden.',
+       'supprimer' => 'Löschen',
+       'sympa_message_confirmation' => 'Eine Bestätigungsmail wurde an folgende Adresse gesendet: ', # MODIF
+
+       // T
+       'template' => 'Modell und Inhalte auswählen',
+       'template_defaut' => 'Default template',
+       'titre_abomailman' => 'Bezeichnung der Liste',
+       'titre_liste_obligatoire' => 'Die Liste muss eine Bezeichnung erhalten',
+       'toute_liste' => 'ALle Mailinglisten', # MODIF
+
+       // V
+       'verifier_formulaire' => 'Überprüfen sie den Inhalt des Formulars.',
+       'veut_s_abonner' => 'want to subscribe',
+       'veut_se_desabonner' => 'want to unsubscribe',
+       'votre_email' => 'Ihre E-Mail'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/abomailmans_en.php b/www/plugins/abomailmans/lang/abomailmans_en.php
new file mode 100755 (executable)
index 0000000..89527c5
--- /dev/null
@@ -0,0 +1,140 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/abomailmans?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailman' => 'Newsletter or mailing list',
+       'abomailmans' => 'Mailing lists or newsletters',
+       'abonne' => 'I subscribe',
+       'activation' => 'Activation',
+       'active' => 'Active',
+       'aucune_langue' => 'None specified',
+
+       // B
+       'bouton_listes_diffusion' => 'Mailing lists',
+       'btn_abonnement' => 'Subscribe',
+       'btn_desabonnement' => 'Unsubscribe',
+
+       // C
+       'choisir_liste' => 'You should choose a list.',
+       'contenu_date' => 'Content since this date',
+       'creation_droits_insuffisants' => 'Your rights are insufficients',
+
+       // D
+       'desactive' => 'Disabled',
+       'destinataire' => 'Recipient',
+
+       // E
+       'email' => 'Email address',
+       'email_abonnement' => 'Your email address',
+       'email_envoye' => 'The email has been sent to the list : @liste@.',
+       'email_oublie' => 'You forgot your email address',
+       'emailliste_abomailman' => 'The email address of the list',
+       'emailliste_abosympa' => 'The email address of the Sympa admin',
+       'emailliste_subscribe' => 'Subscribe',
+       'emailliste_unsubscribe' => 'Unsubscribe',
+       'emails_a_renseigner' => 'Email addresses to provide',
+       'envoi_apercu' => 'Previsualization',
+       'envoi_confirmer' => 'Confirm and send',
+       'envoi_liste_parametres' => 'List of parameters [Facultatif]',
+       'envoi_parametres' => 'Settings',
+       'envoi_regulier' => 'Automatics mail',
+       'envoi_regulier_info' => 'Leave empty if you do not want to send automatically',
+       'envoi_regulier_tous_les' => 'Send each',
+       'envoi_vers' => 'send to',
+       'envoyer_courier' => 'Send an email',
+       'envoyer_courier_liste' => 'Send this content to this list :',
+       'envoyer_mailmans' => 'Select the template and its content',
+       'erreur_email_liste_oublie' => 'The email address of the list is mandatory',
+       'erreur_nobot' => 'No registration has been made ​​due to a technical problem',
+       'explication_email_subscribe' => 'Email for subscribe, something like <code>suffix+subscribe@exemple.org</code>',
+       'explication_email_sympa' => 'If this field is filled in, the list is considered as a "Sympa" list, if not, as a "Mailman" list.',
+       'explication_email_unsubscribe' => 'Email for unsubscribe',
+
+       // I
+       'icone_ajouter_liste' => 'Add a new list',
+       'icone_envoyer_mail_liste' => 'Send an e-mail to the lists from the content of this site',
+       'icone_modifier_abomailman' => 'Edit the list',
+       'icone_retour_abomailman' => 'Back to the list',
+       'info_abomailman_aucun' => 'No list',
+       'info_abomailmans_1' => 'A list',
+       'info_abomailmans_nb' => '@nb@ lists',
+       'info_sisympa' => '[Mandatory for a Sympa list]',
+       'insciption_listes_legende' => 'Subscription to the mailing lists',
+       'inscription_lettres_legende' => 'Subscription to the newsletters<br />and mailing lists',
+
+       // J
+       'je_m_abonne' => 'Check to confirm the subscription or unsubscription.',
+
+       // L
+       'label_etat_liste' => 'Status of the list',
+       'label_type_abo' => 'Type',
+       'label_type_ml' => 'Mailing-list',
+       'label_type_news' => 'Newsletter',
+       'langue_liste' => 'Language of the list',
+       'legende_inscription_ml' => 'Subscription to the mailing list',
+       'legende_inscription_news' => 'Subscription to the newsletter',
+       'legende_inscriptions_ml' => 'Subscription to the mailing lists',
+       'legende_inscriptions_news' => 'Subscription to the newsletters',
+       'les_listes_mailmans' => 'The Mailman’s or Sympa’s lists filled',
+       'lire_article' => 'Read the article',
+       'liste_creee' => 'The list number @id@ (@titre@) has been created.',
+       'liste_non_existante' => 'The asked list doesn’t exist or has been deleted',
+       'liste_oublie' => 'You forgot to check a list.',
+       'liste_supprimee' => 'The list number @id@ (@titre@) has been deleted.',
+       'liste_updatee' => 'The list number @id@ (@titre@) has been updated.',
+
+       // M
+       'message' => 'Introduction of your email, before the site’s content',
+       'message_confirm_suite' => 'To validate your request, please reply to the confirmation email that you will receive.',
+       'message_confirmation_a' => 'A subscription request to the following lists has been sent :',
+       'message_confirmation_d' => 'An unsubscribing request from the lists below has been sent. ',
+       'message_confirmation_unique_a' => 'A subscription request to the following list has been sent :',
+       'message_confirmation_unique_d' => 'An unsubscribing request from the list below has been sent. ',
+       'mot' => 'And list the articles linked to the keyword',
+
+       // N
+       'nom' => 'Name and surname (optional)',
+       'nouveau_abomailman' => 'New mailing list',
+
+       // P
+       'pas_template_txt' => 'There is no text version for this template',
+       'periodicite' => ' days.',
+       'prenom' => 'First name',
+       'previsu_html' => 'html',
+       'previsu_txt' => 'text',
+
+       // R
+       'rubrique' => 'And list the articles of the section',
+
+       // S
+       'souhaite_rester' => 'I wish to keep informed',
+       'sujet' => 'Subject of the mail',
+       'sujet_obligatoire' => 'The subject is mandatory.',
+       'suppression_definitive' => 'Permanent removal !',
+       'supprimer' => 'Delete',
+       'sympa_message_confirmation' => 'A validation email has been sent to the address: ',
+
+       // T
+       'template' => 'Choose a template and his content',
+       'template_defaut' => 'Default template',
+       'template_defaut_info' => 'If the file "choosed_template.txt.html" exists, the newsletter will be sent in html + text format. Otherwise, only the html version will be sent.',
+       'texte_descriptif' => 'Description',
+       'titre_abomailman' => 'Title of the list',
+       'titre_liste_obligatoire' => 'The title of the list is mandatory',
+       'toute_liste' => 'All mailing lists',
+
+       // V
+       'verifier_formulaire' => 'Please verify the filling of the form.',
+       'veut_s_abonner' => 'want to subscribe',
+       'veut_se_desabonner' => 'want to unsubscribe',
+       'voir_modele_depuis' => 'See an example of the template with',
+       'votre_email' => 'Your email'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/abomailmans_es.php b/www/plugins/abomailmans/lang/abomailmans_es.php
new file mode 100644 (file)
index 0000000..8ca4b81
--- /dev/null
@@ -0,0 +1,140 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/abomailmans?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailman' => 'Lista de difusión o discusiones',
+       'abomailmans' => 'Listas de difusión o discusiones',
+       'abonne' => 'Me suscribo',
+       'activation' => 'Activación',
+       'active' => 'Activo',
+       'aucune_langue' => 'Ninguno específico',
+
+       // B
+       'bouton_listes_diffusion' => 'Listas de difusión',
+       'btn_abonnement' => 'Suscribirse',
+       'btn_desabonnement' => 'Darse de baja',
+
+       // C
+       'choisir_liste' => 'Debe elegir una lista.',
+       'contenu_date' => 'Contenido a partir de esta fecha',
+       'creation_droits_insuffisants' => 'Sus derechos son insuficientes...',
+
+       // D
+       'desactive' => 'Desactivado',
+       'destinataire' => 'Destinatario',
+
+       // E
+       'email' => 'Correo electrónico',
+       'email_abonnement' => 'Su dirección de correo electrónico',
+       'email_envoye' => 'El correo electrónico ha sido enviado a la lista de difusión: @liste@.',
+       'email_oublie' => 'Ha olvidado su dirección de correo electrónico',
+       'emailliste_abomailman' => 'La dirección de correo electrónico de la lista',
+       'emailliste_abosympa' => 'La dirección de correo electrónico del administrador Sympa',
+       'emailliste_subscribe' => 'Suscripción',
+       'emailliste_unsubscribe' => 'Baja como suscriptor',
+       'emails_a_renseigner' => 'Correos electrónicos a reportar',
+       'envoi_apercu' => 'Vista previa',
+       'envoi_confirmer' => 'Confirmar y enviar',
+       'envoi_liste_parametres' => 'Lista de parámetros de configuración [Opcional]',
+       'envoi_parametres' => 'Configuración',
+       'envoi_regulier' => 'Envíos automáticos',
+       'envoi_regulier_info' => 'Dejar en blanco para no recibir envíos automáticos',
+       'envoi_regulier_tous_les' => 'Enviar todos los',
+       'envoi_vers' => 'enviar a',
+       'envoyer_courier' => 'Envíar un correo electrónico',
+       'envoyer_courier_liste' => 'Enviar este correo electrónico a esta lista de difusión:',
+       'envoyer_mailmans' => 'Seleccionar el modelo y su contenido',
+       'erreur_email_liste_oublie' => 'La dirección de correo electrónico es obligatoria',
+       'erreur_nobot' => 'Su inscripción no ha podido efectuarse debido a un problema técnico',
+       'explication_email_subscribe' => 'Correo electrónico de suscripción, del estilo <code>suffixe+subscribe@exemple.org</code>',
+       'explication_email_sympa' => 'Si este campo es reportado, la lista se considera como una lista de servidor "Sympa", en caso contrario como una lista "Mailman" o "ezmlm".',
+       'explication_email_unsubscribe' => 'Correo electrónico de baja de suscripción',
+
+       // I
+       'icone_ajouter_liste' => 'Añadir una nueva lista',
+       'icone_envoyer_mail_liste' => 'Enviar un correo electrónico a los boletines a partir del contenido de este sitio',
+       'icone_modifier_abomailman' => 'Modificar la lista',
+       'icone_retour_abomailman' => 'Volver a la lista',
+       'info_abomailman_aucun' => 'Ninguna lista',
+       'info_abomailmans_1' => 'Una lista',
+       'info_abomailmans_nb' => '@nb@ listas',
+       'info_sisympa' => '[Obligatorio en caso de liste Sympa]',
+       'insciption_listes_legende' => 'Suscripción a las listas de suscripción',
+       'inscription_lettres_legende' => 'Suscripción a las listas de difusión y de discusiones',
+
+       // J
+       'je_m_abonne' => 'Marque para validar la suscripción o la baja en la suscripción',
+
+       // L
+       'label_etat_liste' => 'Estado de la lista',
+       'label_type_abo' => 'Tipo',
+       'label_type_ml' => 'Lista de discusión',
+       'label_type_news' => 'Lista de difusión',
+       'langue_liste' => 'Idioma de la lista',
+       'legende_inscription_ml' => 'Inscripción a la lista de discusión',
+       'legende_inscription_news' => 'Inscripción en la lista de difusión',
+       'legende_inscriptions_ml' => 'Inscripción en la listas de discusión',
+       'legende_inscriptions_news' => 'Inscripción a las listas de difusión',
+       'les_listes_mailmans' => 'Listas mailmans, sympa o ezmlm reportadas',
+       'lire_article' => 'Leer artículo',
+       'liste_creee' => 'La lista número @id@ (@titre@) ha sido creada.',
+       'liste_non_existante' => 'La lista solicitada no existe o ha sido eliminada',
+       'liste_oublie' => '¡Ha olvidado marcar una lista!',
+       'liste_supprimee' => 'La lista número @id@ (@titre@) ha sido eliminada.',
+       'liste_updatee' => 'La lista número @id@ (@titre@) ha sido actualizada.',
+
+       // M
+       'message' => 'Introducción a su correo, antes del contenido del sitio',
+       'message_confirm_suite' => 'Para confirmar su solicitud, responda a la solicitud de confirmación que ha recibido por correo electrónico.',
+       'message_confirmation_a' => 'Una solicitud de suscripción a las siguientes listas acaba de ser enviada:',
+       'message_confirmation_d' => 'Una solicitud de baja en la suscripción a las siguientes listas acaba de ser enviada.',
+       'message_confirmation_unique_a' => 'Una solicitud de suscripción a la siguiente lista acaba de ser enviada:',
+       'message_confirmation_unique_d' => 'Una solicitud de baja de la suscripción a la siguiente lista acaba de ser enviada. ',
+       'mot' => 'Y listar los artículos de la palabra clave',
+
+       // N
+       'nom' => 'Apellidos y nombre (opcional)',
+       'nouveau_abomailman' => 'Nueva lista de difusión',
+
+       // P
+       'pas_template_txt' => 'No hay una versión texto para este modelo',
+       'periodicite' => ' días.',
+       'prenom' => 'Nombre',
+       'previsu_html' => 'html',
+       'previsu_txt' => 'texto',
+
+       // R
+       'rubrique' => 'Y listar los artículos de la sección',
+
+       // S
+       'souhaite_rester' => 'Quiero estar informado/a',
+       'sujet' => 'Asunto del correo electrónico',
+       'sujet_obligatoire' => 'El asunto es obligatorio.',
+       'suppression_definitive' => '¡Eliminación definitiva!',
+       'supprimer' => 'Eliminar',
+       'sympa_message_confirmation' => 'Un correo electrónico de confirmación ha sido enviado a la dirección: ',
+
+       // T
+       'template' => 'Elija el modelo y su contenido',
+       'template_defaut' => 'Modelo por defecto',
+       'template_defaut_info' => 'Si el archivo modelo_elegido.txt.html existe, el boletín será enviado en modo html + texte. Si no, sólo la versión html será expedida. ',
+       'texte_descriptif' => 'Descripción',
+       'titre_abomailman' => 'Título de la lista',
+       'titre_liste_obligatoire' => 'El título de la lista es obligatorio',
+       'toute_liste' => 'Todas las listas de difusión',
+
+       // V
+       'verifier_formulaire' => 'Verifique el contenido del formulario.',
+       'veut_s_abonner' => 'quiere suscribirse',
+       'veut_se_desabonner' => 'quiere darse de baja',
+       'voir_modele_depuis' => 'Ver un ejemplo del modelo con',
+       'votre_email' => 'Su correo electrónico'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/abomailmans_fr.php b/www/plugins/abomailmans/lang/abomailmans_fr.php
new file mode 100755 (executable)
index 0000000..13f687e
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/abomailmans/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailman' => 'Liste de diffusion ou discussions',
+       'abomailmans' => 'Listes de diffusion ou discussions',
+       'abonne' => 'Je m’abonne',
+       'activation' => 'Activation',
+       'active' => 'Active',
+       'aucune_langue' => 'Aucune spécifique',
+
+       // B
+       'bouton_listes_diffusion' => 'Les listes de diffusion',
+       'btn_abonnement' => 'S’abonner',
+       'btn_desabonnement' => 'Se désabonner',
+
+       // C
+       'choisir_liste' => 'Vous devez choisir une liste.',
+       'contenu_date' => 'Contenu à partir de cette date',
+       'creation_droits_insuffisants' => 'Vos droits sont insuffisants...',
+
+       // D
+       'desactive' => 'Désactivée',
+       'destinataire' => 'Destinataire',
+
+       // E
+       'email' => 'E-mail',
+       'email_abonnement' => 'Votre adresse e-mail',
+       'email_envoye' => 'L’e-mail a été envoyé à la liste de diffusion : @liste@.',
+       'email_oublie' => 'Vous avez oublié votre adresse e-mail',
+       'emailliste_abomailman' => 'L’adresse e-mail de la liste',
+       'emailliste_abosympa' => 'L’adresse e-mail de l’administrateur Sympa',
+       'emailliste_subscribe' => 'Abonnement',
+       'emailliste_unsubscribe' => 'Désabonnement',
+       'emails_a_renseigner' => 'Emails à renseigner',
+       'envoi_apercu' => 'Aperçu',
+       'envoi_confirmer' => 'Confirmer et envoyer',
+       'envoi_liste_parametres' => 'Liste des paramètres [Facultatif]',
+       'envoi_parametres' => 'Paramètres',
+       'envoi_regulier' => 'Envois automatiques',
+       'envoi_regulier_info' => 'Laisser vide pour ne pas avoir d’envois automatiques',
+       'envoi_regulier_tous_les' => 'Envoi tous les',
+       'envoi_vers' => 'envoi vers',
+       'envoyer_courier' => 'Envoyer un courrier',
+       'envoyer_courier_liste' => 'Envoyer ce courrier à cette liste de diffusion :',
+       'envoyer_mailmans' => 'Sélectionner le modèle et son contenu',
+       'erreur_email_liste_oublie' => 'L’adresse email de la liste est obligatoire',
+       'erreur_nobot' => 'Votre inscription n’ a pu être effectué à cause d’un problème technique',
+       'explication_email_subscribe' => 'Email d’abonnement, de style <code>suffixe+subscribe@exemple.org</code>',
+       'explication_email_sympa' => 'Si ce champ est renseigné, la liste est considérée comme une liste de serveur "Sympa", dans le cas contraire comme une liste "Mailman" ou "ezmlm".',
+       'explication_email_unsubscribe' => 'Email de désabonnement',
+
+       // I
+       'icone_ajouter_liste' => 'Ajouter une nouvelle liste',
+       'icone_envoyer_mail_liste' => 'Envoyer un e-mail aux lettres à partir du contenu de ce site',
+       'icone_modifier_abomailman' => 'Modifier la liste',
+       'icone_retour_abomailman' => 'Retour à la liste',
+       'info_abomailman_aucun' => 'Aucune liste',
+       'info_abomailmans_1' => 'Une liste',
+       'info_abomailmans_nb' => '@nb@ listes',
+       'info_sisympa' => '[Obligatoire si liste Sympa]',
+       'insciption_listes_legende' => 'Abonnement aux listes de diffusion',
+       'inscription_lettres_legende' => 'Abonnement aux listes de diffusion et de discussions',
+
+       // J
+       'je_m_abonne' => 'Cochez pour valider l’abonnement ou le désabonnement.',
+
+       // L
+       'label_etat_liste' => 'État de la liste',
+       'label_type_abo' => 'Type',
+       'label_type_ml' => 'Liste de discussion',
+       'label_type_news' => 'Liste de diffusion',
+       'langue_liste' => 'Langue de la liste',
+       'legende_inscription_ml' => 'Inscription à la liste de discussion',
+       'legende_inscription_news' => 'Inscription à la liste de diffusion',
+       'legende_inscriptions_ml' => 'Inscription aux listes de discussion',
+       'legende_inscriptions_news' => 'Inscription aux listes de diffusion',
+       'les_listes_mailmans' => 'Les listes mailmans, sympa ou ezmlm renseignées',
+       'lire_article' => 'Lire l’article',
+       'liste_creee' => 'La liste numéro @id@ (@titre@) a été créée.',
+       'liste_non_existante' => 'La liste demandée n’existe pas ou a été supprimée',
+       'liste_oublie' => 'Vous avez oublié de cocher une liste !',
+       'liste_supprimee' => 'La liste numéro @id@ (@titre@) a été supprimée.',
+       'liste_updatee' => 'La liste numéro @id@ (@titre@) a été mise à jour.',
+
+       // M
+       'message' => 'Introduction à votre courrier, avant le contenu issu du site',
+       'message_confirm_suite' => 'Pour valider votre demande, répondez à la demande de confirmation que vous allez recevoir par mail.',
+       'message_confirmation_a' => 'Une demande d’abonnement aux listes suivantes vient d’être envoyée :',
+       'message_confirmation_d' => 'Une demande de désabonnement aux listes suivantes vient d’être envoyée. ',
+       'message_confirmation_unique_a' => 'Une demande d’abonnement à la liste suivante vient d’être envoyée :',
+       'message_confirmation_unique_d' => 'Une demande de désabonnement à la liste suivante vient d’être envoyée. ',
+       'mot' => 'Et lister les articles du mot clé',
+
+       // N
+       'nom' => 'Nom et prénom (facultatif)',
+       'nouveau_abomailman' => 'Nouvelle liste de diffusion',
+
+       // P
+       'pas_template_txt' => 'Il n’y a pas de version texte pour ce modèle',
+       'periodicite' => ' jours.',
+       'prenom' => 'Prénom',
+       'previsu_html' => 'html',
+       'previsu_txt' => 'texte',
+
+       // R
+       'rubrique' => 'Et lister les articles de la rubrique',
+
+       // S
+       'souhaite_rester' => 'Je souhaite rester informé-e',
+       'sujet' => 'Sujet du courrier',
+       'sujet_obligatoire' => 'Le sujet est obligatoire.',
+       'suppression_definitive' => 'Suppression définitive !',
+       'supprimer' => 'Supprimer',
+       'sympa_message_confirmation' => 'Un email de validation a été envoyé à l’adresse : ',
+
+       // T
+       'template' => 'Choisissez le modèle et son contenu',
+       'template_defaut' => 'Modèle par défaut',
+       'template_defaut_info' => 'Si le fichier modele_choisi.txt.html existe, la newsletter sera envoyée en mode html + texte. Sinon seule la version html sera expédiée.',
+       'texte_descriptif' => 'Descriptif',
+       'titre_abomailman' => 'Titre de la liste',
+       'titre_liste_obligatoire' => 'Le titre de la liste est obligatoire',
+       'toute_liste' => 'Toutes les listes de diffusion',
+
+       // V
+       'verifier_formulaire' => 'Vérifiez le remplissage du formulaire.',
+       'veut_s_abonner' => 'veut s’abonner',
+       'veut_se_desabonner' => 'veut se désabonner',
+       'voir_modele_depuis' => 'Voir un exemple du modèle avec',
+       'votre_email' => 'Votre email'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/abomailmans_sk.php b/www/plugins/abomailmans/lang/abomailmans_sk.php
new file mode 100644 (file)
index 0000000..e26de39
--- /dev/null
@@ -0,0 +1,140 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/abomailmans?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailman' => 'E-mailová alebo diskusná skupina',
+       'abomailmans' => 'E-mailové alebo diskusné skupiny',
+       'abonne' => 'Prihlasujem sa na odoberanie',
+       'activation' => 'Aktivácia',
+       'active' => 'Aktivovaný',
+       'aucune_langue' => 'Žiaden konkrétny',
+
+       // B
+       'bouton_listes_diffusion' => 'E-mailové skupiny',
+       'btn_abonnement' => 'Prihlásiť sa na odoberanie',
+       'btn_desabonnement' => 'Odhlásiť sa z odoberania',
+
+       // C
+       'choisir_liste' => 'Musíte si vybrať skupinu.',
+       'contenu_date' => 'Novinky z tohto dňa',
+       'creation_droits_insuffisants' => 'Vaše práva sú nedostatočné.',
+
+       // D
+       'desactive' => 'Deaktivovaný',
+       'destinataire' => 'Príjemca',
+
+       // E
+       'email' => 'E-mail',
+       'email_abonnement' => 'Vaša e-mailová adresa',
+       'email_envoye' => 'E-mail bol odoslaný do skupiny: @liste@.',
+       'email_oublie' => 'Zabudli ste svoju e-mailovú adresu',
+       'emailliste_abomailman' => 'E-mailová adresa skupiny',
+       'emailliste_abosympa' => 'E-mailová adresa administrátora (Sympa)',
+       'emailliste_subscribe' => 'Prihlásenie na odoberanie',
+       'emailliste_unsubscribe' => 'Odhlásenie sa z odoberania',
+       'emails_a_renseigner' => 'E-maily pre informácie',
+       'envoi_apercu' => 'Anketa',
+       'envoi_confirmer' => 'Potvrdiť a poslať',
+       'envoi_liste_parametres' => 'Zoznam parametrov [Nepovinné]',
+       'envoi_parametres' => 'Parametre',
+       'envoi_regulier' => 'Automatické odosielanie',
+       'envoi_regulier_info' => 'Nevypĺňajte, ak nechcete využívať automatické odosielanie',
+       'envoi_regulier_tous_les' => 'Poslať všetky',
+       'envoi_vers' => 'príjemca',
+       'envoyer_courier' => 'Poslať e-mail',
+       'envoyer_courier_liste' => 'Tento e-mail poslať do e-mailovej skupiny:',
+       'envoyer_mailmans' => 'Vyberte si šablónu a jej obsah',
+       'erreur_email_liste_oublie' => 'E-mailová adresa skupiny je povinný údaj',
+       'erreur_nobot' => 'Registrácia sa z technických príčin neuskutočnila',
+       'explication_email_subscribe' => 'E-mail na prihlásenie sa na odoberanie v podobe<code>suffixe+subscribe@exemple.org</code>',
+       'explication_email_sympa' => 'Ak toto pole vyplníte, skupina bude považovaná za skupinu servera Sympa, v opačnom prípade za skupinu servera "Mailman" alebo "ezmlm".',
+       'explication_email_unsubscribe' => 'E-mail na odhlásenie',
+
+       // I
+       'icone_ajouter_liste' => 'Pridať novú skupinu',
+       'icone_envoyer_mail_liste' => 'Poslať e-mail s textom tejto stránky',
+       'icone_modifier_abomailman' => 'Upraviť skupinu',
+       'icone_retour_abomailman' => 'Vrátiť sa na skupinu',
+       'info_abomailman_aucun' => 'Žiadna skupina',
+       'info_abomailmans_1' => 'Jedna skupina',
+       'info_abomailmans_nb' => '@nb@ skupín',
+       'info_sisympa' => '(Povinné pre skupinu Sympa)',
+       'insciption_listes_legende' => 'Odoberanie príspevkov e-mailových skupín',
+       'inscription_lettres_legende' => 'Odoberanie príspevkov e-mailových a diskusných skupín',
+
+       // J
+       'je_m_abonne' => 'Označením príslušného poľa potvrďte svoje prihlásenie alebo odhlásenie.',
+
+       // L
+       'label_etat_liste' => 'Stav skupiny',
+       'label_type_abo' => 'Typ',
+       'label_type_ml' => 'Diskusná skupina',
+       'label_type_news' => 'E-mailová skupina',
+       'langue_liste' => 'Jazyk skupiny',
+       'legende_inscription_ml' => 'Registrácia do diskusnej skupiny',
+       'legende_inscription_news' => 'Registrácia do e-mailovej skupiny',
+       'legende_inscriptions_ml' => 'Registrácia do diskusných skupín',
+       'legende_inscriptions_news' => 'Registrácia do e-mailových skupín',
+       'les_listes_mailmans' => 'Informované skupiny mailmans, sympa alebo ezmlm',
+       'lire_article' => 'Čítať článok',
+       'liste_creee' => 'Skupina číslo @id@ (@titre@) bola vytvorená.',
+       'liste_non_existante' => 'Požadovaná skupina neexistuje alebo bola vymazaná',
+       'liste_oublie' => 'Zabudli ste skontrolovať skupinu!',
+       'liste_supprimee' => 'Skupina číslo @id@ (@titre@) bola vymazaná.',
+       'liste_updatee' => 'Skupina číslo @id@ (@titre@) bola aktualizovaná.',
+
+       // M
+       'message' => 'Úvod do e-mailu pred obsahom stránky',
+       'message_confirm_suite' => 'Ak chcete potvrdiť požiadavku, postupujte podľa pokynov, ktoré dostanete e-mailom.',
+       'message_confirmation_a' => 'Bola odoslaná požiadavka na prihlásenie na odoberanie príspevkov týchto skupín:',
+       'message_confirmation_d' => 'Požiadavka na odhlásenie z odoberania príspevkov týchto skupín bola odoslaná.',
+       'message_confirmation_unique_a' => 'Bola odoslaná požiadavka na odoberanie príspevkov z tejto skupiny:',
+       'message_confirmation_unique_d' => 'Požiadavka na odhlásenie sa z odoberania príspevkov z tejto skupiny bola odoslaná.',
+       'mot' => 'A vypísať články s kľúčovým slovom ',
+
+       // N
+       'nom' => 'Priezvisko a meno (nepovinné)',
+       'nouveau_abomailman' => 'Nová e-mailová skupina',
+
+       // P
+       'pas_template_txt' => 'K tejto šablóne neexistuje textová verzie',
+       'periodicite' => ' dní/dni.',
+       'prenom' => 'Krstné meno',
+       'previsu_html' => 'html',
+       'previsu_txt' => 'nenaformátovaný text',
+
+       // R
+       'rubrique' => 'A vypísať články z rubriky',
+
+       // S
+       'souhaite_rester' => 'Chcem mať prehľad',
+       'sujet' => 'Predmet e-mailu',
+       'sujet_obligatoire' => 'Predmet je povinný.',
+       'suppression_definitive' => 'Definitívne odstránenie!',
+       'supprimer' => 'Odstrániť',
+       'sympa_message_confirmation' => 'Potvrdzovací e-mail bol odoslaný na túto adresu: ',
+
+       // T
+       'template' => 'Vyberte si šablónu a jej obsah',
+       'template_defaut' => 'Predvolená šablóna',
+       'template_defaut_info' => 'Ak súbor modele_choisi.txt.html existuje, bulletin bude odoslaný vo verzii html aj ako text. Inak bude odoslaný iba vo verzii html.',
+       'texte_descriptif' => 'Opis',
+       'titre_abomailman' => 'Názov skupiny',
+       'titre_liste_obligatoire' => 'Názov skupiny je povinný údaj',
+       'toute_liste' => 'Všetky e-mailové skupiny',
+
+       // V
+       'verifier_formulaire' => 'Skontrolujte, ako ste vyplnili formulár.',
+       'veut_s_abonner' => 'chcem sa prihlásiť',
+       'veut_se_desabonner' => 'chcem sa odhlásiť',
+       'voir_modele_depuis' => 'Zobraziť príklad šablóny s ',
+       'votre_email' => 'Váš e-mail'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans.xml b/www/plugins/abomailmans/lang/paquet-abomailmans.xml
new file mode 100644 (file)
index 0000000..909001c
--- /dev/null
@@ -0,0 +1,15 @@
+<traduction module="paquet-abomailmans" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/abomailmans/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=de" total="3" traduits="2" relire="0" modifs="0" nouveaux="1" pourcent="66.67">
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=en" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=es" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
+       </langue>
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=fr" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=sk" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans_de.php b/www/plugins/abomailmans/lang/paquet-abomailmans_de.php
new file mode 100644 (file)
index 0000000..3df03c7
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailmans_description' => 'Dieses Plugin ermöglich mit dem TAG #FORMULAIRE_ABOMAILMAN das Abnonnieren von Mailinglisten.
+                       Dem Adminstrator steht ein Interface zur Verwaltung dieser Listen zur Verfügung.',
+       'abomailmans_nom' => 'Abonnieren Sie Mailing-Listen'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans_en.php b/www/plugins/abomailmans/lang/paquet-abomailmans_en.php
new file mode 100644 (file)
index 0000000..125c1ac
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailmans_description' => 'This plugin adds a registration form to mailing lists and newsletters services as [Mailman->http://www.gnu.org/software/mailman/], [Ezmlm->http://www.ezmlm.org/] or [Sympa->http://www.sympa.org].
+
+The administrator can manage the lists from the private space via a dedicated interface.',
+       'abomailmans_nom' => 'Mailing lists and newsletters subscription',
+       'abomailmans_slogan' => 'Interface your Mailman, Ezmlm or Sympa mailing lists and newsletters with SPIP'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans_es.php b/www/plugins/abomailmans/lang/paquet-abomailmans_es.php
new file mode 100644 (file)
index 0000000..3ec6930
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailmans_description' => 'Este plugin permite a través de una etiqueta #FORMULAIRE_ABOMAILMAN mostrar un formulario de suscripción al conjunto de las listas [Mailman->http://www.gnu.org/software/mailman/], [Ezmlm->http://www.ezmlm.org/] o [Sympa->http://www.sympa.org] renseignées.
+_ Esta inscripción se hace a través de la interfaz privada de SPIP por el menú "Edición Abomailmans listas de difusiones mailman".
+_ A continuación puede seleccionar artículos de su SPIP, por criterios de fecha, de sección y/o de palabra clave y enviar su contenido a estas listas, usando esqueletos de formateo de contenido.
+_ El enlace con las listas Mailman, Ezmlm y Sympa se hace por envíos de correo electrónico. ',
+       'abomailmans_nom' => 'Suscripción a las listas de difusión',
+       'abomailmans_slogan' => 'Vincular sus listas de difusiones mailman, ezmlm o sympa con su SPIP'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans_fr.php b/www/plugins/abomailmans/lang/paquet-abomailmans_fr.php
new file mode 100644 (file)
index 0000000..1b389ce
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/abomailmans/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailmans_description' => 'Ce plugin permet via une balise #FORMULAIRE_ABOMAILMAN d’afficher un formulaire d’abonnement à l’ensemble des listes [Mailman->http://www.gnu.org/software/mailman/], [Ezmlm->http://www.ezmlm.org/] ou [Sympa->http://www.sympa.org] renseignées.
+_ Cette inscription se fait via l’interface privée de SPIP par le menu "Edition Abomailmans les listes de diffusions mailman".
+_ Ensuite il vous est possible de sélectionner des articles de votre SPIP, par des critères de date, de rubrique et/ou de mot-clé et envoyer leurs contenus à ces listes, en utilisant des squelettes de mise en page du contenu.
+_ Le lien avec les listes Mailman, Ezmlm et Sympa se fait par des envois d’e-mail.',
+       'abomailmans_nom' => 'Abonnement à des listes de diffusion',
+       'abomailmans_slogan' => 'Interfacer vos listes de diffusions mailman, ezmlm ou sympa avec votre SPIP'
+);
+
+?>
diff --git a/www/plugins/abomailmans/lang/paquet-abomailmans_sk.php b/www/plugins/abomailmans/lang/paquet-abomailmans_sk.php
new file mode 100644 (file)
index 0000000..817dd1e
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-abomailmans?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'abomailmans_description' => 'Tento zásuvný modul umožňuje pomocou tagu #FORMULAIRE_ABOMAILMAN zobraziť formulár na prihlásenie sa na odoberanie príspevkov celého radu typov skupín (resp. konferencií)  [Mailman,->http://www.gnu.org/software/mailman/] [Ezmlm->http://www.ezmlm.org/] alebo [Sympa.->http://www.sympa.org] 
+_ Registrácia sa vykonáva cez súkromnú zónu SPIPu pomocou menu "Úprava skupín typu mailman".
+_ Potom si zo svojej stránky v SPIPe môžete vybrať články  podľa dátumu, rubriky a/lebo kľúčového slova a poslať ich do týchto skupín (resp. konferencií, mailing listov) pomocou šablón na úpravu vzhľadu textu.
+_ Odkaz na skupiny Mailman, Ezmlm a Sympa získate odoslaním e-mailu.',
+       'abomailmans_nom' => 'Odoberanie príspevkov e-mailových konferencií (skupín)',
+       'abomailmans_slogan' => 'Ovládajte svoje e-mailové skupiny, (e-mailové konferencie), diskusné skupiny či mailing listy typu mailman, ezmlm alebo sympa so svojím SPIPom'
+);
+
+?>
diff --git a/www/plugins/abomailmans/paquet.xml b/www/plugins/abomailmans/paquet.xml
new file mode 100644 (file)
index 0000000..1a33da3
--- /dev/null
@@ -0,0 +1,34 @@
+<paquet\r
+       prefix="abomailmans"\r
+       categorie="communication"\r
+       version="1.1.6"\r
+       etat="stable"\r
+       compatibilite="[3.0.0;3.0.*]"\r
+       logo="prive/themes/spip/images/abomailmans-32.png"\r
+       schema="0.34"\r
+       documentation="http://www.spip-contrib.net/Abomailmans-pour-s-abonner-a-des-listes-de-diffusion"\r
+>      \r
+\r
+       <nom>Abonnement à des listes de diffusion</nom>\r
+       <!-- Interfacer vos listes de diffusions mailman, ezmlm ou sympa avec votre SPIP -->\r
+\r
+       <auteur lien="http://www.netaktiv.com">NetAktiv</auteur>\r
+       <auteur lien="http://www.elastick.net">Anne-lise Martenot</auteur>\r
+       <auteur>Yffic</auteur>\r
+       <auteur lien="http://www.kent1.info">kent1</auteur>\r
+       <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>\r
+       \r
+       <traduire module="abomailmans" reference="fr" gestionnaire="salvatore" />\r
+       <traduire module="paquet-abomailmans" reference="fr" gestionnaire="salvatore" />\r
+       \r
+       <pipeline nom="declarer_tables_interfaces" inclure="base/abomailmans_install.php" />\r
+       <pipeline nom="declarer_tables_objets_sql" inclure="base/abomailmans_install.php" />\r
+       <pipeline nom="taches_generales_cron" inclure="abomailmans_pipelines.php" />\r
+       <pipeline nom="abomailmans" action="go" inclure="abomailmans_pipelines.php" />\r
+       <pipeline nom="autoriser" inclure="abomailmans_autoriser.php" />\r
+\r
+       <necessite nom="facteur" compatibilite="[2.0.0;[" />\r
+       \r
+       <menu nom="abomailmans" titre="abomailmans:bouton_listes_diffusion" parent="bando_edition" icone="images/abomailmans-16.png" />\r
+       <menu nom="abomailman_edit" parametres="new=oui" titre="abomailmans:icone_ajouter_liste" parent="outils_rapides" icone="images/abomailmans-new-16.png" />\r
+</paquet>\r
diff --git a/www/plugins/abomailmans/prive/listes/abomailman_mots.html b/www/plugins/abomailmans/prive/listes/abomailman_mots.html
new file mode 100644 (file)
index 0000000..f50a3c2
--- /dev/null
@@ -0,0 +1,9 @@
+<BOUCLE_groupes_mots(GROUPES_MOTS){tables_liees LIKE %articles%}{par num titre,titre}>
+       <B_mots>
+               <optgroup label="[(#TITRE|supprimer_numero|attribut_html)]">
+               <BOUCLE_mots(MOTS){id_groupe}{par num titre,titre}>
+                       <option value="#ID_MOT"[(#ENV{id_mot}|=={#ID_MOT}|oui) selected="selected"]>[(#TITRE|supprimer_numero)]</option>
+               </BOUCLE_mots>
+               </optgroup>
+       </B_mots>
+</BOUCLE_groupes_mots>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/listes/abomailman_rubriques.html b/www/plugins/abomailmans/prive/listes/abomailman_rubriques.html
new file mode 100644 (file)
index 0000000..02ec561
--- /dev/null
@@ -0,0 +1,17 @@
+#SET{id_parent,#ENV{id_rubrique,0}}
+#SET{niveau,#ENV{niveau,1}}
+[(#GET{niveau}|>={2}|oui)
+       [(#SET{marge,#ENV{marge}|concat{----}})]
+       
+]
+<BOUCLE_rubriques(RUBRIQUES){id_parent=#GET{id_parent}}{par id_rubrique}>
+[(#GET{niveau}|=={1}|oui)
+       [(#SET{marge,&bull;})]
+]
+[(#GET{niveau}|=={2}|oui)
+       [(#SET{marge,'&nbsp;&nbsp;&nbsp;|----'})]
+]
+
+<option value="#ID_RUBRIQUE"[(#ENV{id_rubrique_env}|=={#ID_RUBRIQUE}|oui) selected="selected"]>#GET{marge}&nbsp;[(#TITRE|supprimer_numero)]</option>
+[(#INCLURE{fond=prive/listes/abomailman_rubriques}{niveau=[(#GET{niveau}|plus{1})]}{id_rubrique=#ID_RUBRIQUE}{id_rubrique_env}{marge=#GET{marge}})]
+</BOUCLE_rubriques>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/listes/abomailman_templates.html b/www/plugins/abomailmans/prive/listes/abomailman_templates.html
new file mode 100755 (executable)
index 0000000..a5c3340
--- /dev/null
@@ -0,0 +1,16 @@
+[(#REM) Tous les fichiers *.html, mais pas les .txt.html ]\r
+#SET{arraytemplate,#EVAL{find_all_in_path("templates/",".*(?<!txt)\.html$")}}\r
+\r
+<BOUCLE_abomailman(ABOMAILMANS){id_abomailman}>\r
+[(#SET{select,[(#MODELE_DEFAUT|nettoie_chemin)]})]\r
+</BOUCLE_abomailman>\r
+[(#ENV{template}|oui)\r
+[(#SET{select,[(#ENV{template})]})]\r
+]\r
+\r
+\r
+<BOUCLE_template(POUR){tableau #GET{arraytemplate}}{par valeur}>\r
+<option value="[(#VALEUR|nettoie_chemin)]" \r
+[(#GET{select}|=={[(#VALEUR|nettoie_chemin)]}|oui) selected="selected" ]>\r
+[(#VALEUR|nettoie_chemin)]</option>\r
+</BOUCLE_template>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/listes/listes_des_listes.html b/www/plugins/abomailmans/prive/listes/listes_des_listes.html
new file mode 100644 (file)
index 0000000..5b8556f
--- /dev/null
@@ -0,0 +1,20 @@
+<B_listes>
+<li class="editer abomailman_listes[ (#ENV**{erreurs}|table_valeur{listes}|oui)erreur]">
+       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{listes})</span>]
+       <ul>
+               <li class="editer_listes">
+                       [(#GRAND_TOTAL|>{1}|oui)
+                       <label><:abomailman:label_choisir_listes:></label>]
+               <BOUCLE_listes(ABOMAILMANS){id_abomailman ?}{desactive=0}>
+               <div class="choix">
+                       <input name="listes[]" type="checkbox" id="liste_#ID_ABOMAILMAN" value="#ID_ABOMAILMAN"[(#GRAND_TOTAL|=={1}|oui) checked="checked"] />
+                       <label for="liste_#ID_ABOMAILMAN" class="#EDIT{titre}">#TITRE</label>
+                       [<p class="explications #EDIT{descriptif}">
+                       (#DESCRIPTIF|PtoBR)
+                       </p>]
+               </div>
+               </BOUCLE_listes>
+               </li>
+       </ul>
+</li>
+</B_listes>
diff --git a/www/plugins/abomailmans/prive/objets/contenu/abomailman.html b/www/plugins/abomailmans/prive/objets/contenu/abomailman.html
new file mode 100644 (file)
index 0000000..3bd664d
--- /dev/null
@@ -0,0 +1,30 @@
+<BOUCLE_afficher_contenu(ABOMAILMANS){id_abomailman=#ENV{id,#ENV{id_abomailman}}}>
+<div class="champ contenu_titre[ (#TITRE*|strlen|?{'',vide})]">
+       <div class='label'><:info_titre:></div>
+       <div dir='#LANG_DIR' class='#EDIT{titre} titre'>#TITRE</div>
+</div>
+<div class="champ contenu_descriptif[ (#DESCRIPTIF*|strlen|?{'',vide})]">
+       <div class='label'><:info_descriptif:></div>
+       [(#DESCRIPTIF|image_reduire{500,0})]</div>
+</div>
+<div class="champ contenu_email[ (#EMAIL*|strlen|?{'',vide})]">
+       <div class='label'><:abomailmans:emailliste_abomailman:></div>
+       <div dir='#LANG_DIR' class='#EDIT{email} email'>[(#EMAIL)]</div>
+</div>
+[<div class="champ contenu_email_sympa[ (#EMAIL_SYMPA*|strlen|?{'',vide})]">
+       <div class='label'><:abomailmans:emailliste_abosympa:></div>
+       <div dir='#LANG_DIR' class='#EDIT{email_sympa} email_sympa'>(#EMAIL_SYMPA)</div>
+</div>]
+[<div class="champ contenu_periodicite[ (#PERIODICITE*|strlen|?{'',vide})]">
+       <div class='label'><:abomailmans:envoi_regulier:></div>
+       <div dir='#LANG_DIR' class='#EDIT{periodicite} descriptif'>(#PERIODICITE)</div>
+</div>]
+[<div class="champ contenu_lang[ (#LANG*|strlen|?{'',vide})]">
+       <div class='label'><:abomailmans:langue_liste:></div>
+       <div dir='#LANG_DIR' class='#EDIT{lang} lang'>(#LANG|traduire_nom_langue|sinon{<:abomailmans:aucune_langue:>})</div>
+</div>]                        
+[<div class="champ contenu_notes">
+       <div class='label'><:info_notes:></div>
+       <div dir='#LANG_DIR' class='#EDIT{notes} notes'>(#NOTES)</div>
+</div>
+]</BOUCLE_afficher_contenu>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/objets/infos/abomailman.html b/www/plugins/abomailmans/prive/objets/infos/abomailman.html
new file mode 100644 (file)
index 0000000..674be39
--- /dev/null
@@ -0,0 +1,4 @@
+<div class='infos'>
+#SET{texte_objet,#ENV{type}|objet_info{texte_objet}|_T}
+<div class='numero'><:titre_cadre_numero_objet{objet=#GET{texte_objet}}:><p>[(#ENV{id}|generer_info_entite{#ENV{type},[(#ENV{type}|id_table_objet)],'**'})]</p></div>
+</div>
diff --git a/www/plugins/abomailmans/prive/squelettes/contenu/abomailman.html b/www/plugins/abomailmans/prive/squelettes/contenu/abomailman.html
new file mode 100644 (file)
index 0000000..80aef1b
--- /dev/null
@@ -0,0 +1,24 @@
+<BOUCLE_afficher_contenu(ABOMAILMANS){id_abomailman=#ENV{id_abomailman}}{si #ENV{exec}|=={abomailman}}>\r
+[(#BOITE_OUVRIR{[\r
+       [(#AUTORISER{modifier,abomailman,#ID_ABOMAILMAN})\r
+               [(#ID_ABOMAILMAN|afficher_qui_edite{abomailman}|non)\r
+                       [(#URL_ECRIRE{abomailman_edit,id_abomailman=#ID_ABOMAILMAN}|icone_verticale{<:abomailmans:icone_modifier_abomailman:>,abomailmans-24,edit,right ajax preload})]\r
+               ]\r
+               [(#ID_ABOMAILMAN|afficher_qui_edite{abomailman}|oui)\r
+                       [(#URL_ECRIRE{abomailman_edit,id_abomailman=#ID_ABOMAILMAN}|icone_verticale{#ID_ABOMAILMAN|afficher_qui_edite{abomailmans-24},warning-24,'',right ajax preload})]\r
+               ]\r
+       ]\r
+       <h1>[(#RANG). ](#TITRE|sinon{<:info_sans_titre:>})[(#CHEMIN_IMAGE{abomailmans-24.png}|balise_img{article,cadre-icone})]</h1>\r
+],simple fiche_objet})]\r
+<div>\r
+<div id="wysiwyg">\r
+#INCLURE{fond=prive/objets/contenu/abomailman,env}\r
+</div>\r
+#BOITE_FERMER\r
+\r
+[(#EVAL{_AJAX}|oui)\r
+       <script type="text/javascript">/*<!\[CDATA\[*/reloadExecPage('#ENV{exec}','#navigation');/*\]\]>*/</script>\r
+]\r
+</BOUCLE_afficher_contenu>\r
+[(#ENV**{exec}|=={abomailman_edit}|?{#INCLURE{fond=prive/squelettes/contenu/abomailman_edit,env,retourajax=oui},#REM|sinon_interdire_acces})]\r
+<//B_afficher_contenu>\r
diff --git a/www/plugins/abomailmans/prive/squelettes/contenu/abomailman_edit.html b/www/plugins/abomailmans/prive/squelettes/contenu/abomailman_edit.html
new file mode 100644 (file)
index 0000000..d35478b
--- /dev/null
@@ -0,0 +1,30 @@
+[(#ID_ABOMAILMAN|intval|oui)\r
+       [(#AUTORISER{modifier,abomailman,#ID_ABOMAILMAN}|sinon_interdire_acces)]\r
+][(#ID_ABOMAILMAN|intval|non)\r
+       [(#AUTORISER{creer,abomailman}|sinon_interdire_acces)]\r
+]\r
+#SET{retour,#ENV{redirect}|sinon{#ID_ABOMAILMAN|intval|?{#URL_ECRIRE{abomailman,id_abomailman=#ID_ABOMAILMAN},#URL_ECRIRE{abomailmans}}}}\r
+\r
+<div class='cadre-formulaire-editer'>\r
+       <BOUCLE_liste(ABOMAILMANS){id_abomailman}>\r
+       <div class="entete-formulaire">\r
+               [(#GET{retour}|icone_verticale{<:icone_retour:>,abomailmans-24,'',left retour[(#ENV{retourajax,''}|oui)ajax preload]})]\r
+               <h1>[(#TITRE|supprimer_numero)]</h1>\r
+       </div>\r
+       </BOUCLE_liste>\r
+       <div class="entete-formulaire">\r
+               [(#GET{retour}|icone_verticale{<:icone_retour:>,abomailmans-24,'',left retour[(#ENV{retourajax,''}|oui)ajax preload]})]\r
+               <h1><:abomailmans:icone_ajouter_liste:></h1>\r
+       </div>\r
+       <//B_liste>\r
+       #SET{redirect,#ENV{redirect,#ID_ABOMAILMAN|generer_url_entite{abomailman}}}\r
+       [(#ENV{retourajax,''}|oui)\r
+               #SET{redirect,'javascript:if (window.jQuery) jQuery(".entete-formulaire .retour a").followLink();'}\r
+               <div class="ajax">\r
+       ]\r
+       #FORMULAIRE_EDITER_ABOMAILMAN{#ENV{id_abomailman,oui},#GET{redirect}}\r
+       [(#ENV{retourajax,''}|oui)\r
+               </div>\r
+               <script type="text/javascript">/*<!\[CDATA\[*/reloadExecPage('#ENV{exec}','#navigation,#extra');/*\]\]>*/</script>\r
+       ]\r
+</div>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/squelettes/contenu/abomailman_envoyer.html b/www/plugins/abomailmans/prive/squelettes/contenu/abomailman_envoyer.html
new file mode 100644 (file)
index 0000000..bdd5b3b
--- /dev/null
@@ -0,0 +1,7 @@
+<div class='cadre-formulaire-editer'>\r
+<div class="entete-formulaire">\r
+       [(#GET{retour}|icone_verticale{<:icone_retour:>,abomailmans-24,'',left retour[(#ENV{retourajax,''}|oui)ajax preload]})]\r
+       <h1><:abomailmans:envoyer_courier:></h1>\r
+</div>\r
+#FORMULAIRE_ABOMAILMAN_ENVOI_LISTE\r
+</div>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/squelettes/contenu/abomailmans.html b/www/plugins/abomailmans/prive/squelettes/contenu/abomailmans.html
new file mode 100644 (file)
index 0000000..2e0616a
--- /dev/null
@@ -0,0 +1,40 @@
+#CACHE{0}\r
+\r
+<h1><:abomailmans:les_listes_mailmans:></h1>\r
+\r
+<B_listes>\r
+#BOITE_OUVRIR\r
+       #ANCRE_PAGINATION\r
+       <div class="liste-objets abomailmans">\r
+       <table class='spip liste'>\r
+               <BOUCLE_listes(ABOMAILMANS){par titre}{pagination 10}>\r
+               <tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]">\r
+                       <td class="statut">\r
+                               [<img src="(#CHEMIN{images/[(#REPONSES|?{'puce-verte-breve.gif','puce-orange-breve.gif'})]})" width="7" height="7" style="border:none" alt="" />]\r
+                       </td>\r
+                       <td class="titre">\r
+                               [(#TITRE)]\r
+                       </td>\r
+                       <td class="lang">\r
+                               #LANG\r
+                       </td>\r
+                       <td class="statut">\r
+                               [(#DESACTIVE|=={1}|?{<:abomailmans:desactive:>,<:abomailmans:active:>})]\r
+                       </td>\r
+                       <td class='id'>[(#AUTORISER{modifier,abomailman,#ID_ABOMAILMAN}|?{\r
+                               <a href="[(#URL_ECRIRE{abomailman,id_abomailman=#ID_ABOMAILMAN})]">#ID_ABOMAILMAN</a>,\r
+                               #ID_ABOMAILMAN\r
+                       })]</td>\r
+               </tr>\r
+               </BOUCLE_listes>\r
+       </table>\r
+       [<div class="pagination">\r
+               (#PAGINATION)\r
+       </div>]\r
+</div>\r
+[(#BOITE_FERMER)]\r
+</B_listes>\r
+[(#AUTORISER{creer, abomailman}|oui)\r
+       [(#URL_ECRIRE{abomailman_edit,id_abomailman=new}|parametre_url{redirect,#SELF}\r
+               |icone_verticale{<:abomailmans:icone_ajouter_liste:>,abomailmans-24,new,right})]\r
+]
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/squelettes/navigation/abomailman.html b/www/plugins/abomailmans/prive/squelettes/navigation/abomailman.html
new file mode 100644 (file)
index 0000000..fb094b5
--- /dev/null
@@ -0,0 +1,8 @@
+[(#ID_ABOMAILMAN|generer_info_entite{abomailman,[(#VAL{abomailman}|id_table_objet)],'**'}|intval|=={#ID_ABOMAILMAN}|sinon_interdire_acces)]
+<BOUCLE_nav(ABOMAILMANS){id_abomailman}{si #ENV{exec}|=={abomailman}}>
+#BOITE_OUVRIR{'','info'}
+#PIPELINE{boite_infos,#ARRAY{data,'',args,#ARRAY{'type','abomailman','id',#ID_ABOMAILMAN}}}
+#BOITE_FERMER
+</BOUCLE_nav>
+[(#ENV{exec}|=={abomailman_edit}|oui)<INCLURE{fond=prive/squelettes/navigation/abomailman_edit,env}>]
+<//B_nav>
diff --git a/www/plugins/abomailmans/prive/squelettes/navigation/abomailmans.html b/www/plugins/abomailmans/prive/squelettes/navigation/abomailmans.html
new file mode 100644 (file)
index 0000000..4c9b97d
--- /dev/null
@@ -0,0 +1,5 @@
+<BOUCLE_abos_active(ABOMAILMANS){desactive=0}{0,1}>\r
+[(#BOITE_OUVRIR)]\r
+[(#URL_ECRIRE{abomailman_envoyer}|icone_horizontale{<:abomailmans:icone_envoyer_mail_liste:>,abomailmans-envoyer-24})]\r
+[(#BOITE_FERMER)]\r
+</BOUCLE_abos_active>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/style_prive_plugin_abomailmans.html b/www/plugins/abomailmans/prive/style_prive_plugin_abomailmans.html
new file mode 100644 (file)
index 0000000..54a7677
--- /dev/null
@@ -0,0 +1,8 @@
+#CACHE{3600*100,cache-client}\r
+#HTTP_HEADER{Content-Type: text/css; charset=iso-8859-15}\r
+#HTTP_HEADER{Vary: Accept-Encoding}\r
+\r
+.abo_message {\r
+   overflow:auto;\r
+       width:520px;\r
+}
\ No newline at end of file
diff --git a/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-16.png b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-16.png
new file mode 100755 (executable)
index 0000000..a98ffe9
Binary files /dev/null and b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-16.png differ
diff --git a/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-24.png b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-24.png
new file mode 100644 (file)
index 0000000..b2b75fa
Binary files /dev/null and b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-24.png differ
diff --git a/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-32.png b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-32.png
new file mode 100644 (file)
index 0000000..5ef4e7a
Binary files /dev/null and b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-32.png differ
diff --git a/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-envoyer-24.png b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-envoyer-24.png
new file mode 100644 (file)
index 0000000..d2f7761
Binary files /dev/null and b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-envoyer-24.png differ
diff --git a/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-new-16.png b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-new-16.png
new file mode 100644 (file)
index 0000000..68dc0af
Binary files /dev/null and b/www/plugins/abomailmans/prive/themes/spip/images/abomailmans-new-16.png differ
diff --git a/www/plugins/abomailmans/svn.revision b/www/plugins/abomailmans/svn.revision
new file mode 100644 (file)
index 0000000..4b2cac7
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/abomailmans/trunk
+Revision: 77298
+Dernier commit: 2013-10-18 00:00:06 +0200 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/abomailmans/trunk</origine>
+<revision>77298</revision>
+<commit>2013-10-18 00:00:06 +0200 </commit>
+</svn_revision>
\ No newline at end of file
diff --git a/www/plugins/abomailmans/templates/nouveautes.html b/www/plugins/abomailmans/templates/nouveautes.html
new file mode 100755 (executable)
index 0000000..31a071e
--- /dev/null
@@ -0,0 +1,67 @@
+#CACHE{0}[(#HTTP_HEADER{Content-type: text/html[; charset=(#CHARSET)]})]
+[(#REM)
+/**********************************************************
+* Ce squelette pour Abomailmains
+* Attention a :
+* - ne pas envoyer des gabarits de plus de 10Ko
+* - ne pas placer de balises d'ouverture ou de fermeture html et body
+* ils seront ajoutes automatiquement a l'envoi du mail
+* - mettre les style  CSS directement dans les balises pour etre sur qu'ils seront interpretes (meme par les webmails)
+* - les urls et liens images seront automatiquement converties en absolues
+*  ex. rubrique5.html -> http://www.monsite.org/rubrique5.html
+* Inspire du plugin Spip-Listes
+* $Id: nouveautes.html 59659 2012-03-23 14:00:11Z root $
+***********************************************************/]
+<B_articlesDate>
+<style>
+.nl_container a {
+       text-decoration:none;
+       color:#3996BB;}
+.nl_container a:hover {
+       color: #46839B;
+       text-decoration: underline;}
+</style>
+
+<div class="nl_container" style='width:100%;padding:10px;background-color:#FFF;color:#333333;font-size:12px;font-family:Georgia,"Times New Roman",Times,serif;'>
+<table width="690" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="#FFF">
+   <tr>
+      <td>
+       <h1><a href="#URL_SITE_SPIP">
+               [(#LOGO_SITE_SPIP||image_reduire{100,100}|inserer_attribut{style,'border:0;'}|sinon{#NOM_SITE_SPIP})]
+         </a></h1>
+         <BOUCLE_abomailman(ABOMAILMANS){id_abomailman}>#DESCRIPTIF</BOUCLE_abomailman>
+         </B_abomailman>
+            [<h2>(#ENV{sujet})</h2>]
+            [<p><b>(#ENV{message})</b></p>]
+         <//B_abomailman>
+                       <div style="border-bottom:1px solid #E00000;margin-bottom:1em;">&nbsp;</div>
+      </td>
+   </tr>
+   <BOUCLE_articlesDate(ARTICLES){age_relatif< 0}{id_rubrique ?}{id_mot ?}{par date}{inverse}>
+   <BOUCLE_agenda(MOTS){titre=AGENDA}{id_article}>#SET{type, agenda}</BOUCLE_agenda>
+   <tr>
+       <td>
+         [(#GET{type}|!={'agenda'}|?{'',' '}) <!-- SI agenda -->
+            [<div style="padding:0.2em;font-style:italic;">
+               [(#DATE_REDAC|nom_jour)] (#DATE_REDAC|affdate_jourcourt)[ - (#DATE_REDAC|affdate{'H:i'})]
+            </div>]
+         ]
+         [<h3>(#TITRE|textebrut|supprimer_numero)</h3>]
+         <!-- SI PAS agenda -->
+         [(#GET{type}|=={'agenda'}|?{'',' '})<p style="padding:0.2em;font-style:italic;">[(#DATE|affdate)]</p>]
+         <div><BOUCLE_ariane(HIERARCHIE){id_article}> &gt; <a href="#URL_RUBRIQUE">[(#TITRE|couper{80})]</a></BOUCLE_ariane></div>
+         <table width="100%" border="0" cellspacing="10"><tr>
+            <td valign="top">[<p style="text-align:justify;margin-top:0">(#INTRODUCTION|textebrut|liens_absolus)</p>]</td>
+            <td width="100" valign="top">
+               [(#LOGO_ARTICLE||image_reduire{100,100}|liens_absolus)]
+            </td>
+         </tr></table>
+         <a href="[(#URL_ARTICLE|url_absolue)]" style="float:right;padding:0 0 0 1em;margin:0.5em 0 0 0;"><:abomailmans:lire_article:></a>
+         <br style="clear: both; margin: 0; padding: 0; border: none; height: 0; line-height: 1px; font-size: 1px;" />
+         <div style="border-bottom:1px solid #E00000;margin-bottom:1em;">&nbsp;</div>
+      </td>
+   </tr>
+   </BOUCLE_articlesDate>
+</table>
+</div>
+</B_articlesDate>
diff --git a/www/plugins/abomailmans/templates/nouveautes.txt.html b/www/plugins/abomailmans/templates/nouveautes.txt.html
new file mode 100644 (file)
index 0000000..b31aee3
--- /dev/null
@@ -0,0 +1,38 @@
+#CACHE{0}[(#HTTP_HEADER{Content-type: text/plain[; charset=(#CHARSET)]})]\r
+[(#REM)\r
+/**********************************************************\r
+* Ce squelette pour Abomailmains\r
+* Attention a :\r
+* - ne pas envoyer des gabarits de plus de 10Ko\r
+* - les urls et liens images seront automatiquement converties en absolues\r
+*  ex. rubrique5.html -> http://www.monsite.org/rubrique5.html\r
+* Inspire du plugin Spip-Listes\r
+* $Id: nouveautes.html 44651 2011-02-14 10:33:12Z yffic@lefourneau.com $\r
+***********************************************************/]\r
+<B_articlesDate>\r
+\r
+<BOUCLE_abomailman(ABOMAILMANS){id_abomailman}>[(#DESCRIPTIF)]</BOUCLE_abomailman>\r
+</B_abomailman>\r
+[(#ENV{sujet})]\r
+[(#ENV{message})]\r
+<//B_abomailman>\r
+\r
+------------------------------------------------------------------------------\r
+<BOUCLE_articlesDate(ARTICLES){age_relatif< 0}{id_rubrique ?}{id_mot ?}{par date}{inverse}>\r
+<BOUCLE_agenda(MOTS){titre=AGENDA}{id_article}>#SET{type, agenda}</BOUCLE_agenda>\r
+[(#GET{type}|!={'agenda'}|?{'',' '})<!-- SI agenda -->\r
+   [[(#DATE_REDAC|nom_jour)] (#DATE_REDAC|affdate_jourcourt)[ - (#DATE_REDAC|affdate{'H:i'})]]\r
+]\r
+[(#TITRE|textebrut|supprimer_numero)]\r
+[(#GET{type}|=={'agenda'}|?{'',' '})[(#DATE|affdate)]]<!-- SI PAS agenda -->\r
+<BOUCLE_ariane(HIERARCHIE){id_article}> > [(#TITRE|couper{80})]</BOUCLE_ariane>\r
+[(#INTRODUCTION|textebrut|liens_absolus)]\r
+<:abomailmans:lire_article:> : [(#URL_ARTICLE|url_absolue)]\r
+\r
+------------------------------------------------------------------------------\r
+</BOUCLE_articlesDate>\r
+------------------------------------------------------------------------------\r
+\r
+[(#NOM_SITE_SPIP|textebrut)] (#URL_SITE_SPIP)\r
+</B_articlesDate>\r
+[(#FILTRE{supprimer_tags|filtrer_entites|trim})]
\ No newline at end of file
diff --git a/www/plugins/abomailmans/templates/nouveautes_fr_en.html b/www/plugins/abomailmans/templates/nouveautes_fr_en.html
new file mode 100644 (file)
index 0000000..24ce9dc
--- /dev/null
@@ -0,0 +1,98 @@
+#CACHE{0}[(#HTTP_HEADER{Content-type: text/html[; charset=(#CHARSET)]})]\r
+[(#REM)\r
+/**********************************************************\r
+* Ce squelette pour Abomailmains\r
+* Attention a :\r
+* - ne pas envoyer des gabarits de plus de 10Ko\r
+* - ne pas placer de balises d'ouverture ou de fermeture html et body\r
+* ils seront ajoutes automatiquement a l'envoi du mail\r
+* - mettre les style  CSS directement dans les balises pour etre sur qu'ils seront interpretes (meme par les webmails)\r
+* - les urls et liens images seront automatiquement converties en absolues\r
+*  ex. rubrique5.html -> http://www.monsite.org/rubrique5.html\r
+* Inspire du plugin Spip-Listes\r
+* $Id: nouveautes.html 44651 2011-02-14 10:33:12Z yffic@lefourneau.com $\r
+***********************************************************/]\r
+#SET{tableau_nouveautes,#ARRAY}\r
+<BOUCLE_articles(ARTICLES){id_rubrique ?}{id_mot ?}{age_relatif<0}>\r
+       #SET{tableau_nouveautes, #GET{tableau_nouveautes}|push{#ID_ARTICLE}}\r
+</BOUCLE_articles>\r
+\r
+<style>\r
+.nl_container a {\r
+       text-decoration:none;\r
+       color:#3996BB;}\r
+.nl_container a:hover {\r
+       color: #46839B;\r
+       text-decoration: underline;}\r
+</style>\r
+\r
+<div class="nl_container" style='width:100%;padding:5px;background-color:#FFF;color:#333333;font-size:10px;font-family:Arial, Helvetica, sans-serif'>\r
+<table width="800" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="#FFF">\r
+   <tr>\r
+      <td>\r
+       <h1><a href="#URL_SITE_SPIP">\r
+               [(#LOGO_SITE_SPIP||image_reduire{100,100}|inserer_attribut{style,'border:0;'}|sinon{#NOM_SITE_SPIP})]\r
+         </a></h1>\r
+      </td>\r
+   </tr>\r
+   <tr>\r
+      <td>\r
+         <table width="100%" border="0" cellspacing="10"><tr>\r
+            <td width="340" align="right" valign="top">\r
+               <BOUCLE_abomailman_fr(ABOMAILMANS){id_abomailman}>[(#DESCRIPTIF*|extraire_multi{fr}|propre)]</BOUCLE_abomailman_fr>\r
+               </B_abomailman_fr>\r
+                  [<h2>(#ENV*{sujet}|extraire_multi{fr})</h2>]\r
+                  [<p><b>(#ENV*{message}|extraire_multi{fr})</b></p>]\r
+               <//B_abomailman_fr>\r
+            </td>\r
+            <td width="100">&nbsp;</td>\r
+            <td valign="top" width="340">\r
+               <BOUCLE_abomailman_en(ABOMAILMANS){id_abomailman}>[(#DESCRIPTIF*|extraire_multi{en}|propre)]</BOUCLE_abomailman_en>\r
+               </B_abomailman_en>\r
+                  [<h2>(#ENV*{sujet}|extraire_multi{en})</h2>]\r
+                  [<p><b>(#ENV*{message}|extraire_multi{en})</b></p>]\r
+               <//B_abomailman_en>\r
+            </td>\r
+         </tr></table>\r
+         <div style="border-bottom:1px solid #E00000;margin-bottom:1em;">&nbsp;</div>\r
+      </td>\r
+   </tr>\r
+   <BOUCLE_articlesDate(ARTICLES){id_rubrique ?}{id_mot ?}{age_relatif<0}{par date}{inverse}>\r
+   <BOUCLE_test(CONDITION){si #ID_ARTICLE|=={#ID_TRAD}|ou{#GET{tableau_nouveautes}|find{#ID_TRAD}|non}}>\r
+   <tr>\r
+       <td>\r
+         <table width="100%" border="0" cellspacing="10"><tr>\r
+            <td valign="top" align="right" width="340">\r
+               <BOUCLE_traduction_fr(ARTICLES){traduction}{lang=fr}{doublons}>\r
+                  [<h3>(#TITRE|textebrut|supprimer_numero)</h3>]\r
+                  <div style="padding:0.2em;font-style:italic;">[(#DATE|affdate)]</div>\r
+                  <div>\r
+                     <BOUCLE_ariane_fr(HIERARCHIE){id_article}> &gt; <a href="#URL_RUBRIQUE">[(#TITRE*|extraire_multi{fr}|supprimer_numero|couper{80})]</a></BOUCLE_ariane_fr>\r
+                  </div>\r
+                  [<p style="text-align:justify;margin-top:0">(#INTRODUCTION{150}|textebrut|liens_absolus)</p>\r
+                  <p><a href="[(#URL_ARTICLE|url_absolue)]">Lire l'article</a></p>]\r
+                  [(#SET{logo,#LOGO_ARTICLE||image_reduire{100,100}|liens_absolus})]\r
+               </BOUCLE_traduction_fr>\r
+            </td>\r
+            <td width="100" valign="top">\r
+               [(#GET{logo})]\r
+            </td>\r
+            <td valign="top" width="340">\r
+               <BOUCLE_traduction_en(ARTICLES){traduction}{lang=en}{doublons}>\r
+                  [<h3>(#TITRE|textebrut|supprimer_numero)</h3>]\r
+                  <div style="padding:0.2em;font-style:italic;">[(#DATE|affdate)]</div>\r
+                  <div>\r
+                     <BOUCLE_ariane_en(HIERARCHIE){id_article}> &gt; <a href="#URL_RUBRIQUE">[(#TITRE*|extraire_multi{en}|supprimer_numero|couper{80})]</a></BOUCLE_ariane_en>\r
+                  </div>\r
+                  [<p style="text-align:justify;margin-top:0">(#INTRODUCTION{150}|textebrut|liens_absolus)</p>\r
+                  <p><a href="[(#URL_ARTICLE|url_absolue)]">Read the article</a></p>]\r
+               </BOUCLE_traduction_en>\r
+            </td>\r
+         </tr></table>\r
+         <div style="border-bottom:1px solid #E00000;margin-bottom:1em;">&nbsp;</div>\r
+      </td>\r
+   </tr>\r
+   </BOUCLE_test>\r
+   </BOUCLE_articlesDate>\r
+</table>\r
+</div>\r
diff --git a/www/plugins/abomailmans/templates/nouveautes_fr_en.txt.html b/www/plugins/abomailmans/templates/nouveautes_fr_en.txt.html
new file mode 100644 (file)
index 0000000..6d5987d
--- /dev/null
@@ -0,0 +1,58 @@
+#CACHE{0}[(#HTTP_HEADER{Content-type: text/plain[; charset=(#CHARSET)]})]\r
+[(#REM)\r
+/**********************************************************\r
+* Ce squelette pour Abomailmains\r
+* Attention a :\r
+* - ne pas envoyer des gabarits de plus de 10Ko\r
+* - les urls et liens images seront automatiquement converties en absolues\r
+*  ex. rubrique5.html -> http://www.monsite.org/rubrique5.html\r
+* Inspire du plugin Spip-Listes\r
+* $Id: nouveautes.html 44651 2011-02-14 10:33:12Z yffic@lefourneau.com $\r
+***********************************************************/]\r
+<B_articlesDateFr>\r
+\r
+<BOUCLE_abomailman_fr(ABOMAILMANS){id_abomailman}>[(#DESCRIPTIF*|extraire_multi{fr}|propre)]</BOUCLE_abomailman_fr>\r
+</B_abomailman_fr>\r
+[(#ENV*{sujet}|extraire_multi{fr})]\r
+[(#ENV*{message}|extraire_multi{fr})]\r
+<//B_abomailman_fr>\r
+\r
+------------------------------------------------------------------------------\r
+\r
+<BOUCLE_articlesDateFr(ARTICLES){id_rubrique ?}{id_mot ?}{age_relatif< 0}{lang=fr}{par date}{inverse}>\r
+[(#SURTITRE|textebrut|supprimer_numero) :]\r
+[(#TITRE|textebrut|supprimer_numero)]\r
+[(#DATE|affdate)]\r
+<BOUCLE_arianeFr(HIERARCHIE){id_article}> > [(#TITRE*|extraire_multi{fr}|couper{80})]</BOUCLE_arianeFr>\r
+[(#INTRODUCTION|textebrut|liens_absolus)]\r
+Lire l'article : [(#URL_ARTICLE|url_absolue)]\r
+------------------------------------------------------------------------------\r
+</BOUCLE_articlesDateFr>\r
+\r
+[(#NOM_SITE_SPIP*|extraire_multi{fr}|textebrut)] (#URL_SITE_SPIP)\r
+</B_articlesDateFr>\r
+\r
+##############################################################################\r
+<B_articlesDateEn>\r
+\r
+<BOUCLE_abomailman_en(ABOMAILMANS){id_abomailman}>[(#DESCRIPTIF*|extraire_multi{en}|propre)]</BOUCLE_abomailman_en>\r
+</B_abomailman_en>\r
+[(#ENV*{sujet}|extraire_multi{en})]\r
+[(#ENV*{message}|extraire_multi{en})]\r
+<//B_abomailman_en>\r
+\r
+------------------------------------------------------------------------------\r
+\r
+<BOUCLE_articlesDateEn(ARTICLES){id_rubrique ?}{id_mot ?}{age_relatif< 0}{lang=en}{par date}{inverse}>\r
+[(#SURTITRE|textebrut|supprimer_numero) :]\r
+[(#TITRE|textebrut|supprimer_numero)]\r
+[(#DATE|affdate)]\r
+<BOUCLE_arianeEn(HIERARCHIE){id_article}> > [(#TITRE*|extraire_multi{en}|couper{80})]</BOUCLE_arianeEn>\r
+[(#INTRODUCTION|textebrut|liens_absolus)]\r
+Read the article : [(#URL_ARTICLE|url_absolue)]\r
+------------------------------------------------------------------------------\r
+</BOUCLE_articlesDateEn>\r
+\r
+[(#NOM_SITE_SPIP*|extraire_multi{en}|textebrut)] (#URL_SITE_SPIP)\r
+</B_articlesDateEn>\r
+[(#FILTRE{supprimer_tags|filtrer_entites|trim})]
\ No newline at end of file
diff --git a/www/plugins/facteur/classes/facteur.php b/www/plugins/facteur/classes/facteur.php
new file mode 100755 (executable)
index 0000000..daedf1e
--- /dev/null
@@ -0,0 +1,347 @@
+<?php\r
+/*\r
+ * Plugin Facteur 2\r
+ * (c) 2009-2011 Collectif SPIP\r
+ * Distribue sous licence GPL\r
+ *\r
+ */\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+include_spip('inc/charsets');\r
+include_spip('inc/texte');\r
+include_spip('inc/filtres');\r
+\r
+if (!class_exists('PHPMailer')) {\r
+       include_spip('phpmailer-php5/class.phpmailer');\r
+       include_spip('phpmailer-php5/class.smtp');\r
+}\r
+\r
+include_spip('facteur_fonctions');\r
+\r
+class Facteur extends PHPMailer {\r
+\r
+       /**\r
+        * @param $email\r
+        * @param $objet\r
+        * @param $message_html\r
+        * @param $message_texte\r
+        * @param array $options\r
+        *\r
+        */\r
+       function Facteur($email, $objet, $message_html, $message_texte, $options = array()) {\r
+               $defaut = array(\r
+                       'adresse_envoi' => $GLOBALS['meta']['facteur_adresse_envoi'],\r
+                       'adresse_envoi_email' => $GLOBALS['meta']['facteur_adresse_envoi_email'],\r
+                       'adresse_envoi_nom' => $GLOBALS['meta']['facteur_adresse_envoi_nom'],\r
+                       'cc' => $GLOBALS['meta']['facteur_cc'],\r
+                       'bcc' => $GLOBALS['meta']['facteur_bcc'],\r
+                       'smtp' => $GLOBALS['meta']['facteur_smtp'],\r
+                       'smtp_host' => $GLOBALS['meta']['facteur_smtp_host'],\r
+                       'smtp_port' => $GLOBALS['meta']['facteur_smtp_port'],\r
+                       'smtp_auth' => $GLOBALS['meta']['facteur_smtp_auth'],\r
+                       'smtp_username' => $GLOBALS['meta']['facteur_smtp_username'],\r
+                       'smtp_password' => $GLOBALS['meta']['facteur_smtp_password'],\r
+                       'smtp_secure' => $GLOBALS['meta']['facteur_smtp_secure'],\r
+                       'smtp_sender' => $GLOBALS['meta']['facteur_smtp_sender'],\r
+                       'filtre_images' => $GLOBALS['meta']['facteur_filtre_images'],\r
+                       'filtre_iso_8859' => $GLOBALS['meta']['facteur_filtre_iso_8859'],\r
+               );\r
+               $options = array_merge($defaut, $options);\r
+\r
+               if (defined('_FACTEUR_DEBUG_SMTP')) {\r
+                       $this->SMTPDebug = _FACTEUR_DEBUG_SMTP ;\r
+               }\r
+               if ($options['adresse_envoi'] == 'oui'\r
+                 AND $options['adresse_envoi_email'])\r
+                       $this->From = $options['adresse_envoi_email'];\r
+               else\r
+                       $this->From = (isset($GLOBALS['meta']["email_envoi"]) AND $GLOBALS['meta']["email_envoi"])?\r
+                               $GLOBALS['meta']["email_envoi"]\r
+                               :$GLOBALS['meta']['email_webmaster'];\r
+\r
+               // Si plusieurs emails dans le from, pas de Name !\r
+               if (strpos($this->From,",")===false){\r
+                       if ($options['adresse_envoi'] == 'oui'\r
+                         AND $options['adresse_envoi_nom'])\r
+                               $this->FromName = $options['adresse_envoi_nom'];\r
+                       else\r
+                               $this->FromName = strip_tags(extraire_multi($GLOBALS['meta']['nom_site']));\r
+               }\r
+\r
+               $this->CharSet = "utf-8";\r
+               $this->Mailer = 'mail';\r
+               $this->Subject = unicode_to_utf_8(charset2unicode($objet,$GLOBALS['meta']['charset']));\r
+\r
+               //Pour un envoi multiple de mail, $email doit être un tableau avec les adresses.\r
+               if (is_array($email)) {\r
+                       foreach ($email as $cle => $adresseMail) {\r
+                               if (!$this->AddAddress($adresseMail))\r
+                                       spip_log("Erreur AddAddress $adresseMail : ".print_r($this->ErrorInfo,true),'facteur');\r
+                       }\r
+               }\r
+               else\r
+                       if (!$this->AddAddress($email))\r
+                               spip_log("Erreur AddAddress $email : ".print_r($this->ErrorInfo,true),'facteur');\r
+\r
+               if (!empty($options['smtp_sender'])) {\r
+                       $this->Sender = $options['smtp_sender'];\r
+                       $this->AddCustomHeader("Errors-To: ".$this->Sender);\r
+               }\r
+\r
+               if (!defined('_TEST_EMAIL_DEST')){\r
+                       if (!empty($options['cc'])) {\r
+                               $this->AddCC( $options['cc'] );\r
+                       }\r
+                       if (!empty($options['bcc'])) {\r
+                               $this->AddBCC( $options['bcc'] );\r
+                       }\r
+               }\r
+\r
+               if (isset($options['smtp']) AND $options['smtp'] == 'oui') {\r
+                       $this->Mailer   = 'smtp';\r
+                       $this->Host     = $options['smtp_host'];\r
+                       $this->Port     = $options['smtp_port'];\r
+                       if ($options['smtp_auth'] == 'oui') {\r
+                               $this->SMTPAuth = true;\r
+                               $this->Username = $options['smtp_username'];\r
+                               $this->Password = $options['smtp_password'];\r
+                       }\r
+                       else {\r
+                               $this->SMTPAuth = false;\r
+                       }\r
+                       if (intval(phpversion()) == 5) {\r
+                       if ($options['smtp_secure'] == 'ssl')\r
+                               $this->SMTPSecure = 'ssl';\r
+                       if ($options['smtp_secure'] == 'tls')\r
+                               $this->SMTPSecure = 'tls';\r
+                       }\r
+               }\r
+\r
+               if (!empty($message_html)) {\r
+                       $message_html = unicode_to_utf_8(charset2unicode($message_html,$GLOBALS['meta']['charset']));\r
+                       $this->Body = $message_html;\r
+                       $this->IsHTML(true);\r
+                       if ($options['filtre_images'])\r
+                               $this->JoindreImagesHTML();\r
+                       $this->UrlsAbsolues();\r
+               }\r
+               if (!empty($message_texte)) {\r
+                       $message_texte = unicode_to_utf_8(charset2unicode($message_texte,$GLOBALS['meta']['charset']));\r
+                       if (!$this->Body) {\r
+                               $this->IsHTML(false);\r
+                               $this->Body = $message_texte;\r
+                       }\r
+                       else {\r
+                               $this->AltBody = $message_texte;\r
+                       }\r
+               }\r
+\r
+               if ($options['filtre_iso_8859'])\r
+                       $this->ConvertirUtf8VersIso8859();\r
+\r
+       }\r
+       \r
+       /*\r
+        * Transforme du HTML en texte brut, mais proprement\r
+        * utilise le filtre facteur_mail_html2text\r
+        * @uses facteur_mail_html2text()\r
+        *\r
+        * @param string $html Le HTML à transformer\r
+        * @return string Retourne un texte brut formaté correctement\r
+        */\r
+       function html2text($html){\r
+               return facteur_mail_html2text($html);\r
+       }\r
+       \r
+       /**\r
+        * Transformer les urls des liens et des images en url absolues\r
+        * sans toucher aux images embarquees de la forme "cid:..."\r
+        */\r
+       function UrlsAbsolues($base=null){\r
+               include_spip('inc/filtres_mini');\r
+               if (preg_match_all(',(<(a|link)[[:space:]]+[^<>]*href=["\']?)([^"\' ><[:space:]]+)([^<>]*>),imsS',\r
+                 $this->Body, $liens, PREG_SET_ORDER)) {\r
+                       foreach ($liens as $lien) {\r
+                               if (strncmp($lien[3],"cid:",4)!==0){\r
+                                       $abs = url_absolue($lien[3], $base);\r
+                                       if ($abs <> $lien[3] and !preg_match('/^#/',$lien[3]))\r
+                                               $this->Body = str_replace($lien[0], $lien[1].$abs.$lien[4], $this->Body);\r
+                               }\r
+                       }\r
+               }\r
+               if (preg_match_all(',(<(img|script)[[:space:]]+[^<>]*src=["\']?)([^"\' ><[:space:]]+)([^<>]*>),imsS',\r
+                 $this->Body, $liens, PREG_SET_ORDER)) {\r
+                       foreach ($liens as $lien) {\r
+                               if (strncmp($lien[3],"cid:",4)!==0){\r
+                                       $abs = url_absolue($lien[3], $base);\r
+                                       if ($abs <> $lien[3])\r
+                                               $this->Body = str_replace($lien[0], $lien[1].$abs.$lien[4], $this->Body);\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       function JoindreImagesHTML() {\r
+               $image_types = array(\r
+                                                       'gif'   => 'image/gif',\r
+                                                       'jpg'   => 'image/jpeg',\r
+                                                       'jpeg'  => 'image/jpeg',\r
+                                                       'jpe'   => 'image/jpeg',\r
+                                                       'bmp'   => 'image/bmp',\r
+                                                       'png'   => 'image/png',\r
+                                                       'tif'   => 'image/tiff',\r
+                                                       'tiff'  => 'image/tiff',\r
+                                                       'swf'   => 'application/x-shockwave-flash'\r
+                                               );\r
+               $src_found = array();\r
+               $images_embeded = array();\r
+               if (preg_match_all(\r
+                       '/["\'](([^"\']+)\.('.implode('|', array_keys($image_types)).'))([?][^"\']+)?([#][^"\']+)?["\']/Uims',\r
+                       $this->Body, $images, PREG_SET_ORDER)) {\r
+\r
+                       $adresse_site = $GLOBALS['meta']['adresse_site'].'/';\r
+                       foreach($images as $im){\r
+                               $src_orig = $im[1].$im[4].$im[5];\r
+                               if (!isset($src_found[$src_orig])){ // deja remplace ? rien a faire (ie la meme image presente plusieurs fois)\r
+                                       // examiner le src et voir si embedable\r
+                                       $src = $im[1];\r
+                                       if ($src AND strncmp($src,$adresse_site,strlen($adresse_site))==0)\r
+                                               $src = _DIR_RACINE . substr($src,strlen($adresse_site));\r
+                                       if ($src\r
+                                         AND !preg_match(",^[a-z0-9]+://,i",$src)\r
+                                         AND (\r
+                                             file_exists($f=$src) // l'image a ete generee depuis le meme cote que l'envoi\r
+                                             OR (_DIR_RACINE AND file_exists($f=_DIR_RACINE.$src)) // l'image a ete generee dans le public et on est dans le prive\r
+                                             OR (!_DIR_RACINE AND file_exists($f=_DIR_RESTREINT.$src)) // l'image a ete generee dans le prive et on est dans le public\r
+                                            )\r
+                                         ){\r
+                                               if (!isset($images_embeded[$f])){\r
+                                                       $extension = strtolower($im[3]);\r
+                                                       $header_extension = $image_types[$extension];\r
+                                                       $cid = md5($f); // un id unique pour un meme fichier\r
+                                                       $images_embeded[$f] = $cid; // marquer l'image comme traitee, inutile d'y revenir\r
+                                                       $this->AddEmbeddedImage($f, $cid, basename($f),'base64',$header_extension);\r
+                                               }\r
+\r
+                                               $this->Body = str_replace($src_orig, "cid:".$images_embeded[$f], $this->Body);\r
+                                               $src_found[$src_orig] = $f;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+\r
+       /**\r
+        * Compat ascendante, obsolete\r
+        */\r
+       function ConvertirStylesEnligne() {\r
+               $this->Body = facteur_convertir_styles_inline($this->Body);\r
+       }\r
+\r
+\r
+       function safe_utf8_decode($text,$mode='texte_brut') {\r
+               if (!is_utf8($text))\r
+                       return ($text);\r
+\r
+               if (function_exists('iconv') && $mode == 'texte_brut') {\r
+                       $text = str_replace('’',"'",$text);\r
+                       $text = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text);\r
+                       return str_replace('&#8217;',"'",$text);\r
+               }\r
+               else {\r
+                       if ($mode == 'texte_brut') {\r
+                               $text = str_replace('’',"'",$text);\r
+                       }\r
+                       $text = unicode2charset(utf_8_to_unicode($text),'iso-8859-1');\r
+                       return str_replace('&#8217;',"'",$text);\r
+               }\r
+       }\r
+\r
+       function ConvertirUtf8VersIso8859() {\r
+               $this->CharSet  = 'iso-8859-1';\r
+               $this->Body             = str_ireplace('charset=utf-8', 'charset=iso-8859-1', $this->Body);\r
+               $this->Body             = $this->safe_utf8_decode($this->Body,'html');\r
+               $this->AltBody  = $this->safe_utf8_decode($this->AltBody);\r
+               $this->Subject  = $this->safe_utf8_decode($this->Subject);\r
+               $this->FromName = $this->safe_utf8_decode($this->FromName);\r
+       }\r
+\r
+       function ConvertirAccents() {\r
+               // tableau à compléter au fur et à mesure\r
+               $cor = array(\r
+                                               'à' => '&agrave;',\r
+                                               'â' => '&acirc;',\r
+                                               'ä' => '&auml;',\r
+                                               'ç' => '&ccedil;',\r
+                                               'é' => '&eacute;',\r
+                                               'è' => '&egrave;',\r
+                                               'ê' => '&ecirc;',\r
+                                               'ë' => '&euml;',\r
+                                               'î' => '&icirc;',\r
+                                               'ï' => '&iuml;',\r
+                                               'ò' => '&ograve;',\r
+                                               'ô' => '&ocirc;',\r
+                                               'ö' => '&ouml;',\r
+                                               'ù' => '&ugrave;',\r
+                                               'û' => '&ucirc;',\r
+                                               'œ' => '&oelig;',\r
+                                               '€' => '&euro;'\r
+                                       );\r
+\r
+               $this->Body = strtr($this->Body, $cor);\r
+       }\r
+       public function Send() {\r
+               ob_start();\r
+               $retour = parent::Send();\r
+               $error = ob_get_contents();\r
+               ob_end_clean();\r
+               if( !empty($error) ) {\r
+                       spip_log("Erreur Facteur->Send : $error",'facteur.err');\r
+               }\r
+               return $retour;\r
+       }\r
+       public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {\r
+               ob_start();\r
+               $retour = parent::AddAttachment($path, $name, $encoding, $type);\r
+               $error = ob_get_contents();\r
+               ob_end_clean();\r
+               if( !empty($error) ) {\r
+                       spip_log("Erreur Facteur->AddAttachment : $error",'facteur.err');\r
+               }\r
+               return $retour;\r
+       }\r
+       public function AddReplyTo($address, $name = '') {\r
+               ob_start();\r
+               $retour = parent::AddReplyTo($address, $name);\r
+               $error = ob_get_contents();\r
+               ob_end_clean();\r
+               if( !empty($error) ) {\r
+                       spip_log("Erreur Facteur->AddReplyTo : $error",'facteur.err');\r
+               }\r
+               return $retour;\r
+       }\r
+       public function AddBCC($address, $name = '') {\r
+               ob_start();\r
+               $retour = parent::AddBCC($address, $name);\r
+               $error = ob_get_contents();\r
+               ob_end_clean();\r
+               if( !empty($error) ) {\r
+                       spip_log("Erreur Facteur->AddBCC : $error",'facteur.err');\r
+               }\r
+               return $retour;\r
+       }\r
+       public function AddCC($address, $name = '') {\r
+               ob_start();\r
+               $retour = parent::AddCC($address, $name);\r
+               $error = ob_get_contents();\r
+               ob_end_clean();\r
+               if( !empty($error) ) {\r
+                       spip_log("Erreur Facteur->AddCC : $error",'facteur.err');\r
+               }\r
+               return $retour;\r
+       }\r
+}\r
+\r
+?>\r
diff --git a/www/plugins/facteur/emails/css.html b/www/plugins/facteur/emails/css.html
new file mode 100755 (executable)
index 0000000..ace3aa9
--- /dev/null
@@ -0,0 +1,63 @@
+<style type="text/css" media="screen">
+.faux_body {
+       background-color: #fff;
+       font-size: 12px;
+       font-family: verdana, sans-serif;
+}
+
+.titre {
+       text-align: center;
+       color: #000;
+       font-size: 24px;
+}
+
+h2 {
+       font-size: 18px;
+}
+
+h3 {
+       font-size: 16px;
+       clear: both;
+}
+
+a {
+       text-decoration: none;
+}
+
+a:hover {
+       text-decoration: underline;
+}
+
+a:visited {
+}
+
+.spip_documents_left {
+       float: left;
+       margin-right: 10px;
+}
+
+.spip_documents_center {
+       display: block;
+       text-align: center;
+       margin: 10px 0;
+}
+
+.spip_documents_right {
+       float: right;
+       margin-left: 10px;
+}
+
+.petit {
+       padding-top: 20px;
+       text-align: center;
+       font-size: 10px;
+}
+
+ul {
+       clear: both;
+}
+
+.invisible {
+       color: #eee;
+}
+</style>
\ No newline at end of file
diff --git a/www/plugins/facteur/emails/inc-bas.html b/www/plugins/facteur/emails/inc-bas.html
new file mode 100755 (executable)
index 0000000..b8a8c19
--- /dev/null
@@ -0,0 +1,22 @@
+</td>
+<td width="20" style="background-color: #fff;">&nbsp;</td>
+</tr>
+[<tr>
+<td colspan="3" width="580" style="background-color: #fff;"><a href="#URL_SITE_SPIP" title="[(#DESCRIPTIF_SITE_SPIP|textebrut)]"><img src="(#LOGO_NOTIFICATION_SURVOL||extraire_attribut{src})" alt="[(#NOM_SITE_SPIP|textebrut)]" border="0" width="[(#LOGO_NOTIFICATION_SURVOL||extraire_attribut{width})]" height="[(#LOGO_NOTIFICATION_SURVOL||extraire_attribut{height})]" /></a></td>
+</tr>
+]<tr>
+<td colspan="3" width="580" height="20">&nbsp;</td>
+</tr>
+</table>
+
+
+</center>
+
+
+</div><!-- fin faux_body -->
+
+
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/www/plugins/facteur/emails/inc-button.html b/www/plugins/facteur/emails/inc-button.html
new file mode 100644 (file)
index 0000000..08fc0d3
--- /dev/null
@@ -0,0 +1,23 @@
+[(#REM)
+       Bulletproof button code for email html
+       from http://emailbtn.net/
+
+       Arguments :
+       url
+       label
+       color (#ffffff par defaut)
+       bgcolor (#556270 par defaut)
+       bordercolor (#1e3650 par defaut)
+       borderradius (4px par defaut)
+       width (200px par defaut)
+       height (40px par defaut)
+       bgurl (rien par defaut)
+]
+<span style="display: inline-block;"><!--[if mso]>
+  <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#ENV*{url}" style="height:#ENV{height,40px};v-text-anchor:middle;width:#ENV{width,200px};"[(#ENV{borderradius,4px}|intval|oui)arcsize="[(#ENV{borderradius,4px}|intval|mult{100}|div{#ENV{height,40px}|intval}|intval)%]"] strokecolor="#ENV{bordercolor,#1e3650}" [(#ENV{bgurl,''}|?{'fill="t"',[fillcolor="(#ENV{bgcolor,#556270})"]})]>
+    [<v:fill type="tile" src="(#ENV{bgurl,''})" color="#ENV{bgcolor,#556270}" />
+    ]<w:anchorlock/>
+    <center style="color:#ENV{color,#ffffff};font-family:sans-serif;font-size:13px;font-weight:bold;">#ENV*{label}</center>
+  </v:roundrect>
+<![endif]--><![if !mso]><a href="#ENV*{url}"
+style="background-color:#ENV{bgcolor,#556270};[background-image:url\((#ENV{bgurl,''})\);]border:1px solid #ENV{bordercolor,#1e3650};[border-radius:(#ENV{borderradius,4px});]color:#ENV{color,#ffffff};display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:#ENV{height,40px};text-align:center;text-decoration:none;width:#ENV{width,200px};-webkit-text-size-adjust:none;">#ENV*{label}</a><![endif]></span>
\ No newline at end of file
diff --git a/www/plugins/facteur/emails/inc-haut.html b/www/plugins/facteur/emails/inc-haut.html
new file mode 100755 (executable)
index 0000000..21f4ee1
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" dir="#LANG_DIR" xml:lang="#LANG" lang="#LANG">
+
+
+<head>
+<meta http-equiv="content-type" content="text/html; charset=#CHARSET" />
+<meta name="language" content="#LANG" />
+<INCLURE {fond=emails/css}>
+</head>
+
+
+<body>
+
+
+<div class="faux_body">
+       
+
+<center>
+
+
+<table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td colspan="3" width="580" height="10">&nbsp;</td>
+</tr>
+[<tr>
+<td colspan="3" width="580" style="background-color: #fff; text-align: center;"><a class="titre" href="#URL_SITE_SPIP" title="[(#DESCRIPTIF_SITE_SPIP|textebrut)]"><img class="titre" src="(#LOGO_NOTIFICATION_NORMAL||extraire_attribut{src})" alt="[(#NOM_SITE_SPIP|textebrut)]" border="0" width="[(#LOGO_NOTIFICATION_NORMAL||extraire_attribut{width})]" height="[(#LOGO_NOTIFICATION_NORMAL||extraire_attribut{height})]" /></a></td>
+</tr>
+]<tr>
+<td width="20" style="background-color: #fff;">&nbsp;</td>
+<td width="540" style="background-color: #fff;">
diff --git a/www/plugins/facteur/emails/test_email_html.html b/www/plugins/facteur/emails/test_email_html.html
new file mode 100755 (executable)
index 0000000..481b417
--- /dev/null
@@ -0,0 +1,28 @@
+#HTTP_HEADER{Content-Type:text/html}
+#INCLURE{fond=emails/inc-haut}
+
+<h2><:facteur:corps_email_de_test:></h2>
+
+<p><:facteur:version_html:></p>
+
+<BOUCLE_art(ARTICLES){texte==<img}{0,1}>
+               [(#TEXTE|image_reduire{550,0})]
+               <hr />
+               [(#NOTES|image_reduire{550,0})]
+</BOUCLE_art>
+       <BOUCLE_art2(ARTICLES){0,1}>
+               [(#TEXTE|image_reduire{550,0})]
+               <hr />
+               [(#NOTES|image_reduire{550,0})]
+       </BOUCLE_art2>
+<//B_art>
+
+<BOUCLE_image(DOCUMENTS){extension IN jpg,png,gif}{0,1}>
+       [(#MODELE{img}|image_reduire{550,0})]
+</BOUCLE_image>
+
+<BOUCLE_pdf(DOCUMENTS){extension=pdf}{0,1}>
+       [(#MODELE{doc}|image_reduire{550,0})]
+</BOUCLE_pdf>
+
+#INCLURE{fond=emails/inc-bas}
\ No newline at end of file
diff --git a/www/plugins/facteur/emails/test_email_texte.html b/www/plugins/facteur/emails/test_email_texte.html
new file mode 100755 (executable)
index 0000000..e8953af
--- /dev/null
@@ -0,0 +1,12 @@
+<:facteur:corps_email_de_test:>
+--------------------------------
+
+<:facteur:version_texte:>
+
+<BOUCLE_art(ARTICLES){texte==<img}{0,1}>
+               [(#TEXTE|textebrut)]
+</BOUCLE_art>
+       <BOUCLE_art2(ARTICLES){0,1}>
+                       [(#TEXTE|textebrut)]
+       </BOUCLE_art2>
+<//B_art>
diff --git a/www/plugins/facteur/emails/texte.html b/www/plugins/facteur/emails/texte.html
new file mode 100644 (file)
index 0000000..e8ed065
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+       <title>[(#ENV*{sujet})]</title>
+       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+       <style type="text/css">
+               [(#SET{siteColor,[#(#LOGO_SITE_SPIP|couleur_extraire|couleur_eclaircir_si_foncee{168}|sinon{BBB})]})]
+               #outlook a {padding: 0;}
+               body {width: 100% !important;}
+               body {margin: 0;padding: 0;}
+               img {border: none;font-size: inherit;font-weight: bold;height: auto;line-height: 100%;outline: none;text-decoration: none;text-transform: capitalize;}
+               #backgroundTable {height: 100% !important;margin: 0;padding: 0;width: 100% !important;}
+               body, .backgroundTable {background-color: #DDDDDD;}
+               #templateContainer {border: 1px solid #CCCCCC;max-width: 600px !important;}
+               h1,.h1,h2,.h2,h3,.h3,h4,.h4 {color: #202020;display: block;font-family: Verdana, Geneva, sans-serif;margin-bottom: 0.5em;text-align: left;}
+               #templateHeader {background-color: #FFFFFF;border-bottom: 0;}
+               #templateContainer, .bodyContent {background-color: #FFFFFF;margin-top: 40px;}
+               .bodyContent {padding:30px;border-bottom:10px solid #GET{siteColor};}
+               .bodyContent div {color: #222222;font-family: Verdana, Geneva, sans-serif;line-height: 150%;text-align: left;}
+               .bodyContent div a:link, .bodyContent div a:visited {color: #336699;font-weight: normal;text-decoration: underline;}
+               .bodyContent img {display: inline;margin-bottom: 10px;}
+               .bodyContent img.puce {display: inline;margin-bottom: 0;}
+               hr { height: 1px; margin: 1.5em 0; border: 0; background: #222222; color: #222222; }
+               .spip_code, .spip_cadre {color: #606060;font-family: Courier,"Courier New",monospace;font-size: 1em;word-wrap:break-word;max-width: 100%;overflow: auto;}
+               .coloration_code ol {list-style: none;}
+               .spip_logos {float: right;margin-left: 10px;}
+               .text {word-wrap:break-word;}
+               .header,.footer {padding: 20px 40px;margin-left: -40px;margin-right: -40px;}
+               .text > .header:first-child {margin-top: -40px;}
+               .header {background: #e9e9e9;}
+               .footer {border-top:2px solid #e9e9e9;margin-top: 40px;}
+               .header hr,.footer hr {display: none}
+               @media only screen and (max-width: 600px) {
+                       html,body {width: 100% !important;}
+                       body, .backgroundTable {background-color: #ffffff !important;}
+                       .bodyContent {padding:0 0 10px !important;border-top:0;border-bottom:0;}
+                       #templateHead {display: none}
+                       #templateContainer {width: 100% !important;border: 0 !important;margin-top: 0}
+                       #templateBody {width: 100% !important;}
+                       .padding {padding-left:0 !important;padding-right:0 !important;}
+                       .text {color: #101010 !important;}
+                       .header,.footer {padding: 10px;margin-left: -10px;margin-right: -10px;}
+                       .text > .header:first-child {margin-top: -10px;}
+               }
+               @media only screen and (max-device-width: 480px) {
+                       html,body {width: 320px !important;}
+                       body, .backgroundTable {background-color: #ffffff !important;}
+                       .bodyContent {padding: 0 0 10px !important;border-top:0;border-bottom:0;}
+                       #templateContainer {width: 320px !important;border: 0 !important;margin-top: 0;}
+                       #templateBody {width: 320px !important;}
+                       .padding {padding-left:0 !important;padding-right:0 !important;}
+                       .text {color: #101010 !important;}
+               }
+       </style>
+</head>
+<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"
+                       style="margin: 0;padding: 0;width: 100% !important;">
+<center>
+       [<div style="display:none;display:none !important;">(#ENV{intro,''})</div>]
+       <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable"
+                                style="margin: 0;padding: 0;height: 100% !important;width: 100% !important;">
+               <tr>
+                       <td align="center" valign="top">
+                               <!-- // End Template Preheader \\ -->
+                               <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer"
+                                                        style="border: 1px solid #CCCCCC;background-color: #FFFFFF;max-width: 600px !important;">
+                                       <tr id="templateHead">
+                                               <td class="headContent" style="padding:10px 40px;background: #GET{siteColor};"><strong style="color:#fff;text-transform:uppercase">#NOM_SITE_SPIP</strong></td>
+                                       </tr>
+                                       <tr>
+                                               <td align="center" valign="top">
+                                                       <!-- // Begin Template Body \\ -->
+                                                       <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody">
+                                                               <tr>
+                                                                       <td valign="top" class="bodyContent" style="background-color: #FFFFFF;padding:30px;">
+
+                                                                               <!-- // Begin Module: Standard Content \\ -->
+                                                                               <table border="0" cellpadding="10" cellspacing="0" width="100%">
+                                                                                       <tr>
+                                                                                               <td valign="top">
+                                                                                                       <div class='text' style="color:#222222;font-family: Verdana, Geneva, sans-serif;font-size:100%;line-height:150%;text-align:left;word-wrap:break-word;">
+                                                                                                               [(#ENV*{html,#ENV*{texte}|replace{'<','&lt;'}|facteur_nl2br_si_pas_autobr|propre|replace{'<br />\s*<br />(\s*<br />)+?','<br /> <br />'}|concat{'<br /> <br />'}})]
+                                                                                                       </div>
+                                                                                               </td>
+                                                                                       </tr>
+                                                                                       <tr>
+                                                                                               <td align="left" valign="top"
+                                                                                                               style="color:#A39F9A !important;font-family: Verdana, Geneva, sans-serif; !important;font-size:90% !important;font-weight:normal !important;font-style:normal !important;text-decoration:none !important;vertical-align:top !important;text-align:left !important;">
+                                                                                                       <br/>
+                                                                                                       <br/>
+                                                                                                       &mdash; #SET{site,<a href="#URL_SITE_SPIP/">#NOM_SITE_SPIP</a>}<:facteur:email_envoye_par{site=#GET{site}}:>
+                                                                                                       <br/>
+                                                                                               </td>
+                                                                                       </tr>
+                                                                               </table>
+                                                                               <!-- // End Module: Standard Content \\ -->
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
+                                                       <!-- // End Template Body \\ -->
+                                               </td>
+                                       </tr>
+                               </table>
+                               <br>
+                       </td>
+               </tr>
+       </table>
+</center>
+</body>
+</html>
diff --git a/www/plugins/facteur/erreurs et exceptions.txt b/www/plugins/facteur/erreurs et exceptions.txt
new file mode 100644 (file)
index 0000000..192c8a2
--- /dev/null
@@ -0,0 +1,42 @@
+Avril 2012\r
+Yffic\r
+\r
+Petit point sur la gestion des erreurs et les exceptions de phpMailer 5. "Parce que c'est pénible de ne pas savoir pourquoi ça ne marche pas"\r
+\r
+Constat :\r
+- Les problèmes de connexion smtp ne sont pas affichées dans l'interface privée de SPIP après un test d'envoi via la page de config de Facteur. On a juste le message "Erreur: consultez le fichier log pour plus de détails" dans un cadre rouge.\r
+\r
+- Dans formulaires/configurer_facteur.php, facteur_envoyer_mail_test() renvoie true/false. Donc on n'a pas accès aux messages d'erreurs de phpMailer dans l'espace privé.\r
+\r
+- La gestion des exceptions via la classe phpmailerException n'est pas activée par défaut dans phpMailer (Cf le constructeur). Elle sert surtout à faire remonter les messages d'erreur.\r
+\r
+- Après avoir activé la gestion des exceptions et le mode debug de la classe smtp (qui ne fait que des echo), on peut remarquer que les messages d'erreurs affichés par les exceptions dans phpMailer ne reprennent pas les vraies causes d'erreurs relevées dans la classe smtp. Si par exemple, on n'active pas ssl dans php, le debug "echo" affiche "SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?", mais l'exception se contente d'un "SMTP Error: Could not connect to SMTP host" dans le fichier log. C'est quand même dommage de ne pas avoir accès au premier message d'erreur.\r
+\r
+- Voir aussi :\r
+http://code.google.com/a/apache-extras.org/p/phpmailer/issues/detail?id=50\r
+http://code.google.com/a/apache-extras.org/p/phpmailer/issues/detail?id=5\r
+\r
+En attendant une éventuelle amélioration de phpMailer, on peut :\r
+\r
+- Upgrader phpMailer 5.2.1. J'ai testé, ca ne change rien au niveau de la gestion des messages d'erreur, mais ça corrige d'autres trucs. \r
+05/04/12 : Un cas foireux avec la version 5.2.1 : Si comme hôte on met un serveur ssl (ssl0.ovh.net), mais qu'on ne coche pas ssl au dessous, lors d'un test d'envoi, la roue Ajax tourne en rond indéfiniment... Pas de retour, aucune trace meme avec de simples echo... Je pense que ca tourne en rond au niveau de la fonction feof de get_lines. Cf les Notes de http://php.net/manual/fr/function.feof.php... Il n'est pas donc pas si urgent d'upgrader...\r
+\r
+- Redéfinir dans la classe Facteur, les fonctions Send, AddAttachment, AddReplyTo, AddBCC, AddCC, de la classe PhpMailer de cette façon :\r
+public function Send() {\r
+       ob_start();\r
+       parent::Send();\r
+       $error = ob_get_contents();\r
+       ob_end_clean();\r
+       if( !empty($error) ) {\r
+               spip_log("Erreur Facteur->Send : $error",'facteur.err');\r
+       }\r
+}\r
+Avec une constante pour activer ce mode et rajouter au début du constructeur de Facteur :\r
+if (defined('_FACTEUR_DEBUG_SMTP')) {\r
+       $this->SMTPDebug = _FACTEUR_DEBUG_SMTP ;\r
+}\r
+Ajouter la ligne qui suit dans mes_options.php permet donc de retrouver les erreurs dans le fichier facteur.err.log. \r
+define('_FACTEUR_DEBUG_SMTP','5'); // Le niveau peut varier de 1 à 5, 5 affichant tout le dialogue lors de la connexion smtp avec le serveur\r
+\r
+\r
+\r
diff --git a/www/plugins/facteur/facteur_administrations.php b/www/plugins/facteur/facteur_administrations.php
new file mode 100755 (executable)
index 0000000..1b0467a
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/*
+ * Plugin Facteur 2
+ * (c) 2009-2011 Collectif SPIP
+ * Distribue sous licence GPL
+ *
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+function facteur_upgrade($nom_meta_base_version, $version_cible){
+
+       $maj = array();
+
+       $maj['create'] = array(
+               array('ecrire_meta','facteur_smtp', 'non'),
+               array('ecrire_meta','facteur_smtp_auth', 'non'),
+               array('ecrire_meta','facteur_smtp_secure', 'non'),
+               array('ecrire_meta','facteur_smtp_sender', ''),
+               array('ecrire_meta','facteur_filtre_images', 1),
+               array('ecrire_meta','facteur_filtre_css', 0),
+               array('ecrire_meta','facteur_filtre_iso_8859', 0),
+               array('ecrire_meta','facteur_adresse_envoi', 'non'),
+               array('facteur_vieil_upgrade'),
+       );
+
+       include_spip('base/upgrade');
+       maj_plugin($nom_meta_base_version, $version_cible, $maj);
+}
+
+function facteur_vieil_upgrade(){
+       // migration depuis tres ancienne version, a la main
+       if (isset($GLOBALS['meta']['spip_notifications_version'])) {
+               ecrire_meta('facteur_smtp', $GLOBALS['meta']['spip_notifications_smtp']);
+               ecrire_meta('facteur_smtp_auth', $GLOBALS['meta']['spip_notifications_smtp_auth']);
+               ecrire_meta('facteur_smtp_secure', $GLOBALS['meta']['spip_notifications_smtp_secure']);
+               ecrire_meta('facteur_smtp_sender', $GLOBALS['meta']['spip_notifications_smtp_sender']);
+               ecrire_meta('facteur_filtre_images', $GLOBALS['meta']['spip_notifications_filtre_images']);
+               ecrire_meta('facteur_filtre_css', $GLOBALS['meta']['spip_notifications_filtre_css']);
+               ecrire_meta('facteur_filtre_iso_8859', $GLOBALS['meta']['spip_notifications_filtre_iso_8859']);
+               ecrire_meta('facteur_adresse_envoi', $GLOBALS['meta']['spip_notifications_adresse_envoi']);
+               ecrire_meta('facteur_adresse_envoi_nom', $GLOBALS['meta']['spip_notifications_adresse_envoi_nom']);
+               ecrire_meta('facteur_adresse_envoi_email', $GLOBALS['meta']['spip_notifications_adresse_envoi_email']);
+               // supprimer l'ancien nommage
+               effacer_meta('spip_notifications_smtp');
+               effacer_meta('spip_notifications_smtp_auth');
+               effacer_meta('spip_notifications_smtp_secure');
+               effacer_meta('spip_notifications_smtp_sender');
+               effacer_meta('spip_notifications_filtre_images');
+               effacer_meta('spip_notifications_filtre_css');
+               effacer_meta('spip_notifications_filtre_iso_8859');
+               effacer_meta('spip_notifications_adresse_envoi');
+               effacer_meta('spip_notifications_adresse_envoi_nom');
+               effacer_meta('spip_notifications_adresse_envoi_email');
+               effacer_meta('spip_notifications_version');
+               // KEZAKO ?
+               include_spip('base/abstract_sql');
+               sql_drop_table('spip_notifications', true);
+       }
+}
+
+
+function facteur_vider_tables($nom_meta_base_version) {
+       // cfg la dessus, ca serait mieux !
+       effacer_meta('facteur_version');
+       effacer_meta('facteur_smtp');
+       effacer_meta('facteur_smtp_auth');
+       effacer_meta('facteur_smtp_secure');
+       effacer_meta('facteur_smtp_sender');
+       effacer_meta('facteur_filtre_images');
+       effacer_meta('facteur_filtre_css');
+       effacer_meta('facteur_filtre_iso_8859');
+       effacer_meta('facteur_adresse_envoi');
+       effacer_meta('facteur_adresse_envoi_nom');
+       effacer_meta('facteur_adresse_envoi_email');
+       effacer_meta('facteur_cc');
+       effacer_meta('facteur_bcc');
+       effacer_meta($nom_meta_base_version);
+}
+
+
+
+?>
diff --git a/www/plugins/facteur/facteur_fonctions.php b/www/plugins/facteur/facteur_fonctions.php
new file mode 100755 (executable)
index 0000000..9c09ca4
--- /dev/null
@@ -0,0 +1,387 @@
+<?php
+/*
+ * Plugin Facteur 2
+ * (c) 2009-2011 Collectif SPIP
+ * Distribue sous licence GPL
+ *
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+/**
+ * Transformer un mail texte ou HTML simplifie en mail HTML complet avec le wrapper emails/texte.html
+ * Si le mail est un mail texte :
+ *   la premiere ligne est le sujet
+ *   le reste est le corps du mail
+ *
+ * Si le mail est un mail HTML simplifie :
+ *   le sujet est entre <title></title>
+ *   le corps est entre <body></body>
+ *   une eventuelle intro peut etre fournie entre <intro></intro>
+ *
+ * @param string $texte_ou_html
+ * @return string
+ */
+function facteur_email_wrap_to_html($texte_ou_html){
+       $texte_ou_html = trim($texte_ou_html);
+       // attention : si pas de contenu on renvoi du vide aussi (mail vide = mail vide)
+       if (!strlen(trim($texte_ou_html)))
+               return $texte_ou_html;
+
+       $contexte = array("sujet"=>"","texte"=>"","intro"=>"");
+
+       // tester si le mail est en html (simplifie)
+       if (substr($texte_ou_html,0,1)=="<"
+         AND substr($texte_ou_html,-1,1)==">"
+         AND stripos($texte_ou_html,"</body>")!==false){
+
+               // dans ce cas on ruse un peu : extraire le sujet du title
+               $sujet = "";
+               if (preg_match(",<title>(.*)</title>,Uims",$texte_ou_html,$m)){
+                       $contexte['sujet'] = $m[1];
+                       $texte_ou_html = preg_replace(",<title>(.*)</title>,Uims","",$texte_ou_html,1);
+                       $texte_ou_html = trim($texte_ou_html);
+               }
+               if (preg_match(",<intro>(.*)</intro>,Uims",$texte_ou_html,$m)){
+                       $contexte['intro'] = $m[1];
+                       $texte_ou_html = preg_replace(",<intro>(.*)</intro>,Uims","",$texte_ou_html,1);
+                       $texte_ou_html = trim($texte_ou_html);
+               }
+               $contexte['html'] = preg_replace(",</?body>,ims","",$texte_ou_html);
+       }
+       else {
+               // la premiere ligne est toujours le sujet
+               $texte_ou_html = explode("\n",$texte_ou_html);
+               $contexte['sujet'] = trim(array_shift($texte_ou_html));
+               $contexte['texte'] = trim(implode("\n",$texte_ou_html));
+       }
+
+       // attention : si pas de contenu on renvoi du vide aussi (mail vide = mail vide)
+       if (!strlen(trim(implode("",$contexte))))
+               return "";
+
+       return recuperer_fond("emails/texte",$contexte);
+}
+
+       /*
+
+       Written by Eric Dols - edols@auditavenue.com
+
+       You may freely use or modify this, provided
+       you leave credits to the original coder.
+       Feedback about (un)successfull uses, bugs and improvements done
+       are much appreciated, but don't expect actual support.
+
+       PURPOSE OF THIS FUNCTION
+               It is designed to process html emails relying
+               on a css stylesheet placed in the <head> for layout in
+               order to enhance compatibility with email clients,
+               including webmail services.
+               Provided you use minimal css, you can keep styling separate
+               from the content in your email template, and let this function
+               "inject" those styles inline in your email html tags on-the-fly,
+               just before sending.
+               Technically, it grabs the style declarations found in the
+               <head> section and inserts each declaration inline,
+               inside the corresponding html tags in the email message.
+
+               Supports both HTML and XHTML markup seamlessly. Thus
+               tolerant to email message writers using non-xhtml tag,
+               even when template is xhtml compliant (e.g. they would
+               add <img ...> instead of a xhtml compliant <img ... />).
+
+       NEW 10 dec. 2003:
+               - code revised, including a few regexp bugs fixed.
+               - multiple class for a tag are now allowed <p class="firstclass secondclass">
+               - all unsupported css styles are now moved to the body section (not just a:hover etc...)
+
+       USE
+               Add this function to a function library include, like "inline.inc"
+               and include it near the beginning of your php page:
+               require ("inline.inc");
+
+               load the html source of message into a variable
+               like $html_source and process it using:
+               $html_source = sheet2inline($html_source)
+
+
+       STYLE DEFINITIONS SUPPORTED
+               TAG { ... }
+               TAG1, TAG2, ... { ... }
+               TAG.class { ... }
+               .class { ...)
+               TAG:pseudo { ... }
+
+
+               CSS definitions may be freely formatted (spaces, tabs, linefeeds...),
+               they are converted to oneliners before inserting them inline in the html tags.
+
+               .class definitions are processed AFTER tag definitions,
+               thus appended inline after any existing tag styling to
+               preserve the normal css priority behavior.
+
+               Existing style="..." attributes in tags are NOT stripped. However they MUST
+               be with double quotes. If not, an addtional style="..." attribute will be added
+
+
+       KNOWN LIMITATIONS
+               - style info should be placed in <head> section. I believe
+                       it shouldnt be too hard to modify to point to an external
+                       stylesheet instead.
+               - no support (yet?):
+                       * chains like P UL LI { .... } or P UL LI.class { .... }
+                       * #divname p { ... } and <tag id="...">
+                       * a:hover, a:visited {...} multiple class:pseudo
+                       They require a significantly more complicated processing likely
+                       based on stylesheet and document trees parsing.
+                       Many email clients don't handle more than what is supported
+                       by this script anyway.
+               - pseudo-classes like a:hover {...} can't be inserted inline
+                       in the html tags: they are moved to a <style> declaration in
+                       the <body> instead. This is a limitation from html, not this script.
+               - It is still up to you to check if target email clients render
+                       your css styled templates correctly, especially webmail services
+                       like Hotmail, in which the email becomes a sub-part of an html page,
+                       with styles already in place.
+       */
+function facteur_convertir_styles_inline($body){
+       // variables to be accessed in the callback sub-function too
+       global $styledefinition, $styletag, $styleclass;
+
+       // Let's first load the stylesheet information in a $styles array using a regexp
+       preg_match_all ( "/^[ \t]*([.]?)([\w, #]+)([.:])?(\S*)\s+{([^}]+)}/mi", $body , $styles);
+       /*
+               $styles[1] = . or ''  => .class or tag (empty)
+               $styles[2] = name of class or tag(s)
+               $styles[3] = : . or '' => followed by pseudo-element, class separator or nothing (empty)
+               $styles[4] = name of pseudo-element after a tag, if any
+               $styles[5] = the style definition itself, i.e. what's between the { }
+       */
+
+       // Now loop through the styles found and act accordingly;
+
+       // process TAG {...} & TAG1, TAG2,... {...} definitions only first by order of appearance
+       foreach ($styles[1] as $i => $type) {
+               if ($type=="" && $styles[3][$i]=="") {
+                       $styledefinition = trim($styles[5][$i]);
+                       $styletag = preg_replace("/ *, */", "|", trim($styles[2][$i])); //echo $styletag."<br />";
+                       $styleclass = "";
+                       // process TAG {...} and TAG1, TAG2 {...} but not TAG1 TAG2 {...} or #divname styles
+                       if (!preg_match("/ /", $styletag) && !preg_match("/#/", $styletag)) {
+                               $pattern = "!<(".$styletag.")([^>]*(?= /)|[^>]*)( /)?>!mi";
+                               $body = preg_replace_callback ($pattern, 'facteur_addstyle' , $body);
+                               $styles[6][$i]=1; // mark as injected inline
+                       }
+               }
+       }
+
+       // append additional .CLASS {...} and TAG.CLASS {...} styling by order of appearance
+       // important to do so after TAG {...} definitions, so that class attributes override TAG styles when needed
+       foreach ($styles[1] as $i => $type) {
+               if ($type!="." && $styles[3][$i]=="." ) {       // class definition for a specific tag
+                       $styledefinition = trim($styles[5][$i]);
+                       $styletag = trim($styles[2][$i]);
+                       $styleclass = trim($styles[4][$i]);
+                       $pattern = "!<(".$styletag.")([^>]* class\=['\"][^'\"]*".$styleclass."[^'\"]*['\"][^>]*(?= /)|[^>]* class\=['\"][^'\"]*".$styleclass."[^'\"]*['\"][^>]*)( />)?>!mi";
+                       $body = preg_replace_callback ($pattern, 'facteur_addstyle' , $body);
+                       $styles[6][$i]=1; // mark as injected inline
+
+               }
+               elseif ($type=="." && $styles[3][$i]=="" ) {    // general class definition for any tag
+                       $styledefinition = trim($styles[5][$i]);
+                       $styletag = "";
+                       $styleclass = trim($styles[2][$i]);
+                       $pattern = "!<(\w+)([^>]* class\=['\"]".$styleclass."['\"][^>]*(?= /)|[^>]* class\=['\"]".$styleclass."['\"][^>]*)( />)?>!mi";
+                       $body = preg_replace_callback ($pattern, 'facteur_addstyle' , $body);
+                       $styles[6][$i]=1; // mark as injected inline
+               }
+       }
+
+
+       /* move all style declarations that weren't injected from <head> to a <body> <style> section,
+                including but not limited to:
+                - pseudo-classes like a:hover {...} as they can't be set inline
+                - declaration chains like UL LI {...}
+                - #divname {...}. These are not supported by email clients like Mac/Entourage anyway, it seems. */
+       foreach ($styles[1] as $i => $type) {
+               if ($styles[6][$i]=="") {
+                       // add a <style type="text/css"> section after <body> if there's isn't one yet
+                       if (preg_match ("!<body[^>]*>\s*<style!mi", $body)==0) {
+                               $body = preg_replace ("/(<body[^>]*>)/i", "\n\$1\n".'<style type="text/css">'."\n<!--\n-->\n</style>\n", $body);
+                       }
+                       // append a copy of the pseudo-element declaration to that body style section
+                       $styledefinition = trim($styles[5][$i]);
+                       $styledefinition = preg_replace ("!\s+!mi", " ", $styledefinition ); // convert style definition to a one-liner (optional)
+                       $declaration = $styles[1][$i].trim($styles[2][$i]).$styles[3][$i].trim($styles[4][$i])." { ".$styledefinition." }";
+                       $body = preg_replace ("!(<body[^>]*>\s*<style[^>]*>\s*<\!\-\-[^>]*)"."(\s*\-\->\s*</style>)!si", "\$1".$declaration."\n\$2", $body);
+                       $styles[6][$i]= 2; // mark as moved to <style> section in <body>
+               }
+       }
+
+       // remove stylesheet declaration(s) from <head> section (comment following line out if not wanted)
+       //$body = preg_replace ("!(<head>.*)<style type.*</style>(.*</head>)!si", "\$1\$2" , $body);
+
+       // check what styles have been injected
+#                      print_r($styles);
+
+       return $body;
+}
+
+/**
+ * facteur_addstyle
+ * @author Eric Dols
+ *
+ * @param $matches
+ * @return string
+ */
+function facteur_addstyle($matches) {
+
+       // $matches[1]=tag, $matches[2]=tag attributes (if any), $matches[3]=xhtml closing (if any)
+
+       // variables values set in calling function
+       global $styledefinition, $styletag, $styleclass;
+
+       // convert the style definition to a one-liner
+       $styledefinition = preg_replace ("!\s+!mi", " ", $styledefinition );
+       // convert all double-quotes to single-quotes
+       $styledefinition = preg_replace ('/"/','\'', $styledefinition );
+
+       if (preg_match ("/style\=/i", $matches[2])) {
+                       // add styles to existing style attribute if any already in the tag
+                       $pattern = "!(.* style\=)[\"]([^\"]*)[\"](.*)!mi";
+                       $replacement = "\$1".'"'."\$2 ".$styledefinition.'"'."\$3";
+                       $attributes = preg_replace ($pattern, $replacement , $matches[2]);
+       } else {
+                       // otherwise add new style attribute to tag (none was present)
+                       $attributes = $matches[2].' style="'.$styledefinition.'"';
+       }
+
+       if ($styleclass!="") {
+               // if we were injecting a class style, remove the now useless class attribute from the html tag
+
+               // Single class in tag case (class="classname"): remove class attribute altogether
+               $pattern = "!(.*) class\=['\"]".$styleclass."['\"](.*)!mi";
+               $replacement = "\$1\$2";
+               $attributes = preg_replace ( $pattern, $replacement, $attributes);
+
+               // Multiple classes in tag case (class="classname anotherclass..."): remove class name from class attribute.
+               // classes are injected inline and removed by order of appearance in <head> stylesheet
+               // exact same behavior as where last declared class attributes in <style> take over (IE6 tested only)
+               $pattern = "!(.* class\=['\"][^\"]*)(".$styleclass." | ".$styleclass.")([^\"]*['\"].*)!mi";
+               $replacement = "\$1\$3";
+               $attributes = preg_replace ( $pattern, $replacement, $attributes);
+
+       }
+
+       return "<".$matches[1].$attributes.$matches[3].">";
+}
+
+/**
+ * Un filtre pour transformer les retour ligne texte en br si besoin (si pas autobr actif)
+ *
+ * @param string $texte
+ * @return string
+ */
+function facteur_nl2br_si_pas_autobr($texte){
+       return (_AUTOBR?$texte:nl2br($texte));
+}
+
+/**
+ * Transformer un mail HTML en mail Texte proprement :
+ * - les tableaux de mise en page sont utilisés pour structurer le mail texte
+ * - le reste du HTML est markdownifie car c'est un format texte lisible et conventionnel
+ *
+ * @param string $html
+ * @return string
+ */
+function facteur_mail_html2text($html){
+       // nettoyer les balises de mise en page html
+       $html = preg_replace(",</(td|th)>,Uims","<br/>",$html);
+       $html = preg_replace(",</(table)>,Uims","@@@hr@@@",$html);
+       $html = preg_replace(",</?(html|body|table|td|th|tbody|thead|center|article|section|span)[^>]*>,Uims","\n\n",$html);
+
+       // commentaires html et conditionnels
+       $html = preg_replace(",<!--.*-->,Uims","\n",$html);
+       $html = preg_replace(",<!\[.*\]>,Uims","\n",$html);
+
+       $html = preg_replace(",<(/?)(div|tr|caption)([^>]*>),Uims","<\\1p>",$html);
+       $html = preg_replace(",(<p>\s*)+,ims","<p>",$html);
+       $html = preg_replace(",<br/?>\s*</p>,ims","</p>",$html);
+       $html = preg_replace(",</p>\s*<br/?>,ims","</p>",$html);
+       $html = preg_replace(",(</p>\s*(@@@hr@@@)?\s*)+,ims","</p>\\2",$html);
+       $html = preg_replace(",(<p>\s*</p>),ims","",$html);
+
+       // succession @@@hr@@@<hr> et <hr>@@@hr@@@
+       $html = preg_replace(",@@@hr@@@\s*(<[^>]*>\s*)?<hr[^>]*>,ims","@@@hr@@@\n",$html);
+       $html = preg_replace(",<hr[^>]*>\s*(<[^>]*>\s*)?@@@hr@@@,ims","\n@@@hr@@@",$html);
+
+       $html = preg_replace(",<textarea[^>]*spip_cadre[^>]*>(.*)</textarea>,Uims","<code>\n\\1\n</code>",$html);
+
+       // vider le contenu de qqunes :
+       $html = preg_replace(",<head[^>]*>.*</head>,Uims","\n",$html);
+
+       // Liens :
+       // Nettoyage des liens des notes de bas de page
+       $html = preg_replace("@<a href=\"#n(b|h)[0-9]+-[0-9]+\" name=\"n(b|h)[0-9]+-[0-9]+\" class=\"spip_note\">([0-9]+)</a>@", "\\3", $html);
+       // Supprimer tous les liens internes
+       $html = preg_replace("/\<a href=['\"]#(.*?)['\"][^>]*>(.*?)<\/a>/ims","\\2", $html);
+       // Remplace tous les liens
+       preg_match_all("/\<a href=['\"](.*?)['\"][^>]*>(.*?)<\/a>/ims", $html,$matches,PREG_SET_ORDER);
+       $prelinks = $postlinks = array();
+       foreach ($matches as $k => $match){
+               $link = "@@@link$k@@@";
+               $url = str_replace("&amp;","&",$match[1]);
+               if ($match[2]==$match[1] OR $match[2]==$url){
+                       // si le texte est l'url :
+                       $prelinks[$match[0]] = "$link";
+               }
+               else {
+                       // texte + url
+                       $prelinks[$match[0]] = $match[2] . " ($link)";
+               }
+               $postlinks[$link] = $url;
+       }
+       $html = str_replace(array_keys($prelinks), array_values($prelinks),$html);
+
+       // les images par leur alt ?
+       // au moins les puces
+       $html = preg_replace(',<img\s[^>]*alt="-"[^>]*>,Uims','-',$html);
+       // les autres
+       $html = preg_replace(',<img\s[^>]*alt=[\'"]([^\'"]*)[\'"][^>]*>,Uims',"\\1",$html);
+       // on vire celles sans alt
+       $html = preg_replace(",</?(img)[^>]*>,Uims","\n",$html);
+
+       // espaces
+       $html = str_replace("&nbsp;"," ",$html);
+       $html = preg_replace(",<p>\s+,ims","<p>",$html);
+
+       #return $html;
+       include_spip("lib/markdownify/markdownify");
+       $parser = new Markdownify('inline',false,false);
+       $texte = $parser->parseString($html);
+
+       $texte = str_replace(array_keys($postlinks), array_values($postlinks),$texte);
+
+
+       // trim et sauts de ligne en trop ou pas assez
+       $texte = trim($texte);
+       $texte = str_replace("<br />\n","\n",$texte);
+       $texte = preg_replace(",(@@@hr@@@\s*)+\Z,ims","",$texte);
+       $texte = preg_replace(",(@@@hr@@@\s*\n)+,ims","\n\n\n".str_pad("-",75,"-")."\n\n\n",$texte);
+       $texte = preg_replace(",(\n#+\s),ims","\n\n\\1",$texte);
+       $texte = preg_replace(",(\n\s*)(\n\s*)+(\n)+,ims","\n\n\n",$texte);
+
+
+       // <p> et </p> restants
+       $texte = str_replace(array("<p>","</p>"),array("",""),$texte);
+
+       // entites restantes ? (dans du code...)
+       include_spip('inc/charsets');
+       $texte = unicode2charset($texte);
+       $texte = str_replace(array('&#039;', '&#034;'),array("'",'"'), $texte);
+
+
+       // Faire des lignes de 75 caracteres maximum
+       return trim(wordwrap($texte));
+}
+?>
diff --git a/www/plugins/facteur/facteur_ieconfig_metas.php b/www/plugins/facteur/facteur_ieconfig_metas.php
new file mode 100644 (file)
index 0000000..5f0e1bf
--- /dev/null
@@ -0,0 +1,18 @@
+<?php\r
+/*\r
+ * Plugin Facteur 2\r
+ * (c) 2009-2011 Collectif SPIP\r
+ * Distribue sous licence GPL\r
+ *\r
+ */\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+function facteur_ieconfig_metas($table){\r
+       $table['facteur']['titre'] = _T('facteur:configuration_facteur');\r
+       $table['facteur']['icone'] = 'facteur-16.png';\r
+       $table['facteur']['metas_brutes'] = 'facteur_adresse_envoi,facteur_adresse_envoi_nom,facteur_adresse_envoi_email,facteur_smtp,facteur_smtp_host,facteur_smtp_port,facteur_smtp_auth,facteur_smtp_username,facteur_smtp_password,facteur_smtp_secure,facteur_smtp_sender,facteur_filtre_images,facteur_filtre_css,facteur_filtre_iso_8859';\r
+       return $table;\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/facteur_pipelines.php b/www/plugins/facteur/facteur_pipelines.php
new file mode 100644 (file)
index 0000000..2bdbdce
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Plugin Facteur
+ * (c) 2009-2013 Collectif SPIP
+ * Distribue sous licence GPL
+ * 
+ * @package SPIP\Facteur\Pipelines
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+/**
+ * Insertion dans le pipeline recuperer_fond (SPIP)
+ * 
+ * On indique dans le formulaire de configuration de l'identité du site
+ * que facteur surchargera l'email configuré ici pour envoyer les emails
+ * 
+ * @param array $flux
+ *             Le contexte du pipeline
+ * @return array $flux
+ *             Le contexte du pipeline modifé
+ */
+function facteur_recuperer_fond($flux){
+       if(($flux['args']['fond'] == 'formulaires/configurer_identite')
+               && (isset($GLOBALS['meta']['facteur_adresse_envoi']) && $GLOBALS['meta']['facteur_adresse_envoi'] == 'oui')
+               && (isset($GLOBALS['meta']['facteur_adresse_envoi_email']) && strlen($GLOBALS['meta']['facteur_adresse_envoi_email']) > 0)){
+               $ajout = '<p class="notice">'._T('facteur:message_identite_email').'</p>';
+               $flux['data'] = preg_replace(",(<li [^>]*class=[\"']editer editer_email_webmaster.*>)(.*<label),Uims","\\1".$ajout."\\2",$flux['data'],1);
+       }
+       return $flux;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/formulaires/configurer_facteur.html b/www/plugins/facteur/formulaires/configurer_facteur.html
new file mode 100644 (file)
index 0000000..6f7122b
--- /dev/null
@@ -0,0 +1,197 @@
+<div class="formulaire_spip formulaire_configurer formulaire_#FORM">
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+
+       [(#ENV{tester,''}|oui)
+       <iframe style='width:95%;height:500px;margin:10px;' src='#URL_PAGE{emails/test_email_html,var_mode=calcul}'></iframe>
+       ]
+       <form method="post" action="#ENV{action}"><div>
+               #ACTION_FORMULAIRE{#ENV{action}}
+               <ul>
+                       <li class="fieldset">
+                               <fieldset>
+                                       <legend><:facteur:configuration_adresse_envoi:></legend>
+                                       <ul>
+                                               <li class="editer editer_facteur_adresse_envoi [ (#ENV**{erreurs}|table_valeur{facteur_adresse_envoi}|oui)erreur]">
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_adresse_envoi})</span>]
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_adresse_envoi" class="radio" value="non" id="facteur_adresse_envoi_non"[(#ENV{facteur_adresse_envoi,'non'}|=={non}|oui)checked="checked"]/>
+                                                               <label for="facteur_adresse_envoi_non"><:facteur:utiliser_reglages_site:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_adresse_envoi" class="radio" value="oui" id="facteur_adresse_envoi_oui"[(#ENV{facteur_adresse_envoi,'non'}|=={oui}|oui)checked="checked"]/>
+                                                               <label for="facteur_adresse_envoi_oui"><:facteur:personnaliser:></label>
+                                                       </div>
+                                               </li>
+                                               <li class="editer editer_facteur_adresse_envoi_perso editer_facteur_adresse_envoi_nom [ (#ENV**{erreurs}|table_valeur{facteur_adresse_envoi_nom}|oui)erreur]"[(#ENV{facteur_adresse_envoi,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label for="facteur_adresse_envoi_nom"><:facteur:facteur_adresse_envoi_nom:></label>[
+                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_adresse_envoi_nom})</span>]
+                                                       <input type="text" name="facteur_adresse_envoi_nom" class="text" value="#ENV**{facteur_adresse_envoi_nom}" id="facteur_adresse_envoi_nom" />
+                                               </li>
+                                               <li class="editer editer_facteur_adresse_envoi_perso editer_facteur_adresse_envoi_email [ (#ENV**{erreurs}|table_valeur{facteur_adresse_envoi_email}|oui)erreur]"[(#ENV{facteur_adresse_envoi,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label for="facteur_adresse_envoi_email"><:facteur:facteur_adresse_envoi_email:></label>[
+                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_adresse_envoi_email})</span>]
+                                                       <input type="text" name="facteur_adresse_envoi_email" class="text" value="#ENV**{facteur_adresse_envoi_email}" id="facteur_adresse_envoi_email" />
+                                               </li>
+                                       </ul>
+                               </fieldset>
+                       </li>
+                       <li class="fieldset">
+                               <fieldset>
+                                       <legend><:facteur:configuration_mailer:></legend>
+                                       <ul>
+                                               <li class="editer editer_facteur_smtp [ (#ENV**{erreurs}|table_valeur{facteur_smtp}|oui)erreur]">
+                                                       <label><:facteur:configuration_smtp:></label>
+                                                       <p class="explication"><:facteur:configuration_smtp_descriptif:></p>
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp})</span>]
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp" class="radio" value="non" id="facteur_smtp_non"[(#ENV{facteur_smtp,'non'}|=={non}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_non"><:facteur:utiliser_mail:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp" class="radio" value="oui" id="facteur_smtp_oui"[(#ENV{facteur_smtp,'non'}|=={oui}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_oui"><:facteur:utiliser_smtp:></label>
+                                                       </div>
+                                               </li>
+                                               <li class="editer editer_facteur_smtp_param editer_facteur_smtp_host [ (#ENV**{erreurs}|table_valeur{facteur_smtp_host}|oui)erreur]"[(#ENV{facteur_smtp,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label for="facteur_smtp_host"><:facteur:facteur_smtp_host:></label>[
+                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_host})</span>]
+                                                       <input type="text" name="facteur_smtp_host" class="text" value="#ENV**{facteur_smtp_host}" id="facteur_smtp_host" />
+                                               </li>
+                                               <li class="editer editer_facteur_smtp_param editer_facteur_smtp_port [ (#ENV**{erreurs}|table_valeur{facteur_smtp_port}|oui)erreur]"[(#ENV{facteur_smtp,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label for="facteur_smtp_port"><:facteur:facteur_smtp_port:></label>[
+                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_port})</span>]
+                                                       <input type="text" name="facteur_smtp_port" class="text" value="#ENV**{facteur_smtp_port}" id="facteur_smtp_port" />
+                                               </li>
+                                               <li class="editer editer_facteur_smtp_param editer_facteur_smtp_auth [ (#ENV**{erreurs}|table_valeur{facteur_smtp_auth}|oui)erreur]"[(#ENV{facteur_smtp,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label><:facteur:facteur_smtp_auth:></label>
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_auth})</span>]
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp_auth" class="radio" value="non" id="facteur_smtp_auth_non"[(#ENV{facteur_smtp_auth,'non'}|=={non}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_auth_non"><:facteur:facteur_smtp_auth_non:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp_auth" class="radio" value="oui" id="facteur_smtp_auth_oui"[(#ENV{facteur_smtp_auth,'non'}|=={oui}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_auth_oui"><:facteur:facteur_smtp_auth_oui:></label>
+                                                       </div>
+                                                       <ul id="smtp-auth"[(#ENV{facteur_smtp_auth,'non'}|=={non}|oui)style='display:none;']>
+                                                               <li class="editer_facteur_smtp_username [ (#ENV**{erreurs}|table_valeur{facteur_smtp_username}|oui)erreur]">
+                                                                       <label for="facteur_smtp_username"><:facteur:facteur_smtp_username:></label>[
+                                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_username})</span>]
+                                                                       <input type="text" name="facteur_smtp_username" class="text" value="#ENV**{facteur_smtp_username}" id="facteur_smtp_username" />
+                                                               </li>
+                                                               <li class="editer_facteur_smtp_password [ (#ENV**{erreurs}|table_valeur{facteur_smtp_password}|oui)erreur]">
+                                                                       <label for="facteur_smtp_password"><:facteur:facteur_smtp_password:></label>[
+                                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_password})</span>]
+                                                                       <input type="password" name="facteur_smtp_password" class="text" value="#ENV**{facteur_smtp_password}" id="facteur_smtp_password" />
+                                                               </li>
+                                                       </ul>
+                                               </li>
+                                               [(#ENV{_enable_smtp_secure}|oui)
+                                               <li class="editer editer_facteur_smtp_param editer_facteur_smtp_secure [ (#ENV**{erreurs}|table_valeur{facteur_smtp_secure}|oui)erreur]"[(#ENV{facteur_smtp,'non'}|=={non}|oui)style='display:none;']>
+                                                       <label><:facteur:facteur_smtp_secure:></label>
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_secure})</span>]
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp_secure" class="radio" value="non" id="facteur_smtp_secure_non"[(#ENV{facteur_smtp_secure,'non'}|=={non}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_secure_non"><:facteur:facteur_smtp_secure_non:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp_secure" class="radio" value="ssl" id="facteur_smtp_secure_ssl"[(#ENV{facteur_smtp_secure,'non'}|=={ssl}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_secure_ssl"><:facteur:facteur_smtp_secure_ssl:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="radio" name="facteur_smtp_secure" class="radio" value="tls" id="facteur_smtp_secure_tls"[(#ENV{facteur_smtp_secure,'non'}|=={tls}|oui)checked="checked"]/>
+                                                               <label for="facteur_smtp_secure_tls"><:facteur:facteur_smtp_secure_tls:></label>
+                                                       </div>
+                                               </li>]
+                                               <li class="editer editer_facteur_smtp_sender [ (#ENV**{erreurs}|table_valeur{facteur_smtp_sender}|oui)erreur]">
+                                                       <label for="facteur_smtp_sender"><:facteur:facteur_smtp_sender:></label>[
+                                                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_sender})</span>]
+                                                       <p class="explication"><:facteur:facteur_smtp_sender_descriptif:></p>
+                                                       <input type="text" name="facteur_smtp_sender" class="text" value="#ENV**{facteur_smtp_sender}" id="facteur_smtp_sender" />
+                                               </li>
+                                       </ul>
+                               </fieldset>
+                       </li>
+                       <li class="fieldset">
+                               <fieldset>
+                                       <legend><:facteur:facteur_filtres:></legend>
+                                       <ul>
+                                               <li class="editer editer_facteur_filtres[ (#ENV**{erreurs}|table_valeur{facteur_filtres}|oui)erreur]">
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_smtp_secure})</span>]
+                                                       <p class="explication"><:facteur:facteur_filtres_descriptif:></p>
+                                                       <div class="choix">
+                                                               <input type="checkbox" name="facteur_filtre_images" class="checkbox" value="1" id="facteur_filtre_images"[(#ENV{facteur_filtre_images,''}|=={1}|oui)checked="checked"]/>
+                                                               <label for="facteur_filtre_images"><:facteur:facteur_filtre_images:></label>
+                                                       </div>
+                                                       <div class="choix">
+                                                               <input type="checkbox" name="facteur_filtre_iso_8859" class="checkbox" value="1" id="facteur_filtre_iso_8859"[(#ENV{facteur_filtre_iso_8859,''}|=={1}|oui)checked="checked"]/>
+                                                               <label for="facteur_filtre_iso_8859"><:facteur:facteur_filtre_iso_8859:></label>
+                                                       </div>
+                                               </li>
+                                       </ul>
+                               </fieldset>
+                       </li>
+                       <li class="fieldset">
+                               <fieldset>
+                                       <legend><:facteur:facteur_copies:></legend>
+                                       <ul>
+                                               <li class="editer editer_facteur_copies editer_facteur_desc">
+                                                       <p class="explication"><:facteur:facteur_copies_descriptif:></p>
+                                               </li>
+                                               <li class="editer editer_facteur_copies editer_facteur_cc [ (#ENV**{erreurs}|table_valeur{facteur_cc}|oui)erreur]">
+                                                       <label for="facteur_cc"><:facteur:facteur_cc:></label>
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_cc})</span>]
+                                                       <input type="text" name="facteur_cc" class="text" value="#ENV**{facteur_cc}" id="facteur_cc" />
+                                               </li>
+                                               <li class="editer editer_facteur_copies editer_facteur_bcc [ (#ENV**{erreurs}|table_valeur{facteur_bcc}|oui)erreur]">
+                                                       <label for="facteur_bcc"><:facteur:facteur_bcc:></label>
+                                                       [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{facteur_bcc})</span>]
+                                                       <input type="text" name="facteur_bcc" class="text" value="#ENV**{facteur_bcc}" id="facteur_bcc" />
+                                               </li>
+                                       </ul>
+                               </fieldset>
+                       </li>
+               </ul>
+               <p class="boutons">
+                       <input type="submit" name="valider" class="submit" value="<:bouton_valider:>" />
+               </p>
+               <ul>
+                       <li class="fieldset">
+                               <fieldset>
+                                       <h3 class="legend"><:facteur:tester_la_configuration:></h3>
+                                       <ul>
+                                               <li>
+                                               <p class="explication"><:facteur:note_test_configuration:></p>  
+                                               </li>
+                                       </ul>
+                               </fieldset>
+                       </li>
+               </ul>
+               <p class="boutons">
+                       <input type="submit" name="tester" class="submit" value="<:facteur:tester:>" />
+               </p>
+       </div></form>
+</div>
+<script type="text/javascript">
+jQuery(function(){
+       jQuery('input[name=facteur_adresse_envoi]').change(function(){
+                       if (jQuery(this).attr('value')=='oui')
+                               jQuery('.editer_facteur_adresse_envoi_perso').show('fast');
+                       else
+                               jQuery('.editer_facteur_adresse_envoi_perso').hide('fast');
+       });
+       jQuery('input[name=facteur_smtp]').change(function(){
+                       if (jQuery(this).attr('value')=='oui')
+                               jQuery('.editer_facteur_smtp_param').show('fast');
+                       else
+                               jQuery('.editer_facteur_smtp_param').hide('fast');
+       });
+       jQuery('input[name=facteur_smtp_auth]').change(function(){
+                       if (jQuery(this).attr('value')=='oui')
+                               jQuery('#smtp-auth').show('fast');
+                       else
+                               jQuery('#smtp-auth').hide('fast');
+       });
+})
+</script>
diff --git a/www/plugins/facteur/formulaires/configurer_facteur.php b/www/plugins/facteur/formulaires/configurer_facteur.php
new file mode 100644 (file)
index 0000000..0aa321b
--- /dev/null
@@ -0,0 +1,171 @@
+<?php\r
+/*\r
+ * Plugin Facteur 2\r
+ * (c) 2009-2011 Collectif SPIP\r
+ * Distribue sous licence GPL\r
+ *\r
+ */\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+function formulaires_configurer_facteur_charger_dist(){\r
+       $valeurs = array(\r
+               'facteur_adresse_envoi' => $GLOBALS['meta']['facteur_adresse_envoi'],\r
+               'facteur_adresse_envoi_nom' => $GLOBALS['meta']['facteur_adresse_envoi_nom'],\r
+               'facteur_adresse_envoi_email' => $GLOBALS['meta']['facteur_adresse_envoi_email'],\r
+               'facteur_smtp' => $GLOBALS['meta']['facteur_smtp'],\r
+               'facteur_smtp_host' => $GLOBALS['meta']['facteur_smtp_host'],\r
+               'facteur_smtp_port' => $GLOBALS['meta']['facteur_smtp_port']?$GLOBALS['meta']['facteur_smtp_port']:'25',\r
+               'facteur_smtp_auth' => $GLOBALS['meta']['facteur_smtp_auth'],\r
+               'facteur_smtp_username' => $GLOBALS['meta']['facteur_smtp_username'],\r
+               'facteur_smtp_password' => $GLOBALS['meta']['facteur_smtp_password'],\r
+               'facteur_smtp_secure' => $GLOBALS['meta']['facteur_smtp_secure'],\r
+               'facteur_smtp_sender' => $GLOBALS['meta']['facteur_smtp_sender'],\r
+               'facteur_filtre_images' => $GLOBALS['meta']['facteur_filtre_images'],\r
+               'facteur_filtre_iso_8859' => $GLOBALS['meta']['facteur_filtre_iso_8859'],\r
+               '_enable_smtp_secure' => (intval(phpversion()) == 5)?' ':'',\r
+               'facteur_cc' => $GLOBALS['meta']['facteur_cc'],\r
+               'facteur_bcc' => $GLOBALS['meta']['facteur_bcc'],\r
+       'tester' => '',\r
+       );\r
+\r
+       return $valeurs;\r
+}\r
+\r
+function formulaires_configurer_facteur_verifier_dist(){\r
+       $erreurs = array();\r
+       if ($email = _request('facteur_adresse_envoi_email')\r
+         AND !email_valide($email)) {\r
+               $erreurs['facteur_adresse_envoi_email'] = _T('form_email_non_valide');\r
+               set_request('facteur_adresse_envoi','oui');\r
+       }\r
+       if (_request('facteur_smtp')=='oui'){\r
+               if (!($h=_request('facteur_smtp_host')))\r
+                       $erreurs['facteur_smtp_host'] = _T('info_obligatoire');\r
+               else {\r
+                       $regexp_ip_valide = '#^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$#'; \r
+                       // Source : http://www.d-sites.com/2008/10/09/regex-ipv4-et-ipv6/\r
+                       if (!preg_match($regexp_ip_valide,$h)){ // ce n'est pas une IP\r
+                               if(!preg_match(';^([^.\s/?:]+[.]){0,2}[^.\s/?:]+$;',$h)\r
+                                 OR gethostbyname($h)==$h)\r
+                                       $erreurs['facteur_smtp_host'] = _T('facteur:erreur_invalid_host');\r
+                       }\r
+                       else {\r
+                               if (gethostbyaddr($h)==$h)\r
+                                       $erreurs['facteur_smtp_host'] = _T('facteur:erreur_invalid_host');                              \r
+                       }\r
+               }\r
+               if (!($p=_request('facteur_smtp_port')))\r
+                       $erreurs['facteur_smtp_port'] = _T('info_obligatoire');\r
+               elseif(!preg_match(';^[0-9]+$;',$p) OR !intval($p))\r
+                       $erreurs['facteur_smtp_port'] = _T('facteur:erreur_invalid_port');\r
+\r
+               if (!_request('facteur_smtp_auth'))\r
+                       $erreurs['facteur_smtp_auth'] = _T('info_obligatoire');\r
+\r
+               if (_request('facteur_smtp_auth')=='oui'){\r
+                       if (!_request('facteur_smtp_username'))\r
+                               $erreurs['facteur_smtp_username'] = _T('info_obligatoire');\r
+                       if (!_request('facteur_smtp_password'))\r
+                               $erreurs['facteur_smtp_password'] = _T('info_obligatoire');\r
+               }\r
+       }\r
+       if ($emailcc = _request('facteur_cc')\r
+         AND !email_valide($emailcc)) {\r
+               $erreurs['facteur_cc'] = _T('form_email_non_valide');\r
+       }\r
+       if ($emailbcc = _request('facteur_bcc')\r
+         AND !email_valide($emailbcc)) {\r
+               $erreurs['facteur_bcc'] = _T('form_email_non_valide');\r
+       }\r
+       \r
+       if(count($erreurs)>0){\r
+               $erreurs['message_erreur'] = _T('facteur:erreur_generale');\r
+       }\r
+       return $erreurs;\r
+}\r
+\r
+function formulaires_configurer_facteur_traiter_dist(){\r
+       include_spip('inc/meta');\r
+\r
+       $facteur_adresse_envoi = _request('facteur_adresse_envoi');\r
+       ecrire_meta('facteur_adresse_envoi', ($facteur_adresse_envoi=='oui')?'oui':'non');\r
+\r
+       $facteur_adresse_envoi_nom = _request('facteur_adresse_envoi_nom');\r
+       ecrire_meta('facteur_adresse_envoi_nom', $facteur_adresse_envoi_nom?$facteur_adresse_envoi_nom:'');\r
+\r
+       $facteur_adresse_envoi_email = _request('facteur_adresse_envoi_email');\r
+       ecrire_meta('facteur_adresse_envoi_email', $facteur_adresse_envoi_email?$facteur_adresse_envoi_email:'');\r
+\r
+       $facteur_smtp = _request('facteur_smtp');\r
+       ecrire_meta('facteur_smtp', ($facteur_smtp=='oui')?'oui':'non');\r
+\r
+       $facteur_smtp_host = _request('facteur_smtp_host');\r
+       ecrire_meta('facteur_smtp_host', $facteur_smtp_host?$facteur_smtp_host:'');\r
+\r
+       $facteur_smtp_port = _request('facteur_smtp_port');\r
+       ecrire_meta('facteur_smtp_port', strlen($facteur_smtp_port)?intval($facteur_smtp_port):'');\r
+\r
+       $facteur_smtp_auth = _request('facteur_smtp_auth');\r
+       ecrire_meta('facteur_smtp_auth', ($facteur_smtp_auth=='oui')?'oui':'non');\r
+\r
+       $facteur_smtp_username = _request('facteur_smtp_username');\r
+       ecrire_meta('facteur_smtp_username', $facteur_smtp_username);\r
+\r
+       $facteur_smtp_password = _request('facteur_smtp_password');\r
+       ecrire_meta('facteur_smtp_password', $facteur_smtp_password);\r
+\r
+       if (intval(phpversion()) == 5) {\r
+               $facteur_smtp_secure = _request('facteur_smtp_secure');\r
+               ecrire_meta('facteur_smtp_secure', in_array($facteur_smtp_secure,array('non','ssl','tls'))?$facteur_smtp_secure:'non');\r
+       }\r
+\r
+       $facteur_smtp_sender = _request('facteur_smtp_sender');\r
+       ecrire_meta('facteur_smtp_sender', $facteur_smtp_sender);\r
+\r
+       ecrire_meta('facteur_filtre_images', intval(_request('facteur_filtre_images')));\r
+       ecrire_meta('facteur_filtre_iso_8859', intval(_request('facteur_filtre_iso_8859')));\r
+\r
+       $facteur_cc = _request('facteur_cc');\r
+       ecrire_meta('facteur_cc', $facteur_cc?$facteur_cc:'');\r
+\r
+       $facteur_bcc = _request('facteur_bcc');\r
+       ecrire_meta('facteur_bcc', $facteur_bcc?$facteur_bcc:'');\r
+       \r
+       \r
+       $res = array('message_ok'=>_T('facteur:config_info_enregistree'));\r
+\r
+       // faut-il envoyer un message de test ?\r
+       if (_request('tester')){\r
+\r
+               if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui'\r
+                 AND $GLOBALS['meta']['facteur_adresse_envoi_email'])\r
+                       $destinataire = $GLOBALS['meta']['facteur_adresse_envoi_email'];\r
+               else\r
+                       $destinataire = $GLOBALS['meta']['email_webmaster'];\r
+\r
+               if ((facteur_envoyer_mail_test($destinataire,_T('facteur:corps_email_de_test')))===true){\r
+                       // OK\r
+                       $res = array('message_ok'=>_T('facteur:email_test_envoye'));\r
+               }\r
+               else {\r
+                       // erreur\r
+                       $res = array('message_erreur'=>_T('facteur:erreur')._T('facteur:erreur_dans_log'));\r
+               }\r
+       }\r
+       \r
+       return $res;\r
+}\r
+\r
+function facteur_envoyer_mail_test($destinataire,$titre){\r
+       include_spip('classes/facteur');\r
+       $message_html   = recuperer_fond('emails/test_email_html', array());\r
+       $message_texte  = recuperer_fond('emails/test_email_texte', array());\r
+\r
+       // passer par envoyer_mail pour bien passer par les pipeline et avoir tous les logs\r
+       $envoyer_mail = charger_fonction('envoyer_mail','inc');\r
+       $retour = $envoyer_mail($destinataire, $titre, array('html'=>$message_html,'texte'=>$message_texte));\r
+\r
+       return $retour?true:false;\r
+}\r
+?>\r
diff --git a/www/plugins/facteur/inc/envoyer_mail.php b/www/plugins/facteur/inc/envoyer_mail.php
new file mode 100644 (file)
index 0000000..261c7c1
--- /dev/null
@@ -0,0 +1,230 @@
+<?php\r
+/*\r
+ * Plugin Facteur 2\r
+ * (c) 2009-2011 Collectif SPIP\r
+ * Distribue sous licence GPL\r
+ *\r
+ */\r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+include_spip('classes/facteur');\r
+// inclure le fichier natif de SPIP, pour les fonctions annexes\r
+include_once _DIR_RESTREINT."inc/envoyer_mail.php";\r
+\r
+/**\r
+ * @param string $destinataire\r
+ * @param string $sujet\r
+ * @param string|array $corps\r
+ *   au format string, c'est un corps d'email au format texte, comme supporte nativement par le core\r
+ *   au format array, c'est un corps etendu qui peut contenir\r
+ *     string texte : le corps d'email au format texte\r
+ *     string html : le corps d'email au format html\r
+ *     string from : email de l'envoyeur (prioritaire sur argument $from de premier niveau, deprecie)\r
+ *     string nom_envoyeur : un nom d'envoyeur pour completer l'email from\r
+ *     string cc : destinataires en copie conforme\r
+ *     string bcc : destinataires en copie conforme cachee\r
+ *     string|array repondre_a : une ou plusieurs adresses à qui répondre\r
+ *     string adresse_erreur : addresse de retour en cas d'erreur d'envoi\r
+ *     array pieces_jointes : listes de pieces a embarquer dans l'email, chacune au format array :\r
+ *       string chemin : chemin file system pour trouver le fichier a embarquer\r
+ *       string nom : nom du document tel qu'apparaissant dans l'email\r
+ *       string encodage : encodage a utiliser, parmi 'base64', '7bit', '8bit', 'binary', 'quoted-printable'\r
+ *       string mime : mime type du document\r
+ *     array headers : tableau d'en-tetes personalises, une entree par ligne d'en-tete\r
+ * @param string $from (deprecie, utiliser l'entree from de $corps)\r
+ * @param string $headers (deprecie, utiliser l'entree headers de $corps)\r
+ * @return bool\r
+ */\r
+function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers = "") {\r
+       $message_html   = '';\r
+       $message_texte  = '';\r
+\r
+       // si $corps est un tableau -> fonctionnalites etendues\r
+       // avec entrees possible : html, texte, pieces_jointes, nom_envoyeur, ...\r
+       if (is_array($corps)) {\r
+               $message_html   = $corps['html'];\r
+               $message_texte  = nettoyer_caracteres_mail($corps['texte']);\r
+               $pieces_jointes = $corps['pieces_jointes'];\r
+               $nom_envoyeur = $corps['nom_envoyeur'];\r
+               $from = (isset($corps['from'])?$corps['from']:$from);\r
+               $cc = $corps['cc'];\r
+               $bcc = $corps['bcc'];\r
+               $repondre_a = $corps['repondre_a'];\r
+               $adresse_erreur = $corps['adresse_erreur'];\r
+               $headers = (isset($corps['headers'])?$corps['headers']:$headers);\r
+               if (is_string($headers))\r
+                       $headers = array_map('trim',explode("\n",$headers));\r
+       }\r
+       // si $corps est une chaine -> compat avec la fonction native SPIP\r
+       // gerer le cas ou le corps est du html avec un Content-Type: text/html dans les headers\r
+       else {\r
+               if (preg_match(',Content-Type:\s*text/html,ims',$headers)){\r
+                       $message_html   = $corps;\r
+               }\r
+               else {\r
+                       // Autodetection : tester si le mail est en HTML\r
+                       if (strpos($headers,"Content-Type:")===false\r
+                               AND strpos($corps,"<")!==false // eviter les tests suivants si possible\r
+                               AND $ttrim = trim($corps)\r
+                               AND substr($ttrim,0,1)=="<"\r
+                         AND substr($ttrim,-1,1)==">"\r
+                         AND stripos($ttrim,"</html>")!==false){\r
+\r
+                               if(!strlen($sujet)){\r
+                                       // dans ce cas on ruse un peu : extraire le sujet du title\r
+                                       if (preg_match(",<title>(.*)</title>,Uims",$corps,$m))\r
+                                               $sujet = $m[1];\r
+                                       else {\r
+                                               // fallback, on prend le body si on le trouve\r
+                                               if (preg_match(",<body[^>]*>(.*)</body>,Uims",$corps,$m))\r
+                                                       $ttrim = $m[1];\r
+\r
+                                               // et on extrait la premiere ligne de vrai texte...\r
+                                               // nettoyer le html et les retours chariots\r
+                                               $ttrim = textebrut($ttrim);\r
+                                               $ttrim = str_replace("\r\n", "\r", $ttrim);\r
+                                               $ttrim = str_replace("\r", "\n", $ttrim);\r
+                                               // decouper\r
+                                               $ttrim = explode("\n",trim($ttrim));\r
+                                               // extraire la premiere ligne de texte brut\r
+                                               $sujet = array_shift($ttrim);\r
+                                       }\r
+                               }\r
+                               $message_html   = $corps;\r
+                       }\r
+                       // c'est vraiment un message texte\r
+                       else\r
+                               $message_texte  = nettoyer_caracteres_mail($corps);\r
+               }\r
+               $headers = array_map('trim',explode("\n",$headers));\r
+       }\r
+       $sujet = nettoyer_titre_email($sujet);\r
+\r
+       // si le mail est en texte brut, on l'encapsule dans un modele surchargeable\r
+       // pour garder le texte brut, il suffit de faire un modele qui renvoie uniquement #ENV*{texte}\r
+       if ($message_texte AND ! $message_html){\r
+               $message_html = recuperer_fond("emails/texte",array('texte'=>$message_texte,'sujet'=>$sujet));\r
+       }\r
+       // si le mail est en HTML sans alternative, la generer\r
+       if ($message_html AND !$message_texte){\r
+               $message_texte = facteur_mail_html2text($message_html);\r
+       }\r
+\r
+       // mode TEST : forcer l'email\r
+       if (defined('_TEST_EMAIL_DEST')) {\r
+               if (!_TEST_EMAIL_DEST)\r
+                       return false;\r
+               else\r
+                       $destinataire = _TEST_EMAIL_DEST;\r
+       }\r
+\r
+       // plusieurs destinataires peuvent etre fournis separes par des virgules\r
+       // c'est un format standard dans l'envoi de mail\r
+       // les passer au format array pour phpMailer\r
+       // mais ne pas casser si on a deja un array en entree\r
+       if (is_array($destinataire))\r
+               $destinataire = implode(", ",$destinataire);\r
+       $destinataire = array_map('trim',explode(",",$destinataire));\r
+       \r
+       // On crée l'objet Facteur (PHPMailer) pour le manipuler ensuite\r
+       $facteur = new Facteur($destinataire, $sujet, $message_html, $message_texte);\r
+       \r
+       // On ajoute le courriel de l'envoyeur s'il est fournit par la fonction\r
+       if (empty($from) AND empty($facteur->From)) {\r
+               $from = $GLOBALS['meta']["email_envoi"];\r
+               if (empty($from) OR !email_valide($from)) {\r
+                       spip_log("Meta email_envoi invalide. Le mail sera probablement vu comme spam.");\r
+                       $from = $destinataire;\r
+               }\r
+       }\r
+\r
+       // "Marie Toto <Marie@toto.com>"\r
+       if (preg_match(",^([^<>\"]*)<([^<>\"]+)>$,i",$from,$m)){\r
+               $nom_envoyeur = trim($m[1]);\r
+               $from = trim($m[2]);\r
+       }\r
+       if (!empty($from)){\r
+               $facteur->From = $from;\r
+               // la valeur par défaut de la config n'est probablement pas valable pour ce mail,\r
+               // on l'écrase pour cet envoi\r
+               $facteur->FromName = $from;\r
+       }\r
+\r
+       // On ajoute le nom de l'envoyeur s'il fait partie des options\r
+       if ($nom_envoyeur)\r
+               $facteur->FromName = $nom_envoyeur;\r
+\r
+       // Si plusieurs emails dans le from, pas de Name !\r
+       if (strpos($facteur->From,",")!==false){\r
+               $facteur->FromName = "";\r
+       }\r
+\r
+       // S'il y a des copies à envoyer\r
+       if ($cc){\r
+               if (is_array($cc))\r
+                       foreach ($cc as $courriel)\r
+                               $facteur->AddCC($courriel);\r
+               else\r
+                       $facteur->AddCC($cc);\r
+       }\r
+       \r
+       // S'il y a des copies cachées à envoyer\r
+       if ($bcc){\r
+               if (is_array($bcc))\r
+                       foreach ($bcc as $courriel)\r
+                               $facteur->AddBCC($courriel);\r
+               else\r
+                       $facteur->AddBCC($bcc);\r
+       }\r
+       \r
+       // S'il y a des copies cachées à envoyer\r
+       if ($repondre_a){\r
+               if (is_array($repondre_a))\r
+                       foreach ($repondre_a as $courriel)\r
+                               $facteur->AddReplyTo($courriel);\r
+               else\r
+                       $facteur->AddReplyTo($repondre_a);\r
+       }\r
+       \r
+       // S'il y a des pièces jointes on les ajoute proprement\r
+       if (count($pieces_jointes)) {\r
+               foreach ($pieces_jointes as $piece) {\r
+                       $facteur->AddAttachment(\r
+                               $piece['chemin'],\r
+                               isset($piece['nom']) ? $piece['nom']:'',\r
+                               (isset($piece['encodage']) AND in_array($piece['encodage'],array('base64', '7bit', '8bit', 'binary', 'quoted-printable'))) ? $piece['encodage']:'base64',\r
+                               isset($piece['mime']) ? $piece['mime']:Facteur::_mime_types(pathinfo($piece['chemin'], PATHINFO_EXTENSION))\r
+                       );\r
+               }\r
+       }\r
+\r
+       // Si une adresse email a été spécifiée pour les retours en erreur, on l'ajoute\r
+       if (!empty($adresse_erreur))\r
+               $facteur->Sender = $adresse_erreur;\r
+\r
+       // si entetes personalises : les ajouter\r
+       // bug : semble ecraser les autres headers. A debug si on veut le rendre fonctionnel\r
+       //if (!empty($headers)) {\r
+       //      foreach($headers as $h)\r
+       //              $facteur->AddCustomHeader($h);\r
+       //}\r
+       \r
+       // On passe dans un pipeline pour modifier tout le facteur avant l'envoi\r
+       $facteur = pipeline('facteur_pre_envoi', $facteur);\r
+       \r
+       // On génère les headers\r
+       $head = $facteur->CreateHeader();\r
+\r
+       // Et c'est parti on envoie enfin\r
+       spip_log("mail via facteur\n$head"."Destinataire:".print_r($destinataire,true),'mail');\r
+       spip_log("mail\n$head"."Destinataire:".print_r($destinataire,true),'facteur');\r
+       $retour = $facteur->Send();\r
+       \r
+       if (!$retour)\r
+               spip_log("Erreur Envoi mail via Facteur : ".print_r($facteur->ErrorInfo,true),'facteur');\r
+\r
+       return $retour ;\r
+}\r
+\r
+?>\r
diff --git a/www/plugins/facteur/inc/facteur_classes.php b/www/plugins/facteur/inc/facteur_classes.php
new file mode 100644 (file)
index 0000000..60244e0
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/*
+ * Plugin Facteur 2
+ * (c) 2009-2011 Collectif SPIP
+ * Distribue sous licence GPL
+ *
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+/*
+ * Compatibilite avec plugins faisant un appel direct a ce fichier
+ */
+include_spip('classes/facteur');
+
+
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/lang/facteur.xml b/www/plugins/facteur/lang/facteur.xml
new file mode 100644 (file)
index 0000000..44a7f74
--- /dev/null
@@ -0,0 +1,25 @@
+<traduction module="facteur" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/facteur/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=de" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+               <traducteur nom="Torsten Willmann" lien="http://trad.spip.net/auteur/torsten-willmann" />
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=en" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+               <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=es" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="dani" lien="http://trad.spip.net/auteur/dani" />
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
+       </langue>
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fr" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=nl" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=sk" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/facteur/lang/facteur_de.php b/www/plugins/facteur/lang/facteur_de.php
new file mode 100644 (file)
index 0000000..21158e7
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'Die Konfiguration des Briefträgers wurde gespeichert.',
+       'configuration_adresse_envoi' => 'Absenderadresse einstellen',
+       'configuration_facteur' => 'Briefträger',
+       'configuration_mailer' => 'Konfiguration des Mailers',
+       'configuration_smtp' => 'Auswahl der Versandmethode',
+       'configuration_smtp_descriptif' => 'Im Zweifel hier die mail() Funktion von PHP eintragen.',
+       'corps_email_de_test' => 'Das ist ein Versandtest mit Sondärzeichen: Bär Größe Maß accentué',
+
+       // E
+       'email_envoye_par' => 'Absender @site@',
+       'email_test_envoye' => 'Die Testmail wurde fehlerfrei verschickt. Falls sie nicht richtig ankommt, bearbeiten sie ihre Serverkonfiguration oder kontaktieren sie den Administrator.',
+       'erreur' => 'Fehler',
+       'erreur_dans_log' => ' : mehr Details in der Logdatei',
+       'erreur_generale' => 'Konfigurationsfehler. Bitte Inhalt des Formulars korrigieren.',
+       'erreur_invalid_host' => 'falscher Servername',
+       'erreur_invalid_port' => 'falsche Portnummer',
+
+       // F
+       'facteur_adresse_envoi_email' => 'E-Mail :',
+       'facteur_adresse_envoi_nom' => 'Name:',
+       'facteur_bcc' => 'Blindkopie (BCC) :',
+       'facteur_cc' => 'Kopie (CC) :',
+       'facteur_copies' => 'Kopien:',
+       'facteur_copies_descriptif' => 'Eine Kopie der E-Mails wird an die angegebenen Adressen geschickt. Geben sie eine Adresse als Empfänger der Kopie bzw. Blindkopie an.',
+       'facteur_filtre_accents' => 'Sonderzeichen in HTML-Entitäten umwandeln (z.B. für Hotmail).',
+       'facteur_filtre_css' => 'Stile zwischen <head> und </head> zu "inline" Stilen umwandeln, sinnvoll für Webmail die inline-Stile externen vorzieht.',
+       'facteur_filtre_images' => 'Verlinkte Bilder in E-Mail einbetten',
+       'facteur_filtre_iso_8859' => 'Nach ISO-8859-1 umwandeln',
+       'facteur_filtres' => 'Filter',
+       'facteur_filtres_descriptif' => 'Beim Versand können die Mails durch mehrere Filter behandelt werden.',
+       'facteur_smtp_auth' => 'Autorisierung erforderlich:',
+       'facteur_smtp_auth_non' => 'nein',
+       'facteur_smtp_auth_oui' => 'ja',
+       'facteur_smtp_host' => 'Server:',
+       'facteur_smtp_password' => 'Passwort:',
+       'facteur_smtp_port' => 'Port:',
+       'facteur_smtp_secure' => 'Verschlüsselte Verbindung:',
+       'facteur_smtp_secure_non' => 'nein',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Fehlercodes (optional)',
+       'facteur_smtp_sender_descriptif' => 'Legt im Kopf der Mail die Empfängeradresse für Fehlermeldungen fest (bzw. den Return-Path), bestimmt ebenfalls die Absenderadresse bei Versand per SMTP.',
+       'facteur_smtp_username' => 'Benutzername:',
+
+       // M
+       'message_identite_email' => 'Die Konfiguration des Plugins Briefträger (facteur) überschreibt diese Adresse für den Mailversand.',
+
+       // N
+       'note_test_configuration' => 'Eine Mail wird an die Absendeadresse geschickt (oder an den Webmaster).',
+
+       // P
+       'personnaliser' => 'Individuelle Einstellungen',
+
+       // T
+       'tester' => 'Testen',
+       'tester_la_configuration' => 'Konfiguration testen',
+
+       // U
+       'utiliser_mail' => 'Funktion mail() von PHP verwenden',
+       'utiliser_reglages_site' => 'Einstellungen von SPIP verwenden: als Name wird die Bezeichnung der SPIP-Website verwendet und als Adresse die des Webmasters.',
+       'utiliser_smtp' => 'SMTP verwenden',
+
+       // V
+       'valider' => ' OK ',
+       'version_html' => 'HTML-Version.',
+       'version_texte' => 'Textversion.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/facteur_en.php b/www/plugins/facteur/lang/facteur_en.php
new file mode 100755 (executable)
index 0000000..3c9c75a
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'Postman’s configuration is now saved',
+       'configuration_adresse_envoi' => 'Sender’s address configuration',
+       'configuration_facteur' => 'Postman',
+       'configuration_mailer' => 'Mailer’s configuration',
+       'configuration_smtp' => 'Choose your mailer',
+       'configuration_smtp_descriptif' => 'If you’re not sure about the settings, leave them set to "PHP mail".',
+       'corps_email_de_test' => 'This is a test email',
+
+       // E
+       'email_envoye_par' => 'Sent by @site@',
+       'email_test_envoye' => 'The test email was successfully sent. If you do not receive it correctly, check the configuration of your server or contact a server administrator.',
+       'erreur' => 'Error',
+       'erreur_dans_log' => ': check the log file for more details',
+       'erreur_generale' => 'There are one or more configuration errors. Please check the contents of the form.',
+       'erreur_invalid_host' => 'This host name is not valid',
+       'erreur_invalid_port' => 'This port number is not valid',
+
+       // F
+       'facteur_adresse_envoi_email' => 'Email:',
+       'facteur_adresse_envoi_nom' => 'Name:',
+       'facteur_bcc' => 'Blind Carbon Copy (BCC):',
+       'facteur_cc' => 'Carbon Copy (CC):',
+       'facteur_copies' => 'Copies:',
+       'facteur_copies_descriptif' => 'An email will be sent to specified adresses. One Carbon Copy and/or one Blind Carbon Copy.',
+       'facteur_filtre_accents' => 'Transform accents into their html entities (useful for Hotmail).',
+       'facteur_filtre_css' => 'Transform styles present between &lt;head&gt; and &lt;/head&gt; into inline styles, useful for webmails because inline styles overwrite external styles.',
+       'facteur_filtre_images' => 'Embed images referenced in emails',
+       'facteur_filtre_iso_8859' => 'Convert to ISO-8859-1',
+       'facteur_filtres' => 'Filters',
+       'facteur_filtres_descriptif' => 'Some filters can be applied before sending an email.',
+       'facteur_smtp_auth' => 'Requires authentication:',
+       'facteur_smtp_auth_non' => 'no',
+       'facteur_smtp_auth_oui' => 'yes',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Password:',
+       'facteur_smtp_port' => 'Port:',
+       'facteur_smtp_secure' => 'Secure:',
+       'facteur_smtp_secure_non' => 'no',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Return-Path (optional)',
+       'facteur_smtp_sender_descriptif' => 'Define the Return-Path in the mail header, useful for error feedback, also in SMTP mode it defines the sender’s email.',
+       'facteur_smtp_username' => 'Username:',
+
+       // M
+       'message_identite_email' => 'The configuration of the plugin "factor" preset this email address for sending emails.',
+
+       // N
+       'note_test_configuration' => 'A test email will be sent to the "sender".',
+
+       // P
+       'personnaliser' => 'Customize',
+
+       // T
+       'tester' => 'Test',
+       'tester_la_configuration' => 'Test the config',
+
+       // U
+       'utiliser_mail' => 'Use mail function from PHP',
+       'utiliser_reglages_site' => 'Use the site’s settings: the email address is the webmaster’s one and the name of the website is the name of the sender',
+       'utiliser_smtp' => 'Use SMTP',
+
+       // V
+       'valider' => 'Submit',
+       'version_html' => 'HTML version.',
+       'version_texte' => 'Text version.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/facteur_es.php b/www/plugins/facteur/lang/facteur_es.php
new file mode 100644 (file)
index 0000000..3cef7c9
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'La configuración del cartero fue guardada correctamente',
+       'configuration_adresse_envoi' => 'Configuración de la dirección de envío',
+       'configuration_facteur' => 'Cartero',
+       'configuration_mailer' => 'Configuración del "mailer"',
+       'configuration_smtp' => 'Elección del método de envío del correo electrónico',
+       'configuration_smtp_descriptif' => 'Si no estás seguro, elige la función de correo electrónico de PHP.',
+       'corps_email_de_test' => 'Éste es un mensaje de prueba acentuado',
+
+       // E
+       'email_envoye_par' => 'Enviado por @site@',
+       'email_test_envoye' => 'El correo electrónico de prueba se ha enviado correctamente. Si no lo recibes, verifica la configuración de tu servidor o contacta a un administrador del servicio. ',
+       'erreur' => 'Error',
+       'erreur_dans_log' => ': consulta el archivo de registro (log) para más detalles',
+       'erreur_generale' => 'Hay uno o más errores de configuración. Por favor, compruebe el contenido del formulario. ',
+       'erreur_invalid_host' => 'Este nombre de host es incorrecto',
+       'erreur_invalid_port' => 'Este número de puerto es incorrecto',
+
+       // F
+       'facteur_adresse_envoi_email' => 'Correo electrónico:',
+       'facteur_adresse_envoi_nom' => 'Nombre:',
+       'facteur_bcc' => 'Copia Oculta (CCO):',
+       'facteur_cc' => 'Copia (CC) :',
+       'facteur_copies' => 'Copias:',
+       'facteur_copies_descriptif' => 'Un correo electrónico será enviado en copia a las direcciones definidas. Una sola dirección en copia y/o una sola dirección en copia oculta.',
+       'facteur_filtre_accents' => 'Transformar los acentos en su versión html (especialmente útil para Hotmail).',
+       'facteur_filtre_css' => 'Transformar los estilos contenidos entre <head> y </head> en estilos en línea, útil para los webmails porque los estilos lineales tienen prioridad sobre los estilos externos. ',
+       'facteur_filtre_images' => 'Incorporar las imágenes de referencia en los correos electrónicos',
+       'facteur_filtre_iso_8859' => 'Convertir en ISO-8859-1',
+       'facteur_filtres' => 'Filtros',
+       'facteur_filtres_descriptif' => 'Filtros pueden aplicarse a los correos electrónicos al ser enviados.',
+       'facteur_smtp_auth' => 'Requiere autenticación:',
+       'facteur_smtp_auth_non' => 'no',
+       'facteur_smtp_auth_oui' => 'sí',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Contraseña:',
+       'facteur_smtp_port' => 'Puerto:',
+       'facteur_smtp_secure' => 'Conexión segura:',
+       'facteur_smtp_secure_non' => 'no',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Rebote de errores (opcional)',
+       'facteur_smtp_sender_descriptif' => 'Indica en el encabezado del correo electrónico la dirección de correo electrónico de rebote de errores (o "Return-Path"), y en caso de un envío a través del método SMTP indica, también, la dirección del remitente.',
+       'facteur_smtp_username' => 'Nombre de usuario:',
+
+       // M
+       'message_identite_email' => 'La configuración del plugin "cartero" sobrecarga esta dirección de correo para el envío de correos.',
+
+       // N
+       'note_test_configuration' => 'Un correo electrónico se enviará a la dirección de envío definida (o aquélla del webmaster).',
+
+       // P
+       'personnaliser' => 'Personalizar esta configuración',
+
+       // T
+       'tester' => 'Probar',
+       'tester_la_configuration' => 'Testar la configuración',
+
+       // U
+       'utiliser_mail' => 'Utilizar la función de correo electrónico de PHP',
+       'utiliser_reglages_site' => 'Utilizar la configuración del sitio SPIP: el nombre mostrado será el nombre del sitio SPIP y la dirección de correo electrónico será la del webmaster',
+       'utiliser_smtp' => 'Utilizar SMTP',
+
+       // V
+       'valider' => 'Validar',
+       'version_html' => 'Versión HTML.',
+       'version_texte' => 'Versión texto.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/facteur_fr.php b/www/plugins/facteur/lang/facteur_fr.php
new file mode 100755 (executable)
index 0000000..5610ec6
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/facteur/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'La configuration du facteur a bien été enregistrée',
+       'configuration_adresse_envoi' => 'Configuration de l’adresse d’envoi',
+       'configuration_facteur' => 'Facteur',
+       'configuration_mailer' => 'Configuration du mailer',
+       'configuration_smtp' => 'Choix de la méthode d’envoi de mail',
+       'configuration_smtp_descriptif' => 'Si vous n’êtes pas sûrs, choisissez la fonction mail de PHP.',
+       'corps_email_de_test' => 'Ceci est un email de test accentué',
+
+       // E
+       'email_envoye_par' => 'Envoyé par @site@',
+       'email_test_envoye' => 'L’email de test a correctement été envoyé. Si vous ne le recevez pas correctement, vérifiez la configuration de votre serveur ou contactez un administrateur du serveur.',
+       'erreur' => 'Erreur',
+       'erreur_dans_log' => ' : consultez le fichier log pour plus de détails',
+       'erreur_generale' => 'Il y a une ou plusieurs erreurs de configuration. Veuillez vérifier le contenu du formulaire.',
+       'erreur_invalid_host' => 'Ce nom d’hôte n’est pas correct',
+       'erreur_invalid_port' => 'Ce numéro de port n’est pas correct',
+
+       // F
+       'facteur_adresse_envoi_email' => 'Email :',
+       'facteur_adresse_envoi_nom' => 'Nom :',
+       'facteur_bcc' => 'Copie Cachée (BCC) :',
+       'facteur_cc' => 'Copie (CC) :',
+       'facteur_copies' => 'Copies :',
+       'facteur_copies_descriptif' => 'Un email sera envoyé en copie aux adresses définies. Une seule adresse en copie et/ou une seule adresse en copie cachée.',
+       'facteur_filtre_accents' => 'Transformer les accents en leur entités html (utile pour Hotmail notamment).',
+       'facteur_filtre_css' => 'Transformer les styles contenus entre <head> et </head> en des styles "en ligne", utile pour les webmails car les styles en ligne ont la priorité sur les styles externes.',
+       'facteur_filtre_images' => 'Embarquer les images référencées dans les emails',
+       'facteur_filtre_iso_8859' => 'Convertir en ISO-8859-1',
+       'facteur_filtres' => 'Filtres',
+       'facteur_filtres_descriptif' => 'Des filtres peuvent être appliqués aux emails au moment de l’envoi.',
+       'facteur_smtp_auth' => 'Requiert une authentification :',
+       'facteur_smtp_auth_non' => 'non',
+       'facteur_smtp_auth_oui' => 'oui',
+       'facteur_smtp_host' => 'Hôte :',
+       'facteur_smtp_password' => 'Mot de passe :',
+       'facteur_smtp_port' => 'Port :',
+       'facteur_smtp_secure' => 'Connexion sécurisée :',
+       'facteur_smtp_secure_non' => 'non',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Retour des erreurs (optionnel)',
+       'facteur_smtp_sender_descriptif' => 'Définit dans l’entête du mail l’adresse email de retour des erreurs (ou Return-Path), et lors d’un envoi via la méthode SMTP cela définit aussi l’adresse de l’envoyeur.',
+       'facteur_smtp_username' => 'Nom d’utilisateur :',
+
+       // M
+       'message_identite_email' => 'La configuration du plugin "facteur" surcharge cette adresse email pour l’envoi de courriels.',
+
+       // N
+       'note_test_configuration' => 'Un email sera envoyé à l’adresse d’envoi définie (ou celle du webmaster).',
+
+       // P
+       'personnaliser' => 'Personnaliser ces réglages',
+
+       // T
+       'tester' => 'Tester',
+       'tester_la_configuration' => 'Tester la configuration',
+
+       // U
+       'utiliser_mail' => 'Utiliser la fonction mail de PHP',
+       'utiliser_reglages_site' => 'Utiliser les réglages du site SPIP : le nom affiché sera le nom du site SPIP et l’adresse email sera celle du webmaster',
+       'utiliser_smtp' => 'Utiliser SMTP',
+
+       // V
+       'valider' => 'Valider',
+       'version_html' => 'Version HTML.',
+       'version_texte' => 'Version texte.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/facteur_nl.php b/www/plugins/facteur/lang/facteur_nl.php
new file mode 100644 (file)
index 0000000..1d2c130
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'De configuratie is opgeslagen',
+       'configuration_adresse_envoi' => 'Configuratie van het verzendadres',
+       'configuration_facteur' => 'Postbode',
+       'configuration_mailer' => 'Configuratie van de mailer',
+       'configuration_smtp' => 'Verzendwijze',
+       'configuration_smtp_descriptif' => 'Kies, wanneer je twijfelt voor de functie PHP mail.',
+       'corps_email_de_test' => 'Dit is een geaccentueerd testbericht',
+
+       // E
+       'email_envoye_par' => 'Verzonden door @site@',
+       'email_test_envoye' => 'Het testbericht is verzonden. Ontvang je het niet juist, controleer dan de configuratie van de server.',
+       'erreur' => 'Fout',
+       'erreur_dans_log' => ': meer details in het logbestand',
+       'erreur_generale' => 'Een of meerdere fouten in de configuratie. Controleer de inhoud van dit formulier.',
+       'erreur_invalid_host' => 'Deze hostnaam is onjuist',
+       'erreur_invalid_port' => 'Dit poortnummer is onjuist',
+
+       // F
+       'facteur_adresse_envoi_email' => 'Email:',
+       'facteur_adresse_envoi_nom' => 'Naam:',
+       'facteur_bcc' => 'Verborgen (BCC) :',
+       'facteur_cc' => 'Kopie (CC) :',
+       'facteur_copies' => 'Kopieën:',
+       'facteur_copies_descriptif' => 'Deze adressen worden in kopie van de email gezet. Niet meer dan één adres in kopie en/of in verborgen kopie.',
+       'facteur_filtre_accents' => 'Zet tekens met accenten om in hun html-code (met name voor Hotmail).',
+       'facteur_filtre_css' => 'Zet de stijlen binnen &lt;head&gt; en &lt;/head&gt; om in "inline" stijlen, wat zinvol is voor webmails.',
+       'facteur_filtre_images' => 'Voeg afbeeldingen in',
+       'facteur_filtre_iso_8859' => 'Omzetten in ISO-8859-1',
+       'facteur_filtres' => 'Filters',
+       'facteur_filtres_descriptif' => 'Bij het verzenden kunnen bepaalde filters worden toegepast.',
+       'facteur_smtp_auth' => 'Vereist authentificatie:',
+       'facteur_smtp_auth_non' => 'nee',
+       'facteur_smtp_auth_oui' => 'ja',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Wachtwoord:',
+       'facteur_smtp_port' => 'Poort:',
+       'facteur_smtp_secure' => 'Beveiligde verbinding:',
+       'facteur_smtp_secure_non' => 'nee',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Return-Path (optioneel)',
+       'facteur_smtp_sender_descriptif' => 'Geef het Return-Path voor de mail aan, bv voor feedback. In SMTP bepaalt het het emailadres van de verzender.',
+       'facteur_smtp_username' => 'Naam van de gebruiker:',
+
+       // M
+       'message_identite_email' => 'De configuratie van plugin "facteur" laadt dit e-mailadres voor het verzenden van mails.',
+
+       // N
+       'note_test_configuration' => 'Een mail wordt naar het aangegeven adres (of naar de webmaster) verzonden.',
+
+       // P
+       'personnaliser' => 'Personaliseren',
+
+       // T
+       'tester' => 'Testen',
+       'tester_la_configuration' => 'Configuratietest',
+
+       // U
+       'utiliser_mail' => 'Gebruik de PHP mail functie',
+       'utiliser_reglages_site' => 'Gebruik de instellingen van SPIP: de getoonde naam is die van de site en het adres dat van de webmaster',
+       'utiliser_smtp' => 'Gebruik SMTP',
+
+       // V
+       'valider' => 'Bevestigen',
+       'version_html' => 'HTML-versie.',
+       'version_texte' => 'Tekstversie.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/facteur_sk.php b/www/plugins/facteur/lang/facteur_sk.php
new file mode 100644 (file)
index 0000000..3e35b13
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'Nastavenia Poštára sa uložili správne',
+       'configuration_adresse_envoi' => 'Nastavenie adresy odosielateľa',
+       'configuration_facteur' => 'Poštár',
+       'configuration_mailer' => 'Nastavenia Poštára',
+       'configuration_smtp' => 'Výber spôsobu odoslania e-mailu',
+       'configuration_smtp_descriptif' => 'Ak si nie ste istý, zvoľte si funkciu mail jazyka PHP.',
+       'corps_email_de_test' => 'Toto je testovací e-mail s diakritikou',
+
+       // E
+       'email_envoye_par' => 'Odoslané z @site@',
+       'email_test_envoye' => 'Testovací e-mail bol úspešne odoslaný. Ak ho nedostanete, skontrolujte nastavenia svojho servera alebo sa obráťte na administrátora servera.',
+       'erreur' => 'Chyba',
+       'erreur_dans_log' => ' : viac podrobností nájdete v súbore log',
+       'erreur_generale' => 'V nastaveniach je jedna alebo viac chýb. Prosím, skontrolujte obsah formulára.',
+       'erreur_invalid_host' => 'Názov servera nie je správny',
+       'erreur_invalid_port' => 'Toto číslo portu nie je správne',
+
+       // F
+       'facteur_adresse_envoi_email' => 'E-mail:',
+       'facteur_adresse_envoi_nom' => '(Obchodné) meno:',
+       'facteur_bcc' => 'Skrytá kópia (BCC):',
+       'facteur_cc' => 'Kópia (CC):',
+       'facteur_copies' => 'Kópie:',
+       'facteur_copies_descriptif' => 'Kópia e-mailu sa pošle na zadané adresy. Na jednu adresu bude odoslaná bežná kópia a/lebo skrytá kópia.',
+       'facteur_filtre_accents' => 'Diakritiku meniť na entity html (užitočné najmä pre Hotmail).',
+       'facteur_filtre_css' => 'Zmeniť štýly medzi <head> a </head> na "in-line" štýly, užitočné pre webmaily, lebo in-line štýly majú prednosť pred externými.',
+       'facteur_filtre_images' => 'Do e-mailov pridávať obrázky, na ktoré sa v nich odkazuje',
+       'facteur_filtre_iso_8859' => 'Zmeniť na ISO-8859-1',
+       'facteur_filtres' => 'Filtre',
+       'facteur_filtres_descriptif' => 'Pri posielaní sa na e-maily môžu použiť filtre.',
+       'facteur_smtp_auth' => 'Vyžaduje sa prihlásenie:',
+       'facteur_smtp_auth_non' => 'nie',
+       'facteur_smtp_auth_oui' => 'áno',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Heslo:',
+       'facteur_smtp_port' => 'Port:',
+       'facteur_smtp_secure' => 'Zabezpečené pripojenie:',
+       'facteur_smtp_secure_non' => 'nie',
+       'facteur_smtp_secure_ssl' => 'SSL',
+       'facteur_smtp_secure_tls' => 'TLS',
+       'facteur_smtp_sender' => 'Vypísanie chýb (nepovinné)',
+       'facteur_smtp_sender_descriptif' => 'Zadané v hlavičke návratnej e-mailovej adresy pri chybe (alebo Return-Path) a pri jej odoslaní metódou SMTP je aj adresou odosielateľa.',
+       'facteur_smtp_username' => 'Používateľské meno:',
+
+       // M
+       'message_identite_email' => 'Nastavenia zásuvného modulu "Poštár" predvolili túto e-mailovú adresu na posielanie e-mailov.',
+
+       // N
+       'note_test_configuration' => 'E-mail bude odoslaný na uvedenú adresu (alebo webmasterovi).',
+
+       // P
+       'personnaliser' => 'Prispôsobiť si tieto nastavenia',
+
+       // T
+       'tester' => 'Otestovať',
+       'tester_la_configuration' => 'Otestovať nastavenia',
+
+       // U
+       'utiliser_mail' => 'Používať funkciu mail z PHP',
+       'utiliser_reglages_site' => 'Použiť nastavenia stránky v SPIPe: zobrazovaný názov je názov stránky a e-mailová adresa je e-mail webmastera',
+       'utiliser_smtp' => 'Používať SMTP',
+
+       // V
+       'valider' => 'Potvrdiť',
+       'version_html' => 'HTML verzia.',
+       'version_texte' => 'Textová verzia.'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur.xml b/www/plugins/facteur/lang/paquet-facteur.xml
new file mode 100644 (file)
index 0000000..bd5de5c
--- /dev/null
@@ -0,0 +1,20 @@
+<traduction module="paquet-facteur" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/facteur/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=de" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=en" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=es" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
+       </langue>
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=fr" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=nl" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=ru" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=sk" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/facteur/lang/paquet-facteur_de.php b/www/plugins/facteur/lang/paquet-facteur_de.php
new file mode 100755 (executable)
index 0000000..1ccd077
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Der Briefträger befördert Emails im HTML-Format, im Nur-Text-Format oder in beiden, egal ob per SMTP oder nicht.',
+       'facteur_nom' => 'Briefräger',
+       'facteur_slogan' => 'Er befördert ihre Emails'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_en.php b/www/plugins/facteur/lang/paquet-facteur_en.php
new file mode 100644 (file)
index 0000000..b354c28
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Postman delivers emails in HTML, text or mixed format; via SMTP or not',
+       'facteur_nom' => 'Postman',
+       'facteur_slogan' => 'He delivers emails'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_es.php b/www/plugins/facteur/lang/paquet-facteur_es.php
new file mode 100644 (file)
index 0000000..ffa1ba1
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => '"Cartero" se ocupa de la distribución de correos electrónicos en formato HTML, texto o mixto; vía SMTP o no',
+       'facteur_nom' => 'Cartero',
+       'facteur_slogan' => 'Distribuye sus correos electrónicos'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_fr.php b/www/plugins/facteur/lang/paquet-facteur_fr.php
new file mode 100644 (file)
index 0000000..72225ac
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/facteur/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Facteur s’occupe de la distribution des courriels au format HTML, texte ou mixte ; via SMTP ou non',
+       'facteur_nom' => 'Facteur',
+       'facteur_slogan' => 'Il distribue vos courriels'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_nl.php b/www/plugins/facteur/lang/paquet-facteur_nl.php
new file mode 100644 (file)
index 0000000..724cb17
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Postbode (Facteur) houdt zich bezig met de distributie van email in HTML, tekst of gemengd formaat; al dan niet via SMTP',
+       'facteur_nom' => 'Postbode',
+       'facteur_slogan' => 'Hij verzendt uw mail'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_ru.php b/www/plugins/facteur/lang/paquet-facteur_ru.php
new file mode 100644 (file)
index 0000000..3c675e7
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Плагин отправляет письма в текстовом, HTML или смешанном формате; при помощи SMTP или функции mail',
+       'facteur_nom' => 'Почтальон (Facteur)',
+       'facteur_slogan' => 'Он отправляет письма'
+);
+
+?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_sk.php b/www/plugins/facteur/lang/paquet-facteur_sk.php
new file mode 100644 (file)
index 0000000..de98cc7
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'Poštár slúži na doručovanie e-mailov vo formáte HTML, v textovej alebo v zmiešanej podobe či už cez SMTP, alebo nie',
+       'facteur_nom' => 'Poštár',
+       'facteur_slogan' => 'Posiela vašu poštu'
+);
+
+?>
diff --git a/www/plugins/facteur/lib/markdownify/LICENSE_LGPL.txt b/www/plugins/facteur/lib/markdownify/LICENSE_LGPL.txt
new file mode 100644 (file)
index 0000000..5ab7695
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                 GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/www/plugins/facteur/lib/markdownify/markdownify.php b/www/plugins/facteur/lib/markdownify/markdownify.php
new file mode 100644 (file)
index 0000000..6dd29f8
--- /dev/null
@@ -0,0 +1,1192 @@
+<?php
+/**
+ * Markdownify converts HTML Markup to [Markdown][1] (by [John Gruber][2]. It
+ * also supports [Markdown Extra][3] by [Michel Fortin][4] via Markdownify_Extra.
+ *
+ * It all started as `html2text.php` - a port of [Aaron Swartz'][5] [`html2text.py`][6] - but
+ * got a long way since. This is far more than a mere port now!
+ * Starting with version 2.0.0 this is a complete rewrite and cannot be
+ * compared to Aaron Swatz' `html2text.py` anylonger. I'm now using a HTML parser
+ * (see `parsehtml.php` which I also wrote) which makes most of the evil
+ * RegEx magic go away and additionally it gives a much cleaner class
+ * structure. Also notably is the fact that I now try to prevent regressions by
+ * utilizing testcases of Michel Fortin's [MDTest][7].
+ *
+ * [1]: http://daringfireball.com/projects/markdown
+ * [2]: http://daringfireball.com/
+ * [3]: http://www.michelf.com/projects/php-markdown/extra/
+ * [4]: http://www.michelf.com/
+ * [5]: http://www.aaronsw.com/
+ * [6]: http://www.aaronsw.com/2002/html2text/
+ * [7]: http://article.gmane.org/gmane.text.markdown.general/2540
+ *
+ * @version 2.0.0 alpha
+ * @author Milian Wolff (<mail@milianw.de>, <http://milianw.de>)
+ * @license LGPL, see LICENSE_LGPL.txt and the summary below
+ * @copyright (C) 2007  Milian Wolff
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/**
+ * HTML Parser, see http://sf.net/projects/parseHTML
+ */
+require_once dirname(__FILE__) . '/parsehtml/parsehtml.php';
+
+/**
+ * default configuration
+ */
+define('MDFY_LINKS_EACH_PARAGRAPH', false);
+define('MDFY_BODYWIDTH', false);
+define('MDFY_KEEPHTML', true);
+
+/**
+ * HTML to Markdown converter class
+ */
+class Markdownify {
+  /**
+   * html parser object
+   *
+   * @var parseHTML
+   */
+  var $parser;
+  /**
+   * markdown output
+   *
+   * @var string
+   */
+  var $output;
+  /**
+   * stack with tags which where not converted to html
+   *
+   * @var array<string>
+   */
+  var $notConverted = array();
+  /**
+   * skip conversion to markdown
+   *
+   * @var bool
+   */
+  var $skipConversion = false;
+  /* options */
+  /**
+   * keep html tags which cannot be converted to markdown
+   *
+   * @var bool
+   */
+  var $keepHTML = false;
+  /**
+   * wrap output, set to 0 to skip wrapping
+   *
+   * @var int
+   */
+  var $bodyWidth = 0;
+  /**
+   * minimum body width
+   *
+   * @var int
+   */
+  var $minBodyWidth = 25;
+  /**
+   * display links after each paragraph
+   *
+   * @var bool
+   */
+  var $linksAfterEachParagraph = false;
+  /**
+   * constructor, set options, setup parser
+   *
+   * @param bool $linksAfterEachParagraph wether or not to flush stacked links after each paragraph
+   *             defaults to false
+   * @param int $bodyWidth wether or not to wrap the output to the given width
+   *             defaults to false
+   * @param bool $keepHTML wether to keep non markdownable HTML or to discard it
+   *             defaults to true (HTML will be kept)
+   * @return void
+   */
+  function Markdownify($linksAfterEachParagraph = MDFY_LINKS_EACH_PARAGRAPH, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML) {
+    $this->linksAfterEachParagraph = $linksAfterEachParagraph;
+    $this->keepHTML = $keepHTML;
+
+    if ($bodyWidth > $this->minBodyWidth) {
+      $this->bodyWidth = intval($bodyWidth);
+    } else {
+      $this->bodyWidth = false;
+    }
+
+    $this->parser = new parseHTML;
+    $this->parser->noTagsInCode = true;
+
+    # we don't have to do this every time
+    $search = array();
+    $replace = array();
+    foreach ($this->escapeInText as $s => $r) {
+      array_push($search, '#(?<!\\\)'.$s.'#U');
+      array_push($replace, $r);
+    }
+    $this->escapeInText = array(
+      'search' => $search,
+      'replace' => $replace
+    );
+  }
+  /**
+   * parse a HTML string
+   *
+   * @param string $html
+   * @return string markdown formatted
+   */
+  function parseString($html) {
+    $this->parser->html = $html;
+    $this->parse();
+    return $this->output;
+  }
+  /**
+   * tags with elements which can be handled by markdown
+   *
+   * @var array<string>
+   */
+  var $isMarkdownable = array(
+    'p' => array(),
+    'ul' => array(),
+    'ol' => array(),
+    'li' => array(),
+    'br' => array(),
+    'blockquote' => array(),
+    'code' => array(),
+    'pre' => array(),
+    'a' => array(
+      'href' => 'required',
+      'title' => 'optional',
+    ),
+    'strong' => array(),
+    'b' => array(),
+    'em' => array(),
+    'i' => array(),
+    'img' => array(
+      'src' => 'required',
+      'alt' => 'optional',
+      'title' => 'optional',
+    ),
+    'h1' => array(),
+    'h2' => array(),
+    'h3' => array(),
+    'h4' => array(),
+    'h5' => array(),
+    'h6' => array(),
+    'hr' => array(),
+  );
+  /**
+   * html tags to be ignored (contents will be parsed)
+   *
+   * @var array<string>
+   */
+  var $ignore = array(
+    'html',
+    'body',
+  );
+  /**
+   * html tags to be dropped (contents will not be parsed!)
+   *
+   * @var array<string>
+   */
+  var $drop = array(
+    'script',
+    'head',
+    'style',
+    'form',
+    'area',
+    'object',
+    'param',
+    'iframe',
+  );
+  /**
+   * Markdown indents which could be wrapped
+   * @note: use strings in regex format
+   *
+   * @var array<string>
+   */
+  var $wrappableIndents = array(
+    '\*   ', # ul
+    '\d.  ', # ol
+    '\d\d. ', # ol
+    '> ', # blockquote
+    '', # p
+  );
+  /**
+   * list of chars which have to be escaped in normal text
+   * @note: use strings in regex format
+   *
+   * @var array
+   *
+   * TODO: what's with block chars / sequences at the beginning of a block?
+   */
+  var $escapeInText = array(
+    '([-*_])([ ]{0,2}\1){2,}' => '\\\\$0|', # hr
+    '\*\*([^*\s]+)\*\*' => '\*\*$1\*\*', # strong
+    '\*([^*\s]+)\*' => '\*$1\*', # em
+    '__(?! |_)(.+)(?!<_| )__' => '\_\_$1\_\_', # em
+    '_(?! |_)(.+)(?!<_| )_' => '\_$1\_', # em
+    '`(.+)`' => '\`$1\`', # code
+    '\[(.+)\](\s*\()' => '\[$1\]$2', # links: [text] (url) => [text\] (url)
+    '\[(.+)\](\s*)\[(.*)\]' => '\[$1\]$2\[$3\]', # links: [text][id] => [text\][id\]
+  );
+  /**
+   * wether last processed node was a block tag or not
+   *
+   * @var bool
+   */
+  var $lastWasBlockTag = false;
+  /**
+   * name of last closed tag
+   *
+   * @var string
+   */
+  var $lastClosedTag = '';
+  /**
+   * iterate through the nodes and decide what we
+   * shall do with the current node
+   *
+   * @param void
+   * @return void
+   */
+  function parse() {
+    $this->output = '';
+    # drop tags
+    $this->parser->html = preg_replace('#<('.implode('|', $this->drop).')[^>]*>.*</\\1>#sU', '', $this->parser->html);
+    while ($this->parser->nextNode()) {
+      switch ($this->parser->nodeType) {
+        case 'doctype':
+          break;
+        case 'pi':
+        case 'comment':
+          if ($this->keepHTML) {
+            $this->flushLinebreaks();
+            $this->out($this->parser->node);
+            $this->setLineBreaks(2);
+          }
+          # else drop
+          break;
+        case 'text':
+          $this->handleText();
+          break;
+        case 'tag':
+          if (in_array($this->parser->tagName, $this->ignore)) {
+            break;
+          }
+          if ($this->parser->isStartTag) {
+            $this->flushLinebreaks();
+          }
+          if ($this->skipConversion) {
+            $this->isMarkdownable(); # update notConverted
+            $this->handleTagToText();
+            continue;
+          }
+          if (!$this->parser->keepWhitespace && $this->parser->isBlockElement && $this->parser->isStartTag) {
+            $this->parser->html = ltrim($this->parser->html);
+          }
+          if ($this->isMarkdownable()) {
+            if ($this->parser->isBlockElement && $this->parser->isStartTag && !$this->lastWasBlockTag && !empty($this->output)) {
+              if (!empty($this->buffer)) {
+                $str =& $this->buffer[count($this->buffer) -1];
+              } else {
+                $str =& $this->output;
+              }
+              if (substr($str, -strlen($this->indent)-1) != "\n".$this->indent) {
+                $str .= "\n".$this->indent;
+              }
+            }
+            $func = 'handleTag_'.$this->parser->tagName;
+            $this->$func();
+            if ($this->linksAfterEachParagraph && $this->parser->isBlockElement && !$this->parser->isStartTag && empty($this->parser->openTags)) {
+              $this->flushStacked();
+            }
+            if (!$this->parser->isStartTag) {
+              $this->lastClosedTag = $this->parser->tagName;
+            }
+          } else {
+            $this->handleTagToText();
+            $this->lastClosedTag = '';
+          }
+          break;
+        default:
+          trigger_error('invalid node type', E_USER_ERROR);
+          break;
+      }
+      $this->lastWasBlockTag = $this->parser->nodeType == 'tag' && $this->parser->isStartTag && $this->parser->isBlockElement;
+    }
+    if (!empty($this->buffer)) {
+      trigger_error('buffer was not flushed, this is a bug. please report!', E_USER_WARNING);
+      while (!empty($this->buffer)) {
+        $this->out($this->unbuffer());
+      }
+    }
+    ### cleanup
+    $this->output = rtrim(str_replace('&amp;', '&', str_replace('&lt;', '<', str_replace('&gt;', '>', $this->output))));
+    # end parsing, flush stacked tags
+    $this->flushStacked();
+    $this->stack = array();
+  }
+  /**
+   * check if current tag can be converted to Markdown
+   *
+   * @param void
+   * @return bool
+   */
+  function isMarkdownable() {
+    if (!isset($this->isMarkdownable[$this->parser->tagName])) {
+      # simply not markdownable
+      return false;
+    }
+    if ($this->parser->isStartTag) {
+      $return = true;
+      if ($this->keepHTML) {
+        $diff = array_diff(array_keys($this->parser->tagAttributes), array_keys($this->isMarkdownable[$this->parser->tagName]));
+        if (!empty($diff)) {
+          # non markdownable attributes given
+          $return = false;
+        }
+      }
+      if ($return) {
+        foreach ($this->isMarkdownable[$this->parser->tagName] as $attr => $type) {
+          if ($type == 'required' && !isset($this->parser->tagAttributes[$attr])) {
+            # required markdown attribute not given
+            $return = false;
+            break;
+          }
+        }
+      }
+      if (!$return) {
+        array_push($this->notConverted, $this->parser->tagName.'::'.implode('/', $this->parser->openTags));
+      }
+      return $return;
+    } else {
+      if (!empty($this->notConverted) && end($this->notConverted) === $this->parser->tagName.'::'.implode('/', $this->parser->openTags)) {
+        array_pop($this->notConverted);
+        return false;
+      }
+      return true;
+    }
+  }
+  /**
+   * output all stacked tags
+   *
+   * @param void
+   * @return void
+   */
+  function flushStacked() {
+    # links
+    foreach ($this->stack as $tag => $a) {
+      if (!empty($a)) {
+        call_user_func(array(&$this, 'flushStacked_'.$tag));
+      }
+    }
+  }
+  /**
+   * output link references (e.g. [1]: http://example.com "title");
+   *
+   * @param void
+   * @return void
+   */
+  function flushStacked_a() {
+    $out = false;
+    foreach ($this->stack['a'] as $k => $tag) {
+      if (!isset($tag['unstacked'])) {
+        if (!$out) {
+          $out = true;
+          $this->out("\n\n", true);
+        } else {
+          $this->out("\n", true);
+        }
+        $this->out(' ['.$tag['linkID'].']: '.$tag['href'].(isset($tag['title']) ? ' "'.$tag['title'].'"' : ''), true);
+        $tag['unstacked'] = true;
+        $this->stack['a'][$k] = $tag;
+      }
+    }
+  }
+  /**
+   * flush enqued linebreaks
+   *
+   * @param void
+   * @return void
+   */
+  function flushLinebreaks() {
+    if ($this->lineBreaks && !empty($this->output)) {
+      $this->out(str_repeat("\n".$this->indent, $this->lineBreaks), true);
+    }
+    $this->lineBreaks = 0;
+  }
+  /**
+   * handle non Markdownable tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTagToText() {
+    if (!$this->keepHTML) {
+      if (!$this->parser->isStartTag && $this->parser->isBlockElement) {
+        $this->setLineBreaks(2);
+      }
+    } else {
+      # dont convert to markdown inside this tag
+      /** TODO: markdown extra **/
+      if (!$this->parser->isEmptyTag) {
+        if ($this->parser->isStartTag) {
+          if (!$this->skipConversion) {
+            $this->skipConversion = $this->parser->tagName.'::'.implode('/', $this->parser->openTags);
+          }
+        } else {
+          if ($this->skipConversion == $this->parser->tagName.'::'.implode('/', $this->parser->openTags)) {
+            $this->skipConversion = false;
+          }
+        }
+      }
+
+      if ($this->parser->isBlockElement) {
+        if ($this->parser->isStartTag) {
+          if (in_array($this->parent(), array('ins', 'del'))) {
+            # looks like ins or del are block elements now
+            $this->out("\n", true);
+            $this->indent('  ');
+          }
+          if ($this->parser->tagName != 'pre') {
+            $this->out($this->parser->node."\n".$this->indent);
+            if (!$this->parser->isEmptyTag) {
+              $this->indent('  ');
+            } else {
+              $this->setLineBreaks(1);
+            }
+            $this->parser->html = ltrim($this->parser->html);
+          } else {
+            # don't indent inside <pre> tags
+            $this->out($this->parser->node);
+            static $indent;
+            $indent =  $this->indent;
+            $this->indent = '';
+          }
+        } else {
+          if (!$this->parser->keepWhitespace) {
+            $this->output = rtrim($this->output);
+          }
+          if ($this->parser->tagName != 'pre') {
+            $this->indent('  ');
+            $this->out("\n".$this->indent.$this->parser->node);
+          } else {
+            # reset indentation
+            $this->out($this->parser->node);
+            static $indent;
+            $this->indent = $indent;
+          }
+
+          if (in_array($this->parent(), array('ins', 'del'))) {
+            # ins or del was block element
+            $this->out("\n");
+            $this->indent('  ');
+          }
+          if ($this->parser->tagName == 'li') {
+            $this->setLineBreaks(1);
+          } else {
+            $this->setLineBreaks(2);
+          }
+        }
+      } else {
+        $this->out($this->parser->node);
+      }
+      if (in_array($this->parser->tagName, array('code', 'pre'))) {
+        if ($this->parser->isStartTag) {
+          $this->buffer();
+        } else {
+          # add stuff so cleanup just reverses this
+          $this->out(str_replace('&lt;', '&amp;lt;', str_replace('&gt;', '&amp;gt;', $this->unbuffer())));
+        }
+      }
+    }
+  }
+  /**
+   * handle plain text
+   *
+   * @param void
+   * @return void
+   */
+  function handleText() {
+    if ($this->hasParent('pre') && strpos($this->parser->node, "\n") !== false) {
+      $this->parser->node = str_replace("\n", "\n".$this->indent, $this->parser->node);
+    }
+    if (!$this->hasParent('code') && !$this->hasParent('pre')) {
+      # entity decode
+      $this->parser->node = $this->decode($this->parser->node);
+      if (!$this->skipConversion) {
+        # escape some chars in normal Text
+        $this->parser->node = preg_replace($this->escapeInText['search'], $this->escapeInText['replace'], $this->parser->node);
+      }
+    } else {
+      $this->parser->node = str_replace(array('&quot;', '&apos'), array('"', '\''), $this->parser->node);
+    }
+    $this->out($this->parser->node);
+    $this->lastClosedTag = '';
+  }
+  /**
+   * handle <em> and <i> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_em() {
+    $this->out('*', true);
+  }
+  function handleTag_i() {
+    $this->handleTag_em();
+  }
+  /**
+   * handle <strong> and <b> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_strong() {
+    $this->out('**', true);
+  }
+  function handleTag_b() {
+    $this->handleTag_strong();
+  }
+  /**
+   * handle <h1> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h1() {
+    $this->handleHeader(1);
+  }
+  /**
+   * handle <h2> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h2() {
+    $this->handleHeader(2);
+  }
+  /**
+   * handle <h3> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h3() {
+    $this->handleHeader(3);
+  }
+  /**
+   * handle <h4> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h4() {
+    $this->handleHeader(4);
+  }
+  /**
+   * handle <h5> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h5() {
+    $this->handleHeader(5);
+  }
+  /**
+   * handle <h6> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_h6() {
+    $this->handleHeader(6);
+  }
+  /**
+   * number of line breaks before next inline output
+   */
+  var $lineBreaks = 0;
+  /**
+   * handle header tags (<h1> - <h6>)
+   *
+   * @param int $level 1-6
+   * @return void
+   */
+  function handleHeader($level) {
+    if ($this->parser->isStartTag) {
+      $this->out(str_repeat('#', $level).' ', true);
+    } else {
+      $this->setLineBreaks(2);
+    }
+  }
+  /**
+   * handle <p> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_p() {
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(2);
+    }
+  }
+  /**
+   * handle <a> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_a() {
+    if ($this->parser->isStartTag) {
+      $this->buffer();
+      if (isset($this->parser->tagAttributes['title'])) {
+        $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
+      } else {
+        $this->parser->tagAttributes['title'] = null;
+      }
+      $this->parser->tagAttributes['href'] = $this->decode(trim($this->parser->tagAttributes['href']));
+      $this->stack();
+    } else {
+      $tag = $this->unstack();
+      $buffer = $this->unbuffer();
+
+      if (empty($tag['href']) && empty($tag['title'])) {
+        # empty links... testcase mania, who would possibly do anything like that?!
+        $this->out('['.$buffer.']()', true);
+        return;
+      }
+
+      if ($buffer == $tag['href'] && empty($tag['title'])) {
+        # <http://example.com>
+        $this->out('<'.$buffer.'>', true);
+        return;
+      }
+
+      $bufferDecoded = $this->decode(trim($buffer));
+      if (substr($tag['href'], 0, 7) == 'mailto:' && 'mailto:'.$bufferDecoded == $tag['href']) {
+        if (is_null($tag['title'])) {
+          # <mail@example.com>
+          $this->out('<'.$bufferDecoded.'>', true);
+          return;
+        }
+        # [mail@example.com][1]
+        # ...
+        #  [1]: mailto:mail@example.com Title
+        $tag['href'] = 'mailto:'.$bufferDecoded;
+      }
+           if ($this->linksAfterEachParagraph!=='inline'){
+             # [This link][id]
+             foreach ($this->stack['a'] as $tag2) {
+               if ($tag2['href'] == $tag['href'] && $tag2['title'] === $tag['title']) {
+                 $tag['linkID'] = $tag2['linkID'];
+                 break;
+               }
+             }
+             if (!isset($tag['linkID'])) {
+               $tag['linkID'] = count($this->stack['a']) + 1;
+               array_push($this->stack['a'], $tag);
+             }
+
+             $this->out('['.trim($buffer).']['.$tag['linkID'].']', true);
+           }
+           else {
+                   # [This link|title](url)
+                   if ($tag['title'])
+                           $buffer.="|".$tag['title'];
+                   $this->out('['.trim($buffer).']('.$tag['href'].')', true);
+           }
+    }
+  }
+  /**
+   * handle <img /> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_img() {
+    if (!$this->parser->isStartTag) {
+      return; # just to be sure this is really an empty tag...
+    }
+
+    if (isset($this->parser->tagAttributes['title'])) {
+      $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
+    } else {
+      $this->parser->tagAttributes['title'] = null;
+    }
+    if (isset($this->parser->tagAttributes['alt'])) {
+      $this->parser->tagAttributes['alt'] = $this->decode($this->parser->tagAttributes['alt']);
+    } else {
+      $this->parser->tagAttributes['alt'] = null;
+    }
+
+    if (empty($this->parser->tagAttributes['src'])) {
+      # support for "empty" images... dunno if this is really needed
+      # but there are some testcases which do that...
+      if (!empty($this->parser->tagAttributes['title'])) {
+        $this->parser->tagAttributes['title'] = ' '.$this->parser->tagAttributes['title'].' ';
+      }
+      $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['title'].')', true);
+      return;
+    } else {
+      $this->parser->tagAttributes['src'] = $this->decode($this->parser->tagAttributes['src']);
+    }
+
+    # [This link][id]
+    $link_id = false;
+    if (!empty($this->stack['a'])) {
+      foreach ($this->stack['a'] as $tag) {
+        if ($tag['href'] == $this->parser->tagAttributes['src']
+            && $tag['title'] === $this->parser->tagAttributes['title']) {
+          $link_id = $tag['linkID'];
+          break;
+        }
+      }
+    } else {
+      $this->stack['a'] = array();
+    }
+    if (!$link_id) {
+      $link_id = count($this->stack['a']) + 1;
+      $tag = array(
+        'href' => $this->parser->tagAttributes['src'],
+        'linkID' => $link_id,
+        'title' => $this->parser->tagAttributes['title']
+      );
+      array_push($this->stack['a'], $tag);
+    }
+
+    $this->out('!['.$this->parser->tagAttributes['alt'].']['.$link_id.']', true);
+  }
+  /**
+   * handle <code> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_code() {
+    if ($this->hasParent('pre')) {
+      # ignore code blocks inside <pre>
+      return;
+    }
+    if ($this->parser->isStartTag) {
+      $this->buffer();
+    } else {
+      $buffer = $this->unbuffer();
+      # use as many backticks as needed
+      preg_match_all('#`+#', $buffer, $matches);
+      if (!empty($matches[0])) {
+        rsort($matches[0]);
+
+        $ticks = '`';
+        while (true) {
+          if (!in_array($ticks, $matches[0])) {
+            break;
+          }
+          $ticks .= '`';
+        }
+      } else {
+        $ticks = '`';
+      }
+      if ($buffer[0] == '`' || substr($buffer, -1) == '`') {
+        $buffer = ' '.$buffer.' ';
+      }
+      $this->out($ticks.$buffer.$ticks, true);
+    }
+  }
+  /**
+   * handle <pre> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_pre() {
+    if ($this->keepHTML && $this->parser->isStartTag) {
+      # check if a simple <code> follows
+      if (!preg_match('#^\s*<code\s*>#Us', $this->parser->html)) {
+        # this is no standard markdown code block
+        $this->handleTagToText();
+        return;
+      }
+    }
+    $this->indent('    ');
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(2);
+    } else {
+      $this->parser->html = ltrim($this->parser->html);
+    }
+  }
+  /**
+   * handle <blockquote> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_blockquote() {
+    $this->indent('> ');
+  }
+  /**
+   * handle <ul> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_ul() {
+    if ($this->parser->isStartTag) {
+      $this->stack();
+      if (!$this->keepHTML && $this->lastClosedTag == $this->parser->tagName) {
+        $this->out("\n".$this->indent.'<!-- -->'."\n".$this->indent."\n".$this->indent);
+      }
+    } else {
+      $this->unstack();
+      if ($this->parent() != 'li' || preg_match('#^\s*(</li\s*>\s*<li\s*>\s*)?<(p|blockquote)\s*>#sU', $this->parser->html)) {
+        # dont make Markdown add unneeded paragraphs
+        $this->setLineBreaks(2);
+      }
+    }
+  }
+  /**
+   * handle <ul> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_ol() {
+    # same as above
+    $this->parser->tagAttributes['num'] = 0;
+    $this->handleTag_ul();
+  }
+  /**
+   * handle <li> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_li() {
+    if ($this->parent() == 'ol') {
+      $parent =& $this->getStacked('ol');
+      if ($this->parser->isStartTag) {
+        $parent['num']++;
+        $this->out($parent['num'].'.'.str_repeat(' ', 3 - strlen($parent['num'])), true);
+      }
+      $this->indent('    ', false);
+    } else {
+      if ($this->parser->isStartTag) {
+        $this->out('*   ', true);
+      }
+      $this->indent('    ', false);
+    }
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(1);
+    }
+  }
+  /**
+   * handle <hr /> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_hr() {
+    if (!$this->parser->isStartTag) {
+      return; # just to be sure this really is an empty tag
+    }
+    $this->out('* * *', true);
+    $this->setLineBreaks(2);
+  }
+  /**
+   * handle <br /> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_br() {
+    $this->out("  \n".$this->indent, true);
+    $this->parser->html = ltrim($this->parser->html);
+  }
+  /**
+   * node stack, e.g. for <a> and <abbr> tags
+   *
+   * @var array<array>
+   */
+  var $stack = array();
+  /**
+   * add current node to the stack
+   * this only stores the attributes
+   *
+   * @param void
+   * @return void
+   */
+  function stack() {
+    if (!isset($this->stack[$this->parser->tagName])) {
+      $this->stack[$this->parser->tagName] = array();
+    }
+    array_push($this->stack[$this->parser->tagName], $this->parser->tagAttributes);
+  }
+  /**
+   * remove current tag from stack
+   *
+   * @param void
+   * @return array
+   */
+  function unstack() {
+    if (!isset($this->stack[$this->parser->tagName]) || !is_array($this->stack[$this->parser->tagName])) {
+      trigger_error('Trying to unstack from empty stack. This must not happen.', E_USER_ERROR);
+    }
+    return array_pop($this->stack[$this->parser->tagName]);
+  }
+  /**
+   * get last stacked element of type $tagName
+   *
+   * @param string $tagName
+   * @return array
+   */
+  function & getStacked($tagName) {
+    // no end() so it can be referenced
+    return $this->stack[$tagName][count($this->stack[$tagName])-1];
+  }
+  /**
+   * set number of line breaks before next start tag
+   *
+   * @param int $number
+   * @return void
+   */
+  function setLineBreaks($number) {
+    if ($this->lineBreaks < $number) {
+      $this->lineBreaks = $number;
+    }
+  }
+  /**
+   * stores current buffers
+   *
+   * @var array<string>
+   */
+  var $buffer = array();
+  /**
+   * buffer next parser output until unbuffer() is called
+   *
+   * @param void
+   * @return void
+   */
+  function buffer() {
+    array_push($this->buffer, '');
+  }
+  /**
+   * end current buffer and return buffered output
+   *
+   * @param void
+   * @return string
+   */
+  function unbuffer() {
+    return array_pop($this->buffer);
+  }
+  /**
+   * append string to the correct var, either
+   * directly to $this->output or to the current
+   * buffers
+   *
+   * @param string $put
+   * @return void
+   */
+  function out($put, $nowrap = false) {
+    if (empty($put)) {
+      return;
+    }
+    if (!empty($this->buffer)) {
+      $this->buffer[count($this->buffer) - 1] .= $put;
+    } else {
+      if ($this->bodyWidth && !$this->parser->keepWhitespace) { # wrap lines
+        // get last line
+        $pos = strrpos($this->output, "\n");
+        if ($pos === false) {
+          $line = $this->output;
+        } else {
+          $line = substr($this->output, $pos);
+        }
+
+        if ($nowrap) {
+          if ($put[0] != "\n" && $this->strlen($line) + $this->strlen($put) > $this->bodyWidth) {
+            $this->output .= "\n".$this->indent.$put;
+          } else {
+            $this->output .= $put;
+          }
+          return;
+        } else {
+          $put .= "\n"; # make sure we get all lines in the while below
+          $lineLen = $this->strlen($line);
+          while ($pos = strpos($put, "\n")) {
+            $putLine = substr($put, 0, $pos+1);
+            $put = substr($put, $pos+1);
+            $putLen = $this->strlen($putLine);
+            if ($lineLen + $putLen < $this->bodyWidth) {
+              $this->output .= $putLine;
+              $lineLen = $putLen;
+            } else {
+              $split = preg_split('#^(.{0,'.($this->bodyWidth - $lineLen).'})\b#', $putLine, 2, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE);
+              $this->output .= rtrim($split[1][0])."\n".$this->indent.$this->wordwrap(ltrim($split[2][0]), $this->bodyWidth, "\n".$this->indent, false);
+            }
+          }
+          $this->output = substr($this->output, 0, -1);
+          return;
+        }
+      } else {
+        $this->output .= $put;
+      }
+    }
+  }
+  /**
+   * current indentation
+   *
+   * @var string
+   */
+  var $indent = '';
+  /**
+   * indent next output (start tag) or unindent (end tag)
+   *
+   * @param string $str indentation
+   * @param bool $output add indendation to output
+   * @return void
+   */
+  function indent($str, $output = true) {
+    if ($this->parser->isStartTag) {
+      $this->indent .= $str;
+      if ($output) {
+        $this->out($str, true);
+      }
+    } else {
+      $this->indent = substr($this->indent, 0, -strlen($str));
+    }
+  }
+  /**
+   * decode email addresses
+   *
+   * @author derernst@gmx.ch <http://www.php.net/manual/en/function.html-entity-decode.php#68536>
+   * @author Milian Wolff <http://milianw.de>
+   */
+  function decode($text, $quote_style = ENT_QUOTES) {
+    if (version_compare(PHP_VERSION, '5', '>=')) {
+      # UTF-8 is only supported in PHP 5.x.x and above
+      $text = html_entity_decode($text, $quote_style, 'UTF-8');
+    } else {
+      if (function_exists('html_entity_decode')) {
+        $text = html_entity_decode($text, $quote_style, 'ISO-8859-1');
+      } else {
+        static $trans_tbl;
+        if (!isset($trans_tbl)) {
+          $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, $quote_style));
+        }
+        $text = strtr($text, $trans_tbl);
+      }
+      $text = preg_replace_callback('~&#x([0-9a-f]+);~i', array(&$this, '_decode_hex'), $text);
+      $text = preg_replace_callback('~&#(\d{2,5});~', array(&$this, '_decode_numeric'), $text);
+    }
+    return $text;
+  }
+  /**
+   * callback for decode() which converts a hexadecimal entity to UTF-8
+   *
+   * @param array $matches
+   * @return string UTF-8 encoded
+   */
+  function _decode_hex($matches) {
+    return $this->unichr(hexdec($matches[1]));
+  }
+  /**
+   * callback for decode() which converts a numerical entity to UTF-8
+   *
+   * @param array $matches
+   * @return string UTF-8 encoded
+   */
+  function _decode_numeric($matches) {
+    return $this->unichr($matches[1]);
+  }
+  /**
+   * UTF-8 chr() which supports numeric entities
+   *
+   * @author grey - greywyvern - com <http://www.php.net/manual/en/function.chr.php#55978>
+   * @param array $matches
+   * @return string UTF-8 encoded
+   */
+  function unichr($dec) {
+    if ($dec < 128) {
+      $utf = chr($dec);
+    } else if ($dec < 2048) {
+      $utf = chr(192 + (($dec - ($dec % 64)) / 64));
+      $utf .= chr(128 + ($dec % 64));
+    } else {
+      $utf = chr(224 + (($dec - ($dec % 4096)) / 4096));
+      $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
+      $utf .= chr(128 + ($dec % 64));
+    }
+    return $utf;
+  }
+  /**
+   * UTF-8 strlen()
+   *
+   * @param string $str
+   * @return int
+   *
+   * @author dtorop 932 at hotmail dot com <http://www.php.net/manual/en/function.strlen.php#37975>
+   * @author Milian Wolff <http://milianw.de>
+   */
+  function strlen($str) {
+    if (function_exists('mb_strlen')) {
+      return mb_strlen($str, 'UTF-8');
+    } else {
+      return preg_match_all('/[\x00-\x7F\xC0-\xFD]/', $str, $var_empty);
+    }
+  }
+  /**
+  * wordwrap for utf8 encoded strings
+  *
+  * @param string $str
+  * @param integer $len
+  * @param string $what
+  * @return string
+  */
+  function wordwrap($str, $width, $break, $cut = false){
+    if (!$cut) {
+      $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){1,'.$width.'}\b#';
+    } else {
+      $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.'}#';
+    }
+    $return = '';
+    while (preg_match($regexp, $str, $matches)) {
+      $string = $matches[0];
+      $str = ltrim(substr($str, strlen($string)));
+      if (!$cut && isset($str[0]) && in_array($str[0], array('.', '!', ';', ':', '?', ','))) {
+        $string .= $str[0];
+        $str = ltrim(substr($str, 1));
+      }
+      $return .= $string.$break;
+    }
+    return $return.ltrim($str);
+  }
+  /**
+   * check if current node has a $tagName as parent (somewhere, not only the direct parent)
+   *
+   * @param string $tagName
+   * @return bool
+   */
+  function hasParent($tagName) {
+    return in_array($tagName, $this->parser->openTags);
+  }
+  /**
+   * get tagName of direct parent tag
+   *
+   * @param void
+   * @return string $tagName
+   */
+  function parent() {
+    return end($this->parser->openTags);
+  }
+}
\ No newline at end of file
diff --git a/www/plugins/facteur/lib/markdownify/markdownify_extra.php b/www/plugins/facteur/lib/markdownify/markdownify_extra.php
new file mode 100644 (file)
index 0000000..3305f09
--- /dev/null
@@ -0,0 +1,489 @@
+<?php
+/**
+ * Class to convert HTML to Markdown with PHP Markdown Extra syntax support.
+ *
+ * @version 1.0.0 alpha
+ * @author Milian Wolff (<mail@milianw.de>, <http://milianw.de>)
+ * @license LGPL, see LICENSE_LGPL.txt and the summary below
+ * @copyright (C) 2007  Milian Wolff
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/**
+ * standard Markdownify class
+ */
+require_once dirname(__FILE__) . '/markdownify.php';
+
+class Markdownify_Extra extends Markdownify {
+  /**
+   * table data, including rows with content and the maximum width of each col
+   *
+   * @var array
+   */
+  var $table = array();
+  /**
+   * current col
+   *
+   * @var int
+   */
+  var $col = -1;
+  /**
+   * current row
+   *
+   * @var int
+   */
+  var $row = 0;
+  /**
+   * constructor, see Markdownify::Markdownify() for more information
+   */
+  function Markdownify_Extra($linksAfterEachParagraph = MDFY_LINKS_EACH_PARAGRAPH, $bodyWidth = MDFY_BODYWIDTH, $keepHTML = MDFY_KEEPHTML) {
+    parent::Markdownify($linksAfterEachParagraph, $bodyWidth, $keepHTML);
+
+    ### new markdownable tags & attributes
+    # header ids: # foo {bar}
+    $this->isMarkdownable['h1']['id'] = 'optional';
+    $this->isMarkdownable['h2']['id'] = 'optional';
+    $this->isMarkdownable['h3']['id'] = 'optional';
+    $this->isMarkdownable['h4']['id'] = 'optional';
+    $this->isMarkdownable['h5']['id'] = 'optional';
+    $this->isMarkdownable['h6']['id'] = 'optional';
+    # tables
+    $this->isMarkdownable['table'] = array();
+    $this->isMarkdownable['th'] = array(
+      'align' => 'optional',
+    );
+    $this->isMarkdownable['td'] = array(
+      'align' => 'optional',
+    );
+    $this->isMarkdownable['tr'] = array();
+    array_push($this->ignore, 'thead');
+    array_push($this->ignore, 'tbody');
+    array_push($this->ignore, 'tfoot');
+    # definition lists
+    $this->isMarkdownable['dl'] = array();
+    $this->isMarkdownable['dd'] = array();
+    $this->isMarkdownable['dt'] = array();
+    # footnotes
+    $this->isMarkdownable['fnref'] = array(
+      'target' => 'required',
+    );
+    $this->isMarkdownable['footnotes'] = array();
+    $this->isMarkdownable['fn'] = array(
+      'name' => 'required',
+    );
+    $this->parser->blockElements['fnref'] = false;
+    $this->parser->blockElements['fn'] = true;
+    $this->parser->blockElements['footnotes'] = true;
+    # abbr
+    $this->isMarkdownable['abbr'] = array(
+      'title' => 'required',
+    );
+    # build RegEx lookahead to decide wether table can pe parsed or not
+    $inlineTags = array_keys($this->parser->blockElements, false);
+    $colContents = '(?:[^<]|<(?:'.implode('|', $inlineTags).'|[^a-z]))+';
+    $this->tableLookaheadHeader = '{
+    ^\s*(?:<thead\s*>)?\s*                               # open optional thead
+      <tr\s*>\s*(?:                                    # start required row with headers
+        <th(?:\s+align=("|\')(?:left|center|right)\1)?\s*>   # header with optional align
+        \s*'.$colContents.'\s*                       # contents
+        </th>\s*                                     # close header
+      )+</tr>                                          # close row with headers
+    \s*(?:</thead>)?                                     # close optional thead
+    }sxi';
+    $this->tdSubstitute = '\s*'.$colContents.'\s*        # contents
+          </td>\s*';
+    $this->tableLookaheadBody = '{
+      \s*(?:<tbody\s*>)?\s*                            # open optional tbody
+        (?:<tr\s*>\s*                                # start row
+          %s                                       # cols to be substituted
+        </tr>)+                                      # close row
+      \s*(?:</tbody>)?                                 # close optional tbody
+    \s*</table>                                          # close table
+    }sxi';
+  }
+  /**
+   * handle header tags (<h1> - <h6>)
+   *
+   * @param int $level 1-6
+   * @return void
+   */
+  function handleHeader($level) {
+    static $id = null;
+    if ($this->parser->isStartTag) {
+      if (isset($this->parser->tagAttributes['id'])) {
+        $id = $this->parser->tagAttributes['id'];
+      }
+    } else {
+      if (!is_null($id)) {
+        $this->out(' {#'.$id.'}');
+        $id = null;
+      }
+    }
+    parent::handleHeader($level);
+  }
+  /**
+   * handle <abbr> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_abbr() {
+    if ($this->parser->isStartTag) {
+      $this->stack();
+      $this->buffer();
+    } else {
+      $tag = $this->unstack();
+      $tag['text'] = $this->unbuffer();
+      $add = true;
+      foreach ($this->stack['abbr'] as $stacked) {
+        if ($stacked['text'] == $tag['text']) {
+          /** TODO: differing abbr definitions, i.e. different titles for same text **/
+          $add = false;
+          break;
+        }
+      }
+      $this->out($tag['text']);
+      if ($add) {
+        array_push($this->stack['abbr'], $tag);
+      }
+    }
+  }
+  /**
+   * flush stacked abbr tags
+   *
+   * @param void
+   * @return void
+   */
+  function flushStacked_abbr() {
+    $out = array();
+    foreach ($this->stack['abbr'] as $k => $tag) {
+      if (!isset($tag['unstacked'])) {
+        array_push($out, ' *['.$tag['text'].']: '.$tag['title']);
+        $tag['unstacked'] = true;
+        $this->stack['abbr'][$k] = $tag;
+      }
+    }
+    if (!empty($out)) {
+      $this->out("\n\n".implode("\n", $out));
+    }
+  }
+  /**
+   * handle <table> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_table() {
+    if ($this->parser->isStartTag) {
+      # check if upcoming table can be converted
+      if ($this->keepHTML) {
+        if (preg_match($this->tableLookaheadHeader, $this->parser->html, $matches)) {
+          # header seems good, now check body
+          # get align & number of cols
+          preg_match_all('#<th(?:\s+align=("|\')(left|right|center)\1)?\s*>#si', $matches[0], $cols);
+          $regEx = '';
+          $i = 1;
+          $aligns = array();
+          foreach ($cols[2] as $align) {
+            $align = strtolower($align);
+            array_push($aligns, $align);
+            if (empty($align)) {
+              $align = 'left'; # default value
+            }
+            $td = '\s+align=("|\')'.$align.'\\'.$i;
+            $i++;
+            if ($align == 'left') {
+              # look for empty align or left
+              $td = '(?:'.$td.')?';
+            }
+            $td = '<td'.$td.'\s*>';
+            $regEx .= $td.$this->tdSubstitute;
+          }
+          $regEx = sprintf($this->tableLookaheadBody, $regEx);
+          if (preg_match($regEx, $this->parser->html, $matches, null, strlen($matches[0]))) {
+            # this is a markdownable table tag!
+            $this->table = array(
+              'rows' => array(),
+              'col_widths' => array(),
+              'aligns' => $aligns,
+            );
+            $this->row = 0;
+          } else {
+            # non markdownable table
+            $this->handleTagToText();
+          }
+        } else {
+          # non markdownable table
+          $this->handleTagToText();
+        }
+      } else {
+        $this->table = array(
+          'rows' => array(),
+          'col_widths' => array(),
+          'aligns' => array(),
+        );
+        $this->row = 0;
+      }
+    } else {
+      # finally build the table in Markdown Extra syntax
+      $separator = array();
+      # seperator with correct align identifikators
+      foreach($this->table['aligns'] as $col => $align) {
+        if (!$this->keepHTML && !isset($this->table['col_widths'][$col])) {
+          break;
+        }
+        $left = ' ';
+        $right = ' ';
+        switch ($align) {
+          case 'left':
+            $left = ':';
+            break;
+          case 'center':
+            $right = ':';
+            $left = ':';
+          case 'right':
+            $right = ':';
+            break;
+        }
+        array_push($separator, $left.str_repeat('-', $this->table['col_widths'][$col]).$right);
+      }
+      $separator = '|'.implode('|', $separator).'|';
+
+      $rows = array();
+      # add padding
+      array_walk_recursive($this->table['rows'], array(&$this, 'alignTdContent'));
+      $header = array_shift($this->table['rows']);
+      array_push($rows, '| '.implode(' | ', $header).' |');
+      array_push($rows, $separator);
+      foreach ($this->table['rows'] as $row) {
+        array_push($rows, '| '.implode(' | ', $row).' |');
+      }
+      $this->out(implode("\n".$this->indent, $rows));
+      $this->table = array();
+      $this->setLineBreaks(2);
+    }
+  }
+  /**
+   * properly pad content so it is aligned as whished
+   * should be used with array_walk_recursive on $this->table['rows']
+   *
+   * @param string &$content
+   * @param int $col
+   * @return void
+   */
+  function alignTdContent(&$content, $col) {
+    switch ($this->table['aligns'][$col]) {
+      default:
+      case 'left':
+        $content .= str_repeat(' ', $this->table['col_widths'][$col] - $this->strlen($content));
+        break;
+      case 'right':
+        $content = str_repeat(' ', $this->table['col_widths'][$col] - $this->strlen($content)).$content;
+        break;
+      case 'center':
+        $paddingNeeded = $this->table['col_widths'][$col] - $this->strlen($content);
+        $left = floor($paddingNeeded / 2);
+        $right = $paddingNeeded - $left;
+        $content = str_repeat(' ', $left).$content.str_repeat(' ', $right);
+        break;
+    }
+  }
+  /**
+   * handle <tr> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_tr() {
+    if ($this->parser->isStartTag) {
+      $this->col = -1;
+    } else {
+      $this->row++;
+    }
+  }
+  /**
+   * handle <td> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_td() {
+    if ($this->parser->isStartTag) {
+      $this->col++;
+      if (!isset($this->table['col_widths'][$this->col])) {
+        $this->table['col_widths'][$this->col] = 0;
+      }
+      $this->buffer();
+    } else {
+      $buffer = trim($this->unbuffer());
+      $this->table['col_widths'][$this->col] = max($this->table['col_widths'][$this->col], $this->strlen($buffer));
+      $this->table['rows'][$this->row][$this->col] = $buffer;
+    }
+  }
+  /**
+   * handle <th> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_th() {
+    if (!$this->keepHTML && !isset($this->table['rows'][1]) && !isset($this->table['aligns'][$this->col+1])) {
+      if (isset($this->parser->tagAttributes['align'])) {
+        $this->table['aligns'][$this->col+1] = $this->parser->tagAttributes['align'];
+      } else {
+        $this->table['aligns'][$this->col+1] = '';
+      }
+    }
+    $this->handleTag_td();
+  }
+  /**
+   * handle <dl> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_dl() {
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(2);
+    }
+  }
+  /**
+   * handle <dt> tags
+   *
+   * @param void
+   * @return void
+   **/
+  function handleTag_dt() {
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(1);
+    }
+  }
+  /**
+   * handle <dd> tags
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_dd() {
+    if ($this->parser->isStartTag) {
+      if (substr(ltrim($this->parser->html), 0, 3) == '<p>') {
+        # next comes a paragraph, so we'll need an extra line
+        $this->out("\n".$this->indent);
+      } elseif (substr($this->output, -2) == "\n\n") {
+        $this->output = substr($this->output, 0, -1);
+      }
+      $this->out(':   ');
+      $this->indent('    ', false);
+    } else {
+      # lookahead for next dt
+      if (substr(ltrim($this->parser->html), 0, 4) == '<dt>') {
+        $this->setLineBreaks(2);
+      } else {
+        $this->setLineBreaks(1);
+      }
+      $this->indent('    ');
+    }
+  }
+  /**
+   * handle <fnref /> tags (custom footnote references, see markdownify_extra::parseString())
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_fnref() {
+    $this->out('[^'.$this->parser->tagAttributes['target'].']');
+  }
+  /**
+   * handle <fn> tags (custom footnotes, see markdownify_extra::parseString()
+   * and markdownify_extra::_makeFootnotes())
+   *
+   * @param void
+   * @return void
+   */
+  function handleTag_fn() {
+    if ($this->parser->isStartTag) {
+      $this->out('[^'.$this->parser->tagAttributes['name'].']:');
+      $this->setLineBreaks(1);
+    } else {
+      $this->setLineBreaks(2);
+    }
+    $this->indent('    ');
+  }
+  /**
+   * handle <footnotes> tag (custom footnotes, see markdownify_extra::parseString()
+   *  and markdownify_extra::_makeFootnotes())
+   *
+   *  @param void
+   *  @return void
+   */
+  function handleTag_footnotes() {
+    if (!$this->parser->isStartTag) {
+      $this->setLineBreaks(2);
+    }
+  }
+  /**
+   * parse a HTML string, clean up footnotes prior
+   *
+   * @param string $HTML input
+   * @return string Markdown formatted output
+   */
+  function parseString($html) {
+    /** TODO: custom markdown-extra options, e.g. titles & classes **/
+    # <sup id="fnref:..."><a href"#fn..." rel="footnote">...</a></sup>
+    # => <fnref target="..." />
+    $html = preg_replace('@<sup id="fnref:([^"]+)">\s*<a href="#fn:\1" rel="footnote">\s*\d+\s*</a>\s*</sup>@Us', '<fnref target="$1" />', $html);
+    # <div class="footnotes">
+    # <hr />
+    # <ol>
+    #
+    # <li id="fn:...">...</li>
+    # ...
+    #
+    # </ol>
+    # </div>
+    # =>
+    # <footnotes>
+    #   <fn name="...">...</fn>
+    #   ...
+    # </footnotes>
+    $html = preg_replace_callback('#<div class="footnotes">\s*<hr />\s*<ol>\s*(.+)\s*</ol>\s*</div>#Us', array(&$this, '_makeFootnotes'), $html);
+    return parent::parseString($html);
+  }
+  /**
+   * replace HTML representation of footnotes with something more easily parsable
+   *
+   * @note this is a callback to be used in parseString()
+   *
+   * @param array $matches
+   * @return string
+   */
+  function _makeFootnotes($matches) {
+    # <li id="fn:1">
+    #   ...
+    #   <a href="#fnref:block" rev="footnote">&#8617;</a></p>
+    # </li>
+    # => <fn name="1">...</fn>
+    # remove footnote link
+    $fns = preg_replace('@\s*(&#160;\s*)?<a href="#fnref:[^"]+" rev="footnote"[^>]*>&#8617;</a>\s*@s', '', $matches[1]);
+    # remove empty paragraph
+    $fns = preg_replace('@<p>\s*</p>@s', '', $fns);
+    # <li id="fn:1">...</li> -> <footnote nr="1">...</footnote>
+    $fns = str_replace('<li id="fn:', '<fn name="', $fns);
+
+    $fns = '<footnotes>'.$fns.'</footnotes>';
+    return preg_replace('#</li>\s*(?=(?:<fn|</footnotes>))#s', '</fn>$1', $fns);
+  }
+}
\ No newline at end of file
diff --git a/www/plugins/facteur/lib/markdownify/parsehtml/parsehtml.php b/www/plugins/facteur/lib/markdownify/parsehtml/parsehtml.php
new file mode 100644 (file)
index 0000000..1a8ecac
--- /dev/null
@@ -0,0 +1,618 @@
+<?php
+/**
+ * parseHTML is a HTML parser which works with PHP 4 and above.
+ * It tries to handle invalid HTML to some degree.
+ *
+ * @version 1.0 beta
+ * @author Milian Wolff (mail@milianw.de, http://milianw.de)
+ * @license LGPL, see LICENSE_LGPL.txt and the summary below
+ * @copyright (C) 2007  Milian Wolff
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+class parseHTML {
+  /**
+   * tags which are always empty (<br /> etc.)
+   *
+   * @var array<string>
+   */
+  var $emptyTags = array(
+    'br',
+    'hr',
+    'input',
+    'img',
+    'area',
+    'link',
+    'meta',
+    'param',
+  );
+  /**
+   * tags with preformatted text
+   * whitespaces wont be touched in them
+   *
+   * @var array<string>
+   */
+  var $preformattedTags = array(
+    'script',
+    'style',
+    'pre',
+    'code',
+  );
+  /**
+   * supress HTML tags inside preformatted tags (see above)
+   *
+   * @var bool
+   */
+  var $noTagsInCode = false;
+  /**
+   * html to be parsed
+   *
+   * @var string
+   */
+  var $html = '';
+  /**
+   * node type:
+   *
+   * - tag (see isStartTag)
+   * - text (includes cdata)
+   * - comment
+   * - doctype
+   * - pi (processing instruction)
+   *
+   * @var string
+   */
+  var $nodeType = '';
+  /**
+   * current node content, i.e. either a
+   * simple string (text node), or something like
+   * <tag attrib="value"...>
+   *
+   * @var string
+   */
+  var $node = '';
+  /**
+   * wether current node is an opening tag (<a>) or not (</a>)
+   * set to NULL if current node is not a tag
+   * NOTE: empty tags (<br />) set this to true as well!
+   *
+   * @var bool | null
+   */
+  var $isStartTag = null;
+  /**
+   * wether current node is an empty tag (<br />) or not (<a></a>)
+   *
+   * @var bool | null
+   */
+  var $isEmptyTag = null;
+  /**
+   * tag name
+   *
+   * @var string | null
+   */
+  var $tagName = '';
+  /**
+   * attributes of current tag
+   *
+   * @var array (attribName=>value) | null
+   */
+  var $tagAttributes = null;
+  /**
+   * wether the current tag is a block element
+   *
+   * @var bool | null
+   */
+  var $isBlockElement = null;
+
+  /**
+   * keep whitespace
+   *
+   * @var int
+   */
+  var $keepWhitespace = 0;
+  /**
+   * list of open tags
+   * count this to get current depth
+   *
+   * @var array
+   */
+  var $openTags = array();
+  /**
+   * list of block elements
+   *
+   * @var array
+   * TODO: what shall we do with <del> and <ins> ?!
+   */
+  var $blockElements = array (
+    # tag name => <bool> is block
+    # block elements
+    'address' => true,
+    'blockquote' => true,
+    'center' => true,
+    'del' => true,
+    'dir' => true,
+    'div' => true,
+    'dl' => true,
+    'fieldset' => true,
+    'form' => true,
+    'h1' => true,
+    'h2' => true,
+    'h3' => true,
+    'h4' => true,
+    'h5' => true,
+    'h6' => true,
+    'hr' => true,
+    'ins' => true,
+    'isindex' => true,
+    'menu' => true,
+    'noframes' => true,
+    'noscript' => true,
+    'ol' => true,
+    'p' => true,
+    'pre' => true,
+    'table' => true,
+    'ul' => true,
+    # set table elements and list items to block as well
+    'thead' => true,
+    'tbody' => true,
+    'tfoot' => true,
+    'td' => true,
+    'tr' => true,
+    'th' => true,
+    'li' => true,
+    'dd' => true,
+    'dt' => true,
+    # header items and html / body as well
+    'html' => true,
+    'body' => true,
+    'head' => true,
+    'meta' => true,
+    'link' => true,
+    'style' => true,
+    'title' => true,
+    # unfancy media tags, when indented should be rendered as block
+    'map' => true,
+    'object' => true,
+    'param' => true,
+    'embed' => true,
+    'area' => true,
+    # inline elements
+    'a' => false,
+    'abbr' => false,
+    'acronym' => false,
+    'applet' => false,
+    'b' => false,
+    'basefont' => false,
+    'bdo' => false,
+    'big' => false,
+    'br' => false,
+    'button' => false,
+    'cite' => false,
+    'code' => false,
+    'del' => false,
+    'dfn' => false,
+    'em' => false,
+    'font' => false,
+    'i' => false,
+    'img' => false,
+    'ins' => false,
+    'input' => false,
+    'iframe' => false,
+    'kbd' => false,
+    'label' => false,
+    'q' => false,
+    'samp' => false,
+    'script' => false,
+    'select' => false,
+    'small' => false,
+    'span' => false,
+    'strong' => false,
+    'sub' => false,
+    'sup' => false,
+    'textarea' => false,
+    'tt' => false,
+    'var' => false,
+  );
+  /**
+   * get next node, set $this->html prior!
+   *
+   * @param void
+   * @return bool
+   */
+  function nextNode() {
+    if (empty($this->html)) {
+      # we are done with parsing the html string
+      return false;
+    }
+    static $skipWhitespace = true;
+    if ($this->isStartTag && !$this->isEmptyTag) {
+      array_push($this->openTags, $this->tagName);
+      if (in_array($this->tagName, $this->preformattedTags)) {
+        # dont truncate whitespaces for <code> or <pre> contents
+        $this->keepWhitespace++;
+      }
+    }
+
+    if ($this->html[0] == '<') {
+      $token = substr($this->html, 0, 9);
+      if (substr($token, 0, 2) == '<?') {
+        # xml prolog or other pi's
+        /** TODO **/
+        #trigger_error('this might need some work', E_USER_NOTICE);
+        $pos = strpos($this->html, '>');
+        $this->setNode('pi', $pos + 1);
+        return true;
+      }
+      if (substr($token, 0, 4) == '<!--') {
+        # comment
+        $pos = strpos($this->html, '-->');
+        if ($pos === false) {
+          # could not find a closing -->, use next gt instead
+          # this is firefox' behaviour
+          $pos = strpos($this->html, '>') + 1;
+        } else {
+          $pos += 3;
+        }
+        $this->setNode('comment', $pos);
+
+        $skipWhitespace = true;
+        return true;
+      }
+      if ($token == '<!DOCTYPE') {
+        # doctype
+        $this->setNode('doctype', strpos($this->html, '>')+1);
+
+        $skipWhitespace = true;
+        return true;
+      }
+      if ($token == '<![CDATA[') {
+        # cdata, use text node
+
+        # remove leading <![CDATA[
+        $this->html = substr($this->html, 9);
+
+        $this->setNode('text', strpos($this->html, ']]>')+3);
+
+        # remove trailing ]]> and trim
+        $this->node = substr($this->node, 0, -3);
+        $this->handleWhitespaces();
+
+        $skipWhitespace = true;
+        return true;
+      }
+      if ($this->parseTag()) {
+        # seems to be a tag
+        # handle whitespaces
+        if ($this->isBlockElement) {
+          $skipWhitespace = true;
+        } else {
+          $skipWhitespace = false;
+        }
+        return true;
+      }
+    }
+    if ($this->keepWhitespace) {
+      $skipWhitespace = false;
+    }
+    # when we get here it seems to be a text node
+    $pos = strpos($this->html, '<');
+    if ($pos === false) {
+      $pos = strlen($this->html);
+    }
+    $this->setNode('text', $pos);
+    $this->handleWhitespaces();
+    if ($skipWhitespace && $this->node == ' ') {
+      return $this->nextNode();
+    }
+    $skipWhitespace = false;
+    return true;
+  }
+  /**
+   * parse tag, set tag name and attributes, see if it's a closing tag and so forth...
+   *
+   * @param void
+   * @return bool
+   */
+  function parseTag() {
+    static $a_ord, $z_ord, $special_ords;
+    if (!isset($a_ord)) {
+      $a_ord = ord('a');
+      $z_ord = ord('z');
+      $special_ords = array(
+        ord(':'), // for xml:lang
+        ord('-'), // for http-equiv
+      );
+    }
+
+    $tagName = '';
+
+    $pos = 1;
+    $isStartTag = $this->html[$pos] != '/';
+    if (!$isStartTag) {
+      $pos++;
+    }
+    # get tagName
+    while (isset($this->html[$pos])) {
+      $pos_ord = ord(strtolower($this->html[$pos]));
+      if (($pos_ord >= $a_ord && $pos_ord <= $z_ord) || (!empty($tagName) && is_numeric($this->html[$pos]))) {
+        $tagName .= $this->html[$pos];
+        $pos++;
+      } else {
+        $pos--;
+        break;
+      }
+    }
+
+    $tagName = strtolower($tagName);
+    if (empty($tagName) || !isset($this->blockElements[$tagName])) {
+      # something went wrong => invalid tag
+      $this->invalidTag();
+      return false;
+    }
+    if ($this->noTagsInCode && end($this->openTags) == 'code' && !($tagName == 'code' && !$isStartTag)) {
+      # we supress all HTML tags inside code tags
+      $this->invalidTag();
+      return false;
+    }
+
+    # get tag attributes
+    /** TODO: in html 4 attributes do not need to be quoted **/
+    $isEmptyTag = false;
+    $attributes = array();
+    $currAttrib = '';
+    while (isset($this->html[$pos+1])) {
+      $pos++;
+      # close tag
+      if ($this->html[$pos] == '>' || $this->html[$pos].$this->html[$pos+1] == '/>') {
+        if ($this->html[$pos] == '/') {
+          $isEmptyTag = true;
+          $pos++;
+        }
+        break;
+      }
+
+      $pos_ord = ord(strtolower($this->html[$pos]));
+      if ( ($pos_ord >= $a_ord && $pos_ord <= $z_ord) || in_array($pos_ord, $special_ords)) {
+        # attribute name
+        $currAttrib .= $this->html[$pos];
+      } elseif (in_array($this->html[$pos], array(' ', "\t", "\n"))) {
+        # drop whitespace
+      } elseif (in_array($this->html[$pos].$this->html[$pos+1], array('="', "='"))) {
+        # get attribute value
+        $pos++;
+        $await = $this->html[$pos]; # single or double quote
+        $pos++;
+        $value = '';
+        while (isset($this->html[$pos]) && $this->html[$pos] != $await) {
+          $value .= $this->html[$pos];
+          $pos++;
+        }
+        $attributes[$currAttrib] = $value;
+        $currAttrib = '';
+      } else {
+        $this->invalidTag();
+        return false;
+      }
+    }
+    if ($this->html[$pos] != '>') {
+      $this->invalidTag();
+      return false;
+    }
+
+    if (!empty($currAttrib)) {
+      # html 4 allows something like <option selected> instead of <option selected="selected">
+      $attributes[$currAttrib] = $currAttrib;
+    }
+    if (!$isStartTag) {
+      if (!empty($attributes) || $tagName != end($this->openTags)) {
+        # end tags must not contain any attributes
+        # or maybe we did not expect a different tag to be closed
+        $this->invalidTag();
+        return false;
+      }
+      array_pop($this->openTags);
+      if (in_array($tagName, $this->preformattedTags)) {
+        $this->keepWhitespace--;
+      }
+    }
+    $pos++;
+    $this->node = substr($this->html, 0, $pos);
+    $this->html = substr($this->html, $pos);
+    $this->tagName = $tagName;
+    $this->tagAttributes = $attributes;
+    $this->isStartTag = $isStartTag;
+    $this->isEmptyTag = $isEmptyTag || in_array($tagName, $this->emptyTags);
+    if ($this->isEmptyTag) {
+      # might be not well formed
+      $this->node = preg_replace('# */? *>$#', ' />', $this->node);
+    }
+    $this->nodeType = 'tag';
+    $this->isBlockElement = $this->blockElements[$tagName];
+    return true;
+  }
+  /**
+   * handle invalid tags
+   *
+   * @param void
+   * @return void
+   */
+  function invalidTag() {
+    $this->html = substr_replace($this->html, '&lt;', 0, 1);
+  }
+  /**
+   * update all vars and make $this->html shorter
+   *
+   * @param string $type see description for $this->nodeType
+   * @param int $pos to which position shall we cut?
+   * @return void
+   */
+  function setNode($type, $pos) {
+    if ($this->nodeType == 'tag') {
+      # set tag specific vars to null
+      # $type == tag should not be called here
+      # see this::parseTag() for more
+      $this->tagName = null;
+      $this->tagAttributes = null;
+      $this->isStartTag = null;
+      $this->isEmptyTag = null;
+      $this->isBlockElement = null;
+
+    }
+    $this->nodeType = $type;
+    $this->node = substr($this->html, 0, $pos);
+    $this->html = substr($this->html, $pos);
+  }
+  /**
+   * check if $this->html begins with $str
+   *
+   * @param string $str
+   * @return bool
+   */
+  function match($str) {
+    return substr($this->html, 0, strlen($str)) == $str;
+  }
+  /**
+   * truncate whitespaces
+   *
+   * @param void
+   * @return void
+   */
+  function handleWhitespaces() {
+    if ($this->keepWhitespace) {
+      # <pre> or <code> before...
+      return;
+    }
+    # truncate multiple whitespaces to a single one
+    $this->node = preg_replace('#\s+#s', ' ', $this->node);
+  }
+  /**
+   * normalize self::node
+   *
+   * @param void
+   * @return void
+   */
+  function normalizeNode() {
+    $this->node = '<';
+    if (!$this->isStartTag) {
+      $this->node .= '/'.$this->tagName.'>';
+      return;
+    }
+    $this->node .= $this->tagName;
+    foreach ($this->tagAttributes as $name => $value) {
+      $this->node .= ' '.$name.'="'.str_replace('"', '&quot;', $value).'"';
+    }
+    if ($this->isEmptyTag) {
+      $this->node .= ' /';
+    }
+    $this->node .= '>';
+  }
+}
+
+/**
+ * indent a HTML string properly
+ *
+ * @param string $html
+ * @param string $indent optional
+ * @return string
+ */
+function indentHTML($html, $indent = "  ", $noTagsInCode = false) {
+  $parser = new parseHTML;
+  $parser->noTagsInCode = $noTagsInCode;
+  $parser->html = $html;
+  $html = '';
+  $last = true; # last tag was block elem
+  $indent_a = array();
+  while($parser->nextNode()) {
+    if ($parser->nodeType == 'tag') {
+      $parser->normalizeNode();
+    }
+    if ($parser->nodeType == 'tag' && $parser->isBlockElement) {
+      $isPreOrCode = in_array($parser->tagName, array('code', 'pre'));
+      if (!$parser->keepWhitespace && !$last && !$isPreOrCode) {
+        $html = rtrim($html)."\n";
+      }
+      if ($parser->isStartTag) {
+        $html .= implode($indent_a);
+        if (!$parser->isEmptyTag) {
+          array_push($indent_a, $indent);
+        }
+      } else {
+        array_pop($indent_a);
+        if (!$isPreOrCode) {
+          $html .= implode($indent_a);
+        }
+      }
+      $html .= $parser->node;
+      if (!$parser->keepWhitespace && !($isPreOrCode && $parser->isStartTag)) {
+        $html .= "\n";
+      }
+      $last = true;
+    } else {
+      if ($parser->nodeType == 'tag' && $parser->tagName == 'br') {
+        $html .= $parser->node."\n";
+        $last = true;
+        continue;
+      } elseif ($last && !$parser->keepWhitespace) {
+        $html .= implode($indent_a);
+        $parser->node = ltrim($parser->node);
+      }
+      $html .= $parser->node;
+
+      if (in_array($parser->nodeType, array('comment', 'pi', 'doctype'))) {
+        $html .= "\n";
+      } else {
+        $last = false;
+      }
+    }
+  }
+  return $html;
+}
+/*
+# testcase / example
+error_reporting(E_ALL);
+
+$html = '<p>Simple block on one line:</p>
+
+<div>foo</div>
+
+<p>And nested without indentation:</p>
+
+<div>
+<div>
+<div>
+foo
+</div>
+<div style=">"/>
+</div>
+<div>bar</div>
+</div>
+
+<p>And with attributes:</p>
+
+<div>
+    <div id="foo">
+    </div>
+</div>
+
+<p>This was broken in 1.0.2b7:</p>
+
+<div class="inlinepage">
+<div class="toggleableend">
+foo
+</div>
+</div>';
+#$html = '<a href="asdfasdf"       title=\'asdf\' foo="bar">asdf</a>';
+echo indentHTML($html);
+die();
+*/
diff --git a/www/plugins/facteur/paquet.xml b/www/plugins/facteur/paquet.xml
new file mode 100644 (file)
index 0000000..7c442cc
--- /dev/null
@@ -0,0 +1,22 @@
+<paquet\r
+       prefix="facteur"\r
+       categorie="communication"\r
+       version="3.0.7"\r
+       etat="stable"\r
+       compatibilite="[3.0.0;3.0.*]"\r
+       logo="prive/themes/spip/images/facteur-32.png"\r
+       schema="1.1"\r
+       documentation="http://www.spip-contrib.net/Facteur"\r
+>      \r
+       \r
+       <nom>Facteur</nom>\r
+       <!-- Il distribue votre courrier -->\r
+       \r
+       <auteur>Collectif SPIP</auteur>\r
+       \r
+       <pipeline nom="facteur_pre_envoi" action="" />\r
+       <pipeline nom="ieconfig_metas" inclure="facteur_ieconfig_metas.php" />\r
+       <pipeline nom="recuperer_fond" inclure="facteur_pipelines.php" />\r
+       \r
+       <menu nom="configurer_facteur" titre="facteur:configuration_facteur" parent="menu_configuration" icone="images/facteur-16.png" />\r
+</paquet>\r
diff --git a/www/plugins/facteur/phpmailer-php5/LICENSE b/www/plugins/facteur/phpmailer-php5/LICENSE
new file mode 100755 (executable)
index 0000000..03851a3
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+                      Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                           Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+  \r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                           NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                    END OF TERMS AND CONDITIONS\r
+\r
+           How to Apply These Terms to Your New Libraries\r
+\r
+  If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change.  You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+  To apply these terms, attach the following notices to the library.  It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the library's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This library is free software; you can redistribute it and/or\r
+    modify it under the terms of the GNU Lesser General Public\r
+    License as published by the Free Software Foundation; either\r
+    version 2.1 of the License, or (at your option) any later version.\r
+\r
+    This library is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+    Lesser General Public License for more details.\r
+\r
+    You should have received a copy of the GNU Lesser General Public\r
+    License along with this library; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1990\r
+  Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
diff --git a/www/plugins/facteur/phpmailer-php5/README b/www/plugins/facteur/phpmailer-php5/README
new file mode 100755 (executable)
index 0000000..3670fb6
--- /dev/null
@@ -0,0 +1,178 @@
+/*******************************************************************\r
+* The http://phpmailer.codeworxtech.com/ website now carries a few *\r
+* advertisements through the Google Adsense network. Please visit  *\r
+* the advertiser sites and help us offset some of our costs.       *\r
+* Thanks ....                                                      *\r
+********************************************************************/\r
+\r
+PHPMailer\r
+Full Featured Email Transfer Class for PHP\r
+==========================================\r
+\r
+Version 2.1 (June 04 2008)\r
+\r
+With this release, we are announcing that the development of PHPMailer for PHP5\r
+will be our focus from this date on. We have implemented all the enhancements\r
+and fixes from the latest release of PHPMailer for PHP4.\r
+\r
+Far more important, though, is that this release of PHPMailer (v2.1) is\r
+fully tested with E_STRICT error checking enabled.\r
+\r
+** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.\r
+   IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE\r
+   APPRECIATED.\r
+\r
+We have now added S/MIME functionality (ability to digitally sign emails).\r
+BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.\r
+The "Signed Emails" functionality adds the Sign method to pass the private key\r
+filename and the password to read it, and then email will be sent with\r
+content-type multipart/signed and with the digital signature attached.\r
+\r
+A quick note on E_STRICT:\r
+\r
+- In about half the test environments the development version was subjected\r
+       to, an error was thrown for the date() functions (used at line 1565 and 1569).\r
+       This is NOT a PHPMailer error, it is the result of an incorrectly configured\r
+       PHP5 installation. The fix is to modify your 'php.ini' file and include the\r
+       date.timezone = America/New York\r
+       directive, (for your own server timezone)\r
+- If you do get this error, and are unable to access your php.ini file, there is\r
+       a workaround. In your PHP script, add\r
+       date_default_timezone_set('America/Toronto');\r
+\r
+       * do NOT try to use\r
+       $myVar = date_default_timezone_get();\r
+       as a test, it will throw an error.\r
+\r
+We have also included more example files to show the use of "sendmail", "mail()",\r
+"smtp", and "gmail".\r
+\r
+We are also looking for more programmers to join the volunteer development team.\r
+If you have an interest in this, please let us know.\r
+\r
+Enjoy!\r
+\r
+\r
+Version 2.1.0beta1 & beta2\r
+\r
+please note, this is BETA software\r
+** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS\r
+INTENDED STRICTLY FOR TESTING\r
+\r
+** NOTE:\r
+\r
+As of November 2007, PHPMailer has a new project team headed by industry\r
+veteran Andy Prevost (codeworxtech). The first release in more than two\r
+years will focus on fixes, adding ease-of-use enhancements, provide\r
+basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility\r
+features. A new release is planned before year-end 2007 that will provide\r
+full compatiblity with PHP4 and PHP5, as well as more bug fixes.\r
+\r
+We are looking for project developers to assist in restoring PHPMailer to\r
+its leadership position. Our goals are to simplify use of PHPMailer, provide\r
+good documentation and examples, and retain backward compatibility to level\r
+1.7.3 standards.\r
+\r
+If you are interested in helping out, visit http://sourceforge.net/phpmailer\r
+and indicate your interest.\r
+\r
+**\r
+\r
+http://phpmailer.sourceforge.net/\r
+\r
+This software is licenced under the LGPL.  Please read LICENSE for information on the\r
+software availability and distribution.\r
+\r
+Class Features:\r
+- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs\r
+- Redundant SMTP servers\r
+- Multipart/alternative emails for mail clients that do not read HTML email\r
+- Support for 8bit, base64, binary, and quoted-printable encoding\r
+- Uses the same methods as the very popular AspEmail active server (COM) component\r
+- SMTP authentication\r
+- Native language support\r
+- Word wrap, and more!\r
+\r
+Why you might need it:\r
+\r
+Many PHP developers utilize email in their code.  The only PHP function\r
+that supports this is the mail() function.  However, it does not expose\r
+any of the popular features that many email clients use nowadays like\r
+HTML-based emails and attachments. There are two proprietary\r
+development tools out there that have all the functionality built into\r
+easy to use classes: AspEmail(tm) and AspMail.  Both of these\r
+programs are COM components only available on Windows.  They are also a\r
+little pricey for smaller projects.\r
+\r
+Since I do Linux development I\92ve missed these tools for my PHP coding.\r
+So I built a version myself that implements the same methods (object\r
+calls) that the Windows-based components do. It is open source and the\r
+LGPL license allows you to place the class in your proprietary PHP\r
+projects.\r
+\r
+\r
+Installation:\r
+\r
+Copy class.phpmailer.php into your php.ini include_path. If you are\r
+using the SMTP mailer then place class.smtp.php in your path as well.\r
+In the language directory you will find several files like\r
+phpmailer.lang-en.php.  If you look right before the .php extension\r
+that there are two letters.  These represent the language type of the\r
+translation file.  For instance "en" is the English file and "br" is\r
+the Portuguese file.  Chose the file that best fits with your language\r
+and place it in the PHP include path.  If your language is English\r
+then you have nothing more to do.  If it is a different language then\r
+you must point PHPMailer to the correct translation.  To do this, call\r
+the PHPMailer SetLanguage method like so:\r
+\r
+// To load the Portuguese version\r
+$mail->SetLanguage("br", "/optional/path/to/language/directory/");\r
+\r
+That's it.  You should now be ready to use PHPMailer!\r
+\r
+\r
+A Simple Example:\r
+\r
+<?php\r
+require("class.phpmailer.php");\r
+\r
+$mail = new PHPMailer();\r
+\r
+$mail->IsSMTP();                                      // set mailer to use SMTP\r
+$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server\r
+$mail->SMTPAuth = true;     // turn on SMTP authentication\r
+$mail->Username = "jswan";  // SMTP username\r
+$mail->Password = "secret"; // SMTP password\r
+\r
+$mail->From = "from@example.com";\r
+$mail->FromName = "Mailer";\r
+$mail->AddAddress("josh@example.net", "Josh Adams");\r
+$mail->AddAddress("ellen@example.com");                  // name is optional\r
+$mail->AddReplyTo("info@example.com", "Information");\r
+\r
+$mail->WordWrap = 50;                                 // set word wrap to 50 characters\r
+$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments\r
+$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name\r
+$mail->IsHTML(true);                                  // set email format to HTML\r
+\r
+$mail->Subject = "Here is the subject";\r
+$mail->Body    = "This is the HTML message body <b>in bold!</b>";\r
+$mail->AltBody = "This is the body in plain text for non-HTML mail clients";\r
+\r
+if(!$mail->Send())\r
+{\r
+   echo "Message could not be sent. <p>";\r
+   echo "Mailer Error: " . $mail->ErrorInfo;\r
+   exit;\r
+}\r
+\r
+echo "Message has been sent";\r
+?>\r
+\r
+CHANGELOG\r
+\r
+See ChangeLog.txt\r
+\r
+Download: http://sourceforge.net/project/showfiles.php?group_id=26031\r
+\r
+Andy Prevost\r
diff --git a/www/plugins/facteur/phpmailer-php5/class.phpmailer.php b/www/plugins/facteur/phpmailer-php5/class.phpmailer.php
new file mode 100755 (executable)
index 0000000..65baf42
--- /dev/null
@@ -0,0 +1,2320 @@
+<?php
+/*~ class.phpmailer.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 5.1                                                            |
+|   Contact: via sourceforge.net support pages (also www.worxware.com)      |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|     Admin: Andy Prevost (project admininistrator)                         |
+|   Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
+|          : Marcus Bointon (coolbru) coolbru@users.sourceforge.net         |
+|   Founder: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.worxware.com):                    |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+*/
+
+/**
+ * PHPMailer - PHP email transport class
+ * NOTE: Requires PHP version 5 or later
+ * @package PHPMailer
+ * @author Andy Prevost
+ * @author Marcus Bointon
+ * @copyright 2004 - 2009 Andy Prevost
+ * @version $Id: class.phpmailer.php 447 2009-05-25 01:36:38Z codeworxtech $
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ */
+
+if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
+
+class PHPMailer {
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PUBLIC
+  /////////////////////////////////////////////////
+
+  /**
+   * Email priority (1 = High, 3 = Normal, 5 = low).
+   * @var int
+   */
+  public $Priority          = 3;
+
+  /**
+   * Sets the CharSet of the message.
+   * @var string
+   */
+  public $CharSet           = 'iso-8859-1';
+
+  /**
+   * Sets the Content-type of the message.
+   * @var string
+   */
+  public $ContentType       = 'text/plain';
+
+  /**
+   * Sets the Encoding of the message. Options for this are
+   *  "8bit", "7bit", "binary", "base64", and "quoted-printable".
+   * @var string
+   */
+  public $Encoding          = '8bit';
+
+  /**
+   * Holds the most recent mailer error message.
+   * @var string
+   */
+  public $ErrorInfo         = '';
+
+  /**
+   * Sets the From email address for the message.
+   * @var string
+   */
+  public $From              = 'root@localhost';
+
+  /**
+   * Sets the From name of the message.
+   * @var string
+   */
+  public $FromName          = 'Root User';
+
+  /**
+   * Sets the Sender email (Return-Path) of the message.  If not empty,
+   * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+   * @var string
+   */
+  public $Sender            = '';
+
+  /**
+   * Sets the Subject of the message.
+   * @var string
+   */
+  public $Subject           = '';
+
+  /**
+   * Sets the Body of the message.  This can be either an HTML or text body.
+   * If HTML then run IsHTML(true).
+   * @var string
+   */
+  public $Body              = '';
+
+  /**
+   * Sets the text-only body of the message.  This automatically sets the
+   * email to multipart/alternative.  This body can be read by mail
+   * clients that do not have HTML email capability such as mutt. Clients
+   * that can read HTML will view the normal Body.
+   * @var string
+   */
+  public $AltBody           = '';
+
+  /**
+   * Sets word wrapping on the body of the message to a given number of
+   * characters.
+   * @var int
+   */
+  public $WordWrap          = 0;
+
+  /**
+   * Method to send mail: ("mail", "sendmail", or "smtp").
+   * @var string
+   */
+  public $Mailer            = 'mail';
+
+  /**
+   * Sets the path of the sendmail program.
+   * @var string
+   */
+  public $Sendmail          = '/usr/sbin/sendmail';
+
+  /**
+   * Path to PHPMailer plugins.  Useful if the SMTP class
+   * is in a different directory than the PHP include path.
+   * @var string
+   */
+  public $PluginDir         = '';
+
+  /**
+   * Sets the email address that a reading confirmation will be sent.
+   * @var string
+   */
+  public $ConfirmReadingTo  = '';
+
+  /**
+   * Sets the hostname to use in Message-Id and Received headers
+   * and as default HELO string. If empty, the value returned
+   * by SERVER_NAME is used or 'localhost.localdomain'.
+   * @var string
+   */
+  public $Hostname          = '';
+
+  /**
+   * Sets the message ID to be used in the Message-Id header.
+   * If empty, a unique id will be generated.
+   * @var string
+   */
+  public $MessageID         = '';
+
+  /////////////////////////////////////////////////
+  // PROPERTIES FOR SMTP
+  /////////////////////////////////////////////////
+
+  /**
+   * Sets the SMTP hosts.  All hosts must be separated by a
+   * semicolon.  You can also specify a different port
+   * for each host by using this format: [hostname:port]
+   * (e.g. "smtp1.example.com:25;smtp2.example.com").
+   * Hosts will be tried in order.
+   * @var string
+   */
+  public $Host          = 'localhost';
+
+  /**
+   * Sets the default SMTP server port.
+   * @var int
+   */
+  public $Port          = 25;
+
+  /**
+   * Sets the SMTP HELO of the message (Default is $Hostname).
+   * @var string
+   */
+  public $Helo          = '';
+
+  /**
+   * Sets connection prefix.
+   * Options are "", "ssl" or "tls"
+   * @var string
+   */
+  public $SMTPSecure    = '';
+
+  /**
+   * Sets SMTP authentication. Utilizes the Username and Password variables.
+   * @var bool
+   */
+  public $SMTPAuth      = false;
+
+  /**
+   * Sets SMTP username.
+   * @var string
+   */
+  public $Username      = '';
+
+  /**
+   * Sets SMTP password.
+   * @var string
+   */
+  public $Password      = '';
+
+  /**
+   * Sets the SMTP server timeout in seconds.
+   * This function will not work with the win32 version.
+   * @var int
+   */
+  public $Timeout       = 10;
+
+  /**
+   * Sets SMTP class debugging on or off.
+   * @var bool
+   */
+  public $SMTPDebug     = false;
+
+  /**
+   * Prevents the SMTP connection from being closed after each mail
+   * sending.  If this is set to true then to close the connection
+   * requires an explicit call to SmtpClose().
+   * @var bool
+   */
+  public $SMTPKeepAlive = false;
+
+  /**
+   * Provides the ability to have the TO field process individual
+   * emails, instead of sending to entire TO addresses
+   * @var bool
+   */
+  public $SingleTo      = false;
+
+   /**
+   * If SingleTo is true, this provides the array to hold the email addresses
+   * @var bool
+   */
+  public $SingleToArray = array();
+
+ /**
+   * Provides the ability to change the line ending
+   * @var string
+   */
+  public $LE              = "\n";
+
+  /**
+   * Used with DKIM DNS Resource Record
+   * @var string
+   */
+  public $DKIM_selector   = 'phpmailer';
+
+  /**
+   * Used with DKIM DNS Resource Record
+   * optional, in format of email address 'you@yourdomain.com'
+   * @var string
+   */
+  public $DKIM_identity   = '';
+
+  /**
+   * Used with DKIM DNS Resource Record
+   * optional, in format of email address 'you@yourdomain.com'
+   * @var string
+   */
+  public $DKIM_domain     = '';
+
+  /**
+   * Used with DKIM DNS Resource Record
+   * optional, in format of email address 'you@yourdomain.com'
+   * @var string
+   */
+  public $DKIM_private    = '';
+
+  /**
+   * Callback Action function name
+   * the function that handles the result of the send email action. Parameters:
+   *   bool    $result        result of the send action
+   *   string  $to            email address of the recipient
+   *   string  $cc            cc email addresses
+   *   string  $bcc           bcc email addresses
+   *   string  $subject       the subject
+   *   string  $body          the email body
+   * @var string
+   */
+  public $action_function = ''; //'callbackAction';
+
+  /**
+   * Sets the PHPMailer Version number
+   * @var string
+   */
+  public $Version         = '5.1';
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PRIVATE AND PROTECTED
+  /////////////////////////////////////////////////
+
+  private   $smtp           = NULL;
+  private   $to             = array();
+  private   $cc             = array();
+  private   $bcc            = array();
+  private   $ReplyTo        = array();
+  private   $all_recipients = array();
+  private   $attachment     = array();
+  private   $CustomHeader   = array();
+  private   $message_type   = '';
+  private   $boundary       = array();
+  protected $language       = array();
+  private   $error_count    = 0;
+  private   $sign_cert_file = "";
+  private   $sign_key_file  = "";
+  private   $sign_key_pass  = "";
+  private   $exceptions     = false;
+
+  /////////////////////////////////////////////////
+  // CONSTANTS
+  /////////////////////////////////////////////////
+
+  const STOP_MESSAGE  = 0; // message only, continue processing
+  const STOP_CONTINUE = 1; // message?, likely ok to continue processing
+  const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
+
+  /////////////////////////////////////////////////
+  // METHODS, VARIABLES
+  /////////////////////////////////////////////////
+
+  /**
+   * Constructor
+   * @param boolean $exceptions Should we throw external exceptions?
+   */
+  public function __construct($exceptions = false) {
+    $this->exceptions = ($exceptions == true);
+  }
+
+  /**
+   * Sets message type to HTML.
+   * @param bool $ishtml
+   * @return void
+   */
+  public function IsHTML($ishtml = true) {
+    if ($ishtml) {
+      $this->ContentType = 'text/html';
+    } else {
+      $this->ContentType = 'text/plain';
+    }
+  }
+
+  /**
+   * Sets Mailer to send message using SMTP.
+   * @return void
+   */
+  public function IsSMTP() {
+    $this->Mailer = 'smtp';
+  }
+
+  /**
+   * Sets Mailer to send message using PHP mail() function.
+   * @return void
+   */
+  public function IsMail() {
+    $this->Mailer = 'mail';
+  }
+
+  /**
+   * Sets Mailer to send message using the $Sendmail program.
+   * @return void
+   */
+  public function IsSendmail() {
+    if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
+      $this->Sendmail = '/var/qmail/bin/sendmail';
+    }
+    $this->Mailer = 'sendmail';
+  }
+
+  /**
+   * Sets Mailer to send message using the qmail MTA.
+   * @return void
+   */
+  public function IsQmail() {
+    if (stristr(ini_get('sendmail_path'), 'qmail')) {
+      $this->Sendmail = '/var/qmail/bin/sendmail';
+    }
+    $this->Mailer = 'sendmail';
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, RECIPIENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds a "To" address.
+   * @param string $address
+   * @param string $name
+   * @return boolean true on success, false if address already used
+   */
+  public function AddAddress($address, $name = '') {
+    return $this->AddAnAddress('to', $address, $name);
+  }
+
+  /**
+   * Adds a "Cc" address.
+   * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+   * @param string $address
+   * @param string $name
+   * @return boolean true on success, false if address already used
+   */
+  public function AddCC($address, $name = '') {
+    return $this->AddAnAddress('cc', $address, $name);
+  }
+
+  /**
+   * Adds a "Bcc" address.
+   * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
+   * @param string $address
+   * @param string $name
+   * @return boolean true on success, false if address already used
+   */
+  public function AddBCC($address, $name = '') {
+    return $this->AddAnAddress('bcc', $address, $name);
+  }
+
+  /**
+   * Adds a "Reply-to" address.
+   * @param string $address
+   * @param string $name
+   * @return boolean
+   */
+  public function AddReplyTo($address, $name = '') {
+    return $this->AddAnAddress('ReplyTo', $address, $name);
+  }
+
+  /**
+   * Adds an address to one of the recipient arrays
+   * Addresses that have been added already return false, but do not throw exceptions
+   * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
+   * @param string $address The email address to send to
+   * @param string $name
+   * @return boolean true on success, false if address already used or invalid in some way
+   * @access private
+   */
+  private function AddAnAddress($kind, $address, $name = '') {
+    if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
+      echo 'Invalid recipient array: ' . kind;
+      return false;
+    }
+    $address = trim($address);
+    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+    if (!self::ValidateAddress($address)) {
+      $this->SetError($this->Lang('invalid_address').': '. $address);
+      if ($this->exceptions) {
+        throw new phpmailerException($this->Lang('invalid_address').': '.$address);
+      }
+      echo $this->Lang('invalid_address').': '.$address;
+      return false;
+    }
+    if ($kind != 'ReplyTo') {
+      if (!isset($this->all_recipients[strtolower($address)])) {
+        array_push($this->$kind, array($address, $name));
+        $this->all_recipients[strtolower($address)] = true;
+        return true;
+      }
+    } else {
+      if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
+        $this->ReplyTo[strtolower($address)] = array($address, $name);
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Set the From and FromName properties
+ * @param string $address
+ * @param string $name
+ * @return boolean
+ */
+  public function SetFrom($address, $name = '',$auto=1) {
+    $address = trim($address);
+    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+    if (!self::ValidateAddress($address)) {
+      $this->SetError($this->Lang('invalid_address').': '. $address);
+      if ($this->exceptions) {
+        throw new phpmailerException($this->Lang('invalid_address').': '.$address);
+      }
+      echo $this->Lang('invalid_address').': '.$address;
+      return false;
+    }
+    $this->From = $address;
+    $this->FromName = $name;
+    if ($auto) {
+      if (empty($this->ReplyTo)) {
+        $this->AddAnAddress('ReplyTo', $address, $name);
+      }
+      if (empty($this->Sender)) {
+        $this->Sender = $address;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Check that a string looks roughly like an email address should
+   * Static so it can be used without instantiation
+   * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator
+   * Conforms approximately to RFC2822
+   * @link http://www.hexillion.com/samples/#Regex Original pattern found here
+   * @param string $address The email address to check
+   * @return boolean
+   * @static
+   * @access public
+   */
+  public static function ValidateAddress($address) {
+    if (function_exists('filter_var')) { //Introduced in PHP 5.2
+      if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
+        return false;
+      } else {
+        return true;
+      }
+    } else {
+      return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
+    }
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MAIL SENDING
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates message and assigns Mailer. If the message is
+   * not sent successfully then it returns false.  Use the ErrorInfo
+   * variable to view description of the error.
+   * @return bool
+   */
+  public function Send() {
+    try {
+      if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
+        throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
+      }
+
+      // Set whether the message is multipart/alternative
+      if(!empty($this->AltBody)) {
+        $this->ContentType = 'multipart/alternative';
+      }
+
+      $this->error_count = 0; // reset errors
+      $this->SetMessageType();
+      $header = $this->CreateHeader();
+      $body = $this->CreateBody();
+
+      if (empty($this->Body)) {
+        throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL);
+      }
+
+      // digitally sign with DKIM if enabled
+      if ($this->DKIM_domain && $this->DKIM_private) {
+        $header_dkim = $this->DKIM_Add($header,$this->Subject,$body);
+        $header = str_replace("\r\n","\n",$header_dkim) . $header;
+      }
+
+      // Choose the mailer and send through it
+      switch($this->Mailer) {
+        case 'sendmail':
+          return $this->SendmailSend($header, $body);
+        case 'smtp':
+          return $this->SmtpSend($header, $body);
+        default:
+          return $this->MailSend($header, $body);
+      }
+
+    } catch (phpmailerException $e) {
+      $this->SetError($e->getMessage());
+      if ($this->exceptions) {
+        throw $e;
+      }
+      echo $e->getMessage()."\n";
+      return false;
+    }
+  }
+
+  /**
+   * Sends mail using the $Sendmail program.
+   * @param string $header The message headers
+   * @param string $body The message body
+   * @access protected
+   * @return bool
+   */
+  protected function SendmailSend($header, $body) {
+    if ($this->Sender != '') {
+      $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+    } else {
+      $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
+    }
+    if ($this->SingleTo === true) {
+      foreach ($this->SingleToArray as $key => $val) {
+        if(!@$mail = popen($sendmail, 'w')) {
+          throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+        }
+        fputs($mail, "To: " . $val . "\n");
+        fputs($mail, $header);
+        fputs($mail, $body);
+        $result = pclose($mail);
+        // implement call back function if it exists
+        $isSent = ($result == 0) ? 1 : 0;
+        $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
+        if($result != 0) {
+          throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+        }
+      }
+    } else {
+      if(!@$mail = popen($sendmail, 'w')) {
+        throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+      }
+      fputs($mail, $header);
+      fputs($mail, $body);
+      $result = pclose($mail);
+      // implement call back function if it exists
+      $isSent = ($result == 0) ? 1 : 0;
+      $this->doCallback($isSent,$this->to,$this->cc,$this->bcc,$this->Subject,$body);
+      if($result != 0) {
+        throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Sends mail using the PHP mail() function.
+   * @param string $header The message headers
+   * @param string $body The message body
+   * @access protected
+   * @return bool
+   */
+  protected function MailSend($header, $body) {
+    $toArr = array();
+    foreach($this->to as $t) {
+      $toArr[] = $this->AddrFormat($t);
+    }
+    $to = implode(', ', $toArr);
+
+    $params = sprintf("-oi -f %s", $this->Sender);
+    if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) {
+      $old_from = ini_get('sendmail_from');
+      ini_set('sendmail_from', $this->Sender);
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+          // implement call back function if it exists
+          $isSent = ($rt == 1) ? 1 : 0;
+          $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+        // implement call back function if it exists
+        $isSent = ($rt == 1) ? 1 : 0;
+        $this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body);
+      }
+    } else {
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+          // implement call back function if it exists
+          $isSent = ($rt == 1) ? 1 : 0;
+          $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
+        // implement call back function if it exists
+        $isSent = ($rt == 1) ? 1 : 0;
+        $this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body);
+      }
+    }
+    if (isset($old_from)) {
+      ini_set('sendmail_from', $old_from);
+    }
+    if(!$rt) {
+      throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
+    }
+    return true;
+  }
+
+  /**
+   * Sends mail via SMTP using PhpSMTP
+   * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
+   * @param string $header The message headers
+   * @param string $body The message body
+   * @uses SMTP
+   * @access protected
+   * @return bool
+   */
+  protected function SmtpSend($header, $body) {
+    require_once $this->PluginDir . 'class.smtp.php';
+    $bad_rcpt = array();
+
+    if(!$this->SmtpConnect()) {
+      throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL);
+    }
+    $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
+    if(!$this->smtp->Mail($smtp_from)) {
+      throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL);
+    }
+
+    // Attempt to send attach all recipients
+    foreach($this->to as $to) {
+      if (!$this->smtp->Recipient($to[0])) {
+        $bad_rcpt[] = $to[0];
+        // implement call back function if it exists
+        $isSent = 0;
+        $this->doCallback($isSent,$to[0],'','',$this->Subject,$body);
+      } else {
+        // implement call back function if it exists
+        $isSent = 1;
+        $this->doCallback($isSent,$to[0],'','',$this->Subject,$body);
+      }
+    }
+    foreach($this->cc as $cc) {
+      if (!$this->smtp->Recipient($cc[0])) {
+        $bad_rcpt[] = $cc[0];
+        // implement call back function if it exists
+        $isSent = 0;
+        $this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body);
+      } else {
+        // implement call back function if it exists
+        $isSent = 1;
+        $this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body);
+      }
+    }
+    foreach($this->bcc as $bcc) {
+      if (!$this->smtp->Recipient($bcc[0])) {
+        $bad_rcpt[] = $bcc[0];
+        // implement call back function if it exists
+        $isSent = 0;
+        $this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body);
+      } else {
+        // implement call back function if it exists
+        $isSent = 1;
+        $this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body);
+      }
+    }
+
+
+    if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses
+      $badaddresses = implode(', ', $bad_rcpt);
+      throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses);
+    }
+    if(!$this->smtp->Data($header . $body)) {
+      throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL);
+    }
+    if($this->SMTPKeepAlive == true) {
+      $this->smtp->Reset();
+    }
+    return true;
+  }
+
+  /**
+   * Initiates a connection to an SMTP server.
+   * Returns false if the operation failed.
+   * @uses SMTP
+   * @access public
+   * @return bool
+   */
+  public function SmtpConnect() {
+    if(is_null($this->smtp)) {
+      $this->smtp = new SMTP();
+    }
+
+    $this->smtp->do_debug = $this->SMTPDebug;
+    $hosts = explode(';', $this->Host);
+    $index = 0;
+    $connection = $this->smtp->Connected();
+
+    // Retry while there is no connection
+    try {
+      while($index < count($hosts) && !$connection) {
+        $hostinfo = array();
+        if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) {
+          $host = $hostinfo[1];
+          $port = $hostinfo[2];
+        } else {
+          $host = $hosts[$index];
+          $port = $this->Port;
+        }
+
+        $tls = ($this->SMTPSecure == 'tls');
+        $ssl = ($this->SMTPSecure == 'ssl');
+
+        if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {
+
+          $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname());
+          $this->smtp->Hello($hello);
+
+          if ($tls) {
+            if (!$this->smtp->StartTLS()) {
+              throw new phpmailerException($this->Lang('tls'));
+            }
+
+            //We must resend HELO after tls negotiation
+            $this->smtp->Hello($hello);
+          }
+
+          $connection = true;
+          if ($this->SMTPAuth) {
+            if (!$this->smtp->Authenticate($this->Username, $this->Password)) {
+              throw new phpmailerException($this->Lang('authenticate'));
+            }
+          }
+        }
+        $index++;
+        if (!$connection) {
+          throw new phpmailerException($this->Lang('connect_host'));
+        }
+      }
+    } catch (phpmailerException $e) {
+      $this->smtp->Reset();
+      throw $e;
+    }
+    return true;
+  }
+
+  /**
+   * Closes the active SMTP session if one exists.
+   * @return void
+   */
+  public function SmtpClose() {
+    if(!is_null($this->smtp)) {
+      if($this->smtp->Connected()) {
+        $this->smtp->Quit();
+        $this->smtp->Close();
+      }
+    }
+  }
+
+  /**
+  * Sets the language for all class error messages.
+  * Returns false if it cannot load the language file.  The default language is English.
+  * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br")
+  * @param string $lang_path Path to the language file directory
+  * @access public
+  */
+  function SetLanguage($langcode = 'en', $lang_path = 'language/') {
+    //Define full set of translatable strings
+    $PHPMAILER_LANG = array(
+      'provide_address' => 'You must provide at least one recipient email address.',
+      'mailer_not_supported' => ' mailer is not supported.',
+      'execute' => 'Could not execute: ',
+      'instantiate' => 'Could not instantiate mail function.',
+      'authenticate' => 'SMTP Error: Could not authenticate.',
+      'from_failed' => 'The following From address failed: ',
+      'recipients_failed' => 'SMTP Error: The following recipients failed: ',
+      'data_not_accepted' => 'SMTP Error: Data not accepted.',
+      'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
+      'file_access' => 'Could not access file: ',
+      'file_open' => 'File Error: Could not open file: ',
+      'encoding' => 'Unknown encoding: ',
+      'signing' => 'Signing Error: ',
+      'smtp_error' => 'SMTP server error: ',
+      'empty_message' => 'Message body empty',
+      'invalid_address' => 'Invalid address',
+      'variable_set' => 'Cannot set or reset variable: '
+    );
+    //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"!
+    $l = true;
+    if ($langcode != 'en') { //There is no English translation file
+      $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php';
+    }
+    $this->language = $PHPMAILER_LANG;
+    return ($l == true); //Returns false if language not found
+  }
+
+  /**
+  * Return the current array of language strings
+  * @return array
+  */
+  public function GetTranslations() {
+    return $this->language;
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MESSAGE CREATION
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates recipient headers.
+   * @access public
+   * @return string
+   */
+  public function AddrAppend($type, $addr) {
+    $addr_str = $type . ': ';
+    $addresses = array();
+    foreach ($addr as $a) {
+      $addresses[] = $this->AddrFormat($a);
+    }
+    $addr_str .= implode(', ', $addresses);
+    $addr_str .= $this->LE;
+
+    return $addr_str;
+  }
+
+  /**
+   * Formats an address correctly.
+   * @access public
+   * @return string
+   */
+  public function AddrFormat($addr) {
+    if (empty($addr[1])) {
+      return $this->SecureHeader($addr[0]);
+    } else {
+      return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
+    }
+  }
+
+  /**
+   * Wraps message for use with mailers that do not
+   * automatically perform wrapping and for quoted-printable.
+   * Original written by philippe.
+   * @param string $message The message to wrap
+   * @param integer $length The line length to wrap to
+   * @param boolean $qp_mode Whether to run in Quoted-Printable mode
+   * @access public
+   * @return string
+   */
+  public function WrapText($message, $length, $qp_mode = false) {
+    $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
+    // If utf-8 encoding is used, we will need to make sure we don't
+    // split multibyte characters when we wrap
+    $is_utf8 = (strtolower($this->CharSet) == "utf-8");
+
+    $message = $this->FixEOL($message);
+    if (substr($message, -1) == $this->LE) {
+      $message = substr($message, 0, -1);
+    }
+
+    $line = explode($this->LE, $message);
+    $message = '';
+    for ($i=0 ;$i < count($line); $i++) {
+      $line_part = explode(' ', $line[$i]);
+      $buf = '';
+      for ($e = 0; $e<count($line_part); $e++) {
+        $word = $line_part[$e];
+        if ($qp_mode and (strlen($word) > $length)) {
+          $space_left = $length - strlen($buf) - 1;
+          if ($e != 0) {
+            if ($space_left > 20) {
+              $len = $space_left;
+              if ($is_utf8) {
+                $len = $this->UTF8CharBoundary($word, $len);
+              } elseif (substr($word, $len - 1, 1) == "=") {
+                $len--;
+              } elseif (substr($word, $len - 2, 1) == "=") {
+                $len -= 2;
+              }
+              $part = substr($word, 0, $len);
+              $word = substr($word, $len);
+              $buf .= ' ' . $part;
+              $message .= $buf . sprintf("=%s", $this->LE);
+            } else {
+              $message .= $buf . $soft_break;
+            }
+            $buf = '';
+          }
+          while (strlen($word) > 0) {
+            $len = $length;
+            if ($is_utf8) {
+              $len = $this->UTF8CharBoundary($word, $len);
+            } elseif (substr($word, $len - 1, 1) == "=") {
+              $len--;
+            } elseif (substr($word, $len - 2, 1) == "=") {
+              $len -= 2;
+            }
+            $part = substr($word, 0, $len);
+            $word = substr($word, $len);
+
+            if (strlen($word) > 0) {
+              $message .= $part . sprintf("=%s", $this->LE);
+            } else {
+              $buf = $part;
+            }
+          }
+        } else {
+          $buf_o = $buf;
+          $buf .= ($e == 0) ? $word : (' ' . $word);
+
+          if (strlen($buf) > $length and $buf_o != '') {
+            $message .= $buf_o . $soft_break;
+            $buf = $word;
+          }
+        }
+      }
+      $message .= $buf . $this->LE;
+    }
+
+    return $message;
+  }
+
+  /**
+   * Finds last character boundary prior to maxLength in a utf-8
+   * quoted (printable) encoded string.
+   * Original written by Colin Brown.
+   * @access public
+   * @param string $encodedText utf-8 QP text
+   * @param int    $maxLength   find last character boundary prior to this length
+   * @return int
+   */
+  public function UTF8CharBoundary($encodedText, $maxLength) {
+    $foundSplitPos = false;
+    $lookBack = 3;
+    while (!$foundSplitPos) {
+      $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
+      $encodedCharPos = strpos($lastChunk, "=");
+      if ($encodedCharPos !== false) {
+        // Found start of encoded character byte within $lookBack block.
+        // Check the encoded byte value (the 2 chars after the '=')
+        $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
+        $dec = hexdec($hex);
+        if ($dec < 128) { // Single byte character.
+          // If the encoded char was found at pos 0, it will fit
+          // otherwise reduce maxLength to start of the encoded char
+          $maxLength = ($encodedCharPos == 0) ? $maxLength :
+          $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec >= 192) { // First byte of a multi byte character
+          // Reduce maxLength to split at start of character
+          $maxLength = $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
+          $lookBack += 3;
+        }
+      } else {
+        // No encoded character found
+        $foundSplitPos = true;
+      }
+    }
+    return $maxLength;
+  }
+
+
+  /**
+   * Set the body wrapping.
+   * @access public
+   * @return void
+   */
+  public function SetWordWrap() {
+    if($this->WordWrap < 1) {
+      return;
+    }
+
+    switch($this->message_type) {
+      case 'alt':
+      case 'alt_attachments':
+        $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
+        break;
+      default:
+        $this->Body = $this->WrapText($this->Body, $this->WordWrap);
+        break;
+    }
+  }
+
+  /**
+   * Assembles message header.
+   * @access public
+   * @return string The assembled header
+   */
+  public function CreateHeader() {
+    $result = '';
+
+    // Set the boundaries
+    $uniq_id = md5(uniqid(time()));
+    $this->boundary[1] = 'b1_' . $uniq_id;
+    $this->boundary[2] = 'b2_' . $uniq_id;
+
+    $result .= $this->HeaderLine('Date', self::RFCDate());
+    if($this->Sender == '') {
+      $result .= $this->HeaderLine('Return-Path', trim($this->From));
+    } else {
+      $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
+    }
+
+    // To be created automatically by mail()
+    if($this->Mailer != 'mail') {
+      if ($this->SingleTo === true) {
+        foreach($this->to as $t) {
+          $this->SingleToArray[] = $this->AddrFormat($t);
+        }
+      } else {
+        if(count($this->to) > 0) {
+          $result .= $this->AddrAppend('To', $this->to);
+        } elseif (count($this->cc) == 0) {
+          $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
+        }
+      }
+    }
+
+    $from = array();
+    $from[0][0] = trim($this->From);
+    $from[0][1] = $this->FromName;
+    $result .= $this->AddrAppend('From', $from);
+
+    // sendmail and mail() extract Cc from the header before sending
+    if(count($this->cc) > 0) {
+      $result .= $this->AddrAppend('Cc', $this->cc);
+    }
+
+    // sendmail and mail() extract Bcc from the header before sending
+    if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
+      $result .= $this->AddrAppend('Bcc', $this->bcc);
+    }
+
+    if(count($this->ReplyTo) > 0) {
+      $result .= $this->AddrAppend('Reply-to', $this->ReplyTo);
+    }
+
+    // mail() sets the subject itself
+    if($this->Mailer != 'mail') {
+      $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
+    }
+
+    if($this->MessageID != '') {
+      $result .= $this->HeaderLine('Message-ID',$this->MessageID);
+    } else {
+      $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
+    }
+    $result .= $this->HeaderLine('X-Priority', $this->Priority);
+    $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (phpmailer.sourceforge.net)');
+
+    if($this->ConfirmReadingTo != '') {
+      $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
+    }
+
+    // Add custom headers
+    for($index = 0; $index < count($this->CustomHeader); $index++) {
+      $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
+    }
+    if (!$this->sign_key_file) {
+      $result .= $this->HeaderLine('MIME-Version', '1.0');
+      $result .= $this->GetMailMIME();
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns the message MIME.
+   * @access public
+   * @return string
+   */
+  public function GetMailMIME() {
+    $result = '';
+    switch($this->message_type) {
+      case 'plain':
+        $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
+        $result .= sprintf("Content-Type: %s; charset=%s", $this->ContentType, $this->CharSet);
+        break;
+      case 'attachments':
+      case 'alt_attachments':
+        if($this->InlineImageExists()){
+          $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
+        } else {
+          $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
+          $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        }
+        break;
+      case 'alt':
+        $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
+        $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        break;
+    }
+
+    if($this->Mailer != 'mail') {
+      $result .= $this->LE.$this->LE;
+    }
+
+    return $result;
+  }
+
+  /**
+   * Assembles the message body.  Returns an empty string on failure.
+   * @access public
+   * @return string The assembled message body
+   */
+  public function CreateBody() {
+    $body = '';
+
+    if ($this->sign_key_file) {
+      $body .= $this->GetMailMIME();
+    }
+
+    $this->SetWordWrap();
+
+    switch($this->message_type) {
+      case 'alt':
+        $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
+        $body .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $body .= $this->LE.$this->LE;
+        $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
+        $body .= $this->EncodeString($this->Body, $this->Encoding);
+        $body .= $this->LE.$this->LE;
+        $body .= $this->EndBoundary($this->boundary[1]);
+        break;
+      case 'plain':
+        $body .= $this->EncodeString($this->Body, $this->Encoding);
+        break;
+      case 'attachments':
+        $body .= $this->GetBoundary($this->boundary[1], '', '', '');
+        $body .= $this->EncodeString($this->Body, $this->Encoding);
+        $body .= $this->LE;
+        $body .= $this->AttachAll();
+        break;
+      case 'alt_attachments':
+        $body .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+        $body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
+        $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
+        $body .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $body .= $this->LE.$this->LE;
+        $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
+        $body .= $this->EncodeString($this->Body, $this->Encoding);
+        $body .= $this->LE.$this->LE;
+        $body .= $this->EndBoundary($this->boundary[2]);
+        $body .= $this->AttachAll();
+        break;
+    }
+
+    if ($this->IsError()) {
+      $body = '';
+    } elseif ($this->sign_key_file) {
+      try {
+        $file = tempnam('', 'mail');
+        file_put_contents($file, $body); //TODO check this worked
+        $signed = tempnam("", "signed");
+        if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) {
+          @unlink($file);
+          @unlink($signed);
+          $body = file_get_contents($signed);
+        } else {
+          @unlink($file);
+          @unlink($signed);
+          throw new phpmailerException($this->Lang("signing").openssl_error_string());
+        }
+      } catch (phpmailerException $e) {
+        $body = '';
+        if ($this->exceptions) {
+          throw $e;
+        }
+      }
+    }
+
+    return $body;
+  }
+
+  /**
+   * Returns the start of a message boundary.
+   * @access private
+   */
+  private function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+    $result = '';
+    if($charSet == '') {
+      $charSet = $this->CharSet;
+    }
+    if($contentType == '') {
+      $contentType = $this->ContentType;
+    }
+    if($encoding == '') {
+      $encoding = $this->Encoding;
+    }
+    $result .= $this->TextLine('--' . $boundary);
+    $result .= sprintf("Content-Type: %s; charset=%s", $contentType, $charSet);
+    $result .= $this->LE;
+    $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
+    $result .= $this->LE;
+
+    return $result;
+  }
+
+  /**
+   * Returns the end of a message boundary.
+   * @access private
+   */
+  private function EndBoundary($boundary) {
+    return $this->LE . '--' . $boundary . '--' . $this->LE;
+  }
+
+  /**
+   * Sets the message type.
+   * @access private
+   * @return void
+   */
+  private function SetMessageType() {
+    if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
+      $this->message_type = 'plain';
+    } else {
+      if(count($this->attachment) > 0) {
+        $this->message_type = 'attachments';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
+        $this->message_type = 'alt';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
+        $this->message_type = 'alt_attachments';
+      }
+    }
+  }
+
+  /**
+   *  Returns a formatted header line.
+   * @access public
+   * @return string
+   */
+  public function HeaderLine($name, $value) {
+    return $name . ': ' . $value . $this->LE;
+  }
+
+  /**
+   * Returns a formatted mail line.
+   * @access public
+   * @return string
+   */
+  public function TextLine($value) {
+    return $value . $this->LE;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, ATTACHMENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds an attachment from a path on the filesystem.
+   * Returns false if the file could not be found
+   * or accessed.
+   * @param string $path Path to the attachment.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+    try {
+      if ( !@is_file($path) ) {
+        throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE);
+      }
+      $filename = basename($path);
+      if ( $name == '' ) {
+        $name = $filename;
+      }
+
+      $this->attachment[] = array(
+        0 => $path,
+        1 => $filename,
+        2 => $name,
+        3 => $encoding,
+        4 => $type,
+        5 => false,  // isStringAttachment
+        6 => 'attachment',
+        7 => 0
+      );
+
+    } catch (phpmailerException $e) {
+      $this->SetError($e->getMessage());
+      if ($this->exceptions) {
+        throw $e;
+      }
+      echo $e->getMessage()."\n";
+      if ( $e->getCode() == self::STOP_CRITICAL ) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+  * Return the current array of attachments
+  * @return array
+  */
+  public function GetAttachments() {
+    return $this->attachment;
+  }
+
+  /**
+   * Attaches all fs, string, and binary attachments to the message.
+   * Returns an empty string on failure.
+   * @access private
+   * @return string
+   */
+  private function AttachAll() {
+    // Return text of body
+    $mime = array();
+    $cidUniq = array();
+    $incl = array();
+
+    // Add all attachments
+    foreach ($this->attachment as $attachment) {
+      // Check for string attachment
+      $bString = $attachment[5];
+      if ($bString) {
+        $string = $attachment[0];
+      } else {
+        $path = $attachment[0];
+      }
+
+      if (in_array($attachment[0], $incl)) { continue; }
+      $filename    = $attachment[1];
+      $name        = $attachment[2];
+      $encoding    = $attachment[3];
+      $type        = $attachment[4];
+      $disposition = $attachment[6];
+      $cid         = $attachment[7];
+      $incl[]      = $attachment[0];
+      if ( $disposition == 'inline' && isset($cidUniq[$cid]) ) { continue; }
+      $cidUniq[$cid] = true;
+
+      $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
+      $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
+      $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
+
+      if($disposition == 'inline') {
+        $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
+      }
+
+      $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
+
+      // Encode as string attachment
+      if($bString) {
+        $mime[] = $this->EncodeString($string, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      } else {
+        $mime[] = $this->EncodeFile($path, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      }
+    }
+
+    $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
+
+    return join('', $mime);
+  }
+
+  /**
+   * Encodes attachment in requested format.
+   * Returns an empty string on failure.
+   * @param string $path The full path to the file
+   * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
+   * @see EncodeFile()
+   * @access private
+   * @return string
+   */
+  private function EncodeFile($path, $encoding = 'base64') {
+    try {
+      if (!is_readable($path)) {
+        throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
+      }
+      if (!function_exists('get_magic_quotes')) {
+        function get_magic_quotes() {
+          return false;
+        }
+      }
+      if (PHP_VERSION < 6
+                         AND $magic_quotes = get_magic_quotes_runtime()) {
+        set_magic_quotes_runtime(0);
+      }
+      $file_buffer  = file_get_contents($path);
+      $file_buffer  = $this->EncodeString($file_buffer, $encoding);
+      if (PHP_VERSION < 6 AND $magic_quotes) { set_magic_quotes_runtime($magic_quotes); }
+      return $file_buffer;
+    } catch (Exception $e) {
+      $this->SetError($e->getMessage());
+      return '';
+    }
+  }
+
+  /**
+   * Encodes string to requested format.
+   * Returns an empty string on failure.
+   * @param string $str The text to encode
+   * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
+   * @access public
+   * @return string
+   */
+  public function EncodeString ($str, $encoding = 'base64') {
+    $encoded = '';
+    switch(strtolower($encoding)) {
+      case 'base64':
+        $encoded = chunk_split(base64_encode($str), 76, $this->LE);
+        break;
+      case '7bit':
+      case '8bit':
+        $encoded = $this->FixEOL($str);
+        //Make sure it ends with a line break
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+          $encoded .= $this->LE;
+        break;
+      case 'binary':
+        $encoded = $str;
+        break;
+      case 'quoted-printable':
+        $encoded = $this->EncodeQP($str);
+        break;
+      default:
+        $this->SetError($this->Lang('encoding') . $encoding);
+        break;
+    }
+    return $encoded;
+  }
+
+  /**
+   * Encode a header string to best (shortest) of Q, B, quoted or none.
+   * @access public
+   * @return string
+   */
+  public function EncodeHeader($str, $position = 'text') {
+    $x = 0;
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        if (!preg_match('/[\200-\377]/', $str)) {
+          // Can't use addslashes as we don't know what value has magic_quotes_sybase
+          $encoded = addcslashes($str, "\0..\37\177\\\"");
+          if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
+            return ($encoded);
+          } else {
+            return ("\"$encoded\"");
+          }
+        }
+        $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+        break;
+      case 'comment':
+        $x = preg_match_all('/[()"]/', $str, $matches);
+        // Fall-through
+      case 'text':
+      default:
+        $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+        break;
+    }
+
+    if ($x == 0) {
+      return ($str);
+    }
+
+    $maxlen = 75 - 7 - strlen($this->CharSet);
+    // Try to select the encoding which should produce the shortest output
+    if (strlen($str)/3 < $x) {
+      $encoding = 'B';
+      if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
+        // Use a custom function which correctly encodes and wraps long
+        // multibyte strings without breaking lines within a character
+        $encoded = $this->Base64EncodeWrapMB($str);
+      } else {
+        $encoded = base64_encode($str);
+        $maxlen -= $maxlen % 4;
+        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
+      }
+    } else {
+      $encoding = 'Q';
+      $encoded = $this->EncodeQ($str, $position);
+      $encoded = $this->WrapText($encoded, $maxlen, true);
+      $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
+    }
+
+    $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
+    $encoded = trim(str_replace("\n", $this->LE, $encoded));
+
+    return $encoded;
+  }
+
+  /**
+   * Checks if a string contains multibyte characters.
+   * @access public
+   * @param string $str multi-byte text to wrap encode
+   * @return bool
+   */
+  public function HasMultiBytes($str) {
+    if (function_exists('mb_strlen')) {
+      return (strlen($str) > mb_strlen($str, $this->CharSet));
+    } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
+      return false;
+    }
+  }
+
+  /**
+   * Correctly encodes and wraps long multibyte strings for mail headers
+   * without breaking lines within a character.
+   * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
+   * @access public
+   * @param string $str multi-byte text to wrap encode
+   * @return string
+   */
+  public function Base64EncodeWrapMB($str) {
+    $start = "=?".$this->CharSet."?B?";
+    $end = "?=";
+    $encoded = "";
+
+    $mb_length = mb_strlen($str, $this->CharSet);
+    // Each line must have length <= 75, including $start and $end
+    $length = 75 - strlen($start) - strlen($end);
+    // Average multi-byte ratio
+    $ratio = $mb_length / strlen($str);
+    // Base64 has a 4:3 ratio
+    $offset = $avgLength = floor($length * $ratio * .75);
+
+    for ($i = 0; $i < $mb_length; $i += $offset) {
+      $lookBack = 0;
+
+      do {
+        $offset = $avgLength - $lookBack;
+        $chunk = mb_substr($str, $i, $offset, $this->CharSet);
+        $chunk = base64_encode($chunk);
+        $lookBack++;
+      }
+      while (strlen($chunk) > $length);
+
+      $encoded .= $chunk . $this->LE;
+    }
+
+    // Chomp the last linefeed
+    $encoded = substr($encoded, 0, -strlen($this->LE));
+    return $encoded;
+  }
+
+  /**
+  * Encode string to quoted-printable.
+  * Only uses standard PHP, slow, but will always work
+  * @access public
+  * @param string $string the text to encode
+  * @param integer $line_max Number of chars allowed on a line before wrapping
+  * @return string
+  */
+  public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) {
+    $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
+    $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
+    $eol = "\r\n";
+    $escape = '=';
+    $output = '';
+    while( list(, $line) = each($lines) ) {
+      $linlen = strlen($line);
+      $newline = '';
+      for($i = 0; $i < $linlen; $i++) {
+        $c = substr( $line, $i, 1 );
+        $dec = ord( $c );
+        if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
+          $c = '=2E';
+        }
+        if ( $dec == 32 ) {
+          if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
+            $c = '=20';
+          } else if ( $space_conv ) {
+            $c = '=20';
+          }
+        } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
+          $h2 = floor($dec/16);
+          $h1 = floor($dec%16);
+          $c = $escape.$hex[$h2].$hex[$h1];
+        }
+        if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
+          $output .= $newline.$escape.$eol; //  soft line break; " =\r\n" is okay
+          $newline = '';
+          // check if newline first character will be point or not
+          if ( $dec == 46 ) {
+            $c = '=2E';
+          }
+        }
+        $newline .= $c;
+      } // end of for
+      $output .= $newline.$eol;
+    } // end of while
+    return $output;
+  }
+
+  /**
+  * Encode string to RFC2045 (6.7) quoted-printable format
+  * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version
+  * Also results in same content as you started with after decoding
+  * @see EncodeQPphp()
+  * @access public
+  * @param string $string the text to encode
+  * @param integer $line_max Number of chars allowed on a line before wrapping
+  * @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function
+  * @return string
+  * @author Marcus Bointon
+  */
+  public function EncodeQP($string, $line_max = 76, $space_conv = false) {
+    if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3)
+      return quoted_printable_encode($string);
+    }
+    $filters = stream_get_filters();
+    if (!in_array('convert.*', $filters)) { //Got convert stream filter?
+      return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation
+    }
+    $fp = fopen('php://temp/', 'r+');
+    $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks
+    $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE);
+    $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params);
+    fputs($fp, $string);
+    rewind($fp);
+    $out = stream_get_contents($fp);
+    stream_filter_remove($s);
+    $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange
+    fclose($fp);
+    return $out;
+  }
+
+  /**
+   * Encode string to q encoding.
+   * @link http://tools.ietf.org/html/rfc2047
+   * @param string $str the text to encode
+   * @param string $position Where the text is going to be used, see the RFC for what that means
+   * @access public
+   * @return string
+   */
+  public function EncodeQ ($str, $position = 'text') {
+    // There should not be any EOL in the string
+    $encoded = preg_replace('/[\r\n]*/', '', $str);
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+      case 'comment':
+        $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+      case 'text':
+      default:
+        // Replace every high ascii, control =, ? and _ characters
+        //TODO using /e (equivalent to eval()) is probably not a good idea
+        $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
+              "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+    }
+
+    // Replace every spaces to _ (more readable than =20)
+    $encoded = str_replace(' ', '_', $encoded);
+
+    return $encoded;
+  }
+
+  /**
+   * Adds a string or binary attachment (non-filesystem) to the list.
+   * This method can be used to attach ascii or binary data,
+   * such as a BLOB record from a database.
+   * @param string $string String attachment data.
+   * @param string $filename Name of the attachment.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return void
+   */
+  public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
+    // Append to $attachment array
+    $this->attachment[] = array(
+      0 => $string,
+      1 => $filename,
+      2 => basename($filename),
+      3 => $encoding,
+      4 => $type,
+      5 => true,  // isStringAttachment
+      6 => 'attachment',
+      7 => 0
+    );
+  }
+
+  /**
+   * Adds an embedded attachment.  This can include images, sounds, and
+   * just about any other document.  Make sure to set the $type to an
+   * image type.  For JPEG images use "image/jpeg" and for GIF images
+   * use "image/gif".
+   * @param string $path Path to the attachment.
+   * @param string $cid Content ID of the attachment.  Use this to identify
+   *        the Id for accessing the image in an HTML form.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+
+    if ( !@is_file($path) ) {
+      $this->SetError($this->Lang('file_access') . $path);
+      return false;
+    }
+
+    $filename = basename($path);
+    if ( $name == '' ) {
+      $name = $filename;
+    }
+
+    // Append to $attachment array
+    $this->attachment[] = array(
+      0 => $path,
+      1 => $filename,
+      2 => $name,
+      3 => $encoding,
+      4 => $type,
+      5 => false,  // isStringAttachment
+      6 => 'inline',
+      7 => $cid
+    );
+
+    return true;
+  }
+
+  /**
+   * Returns true if an inline attachment is present.
+   * @access public
+   * @return bool
+   */
+  public function InlineImageExists() {
+    foreach($this->attachment as $attachment) {
+      if ($attachment[6] == 'inline') {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MESSAGE RESET
+  /////////////////////////////////////////////////
+
+  /**
+   * Clears all recipients assigned in the TO array.  Returns void.
+   * @return void
+   */
+  public function ClearAddresses() {
+    foreach($this->to as $to) {
+      unset($this->all_recipients[strtolower($to[0])]);
+    }
+    $this->to = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the CC array.  Returns void.
+   * @return void
+   */
+  public function ClearCCs() {
+    foreach($this->cc as $cc) {
+      unset($this->all_recipients[strtolower($cc[0])]);
+    }
+    $this->cc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the BCC array.  Returns void.
+   * @return void
+   */
+  public function ClearBCCs() {
+    foreach($this->bcc as $bcc) {
+      unset($this->all_recipients[strtolower($bcc[0])]);
+    }
+    $this->bcc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the ReplyTo array.  Returns void.
+   * @return void
+   */
+  public function ClearReplyTos() {
+    $this->ReplyTo = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the TO, CC and BCC
+   * array.  Returns void.
+   * @return void
+   */
+  public function ClearAllRecipients() {
+    $this->to = array();
+    $this->cc = array();
+    $this->bcc = array();
+    $this->all_recipients = array();
+  }
+
+  /**
+   * Clears all previously set filesystem, string, and binary
+   * attachments.  Returns void.
+   * @return void
+   */
+  public function ClearAttachments() {
+    $this->attachment = array();
+  }
+
+  /**
+   * Clears all custom headers.  Returns void.
+   * @return void
+   */
+  public function ClearCustomHeaders() {
+    $this->CustomHeader = array();
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MISCELLANEOUS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds the error message to the error container.
+   * @access protected
+   * @return void
+   */
+  protected function SetError($msg) {
+    $this->error_count++;
+    if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
+      $lasterror = $this->smtp->getError();
+      if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) {
+        $msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n";
+      }
+    }
+    $this->ErrorInfo = $msg;
+  }
+
+  /**
+   * Returns the proper RFC 822 formatted date.
+   * @access public
+   * @return string
+   * @static
+   */
+  public static function RFCDate() {
+    $tz = date('Z');
+    $tzs = ($tz < 0) ? '-' : '+';
+    $tz = abs($tz);
+    $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
+    $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
+
+    return $result;
+  }
+
+  /**
+   * Returns the server hostname or 'localhost.localdomain' if unknown.
+   * @access private
+   * @return string
+   */
+  private function ServerHostname() {
+    if (!empty($this->Hostname)) {
+      $result = $this->Hostname;
+    } elseif (isset($_SERVER['SERVER_NAME'])) {
+      $result = $_SERVER['SERVER_NAME'];
+    } else {
+      $result = 'localhost.localdomain';
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns a message in the appropriate language.
+   * @access private
+   * @return string
+   */
+  private function Lang($key) {
+    if(count($this->language) < 1) {
+      $this->SetLanguage('en'); // set the default language
+    }
+
+    if(isset($this->language[$key])) {
+      return $this->language[$key];
+    } else {
+      return 'Language string failed to load: ' . $key;
+    }
+  }
+
+  /**
+   * Returns true if an error occurred.
+   * @access public
+   * @return bool
+   */
+  public function IsError() {
+    return ($this->error_count > 0);
+  }
+
+  /**
+   * Changes every end of line from CR or LF to CRLF.
+   * @access private
+   * @return string
+   */
+  private function FixEOL($str) {
+    $str = str_replace("\r\n", "\n", $str);
+    $str = str_replace("\r", "\n", $str);
+    $str = str_replace("\n", $this->LE, $str);
+    return $str;
+  }
+
+  /**
+   * Adds a custom header.
+   * @access public
+   * @return void
+   */
+  public function AddCustomHeader($custom_header) {
+    $this->CustomHeader[] = explode(':', $custom_header, 2);
+  }
+
+  /**
+   * Evaluates the message and returns modifications for inline images and backgrounds
+   * @access public
+   * @return $message
+   */
+  public function MsgHTML($message, $basedir = '') {
+    preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
+    if(isset($images[2])) {
+      foreach($images[2] as $i => $url) {
+        // do not change urls for absolute images (thanks to corvuscorax)
+        if (!preg_match('#^[A-z]+://#',$url)) {
+          $filename = basename($url);
+          $directory = dirname($url);
+          ($directory == '.')?$directory='':'';
+          $cid = 'cid:' . md5($filename);
+          $ext = pathinfo($filename, PATHINFO_EXTENSION);
+          $mimeType  = self::_mime_types($ext);
+          if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
+          if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
+          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
+            $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
+          }
+        }
+      }
+    }
+    $this->IsHTML(true);
+    $this->Body = $message;
+    $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
+    if (!empty($textMsg) && empty($this->AltBody)) {
+      $this->AltBody = html_entity_decode($textMsg,ENT_COMPAT | ENT_HTML401, strtoupper($this->CharSet));
+    }
+    if (empty($this->AltBody)) {
+      $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n";
+    }
+  }
+
+  /**
+   * Gets the MIME type of the embedded or inline image
+   * @param string File extension
+   * @access public
+   * @return string MIME type of ext
+   * @static
+   */
+  public static function _mime_types($ext = '') {
+    $mimes = array(
+      'hqx'   =>  'application/mac-binhex40',
+      'cpt'   =>  'application/mac-compactpro',
+      'doc'   =>  'application/msword',
+      'bin'   =>  'application/macbinary',
+      'dms'   =>  'application/octet-stream',
+      'lha'   =>  'application/octet-stream',
+      'lzh'   =>  'application/octet-stream',
+      'exe'   =>  'application/octet-stream',
+      'class' =>  'application/octet-stream',
+      'psd'   =>  'application/octet-stream',
+      'so'    =>  'application/octet-stream',
+      'sea'   =>  'application/octet-stream',
+      'dll'   =>  'application/octet-stream',
+      'oda'   =>  'application/oda',
+      'pdf'   =>  'application/pdf',
+      'ai'    =>  'application/postscript',
+      'eps'   =>  'application/postscript',
+      'ps'    =>  'application/postscript',
+      'smi'   =>  'application/smil',
+      'smil'  =>  'application/smil',
+      'mif'   =>  'application/vnd.mif',
+      'xls'   =>  'application/vnd.ms-excel',
+      'ppt'   =>  'application/vnd.ms-powerpoint',
+      'wbxml' =>  'application/vnd.wap.wbxml',
+      'wmlc'  =>  'application/vnd.wap.wmlc',
+      'dcr'   =>  'application/x-director',
+      'dir'   =>  'application/x-director',
+      'dxr'   =>  'application/x-director',
+      'dvi'   =>  'application/x-dvi',
+      'gtar'  =>  'application/x-gtar',
+      'php'   =>  'application/x-httpd-php',
+      'php4'  =>  'application/x-httpd-php',
+      'php3'  =>  'application/x-httpd-php',
+      'phtml' =>  'application/x-httpd-php',
+      'phps'  =>  'application/x-httpd-php-source',
+      'js'    =>  'application/x-javascript',
+      'swf'   =>  'application/x-shockwave-flash',
+      'sit'   =>  'application/x-stuffit',
+      'tar'   =>  'application/x-tar',
+      'tgz'   =>  'application/x-tar',
+      'xhtml' =>  'application/xhtml+xml',
+      'xht'   =>  'application/xhtml+xml',
+      'zip'   =>  'application/zip',
+      'mid'   =>  'audio/midi',
+      'midi'  =>  'audio/midi',
+      'mpga'  =>  'audio/mpeg',
+      'mp2'   =>  'audio/mpeg',
+      'mp3'   =>  'audio/mpeg',
+      'aif'   =>  'audio/x-aiff',
+      'aiff'  =>  'audio/x-aiff',
+      'aifc'  =>  'audio/x-aiff',
+      'ram'   =>  'audio/x-pn-realaudio',
+      'rm'    =>  'audio/x-pn-realaudio',
+      'rpm'   =>  'audio/x-pn-realaudio-plugin',
+      'ra'    =>  'audio/x-realaudio',
+      'rv'    =>  'video/vnd.rn-realvideo',
+      'wav'   =>  'audio/x-wav',
+      'bmp'   =>  'image/bmp',
+      'gif'   =>  'image/gif',
+      'jpeg'  =>  'image/jpeg',
+      'jpg'   =>  'image/jpeg',
+      'jpe'   =>  'image/jpeg',
+      'png'   =>  'image/png',
+      'tiff'  =>  'image/tiff',
+      'tif'   =>  'image/tiff',
+      'css'   =>  'text/css',
+      'html'  =>  'text/html',
+      'htm'   =>  'text/html',
+      'shtml' =>  'text/html',
+      'txt'   =>  'text/plain',
+      'text'  =>  'text/plain',
+      'log'   =>  'text/plain',
+      'rtx'   =>  'text/richtext',
+      'rtf'   =>  'text/rtf',
+      'xml'   =>  'text/xml',
+      'xsl'   =>  'text/xml',
+      'mpeg'  =>  'video/mpeg',
+      'mpg'   =>  'video/mpeg',
+      'mpe'   =>  'video/mpeg',
+      'qt'    =>  'video/quicktime',
+      'mov'   =>  'video/quicktime',
+      'avi'   =>  'video/x-msvideo',
+      'movie' =>  'video/x-sgi-movie',
+      'doc'   =>  'application/msword',
+      'word'  =>  'application/msword',
+      'xl'    =>  'application/excel',
+      'eml'   =>  'message/rfc822'
+    );
+    return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
+  }
+
+  /**
+  * Set (or reset) Class Objects (variables)
+  *
+  * Usage Example:
+  * $page->set('X-Priority', '3');
+  *
+  * @access public
+  * @param string $name Parameter Name
+  * @param mixed $value Parameter Value
+  * NOTE: will not work with arrays, there are no arrays to set/reset
+  * @todo Should this not be using __set() magic function?
+  */
+  public function set($name, $value = '') {
+    try {
+      if (isset($this->$name) ) {
+        $this->$name = $value;
+      } else {
+        throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL);
+      }
+    } catch (Exception $e) {
+      $this->SetError($e->getMessage());
+      if ($e->getCode() == self::STOP_CRITICAL) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Strips newlines to prevent header injection.
+   * @access public
+   * @param string $str String
+   * @return string
+   */
+  public function SecureHeader($str) {
+    $str = str_replace("\r", '', $str);
+    $str = str_replace("\n", '', $str);
+    return trim($str);
+  }
+
+  /**
+   * Set the private key file and password to sign the message.
+   *
+   * @access public
+   * @param string $key_filename Parameter File Name
+   * @param string $key_pass Password for private key
+   */
+  public function Sign($cert_filename, $key_filename, $key_pass) {
+    $this->sign_cert_file = $cert_filename;
+    $this->sign_key_file = $key_filename;
+    $this->sign_key_pass = $key_pass;
+  }
+
+  /**
+   * Set the private key file and password to sign the message.
+   *
+   * @access public
+   * @param string $key_filename Parameter File Name
+   * @param string $key_pass Password for private key
+   */
+  public function DKIM_QP($txt) {
+    $tmp="";
+    $line="";
+    for ($i=0;$i<strlen($txt);$i++) {
+      $ord=ord($txt[$i]);
+      if ( ((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E)) ) {
+        $line.=$txt[$i];
+      } else {
+        $line.="=".sprintf("%02X",$ord);
+      }
+    }
+    return $line;
+  }
+
+  /**
+   * Generate DKIM signature
+   *
+   * @access public
+   * @param string $s Header
+   */
+  public function DKIM_Sign($s) {
+    $privKeyStr = file_get_contents($this->DKIM_private);
+    if ($this->DKIM_passphrase!='') {
+      $privKey = openssl_pkey_get_private($privKeyStr,$this->DKIM_passphrase);
+    } else {
+      $privKey = $privKeyStr;
+    }
+    if (openssl_sign($s, $signature, $privKey)) {
+      return base64_encode($signature);
+    }
+  }
+
+  /**
+   * Generate DKIM Canonicalization Header
+   *
+   * @access public
+   * @param string $s Header
+   */
+  public function DKIM_HeaderC($s) {
+    $s=preg_replace("/\r\n\s+/"," ",$s);
+    $lines=explode("\r\n",$s);
+    foreach ($lines as $key=>$line) {
+      list($heading,$value)=explode(":",$line,2);
+      $heading=strtolower($heading);
+      $value=preg_replace("/\s+/"," ",$value) ; // Compress useless spaces
+      $lines[$key]=$heading.":".trim($value) ; // Don't forget to remove WSP around the value
+    }
+    $s=implode("\r\n",$lines);
+    return $s;
+  }
+
+  /**
+   * Generate DKIM Canonicalization Body
+   *
+   * @access public
+   * @param string $body Message Body
+   */
+  public function DKIM_BodyC($body) {
+    if ($body == '') return "\r\n";
+    // stabilize line endings
+    $body=str_replace("\r\n","\n",$body);
+    $body=str_replace("\n","\r\n",$body);
+    // END stabilize line endings
+    while (substr($body,strlen($body)-4,4) == "\r\n\r\n") {
+      $body=substr($body,0,strlen($body)-2);
+    }
+    return $body;
+  }
+
+  /**
+   * Create the DKIM header, body, as new header
+   *
+   * @access public
+   * @param string $headers_line Header lines
+   * @param string $subject Subject
+   * @param string $body Body
+   */
+  public function DKIM_Add($headers_line,$subject,$body) {
+    $DKIMsignatureType    = 'rsa-sha1'; // Signature & hash algorithms
+    $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
+    $DKIMquery            = 'dns/txt'; // Query method
+    $DKIMtime             = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
+    $subject_header       = "Subject: $subject";
+    $headers              = explode("\r\n",$headers_line);
+    foreach($headers as $header) {
+      if (strpos($header,'From:') === 0) {
+        $from_header=$header;
+      } elseif (strpos($header,'To:') === 0) {
+        $to_header=$header;
+      }
+    }
+    $from     = str_replace('|','=7C',$this->DKIM_QP($from_header));
+    $to       = str_replace('|','=7C',$this->DKIM_QP($to_header));
+    $subject  = str_replace('|','=7C',$this->DKIM_QP($subject_header)) ; // Copied header fields (dkim-quoted-printable
+    $body     = $this->DKIM_BodyC($body);
+    $DKIMlen  = strlen($body) ; // Length of body
+    $DKIMb64  = base64_encode(pack("H*", sha1($body))) ; // Base64 of packed binary SHA-1 hash of body
+    $ident    = ($this->DKIM_identity == '')? '' : " i=" . $this->DKIM_identity . ";";
+    $dkimhdrs = "DKIM-Signature: v=1; a=" . $DKIMsignatureType . "; q=" . $DKIMquery . "; l=" . $DKIMlen . "; s=" . $this->DKIM_selector . ";\r\n".
+                "\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n".
+                "\th=From:To:Subject;\r\n".
+                "\td=" . $this->DKIM_domain . ";" . $ident . "\r\n".
+                "\tz=$from\r\n".
+                "\t|$to\r\n".
+                "\t|$subject;\r\n".
+                "\tbh=" . $DKIMb64 . ";\r\n".
+                "\tb=";
+    $toSign   = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs);
+    $signed   = $this->DKIM_Sign($toSign);
+    return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n";
+  }
+
+  protected function doCallback($isSent,$to,$cc,$bcc,$subject,$body) {
+    if (!empty($this->action_function) && function_exists($this->action_function)) {
+      $params = array($isSent,$to,$cc,$bcc,$subject,$body);
+      call_user_func_array($this->action_function,$params);
+    }
+  }
+}
+
+class phpmailerException extends Exception {
+  public function errorMessage() {
+    $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
+    return $errorMsg;
+  }
+}
+?>
diff --git a/www/plugins/facteur/phpmailer-php5/class.pop3.php b/www/plugins/facteur/phpmailer-php5/class.pop3.php
new file mode 100755 (executable)
index 0000000..f9fd3b2
--- /dev/null
@@ -0,0 +1,407 @@
+<?php
+/*~ class.pop3.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 5.1                                                            |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|     Admin: Andy Prevost (project admininistrator)                         |
+|   Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
+|          : Marcus Bointon (coolbru) coolbru@users.sourceforge.net         |
+|   Founder: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+*/
+
+/**
+ * PHPMailer - PHP POP Before SMTP Authentication Class
+ * NOTE: Designed for use with PHP version 5 and up
+ * @package PHPMailer
+ * @author Andy Prevost
+ * @author Marcus Bointon
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
+ * @version $Id: class.pop3.php 444 2009-05-05 11:22:26Z coolbru $
+ */
+
+/**
+ * POP Before SMTP Authentication Class
+ * Version 5.0.0
+ *
+ * Author: Richard Davey (rich@corephp.co.uk)
+ * Modifications: Andy Prevost
+ * License: LGPL, see PHPMailer License
+ *
+ * Specifically for PHPMailer to allow POP before SMTP authentication.
+ * Does not yet work with APOP - if you have an APOP account, contact Richard Davey
+ * and we can test changes to this script.
+ *
+ * This class is based on the structure of the SMTP class originally authored by Chris Ryan
+ *
+ * This class is rfc 1939 compliant and implements all the commands
+ * required for POP3 connection, authentication and disconnection.
+ *
+ * @package PHPMailer
+ * @author Richard Davey
+ */
+
+class POP3 {
+  /**
+   * Default POP3 port
+   * @var int
+   */
+  public $POP3_PORT = 110;
+
+  /**
+   * Default Timeout
+   * @var int
+   */
+  public $POP3_TIMEOUT = 30;
+
+  /**
+   * POP3 Carriage Return + Line Feed
+   * @var string
+   */
+  public $CRLF = "\r\n";
+
+  /**
+   * Displaying Debug warnings? (0 = now, 1+ = yes)
+   * @var int
+   */
+  public $do_debug = 2;
+
+  /**
+   * POP3 Mail Server
+   * @var string
+   */
+  public $host;
+
+  /**
+   * POP3 Port
+   * @var int
+   */
+  public $port;
+
+  /**
+   * POP3 Timeout Value
+   * @var int
+   */
+  public $tval;
+
+  /**
+   * POP3 Username
+   * @var string
+   */
+  public $username;
+
+  /**
+   * POP3 Password
+   * @var string
+   */
+  public $password;
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PRIVATE AND PROTECTED
+  /////////////////////////////////////////////////
+
+  private $pop_conn;
+  private $connected;
+  private $error;     //  Error log array
+
+  /**
+   * Constructor, sets the initial values
+   * @access public
+   * @return POP3
+   */
+  public function __construct() {
+    $this->pop_conn  = 0;
+    $this->connected = false;
+    $this->error     = null;
+  }
+
+  /**
+   * Combination of public events - connect, login, disconnect
+   * @access public
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @param string $username
+   * @param string $password
+   */
+  public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
+    $this->host = $host;
+
+    //  If no port value is passed, retrieve it
+    if ($port == false) {
+      $this->port = $this->POP3_PORT;
+    } else {
+      $this->port = $port;
+    }
+
+    //  If no port value is passed, retrieve it
+    if ($tval == false) {
+      $this->tval = $this->POP3_TIMEOUT;
+    } else {
+      $this->tval = $tval;
+    }
+
+    $this->do_debug = $debug_level;
+    $this->username = $username;
+    $this->password = $password;
+
+    //  Refresh the error log
+    $this->error = null;
+
+    //  Connect
+    $result = $this->Connect($this->host, $this->port, $this->tval);
+
+    if ($result) {
+      $login_result = $this->Login($this->username, $this->password);
+
+      if ($login_result) {
+        $this->Disconnect();
+
+        return true;
+      }
+
+    }
+
+    //  We need to disconnect regardless if the login succeeded
+    $this->Disconnect();
+
+    return false;
+  }
+
+  /**
+   * Connect to the POP3 server
+   * @access public
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @return boolean
+   */
+  public function Connect ($host, $port = false, $tval = 30) {
+    //  Are we already connected?
+    if ($this->connected) {
+      return true;
+    }
+
+    /*
+    On Windows this will raise a PHP Warning error if the hostname doesn't exist.
+    Rather than supress it with @fsockopen, let's capture it cleanly instead
+    */
+
+    set_error_handler(array(&$this, 'catchWarning'));
+
+    //  Connect to the POP3 server
+    $this->pop_conn = fsockopen($host,    //  POP3 Host
+                  $port,    //  Port #
+                  $errno,   //  Error Number
+                  $errstr,  //  Error Message
+                  $tval);   //  Timeout (seconds)
+
+    //  Restore the error handler
+    restore_error_handler();
+
+    //  Does the Error Log now contain anything?
+    if ($this->error && $this->do_debug >= 1) {
+      $this->displayErrors();
+    }
+
+    //  Did we connect?
+    if ($this->pop_conn == false) {
+      //  It would appear not...
+      $this->error = array(
+        'error' => "Failed to connect to server $host on port $port",
+        'errno' => $errno,
+        'errstr' => $errstr
+      );
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+
+      return false;
+    }
+
+    //  Increase the stream time-out
+
+    //  Check for PHP 4.3.0 or later
+    if (version_compare(phpversion(), '5.0.0', 'ge')) {
+      stream_set_timeout($this->pop_conn, $tval, 0);
+    } else {
+      //  Does not work on Windows
+      if (substr(PHP_OS, 0, 3) !== 'WIN') {
+        socket_set_timeout($this->pop_conn, $tval, 0);
+      }
+    }
+
+    //  Get the POP3 server response
+    $pop3_response = $this->getResponse();
+
+    //  Check for the +OK
+    if ($this->checkResponse($pop3_response)) {
+    //  The connection is established and the POP3 server is talking
+    $this->connected = true;
+      return true;
+    }
+
+  }
+
+  /**
+   * Login to the POP3 server (does not support APOP yet)
+   * @access public
+   * @param string $username
+   * @param string $password
+   * @return boolean
+   */
+  public function Login ($username = '', $password = '') {
+    if ($this->connected == false) {
+      $this->error = 'Not connected to POP3 server';
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+    }
+
+    if (empty($username)) {
+      $username = $this->username;
+    }
+
+    if (empty($password)) {
+      $password = $this->password;
+    }
+
+    $pop_username = "USER $username" . $this->CRLF;
+    $pop_password = "PASS $password" . $this->CRLF;
+
+    //  Send the Username
+    $this->sendString($pop_username);
+    $pop3_response = $this->getResponse();
+
+    if ($this->checkResponse($pop3_response)) {
+      //  Send the Password
+      $this->sendString($pop_password);
+      $pop3_response = $this->getResponse();
+
+      if ($this->checkResponse($pop3_response)) {
+        return true;
+      } else {
+        return false;
+      }
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Disconnect from the POP3 server
+   * @access public
+   */
+  public function Disconnect () {
+    $this->sendString('QUIT');
+
+    fclose($this->pop_conn);
+  }
+
+  /////////////////////////////////////////////////
+  //  Private Methods
+  /////////////////////////////////////////////////
+
+  /**
+   * Get the socket response back.
+   * $size is the maximum number of bytes to retrieve
+   * @access private
+   * @param integer $size
+   * @return string
+   */
+  private function getResponse ($size = 128) {
+    $pop3_response = fgets($this->pop_conn, $size);
+
+    return $pop3_response;
+  }
+
+  /**
+   * Send a string down the open socket connection to the POP3 server
+   * @access private
+   * @param string $string
+   * @return integer
+   */
+  private function sendString ($string) {
+    $bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
+
+    return $bytes_sent;
+  }
+
+  /**
+   * Checks the POP3 server response for +OK or -ERR
+   * @access private
+   * @param string $string
+   * @return boolean
+   */
+  private function checkResponse ($string) {
+    if (substr($string, 0, 3) !== '+OK') {
+      $this->error = array(
+        'error' => "Server reported an error: $string",
+        'errno' => 0,
+        'errstr' => ''
+      );
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+
+      return false;
+    } else {
+      return true;
+    }
+
+  }
+
+  /**
+   * If debug is enabled, display the error message array
+   * @access private
+   */
+  private function displayErrors () {
+    echo '<pre>';
+
+    foreach ($this->error as $single_error) {
+      print_r($single_error);
+    }
+
+    echo '</pre>';
+  }
+
+  /**
+   * Takes over from PHP for the socket warning handler
+   * @access private
+   * @param integer $errno
+   * @param string $errstr
+   * @param string $errfile
+   * @param integer $errline
+   */
+  private function catchWarning ($errno, $errstr, $errfile, $errline) {
+    $this->error[] = array(
+      'error' => "Connecting to the POP3 server raised a PHP warning: ",
+      'errno' => $errno,
+      'errstr' => $errstr
+    );
+  }
+
+  //  End of class
+}
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/class.smtp.php b/www/plugins/facteur/phpmailer-php5/class.smtp.php
new file mode 100755 (executable)
index 0000000..c2ca1cb
--- /dev/null
@@ -0,0 +1,814 @@
+<?php\r
+/*~ class.smtp.php\r
+.---------------------------------------------------------------------------.\r
+|  Software: PHPMailer - PHP email class                                    |\r
+|   Version: 5.1                                                            |\r
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |\r
+|      Info: http://phpmailer.sourceforge.net                               |\r
+|   Support: http://sourceforge.net/projects/phpmailer/                     |\r
+| ------------------------------------------------------------------------- |\r
+|     Admin: Andy Prevost (project admininistrator)                         |\r
+|   Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |\r
+|          : Marcus Bointon (coolbru) coolbru@users.sourceforge.net         |\r
+|   Founder: Brent R. Matzelle (original founder)                           |\r
+| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved.               |\r
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |\r
+| ------------------------------------------------------------------------- |\r
+|   License: Distributed under the Lesser General Public License (LGPL)     |\r
+|            http://www.gnu.org/copyleft/lesser.html                        |\r
+| This program is distributed in the hope that it will be useful - WITHOUT  |\r
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |\r
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |\r
+| ------------------------------------------------------------------------- |\r
+| We offer a number of paid services (www.codeworxtech.com):                |\r
+| - Web Hosting on highly optimized fast and secure servers                 |\r
+| - Technology Consulting                                                   |\r
+| - Oursourcing (highly qualified programmers and graphic designers)        |\r
+'---------------------------------------------------------------------------'\r
+*/\r
+\r
+/**\r
+ * PHPMailer - PHP SMTP email transport class\r
+ * NOTE: Designed for use with PHP version 5 and up\r
+ * @package PHPMailer\r
+ * @author Andy Prevost\r
+ * @author Marcus Bointon\r
+ * @copyright 2004 - 2008 Andy Prevost\r
+ * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)\r
+ * @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $\r
+ */\r
+\r
+/**\r
+ * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP\r
+ * commands except TURN which will always return a not implemented\r
+ * error. SMTP also provides some utility methods for sending mail\r
+ * to an SMTP server.\r
+ * original author: Chris Ryan\r
+ */\r
+\r
+class SMTP {\r
+  /**\r
+   *  SMTP server port\r
+   *  @var int\r
+   */\r
+  public $SMTP_PORT = 25;\r
+\r
+  /**\r
+   *  SMTP reply line ending\r
+   *  @var string\r
+   */\r
+  public $CRLF = "\r\n";\r
+\r
+  /**\r
+   *  Sets whether debugging is turned on\r
+   *  @var bool\r
+   */\r
+  public $do_debug;       // the level of debug to perform\r
+\r
+  /**\r
+   *  Sets VERP use on/off (default is off)\r
+   *  @var bool\r
+   */\r
+  public $do_verp = false;\r
+\r
+  /////////////////////////////////////////////////\r
+  // PROPERTIES, PRIVATE AND PROTECTED\r
+  /////////////////////////////////////////////////\r
+\r
+  private $smtp_conn; // the socket to the server\r
+  private $error;     // error if any on the last call\r
+  private $helo_rply; // the reply the server sent to us for HELO\r
+\r
+  /**\r
+   * Initialize the class so that the data is in a known state.\r
+   * @access public\r
+   * @return void\r
+   */\r
+  public function __construct() {\r
+    $this->smtp_conn = 0;\r
+    $this->error = null;\r
+    $this->helo_rply = null;\r
+\r
+    $this->do_debug = 0;\r
+  }\r
+\r
+  /////////////////////////////////////////////////\r
+  // CONNECTION FUNCTIONS\r
+  /////////////////////////////////////////////////\r
+\r
+  /**\r
+   * Connect to the server specified on the port specified.\r
+   * If the port is not specified use the default SMTP_PORT.\r
+   * If tval is specified then a connection will try and be\r
+   * established with the server for that number of seconds.\r
+   * If tval is not specified the default is 30 seconds to\r
+   * try on the connection.\r
+   *\r
+   * SMTP CODE SUCCESS: 220\r
+   * SMTP CODE FAILURE: 421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Connect($host, $port = 0, $tval = 30) {\r
+    // set the error val to null so there is no confusion\r
+    $this->error = null;\r
+\r
+    // make sure we are __not__ connected\r
+    if($this->connected()) {\r
+      // already connected, generate error\r
+      $this->error = array("error" => "Already connected to a server");\r
+      return false;\r
+    }\r
+\r
+    if(empty($port)) {\r
+      $port = $this->SMTP_PORT;\r
+    }\r
+\r
+    // connect to the smtp server\r
+    $this->smtp_conn = @fsockopen($host,    // the host of the server\r
+                                 $port,    // the port to use\r
+                                 $errno,   // error number if any\r
+                                 $errstr,  // error message if any\r
+                                 $tval);   // give up after ? secs\r
+    // verify we connected properly\r
+    if(empty($this->smtp_conn)) {\r
+      $this->error = array("error" => "Failed to connect to server",\r
+                           "errno" => $errno,\r
+                           "errstr" => $errstr);\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    // SMTP server can take longer to respond, give longer timeout for first read\r
+    // Windows does not have support for this timeout function\r
+    if(substr(PHP_OS, 0, 3) != "WIN")\r
+     socket_set_timeout($this->smtp_conn, $tval, 0);\r
+\r
+    // get any announcement\r
+    $announce = $this->get_lines();\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';\r
+    }\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Initiate a TLS communication with the server.\r
+   *\r
+   * SMTP CODE 220 Ready to start TLS\r
+   * SMTP CODE 501 Syntax error (no parameters allowed)\r
+   * SMTP CODE 454 TLS not available due to temporary reason\r
+   * @access public\r
+   * @return bool success\r
+   */\r
+  public function StartTLS() {\r
+    $this->error = null; # to avoid confusion\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array("error" => "Called StartTLS() without being connected");\r
+      return false;\r
+    }\r
+\r
+    fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 220) {\r
+      $this->error =\r
+         array("error"     => "STARTTLS not accepted from server",\r
+               "smtp_code" => $code,\r
+               "smtp_msg"  => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    // Begin encrypted connection\r
+    if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {\r
+      return false;\r
+    }\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Performs SMTP authentication.  Must be run after running the\r
+   * Hello() method.  Returns true if successfully authenticated.\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Authenticate($username, $password) {\r
+    // Start authentication\r
+    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($code != 334) {\r
+      $this->error =\r
+        array("error" => "AUTH not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    // Send encoded username\r
+    fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($code != 334) {\r
+      $this->error =\r
+        array("error" => "Username not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    // Send encoded password\r
+    fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($code != 235) {\r
+      $this->error =\r
+        array("error" => "Password not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Returns true if connected to a server otherwise false\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Connected() {\r
+    if(!empty($this->smtp_conn)) {\r
+      $sock_status = socket_get_status($this->smtp_conn);\r
+      if($sock_status["eof"]) {\r
+        // the socket is valid but we are not connected\r
+        if($this->do_debug >= 1) {\r
+            echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";\r
+        }\r
+        $this->Close();\r
+        return false;\r
+      }\r
+      return true; // everything looks good\r
+    }\r
+    return false;\r
+  }\r
+\r
+  /**\r
+   * Closes the socket and cleans up the state of the class.\r
+   * It is not considered good to use this function without\r
+   * first trying to use QUIT.\r
+   * @access public\r
+   * @return void\r
+   */\r
+  public function Close() {\r
+    $this->error = null; // so there is no confusion\r
+    $this->helo_rply = null;\r
+    if(!empty($this->smtp_conn)) {\r
+      // close the connection and cleanup\r
+      fclose($this->smtp_conn);\r
+      $this->smtp_conn = 0;\r
+    }\r
+  }\r
+\r
+  /////////////////////////////////////////////////\r
+  // SMTP COMMANDS\r
+  /////////////////////////////////////////////////\r
+\r
+  /**\r
+   * Issues a data command and sends the msg_data to the server\r
+   * finializing the mail transaction. $msg_data is the message\r
+   * that is to be send with the headers. Each header needs to be\r
+   * on a single line followed by a <CRLF> with the message headers\r
+   * and the message body being seperated by and additional <CRLF>.\r
+   *\r
+   * Implements rfc 821: DATA <CRLF>\r
+   *\r
+   * SMTP CODE INTERMEDIATE: 354\r
+   *     [data]\r
+   *     <CRLF>.<CRLF>\r
+   *     SMTP CODE SUCCESS: 250\r
+   *     SMTP CODE FAILURE: 552,554,451,452\r
+   * SMTP CODE FAILURE: 451,554\r
+   * SMTP CODE ERROR  : 500,501,503,421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Data($msg_data) {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+              "error" => "Called Data() without being connected");\r
+      return false;\r
+    }\r
+\r
+    fputs($this->smtp_conn,"DATA" . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 354) {\r
+      $this->error =\r
+        array("error" => "DATA command not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    /* the server is ready to accept data!\r
+     * according to rfc 821 we should not send more than 1000\r
+     * including the CRLF\r
+     * characters on a single line so we will break the data up\r
+     * into lines by \r and/or \n then if needed we will break\r
+     * each of those into smaller lines to fit within the limit.\r
+     * in addition we will be looking for lines that start with\r
+     * a period '.' and append and additional period '.' to that\r
+     * line. NOTE: this does not count towards limit.\r
+     */\r
+\r
+    // normalize the line breaks so we know the explode works\r
+    $msg_data = str_replace("\r\n","\n",$msg_data);\r
+    $msg_data = str_replace("\r","\n",$msg_data);\r
+    $lines = explode("\n",$msg_data);\r
+\r
+    /* we need to find a good way to determine is headers are\r
+     * in the msg_data or if it is a straight msg body\r
+     * currently I am assuming rfc 822 definitions of msg headers\r
+     * and if the first field of the first line (':' sperated)\r
+     * does not contain a space then it _should_ be a header\r
+     * and we can process all lines before a blank "" line as\r
+     * headers.\r
+     */\r
+\r
+    $field = substr($lines[0],0,strpos($lines[0],":"));\r
+    $in_headers = false;\r
+    if(!empty($field) && !strstr($field," ")) {\r
+      $in_headers = true;\r
+    }\r
+\r
+    $max_line_length = 998; // used below; set here for ease in change\r
+\r
+    while(list(,$line) = @each($lines)) {\r
+      $lines_out = null;\r
+      if($line == "" && $in_headers) {\r
+        $in_headers = false;\r
+      }\r
+      // ok we need to break this line up into several smaller lines\r
+      while(strlen($line) > $max_line_length) {\r
+        $pos = strrpos(substr($line,0,$max_line_length)," ");\r
+\r
+        // Patch to fix DOS attack\r
+        if(!$pos) {\r
+          $pos = $max_line_length - 1;\r
+          $lines_out[] = substr($line,0,$pos);\r
+          $line = substr($line,$pos);\r
+        } else {\r
+          $lines_out[] = substr($line,0,$pos);\r
+          $line = substr($line,$pos + 1);\r
+        }\r
+\r
+        /* if processing headers add a LWSP-char to the front of new line\r
+         * rfc 822 on long msg headers\r
+         */\r
+        if($in_headers) {\r
+          $line = "\t" . $line;\r
+        }\r
+      }\r
+      $lines_out[] = $line;\r
+\r
+      // send the lines to the server\r
+      while(list(,$line_out) = @each($lines_out)) {\r
+        if(strlen($line_out) > 0)\r
+        {\r
+          if(substr($line_out, 0, 1) == ".") {\r
+            $line_out = "." . $line_out;\r
+          }\r
+        }\r
+        fputs($this->smtp_conn,$line_out . $this->CRLF);\r
+      }\r
+    }\r
+\r
+    // message data has been sent\r
+    fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250) {\r
+      $this->error =\r
+        array("error" => "DATA not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Sends the HELO command to the smtp server.\r
+   * This makes sure that we and the server are in\r
+   * the same known state.\r
+   *\r
+   * Implements from rfc 821: HELO <SP> <domain> <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250\r
+   * SMTP CODE ERROR  : 500, 501, 504, 421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Hello($host = '') {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+            "error" => "Called Hello() without being connected");\r
+      return false;\r
+    }\r
+\r
+    // if hostname for HELO was not specified send default\r
+    if(empty($host)) {\r
+      // determine appropriate default to send to server\r
+      $host = "localhost";\r
+    }\r
+\r
+    // Send extended hello first (RFC 2821)\r
+    if(!$this->SendHello("EHLO", $host)) {\r
+      if(!$this->SendHello("HELO", $host)) {\r
+        return false;\r
+      }\r
+    }\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Sends a HELO/EHLO command.\r
+   * @access private\r
+   * @return bool\r
+   */\r
+  private function SendHello($hello, $host) {\r
+    fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250) {\r
+      $this->error =\r
+        array("error" => $hello . " not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    $this->helo_rply = $rply;\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Starts a mail transaction from the email address specified in\r
+   * $from. Returns true if successful or false otherwise. If True\r
+   * the mail transaction is started and then one or more Recipient\r
+   * commands may be called followed by a Data command.\r
+   *\r
+   * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250\r
+   * SMTP CODE SUCCESS: 552,451,452\r
+   * SMTP CODE SUCCESS: 500,501,421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Mail($from) {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+              "error" => "Called Mail() without being connected");\r
+      return false;\r
+    }\r
+\r
+    $useVerp = ($this->do_verp ? "XVERP" : "");\r
+    fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250) {\r
+      $this->error =\r
+        array("error" => "MAIL not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Sends the quit command to the server and then closes the socket\r
+   * if there is no error or the $close_on_error argument is true.\r
+   *\r
+   * Implements from rfc 821: QUIT <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 221\r
+   * SMTP CODE ERROR  : 500\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Quit($close_on_error = true) {\r
+    $this->error = null; // so there is no confusion\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+              "error" => "Called Quit() without being connected");\r
+      return false;\r
+    }\r
+\r
+    // send the quit command to the server\r
+    fputs($this->smtp_conn,"quit" . $this->CRLF);\r
+\r
+    // get any good-bye messages\r
+    $byemsg = $this->get_lines();\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';\r
+    }\r
+\r
+    $rval = true;\r
+    $e = null;\r
+\r
+    $code = substr($byemsg,0,3);\r
+    if($code != 221) {\r
+      // use e as a tmp var cause Close will overwrite $this->error\r
+      $e = array("error" => "SMTP server rejected quit command",\r
+                 "smtp_code" => $code,\r
+                 "smtp_rply" => substr($byemsg,4));\r
+      $rval = false;\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';\r
+      }\r
+    }\r
+\r
+    if(empty($e) || $close_on_error) {\r
+      $this->Close();\r
+    }\r
+\r
+    return $rval;\r
+  }\r
+\r
+  /**\r
+   * Sends the command RCPT to the SMTP server with the TO: argument of $to.\r
+   * Returns true if the recipient was accepted false if it was rejected.\r
+   *\r
+   * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250,251\r
+   * SMTP CODE FAILURE: 550,551,552,553,450,451,452\r
+   * SMTP CODE ERROR  : 500,501,503,421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Recipient($to) {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+              "error" => "Called Recipient() without being connected");\r
+      return false;\r
+    }\r
+\r
+    fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250 && $code != 251) {\r
+      $this->error =\r
+        array("error" => "RCPT not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Sends the RSET command to abort and transaction that is\r
+   * currently in progress. Returns true if successful false\r
+   * otherwise.\r
+   *\r
+   * Implements rfc 821: RSET <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250\r
+   * SMTP CODE ERROR  : 500,501,504,421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Reset() {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+              "error" => "Called Reset() without being connected");\r
+      return false;\r
+    }\r
+\r
+    fputs($this->smtp_conn,"RSET" . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250) {\r
+      $this->error =\r
+        array("error" => "RSET failed",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * Starts a mail transaction from the email address specified in\r
+   * $from. Returns true if successful or false otherwise. If True\r
+   * the mail transaction is started and then one or more Recipient\r
+   * commands may be called followed by a Data command. This command\r
+   * will send the message to the users terminal if they are logged\r
+   * in and send them an email.\r
+   *\r
+   * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250\r
+   * SMTP CODE SUCCESS: 552,451,452\r
+   * SMTP CODE SUCCESS: 500,501,502,421\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function SendAndMail($from) {\r
+    $this->error = null; // so no confusion is caused\r
+\r
+    if(!$this->connected()) {\r
+      $this->error = array(\r
+          "error" => "Called SendAndMail() without being connected");\r
+      return false;\r
+    }\r
+\r
+    fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);\r
+\r
+    $rply = $this->get_lines();\r
+    $code = substr($rply,0,3);\r
+\r
+    if($this->do_debug >= 2) {\r
+      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';\r
+    }\r
+\r
+    if($code != 250) {\r
+      $this->error =\r
+        array("error" => "SAML not accepted from server",\r
+              "smtp_code" => $code,\r
+              "smtp_msg" => substr($rply,4));\r
+      if($this->do_debug >= 1) {\r
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';\r
+      }\r
+      return false;\r
+    }\r
+    return true;\r
+  }\r
+\r
+  /**\r
+   * This is an optional command for SMTP that this class does not\r
+   * support. This method is here to make the RFC821 Definition\r
+   * complete for this class and __may__ be implimented in the future\r
+   *\r
+   * Implements from rfc 821: TURN <CRLF>\r
+   *\r
+   * SMTP CODE SUCCESS: 250\r
+   * SMTP CODE FAILURE: 502\r
+   * SMTP CODE ERROR  : 500, 503\r
+   * @access public\r
+   * @return bool\r
+   */\r
+  public function Turn() {\r
+    $this->error = array("error" => "This method, TURN, of the SMTP ".\r
+                                    "is not implemented");\r
+    if($this->do_debug >= 1) {\r
+      echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';\r
+    }\r
+    return false;\r
+  }\r
+\r
+  /**\r
+  * Get the current error\r
+  * @access public\r
+  * @return array\r
+  */\r
+  public function getError() {\r
+    return $this->error;\r
+  }\r
+\r
+  /////////////////////////////////////////////////\r
+  // INTERNAL FUNCTIONS\r
+  /////////////////////////////////////////////////\r
+\r
+  /**\r
+   * Read in as many lines as possible\r
+   * either before eof or socket timeout occurs on the operation.\r
+   * With SMTP we can tell if we have more lines to read if the\r
+   * 4th character is '-' symbol. If it is a space then we don't\r
+   * need to read anything else.\r
+   * @access private\r
+   * @return string\r
+   */\r
+  private function get_lines() {\r
+    $data = "";\r
+    while($str = @fgets($this->smtp_conn,515)) {\r
+      if($this->do_debug >= 4) {\r
+        echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';\r
+        echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';\r
+      }\r
+      $data .= $str;\r
+      if($this->do_debug >= 4) {\r
+        echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';\r
+      }\r
+      // if 4th character is a space, we are done reading, break the loop\r
+      if(substr($str,3,1) == " ") { break; }\r
+    }\r
+    return $data;\r
+  }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ar.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ar.php
new file mode 100755 (executable)
index 0000000..b7c5057
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+* PHPMailer language file: refer to English translation for definitive list
+* Arabic Version, UTF-8
+* by : bahjat al mostafa <bahjat983@hotmail.com>
+*/
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: لم نستطع تأكيد الهوية.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: لم يتم قبول المعلومات .';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'ترميز غير معروف: ';
+$PHPMAILER_LANG['execute']              = 'لم أستطع تنفيذ : ';
+$PHPMAILER_LANG['file_access']          = 'لم نستطع الوصول للملف: ';
+$PHPMAILER_LANG['file_open']            = 'File Error: لم نستطع فتح الملف: ';
+$PHPMAILER_LANG['from_failed']          = 'البريد التالي لم نستطع ارسال البريد له : ';
+$PHPMAILER_LANG['instantiate']          = 'لم نستطع توفير خدمة البريد.';
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
+//$PHPMAILER_LANG['provide_address']      = 'You must provide at least one recipient email address.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: الأخطاء التالية ' .
+                                          'فشل في الارسال لكل من : ';
+$PHPMAILER_LANG['signing']              = 'خطأ في التوقيع: ';
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-br.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-br.php
new file mode 100755 (executable)
index 0000000..7d64ce4
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Portuguese Version\r
+* By Paulo Henrique Garcia - paulo@controllerweb.com.br\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Erro de SMTP: Não foi possível autenticar.';\r
+$PHPMAILER_LANG['connect_host']         = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Erro de SMTP: Dados não aceitos.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Codificação desconhecida: ';\r
+$PHPMAILER_LANG['execute']              = 'Não foi possível executar: ';\r
+$PHPMAILER_LANG['file_access']          = 'Não foi possível acessar o arquivo: ';\r
+$PHPMAILER_LANG['file_open']            = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Os endereços de rementente a seguir falharam: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Não foi possível instanciar a função mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.';\r
+$PHPMAILER_LANG['provide_address']      = 'Você deve fornecer pelo menos um endereço de destinatário de email.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ca.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ca.php
new file mode 100644 (file)
index 0000000..1127567
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Catalan Version\r
+* By Ivan: web AT microstudi DOT com\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Error SMTP: No s\'hapogut autenticar.';\r
+$PHPMAILER_LANG['connect_host']         = 'Error SMTP: No es pot connectar al servidor SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Dades no acceptades.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Codificació desconeguda: ';\r
+$PHPMAILER_LANG['execute']              = 'No es pot executar: ';\r
+$PHPMAILER_LANG['file_access']          = 'No es pot accedir a l\'arxiu: ';\r
+$PHPMAILER_LANG['file_open']            = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';\r
+$PHPMAILER_LANG['from_failed']          = 'La(s) següent(s) adreces de remitent han fallat: ';\r
+$PHPMAILER_LANG['instantiate']          = 'No s\'ha pogut crear una instància de la funció Mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';\r
+$PHPMAILER_LANG['provide_address']      = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Els següents destinataris han fallat: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ch.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ch.php
new file mode 100755 (executable)
index 0000000..31ebd86
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+* PHPMailer language file: refer to English translation for definitive list
+* Chinese Version
+* By LiuXin: www.80x86.cn/blog/
+*/
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding'] = '未知编码:';
+$PHPMAILER_LANG['execute'] = '不能执行: ';
+$PHPMAILER_LANG['file_access'] = '不能访问文件:';
+$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
+$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
+$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
+$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-cz.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-cz.php
new file mode 100755 (executable)
index 0000000..f9589ca
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Czech Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Chyba autentikace.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Data nebyla pøijata';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Neznámé kódování: ';\r
+$PHPMAILER_LANG['execute']              = 'Nelze provést: ';\r
+$PHPMAILER_LANG['file_access']          = 'Soubor nenalezen: ';\r
+$PHPMAILER_LANG['file_open']            = 'File Error: Nelze otevøít soubor pro ètení: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Následující adresa From je nesprávná: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Nelze vytvoøit instanci emailové funkce.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.';\r
+$PHPMAILER_LANG['provide_address']      = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: Adresy pøíjemcù nejsou správné ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-de.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-de.php
new file mode 100755 (executable)
index 0000000..165a86f
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* German Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Fehler: Daten werden nicht akzeptiert.';\r
+$PHPMAILER_LANG['empty_message']        = 'E-Mail Inhalt ist leer.';\r
+$PHPMAILER_LANG['encoding']             = 'Unbekanntes Encoding-Format: ';\r
+$PHPMAILER_LANG['execute']              = 'Konnte folgenden Befehl nicht ausführen: ';\r
+$PHPMAILER_LANG['file_access']          = 'Zugriff auf folgende Datei fehlgeschlagen: ';\r
+$PHPMAILER_LANG['file_open']            = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Die folgende Absenderadresse ist nicht korrekt: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Mail Funktion konnte nicht initialisiert werden.';\r
+$PHPMAILER_LANG['invalid_email']        = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';\r
+$PHPMAILER_LANG['provide_address']      = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';\r
+$PHPMAILER_LANG['signing']              = 'Fehler beim Signieren: ';\r
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Verbindung zu SMTP Server fehlgeschlagen.';\r
+$PHPMAILER_LANG['smtp_error']           = 'Fehler vom SMTP Server: ';\r
+$PHPMAILER_LANG['variable_set']         = 'Kann Variable nicht setzen oder zurücksetzen: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-dk.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-dk.php
new file mode 100644 (file)
index 0000000..59b58c0
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Danish Version\r
+* Author: Mikael Stokkebro <info@stokkebro.dk>\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP fejl: Kunne ikke logge på.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fejl: Data kunne ikke accepteres.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Ukendt encode-format: ';\r
+$PHPMAILER_LANG['execute']              = 'Kunne ikke køre: ';\r
+$PHPMAILER_LANG['file_access']          = 'Ingen adgang til fil: ';\r
+$PHPMAILER_LANG['file_open']            = 'Fil fejl: Kunne ikke åbne filen: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Følgende afsenderadresse er forkert: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Kunne ikke initialisere email funktionen.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';\r
+$PHPMAILER_LANG['provide_address']      = 'Du skal indtaste mindst en modtagers emailadresse.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP fejl: Følgende modtagere er forkerte: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php
new file mode 100755 (executable)
index 0000000..f7d4286
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * English Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'You must provide at least one ' .
+                                          'recipient email address.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
+$PHPMAILER_LANG["execute"]              = 'Could not execute: ';
+$PHPMAILER_LANG["instantiate"]          = 'Could not instantiate mail function.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Could not authenticate.';
+$PHPMAILER_LANG["from_failed"]          = 'The following From address failed: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: The following ' .
+                                          'recipients failed: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data not accepted.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Could not connect to SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Could not access file: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Could not open file: ';
+$PHPMAILER_LANG["encoding"]             = 'Unknown encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-es.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-es.php
new file mode 100755 (executable)
index 0000000..0b69825
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Spanish version\r
+* Versión en español\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Error SMTP: No se pudo autentificar.';\r
+$PHPMAILER_LANG['connect_host']         = 'Error SMTP: No puedo conectar al servidor SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Datos no aceptados.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Codificación desconocida: ';\r
+$PHPMAILER_LANG['execute']              = 'No puedo ejecutar: ';\r
+$PHPMAILER_LANG['file_access']          = 'No puedo acceder al archivo: ';\r
+$PHPMAILER_LANG['file_open']            = 'Error de Archivo: No puede abrir el archivo: ';\r
+$PHPMAILER_LANG['from_failed']          = 'La(s) siguiente(s) direcciones de remitente fallaron: ';\r
+$PHPMAILER_LANG['instantiate']          = 'No pude crear una instancia de la función Mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';\r
+$PHPMAILER_LANG['provide_address']      = 'Debe proveer al menos una dirección de email como destinatario.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Los siguientes destinatarios fallaron: ';\r
+$PHPMAILER_LANG['signing']              = 'Error al firmar: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-et.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-et.php
new file mode 100755 (executable)
index 0000000..cf61779
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+* PHPMailer language file: refer to English translation for definitive list
+* Estonian Version
+* By Indrek Päri
+*/
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Viga: Autoriseerimise viga.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Viga: Vigased andmed.';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'Tundmatu Unknown kodeering: ';
+$PHPMAILER_LANG['execute']              = 'Tegevus ebaõnnestus: ';
+$PHPMAILER_LANG['file_access']          = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
+$PHPMAILER_LANG['file_open']            = 'Faili Viga: Faili avamine ebaõnnestus: ';
+$PHPMAILER_LANG['from_failed']          = 'Järgnev saatja e-posti aadress on vigane: ';
+$PHPMAILER_LANG['instantiate']          = 'mail funktiooni käivitamine ebaõnnestus.';
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
+$PHPMAILER_LANG['provide_address']      = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fi.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fi.php
new file mode 100644 (file)
index 0000000..6d7dcce
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Finnish Version\r
+* By Jyry Kuukanen\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-virhe: data on virheellinen.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';\r
+$PHPMAILER_LANG['execute']              = 'Suoritus epäonnistui: ';\r
+$PHPMAILER_LANG['file_access']          = 'Seuraavaan tiedostoon ei ole oikeuksia: ';\r
+$PHPMAILER_LANG['file_open']            = 'Tiedostovirhe: Ei voida avata tiedostoa: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Seuraava lähettäjän osoite on virheellinen: ';\r
+$PHPMAILER_LANG['instantiate']          = 'mail-funktion luonti epäonnistui.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';\r
+$PHPMAILER_LANG['provide_address']      = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';\r
+$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fo.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fo.php
new file mode 100644 (file)
index 0000000..704c477
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Faroese Version [language of the Faroe Islands, a Danish dominion]\r
+* This file created: 11-06-2004\r
+* Supplied by Dávur Sørensen [www.profo-webdesign.dk]\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP feilur: Kundi ikki góðkenna.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP feilur: Data ikki góðkent.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Ókend encoding: ';\r
+$PHPMAILER_LANG['execute']              = 'Kundi ikki útføra: ';\r
+$PHPMAILER_LANG['file_access']          = 'Kundi ikki tilganga fílu: ';\r
+$PHPMAILER_LANG['file_open']            = 'Fílu feilur: Kundi ikki opna fílu: ';\r
+$PHPMAILER_LANG['from_failed']          = 'fylgjandi Frá/From adressa miseydnaðist: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Kuni ikki instantiera mail funktión.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';\r
+$PHPMAILER_LANG['provide_address']      = 'Tú skal uppgeva minst móttakara-emailadressu(r).';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fr.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fr.php
new file mode 100755 (executable)
index 0000000..52e9ae2
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* French Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Erreur SMTP : Echec de l\'authentification.';\r
+$PHPMAILER_LANG['connect_host']         = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Erreur SMTP : Données incorrects.';\r
+$PHPMAILER_LANG['empty_message']        = 'Corps de message vide';\r
+$PHPMAILER_LANG['encoding']             = 'Encodage inconnu : ';\r
+$PHPMAILER_LANG['execute']              = 'Impossible de lancer l\'exécution : ';\r
+$PHPMAILER_LANG['file_access']          = 'Impossible d\'accéder au fichier : ';\r
+$PHPMAILER_LANG['file_open']            = 'Erreur Fichier : ouverture impossible : ';\r
+$PHPMAILER_LANG['from_failed']          = 'L\'adresse d\'expéditeur suivante a échouée : ';\r
+$PHPMAILER_LANG['instantiate']          = 'Impossible d\'instancier la fonction mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';\r
+$PHPMAILER_LANG['provide_address']      = 'Vous devez fournir au moins une adresse de destinataire.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Erreur SMTP : Les destinataires suivants sont en erreur : ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hu.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hu.php
new file mode 100644 (file)
index 0000000..a266484
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Hungarian Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Hiba: Sikertelen autentikáció.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Hiba: Nem elfogadható adat.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Ismeretlen kódolás: ';\r
+$PHPMAILER_LANG['execute']              = 'Nem tudtam végrehajtani: ';\r
+$PHPMAILER_LANG['file_access']          = 'Nem sikerült elérni a következõ fájlt: ';\r
+$PHPMAILER_LANG['file_open']            = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Az alábbi Feladó cím hibás: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Nem sikerült példányosítani a mail funkciót.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Meg kell adnod legalább egy címzett email címet.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Hiba: Az alábbi címzettek hibásak: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-it.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-it.php
new file mode 100755 (executable)
index 0000000..59bf4fb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Italian version\r
+* @package PHPMailer\r
+* @author Ilias Bartolini <brain79@inwind.it>\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Impossibile autenticarsi.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Impossibile connettersi all\'host SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Data non accettati dal server.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Encoding set dei caratteri sconosciuto: ';\r
+$PHPMAILER_LANG['execute']              = 'Impossibile eseguire l\'operazione: ';\r
+$PHPMAILER_LANG['file_access']          = 'Impossibile accedere al file: ';\r
+$PHPMAILER_LANG['file_open']            = 'File Error: Impossibile aprire il file: ';\r
+$PHPMAILER_LANG['from_failed']          = 'I seguenti indirizzi mittenti hanno generato errore: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Impossibile istanziare la funzione mail';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Deve essere fornito almeno un indirizzo ricevente';\r
+$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ja.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ja.php
new file mode 100644 (file)
index 0000000..66da1b6
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Japanese Version\r
+* By Mitsuhiro Yoshida - http://mitstek.com/\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';\r
+$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';\r
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';\r
+$PHPMAILER_LANG['execute'] = '実行できませんでした: ';\r
+$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';\r
+$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';\r
+$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: ';\r
+$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';\r
+$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-nl.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-nl.php
new file mode 100755 (executable)
index 0000000..355dcdc
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Dutch Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Fout: authenticatie mislukt.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Fout: Kon niet verbinden met SMTP host.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Fout: Data niet geaccepteerd.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Onbekende codering: ';\r
+$PHPMAILER_LANG['execute']              = 'Kon niet uitvoeren: ';\r
+$PHPMAILER_LANG['file_access']          = 'Kreeg geen toegang tot bestand: ';\r
+$PHPMAILER_LANG['file_open']            = 'Bestandsfout: Kon bestand niet openen: ';\r
+$PHPMAILER_LANG['from_failed']          = 'De volgende afzender adressen zijn mislukt: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Kon mail functie niet initialiseren.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Fout: De volgende ontvangers zijn mislukt: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-no.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-no.php
new file mode 100755 (executable)
index 0000000..bf2f84e
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Norwegian Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Feil: Kunne ikke authentisere.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Feil: Kunne ikke koble til SMTP host.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Feil: Data ble ikke akseptert.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Ukjent encoding: ';\r
+$PHPMAILER_LANG['execute']              = 'Kunne ikke utføre: ';\r
+$PHPMAILER_LANG['file_access']          = 'Kunne ikke få tilgang til filen: ';\r
+$PHPMAILER_LANG['file_open']            = 'Fil feil: Kunne ikke åpne filen: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Følgende Fra feilet: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Kunne ikke instantiate mail funksjonen.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Du må ha med minst en mottager adresse.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feil: Følgende mottagere feilet: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pl.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pl.php
new file mode 100644 (file)
index 0000000..e8bd512
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Polish Version\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić autentykacji.';\r
+$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';\r
+$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';\r
+$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';\r
+$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';\r
+$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';\r
+$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest jest nieprawidłowy: ';\r
+$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';\r
+$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ro.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ro.php
new file mode 100644 (file)
index 0000000..17cddb7
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Romanian Version\r
+* @package PHPMailer\r
+* @author Catalin Constantin <catalin@dazoot.ro>\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Eroare SMTP: Nu a functionat autentificarea.';\r
+$PHPMAILER_LANG['connect_host']         = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Encodare necunoscuta: ';\r
+$PHPMAILER_LANG['execute']              = 'Nu pot executa:  ';\r
+$PHPMAILER_LANG['file_access']          = 'Nu pot accesa fisierul: ';\r
+$PHPMAILER_LANG['file_open']            = 'Eroare de fisier: Nu pot deschide fisierul: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Urmatoarele adrese From au dat eroare: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Nu am putut instantia functia mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';\r
+$PHPMAILER_LANG['provide_address']      = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ru.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ru.php
new file mode 100644 (file)
index 0000000..295a56e
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Russian Version by Alexey Chumakov <alex@chumakov.ru>\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'Ошибка SMTP: ошибка авторизации.';\r
+$PHPMAILER_LANG['connect_host']         = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'Ошибка SMTP: данные не приняты.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Неизвестный вид кодировки: ';\r
+$PHPMAILER_LANG['execute']              = 'Невозможно выполнить команду: ';\r
+$PHPMAILER_LANG['file_access']          = 'Нет доступа к файлу: ';\r
+$PHPMAILER_LANG['file_open']            = 'Файловая ошибка: не удается открыть файл: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Неверный адрес отправителя: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Невозможно запустить функцию mail.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-se.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-se.php
new file mode 100755 (executable)
index 0000000..d459667
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Swedish Version\r
+* Author: Johan Linnér <johan@linner.biz>\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP fel: Kunde inte autentisera.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP fel: Kunde inte ansluta till SMTP-server.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fel: Data accepterades inte.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Okänt encode-format: ';\r
+$PHPMAILER_LANG['execute']              = 'Kunde inte köra: ';\r
+$PHPMAILER_LANG['file_access']          = 'Ingen åtkomst till fil: ';\r
+$PHPMAILER_LANG['file_open']            = 'Fil fel: Kunde inte öppna fil: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Följande avsändaradress är felaktig: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Kunde inte initiera e-postfunktion.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'Du måste ange minst en mottagares e-postadress.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP fel: Följande mottagare är felaktig: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-tr.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-tr.php
new file mode 100755 (executable)
index 0000000..8a069d1
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+* PHPMailer language file: refer to English translation for definitive list\r
+* Turkish version\r
+* Türkçe Versiyonu\r
+* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu\r
+*/\r
+\r
+$PHPMAILER_LANG['authenticate']         = 'SMTP Hatasý: Doðrulanamýyor.';\r
+$PHPMAILER_LANG['connect_host']         = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';\r
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Hatasý: Veri kabul edilmedi.';\r
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';\r
+$PHPMAILER_LANG['encoding']             = 'Bilinmeyen þifreleme: ';\r
+$PHPMAILER_LANG['execute']              = 'Çalýþtýrýlamýyor: ';\r
+$PHPMAILER_LANG['file_access']          = 'Dosyaya eriþilemiyor: ';\r
+$PHPMAILER_LANG['file_open']            = 'Dosya Hatasý: Dosya açýlamýyor: ';\r
+$PHPMAILER_LANG['from_failed']          = 'Baþarýsýz olan gönderici adresi: ';\r
+$PHPMAILER_LANG['instantiate']          = 'Örnek mail fonksiyonu yaratýlamadý.';\r
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';\r
+$PHPMAILER_LANG['provide_address']      = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.';\r
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.';\r
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Hatasý: alýcýlara ulaþmadý: ';\r
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';\r
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';\r
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';\r
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';\r
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh.php
new file mode 100755 (executable)
index 0000000..fef66f8
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+* PHPMailer language file: refer to English translation for definitive list
+* Traditional Chinese Version
+* @author liqwei <liqwei@liqwei.com>
+*/
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding'] = '未知編碼: ';
+$PHPMAILER_LANG['file_access'] = '無法訪問文件:';
+$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:';
+$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
+$PHPMAILER_LANG['execute'] = '無法執行:';
+$PHPMAILER_LANG['instantiate'] = '未知函數調用。';
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
+$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
+$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:';
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh_cn.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh_cn.php
new file mode 100755 (executable)
index 0000000..b188404
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+* PHPMailer language file: refer to English translation for definitive list
+* Simplified Chinese Version
+* @author liqwei <liqwei@liqwei.com>
+*/
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
+//$P$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding'] = '未知编码: ';
+$PHPMAILER_LANG['execute'] = '无法执行:';
+$PHPMAILER_LANG['file_access'] = '无法访问文件:';
+$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
+$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
+$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
+//$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
+$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
+$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
+//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
+//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
+?>
\ No newline at end of file
diff --git a/www/plugins/facteur/prive/squelettes/contenu/configurer_facteur.html b/www/plugins/facteur/prive/squelettes/contenu/configurer_facteur.html
new file mode 100644 (file)
index 0000000..3bbab56
--- /dev/null
@@ -0,0 +1,5 @@
+[(#AUTORISER{configurer,facteur}|sinon_interdire_acces)]
+<h1 class="grostitre"><:facteur:configuration_facteur:></h1>
+<div class="ajax">
+       #FORMULAIRE_CONFIGURER_FACTEUR
+</div>
\ No newline at end of file
diff --git a/www/plugins/facteur/prive/themes/spip/images/facteur-16.png b/www/plugins/facteur/prive/themes/spip/images/facteur-16.png
new file mode 100644 (file)
index 0000000..29a7f05
Binary files /dev/null and b/www/plugins/facteur/prive/themes/spip/images/facteur-16.png differ
diff --git a/www/plugins/facteur/prive/themes/spip/images/facteur-24.png b/www/plugins/facteur/prive/themes/spip/images/facteur-24.png
new file mode 100644 (file)
index 0000000..c2e2154
Binary files /dev/null and b/www/plugins/facteur/prive/themes/spip/images/facteur-24.png differ
diff --git a/www/plugins/facteur/prive/themes/spip/images/facteur-32.png b/www/plugins/facteur/prive/themes/spip/images/facteur-32.png
new file mode 100644 (file)
index 0000000..b27394e
Binary files /dev/null and b/www/plugins/facteur/prive/themes/spip/images/facteur-32.png differ
diff --git a/www/plugins/facteur/svn.revision b/www/plugins/facteur/svn.revision
new file mode 100644 (file)
index 0000000..9a32d0e
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/facteur/trunk
+Revision: 79975
+Dernier commit: 2014-01-12 06:00:48 +0100 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/facteur/trunk</origine>
+<revision>79975</revision>
+<commit>2014-01-12 06:00:48 +0100 </commit>
+</svn_revision>
\ No newline at end of file