[PLUGINS] ~maj globale
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Tue, 6 Sep 2016 15:26:20 +0000 (17:26 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Tue, 6 Sep 2016 15:26:20 +0000 (17:26 +0200)
935 files changed:
www/plugins/Menu_langue_lien/formulaires/menu_lang.html
www/plugins/Menu_langue_lien/lang/mll.xml
www/plugins/Menu_langue_lien/lang/mll_en.php
www/plugins/Menu_langue_lien/lang/mll_es.php
www/plugins/Menu_langue_lien/lang/mll_fr.php
www/plugins/Menu_langue_lien/lang/mll_nl.php
www/plugins/Menu_langue_lien/lang/mll_ru.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/mll_sk.php
www/plugins/Menu_langue_lien/lang/paquet-mll.xml
www/plugins/Menu_langue_lien/lang/paquet-mll_en.php
www/plugins/Menu_langue_lien/lang/paquet-mll_es.php
www/plugins/Menu_langue_lien/lang/paquet-mll_fr.php
www/plugins/Menu_langue_lien/lang/paquet-mll_nl.php
www/plugins/Menu_langue_lien/lang/paquet-mll_ru.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll_sk.php
www/plugins/Menu_langue_lien/paquet.xml
www/plugins/Menu_langue_lien/plugin.xml
www/plugins/Menu_langue_lien/svn.revision
www/plugins/compositions_v3/compositions_fonctions.php
www/plugins/compositions_v3/compositions_ieconfig.php
www/plugins/compositions_v3/compositions_options.php [new file with mode: 0644]
www/plugins/compositions_v3/compositions_pipeline.php
www/plugins/compositions_v3/formulaires/configurer_compositions.html
www/plugins/compositions_v3/formulaires/editer_composition_objet.html
www/plugins/compositions_v3/formulaires/inc-informeur_composition.html [deleted file]
www/plugins/compositions_v3/formulaires/inc-selecteur_composition.html
www/plugins/compositions_v3/images/composition-cours.png
www/plugins/compositions_v3/images/composition-tableau.png
www/plugins/compositions_v3/images/composition-test.png
www/plugins/compositions_v3/images/objet-blocs.png [new file with mode: 0644]
www/plugins/compositions_v3/images/objet-intro-blocs.png [new file with mode: 0644]
www/plugins/compositions_v3/images/objet-liste-contenus-dates.png
www/plugins/compositions_v3/images/objet-liste-contenus.png
www/plugins/compositions_v3/images/objet-simple.png
www/plugins/compositions_v3/inc/compositions.php
www/plugins/compositions_v3/lang/compositions.xml
www/plugins/compositions_v3/lang/compositions_de.php [new file with mode: 0644]
www/plugins/compositions_v3/lang/compositions_en.php
www/plugins/compositions_v3/lang/compositions_es.php
www/plugins/compositions_v3/lang/compositions_fr.php
www/plugins/compositions_v3/lang/compositions_nl.php
www/plugins/compositions_v3/lang/compositions_ru.php
www/plugins/compositions_v3/lang/compositions_sk.php
www/plugins/compositions_v3/lang/paquet-compositions_en.php
www/plugins/compositions_v3/lang/paquet-compositions_es.php
www/plugins/compositions_v3/lang/paquet-compositions_fr.php
www/plugins/compositions_v3/lang/paquet-compositions_nl.php
www/plugins/compositions_v3/lang/paquet-compositions_ru.php
www/plugins/compositions_v3/lang/paquet-compositions_sk.php
www/plugins/compositions_v3/paquet.xml
www/plugins/compositions_v3/prive/editer/compositions.html
www/plugins/compositions_v3/prive/squelettes/contenu/compositions.html
www/plugins/compositions_v3/prive/squelettes/navigation/compositions.html [new file with mode: 0644]
www/plugins/compositions_v3/prive/style_prive_plugin_compositions.html
www/plugins/compositions_v3/prive/themes/spip/images/composition-16.png
www/plugins/compositions_v3/prive/themes/spip/images/composition-24.png
www/plugins/compositions_v3/prive/themes/spip/images/composition-32.png
www/plugins/compositions_v3/prive/themes/spip2/images/composition-16.png
www/plugins/compositions_v3/prive/themes/spip2/images/composition-24.png
www/plugins/compositions_v3/prive/themes/spip2/images/composition-32.png
www/plugins/compositions_v3/svn.revision
www/plugins/enluminures_typographiques_v3/base/typoenluminee_upgrade.php [new file with mode: 0644]
www/plugins/enluminures_typographiques_v3/css/enluminurestypo.css
www/plugins/enluminures_typographiques_v3/css/enluminurestypo_prive.css
www/plugins/enluminures_typographiques_v3/editeur/supprimer_ligne.png
www/plugins/enluminures_typographiques_v3/enluminures_typo_pipelines.php
www/plugins/enluminures_typographiques_v3/exec/tableau_edit.php
www/plugins/enluminures_typographiques_v3/formulaires/configurer_typoenluminee.html
www/plugins/enluminures_typographiques_v3/icones_barre/avances.png
www/plugins/enluminures_typographiques_v3/icones_barre/barre-tableau.png
www/plugins/enluminures_typographiques_v3/icones_barre/barre-wiki.png
www/plugins/enluminures_typographiques_v3/icones_barre/cadretexte.png
www/plugins/enluminures_typographiques_v3/icones_barre/center.png
www/plugins/enluminures_typographiques_v3/icones_barre/eacute-maj.png
www/plugins/enluminures_typographiques_v3/icones_barre/exposant.png
www/plugins/enluminures_typographiques_v3/icones_barre/indice.png
www/plugins/enluminures_typographiques_v3/icones_barre/intertitre2.png
www/plugins/enluminures_typographiques_v3/icones_barre/intertitre3.png
www/plugins/enluminures_typographiques_v3/icones_barre/left.png
www/plugins/enluminures_typographiques_v3/icones_barre/listenum.png
www/plugins/enluminures_typographiques_v3/icones_barre/listepuces.png
www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence.png
www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence2.png
www/plugins/enluminures_typographiques_v3/icones_barre/oelig-maj.png
www/plugins/enluminures_typographiques_v3/icones_barre/oelig.png
www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code.png
www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code_red.png
www/plugins/enluminures_typographiques_v3/icones_barre/petitescapitales.png
www/plugins/enluminures_typographiques_v3/icones_barre/poesie.png
www/plugins/enluminures_typographiques_v3/icones_barre/right.png
www/plugins/enluminures_typographiques_v3/icones_barre/tag.png
www/plugins/enluminures_typographiques_v3/icones_barre/text_strikethrough.png
www/plugins/enluminures_typographiques_v3/img_pack/e.gif
www/plugins/enluminures_typographiques_v3/img_pack/moinecopiste.gif
www/plugins/enluminures_typographiques_v3/lang/enlumtypo.xml
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_ar.php
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_en.php
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_es.php
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_fr.php
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_it.php
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_nl.php [new file with mode: 0644]
www/plugins/enluminures_typographiques_v3/lang/enlumtypo_ru.php [new file with mode: 0644]
www/plugins/enluminures_typographiques_v3/lang/paquet-typoenluminee.xml [new file with mode: 0644]
www/plugins/enluminures_typographiques_v3/lang/paquet-typoenluminee_fr.php
www/plugins/enluminures_typographiques_v3/paquet.xml
www/plugins/enluminures_typographiques_v3/plugin.xml
www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-16.png
www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-32.png
www/plugins/enluminures_typographiques_v3/svn.revision
www/plugins/enluminures_typographiques_v3/typoenluminee.php
www/plugins/enluminures_typographiques_v3/typoenluminee_administrations.php [new file with mode: 0644]
www/plugins/enluminures_typographiques_v3/typoenluminee_options.php
www/plugins/enluminures_typographiques_v3/typoenluminee_pipelines.php
www/plugins/facteur/classes/facteur.php
www/plugins/facteur/emails/test_email_html.html
www/plugins/facteur/emails/texte.html
www/plugins/facteur/facteur_fonctions.php
www/plugins/facteur/facteur_pipelines.php
www/plugins/facteur/formulaires/configurer_facteur.html
www/plugins/facteur/formulaires/configurer_facteur.php
www/plugins/facteur/inc/envoyer_mail.php
www/plugins/facteur/lang/facteur.xml
www/plugins/facteur/lang/facteur_de.php
www/plugins/facteur/lang/facteur_en.php
www/plugins/facteur/lang/facteur_es.php
www/plugins/facteur/lang/facteur_fa.php
www/plugins/facteur/lang/facteur_fr.php
www/plugins/facteur/lang/facteur_fr_tu.php
www/plugins/facteur/lang/facteur_it.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_nl.php
www/plugins/facteur/lang/facteur_oc_ni_mis.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_pt_br.php [new file with mode: 0644]
www/plugins/facteur/lang/facteur_sk.php
www/plugins/facteur/lang/paquet-facteur.xml
www/plugins/facteur/lang/paquet-facteur_de.php
www/plugins/facteur/lang/paquet-facteur_en.php
www/plugins/facteur/lang/paquet-facteur_es.php
www/plugins/facteur/lang/paquet-facteur_fr.php
www/plugins/facteur/lang/paquet-facteur_fr_tu.php
www/plugins/facteur/lang/paquet-facteur_nl.php
www/plugins/facteur/lang/paquet-facteur_pt_br.php [new file with mode: 0644]
www/plugins/facteur/lang/paquet-facteur_ru.php
www/plugins/facteur/lang/paquet-facteur_sk.php
www/plugins/facteur/paquet.xml
www/plugins/facteur/phpmailer-php5/LICENSE
www/plugins/facteur/phpmailer-php5/PHPMailerAutoload.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/README [deleted file]
www/plugins/facteur/phpmailer-php5/README.md [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/VERSION [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/changelog.md [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/class.phpmailer.php
www/plugins/facteur/phpmailer-php5/class.phpmaileroauth.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/class.phpmaileroauthgoogle.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/class.pop3.php
www/plugins/facteur/phpmailer-php5/class.smtp.php
www/plugins/facteur/phpmailer-php5/composer.json [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/extras/EasyPeasyICS.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/extras/README.md [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/extras/htmlfilter.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/extras/ntlm_sasl_client.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/get_oauth_token.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-am.php [new file with mode: 0755]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ar.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-az.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-be.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-bg.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-br.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ca.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ch.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-cz.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-de.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-dk.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-el.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php [deleted file]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-eo.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-es.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-et.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fa.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fi.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fo.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fr.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-gl.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-he.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hr.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hu.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-id.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-it.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ja.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ka.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ko.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lt.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lv.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ms.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-nl.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-no.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pl.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pt.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ro.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ru.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-se.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sk.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sl.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sr.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-tr.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-uk.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-vi.php [new file with mode: 0644]
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh.php
www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-zh_cn.php
www/plugins/facteur/phpmailer-php5/travis.phpunit.xml.dist [new file with mode: 0644]
www/plugins/facteur/svn.revision
www/plugins/formidable/action/dupliquer_formulaire.php
www/plugins/formidable/action/editer_formulaire.php
www/plugins/formidable/action/exporter_analyse_reponses.php [deleted file]
www/plugins/formidable/action/exporter_formulaire.php
www/plugins/formidable/action/exporter_formulaires_reponses.php [deleted file]
www/plugins/formidable/action/supprimer_formulaire.php
www/plugins/formidable/action/supprimer_formulaires_reponse.php
www/plugins/formidable/action/vider_formulaire.php
www/plugins/formidable/base/formidable_tables.php
www/plugins/formidable/echanger/formulaire/forms.php
www/plugins/formidable/echanger/formulaire/wcs.php
www/plugins/formidable/echanger/formulaire/yaml.php
www/plugins/formidable/exec/puce_statut_formulaires.php
www/plugins/formidable/formidable_administrations.php
www/plugins/formidable/formidable_autorisations.php
www/plugins/formidable/formidable_fonctions.php
www/plugins/formidable/formidable_options.php
www/plugins/formidable/formidable_pipelines.php
www/plugins/formidable/formulaires/configurer_formidable_analyse.html
www/plugins/formidable/formulaires/editer_formulaire.html
www/plugins/formidable/formulaires/editer_formulaire.php
www/plugins/formidable/formulaires/editer_formulaire_champs.php
www/plugins/formidable/formulaires/editer_formulaire_traitements.html
www/plugins/formidable/formulaires/editer_formulaire_traitements.php
www/plugins/formidable/formulaires/exporter_formulaire_analyse.html [new file with mode: 0644]
www/plugins/formidable/formulaires/exporter_formulaire_analyse.php [new file with mode: 0644]
www/plugins/formidable/formulaires/exporter_formulaire_reponses.html [new file with mode: 0644]
www/plugins/formidable/formulaires/exporter_formulaire_reponses.php [new file with mode: 0644]
www/plugins/formidable/formulaires/formidable.html
www/plugins/formidable/formulaires/formidable.php
www/plugins/formidable/formulaires/importer_formulaire.html
www/plugins/formidable/formulaires/importer_formulaire.php
www/plugins/formidable/formulaires/inc-formidable-unicite.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/formulaires-ressource.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/formulaires.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/formulaires_reponses-ressource.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/formulaires_reponses.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/formulaires_reponses.php [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/inc-formulaire.html [new file with mode: 0644]
www/plugins/formidable/http/collectionjson/inc-formulaires_reponse.html [new file with mode: 0644]
www/plugins/formidable/icones_barre/formulaire.png
www/plugins/formidable/images/formidable-128.png
www/plugins/formidable/images/formidable-24.png
www/plugins/formidable/images/formidable-64.png
www/plugins/formidable/images/formulaire-24.png
www/plugins/formidable/images/formulaire-action-ajouter.png
www/plugins/formidable/images/formulaire-analyse-24.png
www/plugins/formidable/images/formulaire-config-auteurs-24.png
www/plugins/formidable/images/formulaire-config-champs-24.png
www/plugins/formidable/images/formulaire-config-traitements-24.png
www/plugins/formidable/images/formulaire-dupliquer-24.png
www/plugins/formidable/images/formulaire-editer-24.png
www/plugins/formidable/images/formulaire-exporter-24.png
www/plugins/formidable/images/formulaire-nouveau-48.png
www/plugins/formidable/images/formulaire-reponse-24.png
www/plugins/formidable/images/formulaire-reponse-supprimer-24.png
www/plugins/formidable/images/formulaire-reponses-24.png
www/plugins/formidable/images/formulaire-reponses-exporter-24.png
www/plugins/formidable/images/formulaire-reponses-supprimer-24.png
www/plugins/formidable/images/formulaire-supprimer-24.png
www/plugins/formidable/inc/formidable.php
www/plugins/formidable/inc/rechercher_joints_formulaires_reponse_formulaires_reponses_champ.php
www/plugins/formidable/lang/formidable.xml
www/plugins/formidable/lang/formidable_ar.php [new file with mode: 0644]
www/plugins/formidable/lang/formidable_de.php
www/plugins/formidable/lang/formidable_en.php
www/plugins/formidable/lang/formidable_es.php
www/plugins/formidable/lang/formidable_fr.php
www/plugins/formidable/lang/formidable_it.php
www/plugins/formidable/lang/formidable_pt_br.php [new file with mode: 0644]
www/plugins/formidable/lang/formidable_ru.php [new file with mode: 0644]
www/plugins/formidable/lang/formidable_sk.php
www/plugins/formidable/lang/formulaire.xml [new file with mode: 0644]
www/plugins/formidable/lang/formulaire_fr.php
www/plugins/formidable/lang/formulaire_ru.php [new file with mode: 0644]
www/plugins/formidable/lang/formulaires_reponse.xml [new file with mode: 0644]
www/plugins/formidable/lang/formulaires_reponse_fr.php
www/plugins/formidable/lang/paquet-formidable.xml
www/plugins/formidable/lang/paquet-formidable_en.php [new file with mode: 0644]
www/plugins/formidable/lang/paquet-formidable_es.php
www/plugins/formidable/lang/paquet-formidable_fr.php
www/plugins/formidable/modeles/form.html
www/plugins/formidable/modeles/formulaires_reponse.html
www/plugins/formidable/paquet.xml
www/plugins/formidable/prive/objets/liste/formulaires.html
www/plugins/formidable/prive/objets/liste/formulaires_associer.html [new file with mode: 0644]
www/plugins/formidable/prive/objets/liste/formulaires_associer_fonctions.php [new file with mode: 0644]
www/plugins/formidable/prive/objets/liste/formulaires_lies.html [new file with mode: 0644]
www/plugins/formidable/prive/objets/liste/formulaires_lies_fonctions.php [new file with mode: 0644]
www/plugins/formidable/prive/squelettes/contenu/formulaire.html
www/plugins/formidable/prive/squelettes/contenu/formulaires_reponse.html
www/plugins/formidable/prive/squelettes/extra/formulaire.html
www/plugins/formidable/prive/squelettes/extra/formulaires_analyse.html
www/plugins/formidable/prive/squelettes/extra/formulaires_reponses.html
www/plugins/formidable/prive/squelettes/inclure/formulaires_reponses-filtres.html
www/plugins/formidable/prive/squelettes/navigation/formulaire.html
www/plugins/formidable/prive/squelettes/navigation/formulaires_analyse.html
www/plugins/formidable/prive/squelettes/navigation/formulaires_reponse.html
www/plugins/formidable/prive/squelettes/navigation/formulaires_reponses.html
www/plugins/formidable/prive/themes/basic/images/formulaire-16.png
www/plugins/formidable/prive/themes/spip/images/formulaire-16.png
www/plugins/formidable/prive/themes/spip/images/formulaire-24.png
www/plugins/formidable/prive/themes/spip/images/formulaires_reponse-24.png
www/plugins/formidable/public/formidable_criteres.php
www/plugins/formidable/puce_statut/formulaires_reponse.php
www/plugins/formidable/svn.revision
www/plugins/formidable/traiter/email.php
www/plugins/formidable/traiter/email.yaml
www/plugins/formidable/traiter/enregistrement.php
www/plugins/gis/action/editer_gis.php
www/plugins/gis/action/editer_lien_gis.php
www/plugins/gis/action/gis_geocoder_rechercher.php
www/plugins/gis/action/kml_infos.php
www/plugins/gis/action/supprimer_gis.php
www/plugins/gis/base/gis.php
www/plugins/gis/crud/gis.php
www/plugins/gis/css/leaflet_nodirection.css [new file with mode: 0644]
www/plugins/gis/embed/kml_fonctions.php
www/plugins/gis/formulaires/configurer_gis.html
www/plugins/gis/formulaires/configurer_gis.php
www/plugins/gis/formulaires/editer_gis.html
www/plugins/gis/formulaires/editer_gis.php
www/plugins/gis/formulaires/gis_inserer_modeles_traiter.php
www/plugins/gis/formulaires/rechercher_gis.php
www/plugins/gis/gis_administrations.php
www/plugins/gis/gis_autoriser.php
www/plugins/gis/gis_fonctions.php
www/plugins/gis/gis_options.php
www/plugins/gis/gis_pipelines.php
www/plugins/gis/icones_barre/gis.png
www/plugins/gis/images/gis-16.png
www/plugins/gis/images/gis-24.png
www/plugins/gis/images/gis.png
www/plugins/gis/inc/gis_xmlrpc.php
www/plugins/gis/inc/iptc.php
www/plugins/gis/inc/kml_infos.php
www/plugins/gis/javascript/.eslintrc [new file with mode: 0644]
www/plugins/gis/javascript/gis.js.html
www/plugins/gis/javascript/gis_geocoder.js
www/plugins/gis/javascript/gis_utils.js
www/plugins/gis/javascript/leaflet.gis.js
www/plugins/gis/json/gis.html
www/plugins/gis/json/gis_articles.html
www/plugins/gis/json/gis_articles_branche.html
www/plugins/gis/json/gis_auteurs.html
www/plugins/gis/json/gis_documents.html
www/plugins/gis/json/gis_evenements.html
www/plugins/gis/json/gis_mots.html
www/plugins/gis/json/gis_organisations.html
www/plugins/gis/json/gis_rubriques.html
www/plugins/gis/json/gis_sites.html
www/plugins/gis/json/gis_tous_avec_liens_espace_prive.html
www/plugins/gis/lang/gis.xml
www/plugins/gis/lang/gis_de.php
www/plugins/gis/lang/gis_en.php
www/plugins/gis/lang/gis_es.php
www/plugins/gis/lang/gis_fr.php
www/plugins/gis/lang/gis_nl.php
www/plugins/gis/lang/gis_ru.php
www/plugins/gis/lang/gis_sk.php
www/plugins/gis/lang/paquet-gis_en.php
www/plugins/gis/lang/paquet-gis_es.php
www/plugins/gis/lang/paquet-gis_fr.php
www/plugins/gis/lang/paquet-gis_nl.php
www/plugins/gis/lang/paquet-gis_ru.php
www/plugins/gis/lang/paquet-gis_sk.php
www/plugins/gis/lib/leaflet/README.md
www/plugins/gis/lib/leaflet/plugins/Bing.js
www/plugins/gis/lib/leaflet/plugins/Control.FullScreen.js
www/plugins/gis/lib/leaflet/plugins/Control.MiniMap.js
www/plugins/gis/lib/leaflet/plugins/GPX.Speed.js
www/plugins/gis/lib/leaflet/plugins/GPX.js
www/plugins/gis/lib/leaflet/plugins/Google.js
www/plugins/gis/lib/leaflet/plugins/KML.js
www/plugins/gis/lib/leaflet/plugins/Marker.Rotate.js
www/plugins/gis/lib/leaflet/plugins/TOPOJSON.js [new file with mode: 0644]
www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen-2x.png
www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen.png
www/plugins/gis/lib/leaflet/plugins/images/toggle.png
www/plugins/gis/lib/leaflet/plugins/images/toggle.svg [new file with mode: 0644]
www/plugins/gis/lib/leaflet/plugins/leaflet-plugins.css
www/plugins/gis/lib/leaflet/plugins/leaflet-providers.js
www/plugins/gis/lib/leaflet/plugins/leaflet.markercluster-src.js
www/plugins/gis/lib/leaflet/plugins/leaflet.markercluster.css
www/plugins/gis/modeles/carte_gis.html
www/plugins/gis/modeles/carte_gis_preview.html
www/plugins/gis/paquet.xml
www/plugins/gis/prive/contenu/gis_objet.html
www/plugins/gis/prive/inclure/gis_objet_formulaires.html
www/plugins/gis/prive/objets/liste/gis_associer.html
www/plugins/gis/prive/objets/liste/gis_associer_fonctions.php
www/plugins/gis/prive/objets/liste/gis_lies.html
www/plugins/gis/prive/objets/liste/gis_lies_fonctions.php
www/plugins/gis/prive/squelettes/contenu/gis.html
www/plugins/gis/prive/style_prive_plugin_gis.html
www/plugins/gis/prive/themes/spip/images/gis-16.png
www/plugins/gis/prive/themes/spip/images/gis-24.png
www/plugins/gis/prive/themes/spip/images/gis-new-16.png
www/plugins/gis/saisies/carte.html
www/plugins/gis/svn.revision
www/plugins/gis/tests/gis_connect_sql.php
www/plugins/menus_1/action/editer_menu.php
www/plugins/menus_1/action/editer_menus_entree.php
www/plugins/menus_1/action/generer_menus.php [new file with mode: 0644]
www/plugins/menus_1/css/menuspip.css
www/plugins/menus_1/formulaires/editer_menu.html
www/plugins/menus_1/formulaires/editer_menu.php
www/plugins/menus_1/formulaires/editer_menus_entree.html
www/plugins/menus_1/formulaires/editer_menus_entree.php
www/plugins/menus_1/formulaires/inc-menus_entrees.html
www/plugins/menus_1/formulaires/inc-nouvelle_entree-1.html
www/plugins/menus_1/formulaires/inc-nouvelle_entree-2.html
www/plugins/menus_1/images/menus_rechercher.png [new file with mode: 0755]
www/plugins/menus_1/inc/menus.php
www/plugins/menus_1/lang/menus.xml
www/plugins/menus_1/lang/menus_ar.php
www/plugins/menus_1/lang/menus_ca.php
www/plugins/menus_1/lang/menus_de.php
www/plugins/menus_1/lang/menus_en.php
www/plugins/menus_1/lang/menus_es.php
www/plugins/menus_1/lang/menus_fa.php
www/plugins/menus_1/lang/menus_fr.php
www/plugins/menus_1/lang/menus_it.php
www/plugins/menus_1/lang/menus_nl.php
www/plugins/menus_1/lang/menus_pt_br.php [new file with mode: 0644]
www/plugins/menus_1/lang/menus_ru.php
www/plugins/menus_1/lang/menus_sk.php
www/plugins/menus_1/lang/paquet-menus.xml
www/plugins/menus_1/lang/paquet-menus_ar.php
www/plugins/menus_1/lang/paquet-menus_de.php
www/plugins/menus_1/lang/paquet-menus_en.php
www/plugins/menus_1/lang/paquet-menus_es.php
www/plugins/menus_1/lang/paquet-menus_fr.php
www/plugins/menus_1/lang/paquet-menus_it.php
www/plugins/menus_1/lang/paquet-menus_nl.php
www/plugins/menus_1/lang/paquet-menus_pt_br.php [new file with mode: 0644]
www/plugins/menus_1/lang/paquet-menus_sk.php
www/plugins/menus_1/menus/lien.html
www/plugins/menus_1/menus/objet.html
www/plugins/menus_1/menus/objet.xml
www/plugins/menus_1/menus/page_speciale.html
www/plugins/menus_1/menus/recherche.html [new file with mode: 0644]
www/plugins/menus_1/menus/recherche.xml [new file with mode: 0644]
www/plugins/menus_1/menus_fonctions.php
www/plugins/menus_1/menus_ieconfig.php
www/plugins/menus_1/paquet.xml
www/plugins/menus_1/prive/squelettes/contenu/menus_tous.html
www/plugins/menus_1/svn.revision
www/plugins/multilang/CHANGELOG.md [new file with mode: 0644]
www/plugins/multilang/formulaires/configurer_multilang.html
www/plugins/multilang/formulaires/configurer_multilang_fonctions.php
www/plugins/multilang/images/background.png
www/plugins/multilang/images/multi_forbidden.png
www/plugins/multilang/images/multi_undefined.png
www/plugins/multilang/images/multilang-16.png
www/plugins/multilang/images/multilang-24.png
www/plugins/multilang/images/multilang-32.png
www/plugins/multilang/images/multilang-48.png
www/plugins/multilang/javascript/multilang.js
www/plugins/multilang/javascript/multilang_init.js_fonctions.php
www/plugins/multilang/lang/multilang.xml
www/plugins/multilang/lang/multilang_de.php [new file with mode: 0644]
www/plugins/multilang/lang/multilang_en.php
www/plugins/multilang/lang/multilang_es.php
www/plugins/multilang/lang/multilang_fa.php
www/plugins/multilang/lang/multilang_fr.php
www/plugins/multilang/lang/multilang_nl.php
www/plugins/multilang/lang/multilang_ru.php [new file with mode: 0644]
www/plugins/multilang/lang/multilang_sk.php
www/plugins/multilang/lang/multilang_uk.php [new file with mode: 0644]
www/plugins/multilang/lang/paquet-multilang.xml
www/plugins/multilang/lang/paquet-multilang_de.php [new file with mode: 0644]
www/plugins/multilang/lang/paquet-multilang_en.php
www/plugins/multilang/lang/paquet-multilang_es.php
www/plugins/multilang/lang/paquet-multilang_fr.php
www/plugins/multilang/lang/paquet-multilang_it.php
www/plugins/multilang/lang/paquet-multilang_nl.php
www/plugins/multilang/lang/paquet-multilang_ru.php
www/plugins/multilang/lang/paquet-multilang_sk.php
www/plugins/multilang/lang/paquet-multilang_uk.php [new file with mode: 0644]
www/plugins/multilang/multilang.css.html
www/plugins/multilang/multilang_administrations.php
www/plugins/multilang/multilang_pipelines.php
www/plugins/multilang/paquet.xml
www/plugins/multilang/prive/style_prive_plugin_multilang.html
www/plugins/multilang/prive/themes/spip/images/multilang-16.png
www/plugins/multilang/prive/themes/spip/images/multilang-24.png
www/plugins/multilang/svn.revision
www/plugins/nospam/inc/detecter_langue.php
www/plugins/nospam/lang/nospam.xml
www/plugins/nospam/lang/nospam_ar.php
www/plugins/nospam/lang/nospam_de.php [new file with mode: 0644]
www/plugins/nospam/lang/nospam_en.php
www/plugins/nospam/lang/nospam_es.php
www/plugins/nospam/lang/nospam_fa.php
www/plugins/nospam/lang/nospam_fr.php
www/plugins/nospam/lang/nospam_fr_tu.php
www/plugins/nospam/lang/nospam_nl.php
www/plugins/nospam/lang/nospam_sk.php
www/plugins/nospam/lang/paquet-nospam_ar.php
www/plugins/nospam/lang/paquet-nospam_de.php
www/plugins/nospam/lang/paquet-nospam_en.php
www/plugins/nospam/lang/paquet-nospam_es.php
www/plugins/nospam/lang/paquet-nospam_fr.php
www/plugins/nospam/lang/paquet-nospam_fr_tu.php
www/plugins/nospam/lang/paquet-nospam_nl.php
www/plugins/nospam/lang/paquet-nospam_sk.php
www/plugins/nospam/nospam/verifier_formulaire_forum.php
www/plugins/nospam/nospam_pipelines.php
www/plugins/nospam/paquet.xml
www/plugins/nospam/plugin.xml
www/plugins/nospam/svn.revision
www/plugins/notifications2/formulaires/abonner_notifications.php
www/plugins/notifications2/formulaires/configurer_notifications.html
www/plugins/notifications2/lang/notifications.xml
www/plugins/notifications2/lang/notifications_de.php [new file with mode: 0644]
www/plugins/notifications2/lang/notifications_en.php
www/plugins/notifications2/lang/notifications_es.php
www/plugins/notifications2/lang/notifications_fa.php
www/plugins/notifications2/lang/notifications_fr.php
www/plugins/notifications2/lang/notifications_nl.php
www/plugins/notifications2/lang/notifications_sk.php
www/plugins/notifications2/lang/paquet-notifications.xml
www/plugins/notifications2/lang/paquet-notifications_de.php [new file with mode: 0644]
www/plugins/notifications2/lang/paquet-notifications_en.php
www/plugins/notifications2/lang/paquet-notifications_es.php
www/plugins/notifications2/lang/paquet-notifications_fa.php
www/plugins/notifications2/lang/paquet-notifications_fr.php
www/plugins/notifications2/lang/paquet-notifications_nl.php
www/plugins/notifications2/lang/paquet-notifications_sk.php
www/plugins/notifications2/notifications/article_refuse.html [new file with mode: 0644]
www/plugins/notifications2/notifications/forum_poste.html
www/plugins/notifications2/notifications/forumvalide.php
www/plugins/notifications2/notifications/instituerarticle.php
www/plugins/notifications2/notifications_pipelines.php
www/plugins/notifications2/paquet.xml
www/plugins/notifications2/svn.revision
www/plugins/odt2spip_30/action/odt2spip_importe.php
www/plugins/odt2spip_30/paquet.xml
www/plugins/odt2spip_30/svn.revision
www/plugins/redirhttps.bak/images/redirhttps-128.png [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/paquet-redirhttps.xml [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/paquet-redirhttps_en.php [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/paquet-redirhttps_es.php [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/paquet-redirhttps_fr.php [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/paquet-redirhttps_sk.php [new file with mode: 0644]
www/plugins/redirhttps.bak/lang/redirhttps.xml [new file with mode: 0644]
www/plugins/redirhttps.bak/paquet.xml [new file with mode: 0644]
www/plugins/redirhttps.bak/plugin.xml [new file with mode: 0755]
www/plugins/redirhttps.bak/redirhttps_options.php [new file with mode: 0755]
www/plugins/redirhttps.bak/svn.revision [new file with mode: 0644]
www/plugins/redirhttps/images/redirhttps-128.png [deleted file]
www/plugins/redirhttps/lang/paquet-redirhttps.xml [deleted file]
www/plugins/redirhttps/lang/paquet-redirhttps_en.php [deleted file]
www/plugins/redirhttps/lang/paquet-redirhttps_es.php [deleted file]
www/plugins/redirhttps/lang/paquet-redirhttps_fr.php [deleted file]
www/plugins/redirhttps/lang/paquet-redirhttps_sk.php [deleted file]
www/plugins/redirhttps/lang/redirhttps.xml [deleted file]
www/plugins/redirhttps/paquet.xml [deleted file]
www/plugins/redirhttps/plugin.xml [deleted file]
www/plugins/redirhttps/redirhttps_options.php [deleted file]
www/plugins/redirhttps/svn.revision [deleted file]
www/plugins/rss_article_3_0/base/rssarticle.php
www/plugins/rss_article_3_0/exec/rss_article.php
www/plugins/rss_article_3_0/formulaires/configurer_rssarticle.html
www/plugins/rss_article_3_0/formulaires/editer_rssarticle.html
www/plugins/rss_article_3_0/formulaires/editer_rssarticle.php
www/plugins/rss_article_3_0/genie/rssarticle_copie.php
www/plugins/rss_article_3_0/lang/rssarticle_ar.php
www/plugins/rss_article_3_0/lang/rssarticle_fr.php
www/plugins/rss_article_3_0/paquet.xml
www/plugins/rss_article_3_0/prive/contenu/rssarticle.html
www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-128.png
www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-16.png
www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-32.png
www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-64.png
www/plugins/rss_article_3_0/rssarticle_administrations.php
www/plugins/rss_article_3_0/rssarticle_pipelines.php
www/plugins/rss_article_3_0/svn.revision
www/plugins/saisies/action/deplacer_saisie.php
www/plugins/saisies/balise/configurer_saisie.php
www/plugins/saisies/balise/generer_saisies.php
www/plugins/saisies/balise/saisie.php
www/plugins/saisies/balise/voir_saisie.php
www/plugins/saisies/balise/voir_saisies.php
www/plugins/saisies/formulaires/construire_formulaire.html
www/plugins/saisies/formulaires/construire_formulaire.php
www/plugins/saisies/formulaires/saisies_cvt.php
www/plugins/saisies/images/formulaire-annuler-16.png
www/plugins/saisies/images/formulaire-configurer-16.png
www/plugins/saisies/images/formulaire-deplacer-16.png
www/plugins/saisies/images/formulaire-dupliquer-16.png
www/plugins/saisies/images/formulaire-enregistrer-16.png
www/plugins/saisies/images/formulaire-reinitialiser-24.png
www/plugins/saisies/images/formulaire-saisie-defaut.png
www/plugins/saisies/images/formulaire-supprimer-16.png
www/plugins/saisies/images/logo_saisie_48.png
www/plugins/saisies/images/saisies_auteurs.png
www/plugins/saisies/images/saisies_case.png
www/plugins/saisies/images/saisies_checkbox.png
www/plugins/saisies/images/saisies_date.png
www/plugins/saisies/images/saisies_explication.png
www/plugins/saisies/images/saisies_fieldset.png
www/plugins/saisies/images/saisies_hidden.png
www/plugins/saisies/images/saisies_input.png
www/plugins/saisies/images/saisies_oui_non.png
www/plugins/saisies/images/saisies_radio.png
www/plugins/saisies/images/saisies_selecteur_article.png
www/plugins/saisies/images/saisies_selecteur_rubrique.png
www/plugins/saisies/images/saisies_selecteur_rubrique_article.png
www/plugins/saisies/images/saisies_selection.png
www/plugins/saisies/images/saisies_selection_multiple.png
www/plugins/saisies/images/saisies_textarea.png
www/plugins/saisies/inc/saisies.php
www/plugins/saisies/inc/saisies_afficher.php
www/plugins/saisies/inc/saisies_lister.php
www/plugins/saisies/inc/saisies_manipuler.php
www/plugins/saisies/inclure/configurer_saisie_fonctions.php
www/plugins/saisies/lang/paquet-saisies_ar.php
www/plugins/saisies/lang/paquet-saisies_de.php
www/plugins/saisies/lang/paquet-saisies_en.php
www/plugins/saisies/lang/paquet-saisies_es.php
www/plugins/saisies/lang/paquet-saisies_fr.php
www/plugins/saisies/lang/paquet-saisies_fr_tu.php
www/plugins/saisies/lang/paquet-saisies_nl.php
www/plugins/saisies/lang/paquet-saisies_pt_br.php
www/plugins/saisies/lang/paquet-saisies_ru.php
www/plugins/saisies/lang/paquet-saisies_sk.php
www/plugins/saisies/lang/saisies.xml
www/plugins/saisies/lang/saisies_ca.php
www/plugins/saisies/lang/saisies_de.php
www/plugins/saisies/lang/saisies_en.php
www/plugins/saisies/lang/saisies_es.php
www/plugins/saisies/lang/saisies_fa.php
www/plugins/saisies/lang/saisies_fr.php
www/plugins/saisies/lang/saisies_fr_tu.php
www/plugins/saisies/lang/saisies_it.php
www/plugins/saisies/lang/saisies_nl.php
www/plugins/saisies/lang/saisies_pt_br.php
www/plugins/saisies/lang/saisies_ru.php
www/plugins/saisies/lang/saisies_sk.php
www/plugins/saisies/paquet.xml
www/plugins/saisies/saisies-vues/selecteur_article_fonctions.php
www/plugins/saisies/saisies/_base.html
www/plugins/saisies/saisies/checkbox.html
www/plugins/saisies/saisies/choisir_objets.html
www/plugins/saisies/saisies/fieldset.html
www/plugins/saisies/saisies/input.html
www/plugins/saisies/saisies/oui_non.html
www/plugins/saisies/saisies/selecteur_article.html
www/plugins/saisies/saisies/selecteur_article.yaml
www/plugins/saisies/saisies/selection.html
www/plugins/saisies/saisies/textarea.html
www/plugins/saisies/saisies_fonctions.php
www/plugins/saisies/saisies_options.php
www/plugins/saisies/saisies_pipelines.php
www/plugins/saisies/svn.revision
www/plugins/seo-dev/action/editer_seo.php [new file with mode: 0644]
www/plugins/seo-dev/base/seo_tables.php [new file with mode: 0644]
www/plugins/seo-dev/formulaires/configurer_seo.html [new file with mode: 0644]
www/plugins/seo-dev/formulaires/configurer_seo.php [new file with mode: 0644]
www/plugins/seo-dev/formulaires/editer_seo.html [new file with mode: 0644]
www/plugins/seo-dev/formulaires/editer_seo.php [new file with mode: 0644]
www/plugins/seo-dev/formulaires/inc-editer-seo.html [new file with mode: 0644]
www/plugins/seo-dev/img_pack/alexa-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/bing-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/canonical_url-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/google_analytics-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/google_webmaster-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/meta_tags-24.png [new file with mode: 0644]
www/plugins/seo-dev/img_pack/seo-24.png [new file with mode: 0644]
www/plugins/seo-dev/inclure/seo-head.html [new file with mode: 0644]
www/plugins/seo-dev/javascript/jquery.simplycountable.js [new file with mode: 0644]
www/plugins/seo-dev/javascript/seo.js.html [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo.xml [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_en.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_es.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_fr.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_nl.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_pt_br.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_ru.php [new file with mode: 0644]
www/plugins/seo-dev/lang/paquet-seo_sk.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo.xml [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_en.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_es.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_fr.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_nl.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_pt_br.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_ru.php [new file with mode: 0644]
www/plugins/seo-dev/lang/seo_sk.php [new file with mode: 0644]
www/plugins/seo-dev/paquet.xml [new file with mode: 0644]
www/plugins/seo-dev/prive/objets/seo-metas.html [new file with mode: 0644]
www/plugins/seo-dev/prive/squelettes/contenu/configurer_seo.html [new file with mode: 0644]
www/plugins/seo-dev/prive/squelettes/inclure/seo_metas.html [new file with mode: 0644]
www/plugins/seo-dev/prive/style_prive_plugin_seo.html [new file with mode: 0644]
www/plugins/seo-dev/prive/themes/spip/images/seo-16.png [new file with mode: 0644]
www/plugins/seo-dev/prive/themes/spip/images/seo-24.png [new file with mode: 0644]
www/plugins/seo-dev/seo.png [new file with mode: 0644]
www/plugins/seo-dev/seo_administrations.php [new file with mode: 0644]
www/plugins/seo-dev/seo_fonctions.php [new file with mode: 0644]
www/plugins/seo-dev/seo_pipelines.php [new file with mode: 0644]
www/plugins/seo-dev/seo_pipelines_ecrire.php [new file with mode: 0644]
www/plugins/seo-dev/svn.revision [new file with mode: 0644]
www/plugins/seo-v1/action/editer_seo.php [deleted file]
www/plugins/seo-v1/base/seo_tables.php [deleted file]
www/plugins/seo-v1/exec/seo_config.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_alexa.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_alexa.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_bing.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_bing.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_insert_head.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_insert_head.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_metas.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_metas.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.php [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.html [deleted file]
www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.php [deleted file]
www/plugins/seo-v1/formulaires/editer_seo.html [deleted file]
www/plugins/seo-v1/formulaires/editer_seo.php [deleted file]
www/plugins/seo-v1/img_pack/alexa-24.png [deleted file]
www/plugins/seo-v1/img_pack/bing-24.png [deleted file]
www/plugins/seo-v1/img_pack/canonical_url-24.png [deleted file]
www/plugins/seo-v1/img_pack/google_analytics-24.png [deleted file]
www/plugins/seo-v1/img_pack/google_webmaster-24.png [deleted file]
www/plugins/seo-v1/img_pack/meta_tags-24.png [deleted file]
www/plugins/seo-v1/img_pack/seo-24.png [deleted file]
www/plugins/seo-v1/lang/paquet-seo.xml [deleted file]
www/plugins/seo-v1/lang/paquet-seo_en.php [deleted file]
www/plugins/seo-v1/lang/paquet-seo_fr.php [deleted file]
www/plugins/seo-v1/lang/paquet-seo_ru.php [deleted file]
www/plugins/seo-v1/lang/paquet-seo_sk.php [deleted file]
www/plugins/seo-v1/lang/seo.xml [deleted file]
www/plugins/seo-v1/lang/seo_en.php [deleted file]
www/plugins/seo-v1/lang/seo_fr.php [deleted file]
www/plugins/seo-v1/lang/seo_ru.php [deleted file]
www/plugins/seo-v1/lang/seo_sk.php [deleted file]
www/plugins/seo-v1/paquet.xml [deleted file]
www/plugins/seo-v1/pipelines/seo_affichage_final.php [deleted file]
www/plugins/seo-v1/pipelines/seo_affiche_milieu.php [deleted file]
www/plugins/seo-v1/pipelines/seo_ajouter_onglets.php [deleted file]
www/plugins/seo-v1/pipelines/seo_autoriser.php [deleted file]
www/plugins/seo-v1/pipelines/seo_insert_head.php [deleted file]
www/plugins/seo-v1/plugin.xml [deleted file]
www/plugins/seo-v1/prive/configurer_seo.html [deleted file]
www/plugins/seo-v1/prive/squelettes/contenu/configurer_seo.html [deleted file]
www/plugins/seo-v1/prive/squelettes/inclure/seo_metas.html [deleted file]
www/plugins/seo-v1/prive/style_prive_plugin_seo.html [deleted file]
www/plugins/seo-v1/prive/themes/spip/images/seo-16.png [deleted file]
www/plugins/seo-v1/prive/themes/spip/images/seo-24.png [deleted file]
www/plugins/seo-v1/seo.png [deleted file]
www/plugins/seo-v1/seo_administrations.php [deleted file]
www/plugins/seo-v1/seo_fonctions.php [deleted file]
www/plugins/seo-v1/svn.revision [deleted file]
www/plugins/skel_lhc/plugin.xml
www/plugins/spip-bonux-3/img_pack/annuler-recherche.png
www/plugins/spip-bonux-3/img_pack/article-12.png
www/plugins/spip-bonux-3/img_pack/deplier-droite.png
www/plugins/spip-bonux-3/img_pack/frame-close.png
www/plugins/spip-bonux-3/img_pack/item-add.png
www/plugins/spip-bonux-3/img_pack/item-remove.png
www/plugins/spip-bonux-3/img_pack/logo-bonux.gif
www/plugins/spip-bonux-3/img_pack/message_erreur-24.png
www/plugins/spip-bonux-3/img_pack/message_notice-24.png
www/plugins/spip-bonux-3/img_pack/message_ok-24.png
www/plugins/spip-bonux-3/img_pack/spip-bonux.png
www/plugins/spip-bonux-3/img_pack/tri_asc-12.png
www/plugins/spip-bonux-3/img_pack/tri_asc-16.png
www/plugins/spip-bonux-3/img_pack/tri_asc-24.png
www/plugins/spip-bonux-3/img_pack/tri_asc.png
www/plugins/spip-bonux-3/img_pack/tri_desc-12.png
www/plugins/spip-bonux-3/img_pack/tri_desc-16.png
www/plugins/spip-bonux-3/img_pack/tri_desc-24.png
www/plugins/spip-bonux-3/inc/date_gestion.php
www/plugins/spip-bonux-3/inc/exporter_csv.php
www/plugins/spip-bonux-3/inc/importer_csv.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux.xml
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ar.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_de.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_en.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_es.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_fa.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_fr.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_nl.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_pt_br.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ru.php
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_sk.php
www/plugins/spip-bonux-3/lang/spip_bonux.xml
www/plugins/spip-bonux-3/lang/spip_bonux_ar.php
www/plugins/spip-bonux-3/lang/spip_bonux_de.php
www/plugins/spip-bonux-3/lang/spip_bonux_en.php
www/plugins/spip-bonux-3/lang/spip_bonux_es.php
www/plugins/spip-bonux-3/lang/spip_bonux_fa.php
www/plugins/spip-bonux-3/lang/spip_bonux_fr.php
www/plugins/spip-bonux-3/lang/spip_bonux_nl.php
www/plugins/spip-bonux-3/lang/spip_bonux_pt_br.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_ru.php
www/plugins/spip-bonux-3/lang/spip_bonux_sk.php
www/plugins/spip-bonux-3/lib/array_column/array_column.php [new file with mode: 0755]
www/plugins/spip-bonux-3/modeles/pagination_noancre.html
www/plugins/spip-bonux-3/paquet.xml
www/plugins/spip-bonux-3/public/spip_bonux_balises.php
www/plugins/spip-bonux-3/public/spip_bonux_criteres.php
www/plugins/spip-bonux-3/spip_bonux_fonctions.php
www/plugins/spip-bonux-3/spip_bonux_options.php
www/plugins/spip-bonux-3/svn.revision
www/plugins/spip_piwik_2_0/balise/piwik.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik.xml
www/plugins/spip_piwik_2_0/lang/paquet-piwik_de.php [new file with mode: 0644]
www/plugins/spip_piwik_2_0/lang/paquet-piwik_en.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_es.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_fa.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_fr.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_nl.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_ru.php
www/plugins/spip_piwik_2_0/lang/paquet-piwik_sk.php
www/plugins/spip_piwik_2_0/lang/piwik.xml
www/plugins/spip_piwik_2_0/lang/piwik_ca.php
www/plugins/spip_piwik_2_0/lang/piwik_de.php
www/plugins/spip_piwik_2_0/lang/piwik_en.php
www/plugins/spip_piwik_2_0/lang/piwik_es.php
www/plugins/spip_piwik_2_0/lang/piwik_fa.php
www/plugins/spip_piwik_2_0/lang/piwik_fr.php
www/plugins/spip_piwik_2_0/lang/piwik_fr_tu.php
www/plugins/spip_piwik_2_0/lang/piwik_nl.php
www/plugins/spip_piwik_2_0/lang/piwik_sk.php
www/plugins/spip_piwik_2_0/paquet.xml
www/plugins/spip_piwik_2_0/plugin.xml
www/plugins/spip_piwik_2_0/svn.revision
www/plugins/verifier/aide/verifier_fonctions.php
www/plugins/verifier/images/verifier-128.png
www/plugins/verifier/inc/is_email.php
www/plugins/verifier/inc/verifier.php
www/plugins/verifier/lang/paquet-verifier.xml
www/plugins/verifier/lang/paquet-verifier_de.php
www/plugins/verifier/lang/paquet-verifier_en.php
www/plugins/verifier/lang/paquet-verifier_es.php
www/plugins/verifier/lang/paquet-verifier_fr.php
www/plugins/verifier/lang/paquet-verifier_fr_tu.php
www/plugins/verifier/lang/paquet-verifier_nl.php [new file with mode: 0644]
www/plugins/verifier/lang/paquet-verifier_ru.php
www/plugins/verifier/lang/paquet-verifier_sk.php
www/plugins/verifier/lang/verifier.xml
www/plugins/verifier/lang/verifier_ca.php
www/plugins/verifier/lang/verifier_de.php
www/plugins/verifier/lang/verifier_en.php
www/plugins/verifier/lang/verifier_es.php
www/plugins/verifier/lang/verifier_fa.php
www/plugins/verifier/lang/verifier_fr.php
www/plugins/verifier/lang/verifier_fr_tu.php
www/plugins/verifier/lang/verifier_it.php
www/plugins/verifier/lang/verifier_nl.php [new file with mode: 0644]
www/plugins/verifier/lang/verifier_pt_br.php
www/plugins/verifier/lang/verifier_ru.php
www/plugins/verifier/lang/verifier_sk.php
www/plugins/verifier/paquet.xml
www/plugins/verifier/plugin.xml
www/plugins/verifier/svn.revision
www/plugins/verifier/verifier/code_postal.php
www/plugins/verifier/verifier/code_postal.yaml [new file with mode: 0644]
www/plugins/verifier/verifier/comparaison_champ.php
www/plugins/verifier/verifier/comparaison_champ.yaml [new file with mode: 0644]
www/plugins/verifier/verifier/couleur.php
www/plugins/verifier/verifier/date.php
www/plugins/verifier/verifier/decimal.php
www/plugins/verifier/verifier/email.php
www/plugins/verifier/verifier/entier.php
www/plugins/verifier/verifier/id_document.php
www/plugins/verifier/verifier/id_document.yaml [new file with mode: 0644]
www/plugins/verifier/verifier/id_objet.php [new file with mode: 0644]
www/plugins/verifier/verifier/id_objet.yaml [new file with mode: 0644]
www/plugins/verifier/verifier/isbn.php
www/plugins/verifier/verifier/isbn.yaml [new file with mode: 0644]
www/plugins/verifier/verifier/regex.php
www/plugins/verifier/verifier/siren_siret.php
www/plugins/verifier/verifier/taille.php
www/plugins/verifier/verifier/telephone.php
www/plugins/verifier/verifier/url.php
www/plugins/yaml/experimental/yaml_fonctions.php
www/plugins/yaml/inc/yaml.php
www/plugins/yaml/inc/yaml_sfyaml.php
www/plugins/yaml/inc/yaml_to_array.php
www/plugins/yaml/lang/paquet-yaml.xml
www/plugins/yaml/lang/paquet-yaml_en.php
www/plugins/yaml/lang/paquet-yaml_es.php
www/plugins/yaml/lang/paquet-yaml_fa.php
www/plugins/yaml/lang/paquet-yaml_fr.php
www/plugins/yaml/lang/paquet-yaml_nl.php [new file with mode: 0644]
www/plugins/yaml/lang/paquet-yaml_ru.php
www/plugins/yaml/lang/paquet-yaml_sk.php
www/plugins/yaml/paquet.xml
www/plugins/yaml/plugin.xml
www/plugins/yaml/svn.revision
www/plugins/yaml/yaml_fonctions.php
www/plugins/zen-garden-2/images/themes-128.png
www/plugins/zen-garden-2/images/themes-32.png
www/plugins/zen-garden-2/images/themes-64.png
www/plugins/zen-garden-2/inc/zengarden.php
www/plugins/zen-garden-2/inclure/zengarden_switcher.js
www/plugins/zen-garden-2/lang/paquet-zengarden.xml
www/plugins/zen-garden-2/lang/paquet-zengarden_de.php [new file with mode: 0644]
www/plugins/zen-garden-2/lang/paquet-zengarden_en.php
www/plugins/zen-garden-2/lang/paquet-zengarden_es.php
www/plugins/zen-garden-2/lang/paquet-zengarden_fa.php
www/plugins/zen-garden-2/lang/paquet-zengarden_fr.php
www/plugins/zen-garden-2/lang/paquet-zengarden_nl.php
www/plugins/zen-garden-2/lang/paquet-zengarden_ru.php
www/plugins/zen-garden-2/lang/paquet-zengarden_sk.php
www/plugins/zen-garden-2/lang/zengarden_de.php
www/plugins/zen-garden-2/lang/zengarden_en.php
www/plugins/zen-garden-2/lang/zengarden_es.php
www/plugins/zen-garden-2/lang/zengarden_fa.php
www/plugins/zen-garden-2/lang/zengarden_fr.php
www/plugins/zen-garden-2/lang/zengarden_nl.php
www/plugins/zen-garden-2/lang/zengarden_sk.php
www/plugins/zen-garden-2/paquet.xml
www/plugins/zen-garden-2/prive/squelettes/inclure/zengarden_theme.html
www/plugins/zen-garden-2/prive/squelettes/inclure/zengarden_theme_actif.html
www/plugins/zen-garden-2/prive/themes/spip/images/themes-16.png
www/plugins/zen-garden-2/svn.revision
www/plugins/zen-garden-2/zengarden_fonctions.php
www/plugins/zen-garden-2/zengarden_options.php
www/plugins/zen-garden-2/zengarden_pipelines.php

index 80d1601..a74bb00 100644 (file)
@@ -1,13 +1,3 @@
-[(#REM) 
-       Stocker les traductions eventuelles de l'article en cours
-]
-<BOUCLE_article(ARTICLES){id_article}>
-#SET{ListeTraductions, #ARRAY{}}
-<BOUCLE_TraductionArticleCourant(ARTICLES){traduction}{lang !IN #CONFIG{menu_lang_liens/langues_invisibles,#ARRAY}}>
-       #SET_MERGE{ListeTraductions,#GET{ListeTraductions},#ARRAY{#LANG,#URL_ARTICLE}}
-</BOUCLE_TraductionArticleCourant>
-</BOUCLE_article>
-
 [(#REM) 
        Stocker les traductions eventuelles de la rubrique en cours si le plugin Tradrub est installe (permet l'utilisation du
        critere traduction sur les rubriques)
        </BOUCLE_rubrique>
 </BOUCLE_tradrub>
 
+[(#REM) 
+       Stocker les traductions eventuelles de l'article en cours
+]
+<BOUCLE_article(ARTICLES){id_article}>
+#SET{ListeTraductions, #ARRAY{}}
+<BOUCLE_TraductionArticleCourant(ARTICLES){traduction}{lang !IN #CONFIG{menu_lang_liens/langues_invisibles,#ARRAY}}>
+       #SET_MERGE{ListeTraductions,#GET{ListeTraductions},#ARRAY{#LANG,#URL_ARTICLE}}
+</BOUCLE_TraductionArticleCourant>
+</BOUCLE_article>
+
 [(#REM) 
        Y-a-t'il plus d'une langue reellement utilisee dans le site (moins les langues "invisibles") ?
        Si oui, on affiche le menu de langue
index 58c6229..336685f 100644 (file)
@@ -10,6 +10,9 @@
        <langue code="nl" url="http://trad.spip.net/tradlang_module/mll?lang_cible=nl" total="11" traduits="11" 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/mll?lang_cible=ru" total="11" traduits="11" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
+       </langue>
        <langue code="sk" url="http://trad.spip.net/tradlang_module/mll?lang_cible=sk" total="11" traduits="11" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
index c759efa..8b61401 100755 (executable)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/mll?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -24,5 +26,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_langues_invisibles' => 'Invisible languages in the​​ menu',
        'label_separateur' => 'Language divider'
 );
-
-?>
index bb9236f..ab843cb 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/mll?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -22,5 +24,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_format_liste_liste' => 'Lista por viñetas',
        'label_langues_invisibles' => 'Idiomas invisibles del menú'
 );
-
-?>
index 9889529..f0dc0fe 100755 (executable)
@@ -1,7 +1,9 @@
 <?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_/menu_langues_liens/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -22,5 +24,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_langues_invisibles' => 'Langues invisibles du menu',
        'label_separateur' => 'Séparateur des langues'
 );
-
-?>
index 63846f2..dde735e 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/mll?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -24,5 +26,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_langues_invisibles' => 'Talen die niet in het menu zichtbaar zijn',
        'label_separateur' => 'Scheiding van de talen'
 );
-
-?>
diff --git a/www/plugins/Menu_langue_lien/lang/mll_ru.php b/www/plugins/Menu_langue_lien/lang/mll_ru.php
new file mode 100644 (file)
index 0000000..ebcde7b
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/mll?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_titre_mll' => 'Языковое меню в виде ссылок',
+
+       // E
+       'explication_langues_invisibles' => 'Позволяет удалить некоторые языки из меню',
+       'explication_separateur' => 'Текст, используемый для разделения языков в меню',
+
+       // L
+       'label_format' => 'Формат отображения языков',
+       'label_format_abrege' => 'Краткий (например, Fr)',
+       'label_format_complet' => 'Полный (например, Français)',
+       'label_format_liste' => 'Формат отображения списка языков',
+       'label_format_liste_bloc' => 'Блок, разделенный пробелами (или настроить сепаратор)',
+       'label_format_liste_liste' => 'Маркированный список',
+       'label_langues_invisibles' => 'Невидимые языки в меню',
+       'label_separateur' => 'Разделитель языков'
+);
index 5c6b96f..2bef5f3 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/mll?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -24,5 +26,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_langues_invisibles' => 'Jazyky, ktoré nebudú zobrazené v menu',
        'label_separateur' => 'Oddeľovač jazykov'
 );
-
-?>
index 5d3c7f0..4fda2f2 100644 (file)
@@ -9,6 +9,9 @@
        <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-mll?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-mll?lang_cible=ru" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
+       </langue>
        <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-mll?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>
index b31b6df..5564448 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'mll_nom' => 'Language menu as links',
        'mll_slogan' => 'View languages ​​as clickable links'
 );
-
-?>
index 15d889a..2f349fc 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'mll_nom' => 'Menú de idiomas con enlaces',
        'mll_slogan' => 'Mostrar los idiomas bajo la forma de enlaces en los que hacer click'
 );
-
-?>
index 5e0ef81..d424e05 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/menu_langues_liens/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'mll_nom' => 'Menu de langues avec liens',
        'mll_slogan' => 'Afficher les langues sous forme de liens cliquables'
 );
-
-?>
index 4a4c792..20a8484 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'mll_nom' => 'Taalmenu met links',
        'mll_slogan' => 'Toon een taalkeuze met klik-optie'
 );
-
-?>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll_ru.php b/www/plugins/Menu_langue_lien/lang/paquet-mll_ru.php
new file mode 100644 (file)
index 0000000..2454cf5
--- /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-mll?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'mll_description' => 'Заменить оригинальное языковое меню интерактивным меню. Это меню отображается только если по крайней мере два языка на самом деле используется на сайте.',
+       'mll_nom' => 'Языковое меню в виде ссылок',
+       'mll_slogan' => 'Отображать языки как кликабельные ссылки'
+);
index f7117e7..b39fbdc 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'mll_nom' => 'Jazykové menu s odkazmi',
        'mll_slogan' => 'Zobraziť jazyky vo forme klikateľných odkazov'
 );
-
-?>
index c91eeb7..4f7ae87 100644 (file)
@@ -1,15 +1,15 @@
 <paquet
        prefix="mll"
        categorie="navigation"
-       version="1.2.0"
+       version="1.2.4"
        etat="stable"
-       compatibilite="[2.0.10;3.0.*]"
+       compatibilite="[2.0.10;3.1.*]"
        logo="prive/themes/spip/images/world_link-32.png"
-       documentation="http://www.spip-contrib.net/Menu-de-langues-sous-forme-de-liens"
+       documentation="http://contrib.spip.net/Menu-de-langues-sous-forme-de-liens"
        >
        <nom>Menu de langues avec liens</nom>
        <!-- Afficher les langues sous forme de liens cliquables -->
-       <auteur lien="http://www.spip-contrib.net/_Jacques-PYRAT_">Jacques</auteur>
+       <auteur lien="http://contrib.spip.net/RealET">Jacques</auteur>
        <auteur>Jean-Baptiste Pressac</auteur>
        <auteur lien="http://www.kent1.info">kent1</auteur>
        <auteur>Cédric Morin</auteur>
@@ -17,7 +17,7 @@
        <copyright>2009-2014</copyright>
        <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
        <pipeline nom="insert_head_css" inclure="mll_pipelines.php" />
-       <necessite nom="spip_bonux" compatibilite="[3.0.0-dev;[" />
+       <necessite nom="spip_bonux" compatibilite="[3.0.7;]" />
        <utilise nom="tradrub" compatibilite="[2.1.1;[" />
        <menu nom="config_mll" titre="mll:cfg_titre_mll" parent="menu_squelette" icone="images/world_link-16.png" action="configurer_mll"/>
 </paquet>
\ No newline at end of file
index 6412fc3..a95f187 100644 (file)
                [en]View languages ​​as clickable links\r
                </multi>\r
        </slogan>\r
-       <auteur>[Jacques->http://www.spip-contrib.net/_Jacques-PYRAT_] - Jean-Baptiste Pressac - Quentin Drouet - Cedric Morin</auteur>\r
+       <auteur>[Jacques->http://contrib.spip.net/RealET] - Jean-Baptiste Pressac - Quentin Drouet - Cedric Morin</auteur>\r
        <licence>&#169; 2009-2014 GNU/GPL</licence>\r
-       <lien>http://www.spip-contrib.net/Menu-de-langues-sous-forme-de-liens</lien>\r
-       <version>1.2.0</version>\r
+       <lien>http://contrib.spip.net/Menu-de-langues-sous-forme-de-liens</lien>\r
+       <version>1.2.4</version>\r
        <etat>stable</etat>\r
        <description>\r
                <multi>\r
@@ -33,8 +33,8 @@ Icon by [FatCow->http://www.fatcow.com/free-icons]
                <nom>insert_head_css</nom>\r
                <inclure>mll_pipelines.php</inclure>\r
        </pipeline>\r
-       <necessite id="SPIP" version="[2.0.10;3.0.99]" />\r
-       <necessite id='spip_bonux' version='[1.9.1;]' src="http://files.spip.org/spip-zone/spip-bonux.zip" />\r
+       <necessite id="SPIP" version="[2.0.10;3.1.99]" />\r
+       <necessite id='spip_bonux' version='[2.3.3;]' src="http://files.spip.org/spip-zone/spip-bonux.zip" />\r
        <utilise id='tradrub' version='[2.1.1;]' src="http://files.spip.org/spip-zone/tradrub_dev.zip" />\r
        <utilise id='cfg' version='[1.3.6;]' src="http://files.spip.org/spip-zone/cfg.zip" />\r
        <categorie>navigation</categorie>\r
index 8649234..5dcca62 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/menu_langues_liens
-Revision: 81566
-Dernier commit: 2014-03-22 05:38:58 +0100 
+Revision: 97400
+Dernier commit: 2016-05-07 22:04:34 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/menu_langues_liens</origine>
-<revision>81566</revision>
-<commit>2014-03-22 05:38:58 +0100 </commit>
+<revision>97400</revision>
+<commit>2016-05-07 22:04:34 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 415e17a..82a20a1 100644 (file)
-<?php\r
-/**\r
- * Plugin Compositions\r
- * (c) 2007-2013 Cedric Morin\r
- * Distribue sous licence GPL\r
- *\r
- * @package SPIP\Compositions\Fonctions\r
- */\r
-\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-define('_COMPOSITIONS_MATCH','-([^0-9][^.]*)');\r
-$GLOBALS['marqueur_skel'] = (isset($GLOBALS['marqueur_skel'])?$GLOBALS['marqueur_skel']:'').':composition';\r
-\r
-/**\r
- * Lister les objets actives par configuration\r
- *\r
- * @return array\r
- */\r
-function compositions_objets_actives(){\r
-       static $config=null;\r
-       if (is_null($config)){\r
-               // lister les objets dont on a active la composition dans la configuration\r
-               $config = isset($GLOBALS['meta']['compositions']) ? unserialize($GLOBALS['meta']['compositions']) : array();\r
-               $config = (isset($config['objets'])?$config['objets']:array('spip_articles','spip_rubriques'));\r
-               $config = array_map('objet_type',$config);\r
-       }\r
-       return $config;\r
-}\r
-\r
-/**\r
- * Retrouver le nom du dossier ou sont stockees les compositions\r
- * reglage par defaut, ou valeur personalisee via cfg\r
- *\r
- * @return string\r
- */\r
-function compositions_chemin(){\r
-       $config_chemin = 'compositions/';\r
-       if (defined('_DIR_PLUGIN_Z') OR defined('_DIR_PLUGIN_ZCORE'))\r
-               $config_chemin = (isset($GLOBALS['z_blocs'])?reset($GLOBALS['z_blocs']):'contenu').'/';\r
-\r
-       elseif (isset($GLOBALS['meta']['compositions'])){\r
-               $config = unserialize($GLOBALS['meta']['compositions']);\r
-               if (isset ($config['chemin_compositions'])){\r
-                       $config_chemin = rtrim($config['chemin_compositions'],'/').'/';\r
-               }\r
-       }\r
-\r
-       return $config_chemin;\r
-}\r
-\r
-/**\r
- * Tester si la stylisation auto est activee\r
- * @return string\r
- */\r
-function compositions_styliser_auto(){\r
-       $config_styliser = true;\r
-       if (defined('_DIR_PLUGIN_Z') OR defined('_DIR_PLUGIN_ZCORE')){\r
-               $config_styliser = false; // Z s'occupe de styliser les compositions\r
-       }\r
-       elseif (isset($GLOBALS['meta']['compositions'])){\r
-               $config = unserialize($GLOBALS['meta']['compositions']);\r
-               $config_styliser = $config['styliser_auto'] != 'non';\r
-       }\r
-       return $config_styliser?' ':'';\r
-}\r
-\r
-/**\r
- * Lister les compositions disponibles : toutes ou pour un type donne\r
- * Si informer est a false, on ne charge pas les infos du xml\r
- *\r
- * @param string $type\r
- * @param bool $informer\r
- * @return array\r
- */\r
-function compositions_lister_disponibles($type, $informer=true){\r
-       include_spip('inc/compositions');\r
-       $type_match = "";\r
-       if (strlen($type)){\r
-               $type = objet_type($type); // securite\r
-               $type_match = $type;\r
-       }\r
-       else {\r
-               $type_match = "[a-z0-9]+";\r
-       }\r
-\r
-       // rechercher les skel du type article-truc.html\r
-       // truc ne doit pas commencer par un chiffre pour eviter de confondre avec article-12.html\r
-       $match = "($type_match)("._COMPOSITIONS_MATCH.")?[.]html$";\r
-\r
-       // lister les compositions disponibles\r
-       $liste = find_all_in_path(compositions_chemin(),$match);\r
-       $res = array();\r
-       if (count($liste)){\r
-               foreach($liste as $s) {\r
-                       $base = preg_replace(',[.]html$,i','',$s);\r
-                       if (preg_match(",$match,ims",basename($s),$regs)\r
-                         AND ($composition = !$informer\r
-                               OR $composition = compositions_charger_infos($base)))\r
-                               $res[$regs[1]][$regs[3]] = $composition;\r
-                       // retenir les skels qui ont un xml associe\r
-               }\r
-       }\r
-       // Pipeline compositions_lister_disponibles\r
-       $res = pipeline('compositions_lister_disponibles',array(\r
-               'args'=>array('type' => $type,'informer' => $informer),\r
-               'data'=> $res\r
-               )\r
-       );\r
-       return $res;\r
-}\r
-\r
-/**\r
- * Liste les id d'un type donne utilisant une composition donnee\r
- *\r
- * @param string $type\r
- * @param string $composition\r
- * @return array\r
- */\r
-function compositions_lister_utilisations($type,$composition){\r
-       $table_sql = table_objet_sql($type);\r
-       if (!in_array($table_sql, sql_alltable())) return;\r
-       $_id_table_objet = id_table_objet($type);\r
-       return sql_allfetsel("$_id_table_objet as id,titre", $table_sql, "composition=".sql_quote($composition));\r
-}\r
-\r
-/**\r
- * Selectionner le fond en fonction du type et de la composition\r
- * en prenant en compte la configuration pour le chemin\r
- * et le fait que la composition a pu etre supprimee\r
- *\r
- * @param string $composition\r
- * @param string $type\r
- * @param string $defaut\r
- * @param string $ext\r
- * @param bool $fullpath\r
- * @param string $vide\r
- * @return string\r
- */\r
-function compositions_selectionner($composition,$type,$defaut="",$ext="html",$fullpath = false, $vide="composition-vide"){\r
-       if ($type=='syndic') $type='site'; //grml\r
-       $fond = compositions_chemin() . $type;\r
-\r
-       // regarder si compositions/article-xxx est disponible\r
-       if (strlen($composition)\r
-               AND $f = find_in_path("$fond-$composition.$ext"))\r
-               return $fullpath ? $f : $fond . "-$composition";\r
-       else\r
-               // sinon regarder si compositions/article-defaut est disponible\r
-               if (strlen($defaut)\r
-                       AND $f = find_in_path("$fond-$defaut.$ext"))\r
-                       return $fullpath ? $f : $fond . "-$defaut";\r
-\r
-       // se rabattre sur compositions/article si disponible\r
-       if ($f = find_in_path("$fond.$ext"))\r
-               return $fullpath ? $f : $fond;\r
-\r
-       // sinon une composition vide pour ne pas generer d'erreur\r
-       if ($vide AND $f = find_in_path("$vide.$ext"))\r
-               return $fullpath ? $f : $vide;\r
-\r
-       // rien mais ca fera une erreur dans le squelette si appele en filtre\r
-       return '';\r
-}\r
-\r
-/**\r
- * Decrire une composition pour un objet\r
- * @param string $type\r
- * @param string $composition\r
- * @return array|bool|string\r
- */\r
-function compositions_decrire($type, $composition){\r
-       static $compositions = array();\r
-       if (!function_exists('compositions_charger_infos'))\r
-               include_spip('inc/compositions');\r
-       if ($type=='syndic') $type='site'; //grml\r
-       if (isset($compositions[$type][$composition]))\r
-               return $compositions[$type][$composition];\r
-       $ext = "html";\r
-       $fond = compositions_chemin() . $type;\r
-       if (strlen($composition)\r
-               AND $f = find_in_path("$fond-$composition.$ext")\r
-               AND $desc = compositions_charger_infos($f))\r
-               return $compositions[$type][$composition] = $desc;\r
-       return $compositions[$type][$composition] = false;\r
-}\r
-\r
-/**\r
- * Un filtre a utiliser sur [(#COMPOSITION|composition_class{#ENV{type}})]\r
- * pour poser des classes generiques sur le <body>\r
- * si une balise <class>toto</class> est definie dans la composition c'est elle qui est appliquee\r
- * sinon on pose simplement le nom de la composition\r
- *\r
- * @param string $composition\r
- * @param string $type\r
- * @return string\r
- */\r
-function composition_class($composition,$type){\r
-       if ($desc = compositions_decrire($type, $composition)\r
-               AND isset($desc['class'])\r
-               AND strlen($desc['class']))\r
-               return $desc['class'];\r
-       return $composition;\r
-}\r
-\r
-/**\r
- * Liste les types d'objets qui ont une composition ET sont autorises par la configuration\r
- * utilise la valeur en cache meta sauf si demande de recalcul\r
- * ou pas encore definie\r
- *\r
- * @staticvar array $liste\r
- * @return array\r
- */\r
-function compositions_types(){\r
-       static $liste = null;\r
-       if (is_null($liste)) {\r
-               if (_VAR_MODE OR !isset($GLOBALS['meta']['compositions_types'])){\r
-                       include_spip('inc/compositions');\r
-                       compositions_cacher();\r
-               }\r
-               $liste = explode(',',$GLOBALS['meta']['compositions_types']);\r
-       }\r
-       return $liste;\r
-}\r
-\r
-/**\r
- * Renvoie les parametres necessaires pour utiliser l'heritage de composition de façon generique\r
- * recupere les donnes du pipeline compositions_declarer_heritage.\r
- * Si $type n'est pas precise, on renvoie simplement le tableau des objets pouvant heriter.\r
- *\r
- * @param string $type\r
- * @staticvar array $heritages\r
- * @return array\r
- */\r
-function compositions_recuperer_heritage($type=NULL){\r
-       static $heritages = NULL;\r
-       if (is_null($heritages)) // recuperer les heritages declares via le pipeline compositions_declarer_heritage\r
-               $heritages = pipeline('compositions_declarer_heritage', array());\r
-\r
-       if (is_null($type))\r
-               return $heritages;\r
-\r
-       if (array_key_exists($type, $heritages)) {\r
-               $type_parent = $heritages[$type];\r
-               $table_parent =  table_objet_sql($type_parent);\r
-               $nom_id_parent = ($type==$type_parent) ? 'id_parent' : id_table_objet($type_parent); // Recursivite pour les rubriques, nom de l'identifiant du parent dans la table enfant\r
-               $nom_id_table_parent = id_table_objet($type_parent); // Nom de l'identifiant du parent dans la table parent\r
-\r
-               // verifier que table et champs existent...\r
-               $trouver_table = charger_fonction('trouver_table', 'base');\r
-               if (!$type_parent\r
-                       OR !$desc = $trouver_table($table_parent)\r
-                       OR !isset($desc['field']['composition'])\r
-                       OR !isset($desc['field'][$nom_id_parent]))\r
-                       return '';\r
-\r
-               return array(\r
-                       'type_parent' => $type_parent,\r
-                       'table_parent' => $table_parent,\r
-                       'nom_id_parent' => $nom_id_parent,\r
-                       'nom_id_table_parent' => $nom_id_table_parent\r
-               );\r
-       }\r
-       return array();\r
-}\r
-\r
-/**\r
- * Renvoie la composition qui s'applique a un objet\r
- * en tenant compte, le cas echeant, de la composition heritee\r
- * si etoile=true on renvoi directment le champ sql\r
- *\r
- * @param string $type\r
- * @param integer $id\r
- * @param string $serveur\r
- * @param bool $etoile\r
- * @return string\r
- */\r
-function compositions_determiner($type, $id, $serveur='', $etoile = false){\r
-       static $composition = array();\r
-       $id = intval($id);\r
-\r
-       if (isset($composition[$etoile][$serveur][$type][$id]))\r
-               return $composition[$etoile][$serveur][$type][$id];\r
-\r
-       include_spip('base/abstract_sql');\r
-       $table = table_objet($type);\r
-       $table_sql = table_objet_sql($type);\r
-       $_id_table = id_table_objet($type);\r
-\r
-       $retour = '';\r
-\r
-       $trouver_table = charger_fonction('trouver_table', 'base');\r
-       $desc = $trouver_table($table,$serveur);\r
-       if (isset($desc['field']['composition']) AND $id){\r
-               $select = "composition";\r
-\r
-       $heritage = compositions_recuperer_heritage($type);\r
-       if (isset($desc['field'][$heritage['nom_id_parent']]))\r
-               $select .= ', '.$heritage['nom_id_parent'].' as id_parent';\r
-\r
-       $row = sql_fetsel($select, $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);\r
-       if ($row['composition'] != '')\r
-               $retour = $row['composition'];\r
-       elseif (!$etoile\r
-         AND isset($row['id_parent'])\r
-         AND $row['id_parent'])\r
-               $retour = compositions_heriter($type, $id, $row['id_parent'], $serveur);\r
-       }\r
-       return $composition[$etoile][$serveur][$type][$id] = (($retour == '-') ? '' : $retour);\r
-}\r
-\r
-/**\r
- * Renvoie la composition heritee par un objet selon son identifiant.\r
- * Optionnellement, on peut lui transmettre directement l'id du parent s'il a ate calcule.\r
- *\r
- * @param string $type\r
- * @param integer $id\r
- * @param integer $id_parent\r
- * @param string $serveur\r
- * @return string\r
- */\r
-function compositions_heriter($type, $id, $id_parent=NULL, $serveur=''){\r
-       if ($type=='syndic') $type='site'; //grml\r
-       if (intval($id) < 1) return '';\r
-       static $infos = null;\r
-       $compo_parent = '';\r
-\r
-       $heritage = compositions_recuperer_heritage($type);\r
-\r
-       /* Si aucun héritage n'a été défini pour le type d'objet, ce\r
-       * n'est pas la peine d'aller plus loin. */\r
-       if(count($heritage) == 0)\r
-               return '';\r
-\r
-       $type_parent = $heritage['type_parent'];\r
-       $table_parent = $heritage['table_parent'];\r
-       $nom_id_parent = $heritage['nom_id_parent'];\r
-       $nom_id_table_parent = $heritage['nom_id_table_parent'];\r
-\r
-       if (is_null($id_parent))\r
-               $id_parent = sql_getfetsel($nom_id_parent, table_objet_sql($type), id_table_objet($type).'='.intval($id));\r
-\r
-       $heritages = compositions_recuperer_heritage();\r
-\r
-       do {\r
-               $select = 'composition';\r
-               if ($heritages[$type_parent]==$type_parent) // S'il y a recursivite sur le parent\r
-                       $select .= ', id_parent';\r
-               $row = sql_fetsel($select, $table_parent, $nom_id_table_parent.'='.intval($id_parent),'','','','',$serveur);\r
-               if (strlen($row['composition']) AND $row['composition']!='-')\r
-                       $compo_parent = $row['composition'];\r
-               elseif (strlen($row['composition'])==0 AND isset($heritages[$type_parent])) // Si le parent peut heriter, il faut verifier s'il y a heritage\r
-                       $compo_parent = compositions_determiner($type_parent, $id_parent, $serveur='');\r
-\r
-               if (strlen($compo_parent) AND is_null($infos))\r
-                       $infos = compositions_lister_disponibles('');\r
-\r
-       }\r
-       while ($id_parent = $row['id_parent']\r
-               AND\r
-               (!strlen($compo_parent) OR !isset($infos[$type_parent][$compo_parent]['branche'][$type])));\r
-\r
-       if (strlen($compo_parent) AND isset($infos[$type_parent][$compo_parent]['branche'][$type]))\r
-               return $infos[$type_parent][$compo_parent]['branche'][$type];\r
-\r
-       return '';\r
-}\r
-\r
-/**\r
- * #COMPOSITION\r
- * Renvoie la composition s'appliquant a un objet\r
- * en tenant compte, le cas echeant, de l'heritage.\r
- *\r
- * Sans precision, l'objet et son identifiant sont pris\r
- * dans la boucle en cours, mais l'on peut specifier notre recherche\r
- * en passant objet et id_objet en argument de la balise :\r
- * #COMPOSITION{article, 8}\r
- *\r
- * #COMPOSITION* renvoie toujours le champs brut, sans tenir compte de l'heritage\r
- *\r
- * @param array $p     AST au niveau de la balise\r
- * @return array       AST->code modifie pour calculer le nom de la composition\r
- */\r
-function balise_COMPOSITION_dist($p) {\r
-       $_composition = "";\r
-       if ($_objet = interprete_argument_balise(1, $p)) {\r
-               $_id_objet = interprete_argument_balise(2, $p);\r
-       } else {\r
-               $_composition = champ_sql('composition',$p);\r
-               $_id_objet = champ_sql($p->boucles[$p->id_boucle]->primary, $p);\r
-               $_objet = "objet_type('" . $p->boucles[$p->id_boucle]->id_table . "')";\r
-       }\r
-       // si on veut le champ brut, et qu'on l'a sous la main, inutile d'invoquer toute la machinerie\r
-       if ($_composition AND $p->etoile)\r
-               $p->code = $_composition;\r
-       else {\r
-               $connect = $p->boucles[$p->id_boucle]->sql_serveur;\r
-               $p->code = "compositions_determiner($_objet, $_id_objet, '$connect', ".($p->etoile?'true':'false').")";\r
-               // ne declencher l'usine a gaz que si composition est vide ...\r
-               if ($_composition)\r
-                       $p->code = "((\$zc=$_composition)?(\$zc=='-'?'':\$zc):".$p->code.")";\r
-       }\r
-       return $p;\r
-}\r
-\r
-/**\r
- * Indique si la composition d'un objet est verrouillee ou non,\r
- * auquel cas, seul le webmaster peut la modifier\r
- *\r
- * @param string $type\r
- * @param integer $id\r
- * @param string $serveur\r
- * @return string\r
- */\r
-function compositions_verrouiller($type, $id, $serveur=''){\r
-       $config = unserialize($GLOBALS['meta']['compositions']);\r
-       if (isset($config['tout_verrouiller']) AND $config['tout_verrouiller'] == 'oui')\r
-               return true;\r
-\r
-       include_spip('base/abstract_sql');\r
-       $table = table_objet($type);\r
-       $table_sql = table_objet_sql($type);\r
-       $_id_table = id_table_objet($type);\r
-\r
-       $trouver_table = charger_fonction('trouver_table', 'base');\r
-       $desc = $trouver_table($table,$serveur);\r
-       if (isset($desc['field']['composition_lock']) AND $id){\r
-               $lock = sql_getfetsel('composition_lock', $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);\r
-               if ($lock)\r
-                       return true;\r
-               elseif (isset($desc['field']['id_rubrique'])) {\r
-                       $id_rubrique = sql_getfetsel('id_rubrique', $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);\r
-                       return compositions_verrou_branche($id_rubrique, $serveur);\r
-               }\r
-               else\r
-                       return false;\r
-       }\r
-       else return false;\r
-}\r
-\r
-/**\r
- * Indique si les objets d'une branche sont verrouilles\r
- * @param integer $id_rubrique\r
- * @param string $serveur\r
- * @return string\r
- */\r
-function compositions_verrou_branche($id_rubrique, $serveur=''){\r
-\r
-       if (intval($id_rubrique) < 1) return false;\r
-       if($infos_rubrique = sql_fetsel(array('id_parent','composition_branche_lock'),'spip_rubriques','id_rubrique='.intval($id_rubrique),'','','','',$serveur)) {\r
-               if ($infos_rubrique['composition_branche_lock'])\r
-                       return true;\r
-               else\r
-                       return compositions_verrou_branche($infos_rubrique['id_parent'],$serveur);\r
-       }\r
-       return '';\r
-}\r
-?>\r
+<?php
+/**
+ * Plugin Compositions
+ * (c) 2007-2013 Cedric Morin
+ * Distribue sous licence GPL
+ *
+ * @package SPIP\Compositions\Fonctions
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+define('_COMPOSITIONS_MATCH', '-([^0-9][^.]*)');
+
+/**
+ * Lister les objets actives par configuration
+ *
+ * @return array
+ */
+function compositions_objets_actives() {
+       static $config=null;
+       if (is_null($config)) {
+               // lister les objets dont on a active la composition dans la configuration
+               $config = isset($GLOBALS['meta']['compositions']) ? unserialize($GLOBALS['meta']['compositions']) : array();
+               $config = (isset($config['objets'])?$config['objets']:array('spip_articles','spip_rubriques'));
+               $config = array_map('objet_type', $config);
+       }
+       return $config;
+}
+
+/**
+ * Retrouver le nom du dossier ou sont stockees les compositions
+ * reglage par defaut, ou valeur personalisee via cfg
+ *
+ * @return string
+ */
+function compositions_chemin() {
+       $config_chemin = 'compositions/';
+       if (defined('_DIR_PLUGIN_Z') or defined('_DIR_PLUGIN_ZCORE')) {
+               $config_chemin = (isset($GLOBALS['z_blocs'])?reset($GLOBALS['z_blocs']):'contenu').'/';
+       } elseif (isset($GLOBALS['meta']['compositions'])) {
+               $config = unserialize($GLOBALS['meta']['compositions']);
+               if (isset($config['chemin_compositions'])) {
+                       $config_chemin = rtrim($config['chemin_compositions'], '/').'/';
+               }
+       }
+
+       return $config_chemin;
+}
+
+/**
+ * Tester si la stylisation auto est activee
+ * @return string
+ */
+function compositions_styliser_auto() {
+       $config_styliser = true;
+       if (defined('_DIR_PLUGIN_Z') or defined('_DIR_PLUGIN_ZCORE')) {
+               $config_styliser = false; // Z s'occupe de styliser les compositions
+       } elseif (isset($GLOBALS['meta']['compositions'])) {
+               $config = unserialize($GLOBALS['meta']['compositions']);
+               $config_styliser = (!isset($config['styliser_auto']) or ($config['styliser_auto'] != 'non'));
+       }
+       return $config_styliser?' ':'';
+}
+
+/**
+ * Lister les compositions disponibles : toutes ou pour un type donne
+ * Si informer est a false, on ne charge pas les infos du xml
+ *
+ * @param string $type
+ * @param bool $informer
+ * @return array
+ */
+function compositions_lister_disponibles($type, $informer = true) {
+       include_spip('inc/compositions');
+       $type_match = '';
+       if (strlen($type)) {
+               $type = objet_type($type); // securite
+               $type_match = $type;
+       } else {
+               // _ pour le cas des groupe_mots
+               $type_match = '[a-z0-9_]+';
+       }
+
+       // rechercher les skel du type article-truc.html
+       // truc ne doit pas commencer par un chiffre pour eviter de confondre avec article-12.html
+       $match = "($type_match)("._COMPOSITIONS_MATCH.')?[.]html$';
+
+       // lister les compositions disponibles
+       $liste = find_all_in_path(compositions_chemin(), $match);
+       $res = array();
+       if (count($liste)) {
+               foreach ($liste as $s) {
+                       $base = preg_replace(',[.]html$,i', '', $s);
+                       if (preg_match(",$match,ims", basename($s), $regs)
+                               and ($composition = !$informer
+                                       or $composition = compositions_charger_infos($base))) {
+                               $regs = array_pad($regs, 4, null);
+                               $res[$regs[1]][$regs[3]] = $composition;
+                               // retenir les skels qui ont un xml associe
+                       }
+               }
+       }
+       // Pipeline compositions_lister_disponibles
+       $res = pipeline('compositions_lister_disponibles', array(
+               'args'=>array('type' => $type,'informer' => $informer),
+               'data'=> $res
+               ));
+       return $res;
+}
+
+/**
+ * Liste les id d'un type donne utilisant une composition donnee
+ *
+ * @param string $type
+ * @param string $composition
+ * @return array
+ */
+function compositions_lister_utilisations($type, $composition) {
+       $table_sql = table_objet_sql($type);
+       if (!in_array($table_sql, sql_alltable())) {
+               return;
+       }
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       $desc = $trouver_table($table_sql);
+       $_id_table_objet = id_table_objet($type);
+       $titre = isset($desc['titre']) ? $desc['titre'] : "'' AS titre";
+       return sql_allfetsel("$_id_table_objet as id, $titre", $table_sql, 'composition='.sql_quote($composition));
+}
+
+/**
+ * Selectionner le fond en fonction du type et de la composition
+ * en prenant en compte la configuration pour le chemin
+ * et le fait que la composition a pu etre supprimee
+ *
+ * @param string $composition
+ * @param string $type
+ * @param string $defaut
+ * @param string $ext
+ * @param bool $fullpath
+ * @param string $vide
+ * @return string
+ */
+function compositions_selectionner($composition, $type, $defaut = '', $ext = 'html', $fullpath = false, $vide = 'composition-vide') {
+       if ($type=='syndic') {
+               $type='site'; //grml
+       }
+       $fond = compositions_chemin() . $type;
+
+       // regarder si compositions/article-xxx est disponible
+       if (strlen($composition)
+               and $f = find_in_path("$fond-$composition.$ext")) {
+               return $fullpath ? $f : $fond . "-$composition";
+       } elseif (strlen($defaut)
+               and $f = find_in_path("$fond-$defaut.$ext")) {
+               // sinon regarder si compositions/article-defaut est disponible
+               return $fullpath ? $f : $fond . "-$defaut";
+       }
+
+       // se rabattre sur compositions/article si disponible
+       if ($f = find_in_path("$fond.$ext")) {
+               return $fullpath ? $f : $fond;
+       }
+
+       // sinon une composition vide pour ne pas generer d'erreur
+       if ($vide and $f = find_in_path("$vide.$ext")) {
+               return $fullpath ? $f : $vide;
+       }
+
+       // rien mais ca fera une erreur dans le squelette si appele en filtre
+       return '';
+}
+
+/**
+ * Decrire une composition pour un objet
+ * @param string $type
+ * @param string $composition
+ * @return array|bool|string
+ */
+function compositions_decrire($type, $composition) {
+       static $compositions = array();
+       if (!function_exists('compositions_charger_infos')) {
+               include_spip('inc/compositions');
+       }
+       if ($type=='syndic') {
+               $type='site'; //grml
+       }
+       if (isset($compositions[$type][$composition])) {
+               return $compositions[$type][$composition];
+       }
+       $ext = 'html';
+       $fond = compositions_chemin() . $type;
+       if (strlen($composition)
+               and $f = find_in_path("$fond-$composition.$ext")
+               and $desc = compositions_charger_infos($f)) {
+               return $compositions[$type][$composition] = $desc;
+       }
+       return $compositions[$type][$composition] = false;
+}
+
+/**
+ * Un filtre a utiliser sur [(#COMPOSITION|composition_class{#ENV{type}})]
+ * pour poser des classes generiques sur le <body>
+ * si une balise <class>toto</class> est definie dans la composition c'est elle qui est appliquee
+ * sinon on pose simplement le nom de la composition
+ *
+ * @param string $composition
+ * @param string $type
+ * @return string
+ */
+function composition_class($composition, $type) {
+       if ($desc = compositions_decrire($type, $composition)
+               and isset($desc['class'])
+               and strlen($desc['class'])) {
+               return $desc['class'];
+       }
+       return $composition;
+}
+
+/**
+ * Liste les types d'objets qui ont une composition ET sont autorises par la configuration
+ * utilise la valeur en cache meta sauf si demande de recalcul
+ * ou pas encore definie
+ *
+ * @staticvar array $liste
+ * @return array
+ */
+function compositions_types() {
+       static $liste = null;
+       if (is_null($liste)) {
+               if (_VAR_MODE or !isset($GLOBALS['meta']['compositions_types'])) {
+                       include_spip('inc/compositions');
+                       compositions_cacher();
+               }
+               $liste = explode(',', $GLOBALS['meta']['compositions_types']);
+       }
+       return $liste;
+}
+
+/**
+ * Renvoie les parametres necessaires pour utiliser l'heritage de composition de façon generique
+ * recupere les donnes du pipeline compositions_declarer_heritage.
+ * Si $type n'est pas precise, on renvoie simplement le tableau des objets pouvant heriter.
+ *
+ * @param string $type
+ * @staticvar array $heritages
+ * @return array
+ */
+function compositions_recuperer_heritage($type = null) {
+       static $heritages = null;
+       if (is_null($heritages)) {
+               // recuperer les heritages declares via le pipeline compositions_declarer_heritage
+               $heritages = pipeline('compositions_declarer_heritage', array());
+       }
+
+       if (is_null($type)) {
+               return $heritages;
+       }
+
+       if (array_key_exists($type, $heritages)) {
+               $type_parent = $heritages[$type];
+               $table_parent =  table_objet_sql($type_parent);
+               $nom_id_parent = ($type==$type_parent) ? 'id_parent' : id_table_objet($type_parent); // Recursivite pour les rubriques, nom de l'identifiant du parent dans la table enfant
+               $nom_id_table_parent = id_table_objet($type_parent); // Nom de l'identifiant du parent dans la table parent
+
+               // verifier que table et champs existent...
+               $trouver_table = charger_fonction('trouver_table', 'base');
+               if (!$type_parent
+                       or !$desc = $trouver_table($table_parent)
+                       or !isset($desc['field']['composition'])
+                       or !isset($desc['field'][$nom_id_parent])) {
+                       return '';
+               }
+
+               return array(
+                       'type_parent' => $type_parent,
+                       'table_parent' => $table_parent,
+                       'nom_id_parent' => $nom_id_parent,
+                       'nom_id_table_parent' => $nom_id_table_parent
+               );
+       }
+       return array();
+}
+
+/**
+ * Renvoie la composition qui s'applique a un objet
+ * en tenant compte, le cas echeant, de la composition heritee
+ * si etoile=true on renvoi directment le champ sql
+ *
+ * @param string $type
+ * @param integer $id
+ * @param string $serveur
+ * @param bool $etoile
+ * @return string
+ */
+function compositions_determiner($type, $id, $serveur = '', $etoile = false) {
+       static $composition = array();
+       $id = intval($id);
+
+       if (isset($composition[$etoile][$serveur][$type][$id])) {
+               return $composition[$etoile][$serveur][$type][$id];
+       }
+
+       include_spip('base/abstract_sql');
+       $table = table_objet($type);
+       $table_sql = table_objet_sql($type);
+       $_id_table = id_table_objet($type);
+
+       $retour = '';
+
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       $desc = $trouver_table($table,$serveur);
+       if (isset($desc['field']['composition']) and $id) {
+               $select = 'composition';
+
+               $heritage = compositions_recuperer_heritage($type);
+               if (isset($desc['field'][$heritage['nom_id_parent']])) {
+                       $select .= ', '.$heritage['nom_id_parent'].' as id_parent';
+               }
+
+               $row = sql_fetsel($select, $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);
+               if ($row['composition'] != '') {
+                       $retour = $row['composition'];
+               } elseif (!$etoile
+                       and isset($row['id_parent'])
+                       and $row['id_parent']) {
+                       $retour = compositions_heriter($type, $id, $row['id_parent'], $serveur);
+               }
+       }
+       return $composition[$etoile][$serveur][$type][$id] = (($retour == '-') ? '' : $retour);
+}
+
+/**
+ * Renvoie la composition heritee par un objet selon son identifiant.
+ * Optionnellement, on peut lui transmettre directement l'id du parent s'il a ate calcule.
+ *
+ * @param string $type
+ * @param integer $id
+ * @param integer $id_parent
+ * @param string $serveur
+ * @return string
+ */
+function compositions_heriter($type, $id, $id_parent = null, $serveur = '') {
+       if ($type=='syndic') {
+               $type='site'; //grml
+       }
+       if (intval($id) < 1) {
+               return '';
+       }
+       static $infos = null;
+       $compo_parent = '';
+
+       $heritage = compositions_recuperer_heritage($type);
+
+       /* Si aucun héritage n'a été défini pour le type d'objet, ce
+       * n'est pas la peine d'aller plus loin. */
+       if (count($heritage) == 0) {
+               return '';
+       }
+
+       $type_parent = $heritage['type_parent'];
+       $table_parent = $heritage['table_parent'];
+       $nom_id_parent = $heritage['nom_id_parent'];
+       $nom_id_table_parent = $heritage['nom_id_table_parent'];
+
+       if (is_null($id_parent)) {
+               $id_parent = sql_getfetsel($nom_id_parent, table_objet_sql($type), id_table_objet($type).'='.intval($id));
+       }
+
+       $heritages = compositions_recuperer_heritage();
+
+       do {
+               $select = 'composition';
+               if ($heritages[$type_parent]==$type_parent) {
+                       // S'il y a recursivite sur le parent
+                       $select .= ', id_parent';
+               }
+               $row = sql_fetsel($select, $table_parent, $nom_id_table_parent.'='.intval($id_parent), '', '', '', '', $serveur);
+               if (strlen($row['composition']) and $row['composition']!='-') {
+                       $compo_parent = $row['composition'];
+               } elseif (strlen($row['composition'])==0 and isset($heritages[$type_parent])) {
+                       // Si le parent peut heriter, il faut verifier s'il y a heritage
+                       $compo_parent = compositions_determiner($type_parent, $id_parent, $serveur = '');
+               }
+
+               if (strlen($compo_parent) and is_null($infos)) {
+                       $infos = compositions_lister_disponibles('');
+               }
+       } while ($id_parent = $row['id_parent']
+               and
+               (!strlen($compo_parent) or !isset($infos[$type_parent][$compo_parent]['branche'][$type])));
+
+       if (strlen($compo_parent) and isset($infos[$type_parent][$compo_parent]['branche'][$type])) {
+               return $infos[$type_parent][$compo_parent]['branche'][$type];
+       }
+
+       return '';
+}
+
+/**
+ * #COMPOSITION
+ * Renvoie la composition s'appliquant a un objet
+ * en tenant compte, le cas echeant, de l'heritage.
+ *
+ * Sans precision, l'objet et son identifiant sont pris
+ * dans la boucle en cours, mais l'on peut specifier notre recherche
+ * en passant objet et id_objet en argument de la balise :
+ * #COMPOSITION{article, 8}
+ *
+ * #COMPOSITION* renvoie toujours le champs brut, sans tenir compte de l'heritage
+ *
+ * @param array $p     AST au niveau de la balise
+ * @return array       AST->code modifie pour calculer le nom de la composition
+ */
+function balise_COMPOSITION_dist($p) {
+       $_composition = '';
+       if ($_objet = interprete_argument_balise(1, $p)) {
+               $_id_objet = interprete_argument_balise(2, $p);
+       } else {
+               $_composition = champ_sql('composition', $p);
+               $_id_objet = champ_sql($p->boucles[$p->id_boucle]->primary, $p);
+               $_objet = "objet_type('" . $p->boucles[$p->id_boucle]->id_table . "')";
+       }
+       // si on veut le champ brut, et qu'on l'a sous la main, inutile d'invoquer toute la machinerie
+       if ($_composition and $p->etoile) {
+               $p->code = $_composition;
+       } else {
+               $connect = $p->boucles[$p->id_boucle]->sql_serveur;
+               $p->code = "compositions_determiner($_objet, $_id_objet, '$connect', ".($p->etoile?'true':'false').")";
+               // ne declencher l'usine a gaz que si composition est vide ...
+               if ($_composition) {
+                       $p->code = "((\$zc=$_composition)?(\$zc=='-'?'':\$zc):".$p->code.")";
+               }
+       }
+       return $p;
+}
+
+/**
+ * Indique si la composition d'un objet est verrouillee ou non,
+ * auquel cas, seul le webmaster peut la modifier
+ *
+ * @param string $type
+ * @param integer $id
+ * @param string $serveur
+ * @return string
+ */
+function compositions_verrouiller($type, $id, $serveur = '') {
+       $config = (isset($GLOBALS['meta']['compositions']) ? unserialize($GLOBALS['meta']['compositions']) : array());
+       if (isset($config['tout_verrouiller']) and $config['tout_verrouiller'] == 'oui') {
+               return true;
+       }
+
+       include_spip('base/abstract_sql');
+       $table = table_objet($type);
+       $table_sql = table_objet_sql($type);
+       $_id_table = id_table_objet($type);
+
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       $desc = $trouver_table($table,$serveur);
+       if (isset($desc['field']['composition_lock']) and $id) {
+               $lock = sql_getfetsel('composition_lock', $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);
+               if ($lock) {
+                       return true;
+               } elseif (isset($desc['field']['id_rubrique'])) {
+                       $id_rubrique = sql_getfetsel('id_rubrique', $table_sql, "$_id_table=".intval($id), '', '', '', '', $serveur);
+                       return compositions_verrou_branche($id_rubrique, $serveur);
+               } else {
+                       return false;
+               }
+       } else {
+               return false;
+       }
+}
+
+/**
+ * Indique si les objets d'une branche sont verrouilles
+ * @param integer $id_rubrique
+ * @param string $serveur
+ * @return string
+ */
+function compositions_verrou_branche($id_rubrique, $serveur = '') {
+
+       if (intval($id_rubrique) < 1) {
+               return false;
+       }
+       if ($infos_rubrique = sql_fetsel(array('id_parent', 'composition_branche_lock'), 'spip_rubriques', 'id_rubrique='.intval($id_rubrique), '', '', '', '', $serveur)) {
+               if ($infos_rubrique['composition_branche_lock']) {
+                       return true;
+               } else {
+                       return compositions_verrou_branche($infos_rubrique['id_parent'], $serveur);
+               }
+       }
+       return '';
+}
index ea5c520..b190b01 100644 (file)
@@ -1,14 +1,14 @@
-<?php\r
-\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-// On déclare ici la config du core\r
-function compositions_ieconfig_metas($table){\r
-       $table['compositions']['titre'] = _T('compositions:compositions');\r
-       $table['compositions']['icone'] = 'composition-16.png';\r
-       $table['compositions']['metas_serialize'] = 'compositions';\r
-       \r
-       return $table;\r
-}\r
-\r
+<?php
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+// On déclare ici la config du core
+function compositions_ieconfig_metas($table){
+       $table['compositions']['titre'] = _T('compositions:compositions');
+       $table['compositions']['icone'] = 'composition-16.png';
+       $table['compositions']['metas_serialize'] = 'compositions';
+       
+       return $table;
+}
+
 ?>
\ No newline at end of file
diff --git a/www/plugins/compositions_v3/compositions_options.php b/www/plugins/compositions_v3/compositions_options.php
new file mode 100644 (file)
index 0000000..e9132b9
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Plugin Compositions
+ * (c) 2007-2013 Cedric Morin
+ * Distribue sous licence GPL
+ *
+ * @package SPIP\Compositions\Fonctions
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+$GLOBALS['marqueur_skel'] = (isset($GLOBALS['marqueur_skel'])?$GLOBALS['marqueur_skel']:'').':composition';
index dd38a96..c569374 100644 (file)
-<?php\r
-/*\r
- * Plugin Compositions\r
- * (c) 2007-2009 Cedric Morin\r
- * Distribue sous licence GPL\r
- *\r
- */\r
-\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-/**\r
- * Declaration des champs sur les objets\r
- *\r
- * @param array $tables\r
- * @return array\r
- */\r
-function compositions_declarer_tables_objets_sql($tables){\r
-\r
-       // champs composition et composition_lock sur tous les objets\r
-       // c'est easy\r
-       $tables[]['field']['composition'] = "varchar(255) DEFAULT '' NOT NULL";\r
-       $tables[]['field']['composition_lock'] = "tinyint(1) DEFAULT 0 NOT NULL";\r
-       $tables['spip_rubriques']['field']['composition_branche_lock'] = "tinyint(1) DEFAULT 0 NOT NULL";\r
-\r
-       return $tables;\r
-}\r
-\r
-\r
-/**\r
- * Fonction vide pour le pipeline homonyme\r
- */\r
-function compositions_autoriser(){}\r
-\r
-/**\r
- * Autorisation de modifier la composition\r
- *\r
- * @param string $faire\r
- * @param string $type\r
- * @param int $id\r
- * @param array $qui\r
- * @param array $opt\r
- * @return bool\r
- */\r
-function autoriser_styliser_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){\r
-       include_spip('compositions_fonctions');\r
-       if (!autoriser('modifier',$type,$id,$qui,$opt))\r
-               return false;\r
-       if (compositions_verrouiller($type, $id) AND !autoriser('webmestre'))\r
-               return false;\r
-       return true;\r
-}\r
-\r
-\r
-/**\r
- * Pipeline styliser pour definir le fond d'un objet en fonction de sa composition\r
- *\r
- * @param array $flux\r
- * @return array\r
- */\r
-function compositions_styliser($flux){\r
-       // en contexte Z, c'est Z ou Z-core qui stylise (on ne n'en occupe donc pas ici)\r
-       if(!defined('_DIR_PLUGIN_Z') AND !defined('_DIR_PLUGIN_ZCORE')){\r
-               include_spip('compositions_fonctions');\r
-               if (compositions_styliser_auto()){\r
-                       $type = $flux['args']['fond']; // on fait l'approximation fond=type\r
-                       // si le type n'est pas l'objet d'une composition, ne rien faire\r
-                       if (in_array($type,compositions_types())){\r
-                               $contexte = isset($flux['args']['contexte'])?$flux['args']['contexte']:$GLOBALS['contexte'];\r
-                               $serveur = $flux['args']['connect'];\r
-\r
-                               $ext = $flux['args']['ext'];\r
-                               $_id_table = id_table_objet($type);\r
-\r
-                               if ($id = $contexte[$_id_table] AND $composition = compositions_determiner($type,$id,$serveur)){\r
-                                       if ($fond = compositions_selectionner($composition, $type, '', $ext, true, "")){\r
-                                               $flux['data'] = substr($fond, 0, - strlen(".$ext"));\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * Affichage du formulaire de selection de la composition\r
- *\r
- * @param array $flux\r
- * @return array\r
- */\r
-function compositions_affiche_milieu($flux){\r
-       $e = trouver_objet_exec($flux['args']['exec']);\r
-       $objets = compositions_objets_actives();\r
-       if (in_array($e['type'],$objets)\r
-         AND $e['edition']===false){\r
-               $type = $e['type'];\r
-               if ($id = $flux['args'][$e['id_table_objet']]) {\r
-                       $config = unserialize($GLOBALS['meta']['compositions']);\r
-                       $aut = autoriser('styliser',$type,$id);\r
-                       if ((!isset($config['masquer_formulaire']) OR $config['masquer_formulaire'] != 'oui' OR $aut)\r
-                               AND (\r
-                                       ($c=compositions_lister_disponibles($type) AND is_array(reset($c)))\r
-                                       OR ($type == 'rubrique' AND (!isset($config['tout_verrouiller']) OR $config['tout_verrouiller'] != 'oui'))\r
-                                 )\r
-                               ) {\r
-                               $ids = 'formulaire_editer_composition_objet-' . "$type-$id";\r
-                               $texte = recuperer_fond(\r
-                                       'prive/editer/compositions',\r
-                                       array(\r
-                                               'type'=>$type,\r
-                                               'id'=>$id,\r
-                                       )\r
-                               );\r
-\r
-                               if (($p = strpos($flux['data'],'<!--affiche_milieu-->'))!==false)\r
-                                       $flux['data'] = substr_replace($flux['data'],$texte,$p,0);\r
-                               else\r
-                                       $flux['data'] .= $texte;\r
-                       }\r
-               }\r
-       }\r
-\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * Le pipeline compositions_declarer_heritage permet de declarer les heritages\r
- * sous la forme :\r
- *             $heritages['objet'] = 'parent';\r
- * ce qui permet ensuite de faire dans le fichier parent-ma_compo.xml\r
- * <branche type="objet" composition="une_compo" />\r
- * \r
- * A partir de compositions 3.3.0 cette declaration est obligatoire.\r
- * Les objets "standards" de SPIP sont declares ici. (a deplacer dans leurs plugins respectifs ?)\r
- */\r
-function compositions_compositions_declarer_heritage($heritages){\r
-       $heritages['mot'] = 'groupe_mots';\r
-       $heritages['rubrique'] = 'rubrique';\r
-       $heritages['article'] = 'rubrique';\r
-       $heritages['breve'] = 'rubrique';\r
-       $heritages['site'] = 'rubrique';\r
-       return $heritages;\r
-}\r
-\r
-\r
-?>\r
+<?php
+/*
+ * Plugin Compositions
+ * (c) 2007-2009 Cedric Morin
+ * Distribue sous licence GPL
+ *
+ */
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+/**
+ * Declaration des champs sur les objets
+ *
+ * @param array $tables
+ * @return array
+ */
+function compositions_declarer_tables_objets_sql($tables){
+
+       // champs composition et composition_lock sur tous les objets
+       // c'est easy
+       $tables[]['field']['composition'] = "varchar(255) DEFAULT '' NOT NULL";
+       $tables[]['field']['composition_lock'] = "tinyint(1) DEFAULT 0 NOT NULL";
+       $tables['spip_rubriques']['field']['composition_branche_lock'] = "tinyint(1) DEFAULT 0 NOT NULL";
+
+       return $tables;
+}
+
+
+/**
+ * Fonction vide pour le pipeline homonyme
+ */
+function compositions_autoriser(){}
+
+/**
+ * Autorisation de modifier la composition
+ *
+ * @param string $faire
+ * @param string $type
+ * @param int $id
+ * @param array $qui
+ * @param array $opt
+ * @return bool
+ */
+function autoriser_styliser_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL){
+       include_spip('compositions_fonctions');
+       if (!autoriser('modifier',$type,$id,$qui,$opt))
+               return false;
+       if (compositions_verrouiller($type, $id) AND !autoriser('webmestre'))
+               return false;
+       return true;
+}
+
+
+/**
+ * Pipeline styliser pour definir le fond d'un objet en fonction de sa composition
+ *
+ * @param array $flux
+ * @return array
+ */
+function compositions_styliser($flux){
+       // en contexte Z, c'est Z ou Z-core qui stylise (on ne n'en occupe donc pas ici)
+       if(!defined('_DIR_PLUGIN_Z') AND !defined('_DIR_PLUGIN_ZCORE')){
+               include_spip('compositions_fonctions');
+               if (compositions_styliser_auto()){
+                       $type = $flux['args']['fond']; // on fait l'approximation fond=type
+                       // si le type n'est pas l'objet d'une composition, ne rien faire
+                       if (in_array($type,compositions_types())){
+                               $contexte = isset($flux['args']['contexte'])?$flux['args']['contexte']:$GLOBALS['contexte'];
+                               $serveur = $flux['args']['connect'];
+
+                               $ext = $flux['args']['ext'];
+                               $_id_table = id_table_objet($type);
+
+                               if ($id = $contexte[$_id_table] AND $composition = compositions_determiner($type,$id,$serveur)){
+                                       if ($fond = compositions_selectionner($composition, $type, '', $ext, true, "")){
+                                               $flux['data'] = substr($fond, 0, - strlen(".$ext"));
+                                       }
+                               }
+                       }
+               }
+       }
+       return $flux;
+}
+
+/**
+ * Affichage du formulaire de selection de la composition
+ *
+ * @param array $flux
+ * @return array
+ */
+function compositions_affiche_milieu($flux){
+       $e = trouver_objet_exec($flux['args']['exec']);
+       $objets = compositions_objets_actives();
+       if (in_array($e['type'],$objets)
+         AND $e['edition']===false){
+               $type = $e['type'];
+               if ($id = $flux['args'][$e['id_table_objet']]) {
+                       $config = (isset($GLOBALS['meta']['compositions']) ? unserialize($GLOBALS['meta']['compositions']) : array());
+                       $aut = autoriser('styliser',$type,$id);
+                       if ((!isset($config['masquer_formulaire']) OR $config['masquer_formulaire'] != 'oui' OR $aut)
+                               AND (
+                                       ($c=compositions_lister_disponibles($type) AND is_array(reset($c)))
+                                       OR ($type == 'rubrique' AND (!isset($config['tout_verrouiller']) OR $config['tout_verrouiller'] != 'oui'))
+                                 )
+                               ) {
+                               $ids = 'formulaire_editer_composition_objet-' . "$type-$id";
+                               $texte = recuperer_fond(
+                                       'prive/editer/compositions',
+                                       array(
+                                               'type'=>$type,
+                                               'id'=>$id,
+                                       )
+                               );
+
+                               if (($p = strpos($flux['data'],'<!--affiche_milieu-->'))!==false)
+                                       $flux['data'] = substr_replace($flux['data'],$texte,$p,0);
+                               else
+                                       $flux['data'] .= $texte;
+                       }
+               }
+       }
+
+       return $flux;
+}
+
+/**
+ * Le pipeline compositions_declarer_heritage permet de declarer les heritages
+ * sous la forme :
+ *             $heritages['objet'] = 'parent';
+ * ce qui permet ensuite de faire dans le fichier parent-ma_compo.xml
+ * <branche type="objet" composition="une_compo" />
+ * 
+ * A partir de compositions 3.3.0 cette declaration est obligatoire.
+ * Les objets "standards" de SPIP sont declares ici. (a deplacer dans leurs plugins respectifs ?)
+ */
+function compositions_compositions_declarer_heritage($heritages){
+       $heritages['mot'] = 'groupe_mots';
+       $heritages['rubrique'] = 'rubrique';
+       $heritages['article'] = 'rubrique';
+       $heritages['breve'] = 'rubrique';
+       $heritages['site'] = 'rubrique';
+       return $heritages;
+}
+
+
+?>
index f43a62d..39a474b 100644 (file)
@@ -6,8 +6,8 @@
 
        <form method="post" action="#SELF"><div>
                #ACTION_FORMULAIRE
-               <ul>
-                       #SET{name,objets}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <ul class="editer-groupe">
+                       #SET{name,objets}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
                        <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
                                <label><:compositions:label_activer_composition_objets:></label>[
                                <span class='erreur_message'>(#GET{erreurs})</span>
@@ -15,7 +15,7 @@
                                #INCLURE{fond=formulaires/inc-choisir-objets,name=#GET{name},selected=#ENV**{#GET{name},#LISTE{spip_articles,spip_rubriques}}}
                        </li>
 
-                       <li class='configurer_chemin_compositions'>
+                       <li class='editer configurer_chemin_compositions'>
                                <label for="chemin_compositions"><:compositions:label_chemin_compositions:></label>
                                [(#PLUGIN{z}|ou{#PLUGIN{zcore}}|non)<div class='explication'><:compositions:label_chemin_compositions_details:></div>]
                                <input type="text" name="chemin_compositions" value="[(#REM|compositions_chemin|entites_html)]" id="chemin_compositions" class="text" [(#PLUGIN{z}|ou{#PLUGIN{zcore}}|oui)disabled="true"] />
                                </div>
                        </li>
                        ]
-                       <li class='configurer_masquer_formulaire'>
+                       <li class='editer configurer_masquer_formulaire'>
                                <label><:compositions:label_masquer_formulaire:></label>
                                <div class="choix">
                                        <input type="checkbox" name="masquer_formulaire" [checked="(#ENV{masquer_formulaire}|=={oui}|?{checked})"] id="masquer_formulaire" value='oui' />
                                        <label for="masquer_formulaire"><:compositions:label_masquer_formulaire_composition:></label>
                                </div>
                        </li>
-                       <li class='configurer_tout_verrouiller'>
+                       <li class='editer configurer_tout_verrouiller'>
                                <label><:compositions:label_tout_verrouiller:></label>
                                <div class="choix">
                                        <input type="checkbox" name="tout_verrouiller" [checked="(#ENV{tout_verrouiller}|=={oui}|?{checked})"] id="tout_verrouiller" value='oui' />
@@ -46,4 +46,4 @@
                <p class='boutons'><input class='submit' type="submit" name="_cfg_ok" value="<:bouton_enregistrer:>" /></p>
        </div></form>
 
-</div>
\ No newline at end of file
+</div>
index 959bcd5..0eda9b0 100644 (file)
-<div class="formulaire_spip formulaire_#FORM formulaire_#FORM-#ENV{objet}-#ENV{id,nouveau}">\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}'><div>\r
-               [(#REM) declarer les hidden qui declencheront le service du formulaire\r
-               parametre : url d'action ]\r
-               #ACTION_FORMULAIRE{#ENV{action}}\r
-       ]\r
-       <h4[\r
-               style="background-image: url((#ENV{_compositions}|table_valeur{#ENV{composition}}|table_valeur{icon}|image_reduire{24,24}|extraire_attribut{src}))"][\r
-               title="(#ENV{_compositions}|table_valeur{#ENV{composition}}|table_valeur{description}|attribut_html)"]>\r
-               <:compositions:composition_utilisee:>\r
-                       <span class="composition_actuelle">[(#ENV{composition}|oui)[(#ENV{_compositions}|table_valeur{#ENV{composition}}|table_valeur{nom}|supprimer_numero|sinon{#ENV{composition}})]\r
-                       ][(#ENV{composition}|non)\r
-                               [(#ENV{composition_heritee}|oui)\r
-                                       [(#ENV{composition_heritee}|=={'-'}|oui)<:compositions:composition_defaut:>]\r
-                                       [(#ENV{composition_heritee}|!={'-'}|oui)[(#ENV{_compositions}|table_valeur{''}|table_valeur{nom}|supprimer_numero|sinon{#ENV{composition_heritee}})]]\r
-                                       <span class="precision">(<:compositions:composition_heritee:>)</span>\r
-                               ]\r
-                               [(#ENV{composition_heritee}|non)<:compositions:composition_defaut:>]\r
-                       ][(#ENV{composition_verrouillee}|oui) <img src="#CHEMIN_IMAGE{cadenas-16.png}" alt="" />]\r
-                       </span>\r
-       </h4>\r
-       [(#ENV{editable})\r
-       <span class="toggle_box_link" style="display:none;">&#91;<a href="#"\r
-                       onclick="var f=jQuery(this).parents('form').eq(0);f.find('p').show('fast');f.find('ul').show('fast');f.find('.toggle_box_link').hide('fast');return false;"\r
-                       ><:bouton_changer:></a>&#93;</span>\r
-       ]\r
-       <div class="detail">\r
-               [(#ENV{composition_verrouillee}|oui)<p><:compositions:composition_verrouillee:></p>]\r
-               <B_heritages><p><:compositions:heritages:> <BOUCLE_heritages(POUR){tableau #ENV{_compositions}|table_valeur{#ENV{composition}}|table_valeur{branche}}{', '}>#CLE (#VALEUR)</BOUCLE_heritages>.</p></B_heritages>\r
-       </div>\r
-\r
-       [(#ENV{editable})\r
-       <ul>\r
-               #SET{fl,compositions}\r
-               #SET{name,composition}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}#SET{obli,''}\r
-               [<li class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">\r
-                       <label>[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>\r
-                               [<span class='erreur_message'>(#GET{erreurs})</span>]\r
-                               (#INCLURE{fond=formulaires/inc-selecteur_composition}{name=#GET{name}}{id=#GET{name}}{id_rubrique}{selected=#ENV{#GET{name}}}{_compositions}{composition_heritee})\r
-               </li>]\r
-               \r
-               #SET{lock,''}\r
-               [(#AUTORISER{webmestre}|et{#ENV{verrou_branche}|non}|et{#CONFIG{compositions/tout_verrouiller}|non}|oui)\r
-                       #SET{name,composition_lock}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}#SET{obli,''}\r
-                       <li class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">\r
-                               [<span class='erreur_message'>(#GET{erreurs})</span>]\r
-                               <label><:compositions:label_composition_explication:></label>\r
-                               [(#ENV{_compositions}|is_array|oui)\r
-                               <div class="choix">\r
-                                       <input type="checkbox" class="checkbox" name="#GET{name}" value="1" id="#GET{name}"[ (#ENV{#GET{name}}|oui)checked="checked"] />\r
-                                       <label for="#GET{name}">[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>\r
-                               </div>\r
-                               ]\r
-                               [(#ENV{_compositions}|is_array|non)<input type="hidden" name="composition_lock" id="composition_lock" value="#ENV{composition_lock}" />]\r
-                               [(#ENV{objet}|=={rubrique}|oui)\r
-                               #SET{name,composition_branche_lock}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}#SET{obli,''}\r
-                                       [<span class='erreur_message'>(#GET{erreurs})</span>]\r
-                                       <div class="choix">\r
-                                               <input type="checkbox" class="checkbox" name="#GET{name}" value="1" id="#GET{name}"[ (#ENV{#GET{name}}|oui)checked="checked"] />\r
-                                               <label for="#GET{name}">[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>\r
-                                       </div>\r
-                               ]\r
-                       </li>\r
-                       #SET{lock,'oui'}\r
-               ]\r
-               [(#ENV{verrou_branche}|oui)\r
-               <li>\r
-                       <label><:compositions:label_information:></label>\r
-                       <:compositions:label_branche_verrouillee:>\r
-               </li>\r
-               ]\r
-               [(#CONFIG{compositions/tout_verrouiller}|oui)\r
-               <li>\r
-                       <label><:compositions:label_information:></label>\r
-                       <:compositions:label_toutes_verrouilles:>\r
-               </li>\r
-               ]\r
-       </ul>\r
-       [(#GET{lock}|non)\r
-               <input type="hidden" name="composition_lock" id="composition_lock" value="#ENV{composition_lock}" />\r
-               [(#ENV{objet}|=={rubrique}|oui)\r
-                       <input type="hidden" name="composition_branche_lock" id="composition_branche_lock" value="#ENV{composition_branche_lock}" />\r
-               ]\r
-       ]\r
-\r
-         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]\r
-         <!--extra-->\r
-         <p class='boutons'>\r
-                       <span class='image_loading'>&nbsp;</span>\r
-                       <input type='submit' class='submit' name='annuler' value='<:bouton_annuler:>' />\r
-                       <input type='submit' class='submit' name='changer' value='<:bouton_changer:>' />\r
-               </p>\r
-       </div></form>\r
-       ]\r
-</div>\r
-<script type="text/javascript">// <![CDATA[\r
-       $(document).ready(function(){\r
-               $(".formulaire_editer_composition_objet .toggle_box_link").show(0);\r
-               $(".formulaire_editer_composition_objet p").hide(0);\r
-               $(".formulaire_editer_composition_objet ul").hide(0);\r
-       });\r
- //]]></script>
\ No newline at end of file
+<div class="formulaire_spip formulaire_#FORM formulaire_#FORM-#ENV{objet}-#ENV{id,nouveau}">
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+       [(#ENV{editable})
+       <form method='post' action='#ENV{action}'><div>
+               [(#REM) declarer les hidden qui declencheront le service du formulaire
+               parametre : url d'action ]
+               #ACTION_FORMULAIRE{#ENV{action}}
+       ]
+       <h4[
+               style="background-image: url((#ENV{_compositions/#ENV{composition}/icon}|image_reduire{24,24}|extraire_attribut{src}))"][
+               title="(#ENV{_compositions/#ENV{composition}/description}|attribut_html)"]>
+               <:compositions:composition_utilisee:>
+                       <span class="composition_actuelle">[(#ENV{composition}|oui)[(#ENV{_compositions/#ENV{composition}/nom}|supprimer_numero|sinon{#ENV{composition}})]
+                       ][(#ENV{composition}|non)
+                               [(#ENV{composition_heritee}|oui)
+                                       [(#ENV{composition_heritee}|=={'-'}|oui)<:compositions:composition_defaut:>]
+                                       [(#ENV{composition_heritee}|!={'-'}|oui)[(#ENV{_compositions}|table_valeur{''}|table_valeur{nom}|supprimer_numero|sinon{#ENV{composition_heritee}})]]
+                                       <span class="precision">(<:compositions:composition_heritee:>)</span>
+                               ]
+                               [(#ENV{composition_heritee}|non)<:compositions:composition_defaut:>]
+                       ][(#ENV{composition_verrouillee}|oui) <img src="#CHEMIN_IMAGE{cadenas-16.png}" alt="" />]
+                       </span>
+       </h4>
+       [(#ENV{editable})
+       <span class="toggle_box_link" style="display:none;">&#91;<a href="#"
+                       onclick="var f=jQuery(this).parents('form').eq(0);f.find('p').show('fast');f.find('ul').show('fast');f.find('.toggle_box_link').hide('fast');return false;"
+                       ><:bouton_changer:></a>&#93;</span>
+       ]
+       <div class="detail">
+               [(#ENV{composition_verrouillee}|oui)<p><:compositions:composition_verrouillee:></p>]
+               <B_heritages>
+                       <p><:compositions:heritages:>
+               <BOUCLE_heritages(DATA){source tableau, #ENV{_compositions/#ENV{composition}/branche}}{', '}>#CLE (#VALEUR)</BOUCLE_heritages>
+                       .</p>
+               </B_heritages>
+       </div>
+
+       [(#ENV{editable})
+       <ul class="editer-groupe">
+               #SET{fl,compositions}
+               #SET{name,composition}#SET{erreurs,#ENV**{erreurs/#GET{name}}}#SET{obli,''}
+               [<li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label>[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>
+                               [<span class='erreur_message'>(#GET{erreurs})</span>]
+                               (#INCLURE{fond=formulaires/inc-selecteur_composition}{name=#GET{name}}{id=#GET{name}}{id_rubrique}{selected=#ENV{#GET{name}}}{_compositions}{composition_heritee})
+               </li>]
+
+               #SET{lock,''}
+               [(#AUTORISER{webmestre}|et{#ENV{verrou_branche}|non}|et{#CONFIG{compositions/tout_verrouiller}|non}|oui)
+                       #SET{name,composition_lock}#SET{erreurs,#ENV**{erreurs/#GET{name}}}#SET{obli,''}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               [<span class='erreur_message'>(#GET{erreurs})</span>]
+                               <label><:compositions:label_composition_explication:></label>
+                               [(#ENV{_compositions}|is_array|oui)
+                               <div class="choix">
+                                       <input type="checkbox" class="checkbox" name="#GET{name}" value="1" id="#GET{name}"[ (#ENV{#GET{name}}|oui)checked="checked"] />
+                                       <label for="#GET{name}">[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>
+                               </div>
+                               ]
+                               [(#ENV{_compositions}|is_array|non)<input type="hidden" name="composition_lock" id="composition_lock" value="#ENV{composition_lock}" />]
+                               [(#ENV{objet}|=={rubrique}|oui)
+                               #SET{name,composition_branche_lock}#SET{erreurs,#ENV**{erreurs/#GET{name}}}#SET{obli,''}
+                                       [<span class='erreur_message'>(#GET{erreurs})</span>]
+                                       <div class="choix">
+                                               <input type="checkbox" class="checkbox" name="#GET{name}" value="1" id="#GET{name}"[ (#ENV{#GET{name}}|oui)checked="checked"] />
+                                               <label for="#GET{name}">[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>
+                                       </div>
+                               ]
+                       </li>
+                       #SET{lock,'oui'}
+               ]
+               [(#ENV{verrou_branche}|oui)
+               <li class="editer editer_branche_verrouillee">
+                       <label><:compositions:label_information:></label>
+                       <:compositions:label_branche_verrouillee:>
+               </li>
+               ]
+               [(#CONFIG{compositions/tout_verrouiller}|oui)
+               <li class="editer editer_toutes_verouillees">
+                       <label><:compositions:label_information:></label>
+                       <:compositions:label_toutes_verrouilles:>
+               </li>
+               ]
+       </ul>
+       [(#GET{lock}|non)
+               <input type="hidden" name="composition_lock" id="composition_lock" value="#ENV{composition_lock}" />
+               [(#ENV{objet}|=={rubrique}|oui)
+                       <input type="hidden" name="composition_branche_lock" id="composition_branche_lock" value="#ENV{composition_branche_lock}" />
+               ]
+       ]
+
+         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
+         <!--extra-->
+         <p class='boutons'>
+                       <span class='image_loading'>&nbsp;</span>
+                       <input type='submit' class='submit' name='annuler' value='<:bouton_annuler:>' />
+                       <input type='submit' class='submit' name='changer' value='<:bouton_changer:>' />
+               </p>
+       </div></form>
+       ]
+</div>
+<script type="text/javascript">// <![CDATA[
+       $(document).ready(function(){
+               $(".formulaire_editer_composition_objet .toggle_box_link").show(0);
+               $(".formulaire_editer_composition_objet p").hide(0);
+               $(".formulaire_editer_composition_objet ul").hide(0);
+       });
+ //]]></script>
diff --git a/www/plugins/compositions_v3/formulaires/inc-informeur_composition.html b/www/plugins/compositions_v3/formulaires/inc-informeur_composition.html
deleted file mode 100644 (file)
index 0ac2614..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<B_pour>
-<BOUCLE_pour(POUR){tableau #ENV{_compositions}}{cle=#ENV{selected}}>
-<div class='choix'>[(#VALEUR|table_valeur{icon}|image_reduire{24,24}|inserer_attribut{class,logo})]
-[(#VALEUR|table_valeur{nom})]
-[<br /><span class='descriptif'>(#VALEUR|table_valeur{description})</span>]
-</div>
-</BOUCLE_pour>
-</B_pour>
\ No newline at end of file
index d63dfc4..44c2102 100644 (file)
@@ -1,7 +1,13 @@
-<B_pour>\r
-<BOUCLE_pour(POUR){tableau #ENV{_compositions}}{par nom}>\r
-<div class='choix'>\r
-<input type='radio' class='radio' name='#ENV{name}' id='[(#ENV{name})]-#CLE' value='#CLE'[(#CLE|=={#ENV{selected}}|oui)checked='checked'] /><label for='[(#ENV{name})]-#CLE'>[(#VALEUR|table_valeur{icon}|sinon{#CHEMIN_IMAGE{composition-24.png}}|image_reduire{24,24}|inserer_attribut{class,logo})][(#VALEUR|table_valeur{nom}|supprimer_numero)][(#ENV{composition_heritee}|et{#CLE|=={''}}|oui)(<:compositions:composition_heritee:>)][<br /><span class='descriptif'>(#VALEUR|table_valeur{description})</span>]</label>\r
-</div>\r
-</BOUCLE_pour>\r
-</B_pour>
\ No newline at end of file
+<BOUCLE_compositions(DATA){source tableau, #ENV{_compositions}}{par nom}>
+<div class='choix'>
+<input type='radio' class='radio' name='#ENV{name}' id='#ENV{name}-#CLE' value='#CLE'[(#CLE|=={#ENV{selected}}|oui)checked='checked'] />
+<label for='#ENV{name}-#CLE'>
+       [ [<a href="(#IMAGE_EXEMPLE|balise_img|extraire_attribut{src})" class='mediabox exemple' title="<:compositions:voir_image_exemple|attribut_html:>">]
+               (#ICON|sinon{#CHEMIN_IMAGE{composition-24.png}}|image_reduire{24,24}|inserer_attribut{class,logo})
+               [(#IMAGE_EXEMPLE|oui)</a>]
+       ]
+       [(#NOM|supprimer_numero)][(#ENV{composition_heritee}|et{#CLE|=={''}}|oui)(<:compositions:composition_heritee:>)]
+       [<br /><span class='descriptif'>(#DESCRIPTION)</span>]
+</label>
+</div>
+</BOUCLE_compositions>
index 96fd125..63c3822 100644 (file)
Binary files a/www/plugins/compositions_v3/images/composition-cours.png and b/www/plugins/compositions_v3/images/composition-cours.png differ
index ce4f60e..3479d45 100755 (executable)
Binary files a/www/plugins/compositions_v3/images/composition-tableau.png and b/www/plugins/compositions_v3/images/composition-tableau.png differ
index d4ba8cd..acc1452 100644 (file)
Binary files a/www/plugins/compositions_v3/images/composition-test.png and b/www/plugins/compositions_v3/images/composition-test.png differ
diff --git a/www/plugins/compositions_v3/images/objet-blocs.png b/www/plugins/compositions_v3/images/objet-blocs.png
new file mode 100644 (file)
index 0000000..7693967
Binary files /dev/null and b/www/plugins/compositions_v3/images/objet-blocs.png differ
diff --git a/www/plugins/compositions_v3/images/objet-intro-blocs.png b/www/plugins/compositions_v3/images/objet-intro-blocs.png
new file mode 100644 (file)
index 0000000..2f256de
Binary files /dev/null and b/www/plugins/compositions_v3/images/objet-intro-blocs.png differ
index 8a09263..17b8a2c 100644 (file)
Binary files a/www/plugins/compositions_v3/images/objet-liste-contenus-dates.png and b/www/plugins/compositions_v3/images/objet-liste-contenus-dates.png differ
index 0c39d8e..86f1fa0 100644 (file)
Binary files a/www/plugins/compositions_v3/images/objet-liste-contenus.png and b/www/plugins/compositions_v3/images/objet-liste-contenus.png differ
index 1f387f3..75e0d09 100644 (file)
Binary files a/www/plugins/compositions_v3/images/objet-simple.png and b/www/plugins/compositions_v3/images/objet-simple.png differ
index f705be1..028e995 100644 (file)
@@ -19,9 +19,9 @@ include_spip('compositions_fonctions');
 function compositions_decomposer_nom($nom){
        $reg = ",^([a-z][^-.]*)("._COMPOSITIONS_MATCH.")?$,i";
        if (
-               // recuperer le type et la composition
+               /* recuperer le type et la composition */
          preg_match($reg,$nom,$matches)
-         // il y a bien un type
+         /* il y a bien un type */
          AND $type=$matches[1]
        ){
                $composition = isset($matches[3])?$matches[3]:'';
@@ -38,7 +38,7 @@ function compositions_decomposer_nom($nom){
  * @return array|string
  */
 function compositions_charger_infos($nom,$info=""){
-               // on peut appeller avec le nom du squelette
+               /* on peut appeller avec le nom du squelette */
                $nom = preg_replace(',[.]html$,i','',$nom).".xml";
                include_spip('inc/xml');
                $composition = array();
@@ -49,13 +49,16 @@ function compositions_charger_infos($nom,$info=""){
                                $composition['description'] = isset($xml['description'])?_T_ou_typo(spip_xml_aplatit($xml['description'])):'';
                                if (isset($xml['icon'])) {
                                        $icon = chemin_image(reset($xml['icon']));
-                                       if (!$icon)
+                                       if (!$icon) {
                                                $icon = find_in_path(reset($xml['icon']));
-                               } else
+                                       }
+                               } else {
                                        $icon = '';
+                               }
+                               $composition['image_exemple'] = isset($xml['image_exemple']) ? find_in_path(reset($xml['image_exemple'])) : '';
                                $composition['icon'] = $icon;
-                               $composition['class'] = isset($xml['class'])?trim(reset($xml['class'])):'';
-                               $composition['configuration'] = isset($xml['configuration'])?spip_xml_aplatit($xml['configuration']):'';
+                               $composition['class'] = isset($xml['class']) ? trim(reset($xml['class'])) : '';
+                               $composition['configuration'] = isset($xml['configuration']) ? spip_xml_aplatit($xml['configuration']) : '';
                                $composition['branche'] = array();
                                if (spip_xml_match_nodes(',^branche,', $xml, $branches)){
                                        foreach (array_keys($branches) as $branche){
@@ -67,7 +70,7 @@ function compositions_charger_infos($nom,$info=""){
                }
                if (!$info)
                        return $composition;
-               else 
+               else
                        return isset($composition[$info])?$composition[$info]:"";
 }
 
@@ -86,12 +89,12 @@ function compositions_charger_infos($nom,$info=""){
  * @param array $liste
  */
 function compositions_cacher($liste=null){
-       // lister les compositions vraiment utilisees
+       /* lister les compositions vraiment utilisees */
        if (!is_array($liste)){
                include_spip('compositions_fonctions');
                $liste = compositions_lister_disponibles('',false);
        }
-       // lister les objets dont on a active la composition dans la configuration
+       /* lister les objets dont on a active la composition dans la configuration */
        $config = compositions_objets_actives();
 
        $liste = array_intersect($config,array_keys($liste));
@@ -99,4 +102,4 @@ function compositions_cacher($liste=null){
        spip_log('compositions: maj des compositions_types ['.$GLOBALS['meta']['compositions_types'].']');
 }
 
-?>
\ No newline at end of file
+?>
index 60ecc2f..637cc86 100644 (file)
@@ -1,19 +1,26 @@
 <traduction module="compositions" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/compositions/trunk/lang/" reference="fr">
-       <langue code="en" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=en" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=de" total="34" traduits="30" relire="0" modifs="0" nouveaux="4" pourcent="88.24">
+               <traducteur nom="Torsten Willmann" lien="http://trad.spip.net/auteur/torsten-willmann" />
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=en" total="34" traduits="34" 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="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=es" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=es" total="34" traduits="29" relire="0" modifs="0" nouveaux="5" pourcent="85.29">
+               <traducteur nom="alf" lien="http://trad.spip.net/auteur/alf" />
                <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/compositions?lang_cible=fr" total="28" traduits="28" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=fr" total="34" traduits="34" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="nl" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=nl" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=nl" total="34" traduits="34" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+               <traducteur nom="mpossoz" lien="http://trad.spip.net/auteur/mpossoz" />
        </langue>
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=ru" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=ru" total="34" traduits="28" relire="0" modifs="0" nouveaux="6" pourcent="82.35">
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=sk" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/compositions?lang_cible=sk" total="34" traduits="28" relire="0" modifs="0" nouveaux="6" pourcent="82.35">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
diff --git a/www/plugins/compositions_v3/lang/compositions_de.php b/www/plugins/compositions_v3/lang/compositions_de.php
new file mode 100644 (file)
index 0000000..f088f02
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'composition' => 'Komposition',
+       'composition_defaut' => 'Standardkomposition',
+       'composition_heritee' => 'vererbt',
+       'composition_utilisee' => 'Komposition:',
+       'composition_verrouillee' => 'Diese Komposition ist durch den Webmaster gesperrt.',
+       'compositions' => 'Kompositionen',
+
+       // D
+       'des_utilisations' => '@nb@ Nutzungen',
+
+       // H
+       'heritages' => 'Diese Komposition bestimmt die Standardkomposition für folgende Objekte:',
+
+       // I
+       'info_aucune_composition' => 'Keine Komposition',
+
+       // L
+       'label_activer_composition_objets' => 'Komposition für die Objekte verwenden',
+       'label_branche_verrouillee' => 'Die Kompositionen dieses Zweigs sind gesperrt.',
+       'label_chemin_compositions' => 'Kompositionsverzeichnis',
+       'label_chemin_compositions_details' => 'Geben Sie den Pfad an unter dem die Skelette für die Kompostionen gefunden werden.',
+       'label_composition' => 'Komposition',
+       'label_composition_branche_lock' => 'Komposition für alle Objekte im Zweig festlegen.',
+       'label_composition_explication' => 'Sie sind Webmaster, sie können',
+       'label_composition_lock' => 'Komposition sperren',
+       'label_composition_rubrique' => 'Kompositionen für Rubriken',
+       'label_heritages' => 'Vererbungen',
+       'label_information' => 'Information',
+       'label_masquer_formulaire' => 'Formular verbergen',
+       'label_masquer_formulaire_composition' => 'Das Formular zur Auswahl einer Komposition verbergen, wenn der Nutzer keine Berechtigung zum Ändern hat.',
+       'label_pas_de_composition' => 'Keine Komposition',
+       'label_styliser' => 'Auswahl der Skelette',
+       'label_styliser_auto' => 'Skelette nicht automatisch auswählen. Die Auswahl wird von meinen Skeletten unterstützt.',
+       'label_tout_verrouiller' => 'Alle sperren',
+       'label_toutes_verrouilles' => 'Alle Kompositionen sind gesperrt.',
+       'label_verrouiller_toutes_compositions' => 'Alle Kompostionen sperren (nur Webmaster können Sie verändern).',
+
+       // U
+       'une_utilisation' => '1 Nutzung',
+
+       // V
+       'voir_image_exemple' => 'Beispielbild anzeigen'
+);
index 56b4719..f40580a 100644 (file)
@@ -3,10 +3,15 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // A
+       'ajouter_compositions' => 'Add compositions',
+
        // C
        'composition' => 'Composition',
        'composition_defaut' => 'default composition',
@@ -21,6 +26,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'This composition defines default compositions for the following objects:',
 
+       // I
+       'info_1_composition' => '1 composition',
+       'info_aucune_composition' => 'No composition',
+       'info_nb_compositions' => '@nb@ compositions',
+
        // L
        'label_activer_composition_objets' => 'Use compositions on objects',
        'label_branche_verrouillee' => 'The compositions of this branch are locked.',
@@ -31,6 +41,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_composition_explication' => 'You are Webmaster, you can',
        'label_composition_lock' => 'Lock the composition',
        'label_composition_rubrique' => 'Sections composition',
+       'label_heritages' => 'Heritages',
        'label_information' => 'Information',
        'label_masquer_formulaire' => 'Hide the form',
        'label_masquer_formulaire_composition' => 'Hide the selection form of a composition when the user does not have the rights to edit it.',
@@ -41,8 +52,12 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_toutes_verrouilles' => 'All compositions are locked.',
        'label_verrouiller_toutes_compositions' => 'Lock all compositions (only the webmasters can change them).',
 
+       // M
+       'message_info_ajouter_compositions' => 'To create your own compositions, see the documentation : @url_doc@.',
+
        // U
-       'une_utilisation' => '1 use'
-);
+       'une_utilisation' => '1 use',
 
-?>
+       // V
+       'voir_image_exemple' => 'See an image sample'
+);
index 4c1aa3b..d7b7992 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -21,6 +23,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'Esta composición define las composiciones por defecto para los siguientes objetos:',
 
+       // I
+       'info_aucune_composition' => ' Ninguna composición',
+
        // L
        'label_activer_composition_objets' => 'Utilizar las composiciones en los objetos',
        'label_branche_verrouillee' => 'Las composiciones de esta rama están bloqueadas.',
@@ -31,6 +36,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_composition_explication' => 'Usted es administrador, puede',
        'label_composition_lock' => 'Bloquear la composición',
        'label_composition_rubrique' => 'Composición de las secciones',
+       'label_heritages' => 'Herencias',
        'label_information' => 'Información',
        'label_masquer_formulaire' => 'Ocultar el formulario',
        'label_masquer_formulaire_composition' => 'Ocultar el formulario de elección de una composición cuando el usuario no tenga los derechos para modificarla. ',
@@ -44,5 +50,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // U
        'une_utilisation' => '1 utilización'
 );
-
-?>
index e351a84..7aa60c5 100644 (file)
@@ -1,10 +1,15 @@
 <?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_/compositions/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // A
+       'ajouter_compositions' => 'Ajouter des compositions',
+
        // C
        'composition' => 'Composition',
        'composition_defaut' => 'composition par défaut',
@@ -19,6 +24,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'Cette composition définit des compositions par défaut pour les objets suivants :',
 
+       // I
+       'info_1_composition' => '1 composition',
+       'info_aucune_composition' => 'Aucune composition',
+       'info_nb_compositions' => '@nb@ compositions',
+
        // L
        'label_activer_composition_objets' => 'Utiliser les compositions sur les objets',
        'label_branche_verrouillee' => 'Les compositions de cette branche sont verrouillées.',
@@ -40,8 +50,12 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_toutes_verrouilles' => 'Toutes les compositions sont verrouillées.',
        'label_verrouiller_toutes_compositions' => 'Verrouiller toutes les compositions (seuls les webmestres pourront les modifier).',
 
+       // M
+       'message_info_ajouter_compositions' => 'Pour créer vos propres compositions, consultez la documentation : @url_doc@.',
+
        // U
-       'une_utilisation' => '1 utilisation'
-);
+       'une_utilisation' => '1 utilisation',
 
-?>
+       // V
+       'voir_image_exemple' => 'Voir une image d’exemple'
+);
index 366e048..9998be5 100644 (file)
@@ -3,10 +3,15 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // A
+       'ajouter_compositions' => 'Composities toevoegen',
+
        // C
        'composition' => 'Compositie',
        'composition_defaut' => 'standaard compositie',
@@ -21,6 +26,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'Deze compositie legt de standaardcompositie vast van de volgende objecten:',
 
+       // I
+       'info_1_composition' => '1 compositie',
+       'info_aucune_composition' => 'Geen enkele compositie',
+       'info_nb_compositions' => '@nb@ composities',
+
        // L
        'label_activer_composition_objets' => 'Pas de composities toe op de objecten',
        'label_branche_verrouillee' => 'De composities van deze tak zijn vergrendeld.',
@@ -31,6 +41,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_composition_explication' => 'Je bent webmaster. Je mag',
        'label_composition_lock' => 'Vergrendel de compositie',
        'label_composition_rubrique' => 'Compositie van rubrieken',
+       'label_heritages' => 'Erfenis',
        'label_information' => 'Informatie',
        'label_masquer_formulaire' => 'Het formulier verbergen',
        'label_masquer_formulaire_composition' => 'Verberg het compositie-keuzemenu wanneer de gebruiker het recht niet heeft ze te veranderen.',
@@ -41,8 +52,12 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_toutes_verrouilles' => 'Alle composities zijn vergrendeld.',
        'label_verrouiller_toutes_compositions' => 'Alle composities vergrendelen (alleen webmasters kunnen ze aanpassen).',
 
+       // M
+       'message_info_ajouter_compositions' => 'Om je eigen composities te maken, raadpleeg je de documentatie: @url_doc@.',
+
        // U
-       'une_utilisation' => '1 toepassing'
-);
+       'une_utilisation' => '1 toepassing',
 
-?>
+       // V
+       'voir_image_exemple' => 'Een voorbeeldafbeelding bekijken'
+);
index 6cf56cc..33e5118 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -21,6 +23,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'Этот шаблон определяет шаблоны страниц по умолчанию для следующих объектов:',
 
+       // I
+       'info_aucune_composition' => 'Нет шаблонов',
+
        // L
        'label_activer_composition_objets' => 'Использовать выбор шаблонов для объектов',
        'label_branche_verrouillee' => 'Выбор шаблонов в этой ветке заблокирован вебмастером.',
@@ -44,5 +49,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // U
        'une_utilisation' => '1 использование'
 );
-
-?>
index 76684b3..acb7bf2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/compositions?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -21,6 +23,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // H
        'heritages' => 'Toto rozmiestnenie je predvolených rozmiestnením pre tieto objekty:',
 
+       // I
+       'info_aucune_composition' => 'Žiadne rozmiestnenie',
+
        // L
        'label_activer_composition_objets' => 'Rozmiestnenia používať na objekty',
        'label_branche_verrouillee' => 'Rozmiestnenia tejto vetvy sú zamknuté.',
@@ -44,5 +49,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // U
        'une_utilisation' => '1 použitie'
 );
-
-?>
index e89f046..003f063 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-compositions?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Compositions',
        'compositions_slogan' => 'Differ page layouts according to sections, articles...'
 );
-
-?>
index 8acdb0e..da44f28 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-compositions?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Composiciones',
        'compositions_slogan' => 'Variar los formateos según las secciones, los artículos...'
 );
-
-?>
index e7c7f83..28c6eb8 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/compositions/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Compositions',
        'compositions_slogan' => 'Varier les mises en page selon les rubriques, les articles...'
 );
-
-?>
index 00a21e8..3dfeb72 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-compositions?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Composities',
        'compositions_slogan' => 'Varieer de indeling van de bladzijdes volgens rubriek, artikel, ...'
 );
-
-?>
index 2c5a3a6..00dab0e 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-compositions?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Шаблоны страниц (Compositions)',
        'compositions_slogan' => 'Возможность задавать определенный шаблон для вывода статьи, раздела и т.д.'
 );
-
-?>
index e282cd8..cb4c2f9 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-compositions?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'compositions_nom' => 'Rozmiestnenia',
        'compositions_slogan' => 'Meňte rozmiestnenie podľa rubrík, článkov, atď.'
 );
-
-?>
index 9323646..eb08144 100644 (file)
@@ -1,9 +1,9 @@
 <paquet
        prefix="compositions"
        categorie="outil"
-       version="3.3.7"
-       etat="test"
-       compatibilite="[3.0.0;3.0.*]"
+       version="3.5.5"
+       etat="stable"
+       compatibilite="[3.0.0;3.1.*]"
        logo="prive/themes/spip/images/composition-32.png"
        schema="0.5.0"
        documentation="http://contrib.spip.net/?article3777"
        <pipeline nom="ieconfig_metas" inclure="compositions_ieconfig.php" />
        <pipeline nom="compositions_declarer_heritage"  inclure="compositions_pipeline.php" />
 
-       <utilise nom="Z" compatibilite="[1.7.10;[" />
-       <utilise nom="Zcore" compatibilite="[2.0.0;[" />
-       <utilise nom="Zpip" compatibilite="[2.0.0;[" />
-       
-       <necessite nom="spip_bonux" compatibilite="[3.0.0;[" />
+       <utilise nom="Z" compatibilite="[1.7.14;]" />
+       <utilise nom="Zcore" compatibilite="[2.0.0;]" />
+       <utilise nom="Zpip" compatibilite="[2.0.7-dev;]" />
 
-       <menu nom="compositions" titre="compositions:compositions" parent="menu_configuration" icone="images/composition-16.png" action="configurer_compositions" />
+       <necessite nom="spip_bonux" compatibilite="[3.0.7;[" />
+
+       <menu nom="compositions" titre="compositions:compositions" parent="menu_squelette" icone="images/composition-16.png" action="compositions" />
 </paquet>
index e448f8e..ceb43b9 100644 (file)
@@ -1 +1 @@
-[<div class="ajax composition">(#FORMULAIRE_EDITER_COMPOSITION_OBJET{#ENV{type},#ENV{id}})</div>]\r
+[<div class="ajax composition">(#FORMULAIRE_EDITER_COMPOSITION_OBJET{#ENV{type},#ENV{id}})</div>]
index 5c55d22..b437486 100644 (file)
@@ -1,48 +1,62 @@
-#SET{compositions,#REM|compositions_lister_disponibles}\r
-\r
-<BOUCLE_compositions(DATA){source tableau, #GET{compositions}}>\r
-       <B_pour>\r
-\r
-       [(#BOITE_OUVRIR{[(#CLE|objet_info{texte_objets}|_T)], simple, section})]\r
-\r
-       <div class='liste'>\r
-               <ul class="liste-items compositions">\r
-                       <BOUCLE_pour(DATA){source tableau, #VALEUR}{par nom}>\r
-                       <li class="item">\r
-                               [(#ICON|image_reduire{24,24}|inserer_attribut{class,logo})]\r
-\r
-                               <h4>[(#NOM|supprimer_numero)]</h4>\r
-\r
-                               [<div class='descriptif'>(#DESCRIPTION)</div>]\r
-\r
-                               <B_heritages>\r
-                               [(#BOITE_OUVRIR{<:compositions:label_heritages:>, raccourcis})]\r
-                                       <:compositions:heritages:>\r
-                                       <ul class="spip">\r
-                                               <BOUCLE_heritages(DATA){source tableau, #BRANCHE}>\r
-                                                       <li>#CLE (#VALEUR)</li>\r
-                                               </BOUCLE_heritages>\r
-                                       </ul>\r
-                               #BOITE_FERMER\r
-                               </B_heritages>\r
-\r
-                               <B_util>\r
-                                       [(#BOITE_OUVRIR{[(#TOTAL_BOUCLE|singulier_ou_pluriel{compositions:une_utilisation,compositions:des_utilisations})], raccourcis})]\r
-                                       <div class='liste'>\r
-                                               <ul class='liste-items'>\r
-                                               <BOUCLE_util(DATA){source tableau, #_compositions:CLE|compositions_lister_utilisations{#CLE}}>\r
-                                                       <li class='item'>\r
-                                                               <a href="[(#ID|generer_url_entite{#_compositions:CLE})]">[(#TITRE|supprimer_numero)][ | (#ID)]</a>\r
-                                                       </li>\r
-                                               </BOUCLE_util>\r
-                                               </ul>\r
-                                       </div>\r
-                               </B_util>\r
-                       </li>\r
-                       </BOUCLE_pour>\r
-               </ul>\r
-       </div>\r
-\r
-       #BOITE_FERMER\r
-       </B_pour>\r
-</BOUCLE_compositions>\r
+#SET{compositions,#REM|compositions_lister_disponibles}
+
+<h1 class="grostitre"><:compositions:compositions:></h1>
+
+<B_compositions>
+[<h2>(#GRAND_TOTAL|singulier_ou_pluriel{compositions:info_1_composition,compositions:info_nb_compositions})</h2>]
+
+<BOUCLE_compositions(DATA){source tableau, #GET{compositions}}>
+
+       <B_pour>
+
+       [(#BOITE_OUVRIR{[(#CLE|objet_info{texte_objets}|_T)], simple, section})]
+
+       <div class='liste'>
+               <ul class="liste-items compositions">
+                       <BOUCLE_pour(DATA){source tableau, #VALEUR}{par nom}>
+                       <li class="item">
+                               [ [<a href="(#IMAGE_EXEMPLE|balise_img|extraire_attribut{src})" class='mediabox exemple' title="<:compositions:voir_image_exemple|attribut_html:>">]
+                                       (#ICON|sinon{#CHEMIN_IMAGE{composition-24.png}}|image_reduire{24,24}|inserer_attribut{class,logo})
+                                       [(#IMAGE_EXEMPLE|oui)</a>]
+                               ]
+
+                               <div class='presentation'>
+                                       <h4>[(#NOM|supprimer_numero)]</h4>
+                                       [<div class='descriptif'>(#DESCRIPTION)</div>]
+                               </div>
+
+                               <B_heritages>
+                               [(#BOITE_OUVRIR{<:compositions:label_heritages:>, raccourcis})]
+                                       <:compositions:heritages:>
+                                       <ul class="spip">
+                                               <BOUCLE_heritages(DATA){source tableau, #BRANCHE}>
+                                                       <li>#CLE (#VALEUR)</li>
+                                               </BOUCLE_heritages>
+                                       </ul>
+                               #BOITE_FERMER
+                               </B_heritages>
+
+                               <B_util>
+                                       [(#BOITE_OUVRIR{[(#GRAND_TOTAL|singulier_ou_pluriel{compositions:une_utilisation,compositions:des_utilisations})], raccourcis})]
+                                       <div class='liste'>
+                                               <ul class='liste-items'>
+                                               <BOUCLE_util(DATA){source tableau, #_compositions:CLE|compositions_lister_utilisations{#CLE}}{pagination}>
+                                                       <li class='item'>
+                                                               <a href="[(#ID|generer_url_entite{#_compositions:CLE})]">[(#TITRE|supprimer_numero)][ | (#ID)]</a>
+                                                       </li>
+                                               </BOUCLE_util>
+                                               </ul>
+                                       </div>
+                                       [<p class='pagination'>(#PAGINATION{#ENV{pagination,prive}})</p>]
+                               </B_util>
+                       </li>
+                       </BOUCLE_pour>
+               </ul>
+       </div>
+
+       #BOITE_FERMER
+       </B_pour>
+</BOUCLE_compositions>
+
+<h2><:compositions:info_aucune_composition:></h2>
+<//B_compositions>
diff --git a/www/plugins/compositions_v3/prive/squelettes/navigation/compositions.html b/www/plugins/compositions_v3/prive/squelettes/navigation/compositions.html
new file mode 100644 (file)
index 0000000..db70f0c
--- /dev/null
@@ -0,0 +1,8 @@
+[(#REM)
+  Message expliquant comment ajouter des compositions, réservé aux admins
+]
+[(#AUTORISER{configurer,compositions}|oui)
+[(#BOITE_OUVRIR{<:compositions:ajouter_compositions:>,info})]
+<:compositions:message_info_ajouter_compositions{url_doc=#PLUGIN{compositions,documentation}}|propre:>
+[(#BOITE_FERMER)]
+]
index 340dfa5..c5ef3bd 100644 (file)
@@ -4,6 +4,8 @@
 .formulaire_editer_composition_objet .editer_composition .choix input {display:block;float: #ENV{left};}
 .formulaire_editer_composition_objet .editer_composition .choix label {display:block;float: #ENV{left}; width: 80%; padding-#ENV{left}: 34px; margin-bottom: 0.5em;}
 .formulaire_editer_composition_objet .editer_composition .choix img.logo {float:#ENV{left};margin-#ENV{left}: -34px;margin-#ENV{right}:5px;}
+.formulaire_editer_composition_objet .editer_composition .choix .exemple img.logo { padding-bottom:2px; border-bottom:1px dotted #666; }
+.formulaire_editer_composition_objet .editer_composition .choix .exemple img.logo:hover { border-bottom:1px solid #666; }
 
 .formulaire_editer_composition_objet h4 {
        padding-#ENV{left}: 30px;
 
 .formulaire_editer_composition_objet span.descriptif {font-style: italic; font-size: 0.875em;}
 
-body.compositions #contenu .item > h4 {margin-bottom:0; }
+body.compositions #contenu .item .logo {margin-#ENV{right}:1em; float: #ENV{left}; }
+body.compositions #contenu .item .exemple .logo { padding-bottom:2px; border-bottom:1px dotted #666; }
+body.compositions #contenu .item .exemple .logo:hover { border-bottom:1px solid #666; }
+body.compositions #contenu .item .presentation { overflow:auto; }
+body.compositions #contenu .item .presentation h4 {margin-bottom:0; }
 body.compositions #contenu .item .raccourcis ul {margin-bottom:0; }
+
+body.compositions #contenu .compositions { border-top:none; margin-bottom:0; }
+body.compositions #contenu .compositions > .item + .item { margin-top:.5em; }
+body.compositions #contenu .compositions .item:last-child { border-bottom:none; }
+
index 79cd6b0..31400d1 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip/images/composition-16.png and b/www/plugins/compositions_v3/prive/themes/spip/images/composition-16.png differ
index 13f7b71..4da236f 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip/images/composition-24.png and b/www/plugins/compositions_v3/prive/themes/spip/images/composition-24.png differ
index a0a14ee..1cef16d 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip/images/composition-32.png and b/www/plugins/compositions_v3/prive/themes/spip/images/composition-32.png differ
index b131f9c..fd8d63e 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip2/images/composition-16.png and b/www/plugins/compositions_v3/prive/themes/spip2/images/composition-16.png differ
index 954f8f0..917adaf 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip2/images/composition-24.png and b/www/plugins/compositions_v3/prive/themes/spip2/images/composition-24.png differ
index 78f420a..2c4e64c 100644 (file)
Binary files a/www/plugins/compositions_v3/prive/themes/spip2/images/composition-32.png and b/www/plugins/compositions_v3/prive/themes/spip2/images/composition-32.png differ
index fe9e80a..7d27a58 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/compositions/trunk
-Revision: 82892
-Dernier commit: 2014-06-07 05:50:07 +0200 
+Revision: 99105
+Dernier commit: 2016-08-03 11:04:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/compositions/trunk</origine>
-<revision>82892</revision>
-<commit>2014-06-07 05:50:07 +0200 </commit>
+<revision>99105</revision>
+<commit>2016-08-03 11:04:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
diff --git a/www/plugins/enluminures_typographiques_v3/base/typoenluminee_upgrade.php b/www/plugins/enluminures_typographiques_v3/base/typoenluminee_upgrade.php
new file mode 100644 (file)
index 0000000..a15ea29
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/meta');
+
+/**
+ * Installation/maj des tables gis
+ *
+ * @param string $nom_meta_base_version
+ * @param string $version_cible
+ */
+function typoenluminee_upgrade($nom_meta_base_version, $version_cible) {
+       $current_version = '0.0';
+       if ((!isset($GLOBALS['meta'][$nom_meta_base_version]))
+                       || (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)) {
+               // installation
+               if (version_compare($current_version, '0.0', '<=')) {
+                       maj_titres_enlumines();
+                       ecrire_meta($nom_meta_base_version, $current_version = $version_cible, 'non');
+               }
+       }
+}
+
+/**
+ * Abandon de l'ancienne écriture des intertitres
+ *
+ * {1{...}1} {2{...}2} {3{...}3} {4{...}4} {5{...}5} en intertitres avec étoiles :
+ * {{{...}}} {{{**...}}} {{{***...}}} {{{****...}}} {{{*****...}}}
+ *
+ */
+function maj_titres_enlumines() {
+       $anciens_titres = sql_allfetsel('id_article,texte', 'spip_articles', 'texte LIKE "%{1{%" OR texte LIKE "%{2{%" OR texte LIKE "%{3{%" OR texte LIKE "%{4{%" OR texte LIKE "%{5{%"');
+       foreach ($anciens_titres as $cle => $article) {
+               $id_article = $article['id_article'];
+               $article['texte'] = preg_replace('/({1{)(.*)(}1})/Uims', '{{{\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({2{)(.*)(}2})/Uims', '{{{**\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({3{)(.*)(}3})/Uims', '{{{***\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({4{)(.*)(}4})/Uims', '{{{****\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({5{)(.*)(}5})/Uims', '{{{*****\\2}}}', $article['texte']);
+               $article['texte'] = trim($article['texte']);
+               sql_updateq('spip_articles', array('texte' => $article['texte']), 'id_article=' . intval($article['id_article']));
+               if (time() >= _UPGRADE_TIME_OUT) {
+                       return;
+               }
+       }
+}
+
+
+
+/**
+ * Desinstallation
+ *
+ * @param string $nom_meta_base_version
+ */
+function typoenluminee_vider_tables($nom_meta_base_version) {
+       include_spip('inc/meta');
+       effacer_meta($nom_meta_base_version);
+}
index 876c5b3..1873bdd 100644 (file)
@@ -33,16 +33,28 @@ background: transparent;
 font-size:x-small;\r
 }\r
 \r
+sub, sup, sup.typo_exposants {\r
+ /* Specified in % so that the sup/sup is the\r
+    right size relative to the surrounding text */\r
+ font-size: 75%;\r
+ /* Zero out the line-height so that it doesn't\r
+    interfere with the positioning that follows */\r
+ line-height: 0;\r
+ /* Where the magic happens: makes all browsers position\r
+    the sup/sup properly, relative to the surrounding text */\r
+ position: relative;\r
+ /* Note that if you're using Eric Meyer's reset.css, this\r
+    is already set and you can remove this rule */\r
+ vertical-align: baseline;\r
+}\r
 sup, sup.typo_exposants {\r
-       font-size: 78%;\r
-       font-variant: normal;\r
-       vertical-align: 24%;\r
+ /* Move the superscripted text up */\r
+ top: -0.5em;\r
 }\r
-\r
 sub {\r
-       font-size: 60%;\r
-       font-variant: normal;\r
      vertical-align: -20%;\r
+ /* Move the subscripted text down, but only\r
+    half as far down as the superscript moved up */\r
bottom: -0.25em;\r
 }\r
 \r
 .caps {\r
index 0bce269..04e2979 100644 (file)
@@ -23,3 +23,7 @@ h5.spip {
 }\r
 \r
 acronym, abbr { border-bottom: .1em dotted; cursor: help; }\r
+\r
+.preview  ol.spip {\r
+       padding: 0;\r
+}
\ No newline at end of file
index 1514d51..b0da4ee 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/editeur/supprimer_ligne.png and b/www/plugins/enluminures_typographiques_v3/editeur/supprimer_ligne.png differ
index 6a9587a..3f30723 100644 (file)
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-function typoenluminee_porte_plume_barre_pre_charger($barres){\r
-       $barre = &$barres['edition'];\r
-       \r
-       $barre->cacher('stroke_through');\r
-\r
-       $module_barre = "barre_outils";\r
-       if (intval($GLOBALS['spip_version_branche'])>2)\r
-               $module_barre = "barreoutils";\r
-       \r
-       $barre->set('header1', array(\r
-               // groupe formatage paragraphe\r
-               "dropMenu"    => array(\r
-                       // bouton <cadre>\r
-                       array(\r
-                               "id"          => 'intertitre',\r
-                               "name"        => _T('barre_intertitre'),\r
-                               "className"   => 'outil_intertitre1', \r
-                               "openWith" => "\n{{{",\r
-                               "closeWith" => "}}}\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       array(\r
-                               "id"          => 'intertitre2',\r
-                               "name"        => _T('enlumtypo:barre_intertitre2'),\r
-                               "className"   => 'outil_intertitre2', \r
-                               "openWith" => "\n{{{**",\r
-                               "closeWith" => "}}}\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       array(\r
-                               "id"          => 'intertitre3',\r
-                               "name"        => _T('enlumtypo:barre_intertitre3'),\r
-                               "className"   => 'outil_intertitre3', \r
-                               "openWith" => "\n{{{***",\r
-                               "closeWith" => "}}}\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       array(\r
-                               "id"          => 'alignerdroite',\r
-                               "name"        => _T('enlumtypo:barre_alignerdroite'),\r
-                               "className"   => 'outil_alignerdroite', \r
-                               "openWith" => "\n[/",\r
-                               "closeWith" => "/]\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       array(\r
-                               "id"          => 'alignergauche',\r
-                               "name"        => _T('enlumtypo:barre_alignergauche'),\r
-                               "className"   => 'outil_alignergauche', \r
-                               "openWith" => "\n[!",\r
-                               "closeWith" => "!]\n",\r
-                               "display"     => true,\r
-                               "lang"        => array('ar','fa'),\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       array(\r
-                               "id"          => 'cadretexte',\r
-                               "name"        => _T('enlumtypo:barre_encadrer'),\r
-                               "className"   => 'outil_cadretexte', \r
-                               "openWith" => "\n[(",\r
-                               "closeWith" => ")]\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-                       // code spip\r
-                       array(\r
-                               "id"          => 'barre_cadre',\r
-                               "name"        => _T($module_barre.':barre_cadre'),\r
-                               "className"   => "outil_barre_cadre", \r
-                               "openWith"    => "\n&lt;cadre&gt;", \r
-                               "closeWith"   => "&lt;/cadre&gt;\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-               ),\r
-       ));\r
-       \r
-       $barre->set('bold', array(\r
-               // groupe formatage texte\r
-               "dropMenu"    => array(\r
-                       // Mise en évidence (gras + couleur)\r
-                       array(\r
-                               "id"          => 'miseenevidence',\r
-                               "name"        => _T('enlumtypo:barre_miseenevidence'),\r
-                               "className"   => "outil_miseenevidence",\r
-                               "openWith"    => "[*", \r
-                               "closeWith"   => "*]",\r
-                               "display"     => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-                       // Mise en évidence2 (gras + autre couleur)\r
-                       array(\r
-                               "id"          => 'miseenevidence2',\r
-                               "name"        => _T('enlumtypo:barre_miseenevidence2'),\r
-                               "className"   => "outil_miseenevidence2",\r
-                               "openWith"    => "[**", \r
-                               "closeWith"   => "*]",\r
-                               "display"     => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-                       // montrer une suppression\r
-                       array(\r
-                               "id"        => 'stroke_through_et',\r
-                               "name"      => _T('enlumtypo:barre_barre'), // :-)\r
-                               "className" => "outil_stroke_through_et", \r
-                               "openWith" => "<del>", \r
-                               "closeWith" => "</del>",\r
-                               "display"   => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-                       // Mise en exposant\r
-                       array(\r
-                               "id"          => 'exposant',\r
-                               "name"        => _T('enlumtypo:barre_exposant'),\r
-                               "className"   => "outil_exposant",\r
-                               "openWith"    => "<sup>", \r
-                               "closeWith"   => "</sup>",\r
-                               "display"     => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-                       // Mise en indice\r
-                       array(\r
-                               "id"          => 'indice',\r
-                               "name"        => _T('enlumtypo:barre_indice'),\r
-                               "className"   => "outil_indice",\r
-                               "openWith"    => "<sub>", \r
-                               "closeWith"   => "</sub>",\r
-                               "display"     => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-                       // cadre spip\r
-                       array(\r
-                               "id"          => 'barre_code',\r
-                               "name"        => _T($module_barre.':barre_code'),\r
-                               "className"   => "outil_barre_code", \r
-                               "openWith"    => "&lt;code&gt;", \r
-                               "closeWith"   => "&lt;/code&gt;",\r
-                               "display"     => true,\r
-                               "selectionType" => "word",\r
-                       ),\r
-               ),\r
-       ));\r
-       \r
-       // Appel Tableau\r
-       $barre->ajouterApres('notes', array(\r
-               "id"          => 'barre_tableau',\r
-               "name"        => _T('enlumtypo:barre_tableau'),\r
-               "className"   => "outil_barre_tableau",\r
-               "replaceWith" => 'function(markitup) { zone_selection = markitup.textarea; window.open("?exec=tableau_edit", "","scrollbars=yes,resizable=yes,width=700,height=600") }',\r
-               "display"     => true,\r
-               "selectionType" => "line",\r
-       ));\r
-       \r
-       $barre->set('quote', array(\r
-               "dropMenu"    => array(\r
-                       // poesie spip\r
-                       array(\r
-                               "id"          => 'barre_poesie',\r
-                               "name"        => _T($module_barre.':barre_poesie'),\r
-                               "className"   => "outil_barre_poesie", \r
-                               "openWith"    => "\n&lt;poesie&gt;", \r
-                               "closeWith"   => "&lt;/poesie&gt;\n",\r
-                               "display"     => true,\r
-                               "selectionType" => "line",\r
-                       ),\r
-               ),\r
-       ));     \r
-       \r
-       // Petites capitales\r
-       $barre->ajouterApres('italic', array(\r
-               "id"          => 'petitescapitales',\r
-               "name"        => _T('enlumtypo:barre_petitescapitales'),\r
-               "className"   => "outil_petitescapitales",\r
-               "openWith"    => "<sc>", \r
-               "closeWith"   => "</sc>",\r
-               "display"     => true,\r
-               "selectionType" => "word",\r
-       ));\r
-       \r
-       return $barres;\r
-}\r
-\r
-function typoenluminee_porte_plume_lien_classe_vers_icone($flux){\r
-       return array_merge($flux, array(\r
-               'outil_intertitre1' => array('spt-v1.png','-10px -226px'), //'intertitre.png'\r
-               'outil_intertitre2' => array('intertitre2.png','0'),\r
-               'outil_intertitre3' => array('intertitre3.png','0'),\r
-               'outil_alignerdroite' => array('right.png','0'),\r
-               'outil_alignergauche' => array('left.png','0'),\r
-               'outil_stroke_through_et' => array('spt-v1.png','-10px -946px'), //'text_strikethrough.png'\r
-               'outil_cadretexte' => array('cadretexte.png','0'),\r
-               'outil_speciaux' => array('tag.png','0'),\r
-               'outil_barre_code' => array('page_white_code_red.png','0'),\r
-               'outil_barre_cadre' => array('page_white_code.png','0'),\r
-\r
-               'outil_miseenevidence' => array('miseenevidence.png','0'),\r
-               'outil_miseenevidence2' => array('miseenevidence2.png','0'),\r
-               'outil_exposant' => array('exposant.png','0'),\r
-               'outil_indice' => array('indice.png','0'),\r
-               'outil_petitescapitales' => array('petitescapitales.png','0'),\r
-               'outil_barre_poesie' => array('poesie.png','0'),\r
-               \r
-               'outil_barre_tableau' => array('barre-tableau.png','0'),\r
-       ));\r
-}\r
-\r
-?>\r
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function typoenluminee_porte_plume_barre_pre_charger($barres) {
+       $barre = &$barres['edition'];
+
+       $barre->cacher('italic');
+       $barre->cacher('stroke_through');
+       $barre->cacher('notes');
+       $barre->cacher('sepCode');
+       $barre->cacher('grpCode');
+
+       $module_barre = 'barre_outils';
+       if (intval($GLOBALS['spip_version_branche']) > 2) {
+               $module_barre = 'barreoutils';
+       }
+
+       $barre->set('header1', array(
+               // groupe formatage paragraphe
+               'dropMenu' => array(
+                       array(
+                               'id' => 'intertitre',
+                               'name' => _T('barre_intertitre'),
+                               'className' => 'outil_intertitre1',
+                               'openWith' => "\n{{{",
+                               'closeWith' => "}}}\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'intertitre2',
+                               'name' => _T('enlumtypo:barre_intertitre2'),
+                               'className' => 'outil_intertitre2',
+                               'openWith' => "\n{{{**",
+                               'closeWith' => "}}}\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'intertitre3',
+                               'name' => _T('enlumtypo:barre_intertitre3'),
+                               'className' => 'outil_intertitre3',
+                               'openWith' => "\n{{{***",
+                               'closeWith' => "}}}\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'alignerdroite',
+                               'name' => _T('enlumtypo:barre_alignerdroite'),
+                               'className' => 'outil_alignerdroite',
+                               'openWith' => "\n[/",
+                               'closeWith' => "/]\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'alignergauche',
+                               'name' => _T('enlumtypo:barre_alignergauche'),
+                               'className' => 'outil_alignergauche',
+                               'openWith' => "\n[!",
+                               'closeWith' => "!]\n",
+                               'display' => true,
+                               'lang' => array('ar', 'fa'),
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'cadretexte',
+                               'name' => _T('enlumtypo:barre_encadrer'),
+                               'className' => 'outil_cadretexte',
+                               'openWith' => "\n[(",
+                               'closeWith' => ")]\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+                       array(
+                               'id' => 'barre_cadre',
+                               'name' => _T($module_barre . ':barre_cadre'),
+                               'className' => 'outil_barre_cadre',
+                               'openWith' => "\n&lt;cadre&gt;",
+                               'closeWith' => "&lt;/cadre&gt;\n",
+                               'display' => true,
+                               'selectionType' => 'line',
+                       ),
+               ),
+       ));
+
+       $barre->set('bold', array(
+               // groupe formatage texte
+               'dropMenu' => array(
+                       // Italic - {
+                       array(
+                               'id' => 'italic',
+                               'name' => _T('barreoutils:barre_italic'),
+                               'key' => 'I',
+                               'className' => 'outil_italic',
+                               'replaceWith' => "function(h){ return espace_si_accolade(h, '{', '}');}",
+                               //'openWith' => '{',
+                               //'closeWith' => '}',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // Petites capitales
+                       array(
+                               'id' => 'petitescapitales',
+                               'name' => _T('enlumtypo:barre_petitescapitales'),
+                               'className' => 'outil_petitescapitales',
+                               'openWith' => '<sc>',
+                               'closeWith' => '</sc>',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // montrer une suppression
+                       array(
+                               'id' => 'stroke_through_et',
+                               'name' => _T('enlumtypo:barre_barre'), // :-)
+                               'className' => 'outil_stroke_through_et',
+                               'openWith' => '<del>',
+                               'closeWith' => '</del>',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // Mise en évidence (gras + couleur)
+                       array(
+                               'id' => 'miseenevidence',
+                               'name' => _T('enlumtypo:barre_miseenevidence'),
+                               'className' => 'outil_miseenevidence',
+                               'openWith' => '[*',
+                               'closeWith' => '*]',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // Mise en évidence2 (gras + autre couleur)
+                       array(
+                               'id' => 'miseenevidence2',
+                               'name' => _T('enlumtypo:barre_miseenevidence2'),
+                               'className' => 'outil_miseenevidence2',
+                               'openWith' => '[**',
+                               'closeWith' => '*]',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // Mise en exposant
+                       array(
+                               'id' => 'exposant',
+                               'name' => _T('enlumtypo:barre_exposant'),
+                               'className' => 'outil_exposant',
+                               'openWith' => '<sup>',
+                               'closeWith' => '</sup>',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // Mise en indice
+                       array(
+                               'id' => 'indice',
+                               'name' => _T('enlumtypo:barre_indice'),
+                               'className' => 'outil_indice',
+                               'openWith' => '<sub>',
+                               'closeWith' => '</sub>',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+                       // cadre spip
+                       array(
+                               'id' => 'barre_code',
+                               'name' => _T($module_barre . ':barre_code'),
+                               'className' => 'outil_barre_code',
+                               'openWith' => '&lt;code&gt;',
+                               'closeWith' => '&lt;/code&gt;',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+               ),
+       ));
+
+       $barre->set('link', array(
+               // groupe formatage texte
+               'dropMenu' => array(
+                       array(
+                               'id' => 'notes',
+                               'name' => _T('barreoutils:barre_note'),
+                               'className' => 'outil_notes',
+                               'openWith' => '[[',
+                               'closeWith' => ']]',
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+               ),
+       ));
+
+       // Appel Tableau
+       $barre->ajouterApres('notes', array(
+               'id' => 'barre_tableau',
+               'name' => _T('enlumtypo:barre_tableau'),
+               'className' => 'outil_barre_tableau',
+               'replaceWith' => 'function(markitup) { zone_selection = markitup.textarea; window.open("?exec=tableau_edit", "","scrollbars=yes,resizable=yes,width=700,height=600") }',
+               'display' => true,
+               'selectionType' => 'line',
+       ));
+
+       $barre->set('quote', array(
+               'openWith' => '<quote>',
+               'closeWith' => '</quote>',
+       ));
+
+       $barre->set('quote', array(
+               'dropMenu' => array(
+                       // poesie spip
+                       array(
+                               'id' => 'barre_poesie',
+                               'name' => _T($module_barre . ':barre_poesie'),
+                               'className' => 'outil_barre_poesie',
+                               'openWith' => "\n&lt;poesie&gt;\n",
+                               'closeWith' => "\n&lt;/poesie&gt;\n",
+                               'display' => true,
+                               'selectionType' => 'word',
+                       ),
+               ),
+       ));
+
+       return $barres;
+}
+
+function typoenluminee_porte_plume_lien_classe_vers_icone($flux) {
+       return array_merge($flux, array(
+               'outil_intertitre1' => array('spt-v1.png', '-10px -226px'), //'intertitre.png'
+               'outil_intertitre2' => array('intertitre2.png', '0'),
+               'outil_intertitre3' => array('intertitre3.png', '0'),
+               'outil_alignerdroite' => array('right.png', '0'),
+               'outil_alignergauche' => array('left.png', '0'),
+               'outil_stroke_through_et' => array('spt-v1.png', '-10px -946px'), //'text_strikethrough.png'
+               'outil_cadretexte' => array('cadretexte.png', '0'),
+               'outil_speciaux' => array('tag.png', '0'),
+               'outil_barre_code' => array('page_white_code_red.png', '0'),
+               'outil_barre_cadre' => array('page_white_code.png', '0'),
+
+               'outil_miseenevidence' => array('miseenevidence.png', '0'),
+               'outil_miseenevidence2' => array('miseenevidence2.png', '0'),
+               'outil_exposant' => array('exposant.png', '0'),
+               'outil_indice' => array('indice.png', '0'),
+               'outil_petitescapitales' => array('petitescapitales.png', '0'),
+               'outil_barre_poesie' => array('poesie.png', '0'),
+
+               'outil_barre_tableau' => array('barre-tableau.png', '0'),
+       ));
+}
index a99aa00..e961d25 100644 (file)
@@ -1,8 +1,10 @@
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-function exec_tableau_edit_dist() {\r
-       include_spip("public/assembler"); // Pour pouvoir utiliser recuperer_fond\r
-       echo recuperer_fond('editeur/tableau_edit');\r
-}\r
-?>
\ No newline at end of file
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function exec_tableau_edit_dist() {
+       include_spip('public/assembler'); // Pour pouvoir utiliser recuperer_fond
+       echo recuperer_fond('editeur/tableau_edit');
+}
index aaebf34..6272d1f 100644 (file)
-<div class="formulaire_spip formulaire_configurer formulaire_#FORM">\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
-<form method="post" action="#ENV{action}"><div>[(#ENV{_cfg_}|form_hidden)]<input type="hidden" name="_meta_casier" value="bte" /></div>\r
-       #ACTION_FORMULAIRE{#ENV{action}}\r
-\r
-<ul><li class="fieldset"><fieldset><legend><:enlumtypo:cfg_puces:></legend></li>\r
-       <?php if (isset($GLOBALS['barre_typo_pas_de_fausses_puces'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'barre_typo_pas_de_fausses_puces'&nbsp;:<br /><?php if ($GLOBALS['barre_typo_pas_de_fausses_puces'] === true) { ?>Remplacement<?php } else { ?>Conserver le traitement par défaut de SPIP<?php } ?></p></li>\r
-       <?php } else { ?>\r
-       <li><label for="sc_puces">Puces</label>\r
-       <p class="explication">Remplacement des fausses puces de SPIP (- en début de ligne) par de vraies listes à puces (-* en début de ligne)</p>\r
-       <select name="puces" id="sc_puces" class="forml">\r
-               <option value="Oui"[ selected="(#ENV{puces,Non}|=={Oui}|?{selected})"]>Remplacement</option>\r
-               <option value="Non"[ selected="(#ENV{puces,Non}|=={Non}|?{selected})"]>Conserver le traitement par défaut de SPIP</option>\r
-       </select></li>\r
-       <?php } ?>\r
-</fieldset></ul>\r
-<fieldset><legend><:enlumtypo:cfg_titraille:></legend>\r
-       <p>Les valeurs par défaut sont basées sur la valeur historique de SPIP pour {{{}}} <=> H3. En HTML, il n'y a pas de H7 ce qui explique la balise choisie pour le niveau 5.</p>\r
-       <p>N'oubliez pas que la titraille sert à donner un sens dans la hiérarchisation des idées d'un texte, et <strong>surtout pas</strong> à obtenir un effet de taille de texte !</p>\r
-       <ul><li><p class="explication">Titraille de premier niveau&nbsp;: {{{}}} ou {{{* }}}</p></li>\r
-       <?php if (isset($GLOBALS['config_intertitre'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'debut_intertitre' et 'fin_intertitre'</p></li>\r
-       <?php } else { ?>\r
-       <li>\r
-       <label for="sc_titraille1open">Balise <strong>ouvrante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille1open" id="sc_titraille1open" value="[(#ENV{titraille1open,'<h3 class="spip">'})]" size="30" class="fondl" /><br />\r
-       <label for="sc_titraille1open">Balise <strong>fermante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille1close" id="sc_titraille1close" value="[(#ENV{titraille1close,'</h3>'})]" size="30" class="fondl" />\r
-       <?php } ?>\r
-       </li>\r
-       <li><p class="explication">Titraille de deuxième niveau&nbsp;: {{{** }}}</p></li>\r
-       <?php if (isset($GLOBALS['config_intertitre'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'debut_intertitre_2' et 'fin_intertitre_2'</p></li>\r
-       <?php } else { ?>\r
-       <li>\r
-       <label for="sc_titraille2open">Balise <strong>ouvrante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille2open" id="sc_titraille2open" value="[(#ENV{titraille2open,'<h4 class="spip">'})]" size="30" class="fondl" /><br />\r
-       <label for="sc_titraille2open">Balise <strong>fermante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille2close" id="sc_titraille2close" value="[(#ENV{titraille2close,'</h4>'})]" size="30" class="fondl" />\r
-       <?php } ?>\r
-       </li>\r
-       <li><p class="explication">Titraille de troisième niveau&nbsp;: {{{*** }}}</p></li>\r
-       <?php if (isset($GLOBALS['config_intertitre'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'debut_intertitre_3' et 'fin_intertitre_3'</p></li>\r
-       <?php } else { ?>\r
-       <li>\r
-       <label for="sc_titraille3open">Balise <strong>ouvrante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille3open" id="sc_titraille3open" value="[(#ENV{titraille3open,'<h5 class="spip">'})]" size="30" class="fondl" /><br />\r
-       <label for="sc_titraille3open">Balise <strong>fermante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille3close" id="sc_titraille3close" value="[(#ENV{titraille3close,'</h5>'})]" size="30" class="fondl" />\r
-       <?php } ?>\r
-       </li>\r
-       <li><p class="explication">Titraille de quatrième niveau&nbsp;: {{{**** }}}</p></li>\r
-       <?php if (isset($GLOBALS['config_intertitre'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'debut_intertitre_4' et 'fin_intertitre_4'</p></li>\r
-       <?php } else { ?>\r
-       <li>\r
-       <label for="sc_titraille4open">Balise <strong>ouvrante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille4open" id="sc_titraille4open" value="[(#ENV{titraille4open,'<h6 class="spip">'})]" size="30" class="fondl" /><br />\r
-       <label for="sc_titraille4open">Balise <strong>fermante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille4close" id="sc_titraille4close" value="[(#ENV{titraille4close,'</h6>'})]" size="30" class="fondl" />\r
-       <?php } ?>\r
-       </li>\r
-       <li><p class="explication">Titraille de cinquième niveau&nbsp;: {{{***** }}}</p></li>\r
-       <?php if (isset($GLOBALS['config_intertitre'])) { ?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'debut_intertitre_5' et 'fin_intertitre_5'</p></li>\r
-       <?php } else { ?>\r
-       <li>\r
-       <label for="sc_titraille5open">Balise <strong>ouvrante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille5open" id="sc_titraille5open" value="[(#ENV{titraille5open,'<strong class="spip titraille5">'})]" size="30" class="fondl" /><br />\r
-       <label for="sc_titraille5open">Balise <strong>fermante</strong>&nbsp;:</label>\r
-       <input type="text" name="titraille5close" id="sc_titraille5close" value="[(#ENV{titraille5close,'</strong>'})]" size="30" class="fondl" />\r
-       <?php } ?>\r
-       </li>\r
-       </ul>\r
-</fieldset>\r
-<ul><li class="fieldset"><fieldset><legend><:enlumtypo:cfg_insertcss:></legend></li>\r
-       <?php if (isset($GLOBALS['BarreTypoEnrichie_Preserve_Header'])) { \r
-?>\r
-       <li><p class="explication">Configuré dans le mes_options par 'BarreTypoEnrichie_Preserve_Header'\r
-       <?php \r
-       echo ($GLOBALS['BarreTypoEnrichie_Preserve_Header']=='Oui')?"Ne pas faire l'insertion automatique":"Insertion automatique";\r
-       ?>\r
-       </p></li>\r
-       <?php\r
-       } else { ?>\r
-       <li><label for="sc_insertcss">&#35;INSERT_HEAD</label>\r
-       <p class="explication">Insertion automatique des CSS spécifiques à la BTE dans l'espace public (via &#35;INSERT_HEAD dans les squelettes)</p>\r
-       <select name="insertcss" id="sc_insertcss" class="forml">\r
-               <option value="Oui"[ selected="(#ENV{insertcss,Oui}|=={Oui}|?{selected})"]>Insertion automatique</option>\r
-               <option value="Non"[ selected="(#ENV{insertcss,Oui}|=={Non}|?{selected})"]>Ne pas faire l'insertion automatique</option>\r
-       </select></li>\r
-       <?php } ?>\r
-</fieldset></ul>\r
-\r
-\r
-       <p class="boutons">\r
-               <input type="submit" name="reinit" class="submit" value="<:mediabox:bouton_reinitialiser:>" />\r
-               <input type="submit" name="enregistrer" class="submit" value="<:bouton_valider:>" />\r
-       </p>\r
-\r
-</form>\r
-</div>
\ No newline at end of file
+<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>]
+
+       <form method="post" action="#ENV{action}">
+               <div>[(#ENV{_cfg_}|form_hidden)]<input type="hidden" name="_meta_casier" value="bte"/></div>
+               #ACTION_FORMULAIRE{#ENV{action}}
+
+               <fieldset>
+                       <legend><:enlumtypo:cfg_puces:></legend>
+                       <ul class="editer-groupe">
+                               <?php if (isset($GLOBALS['barre_typo_pas_de_fausses_puces'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'barre_typo_pas_de_fausses_puces'&nbsp;:<br/><?php if ($GLOBALS['barre_typo_pas_de_fausses_puces'] === true) { ?>Remplacement<?php } else { ?>Conserver le traitement par défaut de SPIP<?php } ?></p></li>
+                               <?php } else { ?>
+                               <li class="editer"><label for="sc_puces">Puces</label>
+                                       <p class="explication">Remplacement des fausses puces de SPIP (- en début de ligne) par de vraies listes à puces (-* en début de ligne)</p>
+                                       <select name="puces" id="sc_puces" class="forml select">
+                                               <option value="Oui" [ selected="(#ENV{puces,Non}|=={Oui}|?{selected})" ]>Remplacement</option>
+                                               <option value="Non" [ selected="(#ENV{puces,Non}|=={Non}|?{selected})" ]>Conserver le traitement par défaut de SPIP</option>
+                                       </select></li>
+                               <?php } ?>
+                       </ul>
+               </fieldset>
+               <fieldset>
+                       <legend><:enlumtypo:cfg_titraille:></legend>
+                       <p>Les valeurs par défaut sont basées sur la valeur historique de SPIP pour {{{}}} <=> H3. En HTML, il n'y a pas de H7 ce qui explique la balise choisie pour le niveau 5.</p>
+                       <p>N'oubliez pas que la titraille sert à donner un sens dans la hiérarchisation des idées d'un texte, et <strong>surtout pas</strong> à obtenir un effet de taille de texte !</p>
+                       <ul class="editer-groupe">
+                               <li class="editer pleine_largeur"><p class="explication">Titraille de premier niveau&nbsp;: {{{}}} ou {{{* }}}</p></li>
+                               <?php if (isset($GLOBALS['config_intertitre'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'debut_intertitre' et 'fin_intertitre'</p></li>
+                               <?php } else { ?>
+                               <li class="editer editer_titraille1open">
+                                       <label for="sc_titraille1open">Balise <strong>ouvrante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille1open" id="sc_titraille1open" value="[(#ENV{titraille1open,'<h3 class="spip">'})]" size="30" class="fondl text" />
+                               </li>
+                               <li class="editer editer_titraille1close">
+                                       <label for="sc_titraille1open">Balise <strong>fermante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille1close" id="sc_titraille1close" value="[(#ENV{titraille1close,'</h3>'})]" size="30" class="fondl text"/>
+                                       <?php } ?>
+                               </li>
+
+                               <li class="editer pleine_largeur"><p class="explication">Titraille de deuxième niveau&nbsp;: {{{** }}}</p></li>
+                               <?php if (isset($GLOBALS['config_intertitre'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'debut_intertitre_2' et 'fin_intertitre_2'</p></li>
+                               <?php } else { ?>
+                               <li class="editer editer_titraille2open">
+                                       <label for="sc_titraille2open">Balise <strong>ouvrante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille2open" id="sc_titraille2open" value="[(#ENV{titraille2open,'<h4 class="spip">'})]" size="30" class="fondl text" /><br/>
+                               </li>
+                               <li class="editer editer_titraille2close">
+                                       <label for="sc_titraille2close">Balise <strong>fermante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille2close" id="sc_titraille2close" value="[(#ENV{titraille2close,'</h4>'})]" size="30" class="fondl text"/>
+                                       <?php } ?>
+                               </li>
+
+                               <li class="editer pleine_largeur"><p class="explication">Titraille de troisième niveau&nbsp;: {{{*** }}}</p></li>
+                               <?php if (isset($GLOBALS['config_intertitre'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'debut_intertitre_3' et 'fin_intertitre_3'</p></li>
+                               <?php } else { ?>
+                               <li class="editer editer_titraille3open">
+                                       <label for="sc_titraille3open">Balise <strong>ouvrante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille3open" id="sc_titraille3open" value="[(#ENV{titraille3open,'<h5 class="spip">'})]" size="30" class="fondl text" /><br/>
+                               </li>
+                               <li class="editer editer_titraille3close">
+                                       <label for="sc_titraille3close">Balise <strong>fermante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille3close" id="sc_titraille3close" value="[(#ENV{titraille3close,'</h5>'})]" size="30" class="fondl text"/>
+                                       <?php } ?>
+                               </li>
+
+                               <li class="editer pleine_largeur"><p class="explication">Titraille de quatrième niveau&nbsp;: {{{**** }}}</p></li>
+                               <?php if (isset($GLOBALS['config_intertitre'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'debut_intertitre_4' et 'fin_intertitre_4'</p></li>
+                               <?php } else { ?>
+                               <li class="editer editer_titraille4open">
+                                       <label for="sc_titraille4open">Balise <strong>ouvrante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille4open" id="sc_titraille4open" value="[(#ENV{titraille4open,'<h6 class="spip">'})]" size="30" class="fondl text" />
+                               </li>
+                               <li class="editer editer_titraille4close">
+                                       <label for="sc_titraille4close">Balise <strong>fermante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille4close" id="sc_titraille4close" value="[(#ENV{titraille4close,'</h6>'})]" size="30" class="fondl text"/>
+                                       <?php } ?>
+                               </li>
+
+                               <li class="editer pleine_largeur"><p class="explication">Titraille de cinquième niveau&nbsp;: {{{***** }}}</p></li>
+                               <?php if (isset($GLOBALS['config_intertitre'])) { ?>
+                               <li class="editer"><p class="explication">Configuré dans le mes_options par 'debut_intertitre_5' et 'fin_intertitre_5'</p></li>
+                               <?php } else { ?>
+                               <li class="editer editer_titraille5open">
+                                       <label for="sc_titraille5open">Balise <strong>ouvrante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille5open" id="sc_titraille5open" value="[(#ENV{titraille5open,'<strong class="spip titraille5">'})]" size="30" class="fondl text" /><br/>
+                               </li>
+                               <li class="editer editer_titraille5close">
+                                       <label for="sc_titraille5close">Balise <strong>fermante</strong>&nbsp;:</label>
+                                       <input type="text" name="titraille5close" id="sc_titraille5close" value="[(#ENV{titraille5close,'</strong>'})]" size="30" class="fondl text"/>
+                                       <?php } ?>
+                               </li>
+                       </ul>
+               </fieldset>
+               <fieldset>
+                       <legend><:enlumtypo:cfg_insertcss:></legend>
+                       <ul class="editer-groupe">
+                               <?php if (isset($GLOBALS['BarreTypoEnrichie_Preserve_Header'])) {
+?>
+                               <li class="editer pleine_largeur"><p class="explication">Configuré dans le fichier <code>mes_options.php</code> par 'BarreTypoEnrichie_Preserve_Header'
+                                       <?php
+       echo ($GLOBALS['BarreTypoEnrichie_Preserve_Header']=='Oui')?"Ne pas faire l'insertion automatique":"Insertion automatique";
+       ?>
+                               </p></li>
+                               <?php
+       } else { ?>
+                               <li class="editer">
+                                       <label for="sc_insertcss">&#35;INSERT_HEAD</label>
+                                       <p class="explication">Insertion automatique des CSS spécifiques à la BTE dans l'espace public (via &#35;INSERT_HEAD dans les squelettes)</p>
+                                       <select name="insertcss" id="sc_insertcss" class="forml select">
+                                               <option value="Oui" [ selected="(#ENV{insertcss,Oui}|=={Oui}|?{selected})" ]>Insertion automatique</option>
+                                               <option value="Non" [ selected="(#ENV{insertcss,Oui}|=={Non}|?{selected})" ]>Ne pas faire l'insertion automatique</option>
+                                       </select></li>
+                               <?php } ?>
+                       </ul>
+               </fieldset>
+
+               <p class="boutons">
+                       <input type="submit" name="reinit" class="submit" value="<:enlumtypo:bouton_reinitialiser:>"/>
+                       <input type="submit" name="enregistrer" class="submit" value="<:bouton_valider:>"/>
+               </p>
+
+       </form>
+</div>
index 628cf2d..3102981 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/avances.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/avances.png differ
index c895a1f..8695775 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/barre-tableau.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/barre-tableau.png differ
index 8d1a035..e71178b 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/barre-wiki.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/barre-wiki.png differ
index 29c4ec9..743454c 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/cadretexte.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/cadretexte.png differ
index 38a0659..9487bd9 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/center.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/center.png differ
index 4deee16..aa06215 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/eacute-maj.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/eacute-maj.png differ
index 4cb2cfe..dce6382 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/exposant.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/exposant.png differ
index 357b7fe..e0919ef 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/indice.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/indice.png differ
index da86b80..4da8a35 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/intertitre2.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/intertitre2.png differ
index 34f3a6a..9bb2449 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/intertitre3.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/intertitre3.png differ
index 21bfe4c..8afd1e2 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/left.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/left.png differ
index 0492387..c2bb45c 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/listenum.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/listenum.png differ
index fc1d35a..7bb2846 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/listepuces.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/listepuces.png differ
index 1dfa7dd..bf417ef 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence.png differ
index 87a3c72..c0aac3a 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence2.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/miseenevidence2.png differ
index c335cf1..24abad4 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/oelig-maj.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/oelig-maj.png differ
index 89bdb5a..b50593e 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/oelig.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/oelig.png differ
index 0c76bd1..8251109 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code.png differ
index 87a6914..d84cb42 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code_red.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/page_white_code_red.png differ
index 9122ea2..a674ecd 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/petitescapitales.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/petitescapitales.png differ
index 3c5bbfe..f2e85ed 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/poesie.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/poesie.png differ
index 79d3b19..1ab881d 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/right.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/right.png differ
index e093032..fffef58 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/tag.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/tag.png differ
index 612058a..c910b59 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/icones_barre/text_strikethrough.png and b/www/plugins/enluminures_typographiques_v3/icones_barre/text_strikethrough.png differ
index 8a27a20..3359bef 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/img_pack/e.gif and b/www/plugins/enluminures_typographiques_v3/img_pack/e.gif differ
index c16f858..cf44f19 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/img_pack/moinecopiste.gif and b/www/plugins/enluminures_typographiques_v3/img_pack/moinecopiste.gif differ
index 0ee9187..46d4d00 100644 (file)
@@ -1,13 +1,19 @@
-<traduction module="enlumtypo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/porte_plume_extras/enluminures_typographiques_v3/lang/" reference="fr">
-       <langue code="ar" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=ar" total="27" traduits="26" relire="0" modifs="0" nouveaux="1" pourcent="96.30">
+<traduction module="enlumtypo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/porte_plume_enluminures_typographiques/trunk/lang/" reference="fr">
+       <langue code="ar" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=ar" total="28" traduits="26" relire="0" modifs="0" nouveaux="2" pourcent="92.86">
        </langue>
-       <langue code="en" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=en" total="27" traduits="27" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=en" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=es" total="27" traduits="14" relire="0" modifs="0" nouveaux="13" pourcent="51.85">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=es" total="28" traduits="14" relire="0" modifs="0" nouveaux="14" pourcent="50.00">
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=fr" total="27" traduits="27" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=fr" total="28" traduits="28" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="it" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=it" total="27" traduits="14" relire="0" modifs="0" nouveaux="13" pourcent="51.85">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=it" total="28" traduits="14" relire="0" modifs="0" nouveaux="14" pourcent="50.00">
+       </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=nl" total="28" traduits="28" 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/enlumtypo?lang_cible=ru" total="28" traduits="27" relire="0" modifs="0" nouveaux="1" pourcent="96.43">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
        </langue>
 </traduction>
index 97137ab..5fc9a76 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -41,5 +43,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tableau_resume' => 'الخلاصة',
        'tableau_titre' => 'العنوان'
 );
-
-?>
index 7a29343..32bd8d8 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -40,5 +42,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tableau_resume' => 'Summary',
        'tableau_titre' => 'Title'
 );
-
-?>
index fa3bd55..ac00542 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_puces' => 'Traitement des puces',
        'cfg_titraille' => 'Titraille'
 );
-
-?>
index 1f77bf2..07a88aa 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/porte_plume_extras/enluminures_typographiques_v3/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/porte_plume_enluminures_typographiques/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,6 +27,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'barre_petitescapitales' => 'Mettre le texte en &lt;sc&gt;petites capitales&lt;/sc&gt;',
        'barre_poesie' => 'Mettre en forme comme une &lt;poesie&gt;poésie&lt;/poesie&gt;',
        'barre_tableau' => 'Insérer/modifier (le sélectionner avant) un tableau',
+       'bouton_reinitialiser' => 'Réinitialiser',
 
        // C
        'cfg_insertcss' => 'Insertion CSS',
@@ -38,5 +41,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tableau_resume' => 'Résumé',
        'tableau_titre' => 'Titre'
 );
-
-?>
index c666476..a949bb9 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_puces' => 'Traitement des puces',
        'cfg_titraille' => 'Titraille'
 );
-
-?>
diff --git a/www/plugins/enluminures_typographiques_v3/lang/enlumtypo_nl.php b/www/plugins/enluminures_typographiques_v3/lang/enlumtypo_nl.php
new file mode 100644 (file)
index 0000000..c453659
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // B
+       'barre_alignerdroite' => 'De paragraaf [/rechts uitlijnen/]',
+       'barre_alignergauche' => 'De paragraaf [!links uitlijnen!]',
+       'barre_avances' => 'Betekenisvol!',
+       'barre_barre' => 'De tekst &lt;del&gt;doorstrepen&lt;/del&gt;',
+       'barre_boutonsavances' => 'Extra betekenisvol, gebruik met mate en inzicht!',
+       'barre_cadre' => 'In een &lt;cadre&gt;tekstinvoerveld&lt;/cadre&gt; plaatsen',
+       'barre_centrer' => 'De paragraaf [|centreren|]',
+       'barre_code' => 'In &lt;code&gt;programmeercode&lt;/code&gt; plaatsen',
+       'barre_encadrer' => 'De paragraaf [(omkaderen)]',
+       'barre_exposant' => 'Zet de tekst in &lt;sup&gt;superscript&lt;/sup&gt;',
+       'barre_formatages_speciaux' => 'Speciale formattering',
+       'barre_indice' => 'Zet de tekst in &lt;sub&gt;subscript&lt;/sub&gt;',
+       'barre_intertitre2' => 'Omzetten in {{{**tussentitel niveau 2}}}',
+       'barre_intertitre3' => 'Omzetten in {{{***tussentitel niveau 3}}}',
+       'barre_miseenevidence' => 'Maak de tekst [*benadrukt*]',
+       'barre_miseenevidence2' => 'Maak de tekst [**benadrukt*] (2e kleur)',
+       'barre_petitescapitales' => 'Zet de tekst in &lt;sc&gt;kleine kapitalen&lt;/sc&gt;',
+       'barre_poesie' => 'Formatteren als &lt;poesie&gt;poesie&lt;/poesie&gt;',
+       'barre_tableau' => 'Een tabel invoegen/aanpassen (eerst kiezen)',
+       'bouton_reinitialiser' => 'Herinitialiseren',
+
+       // C
+       'cfg_insertcss' => 'CSS invoegen',
+       'cfg_puces' => 'Puntsgewijs',
+       'cfg_titraille' => 'Titelkoppen',
+       'configuration_typoenluminee' => 'Typografische Verlichting',
+
+       // T
+       'tableau_enregistrer' => 'Opslaan',
+       'tableau_prem_ligne' => 'Eerste regel',
+       'tableau_resume' => 'Samenvatting',
+       'tableau_titre' => 'Titel'
+);
diff --git a/www/plugins/enluminures_typographiques_v3/lang/enlumtypo_ru.php b/www/plugins/enluminures_typographiques_v3/lang/enlumtypo_ru.php
new file mode 100644 (file)
index 0000000..983caa2
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/enlumtypo?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // B
+       'barre_alignerdroite' => '[/Выровнять вправо/] абзац',
+       'barre_alignergauche' => '[!Выровнять влево!] абзац',
+       'barre_avances' => 'Значение, смысл!',
+       'barre_barre' => '&lt;del&gt;Зачеркнутый&lt;/del&gt; текст',
+       'barre_boutonsavances' => 'Эти дополнительные возможности надо использовать умеренно и со смыслом!',
+       'barre_cadre' => 'Поместить текст &lt;cadre&gt;в кадр&lt;/cadre&gt;',
+       'barre_centrer' => '[|Центрировать|] абзац',
+       'barre_code' => 'Текст как &lt;code&gt;программный код&lt;/code&gt;',
+       'barre_encadrer' => '[(Рамка)] вокруг абзаца',
+       'barre_exposant' => '&lt;sup&gt;Верхнийм&lt;/sup&gt; индекс',
+       'barre_formatages_speciaux' => 'Специальные форматы',
+       'barre_indice' => '&lt;sub&gt;Нижний&lt;/sub&gt; индекс',
+       'barre_intertitre2' => 'Заголовок {{{**второго уровня}}}',
+       'barre_intertitre3' => 'Заголовок {{{***третьего уровня}}}',
+       'barre_miseenevidence' => 'Текст [*подчеркнуть*]',
+       'barre_miseenevidence2' => 'Текст [**подчеркнуть*] (другой цвет)',
+       'barre_petitescapitales' => 'Сделать &lt;sc&gt;малыми прописными&lt;/sc&gt;',
+       'barre_poesie' => 'отформатировать как &lt;poesie&gt;поэзию&lt;/poesie&gt;',
+       'barre_tableau' => 'Вставить/изменить (сначала выберите) таблицу',
+
+       // C
+       'cfg_insertcss' => 'Вставить CSS',
+       'cfg_puces' => 'Маркеры (для списков)',
+       'cfg_titraille' => 'Заголовки',
+       'configuration_typoenluminee' => 'Типографские озарения',
+
+       // T
+       'tableau_enregistrer' => 'Сохранить',
+       'tableau_prem_ligne' => 'Первая строка',
+       'tableau_resume' => 'Резюме',
+       'tableau_titre' => 'Заголовок'
+);
diff --git a/www/plugins/enluminures_typographiques_v3/lang/paquet-typoenluminee.xml b/www/plugins/enluminures_typographiques_v3/lang/paquet-typoenluminee.xml
new file mode 100644 (file)
index 0000000..3fa359f
--- /dev/null
@@ -0,0 +1,4 @@
+<traduction module="paquet-typoenluminee" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/porte_plume_enluminures_typographiques/trunk/lang/" reference="fr">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/paquet-typoenluminee?lang_cible=fr" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+</traduction>
index bfe2583..59f4c48 100644 (file)
@@ -1,32 +1,26 @@
 <?php
-
-// Ceci est un fichier langue de SPIP -- This is a SPIP language file
-
-///  Fichier produit par PlugOnet
-// Module: paquet-typoenluminee
-// Langue: fr
-// Date: 08-01-2012 17:02:08
-// Items: 2
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
+// 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_/porte_plume_enluminures_typographiques/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
-// T
-       'typoenluminee_description' => 'Ce plugin ajoute des raccourcis typographiques et des boutons au porte plume. Par exemple :\r
--* Paragraphes :\r
--** {{Sous-titres}} <code>{{{**</code>Texte du titre<code>}}}</code>, le nombre d\'étoiles (*) variant de 2 à 5, la barre de raccourcis ne proposant que 2 et 3\r
--** {{Centrer}} <code>[|</code>Paragraphe centré<code>|]</code>\r
--** {{Aligner à droite}} <code>[/</code>Paragraphe aligné à droite<code>/]</code>\r
--** {{Encadrer}} <code>[(</code>Paragraphe à encadrer<code>)]</code>\r
--* Caractères :\r
--** {{Mise en évidence}} <code>[*</code>texte en évidence<code>*]</code>\r
--** {{Mise en évidence variante}} <code>[**</code>texte en évidence (autre couleur)<code>*]</code>\r
--** {{Mise en exposant}} {&lt;sup&gt;}texte en exposant{&lt;/sup&gt;}\r
--** {{Petites capitales}} {&lt;sc&gt;}texte en petite capitales{&lt;/sc&gt;}\r
+       // T
+       'typoenluminee_description' => 'Ce plugin ajoute des raccourcis typographiques et des boutons au porte plume. Par exemple :
+-* Paragraphes :
+-** {{Sous-titres}} <code>{{{**</code>Texte du titre<code>}}}</code>, le nombre d’étoiles (*) variant de 2 à 5, la barre de raccourcis ne proposant que 2 et 3
+-** {{Centrer}} <code>[|</code>Paragraphe centré<code>|]</code>
+-** {{Aligner à droite}} <code>[/</code>Paragraphe aligné à droite<code>/]</code>
+-** {{Encadrer}} <code>[(</code>Paragraphe à encadrer<code>)]</code>
+-* Caractères :
+-** {{Mise en évidence}} <code>[*</code>texte en évidence<code>*]</code>
+-** {{Mise en évidence variante}} <code>[**</code>texte en évidence (autre couleur)<code>*]</code>
+-** {{Mise en exposant}} {&lt;sup&gt;}texte en exposant{&lt;/sup&gt;}
+-** {{Petites capitales}} {&lt;sc&gt;}texte en petite capitales{&lt;/sc&gt;}
 -** {{Biffé}} {&lt;del&gt;}texte biffé{&lt;/del&gt;}
 
 ',
-       'typoenluminee_slogan' => 'Plein de raccourcis pour la mise en forme !',
+       'typoenluminee_slogan' => 'Plein de raccourcis pour la mise en forme !'
 );
-?>
\ No newline at end of file
index 817ac36..04d9121 100644 (file)
@@ -1,12 +1,13 @@
 <paquet
        prefix="typoenluminee"
        categorie="edition"
-       version="3.4.3"
+       version="3.5.8"
        etat="stable"
-       compatibilite="[2.0.3;3.0.*]"
+       compatibilite="[2.0.3;3.1.*]"
        logo="prive/themes/spip/images/typoenluminee-32.png"
        documentation="http://contrib.spip.net/Enluminures-typographiques-V3-pour-SPIP-2-avec"
->      
+       schema="0.1.0"
+>
 
        <nom>Enluminures typographiques</nom>
        <!-- Plein de raccourcis pour la mise en forme ! -->
@@ -29,8 +30,8 @@
        <pipeline nom="header_prive" inclure="typoenluminee_pipelines.php" />
        <pipeline nom="porte_plume_barre_pre_charger" inclure="enluminures_typo_pipelines.php" />
        <pipeline nom="porte_plume_lien_classe_vers_icone" inclure="enluminures_typo_pipelines.php" />
-       
+
        <menu nom="configurer_typoenluminee" titre="enlumtypo:configuration_typoenluminee" parent="menu_squelette" icone="images/typoenluminee-16.png" />
 
        <necessite nom="porte_plume" compatibilite="[1.2.2;[" />
-</paquet>
\ No newline at end of file
+</paquet>
index e9c09ec..e4e8af7 100644 (file)
@@ -4,7 +4,9 @@
        <auteur>[Jacques->http://contrib.spip.net/_Jacques-PYRAT_], &#224; partir des raccourcis mis en place par [Fran&#231;ois->http://contrib.spip.net/_Francois-Schreuer_]</auteur>\r
        <licence>&#169; 2007 GNU/GPL</licence>\r
        <lien>http://contrib.spip.net/Enluminures-typographiques-V3-pour-SPIP-2-avec</lien>\r
-       <version>3.4.3</version>\r
+       <version>3.5.8</version>\r
+       <version_base>0.1.0</version_base>\r
+       <install>base/typoenluminee_upgrade.php</install>\r
        <etat>stable</etat>\r
        <description>Ce plugin ajoute des raccourcis typographiques et des boutons au porte plume. Par exemple :\r
 -* Paragraphes :\r
@@ -70,6 +72,6 @@
                <inclure>enluminures_typo_pipelines.php</inclure>\r
        </pipeline>\r
        <categorie>edition</categorie>\r
-       <necessite id="SPIP" version="[2.0.3;3.0.99]" />\r
+       <necessite id="SPIP" version="[2.0.3;3.1.99]" />\r
        <necessite id="porte_plume" version="[1.2.2;]" />\r
 </plugin>\r
index edb0d98..223f52d 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-16.png and b/www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-16.png differ
index 76fbc36..8b267fe 100644 (file)
Binary files a/www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-32.png and b/www/plugins/enluminures_typographiques_v3/prive/themes/spip/images/typoenluminee-32.png differ
index c935c88..a02bb7a 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
-Origine: file:///home/svn/repository/spip-zone/_plugins_/porte_plume_extras/enluminures_typographiques_v3
-Revision: 84614
-Dernier commit: 2014-09-14 23:33:31 +0200 
+Origine: file:///home/svn/repository/spip-zone/_plugins_/porte_plume_enluminures_typographiques/trunk
+Revision: 99227
+Dernier commit: 2016-08-21 06:04:02 +0200 
 </text_version>
-<origine>file:///home/svn/repository/spip-zone/_plugins_/porte_plume_extras/enluminures_typographiques_v3</origine>
-<revision>84614</revision>
-<commit>2014-09-14 23:33:31 +0200 </commit>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/porte_plume_enluminures_typographiques/trunk</origine>
+<revision>99227</revision>
+<commit>2016-08-21 06:04:02 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 377da47..68f8788 100644 (file)
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-/*\r
-  * Ce plugin rajoute des raccourcis typographique et ameliore les possibilites de la barre typographique pour les redacteurs\r
-*/\r
-\r
-       /*\r
-        *    Fonctions de ces filtres :\r
-        *     Ils rajoutent quelques racourcis typo a SPIP\r
-        *\r
-        *     Syntaxe des raccourcis :\r
-        *           [/texte/] : aligner le texte a droite\r
-        *           [!texte!] : aligner le texte a gauche\r
-        *           [|texte|] : centrer le texte\r
-        *           [(texte)] : encadrer le texte (occupe toute la largeur de la page, a mettre autour d'un paragraphe)\r
-        *           [*texte*] : encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)\r
-        *           [**texte*] : variante encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)\r
-        *           <sup>texte</sup> : mettre en exposant le texte selectionne\r
-        *           <sub>texte</sub> : mettre en indice le texte selectionne\r
-        *\r
-        *     Styles pour les encadrements a rajouter dans votre feuille de style :\r
-        *            .texteencadre-spip {\r
-        *              background: #FFE;\r
-        *              border-bottom: 2px solid #999999;\r
-        *              border-left: 1px solid #EEEEEE;\r
-        *              border-right: 2px solid #999999;\r
-        *              border-top: 1px solid #EEEEEE;\r
-        *              padding: .25em;\r
-        *           }\r
-        *           .caractencadre-spip {\r
-        *              border: 1px solid #666;\r
-        *              padding: 0px .5em 0px .5em;\r
-        *           }\r
-        *\r
-       */\r
-\r
-// Gerer les variables de personnalisation, fonction depreciee sous SPIP 2.0\r
-// A suivre sur la methode...\r
-if(!function_exists('tester_variable')) {\r
-       function tester_variable($var, $val){\r
-               if (!isset($GLOBALS[$var]))     $GLOBALS[$var] = $val;\r
-       }\r
-}\r
-\r
-function typoenluminee_pre_propre($texte) {\r
-       if(!$texte) return $texte;\r
-\r
-       static $chercher_raccourcis=NULL;\r
-       static $remplacer_raccourcis=NULL;\r
-       \r
-       if ($chercher_raccourcis===NULL) {\r
-       \r
-               // tous les elements block doivent etre introduits ici\r
-               // pour etre pris en charge par paragrapher\r
-       \r
-               // Definition des differents intertitres possibles, si pas deja definies\r
-               if ((!function_exists('lire_config')) OR (isset($GLOBALS['config_intertitre']))) {\r
-                       tester_variable('debut_intertitre', '<h3 class="spip">');\r
-                       tester_variable('fin_intertitre', '</h3>');\r
-                       tester_variable('debut_intertitre_2', '<h4 class="spip">');\r
-                       tester_variable('fin_intertitre_2', '</h4>');\r
-                       tester_variable('debut_intertitre_3', '<h5 class="spip">');\r
-                       tester_variable('fin_intertitre_3', '</h5>');\r
-                       tester_variable('debut_intertitre_4', '<h6 class="spip">');\r
-                       tester_variable('fin_intertitre_4', '</h6>');\r
-                       tester_variable('debut_intertitre_5', '<strong class="spip titraille5">');\r
-                       tester_variable('fin_intertitre_5', '</strong>');\r
-               } else {\r
-                       $GLOBALS['debut_intertitre'] = lire_config('bte/titraille1open','<h3 class="spip">');\r
-                       $GLOBALS['fin_intertitre'] = lire_config('bte/titraille1close','</h3>');\r
-                       $GLOBALS['debut_intertitre_2'] = lire_config('bte/titraille2open','<h4 class="spip">');\r
-                       $GLOBALS['fin_intertitre_2'] = lire_config('bte/titraille2close','</h4>');\r
-                       $GLOBALS['debut_intertitre_3'] = lire_config('bte/titraille3open','<h5 class="spip">');\r
-                       $GLOBALS['fin_intertitre_3'] = lire_config('bte/titraille3close','</h5>');\r
-                       $GLOBALS['debut_intertitre_4'] = lire_config('bte/titraille4open','<h6 class="spip">');\r
-                       $GLOBALS['fin_intertitre_4'] = lire_config('bte/titraille4close','</h6>');\r
-                       $GLOBALS['debut_intertitre_5'] = lire_config('bte/titraille5open','<strong class="spip titraille5">');\r
-                       $GLOBALS['fin_intertitre_5'] = lire_config('bte/titraille5close','</strong>');\r
-               }\r
-       \r
-               tester_variable('toujours_paragrapher', false);\r
-       \r
-               global $debut_intertitre, $fin_intertitre;\r
-               global $debut_intertitre_2, $fin_intertitre_2;\r
-               global $debut_intertitre_3, $fin_intertitre_3;\r
-               global $debut_intertitre_4, $fin_intertitre_4;\r
-               global $debut_intertitre_5, $fin_intertitre_5;\r
-       \r
-               $chercher_raccourcis=array();\r
-               $remplacer_raccourcis=array();\r
-       \r
-               /* 9b */        $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*\*\*\*\*(.*)[}][}][}]($|[^}])/SUms";\r
-               /* 9 */         $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*\*\*\*(.*)[}][}][}]($|[^}])/SUms";\r
-               /* 7 */         $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*\*\*(.*)[}][}][}]($|[^}])/SUms";\r
-               /* 5 */         $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*\*(.*)[}][}][}]($|[^}])/SUms";\r
-               /* 3 */         $chercher_raccourcis[]="/(^|[^{])[{][{][{]\*(.*)[}][}][}]($|[^}])/SUms";\r
-               /* 1 */         $chercher_raccourcis[]="/(^|[^{])[{][{][{](.*)[}][}][}]($|[^}])/SUms";\r
-               /* 11 */        $chercher_raccourcis[]="/\{(�|§)\{/S"; # § Pour gerer l'unicode aussi !\r
-               /* 12 */        $chercher_raccourcis[]="/\}(�|§)\}/S"; # ne pas sauvergarder ce fichier en utf8 !\r
-\r
-               /* 9b */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_5\$2$fin_intertitre_5\n\n\$3";\r
-               /*  9 */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_4\$2$fin_intertitre_4\n\n\$3";\r
-               /*  7 */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_3\$2$fin_intertitre_3\n\n\$3";\r
-               /*  5 */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_2\$2$fin_intertitre_2\n\n\$3";\r
-               /*  3 */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre\$2$fin_intertitre\n\n\$3";\r
-               /*  1 */        $remplacer_raccourcis[]="\$1\n\n$debut_intertitre\$2$fin_intertitre\n\n\$3";\r
-               /* 11 */        $remplacer_raccourcis[]="<sc>";\r
-               /* 12 */        $remplacer_raccourcis[]="</sc>";\r
-       }\r
-\r
-       // Conversion des intertitres d'enluminures type {n{titre}n}\r
-       // ou n est un nombre en intertitres avec des etoiles type {{{* (avec n etoiles)\r
-       // {1{ sera converti en {{{* ; {2{ sera converti en {{{** ; etc.\r
-       // Ne faire la recherche que s'il y a au moins un titre ancienne mode a convertir\r
-       if (strpos($texte, '{1{')!==false\r\r
-               OR strpos($texte, '{2{')!==false\r
-               OR strpos($texte, '{3{')!==false\r
-               OR strpos($texte, '{4{')!==false\r
-               OR strpos($texte, '{5{')!==false) {\r
-                       $texte=preg_replace_callback ("/\{(\d)\{(.*)\}(\\1)\}/Ums",\r
-                                                       create_function (\r
-                                                               '$matches',\r
-                                                               'return "{{{".str_repeat("*",$matches[1]).trim($matches[2])."}}}";'\r
-                                                       ),\r
-                                                       $texte);\r
-       }\r
-       $texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte);\r
-\r
-       return $texte;\r
-}\r
-\r
-function typoenluminee_post_propre($texte) {\r
-       if(!$texte) return $texte;\r
-       static $cherche1 = NULL;\r
-       static $remplace1 = NULL;\r
-       if ($cherche1===NULL) {\r
-               # Le remplacement des intertitres de premier niveau a deja ete effectue dans inc/texte.php\r
-               $cherche1 = array();\r
-               $remplace1 = array();\r
-               $cherche1[] = /* 15 */  ",\[/(.*)/\],Ums";\r
-               $cherche1[] = /* 16 */  ",\[!(.*)!\],Ums";\r
-               $cherche1[] = /* 17 */  ",\[\|(.*)\|\],Ums";\r
-               $cherche1[] = /* 19 */  ",\[\((.*)\)\],Ums";\r
-               $cherche1[] = /* 21 */  "/\[\*\*/S";\r
-               $cherche1[] = /* 21b */         "/\[\*/S";\r
-               $cherche1[] = /* 22 */  "/\*\]/S";\r
-       \r
-               $remplace1[] = /* 15 */         "<div class=\"spip\" style=\"text-align:right;\">$1</div>";\r
-               $remplace1[] = /* 16 */         "<div class=\"spip\" style=\"text-align:left;\">$1</div>";\r
-               $remplace1[] = /* 17 */         "<div class=\"spip\" style=\"text-align:center;\">$1</div>";\r
-               $remplace1[] = /* 19 */         "<div class=\"texteencadre-spip spip\">$1</div>";\r
-               $remplace1[] = /* 21 */         "<strong class=\"caractencadre2-spip spip\">";\r
-               $remplace1[] = /* 21b */        "<strong class=\"caractencadre-spip spip\">";\r
-               $remplace1[] = /* 22 */ "</strong>";\r
-       }\r
-       $texte = preg_replace($cherche1, $remplace1, $texte);\r
-       $texte = paragrapher($texte,$GLOBALS['toujours_paragrapher']); // il faut reparagrapher a cause des raccourcis typo que l'on a ajoute (block div)\r
-       return $texte;\r
-}\r
-\r
-function typoenluminee_pre_liens($texte) {\r
-       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) OR $GLOBALS['barre_typo_pas_de_fork_typo'] === true)\r
-               return $texte;\r
-\r
-       $texte = str_replace('<-->','&harr;',$texte);\r
-       $texte = str_replace('-->','&rarr;',$texte);\r
-\r
-       return $texte;\r
-}\r
-\r
-function typoenluminee_pre_typo($texte) {\r
-       if(!$texte) return $texte;\r
-       static $local_barre_typo_pas_de_fausses_puces = null;\r
-       static $chercher_raccourcis;\r
-       static $remplacer_raccourcis;\r
-       global $debut_italique, $fin_italique;\r
-       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) OR $GLOBALS['barre_typo_pas_de_fork_typo'] === true)\r
-               return $texte;\r
-\r
-       if ($local_barre_typo_pas_de_fausses_puces===null){\r
-               // remplace les fausses listes a puce par de vraies ?\r
-               // (recherche en debut de lignes - suivi d'un ou plusieurs caracteres blancs, en mode multiligne)\r
-               // Mettre $GLOBALS['barre_typo_pas_de_fausses_puces'] = true; dans mes_options.php pour avoir ce comportement\r
-               if (isset($GLOBALS['barre_typo_pas_de_fausses_puces'])) {\r
-                       $local_barre_typo_pas_de_fausses_puces = $GLOBALS['barre_typo_pas_de_fausses_puces'];\r
-               } else {\r
-                       if (function_exists('lire_config')) {\r
-                               $local_barre_typo_pas_de_fausses_puces = (lire_config('bte/puces','Non') == 'Oui')?true:false;\r
-                       }\r
-               }\r
-               global $class_spip;\r
-               tester_variable('debut_italique', "<i$class_spip>");\r
-               tester_variable('fin_italique', '</i>');\r
-               \r
-               $chercher_raccourcis = array(\r
-                       /* 9 */         "/(?<![{\d])[{](?![{\d])/S", // Expressions complexes car on n'a pas encore traite les titres ici\r
-                       /* 10 */        "/(?<![}\d])[}](?![}\d])/S", // puisque italique utilisent les memes caracteres en nombre inferieur\r
-               );\r
-       \r
-               $remplacer_raccourcis = array(\r
-                       /* 9 */         $debut_italique,\r
-                       /* 10 */        $fin_italique,\r
-               );\r
-       }\r
-       if ($local_barre_typo_pas_de_fausses_puces === true) {\r
-               $texte =  preg_replace('/^-\s+/m','-* ',$texte);\r
-       }\r
-\r
-       $texte = str_replace('<--','&larr;',$texte);\r
-       $texte = str_replace('<==>','&hArr;',$texte);\r
-       $texte = str_replace('==>','&rArr;',$texte);\r
-       $texte = str_replace('<==','&lArr;',$texte);\r
-       $texte = str_ireplace('(c)','&copy;',$texte);\r
-       $texte = str_ireplace('(r)','&reg;',$texte);\r
-       $texte = str_ireplace('(tm)','&trade;',$texte);\r
-       $texte = str_replace('...','&hellip;',$texte);\r
-       $texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte);\r
-       /*\r
-               Cas particulier pour le gras\r
-               Il ne faut pas traiter la mise en gras ici si le texte contient un tableau\r
-       */\r
-       if (!preg_match(',.(\|([[:space:]]*{{[^}]+}}[[:space:]]*|<))+.,sS', $texte)) {\r
-               $chercher_raccourcisg = array(\r
-                       /* 7 */         "/(?<![{])[{][{](?![{])/S", // Expressions complexes car on n'a pas encore traite les titres ici\r
-                       /* 8 */         "/(?<![}])[}][}](?![}])/S" // En gros, verification qu'on n'est pas a l'interieur d'un titre\r
-               );\r
-               $remplacer_raccourcisg = array(\r
-                       /* 7 */         "<strong class=\"spip\">",\r
-                       /* 8 */         "</strong>"\r
-               );\r
-               $texte = preg_replace($chercher_raccourcisg, $remplacer_raccourcisg, $texte);\r
-       }\r
-       return $texte;\r
-}\r
-\r
-function typoenluminee_post_typo($texte) {\r
-       if(!$texte) return $texte;\r
-       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) OR $GLOBALS['barre_typo_pas_de_fork_typo'] === true)\r
-               return $texte;\r
-       $texte = str_replace('[^','<sup>',$texte);\r
-       $texte = str_replace('^]','</sup>',$texte);\r
-       $texte = str_replace('[**','<strong class="caractencadre2-spip spip">',$texte);\r
-       $texte = str_replace('[*','<strong class="caractencadre-spip spip">',$texte);\r
-       $texte = str_replace('*]','</strong>',$texte);\r
-       \r
-       // Correction des & en &amp;\r
-       $texte = preg_replace('/&([A-Za-z#0-9]*);/','@@@amp:\1:amp@@@',$texte); // echapement des entites html deja presentes\r
-       $texte = str_replace('&','&amp;',$texte);\r
-       $texte = preg_replace('/@@@amp:([A-Za-z#0-9]*):amp@@@/','&\1;',$texte);\r
-       // Raccourci typographique <sc></sc>\r
-       $texte = str_replace('<sc>', '<span class="caps">', $texte);\r
-       $texte = str_replace('</sc>', '</span>', $texte);\r
-       $texte = acronymes_traiter_raccourcis($texte);\r
-       return $texte;\r
-}\r
-\r
-function typoenluminee_nettoyer_raccourcis_typo($texte){\r
-       $texte = preg_replace(',\{[1-5]\{,','',$texte);\r
-       $texte = preg_replace(',\}[1-5]\},','',$texte);\r
-       $texte = preg_replace(',\{\{\{\*+,','{{{',$texte);\r
-       $texte = str_replace('&hellip;','...',$texte);\r
-       return $texte;\r
-}\r
-\r
-// traite les raccourcis de la forme [SNCF|societe nationale...]\r
-// reprise du plugin acronymes\r
-if (!function_exists('acronymes_traiter_raccourcis')) {\r
-       function acronymes_traiter_raccourcis($letexte){\r
-               $pattern="{\[([^\|\]-]+)\|([^\|\]-]+)\]}";\r
-               preg_match_all ($pattern, $letexte, $tagMatches, PREG_SET_ORDER);\r
-               $textMatches = preg_split ($pattern, $letexte);\r
-\r
-               $tag_attr=array();\r
-               foreach ($tagMatches as $key => $value) {\r
-                       $tag_attr[]="<acronym title='".texte_backend($value[2])."'>".$value[1]."</acronym>";\r
-               }\r
-               for ($i = 0; $i < count ($textMatches); $i ++) {\r
-                       $textMatches [$i] = $textMatches [$i] . $tag_attr [$i];\r
-               }\r
-               return implode ("", $textMatches);\r
-       }\r
-}\r
-\r
-\r
-?>
\ No newline at end of file
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Ce plugin rajoute des raccourcis typographique et ameliore les possibilites de la barre typographique pour les redacteurs
+ *
+ *
+ *    Fonctions de ces filtres :
+ *     Ils rajoutent quelques racourcis typo a SPIP
+ *
+ *     Syntaxe des raccourcis :
+ *           [/texte/] : aligner le texte a droite
+ *           [!texte!] : aligner le texte a gauche
+ *           [|texte|] : centrer le texte
+ *           [(texte)] : encadrer le texte (occupe toute la largeur de la page, a mettre autour d'un paragraphe)
+ *           [*texte*] : encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)
+ *           [**texte*] : variante encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)
+ *           <sup>texte</sup> : mettre en exposant le texte selectionne
+ *           <sub>texte</sub> : mettre en indice le texte selectionne
+ *
+ *     Styles pour les encadrements a rajouter dans votre feuille de style :
+ *            .texteencadre-spip {
+ *             background: #FFE;
+ *             border-bottom: 2px solid #999999;
+ *             border-left: 1px solid #EEEEEE;
+ *             border-right: 2px solid #999999;
+ *             border-top: 1px solid #EEEEEE;
+ *             padding: .25em;
+ *           }
+ *           .caractencadre-spip {
+ *             border: 1px solid #666;
+ *             padding: 0px .5em 0px .5em;
+ *           }
+ */
+
+// Gerer les variables de personnalisation, fonction depreciee sous SPIP 2.0
+// A suivre sur la methode...
+if (!function_exists('tester_variable')) {
+       function tester_variable($var, $val) {
+               if (!isset($GLOBALS[$var])) {
+                       $GLOBALS[$var] = $val;
+               }
+       }
+}
+
+function typoenluminee_pre_propre($texte) {
+       if (!$texte) {
+               return $texte;
+       }
+
+       static $chercher_raccourcis = null;
+       static $remplacer_raccourcis = null;
+
+       if ($chercher_raccourcis === null) {
+               // tous les elements block doivent etre introduits ici
+               // pour etre pris en charge par paragrapher
+
+               // Definition des differents intertitres possibles, si pas deja definies
+               if ((!function_exists('lire_config')) or (isset($GLOBALS['config_intertitre']))) {
+                       tester_variable('debut_intertitre', '<h3 class="spip">');
+                       tester_variable('fin_intertitre', '</h3>');
+                       tester_variable('debut_intertitre_2', '<h4 class="spip">');
+                       tester_variable('fin_intertitre_2', '</h4>');
+                       tester_variable('debut_intertitre_3', '<h5 class="spip">');
+                       tester_variable('fin_intertitre_3', '</h5>');
+                       tester_variable('debut_intertitre_4', '<h6 class="spip">');
+                       tester_variable('fin_intertitre_4', '</h6>');
+                       tester_variable('debut_intertitre_5', '<strong class="spip titraille5">');
+                       tester_variable('fin_intertitre_5', '</strong>');
+               } else {
+                       $GLOBALS['debut_intertitre'] = lire_config('bte/titraille1open', '<h3 class="spip">');
+                       $GLOBALS['fin_intertitre'] = lire_config('bte/titraille1close', '</h3>');
+                       $GLOBALS['debut_intertitre_2'] = lire_config('bte/titraille2open', '<h4 class="spip">');
+                       $GLOBALS['fin_intertitre_2'] = lire_config('bte/titraille2close', '</h4>');
+                       $GLOBALS['debut_intertitre_3'] = lire_config('bte/titraille3open', '<h5 class="spip">');
+                       $GLOBALS['fin_intertitre_3'] = lire_config('bte/titraille3close', '</h5>');
+                       $GLOBALS['debut_intertitre_4'] = lire_config('bte/titraille4open', '<h6 class="spip">');
+                       $GLOBALS['fin_intertitre_4'] = lire_config('bte/titraille4close', '</h6>');
+                       $GLOBALS['debut_intertitre_5'] = lire_config('bte/titraille5open', '<strong class="spip titraille5">');
+                       $GLOBALS['fin_intertitre_5'] = lire_config('bte/titraille5close', '</strong>');
+               }
+
+               tester_variable('toujours_paragrapher', false);
+
+               global $debut_intertitre, $fin_intertitre;
+               global $debut_intertitre_2, $fin_intertitre_2;
+               global $debut_intertitre_3, $fin_intertitre_3;
+               global $debut_intertitre_4, $fin_intertitre_4;
+               global $debut_intertitre_5, $fin_intertitre_5;
+
+               $chercher_raccourcis=array();
+               $remplacer_raccourcis=array();
+
+               /* 9b */        $chercher_raccourcis[] = '/(^|[^{])[{][{][{]\*\*\*\*\*(.*)[}][}][}]($|[^}])/SUms';
+               /* 9 */         $chercher_raccourcis[] = '/(^|[^{])[{][{][{]\*\*\*\*(.*)[}][}][}]($|[^}])/SUms';
+               /* 7 */         $chercher_raccourcis[] = '/(^|[^{])[{][{][{]\*\*\*(.*)[}][}][}]($|[^}])/SUms';
+               /* 5 */         $chercher_raccourcis[] = '/(^|[^{])[{][{][{]\*\*(.*)[}][}][}]($|[^}])/SUms';
+               /* 3 */         $chercher_raccourcis[] = '/(^|[^{])[{][{][{]\*(.*)[}][}][}]($|[^}])/SUms';
+               /* 1 */         $chercher_raccourcis[] = '/(^|[^{])[{][{][{](.*)[}][}][}]($|[^}])/SUms';
+               /* 11 */        $chercher_raccourcis[] = '/\{(�|§)\{/S'; # § Pour gerer l'unicode aussi !
+               /* 12 */        $chercher_raccourcis[] = '/\}(�|§)\}/S'; # ne pas sauvergarder ce fichier en utf8 !
+
+               /* 9b */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre_5\$2$fin_intertitre_5\n\n\$3";
+               /*  9 */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre_4\$2$fin_intertitre_4\n\n\$3";
+               /*  7 */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre_3\$2$fin_intertitre_3\n\n\$3";
+               /*  5 */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre_2\$2$fin_intertitre_2\n\n\$3";
+               /*  3 */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre\$2$fin_intertitre\n\n\$3";
+               /*  1 */        $remplacer_raccourcis[] = "\$1\n\n$debut_intertitre\$2$fin_intertitre\n\n\$3";
+               /* 11 */        $remplacer_raccourcis[] = '<sc>';
+               /* 12 */        $remplacer_raccourcis[] = '</sc>';
+       }
+
+       // Conversion des intertitres d'enluminures type {n{titre}n}
+       // ou n est un nombre en intertitres avec des etoiles type {{{* (avec n etoiles)
+       // {1{ sera converti en {{{* ; {2{ sera converti en {{{** ; etc.
+       // Ne faire la recherche que s'il y a au moins un titre ancienne mode a convertir
+       if (strpos($texte, '{1{') !== false
+               or strpos($texte, '{2{') !== false
+               or strpos($texte, '{3{') !== false
+               or strpos($texte, '{4{') !== false
+               or strpos($texte, '{5{') !== false) {
+                       $texte = preg_replace_callback(
+                               '/\{(\d)\{(.*)\}(\\1)\}/Ums',
+                               create_function(
+                                       '$matches',
+                                       'return "{{{".str_repeat("*",$matches[1]).trim($matches[2])."}}}";'
+                               ),
+                               $texte
+                       );
+       }
+       $texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte);
+
+       return $texte;
+}
+
+/**
+ * Insertion dans le pipeline post_propre (SPIP)
+ *
+ * Remplacement de caracteres apres le passage de propre
+ *
+ * @param $texte string
+ *     Le texte a modifier
+ * @return $texte string
+ */
+function typoenluminee_post_propre($texte) {
+       if (!$texte) {
+               return $texte;
+       }
+       static $cherche1 = null;
+       static $remplace1 = null;
+       if ($cherche1=== null) {
+               # Le remplacement des intertitres de premier niveau a deja ete effectue dans inc/texte.php
+               $cherche1 = array();
+               $remplace1 = array();
+               $cherche1[] = /* 15 */  ',\[/(.*)/\],Ums';
+               $cherche1[] = /* 16 */  ',\[!(.*)!\],Ums';
+               $cherche1[] = /* 17 */  ',\[\|(.*)\|\],Ums';
+               $cherche1[] = /* 19 */  ',\[\((.*)\)\],Ums';
+               $cherche1[] = /* 21 */  '/\[\*\*/S';
+               $cherche1[] = /* 21b */ '/\[\*/S';
+               $cherche1[] = /* 22 */  '/\*\]/S';
+
+               $remplace1[] = /* 15 */         '<div class="spip" style="text-align:right;">$1</div>';
+               $remplace1[] = /* 16 */         '<div class="spip" style="text-align:left;">$1</div>';
+               $remplace1[] = /* 17 */         '<div class="spip" style="text-align:center;">$1</div>';
+               $remplace1[] = /* 19 */         '<div class="texteencadre-spip spip">$1</div>';
+               $remplace1[] = /* 21 */         '<strong class="caractencadre2-spip spip">';
+               $remplace1[] = /* 21b */        '<strong class="caractencadre-spip spip">';
+               $remplace1[] = /* 22 */ '</strong>';
+       }
+       $texte = preg_replace($cherche1, $remplace1, $texte);
+       $texte = paragrapher($texte, $GLOBALS['toujours_paragrapher']); // il faut reparagrapher a cause des raccourcis typo que l'on a ajoute (block div)
+       return $texte;
+}
+
+function typoenluminee_pre_liens($texte) {
+       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) or $GLOBALS['barre_typo_pas_de_fork_typo'] === true) {
+               return $texte;
+       }
+
+       $texte = str_replace('<-->', '&harr;', $texte);
+       $texte = str_replace('-->', '&rarr;', $texte);
+
+       return $texte;
+}
+
+function typoenluminee_pre_typo($texte) {
+       if (!$texte) {
+               return $texte;
+       }
+       static $local_barre_typo_pas_de_fausses_puces = null;
+       static $chercher_raccourcis;
+       static $remplacer_raccourcis;
+
+       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) or $GLOBALS['barre_typo_pas_de_fork_typo'] === true) {
+               return $texte;
+       }
+
+       if ($local_barre_typo_pas_de_fausses_puces === null) {
+               // remplace les fausses listes a puce par de vraies ?
+               // (recherche en debut de lignes - suivi d'un ou plusieurs caracteres blancs, en mode multiligne)
+               // Mettre $GLOBALS['barre_typo_pas_de_fausses_puces'] = true; dans mes_options.php pour avoir ce comportement
+               if (isset($GLOBALS['barre_typo_pas_de_fausses_puces'])) {
+                       $local_barre_typo_pas_de_fausses_puces = $GLOBALS['barre_typo_pas_de_fausses_puces'];
+               } else {
+                       if (function_exists('lire_config')) {
+                               $local_barre_typo_pas_de_fausses_puces = (lire_config('bte/puces', 'Non') == 'Oui') ? true : false;
+                       }
+               }
+       }
+
+       if ($local_barre_typo_pas_de_fausses_puces === true) {
+               $texte =  preg_replace('/^-\s+/m', '-* ', $texte);
+       }
+
+       $texte = str_replace('<--', '&larr;', $texte);
+       $texte = str_replace('<==>', '&hArr;', $texte);
+       $texte = str_replace('==>', '&rArr;', $texte);
+       $texte = str_replace('<==', '&lArr;', $texte);
+       $texte = str_ireplace('(c)', '&copy;', $texte);
+       $texte = str_ireplace('(r)', '&reg;', $texte);
+       $texte = str_ireplace('(tm)', '&trade;', $texte);
+       $texte = str_replace('...', '&hellip;', $texte);
+
+       global $debut_italique, $fin_italique,$class_spip;
+       /*
+               Cas particulier pour le gras
+               Il ne faut pas traiter la mise en gras ici si le texte contient un tableau
+       */
+       if (!preg_match(',.(\|([[:space:]]*{{[^}]+}}[[:space:]]*|<))+.,sS', $texte)) {
+               $chercher_raccourcisg = array(
+                       /* 7 */         '/(?<![{])[{][{](?![{])/S', // Expressions complexes car on n'a pas encore traite les titres ici
+                       /* 8 */         '/(?<![}])[}][}](?![}])/S' // En gros, verification qu'on n'est pas a l'interieur d'un titre
+               );
+               $remplacer_raccourcisg = array(
+                       /* 7 */         "<strong$class_spip>",
+                       /* 8 */         '</strong>'
+               );
+               $texte = preg_replace($chercher_raccourcisg, $remplacer_raccourcisg, $texte);
+       }
+
+
+       /**
+        * Remplacer les { ... } par <i> </i>
+        * On passe après les gras pour que la regexp ne matche pas {{ ... }}
+        */
+       tester_variable('debut_italique', "<i$class_spip>");
+       tester_variable('fin_italique', '</i>');
+       $chercher_raccourcis = array(
+               /* 9 */         '/(?<![{])[{](?![{])/S', // Expressions complexes car on n'a pas encore traite les titres ici
+               /* 10 */        '/(?<![}])[}](?![}])/S' // En gros, verification qu'on n'est pas a l'interieur d'un titre
+       );
+       $remplacer_raccourcis = array(
+               /* 9 */         $debut_italique,
+               /* 10 */        $fin_italique,
+       );
+       $texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte);
+
+       return $texte;
+}
+
+function typoenluminee_post_typo($texte) {
+       if (!$texte) {
+               return $texte;
+       }
+       if (!isset($GLOBALS['barre_typo_pas_de_fork_typo']) or $GLOBALS['barre_typo_pas_de_fork_typo'] === true) {
+               return $texte;
+       }
+       $texte = str_replace('[^', '<sup>', $texte);
+       $texte = str_replace('^]', '</sup>', $texte);
+       $texte = str_replace('[**', '<strong class="caractencadre2-spip spip">', $texte);
+       $texte = str_replace('[*', '<strong class="caractencadre-spip spip">', $texte);
+       $texte = str_replace('*]', '</strong>', $texte);
+
+       // Correction des & en &amp;
+       $texte = preg_replace('/&([A-Za-z#0-9]*);/', '@@@amp:\1:amp@@@', $texte); // echapement des entites html deja presentes
+       $texte = str_replace('&', '&amp;', $texte);
+       $texte = preg_replace('/@@@amp:([A-Za-z#0-9]*):amp@@@/', '&\1;', $texte);
+       // Raccourci typographique <sc></sc>
+       $texte = str_replace('<sc>', '<span class="caps">', $texte);
+       $texte = str_replace('</sc>', '</span>', $texte);
+       $texte = acronymes_traiter_raccourcis($texte);
+       return $texte;
+}
+
+function typoenluminee_nettoyer_raccourcis_typo($texte) {
+       $texte = preg_replace(',\{[1-5]\{,', '', $texte);
+       $texte = preg_replace(',\}[1-5]\},', '', $texte);
+       $texte = preg_replace(',\{\{\{\*+,', '{{{', $texte);
+       $texte = str_replace('&hellip;', '...', $texte);
+       return $texte;
+}
+
+// traite les raccourcis de la forme [SNCF|societe nationale...]
+// reprise du plugin acronymes
+if (!function_exists('acronymes_traiter_raccourcis')) {
+       function acronymes_traiter_raccourcis($letexte) {
+               $pattern = '{\[([^\|\]-]+)\|([^\|\]-]+)\]}';
+               if (preg_match_all($pattern, $letexte, $tagMatches, PREG_SET_ORDER)) {
+                       $textMatches = preg_split($pattern, $letexte);
+
+                       $tag_attr=array();
+                       foreach ($tagMatches as $key => $value) {
+                               $tag_attr[] = "<acronym title='".texte_backend($value[2])."'>".$value[1].'</acronym>';
+                       }
+                       for ($i = 0; $i < count($tag_attr); $i ++) {
+                               $textMatches [$i] = $textMatches [$i] . $tag_attr [$i];
+                       }
+                       return implode('', $textMatches);
+               } else {
+                       return $letexte;
+               }
+       }
+}
diff --git a/www/plugins/enluminures_typographiques_v3/typoenluminee_administrations.php b/www/plugins/enluminures_typographiques_v3/typoenluminee_administrations.php
new file mode 100644 (file)
index 0000000..2cc27c8
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Fonction d'installation et MAJ plugin
+ *
+ * @param string $nom_meta_base_version
+ *     Nom de la meta d'installation du plugin
+ * @param float $version_cible
+ *     Version vers laquelle mettre à jour
+ */
+function typoenluminee_upgrade($nom_meta_base_version, $version_cible) {
+       $maj = array();
+
+       $maj['create'] = array(
+               array('maj_titres_enlumines',array())
+       );
+
+       include_spip('base/upgrade');
+       maj_plugin($nom_meta_base_version, $version_cible, $maj);
+}
+
+/**
+ * Abandon de l'ancienne écriture des intertitres
+ *
+ * {1{...}1} {2{...}2} {3{...}3} {4{...}4} {5{...}5} en intertitres avec étoiles :
+ * {{{...}}} {{{**...}}} {{{***...}}} {{{****...}}} {{{*****...}}}
+ *
+ */
+function maj_titres_enlumines() {
+       $anciens_titres = sql_allfetsel('id_article, texte', 'spip_articles', 'texte LIKE "%{1{%" OR texte LIKE "%{2{%" OR texte LIKE "%{3{%" OR texte LIKE "%{4{%" OR texte LIKE "%{5{%"');
+       foreach ($anciens_titres as $cle => $article) {
+               $id_article = $article['id_article'];
+               $article['texte'] = preg_replace('/({1{)(.*)(}1})/Uims', '{{{\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({2{)(.*)(}2})/Uims', '{{{**\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({3{)(.*)(}3})/Uims', '{{{***\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({4{)(.*)(}4})/Uims', '{{{****\\2}}}', $article['texte']);
+               $article['texte'] = preg_replace('/({5{)(.*)(}5})/Uims', '{{{*****\\2}}}', $article['texte']);
+               $article['texte'] = trim($article['texte']);
+               sql_updateq('spip_articles', array('texte' => $article['texte']), 'id_article='.intval($article['id_article']));
+               if (time() >= _TIME_OUT) {
+                       return;
+               }
+       }
+}
+
+
+/**
+ * Desinstallation
+ *
+ * @param string $nom_meta_base_version
+ */
+function typoenluminee_vider_tables($nom_meta_base_version) {
+       include_spip('inc/meta');
+       effacer_meta($nom_meta_base_version);
+}
index 9f2dce0..57b58e0 100644 (file)
@@ -1,11 +1,17 @@
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-// autoriser les tag <b>, <i>, <em>, <sc> et <br />\r
-// dans le nom/signature d'un auteur.\r
-// par défaut, <multi> est toujours autorisé.\r
-// Cf : http://www.spip.net/fr_article5666.html\r
-// Cf : http://core.spip.org/projects/spip/repository/revisions/21016 à 21018\r
-if (!defined('_TAGS_NOM_AUTEUR'))  define('_TAGS_NOM_AUTEUR', 'b, i, em, sc, br');\r
-\r
-?>
\ No newline at end of file
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Autoriser les tag <b>, <i>, <em>, <sc> et <br />
+ * dans le nom/signature d'un auteur.
+ *
+ * Par defaut, <multi> est toujours autorise.
+ * Cf : http://www.spip.net/fr_article5666.html
+ * Cf : http://core.spip.org/projects/spip/repository/revisions/21016 a 21018
+ */
+if (!defined('_TAGS_NOM_AUTEUR')) {
+       define('_TAGS_NOM_AUTEUR', 'b, i, em, sc, br');
+}
index cac292e..249ed26 100644 (file)
@@ -1,30 +1,33 @@
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-// insert le css pour les styles supplementaires de la BTE dans le <head> du document (#INSERT_HEAD)\r
-function TypoEnluminee_insert_head_css($flux) {\r
-       static $done = false;\r
-       if (!$done) {\r
-               $done = true;\r
-               if (isset($GLOBALS['BarreTypoEnrichie_Preserve_Header']) OR !function_exists('lire_config'))\r
-                       global $BarreTypoEnrichie_Preserve_Header;\r
-               else\r
-                       $BarreTypoEnrichie_Preserve_Header = lire_config('bte/insertcss','Oui');\r
-               if ($BarreTypoEnrichie_Preserve_Header == 'Oui')\r
-                       $flux .= "\n".'<link rel="stylesheet" href="'.find_in_path('css/enluminurestypo.css').'" type="text/css" media="all" />';\r
-       }\r
-       return $flux;\r
-}\r
-\r
-// insert le css pour les styles supplementaires de la BTE dans le <head> du document (#INSERT_HEAD)\r
-function TypoEnluminee_insert_head($flux) {\r
-       $flux = TypoEnluminee_insert_head_css($flux);\r
-       return $flux;\r
-}\r
-function TypoEnluminee_header_prive($texte) {\r
-       $texte.= '<link rel="stylesheet" type="text/css" href="' . _DIR_PLUGIN_TYPOENLUMINEE . 'css/enluminurestypo.css" />' . "\n";\r
-       $texte.= '<link rel="stylesheet" type="text/css" href="' . _DIR_PLUGIN_TYPOENLUMINEE . 'css/enluminurestypo_prive.css" />' . "\n";\r
-       return $texte;\r
-}\r
-\r
-?>
\ No newline at end of file
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+// insert le css pour les styles supplementaires de la BTE dans le <head> du document (#INSERT_HEAD)
+function TypoEnluminee_insert_head_css($flux) {
+       static $done = false;
+       if (!$done) {
+               $done = true;
+               if (isset($GLOBALS['BarreTypoEnrichie_Preserve_Header']) or !function_exists('lire_config')) {
+                       global $BarreTypoEnrichie_Preserve_Header;
+               } else {
+                       $BarreTypoEnrichie_Preserve_Header = lire_config('bte/insertcss', 'Oui');
+               }
+               if ($BarreTypoEnrichie_Preserve_Header == 'Oui') {
+                       $flux .= "\n".'<link rel="stylesheet" href="'.find_in_path('css/enluminurestypo.css').'" type="text/css" media="all" />';
+               }
+       }
+       return $flux;
+}
+
+// insert le css pour les styles supplementaires de la BTE dans le <head> du document (#INSERT_HEAD)
+function TypoEnluminee_insert_head($flux) {
+       $flux = TypoEnluminee_insert_head_css($flux);
+       return $flux;
+}
+function TypoEnluminee_header_prive($texte) {
+       $texte.= '<link rel="stylesheet" type="text/css" href="' . _DIR_PLUGIN_TYPOENLUMINEE . 'css/enluminurestypo.css" />' . "\n";
+       $texte.= '<link rel="stylesheet" type="text/css" href="' . _DIR_PLUGIN_TYPOENLUMINEE . 'css/enluminurestypo_prive.css" />' . "\n";
+       return $texte;
+}
index daedf1e..5a8decd 100755 (executable)
@@ -19,7 +19,28 @@ if (!class_exists('PHPMailer')) {
 \r
 include_spip('facteur_fonctions');\r
 \r
+/**\r
+ * Wrapper de spip_log pour par PHPMailer\r
+ * @param $message\r
+ * @param $level\r
+ */\r
+function facteur_log_debug($message,$level){\r
+       spip_log("$level: ".trim($message),"facteur"._LOG_DEBUG);\r
+}\r
+\r
+\r
 class Facteur extends PHPMailer {\r
+       /**\r
+        * From force si From pas dans le bon domaine\r
+        * @var string\r
+        */\r
+       public $ForceFrom = '';\r
+\r
+       /**\r
+        * FromName force si From pas dans le bon domaine\r
+        * @var string\r
+        */\r
+       public $ForceFromName = '';\r
 \r
        /**\r
         * @param $email\r
@@ -29,44 +50,65 @@ class Facteur extends PHPMailer {
         * @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
+       public function __construct($email, $objet, $message_html, $message_texte, $options = array()) {\r
+               // On récupère toutes les options par défaut depuis le formulaire de config\r
+               $defaut = array();\r
+               foreach (array(\r
+                       'adresse_envoi', 'adresse_envoi_email', 'adresse_envoi_nom', 'forcer_from',\r
+                       'cc', 'bcc',\r
+                       'smtp', 'smtp_host', 'smtp_port', 'smtp_auth',\r
+                       'smtp_username', 'smtp_password', 'smtp_secure', 'smtp_sender',\r
+                       'filtre_images', 'filtre_iso_8859',\r
+               ) as $config) {\r
+                       $defaut[$config] = isset($GLOBALS['meta']["facteur_$config"]) ? $GLOBALS['meta']["facteur_$config"] : '';\r
+               }\r
+               // On fusionne les options avec d'éventuelles surcharges lors de l'appel\r
                $options = array_merge($defaut, $options);\r
 \r
+               // par defaut on log rien car tres verbeux\r
+               // on utilise facteur_log_debug qui filtre log SPIP en _LOG_DEBUG\r
+               $this->SMTPDebug = 0;\r
+               $this->Debugoutput = "facteur_log_debug";\r
+               // Il est possible d'avoir beaucoup plus de logs avec 2, 3 ou 4, ce qui logs les échanges complets avec le serveur\r
+               // utiliser avec un define('_MAX_LOG',1000); car sinon on est limite a 100 lignes par hit et phpMailer est tres verbeux\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->exceptions = false;\r
+\r
+\r
+               if (\r
+                       $options['adresse_envoi'] == 'oui'\r
+                       and $options['adresse_envoi_email']\r
+               ) {\r
                        $this->From = $options['adresse_envoi_email'];\r
-               else\r
-                       $this->From = (isset($GLOBALS['meta']["email_envoi"]) AND $GLOBALS['meta']["email_envoi"])?\r
+               }\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
+                               : $GLOBALS['meta']['email_webmaster'];\r
+               }\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
+               if (strpos($this->From,",") === false) {\r
+                       if (\r
+                               $options['adresse_envoi'] == 'oui'\r
+                               and $options['adresse_envoi_nom']\r
+                       ) {\r
                                $this->FromName = $options['adresse_envoi_nom'];\r
-                       else\r
+                       }\r
+                       // Par défaut, l'envoyeur est le nom du site\r
+                       else {\r
                                $this->FromName = strip_tags(extraire_multi($GLOBALS['meta']['nom_site']));\r
+                       }\r
+               }\r
+\r
+               // si forcer_from, on sauvegarde le From et FromName par defaut, qui seront utilises\r
+               // si From n'est pas dans le meme domaine\r
+               // (utiliser le facteur avec un service externe qui necessite la validation des domaines d'envoi)\r
+               if ($options['forcer_from']=='oui'){\r
+                       $this->ForceFrom = $this->From;\r
+                       $this->ForceFromName = $this->FromName;\r
                }\r
 \r
                $this->CharSet = "utf-8";\r
@@ -76,32 +118,38 @@ class Facteur extends PHPMailer {
                //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
+                               if (!$this->AddAddress($adresseMail)) {\r
+                                       spip_log("Erreur AddAddress $adresseMail : ".print_r($this->ErrorInfo, true), 'facteur.'._LOG_ERREUR);\r
+                               }\r
                        }\r
                }\r
-               else\r
-                       if (!$this->AddAddress($email))\r
-                               spip_log("Erreur AddAddress $email : ".print_r($this->ErrorInfo,true),'facteur');\r
+               elseif (!$this->AddAddress($email)) {\r
+                       spip_log("Erreur AddAddress $email : ".print_r($this->ErrorInfo, true), 'facteur.'._LOG_ERREUR);\r
+               }\r
 \r
+               // Retour des erreurs\r
                if (!empty($options['smtp_sender'])) {\r
                        $this->Sender = $options['smtp_sender'];\r
                        $this->AddCustomHeader("Errors-To: ".$this->Sender);\r
                }\r
 \r
+               // Destinataires en copie, seulement s'il n'y a pas de destinataire de test\r
                if (!defined('_TEST_EMAIL_DEST')){\r
                        if (!empty($options['cc'])) {\r
-                               $this->AddCC( $options['cc'] );\r
+                               $this->AddCC($options['cc']);\r
                        }\r
                        if (!empty($options['bcc'])) {\r
-                               $this->AddBCC( $options['bcc'] );\r
+                               $this->AddBCC($options['bcc']);\r
                        }\r
                }\r
 \r
+               // Si on envoie avec un SMTP explicite\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
+\r
+                       // SMTP authentifié\r
                        if ($options['smtp_auth'] == 'oui') {\r
                                $this->SMTPAuth = true;\r
                                $this->Username = $options['smtp_username'];\r
@@ -110,55 +158,85 @@ class Facteur extends PHPMailer {
                        else {\r
                                $this->SMTPAuth = false;\r
                        }\r
-                       if (intval(phpversion()) == 5) {\r
-                       if ($options['smtp_secure'] == 'ssl')\r
+\r
+                       if ($options['smtp_secure'] == 'ssl') {\r
                                $this->SMTPSecure = 'ssl';\r
-                       if ($options['smtp_secure'] == 'tls')\r
+                       }\r
+                       if ($options['smtp_secure'] == 'tls') {\r
                                $this->SMTPSecure = 'tls';\r
                        }\r
+\r
+                       // Pour le moment on remet l'ancien fonctionnement :\r
+                       // on ne doit pas tester les certificats si pas demandé explicitement avec l'option TLS !\r
+                       $this->SMTPAutoTLS = false;\r
                }\r
 \r
+               // S'il y a un contenu HTML\r
                if (!empty($message_html)) {\r
-                       $message_html = unicode_to_utf_8(charset2unicode($message_html,$GLOBALS['meta']['charset']));\r
+                       $message_html = unicode_to_utf_8(charset2unicode($message_html, $GLOBALS['meta']['charset']));\r
+\r
                        $this->Body = $message_html;\r
                        $this->IsHTML(true);\r
-                       if ($options['filtre_images'])\r
+                       if ($options['filtre_images']) {\r
                                $this->JoindreImagesHTML();\r
+                       }\r
+\r
                        $this->UrlsAbsolues();\r
                }\r
+\r
+               // S'il y a un contenu texte brut\r
                if (!empty($message_texte)) {\r
-                       $message_texte = unicode_to_utf_8(charset2unicode($message_texte,$GLOBALS['meta']['charset']));\r
+                       $message_texte = unicode_to_utf_8(charset2unicode($message_texte, $GLOBALS['meta']['charset']));\r
+\r
+                       // Si pas de HTML on le remplace en tant que contenu principal\r
                        if (!$this->Body) {\r
                                $this->IsHTML(false);\r
                                $this->Body = $message_texte;\r
                        }\r
+                       // Sinon on met le texte brut en contenu alternatif\r
                        else {\r
                                $this->AltBody = $message_texte;\r
                        }\r
                }\r
 \r
-               if ($options['filtre_iso_8859'])\r
+               if ($options['filtre_iso_8859']) {\r
                        $this->ConvertirUtf8VersIso8859();\r
+               }\r
+       }\r
 \r
+       /**\r
+        * @param bool $exceptions\r
+        */\r
+       public function SetExceptions($exceptions){\r
+               $this->exceptions = ($exceptions?true:false);\r
        }\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
+        * @param bool $advanced Inutilisé\r
         * @return string Retourne un texte brut formaté correctement\r
         */\r
-       function html2text($html){\r
+       public function html2text($html, $advanced = false){\r
                return facteur_mail_html2text($html);\r
        }\r
-       \r
+\r
+       /**\r
+        * Compat ascendante, obsolete\r
+        * @deprecated\r
+        */\r
+       public function ConvertirStylesEnligne() {\r
+               $this->Body = facteur_convertir_styles_inline($this->Body);\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
+       protected 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
@@ -182,7 +260,10 @@ class Facteur extends PHPMailer {
                }\r
        }\r
 \r
-       function JoindreImagesHTML() {\r
+       /**\r
+        * Embed les images HTML dans l'email\r
+        */\r
+       protected function JoindreImagesHTML() {\r
                $image_types = array(\r
                                                        'gif'   => 'image/gif',\r
                                                        'jpg'   => 'image/jpeg',\r
@@ -202,6 +283,7 @@ class Facteur extends PHPMailer {
 \r
                        $adresse_site = $GLOBALS['meta']['adresse_site'].'/';\r
                        foreach($images as $im){\r
+                               $im = array_pad($im, 6, null);\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
@@ -234,14 +316,12 @@ class Facteur extends PHPMailer {
 \r
 \r
        /**\r
-        * Compat ascendante, obsolete\r
+        * Conversion safe d'un texte utf en isotruc\r
+        * @param string $text\r
+        * @param string $mode\r
+        * @return string\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
+       protected function safe_utf8_decode($text,$mode='texte_brut') {\r
                if (!is_utf8($text))\r
                        return ($text);\r
 \r
@@ -259,7 +339,10 @@ class Facteur extends PHPMailer {
                }\r
        }\r
 \r
-       function ConvertirUtf8VersIso8859() {\r
+       /**\r
+        * Convertir tout le mail utf en isotruc\r
+        */\r
+       protected 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
@@ -268,7 +351,10 @@ class Facteur extends PHPMailer {
                $this->FromName = $this->safe_utf8_decode($this->FromName);\r
        }\r
 \r
-       function ConvertirAccents() {\r
+       /**\r
+        * Convertir les accents du body en entites html\r
+        */\r
+       protected function ConvertirAccents() {\r
                // tableau à compléter au fur et à mesure\r
                $cor = array(\r
                                                'à' => '&agrave;',\r
@@ -292,56 +378,79 @@ class Facteur extends PHPMailer {
 \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
+\r
+       /**\r
+        * Une fonction wrapper pour appeler une methode de phpMailer\r
+        * en recuperant l'erreur eventuelle, en la loguant via SPIP et en lancant une exception si demandee\r
+        * @param string $function\r
+        * @param array $args\r
+        * @return bool\r
+        * @throws phpmailerException\r
+        */\r
+       protected function callWrapper($function,$args){\r
+               $exceptions = $this->exceptions;\r
+               $this->exceptions = true;\r
+               try {\r
+                       $retour = call_user_func_array($function,$args);\r
+                       $this->exceptions = $exceptions;\r
                }\r
+               catch (phpmailerException $exc) {\r
+                       spip_log((is_array($function)?implode('::',$function):$function)."() : ".$exc->getMessage(),'facteur.'._LOG_ERREUR);\r
+                       $this->exceptions = $exceptions;\r
+                       if ($this->exceptions) {\r
+                               throw $exc;\r
+                       }\r
+                       return false;\r
+               }\r
+               if ($this->ErrorInfo){\r
+                       spip_log($function."() : ".$this->ErrorInfo,'facteur.'._LOG_ERREUR);\r
+               }\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
+       /*\r
+        * Appel des fonctions parents via le callWrapper qui se charge de loger les erreurs\r
+        */\r
+\r
+       /**\r
+        * Avant le Send() on force le From si besoin\r
+        * @return bool\r
+        * @throws phpmailerException\r
+        */\r
+       public function Send() {\r
+               if ($this->ForceFrom\r
+                       AND $this->From!==$this->ForceFrom){\r
+                       $forcedomain = explode('@',$this->ForceFrom);\r
+                       $forcedomain = end($forcedomain);\r
+                       $domain = explode('@',$this->From);\r
+                       $domain = end($domain);\r
+                       if ($domain!==$forcedomain){\r
+                               // le From passe en ReplyTo\r
+                               $this->AddReplyTo($this->From,$this->FromName);\r
+                               // on force le From\r
+                               $this->From = $this->ForceFrom;\r
+                               $this->FromName = $this->ForceFromName;\r
+                       }\r
                }\r
-               return $retour;\r
+               $args = func_get_args();\r
+               return $this->callWrapper(array('parent','Send'),$args);\r
+       }\r
+       public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') {\r
+               $args = func_get_args();\r
+               return $this->callWrapper(array('parent','AddAttachment'),$args);\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
+               $args = func_get_args();\r
+               return $this->callWrapper(array('parent','AddReplyTo'),$args);\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
+               $args = func_get_args();\r
+               return $this->callWrapper(array('parent','AddBCC'),$args);\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
+               $args = func_get_args();\r
+               return $this->callWrapper(array('parent','AddCC'),$args);\r
        }\r
 }\r
-\r
-?>\r
index 481b417..75760b2 100755 (executable)
@@ -1,28 +1,27 @@
 #HTTP_HEADER{Content-Type:text/html}
-#INCLURE{fond=emails/inc-haut}
+<body>
+       <h2><:facteur:corps_email_de_test:></h2>
 
-<h2><:facteur:corps_email_de_test:></h2>
+       <p><:facteur:version_html:></p>
 
-<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_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_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
+       <BOUCLE_pdf(DOCUMENTS){extension=pdf}{0,1}>
+               [(#MODELE{doc}|image_reduire{550,0})]
+       </BOUCLE_pdf>
+</body>
+#FILTRE{facteur_email_wrap_to_html}
index 3ae51b6..d169454 100644 (file)
        </style>
 </head>
 <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"
-                       style="margin: 0;padding: 0;width: 100% !important;">
+                       style="margin: 0;padding: 0;width: 100% !important;background-color: #DDDDDD;">
 <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;">
+                                style="margin: 0;padding: 0;height: 100% !important;width: 100% !important;background-color: #DDDDDD;">
                <tr>
                        <td align="center" valign="top">
                                <!-- // End Template Preheader \\ -->
index 7eb2087..54a2d25 100755 (executable)
@@ -8,6 +8,19 @@
 
 if (!defined("_ECRIRE_INC_VERSION")) return;
 
+function facteur_affiche_password_masque($pass){
+       $l = strlen($pass);
+       if ($l<=8){
+               return str_pad('',$l,'*');
+       }
+       $e = intval(ceil($l/10));
+       $mid = str_pad('',$l-2*$e,'*');
+       if (strlen($mid)>8){
+               $mid = '***...***';
+       }
+       return substr($pass,0,$e) . $mid . substr($pass,-$e);
+}
+
 /**
  * Transformer un mail texte ou HTML simplifie en mail HTML complet avec le wrapper emails/texte.html
  * Si le mail est un mail texte :
@@ -283,12 +296,15 @@ function facteur_addstyle($matches) {
  * @return string
  */
 function facteur_nl2br_si_pas_autobr($texte){
-       return (_AUTOBR?$texte:nl2br($texte));
+       if (_AUTOBR) return $texte;
+       include_spip("inc/filtres");
+       $texte = post_autobr($texte);
+       return $texte;
 }
 
 /**
  * Transformer un mail HTML en mail Texte proprement :
- * - les tableaux de mise en page sont utilisés pour structurer le mail texte
+ * - les tableaux de mise en page sont utiliss pour structurer le mail texte
  * - le reste du HTML est markdownifie car c'est un format texte lisible et conventionnel
  *
  * @param string $html
index 2bdbdce..9c45c19 100644 (file)
@@ -20,8 +20,8 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return array $flux
  *             Le contexte du pipeline modifé
  */
-function facteur_recuperer_fond($flux){
-       if(($flux['args']['fond'] == 'formulaires/configurer_identite')
+function facteur_formulaire_fond($flux){
+       if(($flux['args']['form'] == '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>';
index 6f7122b..08c19cf 100644 (file)
@@ -2,21 +2,21 @@
        [<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)
+       [(#ENV{tester,''}|et{#ENV*{message_erreur}|non})
        <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>
+               <ul class="editer-groupe">
                        <li class="fieldset">
                                <fieldset>
                                        <legend><:facteur:configuration_adresse_envoi:></legend>
-                                       <ul>
+                                       <ul class="editer-groupe">
                                                <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>
+                                                               <label for="facteur_adresse_envoi_non"><:facteur:utiliser_reglages_site{from=#ENV{_from_defaut}}:></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"]/>
                                                        <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>
+                                               #SET{name,facteur_forcer_from}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                       ]
+                                                       <div class="choix">
+                                                               #SET{val,non}
+                                                               <input type="hidden" name="#GET{name}" value="#GET{val}" />
+                                                               #SET{val,oui}
+                                                               <input type="checkbox" name="#GET{name}" class="checkbox" id="#GET{name}_#GET{val}" value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)checked="checked"] />
+                                                               <label for="#GET{name}_#GET{val}"><:facteur:label_facteur_forcer_from:></label>
+                                                       </div>
+                                               </li>
                                        </ul>
                                </fieldset>
                        </li>
                        <li class="fieldset">
                                <fieldset>
                                        <legend><:facteur:configuration_mailer:></legend>
-                                       <ul>
+                                       <ul class="editer-groupe">
                                                <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>
                                                                <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]">
+                                                       <ul class="editer-groupe" id="smtp-auth"[(#ENV{facteur_smtp_auth,'non'}|=={non}|oui)style='display:none;']>
+                                                               <li class="editer 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]">
+                                                               <li class="editer 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" />
+                                                                       <input type="password" name="facteur_smtp_password" class="text" value="#ENV**{facteur_smtp_password}" id="facteur_smtp_password"
+                                                                       [placeholder="(#ENV**{_facteur_smtp_password}|facteur_affiche_password_masque|attribut_html)"] />
                                                                </li>
                                                        </ul>
                                                </li>
                                                                <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>
+                                                       <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>
                                                </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>[
                        <li class="fieldset">
                                <fieldset>
                                        <legend><:facteur:facteur_filtres:></legend>
-                                       <ul>
+                                       <ul class="editer-groupe">
                                                <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>
                        <li class="fieldset">
                                <fieldset>
                                        <legend><:facteur:facteur_copies:></legend>
-                                       <ul>
+                                       <ul class="editer-groupe">
                                                <li class="editer editer_facteur_copies editer_facteur_desc">
                                                        <p class="explication"><:facteur:facteur_copies_descriptif:></p>
                                                </li>
                <p class="boutons">
                        <input type="submit" name="valider" class="submit" value="<:bouton_valider:>" />
                </p>
-               <ul>
+               <ul class="editer-groupe">
                        <li class="fieldset">
                                <fieldset>
                                        <h3 class="legend"><:facteur:tester_la_configuration:></h3>
-                                       <ul>
-                                               <li>
-                                               <p class="explication"><:facteur:note_test_configuration:></p>  
+                                       <ul class="editer-groupe">
+                                               #SET{name,email_test}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                       <label for="#GET{name}"><:facteur:facteur_email_test:></label>[
+                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                       ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                       <p class="explication"><:facteur:note_test_configuration:></p>
                                                </li>
                                        </ul>
                                </fieldset>
index 0aa321b..aa46e78 100644 (file)
@@ -9,31 +9,44 @@
 if (!defined("_ECRIRE_INC_VERSION")) return;\r
 \r
 function formulaires_configurer_facteur_charger_dist(){\r
+       include_spip('inc/config');\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
+               'facteur_adresse_envoi'       => lire_config('facteur_adresse_envoi'),\r
+               'facteur_adresse_envoi_nom'   => lire_config('facteur_adresse_envoi_nom'),\r
+               'facteur_adresse_envoi_email' => lire_config('facteur_adresse_envoi_email'),\r
+               'facteur_forcer_from'         => lire_config('facteur_forcer_from'),\r
+               'facteur_smtp'                => lire_config('facteur_smtp'),\r
+               'facteur_smtp_host'           => lire_config('facteur_smtp_host'),\r
+               'facteur_smtp_port'           => lire_config('facteur_smtp_port', 25),\r
+               'facteur_smtp_auth'           => lire_config('facteur_smtp_auth'),\r
+               'facteur_smtp_username'       => lire_config('facteur_smtp_username'),\r
+               'facteur_smtp_password'       => '',\r
+               '_facteur_smtp_password'       => lire_config('facteur_smtp_password'),\r
+               'facteur_smtp_secure'         => lire_config('facteur_smtp_secure'),\r
+               'facteur_smtp_sender'         => lire_config('facteur_smtp_sender'),\r
+               'facteur_filtre_images'       => lire_config('facteur_filtre_images'),\r
+               'facteur_filtre_iso_8859'     => lire_config('facteur_filtre_iso_8859'),\r
+               'facteur_cc'                  => lire_config('facteur_cc'),\r
+               'facteur_bcc'                 => lire_config('facteur_bcc'),\r
+               '_enable_smtp_secure'         => (intval(phpversion()) == 5)?' ':'',\r
+               'email_test'                  => lire_config('facteur_adresse_envoi')=='oui'?lire_config('facteur_adresse_envoi_email'):$GLOBALS['meta']['email_webmaster'],\r
+               'tester'                      => '',\r
        );\r
 \r
+       // recuperer le from par defaut actuel pour l'indiquer dans le formulaire\r
+       include_spip('classes/facteur');\r
+       $facteur = new Facteur('test@example.org','Test','','',array('adresse_envoi'=>'non'));\r
+       $valeurs['_from_defaut'] = $facteur->From;\r
+       if ($facteur->FromName){\r
+               $valeurs['_from_defaut'] = $facteur->FromName . ' &lt;'.$valeurs['_from_defaut'].'&gt;';\r
+       }\r
+\r
        return $valeurs;\r
 }\r
 \r
 function formulaires_configurer_facteur_verifier_dist(){\r
        $erreurs = array();\r
+       include_spip('inc/config');\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
@@ -43,17 +56,19 @@ function formulaires_configurer_facteur_verifier_dist(){
                if (!($h=_request('facteur_smtp_host')))\r
                        $erreurs['facteur_smtp_host'] = _T('info_obligatoire');\r
                else {\r
+                       $h = trim($h);\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
+                               if(!preg_match(';^([^.\s/?:]+[.])*[^.\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
+                                       $erreurs['facteur_smtp_host'] = _T('facteur:erreur_invalid_host');\r
                        }\r
+                       set_request('facteur_smtp_host',$h);\r
                }\r
                if (!($p=_request('facteur_smtp_port')))\r
                        $erreurs['facteur_smtp_port'] = _T('info_obligatoire');\r
@@ -66,7 +81,7 @@ function formulaires_configurer_facteur_verifier_dist(){
                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
+                       if (!_request('facteur_smtp_password') AND !lire_config('facteur_smtp_password'))\r
                                $erreurs['facteur_smtp_password'] = _T('info_obligatoire');\r
                }\r
        }\r
@@ -78,6 +93,16 @@ function formulaires_configurer_facteur_verifier_dist(){
          AND !email_valide($emailbcc)) {\r
                $erreurs['facteur_bcc'] = _T('form_email_non_valide');\r
        }\r
+\r
+       if (_request('tester')){\r
+               if (!$email = _request('email_test')){\r
+                       $erreurs['email_test'] = _T('info_obligatoire');\r
+               }\r
+               elseif (!email_valide($email)) {\r
+                       $erreurs['email_test'] = _T('form_email_non_valide');\r
+               }\r
+       }\r
+\r
        \r
        if(count($erreurs)>0){\r
                $erreurs['message_erreur'] = _T('facteur:erreur_generale');\r
@@ -97,6 +122,9 @@ function formulaires_configurer_facteur_traiter_dist(){
        $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_forcer_from = _request('facteur_forcer_from');\r
+       ecrire_meta('facteur_forcer_from', ($facteur_forcer_from=='oui')?'oui':'non');\r
+\r
        $facteur_smtp = _request('facteur_smtp');\r
        ecrire_meta('facteur_smtp', ($facteur_smtp=='oui')?'oui':'non');\r
 \r
@@ -112,8 +140,9 @@ function formulaires_configurer_facteur_traiter_dist(){
        $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
+       if ($facteur_smtp_password = _request('facteur_smtp_password')) {\r
+               ecrire_meta('facteur_smtp_password', $facteur_smtp_password);\r
+       }\r
 \r
        if (intval(phpversion()) == 5) {\r
                $facteur_smtp_secure = _request('facteur_smtp_secure');\r
@@ -137,35 +166,54 @@ function formulaires_configurer_facteur_traiter_dist(){
 \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
+               $res = array();\r
+               $destinataire = _request('email_test');\r
+               $err = facteur_envoyer_mail_test($destinataire,_T('facteur:corps_email_de_test'));\r
+               if ($err) {\r
+                       $res['message_erreur'] = $err;\r
                }\r
                else {\r
-                       // erreur\r
-                       $res = array('message_erreur'=>_T('facteur:erreur')._T('facteur:erreur_dans_log'));\r
+                       $res['message_ok'] = _T('facteur:email_test_envoye');\r
                }\r
        }\r
        \r
        return $res;\r
 }\r
 \r
+/**\r
+ * Fonction pour tester un envoi de mail ver sun destinataire\r
+ * renvoie une erreur eventuelle ou rien si tout est OK\r
+ * @param string $destinataire\r
+ * @param string $titre\r
+ * @return string\r
+ *   message erreur ou vide si tout est OK\r
+ */\r
 function facteur_envoyer_mail_test($destinataire,$titre){\r
+\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
+       $corps = array(\r
+               'html' => $message_html,\r
+               'texte' => $message_texte,\r
+               'exceptions' => true,\r
+       );\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
+       try {\r
+               $retour = $envoyer_mail($destinataire, $titre, $corps);\r
+       }\r
+       catch (Exception $e) {\r
+               return $e->getMessage();\r
+       }\r
+\r
+       // si echec mais pas d'exception, on signale de regarder dans les logs\r
+       if (!$retour) {\r
+               return _T('facteur:erreur').' '._T('facteur:erreur_dans_log');\r
+       }\r
 \r
-       return $retour?true:false;\r
+       // tout est OK, pas d'erreur\r
+       return "";\r
 }\r
 ?>\r
index 66b28a0..d485eb2 100644 (file)
@@ -32,6 +32,7 @@ include_once _DIR_RESTREINT."inc/envoyer_mail.php";
  *       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
+ *     bool exceptions : lancer une exception en cas d'erreur (false par defaut)\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
@@ -39,20 +40,22 @@ include_once _DIR_RESTREINT."inc/envoyer_mail.php";
 function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers = "") {\r
        $message_html   = '';\r
        $message_texte  = '';\r
+       $nom_envoyeur = $cc = $bcc = $repondre_a = '';\r
+       $pieces_jointes = array();\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
+               $message_html   = isset($corps['html']) ? $corps['html'] : "";\r
+               $message_texte  = isset($corps['texte']) ? nettoyer_caracteres_mail($corps['texte']) : "";\r
+               $pieces_jointes = isset($corps['pieces_jointes']) ? $corps['pieces_jointes'] : array();\r
+               $nom_envoyeur   = isset($corps['nom_envoyeur']) ? $corps['nom_envoyeur'] : "";\r
+               $from = isset($corps['from']) ? $corps['from']: $from;\r
+               $cc   = isset($corps['cc']) ? $corps['cc'] : "";\r
+               $bcc  = isset($corps['bcc']) ? $corps['bcc'] : "";\r
+               $repondre_a = isset($corps['repondre_a']) ? $corps['repondre_a'] : "";\r
+               $adresse_erreur = isset($corps['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
                        $headers = array_filter($headers);\r
@@ -114,10 +117,20 @@ function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers =
                $message_texte = facteur_mail_html2text($message_html);\r
        }\r
 \r
+       $exceptions = false;\r
+       if (is_array($corps) AND isset($corps['exceptions'])){\r
+               $exceptions = $corps['exceptions'];\r
+       }\r
+       \r
        // mode TEST : forcer l'email\r
        if (defined('_TEST_EMAIL_DEST')) {\r
-               if (!_TEST_EMAIL_DEST)\r
+               if (!_TEST_EMAIL_DEST){\r
+                       spip_log($e="Envois bloques par la constante _TEST_EMAIL_DEST", 'mail.' . _LOG_ERREUR);\r
+                       if ($exceptions) {\r
+                               throw new Exception($e);\r
+                       }\r
                        return false;\r
+               }\r
                else\r
                        $destinataire = _TEST_EMAIL_DEST;\r
        }\r
@@ -126,28 +139,50 @@ function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers =
        // 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
-       // si aucun destinataire du courriel on renvoie false (eviter les warning PHP)\r
+       // si pas destinataire du courriel on renvoie false (eviter les warning PHP : ligne 464 de phpmailer-php5/class.phpmailer.php\r
+       // suppression des adresses de courriels invalides, si aucune valide, renvoyer false (eviter un warning PHP : ligne 464 de phpmailer-php5/class.phpmailer.php)\r
        if (is_array($destinataire))\r
                $destinataire = implode(", ",$destinataire);\r
 \r
-       if(strlen($destinataire) > 0)\r
+       if(strlen($destinataire) > 0){\r
                $destinataire = array_map('trim',explode(",",$destinataire));\r
+               foreach ($destinataire as $key => $value) {\r
+                       if(!email_valide($value))\r
+                               unset($destinataire[$key]);\r
+               }\r
+               if(count($destinataire) == 0) {\r
+                       spip_log($e="Aucune adresse email de destination valable pour l'envoi du courriel.", 'mail.' . _LOG_ERREUR);\r
+                       if ($exceptions) {\r
+                               throw new Exception($e);\r
+                       }\r
+                       return false;\r
+               }\r
+       }\r
        else {\r
-               spip_log("Aucune adresse email de destination valable pour l'envoi du courriel.", 'mail.' . _LOG_ERREUR);\r
+               spip_log($e="Aucune adresse email de destination valable pour l'envoi du courriel.", 'mail.' . _LOG_ERREUR);\r
+               if ($exceptions) {\r
+                       throw new Exception($e);\r
+               }\r
                return false;\r
        }\r
 \r
        // On crée l'objet Facteur (PHPMailer) pour le manipuler ensuite\r
        $facteur = new Facteur($destinataire, $sujet, $message_html, $message_texte);\r
+       if (is_array($corps) AND isset($corps['exceptions'])){\r
+               $facteur->SetExceptions($corps['exceptions']);\r
+       }\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.", 'mail.' . _LOG_ERREUR);\r
-                       $from = $destinataire;\r
+                       if(is_array($destinataire) && count($destinataire) > 0)\r
+                               $from = $destinataire[0];\r
+                       else\r
+                               $from = $destinataire;\r
                }\r
-       } \r
+       }\r
 \r
        // "Marie Toto <Marie@toto.com>"\r
        if (preg_match(",^([^<>\"]*)<([^<>\"]+)>$,i",$from,$m)){\r
@@ -234,14 +269,13 @@ function inc_envoyer_mail($destinataire, $sujet, $corps, $from = "", $headers =
        $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.' . _LOG_ERREUR);\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
+       if (!$retour){\r
+               spip_log("Erreur Envoi mail via Facteur : ".print_r($facteur->ErrorInfo,true),'mail.'._LOG_ERREUR);\r
+       }\r
 \r
        return $retour ;\r
 }\r
-\r
-?>\r
index ceab0c3..e9d736f 100644 (file)
@@ -1,31 +1,41 @@
 <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">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=de" total="52" traduits="43" relire="0" modifs="7" nouveaux="2" pourcent="82.69">
                <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">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=en" total="52" traduits="43" relire="0" modifs="7" nouveaux="2" pourcent="82.69">
                <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">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=es" total="52" traduits="43" relire="0" modifs="7" nouveaux="2" pourcent="82.69">
                <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="fa" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fa" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fa" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fa" total="52" traduits="41" relire="0" modifs="9" nouveaux="2" pourcent="78.85">
                <traducteur nom="Davood Hossein" lien="http://trad.spip.net/auteur/davood-hossein" />
        </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 code="fr" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fr" total="52" traduits="52" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fr_tu" total="50" traduits="50" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=fr_tu" total="52" traduits="41" relire="0" modifs="9" nouveaux="2" pourcent="78.85">
                <traducteur nom="Cerf" lien="http://trad.spip.net/auteur/cerf" />
        </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">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=it" total="52" traduits="40" relire="0" modifs="9" nouveaux="3" pourcent="76.92">
+               <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
+       </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=nl" total="52" traduits="52" 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">
+       <langue code="oc_ni_mis" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=oc_ni_mis" total="52" traduits="43" relire="0" modifs="7" nouveaux="2" pourcent="82.69">
+               <traducteur nom="sylvain" lien="http://trad.spip.net/auteur/sylvain" />
+       </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=pt_br" total="52" traduits="52" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="placido" lien="http://trad.spip.net/auteur/placido" />
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/facteur?lang_cible=sk" total="52" traduits="45" relire="0" modifs="6" nouveaux="1" pourcent="86.54">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
index 21158e7..41e17cf 100644 (file)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Absenderadresse einstellen', # MODIF
        'configuration_facteur' => 'Briefträger',
-       'configuration_mailer' => 'Konfiguration des Mailers',
+       'configuration_mailer' => 'Konfiguration des Mailers', # MODIF
        '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é',
@@ -30,7 +32,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'Name:',
        'facteur_bcc' => 'Blindkopie (BCC) :',
        'facteur_cc' => 'Kopie (CC) :',
-       'facteur_copies' => 'Kopien:',
+       'facteur_copies' => 'Kopien:', # MODIF
        '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.',
@@ -46,17 +48,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (obsolet)',
+       'facteur_smtp_secure_tls' => 'TLS (empfohlen)',
+       'facteur_smtp_sender' => 'Fehlercodes (optional)', # MODIF
+       '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.', # MODIF
        '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).',
+       'note_test_configuration' => 'Eine Mail wird an die Absendeadresse geschickt (oder an den Webmaster).', # MODIF
 
        // P
        'personnaliser' => 'Individuelle Einstellungen',
@@ -67,7 +69,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_reglages_site' => 'Einstellungen von SPIP verwenden: als Name wird die Bezeichnung der SPIP-Website verwendet und als Adresse die des Webmasters.', # MODIF
        'utiliser_smtp' => 'SMTP verwenden',
 
        // V
@@ -75,5 +77,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'HTML-Version.',
        'version_texte' => 'Textversion.'
 );
-
-?>
index 3c9c75a..172067f 100755 (executable)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Sender’s address configuration', # MODIF
        'configuration_facteur' => 'Postman',
-       'configuration_mailer' => 'Mailer’s configuration',
+       'configuration_mailer' => 'Mailer’s configuration', # MODIF
        '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',
@@ -30,7 +32,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'Name:',
        'facteur_bcc' => 'Blind Carbon Copy (BCC):',
        'facteur_cc' => 'Carbon Copy (CC):',
-       'facteur_copies' => 'Copies:',
+       'facteur_copies' => 'Copies:', # MODIF
        '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.',
@@ -46,17 +48,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (depreciated)',
+       'facteur_smtp_secure_tls' => 'TLS (recommended)',
+       'facteur_smtp_sender' => 'Return-Path (optional)', # MODIF
+       '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.', # MODIF
        '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".',
+       'note_test_configuration' => 'A test email will be sent to the "sender".', # MODIF
 
        // P
        'personnaliser' => 'Customize',
@@ -67,7 +69,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_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', # MODIF
        'utiliser_smtp' => 'Use SMTP',
 
        // V
@@ -75,5 +77,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'HTML version.',
        'version_texte' => 'Text version.'
 );
-
-?>
index 3cef7c9..795e48b 100644 (file)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Configuración de la dirección de envío', # MODIF
        'configuration_facteur' => 'Cartero',
-       'configuration_mailer' => 'Configuración del "mailer"',
+       'configuration_mailer' => 'Configuración del "mailer"', # MODIF
        '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',
@@ -30,7 +32,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'Nombre:',
        'facteur_bcc' => 'Copia Oculta (CCO):',
        'facteur_cc' => 'Copia (CC) :',
-       'facteur_copies' => 'Copias:',
+       'facteur_copies' => 'Copias:', # MODIF
        '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. ',
@@ -46,17 +48,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (obsoleto)',
+       'facteur_smtp_secure_tls' => 'TLS (recomendado)',
+       'facteur_smtp_sender' => 'Rebote de errores (opcional)', # MODIF
+       '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.', # MODIF
        '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).',
+       'note_test_configuration' => 'Un correo electrónico se enviará a la dirección de envío definida (o aquélla del webmaster).', # MODIF
 
        // P
        'personnaliser' => 'Personalizar esta configuración',
@@ -67,7 +69,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_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', # MODIF
        'utiliser_smtp' => 'Utilizar SMTP',
 
        // V
@@ -75,5 +77,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'Versión HTML.',
        'version_texte' => 'Versión texto.'
 );
-
-?>
index 45866b6..691d331 100644 (file)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // C
        'config_info_enregistree' => 'پيكربندي پستجي ثبت شده است.',
-       'configuration_adresse_envoi' => 'پيكربندي نشاني نامه ',
+       'configuration_adresse_envoi' => 'پيكربندي نشاني نامه ', # MODIF
        'configuration_facteur' => 'پستچي',
-       'configuration_mailer' => 'پيكربندي نامه‌ رسان',
+       'configuration_mailer' => 'پيكربندي نامه‌ رسان', # MODIF
        'configuration_smtp' => 'انتخاب روش ارسال نامه',
        'configuration_smtp_descriptif' => 'اگر در مورد تنظيمات مطمئن نيستيد، بگذاريد «پي.اچ.پي ميل» تنظيم كند. ',
        'corps_email_de_test' => 'اين يك ايميل آزمايشي است.',
@@ -30,7 +32,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'نام:‌',
        'facteur_bcc' => 'كپي مخفي (بي.سي.سي): ',
        'facteur_cc' => 'كپي غيرمخفي (سي.سي): ',
-       'facteur_copies' => 'كپي‌ها:‌',
+       'facteur_copies' => 'كپي‌ها:‌', # MODIF
        'facteur_copies_descriptif' => 'يك ايميل به نشاني مشخص شده ارسال خواهد شد. يك كپي غير مخفي و/يا يك كپي مخفي.',
        'facteur_filtre_accents' => 'تبديل اكسان‌ها به اچ.تي.ام.ال (براي هاتميل مفيد است)',
        'facteur_filtre_css' => 'تبديل استايل‌هاي مطالب بين <head> و </head> به استايل‌هاي  درخط، مفيد براي وب‌ميل‌ها، زيرا استايل‌هاي درخط بر استايل‌هاي بيروني اولويت مي‌يابند.',
@@ -46,17 +48,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_smtp_port' => 'پورت:‌',
        'facteur_smtp_secure' => 'ارتباط امن:‌',
        'facteur_smtp_secure_non' => 'نه',
-       'facteur_smtp_secure_ssl' => 'اس.اس.ال',
-       'facteur_smtp_secure_tls' => 'تي.ال.اس',
-       'facteur_smtp_sender' => 'برگشت خطاها (دلبخواه)',
-       'facteur_smtp_sender_descriptif' => 'تعيين مسير برگشت در بالاي ايميل مفيد براي خطاي فيدبك، همچنين در حالت اس.ام.تي.پي (پروتكل انتقال ساده نامه) فرستنده نامه را مشخص مي‌كمند. ',
+       'facteur_smtp_secure_ssl' => 'اس.اس.ال', # MODIF
+       'facteur_smtp_secure_tls' => 'تي.ال.اس', # MODIF
+       'facteur_smtp_sender' => 'برگشت خطاها (دلبخواه)', # MODIF
+       'facteur_smtp_sender_descriptif' => 'تعيين مسير برگشت در بالاي ايميل مفيد براي خطاي فيدبك، همچنين در حالت اس.ام.تي.پي (پروتكل انتقال ساده نامه) فرستنده نامه را مشخص مي‌كمند. ', # MODIF
        'facteur_smtp_username' => 'نام كاربر:‌',
 
        // M
        'message_identite_email' => 'پيكربندي پلاگين «پستچي» نشاني اين ايميل را براي ارسال ايميل‌ها تنظيم مي‌كند',
 
        // N
-       'note_test_configuration' => 'يك ايميل به نشاني مرسوله تعيين شده (يا به نشاني وب مستر) ارسال خواهد شد',
+       'note_test_configuration' => 'يك ايميل به نشاني مرسوله تعيين شده (يا به نشاني وب مستر) ارسال خواهد شد', # MODIF
 
        // P
        'personnaliser' => 'شخصي سازي اين تنظيمات ',
@@ -67,7 +69,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // U
        'utiliser_mail' => 'ار كاركرد نامه پي.اچ.پي استفاده كنيد',
-       'utiliser_reglages_site' => 'استفاده از تنظيمات سايت اسپيپ: نام وب سايت نام فرستنده خواهد بود و نشاني ايميل نشاني ايميل وب مستر خواهد بود. ',
+       'utiliser_reglages_site' => 'استفاده از تنظيمات سايت اسپيپ: نام وب سايت نام فرستنده خواهد بود و نشاني ايميل نشاني ايميل وب مستر خواهد بود. ', # MODIF
        'utiliser_smtp' => 'از اس.ام.تي.پي (پروتكل ارسال ساده نامه)‌ اسفتاده كنيد',
 
        // V
@@ -75,5 +77,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'نسخه اچ.تي.ام.ال',
        'version_texte' => 'نسخه متني.'
 );
-
-?>
index 5610ec6..0e5c8ac 100755 (executable)
@@ -1,15 +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_/facteur/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Adresse d’envoi par défaut',
        'configuration_facteur' => 'Facteur',
-       'configuration_mailer' => 'Configuration du mailer',
+       'configuration_mailer' => 'Méthode d’envoi',
        '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é',
@@ -28,8 +30,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'Nom :',
        'facteur_bcc' => 'Copie Cachée (BCC) :',
        'facteur_cc' => 'Copie (CC) :',
-       'facteur_copies' => 'Copies :',
+       '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_email_test' => 'Envoyer un email de test à :',
        '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',
@@ -44,17 +47,20 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (déprécié)',
+       'facteur_smtp_secure_tls' => 'TLS (recommandé)',
+       'facteur_smtp_sender' => 'Adresse de 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)',
        'facteur_smtp_username' => 'Nom d’utilisateur :',
 
+       // L
+       'label_facteur_forcer_from' => 'Forcer cette adresse d’envoi quand le <tt>From</tt> n’est pas sur le même domaine',
+
        // 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).',
+       'note_test_configuration' => 'Un email sera envoyé à cette adresse.',
 
        // P
        'personnaliser' => 'Personnaliser ces réglages',
@@ -65,7 +71,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_reglages_site' => 'Utiliser les réglages du site SPIP : <br /><tt>@from@</tt>',
        'utiliser_smtp' => 'Utiliser SMTP',
 
        // V
@@ -73,5 +79,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'Version HTML.',
        'version_texte' => 'Version texte.'
 );
-
-?>
index eae3378..4ad5edf 100644 (file)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Configuration de l’adresse d’envoi', # MODIF
        'configuration_facteur' => 'Facteur',
-       'configuration_mailer' => 'Configuration du mailer',
+       'configuration_mailer' => 'Configuration du mailer', # MODIF
        'configuration_smtp' => 'Choix de la méthode d’envoi de mail',
        'configuration_smtp_descriptif' => 'Si tu n’es pas sûr, choisis la fonction mail de PHP.',
        'corps_email_de_test' => 'Ceci est un email de test accentué',
@@ -30,7 +32,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => 'Nom :',
        'facteur_bcc' => 'Copie Cachée (BCC) :',
        'facteur_cc' => 'Copie (CC) :',
-       'facteur_copies' => 'Copies :',
+       'facteur_copies' => 'Copies :', # MODIF
        '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.',
@@ -46,17 +48,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL', # MODIF
+       'facteur_smtp_secure_tls' => 'TLS', # MODIF
+       'facteur_smtp_sender' => 'Retour des erreurs (optionnel)', # MODIF
+       '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.', # MODIF
        '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).',
+       'note_test_configuration' => 'Un email sera envoyé à l’adresse d’envoi définie (ou celle du webmaster).', # MODIF
 
        // P
        'personnaliser' => 'Personnaliser ces réglages',
@@ -67,7 +69,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_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', # MODIF
        'utiliser_smtp' => 'Utiliser SMTP',
 
        // V
@@ -75,5 +77,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'Version HTML.',
        'version_texte' => 'Version texte.'
 );
-
-?>
diff --git a/www/plugins/facteur/lang/facteur_it.php b/www/plugins/facteur/lang/facteur_it.php
new file mode 100644 (file)
index 0000000..0a92e76
--- /dev/null
@@ -0,0 +1,78 @@
+<?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=it
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'La configurazione di Facteur è stata registrata',
+       'configuration_adresse_envoi' => 'Configurazione dell’indirizzo emittente', # MODIF
+       'configuration_mailer' => 'Configurazione del mailer', # MODIF
+       'configuration_smtp' => 'Scelta del metodo d’invio di mail',
+       'configuration_smtp_descriptif' => 'Se no siete sicuri, scegliete la funzione mail di PHP.',
+       'corps_email_de_test' => 'Questo è un mail di prova con accento',
+
+       // E
+       'email_envoye_par' => 'Inviato da @site@',
+       'email_test_envoye' => 'La mail di prova è stata correttamente inviata. Se non la ricevete correttamente, verficate la configurazione del server o contattate un amministratore del server.',
+       'erreur' => 'Errorr',
+       'erreur_dans_log' => ': consultate il file log per maggiori dettagli',
+       'erreur_generale' => 'Ci sono uno o più errori di configurazione. Verificate il contenuto del formulario.',
+       'erreur_invalid_host' => 'Questo nome di host non è corretto',
+       'erreur_invalid_port' => 'Questu numero di porta non è corretto',
+
+       // F
+       'facteur_adresse_envoi_email' => 'Email:',
+       'facteur_adresse_envoi_nom' => 'Cognome:',
+       'facteur_bcc' => 'Copia nascosta (CCN):',
+       'facteur_cc' => 'Copia (CC):',
+       'facteur_copies' => 'Copie:', # MODIF
+       'facteur_copies_descriptif' => 'Una mail sarà mandata in copia agli indirizzi definiti. Un solo indirizzo in copia e/o un solo indirizzo in copia nascosta.',
+       'facteur_filtre_accents' => 'Trasformate gli accenti nella loro entity html (utile sopratutto per Hotmail).',
+       'facteur_filtre_css' => 'Trasformare gli stili contenuti tra <head> e </head> negli stili "in linea", utile per le webmail perché gli stili in linea hanno la precedenza sugli stili estermi.',
+       'facteur_filtre_images' => 'Integrate le immagini citate nelle mail',
+       'facteur_filtre_iso_8859' => 'Convertire in ISO-8859-1',
+       'facteur_filtres' => 'Filtri',
+       'facteur_filtres_descriptif' => 'Alcuni filtri possono essere applicati alle mail al momento dell’invio.',
+       'facteur_smtp_auth' => 'Richiede un’autenticazione:',
+       'facteur_smtp_auth_non' => 'no',
+       'facteur_smtp_auth_oui' => 'si',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Password:',
+       'facteur_smtp_port' => 'Porta:',
+       'facteur_smtp_secure' => 'Connessione sicura:',
+       'facteur_smtp_secure_non' => 'no',
+       'facteur_smtp_secure_ssl' => 'SSL', # MODIF
+       'facteur_smtp_secure_tls' => 'TLS', # MODIF
+       'facteur_smtp_sender' => 'Resoconto degli errori (opzionale)', # MODIF
+       'facteur_smtp_sender_descriptif' => 'Definisce nella testata della mail l’indirizzo mail di resoconto degli errori (o Return-Path), e durante l’invio tramite il metodo SMTP definisce anche l’indirizzo del mittente.', # MODIF
+       'facteur_smtp_username' => 'Nome dell’utente:',
+
+       // M
+       'message_identite_email' => 'La configurazione del plugin "facteur" sovraccarica questo indirizzo mail per l’invio della posta.',
+
+       // N
+       'note_test_configuration' => 'Una mail sarà inviata all’indirizzo definito (o all’indirizzo del webmaster).', # MODIF
+
+       // P
+       'personnaliser' => 'Personnalizzate questi impostazioni',
+
+       // T
+       'tester' => 'Provare',
+       'tester_la_configuration' => 'Provare la configurazione',
+
+       // U
+       'utiliser_mail' => 'Usare la funzione mail di PHP',
+       'utiliser_reglages_site' => 'Usare le impostazioni del sito SPIP: il nome visualizzato sarà il nome del sito SPIP e l’indirizzo mail sarà quello del webmaster', # MODIF
+       'utiliser_smtp' => 'Utilisare SMTP',
+
+       // V
+       'valider' => 'Confermare',
+       'version_html' => 'Versione HTML.',
+       'version_texte' => 'Versione testo.'
+);
index 1d2c130..0fbb2a1 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,6 +34,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_email_test' => 'Een test email sturen naar:',
        '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',
@@ -46,12 +49,15 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (gedeprecieerd)',
+       'facteur_smtp_secure_tls' => 'TLS (aanbevolen)',
        '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:',
 
+       // L
+       'label_facteur_forcer_from' => 'Forceer dit verzendadres wanneer de <tt>From</tt> niet tot hetzelfde domein behoort',
+
        // M
        'message_identite_email' => 'De configuratie van plugin "facteur" laadt dit e-mailadres voor het verzenden van mails.',
 
@@ -67,7 +73,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_reglages_site' => 'Gebruik de instellingen van SPIP: <br /><tt>@from@</tt><br/>De getoonde naam is die van de site en het adres dat van de webmaster',
        'utiliser_smtp' => 'Gebruik SMTP',
 
        // V
@@ -75,5 +81,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'HTML-versie.',
        'version_texte' => 'Tekstversie.'
 );
-
-?>
diff --git a/www/plugins/facteur/lang/facteur_oc_ni_mis.php b/www/plugins/facteur/lang/facteur_oc_ni_mis.php
new file mode 100644 (file)
index 0000000..b2618f2
--- /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=oc_ni_mis
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'La counfiguracioun dóu fatour es ben estada registrada',
+       'configuration_adresse_envoi' => 'Counfiguracioun de l’adressa de spedissioun', # MODIF
+       'configuration_facteur' => 'Fatour',
+       'configuration_mailer' => 'Counfiguracioun dóu mailer', # MODIF
+       'configuration_smtp' => 'Chausida de la mètodou de spedissioun de mail',
+       'configuration_smtp_descriptif' => 'Se noun sias segur, chaussissès la founcioun mail de PHP.',
+       'corps_email_de_test' => 'Aiçòt es un e-mail de prova achentat',
+
+       // E
+       'email_envoye_par' => 'Mandat da @site@',
+       'email_test_envoye' => 'L’e-mail de prova es ben estat mandat. Se noun lou recevès courretamen, verificàs la counfiguracioun dóu vouòstre servidou o countatàs un aministratour dóu servidou.',
+       'erreur' => 'Errour',
+       'erreur_dans_log' => ' : counsultàs lou fichié log per mai de detai',
+       'erreur_generale' => 'Lì a, au màncou, un errour de counfiguracioun. Vourguès verificà lou countengut dóu fourmulari.',
+       'erreur_invalid_host' => 'Aquestou noum d’oste es pas courret',
+       'erreur_invalid_port' => 'Aquestou nùmero de pouòrt es pas courret',
+
+       // F
+       'facteur_adresse_envoi_email' => 'E-mail :',
+       'facteur_adresse_envoi_nom' => 'Noum :',
+       'facteur_bcc' => 'Còpia Escounduda (BCC) :',
+       'facteur_cc' => 'Còpia (CC) :',
+       'facteur_copies' => 'Còpia :', # MODIF
+       'facteur_copies_descriptif' => 'Un e-mail serà mandat en còpia ai adressa definidi. Basta una adressa en còpia e/o basta una adressa en còpia escounduda.',
+       'facteur_filtre_accents' => 'Trasfourmà lu achent en li siéu entità html (utile per Hotmail per isemple).',
+       'facteur_filtre_css' => 'Trasfourmà lu estil countengut tra <head> e </head> en dei estil "en ligna", utile per lu webmail perqué lu estil en ligna an la priourità soubre lu estil estèrnou.',
+       'facteur_filtre_images' => 'Embarcà li image referençadi en lu e-mail',
+       'facteur_filtre_iso_8859' => 'Counvertì en ISO-8859-1',
+       'facteur_filtres' => 'Filtre',
+       'facteur_filtres_descriptif' => 'Dei filtre pouòdon estre aplicat ai e-mail au moumen de la spedissioun.',
+       'facteur_smtp_auth' => 'Necessita una autentificacioun :',
+       'facteur_smtp_auth_non' => 'noun',
+       'facteur_smtp_auth_oui' => 'ahì',
+       'facteur_smtp_host' => 'Oste :',
+       'facteur_smtp_password' => 'Mot de passa :',
+       'facteur_smtp_port' => 'Pouòrt :',
+       'facteur_smtp_secure' => 'Counessioun seguritada :',
+       'facteur_smtp_secure_non' => 'noun',
+       'facteur_smtp_secure_ssl' => 'SSL (oussoulet)',
+       'facteur_smtp_secure_tls' => 'TLS (racoumandat)',
+       'facteur_smtp_sender' => 'Retour dei errour (oupciounal)', # MODIF
+       'facteur_smtp_sender_descriptif' => 'Definit en l’entestacioun dóu e-mail de retour dei errour  (o Return-Path), e dóu tems d’una spedissioun vìa lou mètodou SMTP acò definit finda l’adressa de l’espeditour.', # MODIF
+       'facteur_smtp_username' => 'Noum d’utilisaire :',
+
+       // M
+       'message_identite_email' => 'Lou counfiguracioun dóu plugin "fatour" soubre-scriéu aquela adressa e-mail per la spedissioun.',
+
+       // N
+       'note_test_configuration' => 'Un e-mail serà mandat a l’adressa de spedissioun definida (o aquela dóu webmèstre).', # MODIF
+
+       // P
+       'personnaliser' => 'Persounalisà aquestu reglage',
+
+       // T
+       'tester' => 'Prouvà',
+       'tester_la_configuration' => 'Prouvà la counfiguracioun',
+
+       // U
+       'utiliser_mail' => 'Utilisà la founcioun mail de PHP',
+       'utiliser_reglages_site' => 'Utilisà lu reglage dóu sit SPIP : lou noum afichat serà lou noum dóu sit SPIP et l’adressa e-mail serà aquela dóu webmèstre', # MODIF
+       'utiliser_smtp' => 'Utilisà SMTP',
+
+       // V
+       'valider' => 'Validà',
+       'version_html' => 'Versioun HTML.',
+       'version_texte' => 'Versioun tèst.'
+);
diff --git a/www/plugins/facteur/lang/facteur_pt_br.php b/www/plugins/facteur/lang/facteur_pt_br.php
new file mode 100644 (file)
index 0000000..c7e547f
--- /dev/null
@@ -0,0 +1,83 @@
+<?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=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'config_info_enregistree' => 'A configuração do Carteiro foi gravada corretamente',
+       'configuration_adresse_envoi' => 'Endereço de envio padrão',
+       'configuration_facteur' => 'Carteiro',
+       'configuration_mailer' => 'Método de envio',
+       'configuration_smtp' => 'Seleção do método de envio de e-mail',
+       'configuration_smtp_descriptif' => 'Se tiver dúvida, escolha a função mail do PHP.',
+       'corps_email_de_test' => 'Este é um e-mail de teste acentuado',
+
+       // E
+       'email_envoye_par' => 'Enviado por @site@',
+       'email_test_envoye' => 'O e-mail de teste foi enviado corretamente. Se você não o receber, verifique a configuração do seu servidor ou contate o administrador do servidor.',
+       'erreur' => 'Erro',
+       'erreur_dans_log' => ' : consulte o arquivo de log para obter mais detalhes',
+       'erreur_generale' => 'Há um ou mais erros de configuração. Por favor, verifique o conteúdo do formulário.',
+       'erreur_invalid_host' => 'Este nome de host não está correto',
+       'erreur_invalid_port' => 'Este número de porta não está correto',
+
+       // F
+       'facteur_adresse_envoi_email' => 'E-mail:',
+       'facteur_adresse_envoi_nom' => 'Nome:',
+       'facteur_bcc' => 'Cópia Oculta (BCC):',
+       'facteur_cc' => 'Cópia (CC):',
+       'facteur_copies' => 'Cópias',
+       'facteur_copies_descriptif' => 'Um e-mail será enviado em cópia para os endereços especificados. Um único endereço em cópia e/ou um único endereço em cópia oculta.',
+       'facteur_email_test' => 'Enviar um e-mail de teste para:',
+       'facteur_filtre_accents' => 'Transformar os acentos em entidades HTML (útil especialmente para o Hotmail).',
+       'facteur_filtre_css' => 'Transformaros estílos contidos entre <head> e </head> em estilos "em linha", útil para os webmails, já que os estilos em linha têm prioridade sobre os estilos externos.',
+       'facteur_filtre_images' => 'Embutir as imagens referenciadas no próprio e-mail',
+       'facteur_filtre_iso_8859' => 'Converter em ISO-8859-1',
+       'facteur_filtres' => 'Filtros',
+       'facteur_filtres_descriptif' => 'Filtros podem ser aplicados aos e-mails, no momento do envio.',
+       'facteur_smtp_auth' => 'Requer autenticação:',
+       'facteur_smtp_auth_non' => 'não',
+       'facteur_smtp_auth_oui' => 'sim',
+       'facteur_smtp_host' => 'Host:',
+       'facteur_smtp_password' => 'Senha:',
+       'facteur_smtp_port' => 'Porta:',
+       'facteur_smtp_secure' => 'Conexão segura:',
+       'facteur_smtp_secure_non' => 'náo',
+       'facteur_smtp_secure_ssl' => 'SSL (obsoleto)',
+       'facteur_smtp_secure_tls' => 'TLS (recomendado)',
+       'facteur_smtp_sender' => 'Endereço pelo retorno dos erros (opcional)',
+       'facteur_smtp_sender_descriptif' => 'Informa, no cabeçalho da mensagem, o endereço de e-mail de retorno dos erros (ou Return-Path)',
+       'facteur_smtp_username' => 'Nome do usuário:',
+
+       // L
+       'label_facteur_forcer_from' => 'Forçar o endereço de envio quando o <tt>From</tt> não é no mesmo domínio.',
+
+       // M
+       'message_identite_email' => 'A configuração do plugin "Carteiro" define este endereço de e-mail para o envio das mensagens.',
+
+       // N
+       'note_test_configuration' => 'Um e-mail será enviado a este endereço.',
+
+       // P
+       'personnaliser' => 'Personalizar essas configurações',
+
+       // T
+       'tester' => 'Testar',
+       'tester_la_configuration' => 'Testar a configuração',
+
+       // U
+       'utiliser_mail' => 'Usar a função mail do PHP',
+       'utiliser_reglages_site' => 'Usar as configurações do site SPIP:  : <br /><tt>@from@</tt> ',
+       'utiliser_smtp' => 'Usar SMTP',
+
+       // V
+       'valider' => 'Validar',
+       'version_html' => 'Versão HTML.',
+       'version_texte' => 'Versão texto.'
+);
index 3e35b13..e8bd149 100644 (file)
@@ -3,15 +3,17 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/facteur?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+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_adresse_envoi' => 'Nastavenie adresy odosielateľa', # MODIF
        'configuration_facteur' => 'Poštár',
-       'configuration_mailer' => 'Nastavenia Poštára',
+       'configuration_mailer' => 'Nastavenia Poštára', # MODIF
        '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',
@@ -30,8 +32,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_adresse_envoi_nom' => '(Obchodné) meno:',
        'facteur_bcc' => 'Skrytá kópia (BCC):',
        'facteur_cc' => 'Kópia (CC):',
-       'facteur_copies' => 'Kópie:',
+       'facteur_copies' => 'Kópie:', # MODIF
        '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_email_test' => 'Skúšobný e-mail poslať na adresu:',
        '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',
@@ -46,17 +49,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        '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_secure_ssl' => 'SSL (zastarané)',
+       'facteur_smtp_secure_tls' => 'TLS (odporúča sa)',
+       'facteur_smtp_sender' => 'Vypísanie chýb (nepovinné)', # MODIF
+       '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.', # MODIF
        '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).',
+       'note_test_configuration' => 'E-mail bude odoslaný na túto adresu.',
 
        // P
        'personnaliser' => 'Prispôsobiť si tieto nastavenia',
@@ -67,7 +70,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // 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_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', # MODIF
        'utiliser_smtp' => 'Používať SMTP',
 
        // V
@@ -75,5 +78,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'version_html' => 'HTML verzia.',
        'version_texte' => 'Textová verzia.'
 );
-
-?>
index 0902008..b5bf31c 100644 (file)
@@ -14,6 +14,9 @@
        <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="pt_br" url="http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=pt_br" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </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>
index 1ccd077..ff1d706 100755 (executable)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Briefräger',
        'facteur_slogan' => 'Er befördert ihre Emails'
 );
-
-?>
index b354c28..055126a 100644 (file)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Postman',
        'facteur_slogan' => 'He delivers emails'
 );
-
-?>
index ffa1ba1..bb0d6ad 100644 (file)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Cartero',
        'facteur_slogan' => 'Distribuye sus correos electrónicos'
 );
-
-?>
index 72225ac..b903c88 100644 (file)
@@ -1,7 +1,9 @@
 <?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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Facteur',
        'facteur_slogan' => 'Il distribue vos courriels'
 );
-
-?>
index 5e1b76a..e9eef9f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-facteur?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Facteur',
        'facteur_slogan' => 'Il distribue tes courriels'
 );
-
-?>
index 724cb17..2630334 100644 (file)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Postbode',
        'facteur_slogan' => 'Hij verzendt uw mail'
 );
-
-?>
diff --git a/www/plugins/facteur/lang/paquet-facteur_pt_br.php b/www/plugins/facteur/lang/paquet-facteur_pt_br.php
new file mode 100644 (file)
index 0000000..f06b414
--- /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=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'facteur_description' => 'O Carteiro cuida da distribuição de e-mails no formato HTML, texto ou misto; via SMTP ou não',
+       'facteur_nom' => 'Carteiro',
+       'facteur_slogan' => 'Distribui os seus e-mails'
+);
index 3c675e7..fd10f5d 100644 (file)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Почтальон (Facteur)',
        'facteur_slogan' => 'Он отправляет письма'
 );
-
-?>
index de98cc7..6bc4580 100644 (file)
@@ -3,7 +3,9 @@
 // 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;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'facteur_nom' => 'Poštár',
        'facteur_slogan' => 'Posiela vašu poštu'
 );
-
-?>
index 72ff96a..98516a6 100644 (file)
@@ -1,22 +1,22 @@
 <paquet\r
        prefix="facteur"\r
        categorie="communication"\r
-       version="3.0.13"\r
+       version="3.4.3"\r
        etat="stable"\r
-       compatibilite="[3.0.0;3.0.*]"\r
+       compatibilite="[3.0.0;3.1.*]"\r
        logo="prive/themes/spip/images/facteur-32.png"\r
        schema="1.1"\r
        documentation="http://contrib.spip.net/Facteur"\r
->      \r
-       \r
+>\r
+\r
        <nom>Facteur</nom>\r
        <!-- Il distribue votre courrier -->\r
-       \r
+\r
        <auteur>Collectif SPIP</auteur>\r
-       \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
+       <pipeline nom="formulaire_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>
\ No newline at end of file
+</paquet>\r
index 03851a3..8e0763d 100755 (executable)
-                 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
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  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.
+
+  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.
+
+                 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.
+
+  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.
+
+  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.
+
+  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.
+
+  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.
+
+  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.
+
+  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
+
+           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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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/phpmailer-php5/PHPMailerAutoload.php b/www/plugins/facteur/phpmailer-php5/PHPMailerAutoload.php
new file mode 100644 (file)
index 0000000..eaa2e30
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/**
+ * PHPMailer SPL autoloader.
+ * PHP Version 5
+ * @package PHPMailer
+ * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ * @note 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.
+ */
+
+/**
+ * PHPMailer SPL autoloader.
+ * @param string $classname The name of the class to load
+ */
+function PHPMailerAutoload($classname)
+{
+    //Can't use __DIR__ as it's only in PHP 5.3+
+    $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
+    if (is_readable($filename)) {
+        require $filename;
+    }
+}
+
+if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
+    //SPL autoloading was introduced in PHP 5.1.2
+    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+        spl_autoload_register('PHPMailerAutoload', true, true);
+    } else {
+        spl_autoload_register('PHPMailerAutoload');
+    }
+} else {
+    /**
+     * Fall back to traditional autoload for old PHP versions
+     * @param string $classname The name of the class to load
+     */
+    function __autoload($classname)
+    {
+        PHPMailerAutoload($classname);
+    }
+}
diff --git a/www/plugins/facteur/phpmailer-php5/README b/www/plugins/facteur/phpmailer-php5/README
deleted file mode 100755 (executable)
index 3670fb6..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************\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/README.md b/www/plugins/facteur/phpmailer-php5/README.md
new file mode 100644 (file)
index 0000000..0ecfa5d
--- /dev/null
@@ -0,0 +1,184 @@
+![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png)
+
+# PHPMailer - A full-featured email creation and transfer class for PHP
+
+Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
+[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
+[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
+
+[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer)
+
+## Class Features
+
+- Probably the world's most popular code for sending email from PHP!
+- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
+- Integrated SMTP support - send without a local mail server
+- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
+- Multipart/alternative emails for mail clients that do not read HTML email
+- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
+- SMTP authentication with LOGIN, PLAIN, NTLM, CRAM-MD5 and Google's XOAUTH2 mechanisms over SSL and TLS transports
+- Error messages in 47 languages!
+- DKIM and S/MIME signing support
+- Compatible with PHP 5.0 and later
+- Much more!
+
+## Why you might need it
+
+Many PHP developers utilize email in their code. The only PHP function that supports this is the mail() function. However, it does not provide any assistance for making use of popular features such as HTML-based emails and attachments.
+
+Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules - the vast majority of code that you'll find online that uses the mail() function directly is just plain wrong!
+*Please* don't be tempted to do it yourself - if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own - try SwiftMailer, Zend_Mail, eZcomponents etc.
+
+The PHP mail() function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD and OS X platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server.
+
+## License
+
+This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license. Please read LICENSE for information on the
+software availability and distribution.
+
+## Installation & loading
+
+PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), so just add this line to your `composer.json` file:
+
+```json
+"phpmailer/phpmailer": "~5.2"
+```
+
+or
+
+```sh
+composer require phpmailer/phpmailer
+```
+
+If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package.
+
+Alternatively, copy the contents of the PHPMailer folder into somewhere that's in your PHP `include_path` setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.
+
+If you're not using composer's autoloader, PHPMailer provides an SPL-compatible autoloader, and that is the preferred way of loading the library - just `require '/path/to/PHPMailerAutoload.php';` and everything should work. The autoloader does not throw errors if it can't find classes so it prepends itself to the SPL list, allowing your own (or your framework's) autoloader to catch errors. SPL autoloading was introduced in PHP 5.1.0, so if you are using a version older than that you will need to require/include each class manually.
+
+PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3.
+
+If you want to use Google's XOAUTH2 authentication mechanism, you need to be running at least PHP 5.4, and load the dependencies listed in `composer.json`.
+
+### Minimal installation
+
+While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication and ics generation. If you're using Google XOAUTH2 you will need `class.phpmaileroauth.php` and `class.oauth.php` classes too, as well as the composer dependencies.
+
+## A Simple Example
+
+```php
+<?php
+require 'PHPMailerAutoload.php';
+
+$mail = new PHPMailer;
+
+//$mail->SMTPDebug = 3;                               // Enable verbose debug output
+
+$mail->isSMTP();                                      // Set mailer to use SMTP
+$mail->Host = 'smtp1.example.com;smtp2.example.com';  // Specify main and backup SMTP servers
+$mail->SMTPAuth = true;                               // Enable SMTP authentication
+$mail->Username = 'user@example.com';                 // SMTP username
+$mail->Password = 'secret';                           // SMTP password
+$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
+$mail->Port = 587;                                    // TCP port to connect to
+
+$mail->setFrom('from@example.com', 'Mailer');
+$mail->addAddress('joe@example.net', 'Joe User');     // Add a recipient
+$mail->addAddress('ellen@example.com');               // Name is optional
+$mail->addReplyTo('info@example.com', 'Information');
+$mail->addCC('cc@example.com');
+$mail->addBCC('bcc@example.com');
+
+$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
+$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
+$mail->isHTML(true);                                  // Set email format to HTML
+
+$mail->Subject = 'Here is the subject';
+$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
+$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
+
+if(!$mail->send()) {
+    echo 'Message could not be sent.';
+    echo 'Mailer Error: ' . $mail->ErrorInfo;
+} else {
+    echo 'Message has been sent';
+}
+```
+
+You'll find plenty more to play with in the [examples](examples/) folder.
+
+That's it. You should now be ready to use PHPMailer!
+
+## Localization
+PHPMailer defaults to English, but in the [language](language/) folder you'll find numerous (46 at the time of writing!) translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
+
+```php
+// To load the French version
+$mail->setLanguage('fr', '/optional/path/to/language/directory/');
+```
+
+We welcome corrections and new languages - if you're looking for corrections to do, run the [phpmailerLangTest.php](test/phpmailerLangTest.php) script in the tests folder and it will show any missing translations.
+
+## Documentation
+
+Examples of how to use PHPMailer for common scenarios can be found in the [examples](examples/) folder. If you're looking for a good starting point, we recommend you start with [the gmail example](examples/gmail.phps).
+
+There are tips and a troubleshooting guide in the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated.
+
+Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/).
+
+You'll find some basic user-level docs in the [docs](docs/) folder, and you can generate complete API-level documentation using the [generatedocs.sh](docs/generatedocs.sh) shell script in the docs folder, though you'll need to install [PHPDocumentor](http://www.phpdoc.org) first. You may find [the unit tests](test/phpmailerTest.php) a good source of how to do various operations such as encryption.
+
+If the documentation doesn't cover what you need, search the [many questions on StackOverflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
+
+## Tests
+
+There is a PHPUnit test script in the [test](test/) folder.
+
+Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
+
+If this isn't passing, is there something you can do to help?
+
+## Contributing
+
+Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).
+
+We're particularly interested in fixing edge-cases, expanding test coverage and updating translations.
+
+With the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone:
+
+```sh
+git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
+```
+
+Please *don't* use the SourceForge or Google Code projects any more.
+
+## Sponsorship
+
+Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system.
+
+<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="250" height="28" alt="Smartmessages email marketing"></a>
+
+Other contributions are gladly received, whether in beer 🍺, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰.
+
+## Changelog
+
+See [changelog](changelog.md).
+
+## History
+- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/).
+- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004.
+- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
+- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer).
+- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer.
+- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub.
+
+### What's changed since moving from SourceForge?
+- Official successor to the SourceForge and Google Code projects.
+- Test suite.
+- Continuous integration with Travis-CI.
+- Composer support.
+- Public development.
+- Additional languages and language strings.
+- CRAM-MD5 authentication support.
+- Preserves full repo history of authors, commits and branches from the original SourceForge project.
diff --git a/www/plugins/facteur/phpmailer-php5/VERSION b/www/plugins/facteur/phpmailer-php5/VERSION
new file mode 100644 (file)
index 0000000..ba678f2
--- /dev/null
@@ -0,0 +1 @@
+5.2.14
\ No newline at end of file
diff --git a/www/plugins/facteur/phpmailer-php5/changelog.md b/www/plugins/facteur/phpmailer-php5/changelog.md
new file mode 100644 (file)
index 0000000..486f328
--- /dev/null
@@ -0,0 +1,620 @@
+# ChangeLog
+
+## Version 5.2.14 (Nov 1st 2015)
+* Allow addresses with IDN (Internationalized Domain Name) in PHP 5.3+, thanks to @fbonzon
+* Allow access to POP3 errors
+* Make all POP3 private properties and methods protected
+* **SECURITY** Fix vulnerability that allowed email addresses with line breaks (valid in RFC5322) to pass to SMTP, permitting message injection at the SMTP level. Mitigated in both the address validator and in the lower-level SMTP class. Thanks to Takeshi Terada.
+* Updated Brazilian Portuguese translations (Thanks to @phelipealves)
+
+## Version 5.2.13 (Sep 14th 2015)
+* Rename internal oauth class to avoid name clashes
+* Improve Estonian translations
+
+## Version 5.2.12 (Sep 1st 2015)
+* Fix incorrect composer package dependencies
+* Skip existing embedded image `cid`s in `msgHTML`
+
+## Version 5.2.11 (Aug 31st 2015)
+* Don't switch to quoted-printable for long lines if already using base64
+* Fixed Travis-CI config when run on PHP 7
+* Added Google XOAUTH2 authentication mechanism, thanks to @sherryl4george
+* Add address parser for RFC822-format addresses
+* Update MS Office MIME types
+* Don't convert line breaks when using quoted-printable encoding
+* Handle MS Exchange returning an invalid empty AUTH-type list in EHLO
+* Don't set name or filename properties on MIME parts that don't have one
+
+## Version 5.2.10 (May 4th 2015)
+* Add custom header getter
+* Use `application/javascript` for .js attachments
+* Improve RFC2821 compliance for timelimits, especially for end-of-data
+* Add Azerbaijani translations (Thanks to @mirjalal)
+* Minor code cleanup for robustness
+* Add Indonesian translations (Thanks to @ceceprawiro)
+* Avoid `error_log` Debugoutput naming clash
+* Add ability to parse server capabilities in response to EHLO (useful for SendGrid etc)
+* Amended default values for WordWrap to match RFC
+* Remove html2text converter class (has incompatible license)
+* Provide new mechanism for injecting html to text converters
+* Improve pointers to docs and support in README
+* Add example file upload script
+* Refactor and major cleanup of EasyPeasyICS, now a lot more usable
+* Make set() method simpler and more reliable
+* Add Malay translation (Thanks to @nawawi)
+* Add Bulgarian translation (Thanks to @mialy)
+* Add Armenian translation (Thanks to Hrayr Grigoryan)
+* Add Slovenian translation (Thanks to Klemen Tušar)
+* More efficient word wrapping
+* Add support for S/MIME signing with additional CA certificate (thanks to @IgitBuh)
+* Fix incorrect MIME structure when using S/MIME signing and isMail() (#372)
+* Improved checks and error messages for missing extensions
+* Store and report SMTP errors more consistently
+* Add MIME multipart preamble for better Outlook compatibility
+* Enable TLS encryption automatically if the server offers it
+* Provide detailed errors when individual recipients fail
+* Report more errors when connecting
+* Add extras classes to composer classmap
+* Expose stream_context_create options via new SMTPOptions property
+* Automatic encoding switch to quoted-printable if message lines are too long
+* Add Korean translation (Thanks to @ChalkPE)
+* Provide a pointer to troubleshooting docs on SMTP connection failure
+
+## Version 5.2.9 (Sept 25th 2014)
+* **Important: The autoloader is no longer autoloaded by the PHPMailer class**
+* Update html2text from https://github.com/mtibben/html2text
+* Improve Arabic translations (Thanks to @tarekdj)
+* Consistent handling of connection variables in SMTP and POP3
+* PHPDoc cleanup
+* Update composer to use PHPUnit 4.1
+* Pass consistent params to callbacks
+* More consistent handling of error states and debug output
+* Use property defaults, remove constructors
+* Remove unreachable code
+* Use older regex validation pattern for troublesome PCRE library versions
+* Improve PCRE detection in older PHP versions
+* Handle debug output consistently, and always in UTF-8
+* Allow user-defined debug output method via a callable
+* msgHTML now converts data URIs to embedded images
+* SMTP::getLastReply() will now always be populated
+* Improved example code in README
+* Ensure long filenames in Content-Disposition are encoded correctly
+* Simplify SMTP debug output mechanism, clarify levels with constants
+* Add SMTP connection check example
+* Simplify examples, don't use mysql* functions
+
+## Version 5.2.8 (May 14th 2014)
+* Increase timeout to match RFC2821 section 4.5.3.2 and thus not fail greetdelays, fixes #104
+* Add timestamps to default debug output
+* Add connection events and new level 3 to debug output options
+* Chinese language update (Thanks to @binaryoung)
+* Allow custom Mailer types (Thanks to @michield)
+* Cope with spaces around SMTP host specs
+* Fix processing of multiple hosts in connect string
+* Added Galician translation (Thanks to @donatorouco)
+* Autoloader now prepends
+* Docs updates
+* Add Latvian translation (Thanks to @eddsstudio)
+* Add Belarusian translation (Thanks to @amaksymiuk)
+* Make autoloader work better on older PHP versions
+* Avoid double-encoding if mbstring is overloading mail()
+* Add Portuguese translation (Thanks to @Jonadabe)
+* Make quoted-printable encoder respect line ending setting
+* Improve Chinese translation (Thanks to @PeterDaveHello)
+* Add Georgian translation (Thanks to @akalongman)
+* Add Greek translation (Thanks to @lenasterg)
+* Fix serverHostname on PHP < 5.3
+* Improve performance of SMTP class
+* Implement automatic 7bit downgrade
+* Add Vietnamese translation (Thanks to @vinades)
+* Improve example images, switch to PNG
+* Add Croatian translation (Thanks to @hrvoj3e)
+* Remove setting the Return-Path and deprecate the Return-path property - it's just wrong!
+* Fix language file loading if CWD has changed (@stephandesouza)
+* Add HTML5 email validation pattern
+* Improve Turkish translations (Thanks to @yasinaydin)
+* Improve Romanian translations (Thanks to @aflorea)
+* Check php.ini for path to sendmail/qmail before using default
+* Improve Farsi translation (Thanks to @MHM5000)
+* Don't use quoted-printable encoding for multipart types
+* Add Serbian translation (Thanks to ajevremovic at gmail.com)
+* Remove useless PHP5 check
+* Use SVG for build status badges
+* Store MessageDate on creation
+* Better default behaviour for validateAddress
+
+## Version 5.2.7 (September 12th 2013)
+* Add Ukrainian translation from @Krezalis
+* Support for do_verp
+* Fix bug in CRAM-MD5 AUTH
+* Propagate Debugoutput option to SMTP class (@Reblutus)
+* Determine MIME type of attachments automatically
+* Add cross-platform, multibyte-safe pathinfo replacement (with tests) and use it
+* Add a new 'html' Debugoutput type
+* Clean up SMTP debug output, remove embedded HTML
+* Some small changes in header formatting to improve IETF msglint test results
+* Update test_script to use some recently changed features, rename to code_generator
+* Generated code actually works!
+* Update SyntaxHighlighter
+* Major overhaul and cleanup of example code
+* New PHPMailer graphic
+* msgHTML now uses RFC2392-compliant content ids
+* Add line break normalization function and use it in msgHTML
+* Don't set unnecessary reply-to addresses
+* Make fakesendmail.sh a bit cleaner and safer
+* Set a content-transfer-encoding on multiparts (fixes msglint error)
+* Fix cid generation in msgHTML (Thanks to @digitalthought)
+* Fix handling of multiple SMTP servers (Thanks to @NanoCaiordo)
+* SMTP->connect() now supports stream context options (Thanks to @stanislavdavid)
+* Add support for iCal event alternatives (Thanks to @reblutus)
+* Update to Polish language file (Thanks to Krzysztof Kowalewski)
+* Update to Norwegian language file (Thanks to @datagutten)
+* Update to Hungarian language file (Thanks to @dominicus-75)
+* Add Persian/Farsi translation from @jaii
+* Make SMTPDebug property type match type in SMTP class
+* Add unit tests for DKIM
+* Major refactor of SMTP class
+* Reformat to PSR-2 coding standard
+* Introduce autoloader
+* Allow overriding of SMTP class
+* Overhaul of PHPDocs
+* Fix broken Q-encoding
+* Czech language update (Thanks to @nemelu)
+* Removal of excess blank lines in messages
+* Added fake POP server and unit tests for POP-before-SMTP
+
+## Version 5.2.6 (April 11th 2013)
+* Reflect move to PHPMailer GitHub organisation at https://github.com/PHPMailer/PHPMailer
+* Fix unbumped version numbers
+* Update packagist.org with new location
+* Clean up Changelog
+
+## Version 5.2.5 (April 6th 2013)
+* First official release after move from Google Code
+* Fixes for qmail when sending via mail()
+* Merge in changes from Google code 5.2.4 release
+* Minor coding standards cleanup in SMTP class
+* Improved unit tests, now tests S/MIME signing
+* Travis-CI support on GitHub, runs tests with fake SMTP server
+
+## Version 5.2.4 (February 19, 2013)
+* Fix tag and version bug.
+* un-deprecate isSMTP(), isMail(), IsSendmail() and isQmail().
+* Numerous translation updates
+
+## Version 5.2.3 (February 8, 2013)
+* Fix issue with older PCREs and ValidateAddress() (Bugz: 124)
+* Add CRAM-MD5 authentication, thanks to Elijah madden, https://github.com/okonomiyaki3000
+* Replacement of obsolete Quoted-Printable encoder with a much better implementation
+* Composer package definition
+* New language added: Hebrew
+
+## Version 5.2.2 (December 3, 2012)
+* Some fixes and syncs from https://github.com/Synchro/PHPMailer
+* Add Slovak translation, thanks to Michal Tinka
+
+## Version 5.2.2-rc2 (November 6, 2012)
+* Fix SMTP server rotation (Bugz: 118)
+* Allow override of autogen'ed 'Date' header (for Drupal's
+  og_mailinglist module)
+* No whitespace after '-f' option (Bugz: 116)
+* Work around potential warning (Bugz: 114)
+
+## Version 5.2.2-rc1 (September 28, 2012)
+* Header encoding works with long lines (Bugz: 93)
+* Turkish language update (Bugz: 94)
+* undefined $pattern in EncodeQ bug squashed (Bugz: 98)
+* use of mail() in safe_mode now works (Bugz: 96)
+* ValidateAddress() now 'public static' so people can override the
+  default and use their own validation scheme.
+* ValidateAddress() no longer uses broken FILTER_VALIDATE_EMAIL
+* Added in AUTH PLAIN SMTP authentication
+
+## Version 5.2.2-beta2 (August 17, 2012)
+* Fixed Postfix VERP support (Bugz: 92)
+* Allow action_function callbacks to pass/use
+  the From address (passed as final param)
+* Prevent inf look for get_lines() (Bugz: 77)
+* New public var ($UseSendmailOptions). Only pass sendmail()
+  options iff we really are using sendmail or something sendmail
+  compatible. (Bugz: 75)
+* default setting for LE returned to "\n" due to popular demand.
+
+## Version 5.2.2-beta1 (July 13, 2012)
+* Expose PreSend() and PostSend() as public methods to allow
+  for more control if serializing message sending.
+* GetSentMIMEMessage() only constructs the message copy when
+ needed. Save memory.
+* Only pass params to mail() if the underlying MTA is
+  "sendmail" (as defined as "having the string sendmail
+  in its pathname") [#69]
+* Attachments now work with Amazon SES and others [Bugz#70]
+* Debug output now sent to stdout (via echo) or error_log [Bugz#5]
+* New var: Debugoutput (for above) [Bugz#5]
+* SMTP reads now Timeout aware (new var: Timeout=15) [Bugz#71]
+* SMTP reads now can have a Timelimit associated with them
+  (new var: Timelimit=30)[Bugz#71]
+* Fix quoting issue associated with charsets
+* default setting for LE is now RFC compliant: "\r\n"
+* Return-Path can now be user defined (new var: ReturnPath)
+  (the default is "" which implies no change from previous
+  behavior, which was to use either From or Sender) [Bugz#46]
+* X-Mailer header can now be disabled (by setting to a
+  whitespace string, eg "  ") [Bugz#66]
+* Bugz closed: #68, #60, #42, #43, #59, #55, #66, #48, #49,
+               #52, #31, #41, #5. #70, #69
+
+## Version 5.2.1 (January 16, 2012)
+* Closed several bugs #5
+* Performance improvements
+* MsgHTML() now returns the message as required.
+* New method: GetSentMIMEMessage() (returns full copy of sent message)
+
+## Version 5.2 (July 19, 2011)
+* protected MIME body and header
+* better DKIM DNS Resource Record support
+* better aly handling
+* htmlfilter class added to extras
+* moved to Apache Extras
+
+## Version 5.1 (October 20, 2009)
+* fixed filename issue with AddStringAttachment (thanks to Tony)
+* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in
+  addition to PHP mail()
+* added DKIM digital signing functionality, new properties:
+  - DKIM_domain (sets the domain name)
+  - DKIM_private (holds DKIM private key)
+  - DKIM_passphrase (holds your DKIM passphrase)
+  - DKIM_selector (holds the DKIM "selector")
+  - DKIM_identity (holds the identifying email address)
+* added callback function support
+  - callback function parameters include:
+    result, to, cc, bcc, subject and body
+  - see the test/test_callback.php file for usage.
+* added "auto" identity functionality
+  - can automatically add:
+    - Return-path (if Sender not set)
+    - Reply-To (if ReplyTo not set)
+  - can be disabled:
+    - $mail->SetFrom('yourname@yourdomain.com','First Last',false);
+    - or by adding the $mail->Sender and/or $mail->ReplyTo properties
+
+Note: "auto" identity added to help with emails ending up in spam or junk boxes because of missing headers
+
+## Version 5.0.2 (May 24, 2009)
+* Fix for missing attachments when inline graphics are present
+* Fix for missing Cc in header when using SMTP (mail was sent,
+  but not displayed in header -- Cc receiver only saw email To:
+  line and no Cc line, but did get the email (To receiver
+  saw same)
+
+## Version 5.0.1 (April 05, 2009)
+* Temporary fix for missing attachments
+
+## Version 5.0.0 (April 02, 2009)
+With the release of this version, we are initiating a new version numbering
+system to differentiate from the PHP4 version of PHPMailer.
+Most notable in this release is fully object oriented code.
+
+### class.smtp.php:
+* Refactored class.smtp.php to support new exception handling
+* code size reduced from 29.2 Kb to 25.6 Kb
+* Removed unnecessary functions from class.smtp.php:
+  - public function Expand($name) {
+  - public function Help($keyword="") {
+  - public function Noop() {
+  - public function Send($from) {
+  - public function SendOrMail($from) {
+  - public function Verify($name) {
+
+###  class.phpmailer.php:
+* Refactored class.phpmailer.php with new exception handling
+* Changed processing functionality of Sendmail and Qmail so they cannot be
+  inadvertently used
+* removed getFile() function, just became a simple wrapper for
+  file_get_contents()
+* added check for PHP version (will gracefully exit if not at least PHP 5.0)
+* enhanced code to check if an attachment source is the same as an embedded or
+  inline graphic source to eliminate duplicate attachments
+
+### New /test_script
+We have written a test script you can use to test the script as part of your
+installation. Once you press submit, the test script will send a multi-mime
+email with either the message you type in or an HTML email with an inline
+graphic. Two attachments are included in the email (one of the attachments
+is also the inline graphic so you can see that only one copy of the graphic
+is sent in the email). The test script will also display the functional
+script that you can copy/paste to your editor to duplicate the functionality.
+
+### New examples
+All new examples in both basic and advanced modes. Advanced examples show
+   Exception handling.
+
+### PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0
+All new documentation
+
+## Version 2.3 (November 06, 2008)
+* added Arabic language (many thanks to Bahjat Al Mostafa)
+* removed English language from language files and made it a default within
+  class.phpmailer.php - if no language is found, it will default to use
+  the english language translation
+* fixed public/private declarations
+* corrected line 1728, $basedir to $directory
+* added $sign_cert_file to avoid improper duplicate use of $sign_key_file
+* corrected $this->Hello on line 612 to $this->Helo
+* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user
+  if default is not acceptable
+* removed trim() from return results in EncodeQP
+* /test and three files it contained are removed from version 2.3
+* fixed phpunit.php for compliance with PHP5
+* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg);
+* We have removed the /phpdoc from the downloads. All documentation is now on
+  the http://phpmailer.codeworxtech.com website.
+
+## Version 2.2.1 () July 19 2008
+* fixed line 1092 in class.smtp.php (my apologies, error on my part)
+
+## Version 2.2 () July 15 2008
+* Fixed redirect issue (display of UTF-8 in thank you redirect)
+* fixed error in getResponse function declaration (class.pop3.php)
+* PHPMailer now PHP6 compliant
+* fixed line 1092 in class.smtp.php (endless loop from missing = sign)
+
+## Version 2.1 (Wed, June 04 2008)
+NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE APPRECIATED.
+
+* added S/MIME functionality (ability to digitally sign emails)
+  BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
+  The "Signed Emails" functionality adds the Sign method to pass the private key
+  filename and the password to read it, and then email will be sent with
+  content-type multipart/signed and with the digital signature attached.
+* fully compatible with E_STRICT error level
+  - Please note:
+    In about half the test environments this development version was subjected
+    to, an error was thrown for the date() functions used (line 1565 and 1569).
+    This is NOT a PHPMailer error, it is the result of an incorrectly configured
+    PHP5 installation. The fix is to modify your 'php.ini' file and include the
+    date.timezone = Etc/UTC (or your own zone)
+    directive, to your own server timezone
+  - If you do get this error, and are unable to access your php.ini file:
+    In your PHP script, add
+    `date_default_timezone_set('Etc/UTC');`
+  - do not try to use
+    `$myVar = date_default_timezone_get();`
+    as a test, it will throw an error.
+* added ability to define path (mainly for embedded images)
+  function `MsgHTML($message,$basedir='')` ... where:
+  `$basedir` is the fully qualified path
+* fixed `MsgHTML()` function:
+  - Embedded Images where images are specified by `<protocol>://` will not be altered or embedded
+* fixed the return value of SMTP exit code ( pclose )
+* addressed issue of multibyte characters in subject line and truncating
+* added ability to have user specified Message ID
+  (default is still that PHPMailer create a unique Message ID)
+* corrected unidentified message type to 'application/octet-stream'
+* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al).
+* added check for added attachments
+* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny")
+
+## Version 2.1.0beta2 (Sun, Dec 02 2007)
+* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon)
+* finished all testing, all known bugs corrected, enhancements tested
+
+Note: will NOT work with PHP4.
+
+Please note, this is BETA software **DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS; INTENDED STRICTLY FOR TESTING**
+
+## Version 2.1.0beta1
+Please note, this is BETA software
+** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
+ INTENDED STRICTLY FOR TESTING
+
+## Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release
+* implements new property to control VERP in class.smtp.php
+  example (requires instantiating class.smtp.php):
+  $mail->do_verp = true;
+* POP-before-SMTP functionality included, thanks to Richard Davey
+  (see class.pop3.php & pop3_before_smtp_test.php for examples)
+* included example showing how to use PHPMailer with GMAIL
+* fixed the missing Cc in SendMail() and Mail()
+
+## Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release
+* dramatically simplified using inline graphics ... it's fully automated and requires no user input
+* added automatic document type detection for attachments and pictures
+* added MsgHTML() function to replace Body tag for HTML emails
+* fixed the SendMail security issues (input validation vulnerability)
+* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address
+* removed the need to use the AltBody method (set from the HTML, or default text used)
+* set the PHP Mail() function as the default (still support SendMail, SMTP Mail)
+* removed the need to set the IsHTML property (set automatically)
+* added Estonian language file by Indrek P&auml;ri
+* added header injection patch
+* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc.
+* fixed warning message in SMTP get_lines method
+* added TLS/SSL SMTP support.
+* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)
+* Works with PHP installed as a module or as CGI-PHP
+NOTE: will NOT work with PHP5 in E_STRICT error mode
+
+## Version 1.73 (Sun, Jun 10 2005)
+* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
+* Now has a total of 20 translations
+* Fixed alt attachments bug: http://tinyurl.com/98u9k
+
+## Version 1.72 (Wed, May 25 2004)
+* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
+* Received: Removed this method because spam filter programs like
+  SpamAssassin reject this header.
+* Fixed error count bug.
+* SetLanguage default is now "language/".
+* Fixed magic_quotes_runtime bug.
+
+## Version 1.71 (Tue, Jul 28 2003)
+* Made several speed enhancements
+* Added German and Italian translation files
+* Fixed HELO/AUTH bugs on keep-alive connects
+* Now provides an error message if language file does not load
+* Fixed attachment EOL bug
+* Updated some unclear documentation
+* Added additional tests and improved others
+
+## Version 1.70 (Mon, Jun 20 2003)
+* Added SMTP keep-alive support
+* Added IsError method for error detection
+* Added error message translation support (SetLanguage)
+* Refactored many methods to increase library performance
+* Hello now sends the newer EHLO message before HELO as per RFC 2821
+* Removed the boundary class and replaced it with GetBoundary
+* Removed queue support methods
+* New $Hostname variable
+* New Message-ID header
+* Received header reformat
+* Helo variable default changed to $Hostname
+* Removed extra spaces in Content-Type definition (#667182)
+* Return-Path should be set to Sender when set
+* Adds Q or B encoding to headers when necessary
+* quoted-encoding should now encode NULs \000
+* Fixed encoding of body/AltBody (#553370)
+* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
+* Multiple bug fixes
+
+## Version 1.65 (Fri, Aug 09 2002)
+* Fixed non-visible attachment bug (#585097) for Outlook
+* SMTP connections are now closed after each transaction
+* Fixed SMTP::Expand return value
+* Converted SMTP class documentation to phpDocumentor format
+
+## Version 1.62 (Wed, Jun 26 2002)
+* Fixed multi-attach bug
+* Set proper word wrapping
+* Reduced memory use with attachments
+* Added more debugging
+* Changed documentation to phpDocumentor format
+
+## Version 1.60 (Sat, Mar 30 2002)
+* Sendmail pipe and address patch (Christian Holtje)
+* Added embedded image and read confirmation support (A. Ognio)
+* Added unit tests
+* Added SMTP timeout support (*nix only)
+* Added possibly temporary PluginDir variable for SMTP class
+* Added LE message line ending variable
+* Refactored boundary and attachment code
+* Eliminated SMTP class warnings
+* Added SendToQueue method for future queuing support
+
+## Version 1.54 (Wed, Dec 19 2001)
+* Add some queuing support code
+* Fixed a pesky multi/alt bug
+* Messages are no longer forced to have "To" addresses
+
+## Version 1.50 (Thu, Nov 08 2001)
+* Fix extra lines when not using SMTP mailer
+* Set WordWrap variable to int with a zero default
+
+## Version 1.47 (Tue, Oct 16 2001)
+* Fixed Received header code format
+* Fixed AltBody order error
+* Fixed alternate port warning
+
+## Version 1.45 (Tue, Sep 25 2001)
+* Added enhanced SMTP debug support
+* Added support for multiple ports on SMTP
+* Added Received header for tracing
+* Fixed AddStringAttachment encoding
+* Fixed possible header name quote bug
+* Fixed wordwrap() trim bug
+* Couple other small bug fixes
+
+## Version 1.41 (Wed, Aug 22 2001)
+* Fixed AltBody bug w/o attachments
+* Fixed rfc_date() for certain mail servers
+
+## Version 1.40 (Sun, Aug 12 2001)
+* Added multipart/alternative support (AltBody)
+* Documentation update
+* Fixed bug in Mercury MTA
+
+## Version 1.29 (Fri, Aug 03 2001)
+* Added AddStringAttachment() method
+* Added SMTP authentication support
+
+## Version 1.28 (Mon, Jul 30 2001)
+* Fixed a typo in SMTP class
+* Fixed header issue with Imail (win32) SMTP server
+* Made fopen() calls for attachments use "rb" to fix win32 error
+
+## Version 1.25 (Mon, Jul 02 2001)
+* Added RFC 822 date fix (Patrice)
+* Added improved error handling by adding a $ErrorInfo variable
+* Removed MailerDebug variable (obsolete with new error handler)
+
+## Version 1.20 (Mon, Jun 25 2001)
+* Added quoted-printable encoding (Patrice)
+* Set Version as public and removed PrintVersion()
+* Changed phpdoc to only display public variables and methods
+
+## Version 1.19 (Thu, Jun 21 2001)
+* Fixed MS Mail header bug
+* Added fix for Bcc problem with mail(). *Does not work on Win32*
+  (See PHP bug report: http://www.php.net/bugs.php?id=11616)
+* mail() no longer passes a fifth parameter when not needed
+
+## Version 1.15 (Fri, Jun 15 2001)
+Note: these changes contributed by Patrice Fournier
+* Changed all remaining \n to \r\n
+* Bcc: header no longer written to message except
+  when sent directly to sendmail
+* Added a small message to non-MIME compliant mail reader
+* Added Sender variable to change the Sender email
+  used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode
+* Changed boundary setting to a place it will be set only once
+* Removed transfer encoding for whole message when using multipart
+* Message body now uses Encoding in multipart messages
+* Can set encoding and type to attachments 7bit, 8bit
+  and binary attachment are sent as is, base64 are encoded
+* Can set Encoding to base64 to send 8 bits body
+  through 7 bits servers
+
+## Version 1.10 (Tue, Jun 12 2001)
+* Fixed win32 mail header bug (printed out headers in message body)
+
+## Version 1.09 (Fri, Jun 08 2001)
+* Changed date header to work with Netscape mail programs
+* Altered phpdoc documentation
+
+## Version 1.08 (Tue, Jun 05 2001)
+* Added enhanced error-checking
+* Added phpdoc documentation to source
+
+## Version 1.06 (Fri, Jun 01 2001)
+* Added optional name for file attachments
+
+## Version 1.05 (Tue, May 29 2001)
+* Code cleanup
+* Eliminated sendmail header warning message
+* Fixed possible SMTP error
+
+## Version 1.03 (Thu, May 24 2001)
+* Fixed problem where qmail sends out duplicate messages
+
+## Version 1.02 (Wed, May 23 2001)
+* Added multiple recipient and attachment Clear* methods
+* Added Sendmail public variable
+* Fixed problem with loading SMTP library multiple times
+
+## Version 0.98 (Tue, May 22 2001)
+* Fixed problem with redundant mail hosts sending out multiple messages
+* Added additional error handler code
+* Added AddCustomHeader() function
+* Added support for Microsoft mail client headers (affects priority)
+* Fixed small bug with Mailer variable
+* Added PrintVersion() function
+
+## Version 0.92 (Tue, May 15 2001)
+* Changed file names to class.phpmailer.php and class.smtp.php to match
+  current PHP class trend.
+* Fixed problem where body not being printed when a message is attached
+* Several small bug fixes
+
+## Version 0.90 (Tue, April 17 2001)
+* Initial public release
index 65baf42..e4dd00b 100755 (executable)
 <?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
+ * PHPMailer - PHP email creation and transport class.
+ * PHP Version 5
  * @package PHPMailer
- * @author Andy Prevost
- * @author Marcus Bointon
+ * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
  * @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
+ * @note 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.
  */
 
-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
+ * PHPMailer - PHP email creation and transport class.
+ * @package PHPMailer
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
  */
-  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) {
+class PHPMailer
+{
+    /**
+     * The PHPMailer Version number.
+     * @var string
+     */
+    public $Version = '5.2.14';
+
+    /**
+     * Email priority.
+     * Options: null (default), 1 = High, 3 = Normal, 5 = low.
+     * When null, the header is not set at all.
+     * @var integer
+     */
+    public $Priority = null;
+
+    /**
+     * The character set of the message.
+     * @var string
+     */
+    public $CharSet = 'iso-8859-1';
+
+    /**
+     * The MIME Content-type of the message.
+     * @var string
+     */
+    public $ContentType = 'text/plain';
+
+    /**
+     * The message encoding.
+     * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
+     * @var string
+     */
+    public $Encoding = '8bit';
+
+    /**
+     * Holds the most recent mailer error message.
+     * @var string
+     */
+    public $ErrorInfo = '';
+
+    /**
+     * The From email address for the message.
+     * @var string
+     */
+    public $From = 'root@localhost';
+
+    /**
+     * The From name of the message.
+     * @var string
+     */
+    public $FromName = 'Root User';
+
+    /**
+     * 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 = '';
+
+    /**
+     * The Return-Path of the message.
+     * If empty, it will be set to either From or Sender.
+     * @var string
+     * @deprecated Email senders should never set a return-path header;
+     * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
+     * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
+     */
+    public $ReturnPath = '';
+
+    /**
+     * The Subject of the message.
+     * @var string
+     */
+    public $Subject = '';
+
+    /**
+     * An HTML or plain text message body.
+     * If HTML then call isHTML(true).
+     * @var string
+     */
+    public $Body = '';
+
+    /**
+     * The plain-text message body.
+     * This body can be read by mail clients that do not have HTML email
+     * capability such as mutt & Eudora.
+     * Clients that can read HTML will view the normal Body.
+     * @var string
+     */
+    public $AltBody = '';
+
+    /**
+     * An iCal message part body.
+     * Only supported in simple alt or alt_inline message types
+     * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
+     * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
+     * @link http://kigkonsult.se/iCalcreator/
+     * @var string
+     */
+    public $Ical = '';
+
+    /**
+     * The complete compiled MIME message body.
+     * @access protected
+     * @var string
+     */
+    protected $MIMEBody = '';
+
+    /**
+     * The complete compiled MIME message headers.
+     * @var string
+     * @access protected
+     */
+    protected $MIMEHeader = '';
+
+    /**
+     * Extra headers that createHeader() doesn't fold in.
+     * @var string
+     * @access protected
+     */
+    protected $mailHeader = '';
+
+    /**
+     * Word-wrap the message body to this number of chars.
+     * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
+     * @var integer
+     */
+    public $WordWrap = 0;
+
+    /**
+     * Which method to use to send mail.
+     * Options: "mail", "sendmail", or "smtp".
+     * @var string
+     */
+    public $Mailer = 'mail';
+
+    /**
+     * The path to the sendmail program.
+     * @var string
+     */
+    public $Sendmail = '/usr/sbin/sendmail';
+
+    /**
+     * Whether mail() uses a fully sendmail-compatible MTA.
+     * One which supports sendmail's "-oi -f" options.
+     * @var boolean
+     */
+    public $UseSendmailOptions = true;
+
+    /**
+     * Path to PHPMailer plugins.
+     * Useful if the SMTP class is not in the PHP include path.
+     * @var string
+     * @deprecated Should not be needed now there is an autoloader.
+     */
+    public $PluginDir = '';
+
+    /**
+     * The email address that a reading confirmation should be sent to, also known as read receipt.
+     * @var string
+     */
+    public $ConfirmReadingTo = '';
+
+    /**
+     * The hostname to use in the Message-ID header and as default HELO string.
+     * If empty, PHPMailer attempts to find one with, in order,
+     * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
+     * 'localhost.localdomain'.
+     * @var string
+     */
+    public $Hostname = '';
+
+    /**
+     * An ID to be used in the Message-ID header.
+     * If empty, a unique id will be generated.
+     * @var string
+     */
+    public $MessageID = '';
+
+    /**
+     * The message Date to be used in the Date header.
+     * If empty, the current date will be added.
+     * @var string
+     */
+    public $MessageDate = '';
+
+    /**
+     * SMTP hosts.
+     * Either a single hostname or multiple semicolon-delimited hostnames.
+     * 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").
+     * You can also specify encryption type, for example:
+     * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
+     * Hosts will be tried in order.
+     * @var string
+     */
+    public $Host = 'localhost';
+
+    /**
+     * The default SMTP server port.
+     * @var integer
+     * @TODO Why is this needed when the SMTP class takes care of it?
+     */
+    public $Port = 25;
+
+    /**
+     * The SMTP HELO of the message.
+     * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
+     * one with the same method described above for $Hostname.
+     * @var string
+     * @see PHPMailer::$Hostname
+     */
+    public $Helo = '';
+
+    /**
+     * What kind of encryption to use on the SMTP connection.
+     * Options: '', 'ssl' or 'tls'
+     * @var string
+     */
+    public $SMTPSecure = '';
+
+    /**
+     * Whether to enable TLS encryption automatically if a server supports it,
+     * even if `SMTPSecure` is not set to 'tls'.
+     * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
+     * @var boolean
+     */
+    public $SMTPAutoTLS = true;
+
+    /**
+     * Whether to use SMTP authentication.
+     * Uses the Username and Password properties.
+     * @var boolean
+     * @see PHPMailer::$Username
+     * @see PHPMailer::$Password
+     */
+    public $SMTPAuth = false;
+
+    /**
+     * Options array passed to stream_context_create when connecting via SMTP.
+     * @var array
+     */
+    public $SMTPOptions = array();
+
+    /**
+     * SMTP username.
+     * @var string
+     */
+    public $Username = '';
+
+    /**
+     * SMTP password.
+     * @var string
+     */
+    public $Password = '';
+
+    /**
+     * SMTP auth type.
+     * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
+     * @var string
+     */
+    public $AuthType = '';
+
+    /**
+     * SMTP realm.
+     * Used for NTLM auth
+     * @var string
+     */
+    public $Realm = '';
+
+    /**
+     * SMTP workstation.
+     * Used for NTLM auth
+     * @var string
+     */
+    public $Workstation = '';
+
+    /**
+     * The SMTP server timeout in seconds.
+     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
+     * @var integer
+     */
+    public $Timeout = 300;
+
+    /**
+     * SMTP class debug output mode.
+     * Debug output level.
+     * Options:
+     * * `0` No output
+     * * `1` Commands
+     * * `2` Data and commands
+     * * `3` As 2 plus connection status
+     * * `4` Low-level data output
+     * @var integer
+     * @see SMTP::$do_debug
+     */
+    public $SMTPDebug = 0;
+
+    /**
+     * How to handle debug output.
+     * Options:
+     * * `echo` Output plain-text as-is, appropriate for CLI
+     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
+     * * `error_log` Output to error log as configured in php.ini
+     *
+     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
+     * <code>
+     * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
+     * </code>
+     * @var string|callable
+     * @see SMTP::$Debugoutput
+     */
+    public $Debugoutput = 'echo';
+
+    /**
+     * Whether to keep SMTP connection open after each message.
+     * If this is set to true then to close the connection
+     * requires an explicit call to smtpClose().
+     * @var boolean
+     */
+    public $SMTPKeepAlive = false;
+
+    /**
+     * Whether to split multiple to addresses into multiple messages
+     * or send them all in one message.
+     * @var boolean
+     */
+    public $SingleTo = false;
+
+    /**
+     * Storage for addresses when SingleTo is enabled.
+     * @var array
+     * @TODO This should really not be public
+     */
+    public $SingleToArray = array();
+
+    /**
+     * Whether to generate VERP addresses on send.
+     * Only applicable when sending via SMTP.
+     * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
+     * @link http://www.postfix.org/VERP_README.html Postfix VERP info
+     * @var boolean
+     */
+    public $do_verp = false;
+
+    /**
+     * Whether to allow sending messages with an empty body.
+     * @var boolean
+     */
+    public $AllowEmpty = false;
+
+    /**
+     * The default line ending.
+     * @note The default remains "\n". We force CRLF where we know
+     *        it must be used via self::CRLF.
+     * @var string
+     */
+    public $LE = "\n";
+
+    /**
+     * DKIM selector.
+     * @var string
+     */
+    public $DKIM_selector = '';
+
+    /**
+     * DKIM Identity.
+     * Usually the email address used as the source of the email
+     * @var string
+     */
+    public $DKIM_identity = '';
+
+    /**
+     * DKIM passphrase.
+     * Used if your key is encrypted.
+     * @var string
+     */
+    public $DKIM_passphrase = '';
+
+    /**
+     * DKIM signing domain name.
+     * @example 'example.com'
+     * @var string
+     */
+    public $DKIM_domain = '';
+
+    /**
+     * DKIM private key file path.
+     * @var string
+     */
+    public $DKIM_private = '';
+
+    /**
+     * Callback Action function name.
+     *
+     * The function that handles the result of the send email action.
+     * It is called out by send() for each email sent.
+     *
+     * Value can be any php callable: http://www.php.net/is_callable
+     *
+     * Parameters:
+     *   boolean $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
+     *   string  $from          email address of sender
+     * @var string
+     */
+    public $action_function = '';
+
+    /**
+     * What to put in the X-Mailer header.
+     * Options: An empty string for PHPMailer default, whitespace for none, or a string to use
+     * @var string
+     */
+    public $XMailer = '';
+
+    /**
+     * An instance of the SMTP sender class.
+     * @var SMTP
+     * @access protected
+     */
+    protected $smtp = null;
+
+    /**
+     * The array of 'to' names and addresses.
+     * @var array
+     * @access protected
+     */
+    protected $to = array();
+
+    /**
+     * The array of 'cc' names and addresses.
+     * @var array
+     * @access protected
+     */
+    protected $cc = array();
+
+    /**
+     * The array of 'bcc' names and addresses.
+     * @var array
+     * @access protected
+     */
+    protected $bcc = array();
+
+    /**
+     * The array of reply-to names and addresses.
+     * @var array
+     * @access protected
+     */
+    protected $ReplyTo = array();
+
+    /**
+     * An array of all kinds of addresses.
+     * Includes all of $to, $cc, $bcc
+     * @var array
+     * @access protected
+     * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
+     */
+    protected $all_recipients = array();
+
+    /**
+     * An array of names and addresses queued for validation.
+     * In send(), valid and non duplicate entries are moved to $all_recipients
+     * and one of $to, $cc, or $bcc.
+     * This array is used only for addresses with IDN.
+     * @var array
+     * @access protected
+     * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
+     * @see PHPMailer::$all_recipients
+     */
+    protected $RecipientsQueue = array();
+
+    /**
+     * An array of reply-to names and addresses queued for validation.
+     * In send(), valid and non duplicate entries are moved to $ReplyTo.
+     * This array is used only for addresses with IDN.
+     * @var array
+     * @access protected
+     * @see PHPMailer::$ReplyTo
+     */
+    protected $ReplyToQueue = array();
+
+    /**
+     * The array of attachments.
+     * @var array
+     * @access protected
+     */
+    protected $attachment = array();
+
+    /**
+     * The array of custom headers.
+     * @var array
+     * @access protected
+     */
+    protected $CustomHeader = array();
+
+    /**
+     * The most recent Message-ID (including angular brackets).
+     * @var string
+     * @access protected
+     */
+    protected $lastMessageID = '';
+
+    /**
+     * The message's MIME type.
+     * @var string
+     * @access protected
+     */
+    protected $message_type = '';
+
+    /**
+     * The array of MIME boundary strings.
+     * @var array
+     * @access protected
+     */
+    protected $boundary = array();
+
+    /**
+     * The array of available languages.
+     * @var array
+     * @access protected
+     */
+    protected $language = array();
+
+    /**
+     * The number of errors encountered.
+     * @var integer
+     * @access protected
+     */
+    protected $error_count = 0;
+
+    /**
+     * The S/MIME certificate file path.
+     * @var string
+     * @access protected
+     */
+    protected $sign_cert_file = '';
+
+    /**
+     * The S/MIME key file path.
+     * @var string
+     * @access protected
+     */
+    protected $sign_key_file = '';
+
+    /**
+     * The optional S/MIME extra certificates ("CA Chain") file path.
+     * @var string
+     * @access protected
+     */
+    protected $sign_extracerts_file = '';
+
+    /**
+     * The S/MIME password for the key.
+     * Used only if the key is encrypted.
+     * @var string
+     * @access protected
+     */
+    protected $sign_key_pass = '';
+
+    /**
+     * Whether to throw exceptions for errors.
+     * @var boolean
+     * @access protected
+     */
+    protected $exceptions = false;
+
+    /**
+     * Unique ID used for message ID and boundaries.
+     * @var string
+     * @access protected
+     */
+    protected $uniqueid = '';
+
+    /**
+     * Error severity: message only, continue processing.
+     */
+    const STOP_MESSAGE = 0;
+
+    /**
+     * Error severity: message, likely ok to continue processing.
+     */
+    const STOP_CONTINUE = 1;
+
+    /**
+     * Error severity: message, plus full stop, critical error reached.
+     */
+    const STOP_CRITICAL = 2;
+
+    /**
+     * SMTP RFC standard line ending.
+     */
+    const CRLF = "\r\n";
+
+    /**
+     * The maximum line length allowed by RFC 2822 section 2.1.1
+     * @var integer
+     */
+    const MAX_LINE_LENGTH = 998;
+
+    /**
+     * Constructor.
+     * @param boolean $exceptions Should we throw external exceptions?
+     */
+    public function __construct($exceptions = false)
+    {
+        $this->exceptions = (boolean)$exceptions;
+    }
+
+    /**
+     * Destructor.
+     */
+    public function __destruct()
+    {
+        //Close any open SMTP connection nicely
+        if ($this->Mailer == 'smtp') {
+            $this->smtpClose();
+        }
+    }
+
+    /**
+     * Call mail() in a safe_mode-aware fashion.
+     * Also, unless sendmail_path points to sendmail (or something that
+     * claims to be sendmail), don't pass params (not a perfect fix,
+     * but it will do)
+     * @param string $to To
+     * @param string $subject Subject
+     * @param string $body Message Body
+     * @param string $header Additional Header(s)
+     * @param string $params Params
+     * @access private
+     * @return boolean
+     */
+    private function mailPassthru($to, $subject, $body, $header, $params)
+    {
+        //Check overloading of mail function to avoid double-encoding
+        if (ini_get('mbstring.func_overload') & 1) {
+            $subject = $this->secureHeader($subject);
+        } else {
+            $subject = $this->encodeHeader($this->secureHeader($subject));
+        }
+        if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
+            $result = @mail($to, $subject, $body, $header);
+        } else {
+            $result = @mail($to, $subject, $body, $header, $params);
+        }
+        return $result;
+    }
+
+    /**
+     * Output debugging info via user-defined method.
+     * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
+     * @see PHPMailer::$Debugoutput
+     * @see PHPMailer::$SMTPDebug
+     * @param string $str
+     */
+    protected function edebug($str)
+    {
+        if ($this->SMTPDebug <= 0) {
+            return;
+        }
+        //Avoid clash with built-in function names
+        if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
+            call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
+            return;
+        }
+        switch ($this->Debugoutput) {
+            case 'error_log':
+                //Don't output, just log
+                error_log($str);
+                break;
+            case 'html':
+                //Cleans up output a bit for a better looking, HTML-safe output
+                echo htmlentities(
+                    preg_replace('/[\r\n]+/', '', $str),
+                    ENT_QUOTES,
+                    'UTF-8'
+                )
+                . "<br>\n";
+                break;
+            case 'echo':
+            default:
+                //Normalize line breaks
+                $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
+                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
+                    "\n",
+                    "\n                   \t                  ",
+                    trim($str)
+                ) . "\n";
+        }
+    }
+
+    /**
+     * Sets message type to HTML or plain.
+     * @param boolean $isHtml True for HTML mode.
+     * @return void
+     */
+    public function isHTML($isHtml = true)
+    {
+        if ($isHtml) {
+            $this->ContentType = 'text/html';
+        } else {
+            $this->ContentType = 'text/plain';
+        }
+    }
+
+    /**
+     * Send messages using SMTP.
+     * @return void
+     */
+    public function isSMTP()
+    {
+        $this->Mailer = 'smtp';
+    }
+
+    /**
+     * Send messages using PHP's mail() function.
+     * @return void
+     */
+    public function isMail()
+    {
+        $this->Mailer = 'mail';
+    }
+
+    /**
+     * Send messages using $Sendmail.
+     * @return void
+     */
+    public function isSendmail()
+    {
+        $ini_sendmail_path = ini_get('sendmail_path');
+
+        if (!stristr($ini_sendmail_path, 'sendmail')) {
+            $this->Sendmail = '/usr/sbin/sendmail';
+        } else {
+            $this->Sendmail = $ini_sendmail_path;
+        }
+        $this->Mailer = 'sendmail';
+    }
+
+    /**
+     * Send messages using qmail.
+     * @return void
+     */
+    public function isQmail()
+    {
+        $ini_sendmail_path = ini_get('sendmail_path');
+
+        if (!stristr($ini_sendmail_path, 'qmail')) {
+            $this->Sendmail = '/var/qmail/bin/qmail-inject';
+        } else {
+            $this->Sendmail = $ini_sendmail_path;
+        }
+        $this->Mailer = 'qmail';
+    }
+
+    /**
+     * Add a "To" address.
+     * @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
+     */
+    public function addAddress($address, $name = '')
+    {
+        return $this->addOrEnqueueAnAddress('to', $address, $name);
+    }
+
+    /**
+     * Add a "CC" address.
+     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
+     * @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
+     */
+    public function addCC($address, $name = '')
+    {
+        return $this->addOrEnqueueAnAddress('cc', $address, $name);
+    }
+
+    /**
+     * Add a "BCC" address.
+     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
+     * @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
+     */
+    public function addBCC($address, $name = '')
+    {
+        return $this->addOrEnqueueAnAddress('bcc', $address, $name);
+    }
+
+    /**
+     * Add a "Reply-To" address.
+     * @param string $address The email address to reply to
+     * @param string $name
+     * @return boolean true on success, false if address already used or invalid in some way
+     */
+    public function addReplyTo($address, $name = '')
+    {
+        return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
+    }
+
+    /**
+     * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
+     * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
+     * be modified after calling this function), addition of such addresses is delayed until send().
+     * Addresses that have been added already return false, but do not throw exceptions.
+     * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
+     * @param string $address The email address to send, resp. to reply to
+     * @param string $name
+     * @throws phpmailerException
+     * @return boolean true on success, false if address already used or invalid in some way
+     * @access protected
+     */
+    protected function addOrEnqueueAnAddress($kind, $address, $name)
+    {
+        $address = trim($address);
+        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+        if (($pos = strrpos($address, '@')) === false) {
+            // At-sign is misssing.
+            $error_message = $this->lang('invalid_address') . $address;
+            $this->setError($error_message);
+            $this->edebug($error_message);
+            if ($this->exceptions) {
+                throw new phpmailerException($error_message);
+            }
+            return false;
+        }
+        $params = array($kind, $address, $name);
+        // Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
+        if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
+            if ($kind != 'Reply-To') {
+                if (!array_key_exists($address, $this->RecipientsQueue)) {
+                    $this->RecipientsQueue[$address] = $params;
+                    return true;
+                }
+            } else {
+                if (!array_key_exists($address, $this->ReplyToQueue)) {
+                    $this->ReplyToQueue[$address] = $params;
+                    return true;
+                }
+            }
+            return false;
+        }
+        // Immediately add standard addresses without IDN.
+        return call_user_func_array(array($this, 'addAnAddress'), $params);
+    }
+
+    /**
+     * Add an address to one of the recipient arrays or to the ReplyTo array.
+     * Addresses that have been added already return false, but do not throw exceptions.
+     * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
+     * @param string $address The email address to send, resp. to reply to
+     * @param string $name
+     * @throws phpmailerException
+     * @return boolean true on success, false if address already used or invalid in some way
+     * @access protected
+     */
+    protected function addAnAddress($kind, $address, $name = '')
+    {
+        if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
+            $error_message = $this->lang('Invalid recipient kind: ') . $kind;
+            $this->setError($error_message);
+            $this->edebug($error_message);
+            if ($this->exceptions) {
+                throw new phpmailerException($error_message);
+            }
+            return false;
+        }
+        if (!$this->validateAddress($address)) {
+            $error_message = $this->lang('invalid_address') . $address;
+            $this->setError($error_message);
+            $this->edebug($error_message);
+            if ($this->exceptions) {
+                throw new phpmailerException($error_message);
+            }
+            return false;
+        }
+        if ($kind != 'Reply-To') {
+            if (!array_key_exists(strtolower($address), $this->all_recipients)) {
+                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;
-      } 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];
+    }
+
+    /**
+     * Parse and validate a string containing one or more RFC822-style comma-separated email addresses
+     * of the form "display name <address>" into an array of name/address pairs.
+     * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
+     * Note that quotes in the name part are removed.
+     * @param string $addrstr The address list string
+     * @param bool $useimap Whether to use the IMAP extension to parse the list
+     * @return array
+     * @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
+     */
+    public function parseAddresses($addrstr, $useimap = true)
+    {
+        $addresses = array();
+        if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
+            //Use this built-in parser if it's available
+            $list = imap_rfc822_parse_adrlist($addrstr, '');
+            foreach ($list as $address) {
+                if ($address->host != '.SYNTAX-ERROR.') {
+                    if ($this->validateAddress($address->mailbox . '@' . $address->host)) {
+                        $addresses[] = array(
+                            'name' => (property_exists($address, 'personal') ? $address->personal : ''),
+                            'address' => $address->mailbox . '@' . $address->host
+                        );
+                    }
+                }
+            }
         } 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);
+            //Use this simpler parser
+            $list = explode(',', $addrstr);
+            foreach ($list as $address) {
+                $address = trim($address);
+                //Is there a separate name part?
+                if (strpos($address, '<') === false) {
+                    //No separate name, just use the whole thing
+                    if ($this->validateAddress($address)) {
+                        $addresses[] = array(
+                            'name' => '',
+                            'address' => $address
+                        );
+                    }
+                } else {
+                    list($name, $email) = explode('<', $address);
+                    $email = trim(str_replace('>', '', $email));
+                    if ($this->validateAddress($email)) {
+                        $addresses[] = array(
+                            'name' => trim(str_replace(array('"', "'"), '', $name)),
+                            'address' => $email
+                        );
+                    }
+                }
+            }
+        }
+        return $addresses;
+    }
+
+    /**
+     * Set the From and FromName properties.
+     * @param string $address
+     * @param string $name
+     * @param boolean $auto Whether to also set the Sender address, defaults to true
+     * @throws phpmailerException
+     * @return boolean
+     */
+    public function setFrom($address, $name = '', $auto = true)
+    {
+        $address = trim($address);
+        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+        // Don't validate now addresses with IDN. Will be done in send().
+        if (($pos = strrpos($address, '@')) === false or
+            (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
+            !$this->validateAddress($address)) {
+            $error_message = $this->lang('invalid_address') . $address;
+            $this->setError($error_message);
+            $this->edebug($error_message);
+            if ($this->exceptions) {
+                throw new phpmailerException($error_message);
+            }
+            return false;
+        }
+        $this->From = $address;
+        $this->FromName = $name;
+        if ($auto) {
+            if (empty($this->Sender)) {
+                $this->Sender = $address;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Return the Message-ID header of the last email.
+     * Technically this is the value from the last time the headers were created,
+     * but it's also the message ID of the last sent message except in
+     * pathological cases.
+     * @return string
+     */
+    public function getLastMessageID()
+    {
+        return $this->lastMessageID;
+    }
+
+    /**
+     * Check that a string looks like an email address.
+     * @param string $address The email address to check
+     * @param string $patternselect A selector for the validation pattern to use :
+     * * `auto` Pick best pattern automatically;
+     * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
+     * * `pcre` Use old PCRE implementation;
+     * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
+     * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
+     * * `noregex` Don't use a regex: super fast, really dumb.
+     * @return boolean
+     * @static
+     * @access public
+     */
+    public static function validateAddress($address, $patternselect = 'auto')
+    {
+        //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
+        if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
+            return false;
+        }
+        if (!$patternselect or $patternselect == 'auto') {
+            //Check this constant first so it works when extension_loaded() is disabled by safe mode
+            //Constant was added in PHP 5.2.4
+            if (defined('PCRE_VERSION')) {
+                //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2
+                if (version_compare(PCRE_VERSION, '8.0.3') >= 0) {
+                    $patternselect = 'pcre8';
+                } else {
+                    $patternselect = 'pcre';
+                }
+            } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) {
+                //Fall back to older PCRE
+                $patternselect = 'pcre';
             } else {
-              $message .= $buf . $soft_break;
+                //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension
+                if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
+                    $patternselect = 'php';
+                } else {
+                    $patternselect = 'noregex';
+                }
             }
-            $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);
+        }
+        switch ($patternselect) {
+            case 'pcre8':
+                /**
+                 * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains.
+                 * @link http://squiloople.com/2009/12/20/email-address-validation/
+                 * @copyright 2009-2010 Michael Rushton
+                 * Feel free to use and redistribute this code. But please keep this copyright notice.
+                 */
+                return (boolean)preg_match(
+                    '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' .
+                    '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' .
+                    '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' .
+                    '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' .
+                    '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .
+                    '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .
+                    '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .
+                    '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
+                    '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD',
+                    $address
+                );
+            case 'pcre':
+                //An older regex that doesn't need a recent PCRE
+                return (boolean)preg_match(
+                    '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' .
+                    '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' .
+                    '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' .
+                    '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' .
+                    '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' .
+                    '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' .
+                    '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' .
+                    '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' .
+                    '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
+                    '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD',
+                    $address
+                );
+            case 'html5':
+                /**
+                 * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
+                 * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)
+                 */
+                return (boolean)preg_match(
+                    '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[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])?)*$/sD',
+                    $address
+                );
+            case 'noregex':
+                //No PCRE! Do something _very_ approximate!
+                //Check the address is 3 chars or longer and contains an @ that's not the first or last char
+                return (strlen($address) >= 3
+                    and strpos($address, '@') >= 1
+                    and strpos($address, '@') != strlen($address) - 1);
+            case 'php':
+            default:
+                return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
+        }
+    }
+
+    /**
+     * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
+     * "intl" and "mbstring" PHP extensions.
+     * @return bool "true" if required functions for IDN support are present
+     */
+    public function idnSupported()
+    {
+        // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2.
+        return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
+    }
+
+    /**
+     * Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
+     * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
+     * This function silently returns unmodified address if:
+     * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
+     * - Conversion to punycode is impossible (e.g. required PHP functions are not available)
+     *   or fails for any reason (e.g. domain has characters not allowed in an IDN)
+     * @see PHPMailer::$CharSet
+     * @param string $address The email address to convert
+     * @return string The encoded address in ASCII form
+     */
+    public function punyencodeAddress($address)
+    {
+        // Verify we have required functions, CharSet, and at-sign.
+        if ($this->idnSupported() and
+            !empty($this->CharSet) and
+            ($pos = strrpos($address, '@')) !== false) {
+            $domain = substr($address, ++$pos);
+            // Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
+            if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
+                $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
+                if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
+                    idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
+                    idn_to_ascii($domain)) !== false) {
+                    return substr($address, 0, $pos) . $punycode;
+                }
+            }
+        }
+        return $address;
+    }
+
+    /**
+     * Create a message and send it.
+     * Uses the sending method specified by $Mailer.
+     * @throws phpmailerException
+     * @return boolean false on error - See the ErrorInfo property for details of the error.
+     */
+    public function send()
+    {
+        try {
+            if (!$this->preSend()) {
+                return false;
+            }
+            return $this->postSend();
+        } catch (phpmailerException $exc) {
+            $this->mailHeader = '';
+            $this->setError($exc->getMessage());
+            if ($this->exceptions) {
+                throw $exc;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * Prepare a message for sending.
+     * @throws phpmailerException
+     * @return boolean
+     */
+    public function preSend()
+    {
+        try {
+            $this->error_count = 0; // Reset errors
+            $this->mailHeader = '';
+
+            // Dequeue recipient and Reply-To addresses with IDN
+            foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
+                $params[1] = $this->punyencodeAddress($params[1]);
+                call_user_func_array(array($this, 'addAnAddress'), $params);
+            }
+            if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
+                throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
+            }
+
+            // Validate From, Sender, and ConfirmReadingTo addresses
+            foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
+                $this->$address_kind = trim($this->$address_kind);
+                if (empty($this->$address_kind)) {
+                    continue;
+                }
+                $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
+                if (!$this->validateAddress($this->$address_kind)) {
+                    $error_message = $this->lang('invalid_address') . $this->$address_kind;
+                    $this->setError($error_message);
+                    $this->edebug($error_message);
+                    if ($this->exceptions) {
+                        throw new phpmailerException($error_message);
+                    }
+                    return false;
+                }
+            }
+
+            // Set whether the message is multipart/alternative
+            if (!empty($this->AltBody)) {
+                $this->ContentType = 'multipart/alternative';
+            }
+
+            $this->setMessageType();
+            // Refuse to send an empty message unless we are specifically allowing it
+            if (!$this->AllowEmpty and empty($this->Body)) {
+                throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL);
+            }
+
+            // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
+            $this->MIMEHeader = '';
+            $this->MIMEBody = $this->createBody();
+            // createBody may have added some headers, so retain them
+            $tempheaders = $this->MIMEHeader;
+            $this->MIMEHeader = $this->createHeader();
+            $this->MIMEHeader .= $tempheaders;
+
+            // To capture the complete message when using mail(), create
+            // an extra header list which createHeader() doesn't fold in
+            if ($this->Mailer == 'mail') {
+                if (count($this->to) > 0) {
+                    $this->mailHeader .= $this->addrAppend('To', $this->to);
+                } else {
+                    $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');
+                }
+                $this->mailHeader .= $this->headerLine(
+                    'Subject',
+                    $this->encodeHeader($this->secureHeader(trim($this->Subject)))
+                );
+            }
+
+            // Sign with DKIM if enabled
+            if (!empty($this->DKIM_domain)
+                && !empty($this->DKIM_private)
+                && !empty($this->DKIM_selector)
+                && file_exists($this->DKIM_private)) {
+                $header_dkim = $this->DKIM_Add(
+                    $this->MIMEHeader . $this->mailHeader,
+                    $this->encodeHeader($this->secureHeader($this->Subject)),
+                    $this->MIMEBody
+                );
+                $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF .
+                    str_replace("\r\n", "\n", $header_dkim) . self::CRLF;
+            }
+            return true;
+        } catch (phpmailerException $exc) {
+            $this->setError($exc->getMessage());
+            if ($this->exceptions) {
+                throw $exc;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * Actually send a message.
+     * Send the email via the selected mechanism
+     * @throws phpmailerException
+     * @return boolean
+     */
+    public function postSend()
+    {
+        try {
+            // Choose the mailer and send through it
+            switch ($this->Mailer) {
+                case 'sendmail':
+                case 'qmail':
+                    return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
+                case 'smtp':
+                    return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
+                case 'mail':
+                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
+                default:
+                    $sendMethod = $this->Mailer.'Send';
+                    if (method_exists($this, $sendMethod)) {
+                        return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
+                    }
+
+                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
+            }
+        } catch (phpmailerException $exc) {
+            $this->setError($exc->getMessage());
+            $this->edebug($exc->getMessage());
+            if ($this->exceptions) {
+                throw $exc;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Send mail using the $Sendmail program.
+     * @param string $header The message headers
+     * @param string $body The message body
+     * @see PHPMailer::$Sendmail
+     * @throws phpmailerException
+     * @access protected
+     * @return boolean
+     */
+    protected function sendmailSend($header, $body)
+    {
+        if ($this->Sender != '') {
+            if ($this->Mailer == 'qmail') {
+                $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+            } else {
+                $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+            }
+        } else {
+            if ($this->Mailer == 'qmail') {
+                $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail));
             } else {
-              $buf = $part;
+                $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail));
+            }
+        }
+        if ($this->SingleTo) {
+            foreach ($this->SingleToArray as $toAddr) {
+                if (!@$mail = popen($sendmail, 'w')) {
+                    throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+                }
+                fputs($mail, 'To: ' . $toAddr . "\n");
+                fputs($mail, $header);
+                fputs($mail, $body);
+                $result = pclose($mail);
+                $this->doCallback(
+                    ($result == 0),
+                    array($toAddr),
+                    $this->cc,
+                    $this->bcc,
+                    $this->Subject,
+                    $body,
+                    $this->From
+                );
+                if ($result != 0) {
+                    throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+                }
             }
-          }
         } 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 (!@$mail = popen($sendmail, 'w')) {
+                throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+            }
+            fputs($mail, $header);
+            fputs($mail, $body);
+            $result = pclose($mail);
+            $this->doCallback(
+                ($result == 0),
+                $this->to,
+                $this->cc,
+                $this->bcc,
+                $this->Subject,
+                $body,
+                $this->From
+            );
+            if ($result != 0) {
+                throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Send mail using the PHP mail() function.
+     * @param string $header The message headers
+     * @param string $body The message body
+     * @link http://www.php.net/manual/en/book.mail.php
+     * @throws phpmailerException
+     * @access protected
+     * @return boolean
+     */
+    protected function mailSend($header, $body)
+    {
+        $toArr = array();
+        foreach ($this->to as $toaddr) {
+            $toArr[] = $this->addrFormat($toaddr);
+        }
+        $to = implode(', ', $toArr);
 
-    if($this->ConfirmReadingTo != '') {
-      $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
+        if (empty($this->Sender)) {
+            $params = ' ';
+        } else {
+            $params = sprintf('-f%s', $this->Sender);
+        }
+        if ($this->Sender != '' and !ini_get('safe_mode')) {
+            $old_from = ini_get('sendmail_from');
+            ini_set('sendmail_from', $this->Sender);
+        }
+        $result = false;
+        if ($this->SingleTo && count($toArr) > 1) {
+            foreach ($toArr as $toAddr) {
+                $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
+                $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
+            }
+        } else {
+            $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
+            $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
+        }
+        if (isset($old_from)) {
+            ini_set('sendmail_from', $old_from);
+        }
+        if (!$result) {
+            throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL);
+        }
+        return true;
     }
 
-    // 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])));
+    /**
+     * Get an instance to use for SMTP operations.
+     * Override this function to load your own SMTP implementation
+     * @return SMTP
+     */
+    public function getSMTPInstance()
+    {
+        if (!is_object($this->smtp)) {
+            $this->smtp = new SMTP;
+        }
+        return $this->smtp;
+    }
+
+    /**
+     * Send mail via SMTP.
+     * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
+     * Uses the PHPMailerSMTP class by default.
+     * @see PHPMailer::getSMTPInstance() to use a different class.
+     * @param string $header The message headers
+     * @param string $body The message body
+     * @throws phpmailerException
+     * @uses SMTP
+     * @access protected
+     * @return boolean
+     */
+    protected function smtpSend($header, $body)
+    {
+        $bad_rcpt = array();
+        if (!$this->smtpConnect($this->SMTPOptions)) {
+            throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
+        }
+        if ('' == $this->Sender) {
+            $smtp_from = $this->From;
+        } else {
+            $smtp_from = $this->Sender;
+        }
+        if (!$this->smtp->mail($smtp_from)) {
+            $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
+            throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
+        }
+
+        // Attempt to send to all recipients
+        foreach (array($this->to, $this->cc, $this->bcc) as $togroup) {
+            foreach ($togroup as $to) {
+                if (!$this->smtp->recipient($to[0])) {
+                    $error = $this->smtp->getError();
+                    $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']);
+                    $isSent = false;
+                } else {
+                    $isSent = true;
+                }
+                $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From);
+            }
+        }
+
+        // Only send the DATA command if we have viable recipients
+        if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
+            throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
+        }
+        if ($this->SMTPKeepAlive) {
+            $this->smtp->reset();
+        } else {
+            $this->smtp->quit();
+            $this->smtp->close();
+        }
+        //Create error message for any bad addresses
+        if (count($bad_rcpt) > 0) {
+            $errstr = '';
+            foreach ($bad_rcpt as $bad) {
+                $errstr .= $bad['to'] . ': ' . $bad['error'];
+            }
+            throw new phpmailerException(
+                $this->lang('recipients_failed') . $errstr,
+                self::STOP_CONTINUE
+            );
+        }
+        return true;
     }
-    if (!$this->sign_key_file) {
-      $result .= $this->HeaderLine('MIME-Version', '1.0');
-      $result .= $this->GetMailMIME();
+
+    /**
+     * Initiate a connection to an SMTP server.
+     * Returns false if the operation failed.
+     * @param array $options An array of options compatible with stream_context_create()
+     * @uses SMTP
+     * @access public
+     * @throws phpmailerException
+     * @return boolean
+     */
+    public function smtpConnect($options = array())
+    {
+        if (is_null($this->smtp)) {
+            $this->smtp = $this->getSMTPInstance();
+        }
+
+        // Already connected?
+        if ($this->smtp->connected()) {
+            return true;
+        }
+
+        $this->smtp->setTimeout($this->Timeout);
+        $this->smtp->setDebugLevel($this->SMTPDebug);
+        $this->smtp->setDebugOutput($this->Debugoutput);
+        $this->smtp->setVerp($this->do_verp);
+        $hosts = explode(';', $this->Host);
+        $lastexception = null;
+
+        foreach ($hosts as $hostentry) {
+            $hostinfo = array();
+            if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
+                // Not a valid host entry
+                continue;
+            }
+            // $hostinfo[2]: optional ssl or tls prefix
+            // $hostinfo[3]: the hostname
+            // $hostinfo[4]: optional port number
+            // The host string prefix can temporarily override the current setting for SMTPSecure
+            // If it's not specified, the default value is used
+            $prefix = '';
+            $secure = $this->SMTPSecure;
+            $tls = ($this->SMTPSecure == 'tls');
+            if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
+                $prefix = 'ssl://';
+                $tls = false; // Can't have SSL and TLS at the same time
+                $secure = 'ssl';
+            } elseif ($hostinfo[2] == 'tls') {
+                $tls = true;
+                // tls doesn't use a prefix
+                $secure = 'tls';
+            }
+            //Do we need the OpenSSL extension?
+            $sslext = defined('OPENSSL_ALGO_SHA1');
+            if ('tls' === $secure or 'ssl' === $secure) {
+                //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
+                if (!$sslext) {
+                    throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
+                }
+            }
+            $host = $hostinfo[3];
+            $port = $this->Port;
+            $tport = (integer)$hostinfo[4];
+            if ($tport > 0 and $tport < 65536) {
+                $port = $tport;
+            }
+            if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
+                try {
+                    if ($this->Helo) {
+                        $hello = $this->Helo;
+                    } else {
+                        $hello = $this->serverHostname();
+                    }
+                    $this->smtp->hello($hello);
+                    //Automatically enable TLS encryption if:
+                    // * it's not disabled
+                    // * we have openssl extension
+                    // * we are not already using SSL
+                    // * the server offers STARTTLS
+                    if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
+                        $tls = true;
+                    }
+                    if ($tls) {
+                        if (!$this->smtp->startTLS()) {
+                            throw new phpmailerException($this->lang('connect_host'));
+                        }
+                        // We must resend HELO after tls negotiation
+                        $this->smtp->hello($hello);
+                    }
+                    if ($this->SMTPAuth) {
+                        if (!$this->smtp->authenticate(
+                            $this->Username,
+                            $this->Password,
+                            $this->AuthType,
+                            $this->Realm,
+                            $this->Workstation
+                        )
+                        ) {
+                            throw new phpmailerException($this->lang('authenticate'));
+                        }
+                    }
+                    return true;
+                } catch (phpmailerException $exc) {
+                    $lastexception = $exc;
+                    $this->edebug($exc->getMessage());
+                    // We must have connected, but then failed TLS or Auth, so close connection nicely
+                    $this->smtp->quit();
+                }
+            }
+        }
+        // If we get here, all connection attempts have failed, so close connection hard
+        $this->smtp->close();
+        // As we've caught all exceptions, just report whatever the last one was
+        if ($this->exceptions and !is_null($lastexception)) {
+            throw $lastexception;
+        }
+        return false;
+    }
+
+    /**
+     * Close the active SMTP session if one exists.
+     * @return void
+     */
+    public function smtpClose()
+    {
+        if ($this->smtp !== null) {
+            if ($this->smtp->connected()) {
+                $this->smtp->quit();
+                $this->smtp->close();
+            }
+        }
     }
 
-    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);
+    /**
+     * Set the language for 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. French is "fr")
+     * @param string $lang_path Path to the language file directory, with trailing separator (slash)
+     * @return boolean
+     * @access public
+     */
+    public function setLanguage($langcode = 'en', $lang_path = '')
+    {
+        // Define full set of translatable strings in English
+        $PHPMAILER_LANG = array(
+            'authenticate' => 'SMTP Error: Could not authenticate.',
+            'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
+            'data_not_accepted' => 'SMTP Error: data not accepted.',
+            'empty_message' => 'Message body empty',
+            'encoding' => 'Unknown encoding: ',
+            'execute' => 'Could not execute: ',
+            'file_access' => 'Could not access file: ',
+            'file_open' => 'File Error: Could not open file: ',
+            'from_failed' => 'The following From address failed: ',
+            'instantiate' => 'Could not instantiate mail function.',
+            'invalid_address' => 'Invalid address: ',
+            'mailer_not_supported' => ' mailer is not supported.',
+            'provide_address' => 'You must provide at least one recipient email address.',
+            'recipients_failed' => 'SMTP Error: The following recipients failed: ',
+            'signing' => 'Signing Error: ',
+            'smtp_connect_failed' => 'SMTP connect() failed.',
+            'smtp_error' => 'SMTP server error: ',
+            'variable_set' => 'Cannot set or reset variable: ',
+            'extension_missing' => 'Extension missing: '
+        );
+        if (empty($lang_path)) {
+            // Calculate an absolute path so it can work if CWD is not here
+            $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
+        }
+        $foundlang = true;
+        $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
+        // There is no English translation file
+        if ($langcode != 'en') {
+            // Make sure language file path is readable
+            if (!is_readable($lang_file)) {
+                $foundlang = false;
+            } else {
+                // Overwrite language-specific strings.
+                // This way we'll never have missing translation keys.
+                $foundlang = include $lang_file;
+            }
+        }
+        $this->language = $PHPMAILER_LANG;
+        return (boolean)$foundlang; // Returns false if language not found
+    }
+
+    /**
+     * Get the array of strings for the current language.
+     * @return array
+     */
+    public function getTranslations()
+    {
+        return $this->language;
+    }
+
+    /**
+     * Create recipient headers.
+     * @access public
+     * @param string $type
+     * @param array $addr An array of recipient,
+     * where each recipient is a 2-element indexed array with element 0 containing an address
+     * and element 1 containing a name, like:
+     * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))
+     * @return string
+     */
+    public function addrAppend($type, $addr)
+    {
+        $addresses = array();
+        foreach ($addr as $address) {
+            $addresses[] = $this->addrFormat($address);
+        }
+        return $type . ': ' . implode(', ', $addresses) . $this->LE;
+    }
+
+    /**
+     * Format an address for use in a message header.
+     * @access public
+     * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name
+     *      like array('joe@example.com', 'Joe User')
+     * @return string
+     */
+    public function addrFormat($addr)
+    {
+        if (empty($addr[1])) { // No name provided
+            return $this->secureHeader($addr[0]);
         } 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);
+            return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader(
+                $addr[0]
+            ) . '>';
+        }
+    }
+
+    /**
+     * Word-wrap message.
+     * For use with mailers that do not automatically perform wrapping
+     * and for quoted-printable encoded messages.
+     * 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)
+    {
+        if ($qp_mode) {
+            $soft_break = sprintf(' =%s', $this->LE);
+        } else {
+            $soft_break = $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');
+        $lelen = strlen($this->LE);
+        $crlflen = strlen(self::CRLF);
+
+        $message = $this->fixEOL($message);
+        //Remove a trailing line break
+        if (substr($message, -$lelen) == $this->LE) {
+            $message = substr($message, 0, -$lelen);
+        }
+
+        //Split message into lines
+        $lines = explode($this->LE, $message);
+        //Message will be rebuilt in here
+        $message = '';
+        foreach ($lines as $line) {
+            $words = explode(' ', $line);
+            $buf = '';
+            $firstword = true;
+            foreach ($words as $word) {
+                if ($qp_mode and (strlen($word) > $length)) {
+                    $space_left = $length - strlen($buf) - $crlflen;
+                    if (!$firstword) {
+                        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', self::CRLF);
+                        } else {
+                            $message .= $buf . $soft_break;
+                        }
+                        $buf = '';
+                    }
+                    while (strlen($word) > 0) {
+                        if ($length <= 0) {
+                            break;
+                        }
+                        $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', self::CRLF);
+                        } else {
+                            $buf = $part;
+                        }
+                    }
+                } else {
+                    $buf_o = $buf;
+                    if (!$firstword) {
+                        $buf .= ' ';
+                    }
+                    $buf .= $word;
+
+                    if (strlen($buf) > $length and $buf_o != '') {
+                        $message .= $buf_o . $soft_break;
+                        $buf = $word;
+                    }
+                }
+                $firstword = false;
+            }
+            $message .= $buf . self::CRLF;
+        }
+
+        return $message;
+    }
+
+    /**
+     * Find the 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 integer $maxLength Find the last character boundary prior to this length
+     * @return integer
+     */
+    public function utf8CharBoundary($encodedText, $maxLength)
+    {
+        $foundSplitPos = false;
+        $lookBack = 3;
+        while (!$foundSplitPos) {
+            $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
+            $encodedCharPos = strpos($lastChunk, '=');
+            if (false !== $encodedCharPos) {
+                // 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
+                    if ($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;
+    }
+
+    /**
+     * Apply word wrapping to the message body.
+     * Wraps the message body to the number of chars set in the WordWrap property.
+     * You should only do this to plain-text bodies as wrapping HTML tags may break them.
+     * This is called automatically by createBody(), so you don't need to call it yourself.
+     * @access public
+     * @return void
+     */
+    public function setWordWrap()
+    {
+        if ($this->WordWrap < 1) {
+            return;
+        }
+
+        switch ($this->message_type) {
+            case 'alt':
+            case 'alt_inline':
+            case 'alt_attach':
+            case 'alt_inline_attach':
+                $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
+                break;
+            default:
+                $this->Body = $this->wrapText($this->Body, $this->WordWrap);
+                break;
+        }
+    }
+
+    /**
+     * Assemble message headers.
+     * @access public
+     * @return string The assembled headers
+     */
+    public function createHeader()
+    {
+        $result = '';
+
+        if ($this->MessageDate == '') {
+            $this->MessageDate = self::rfcDate();
+        }
+        $result .= $this->headerLine('Date', $this->MessageDate);
+
+        // To be created automatically by mail()
+        if ($this->SingleTo) {
+            if ($this->Mailer != 'mail') {
+                foreach ($this->to as $toaddr) {
+                    $this->SingleToArray[] = $this->addrFormat($toaddr);
+                }
+            }
         } else {
-          @unlink($file);
-          @unlink($signed);
-          throw new phpmailerException($this->Lang("signing").openssl_error_string());
+            if (count($this->to) > 0) {
+                if ($this->Mailer != 'mail') {
+                    $result .= $this->addrAppend('To', $this->to);
+                }
+            } elseif (count($this->cc) == 0) {
+                $result .= $this->headerLine('To', 'undisclosed-recipients:;');
+            }
         }
-      } catch (phpmailerException $e) {
+
+        $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName)));
+
+        // 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' or $this->Mailer == 'qmail' or $this->Mailer == 'mail'
+            )
+            and 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 != '') {
+            $this->lastMessageID = $this->MessageID;
+        } else {
+            $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
+        }
+        $result .= $this->headerLine('Message-ID', $this->lastMessageID);
+        if (!is_null($this->Priority)) {
+            $result .= $this->headerLine('X-Priority', $this->Priority);
+        }
+        if ($this->XMailer == '') {
+            $result .= $this->headerLine(
+                'X-Mailer',
+                'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)'
+            );
+        } else {
+            $myXmailer = trim($this->XMailer);
+            if ($myXmailer) {
+                $result .= $this->headerLine('X-Mailer', $myXmailer);
+            }
+        }
+
+        if ($this->ConfirmReadingTo != '') {
+            $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
+        }
+
+        // Add custom headers
+        foreach ($this->CustomHeader as $header) {
+            $result .= $this->headerLine(
+                trim($header[0]),
+                $this->encodeHeader(trim($header[1]))
+            );
+        }
+        if (!$this->sign_key_file) {
+            $result .= $this->headerLine('MIME-Version', '1.0');
+            $result .= $this->getMailMIME();
+        }
+
+        return $result;
+    }
+
+    /**
+     * Get the message MIME type headers.
+     * @access public
+     * @return string
+     */
+    public function getMailMIME()
+    {
+        $result = '';
+        $ismultipart = true;
+        switch ($this->message_type) {
+            case 'inline':
+                $result .= $this->headerLine('Content-Type', 'multipart/related;');
+                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
+                break;
+            case 'attach':
+            case 'inline_attach':
+            case 'alt_attach':
+            case 'alt_inline_attach':
+                $result .= $this->headerLine('Content-Type', 'multipart/mixed;');
+                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
+                break;
+            case 'alt':
+            case 'alt_inline':
+                $result .= $this->headerLine('Content-Type', 'multipart/alternative;');
+                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
+                break;
+            default:
+                // Catches case 'plain': and case '':
+                $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
+                $ismultipart = false;
+                break;
+        }
+        // RFC1341 part 5 says 7bit is assumed if not specified
+        if ($this->Encoding != '7bit') {
+            // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
+            if ($ismultipart) {
+                if ($this->Encoding == '8bit') {
+                    $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
+                }
+                // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
+            } else {
+                $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
+            }
+        }
+
+        if ($this->Mailer != 'mail') {
+            $result .= $this->LE;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Returns the whole MIME message.
+     * Includes complete headers and body.
+     * Only valid post preSend().
+     * @see PHPMailer::preSend()
+     * @access public
+     * @return string
+     */
+    public function getSentMIMEMessage()
+    {
+        return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
+    }
+
+    /**
+     * Assemble the message body.
+     * Returns an empty string on failure.
+     * @access public
+     * @throws phpmailerException
+     * @return string The assembled message body
+     */
+    public function createBody()
+    {
         $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') {
+        //Create unique IDs and preset boundaries
+        $this->uniqueid = md5(uniqid(time()));
+        $this->boundary[1] = 'b1_' . $this->uniqueid;
+        $this->boundary[2] = 'b2_' . $this->uniqueid;
+        $this->boundary[3] = 'b3_' . $this->uniqueid;
+
+        if ($this->sign_key_file) {
+            $body .= $this->getMailMIME() . $this->LE;
+        }
+
+        $this->setWordWrap();
+
+        $bodyEncoding = $this->Encoding;
+        $bodyCharSet = $this->CharSet;
+        //Can we do a 7-bit downgrade?
+        if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
+            $bodyEncoding = '7bit';
+            $bodyCharSet = 'us-ascii';
+        }
+        //If lines are too long, and we're not already using an encoding that will shorten them,
+        //change to quoted-printable transfer encoding
+        if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
+            $this->Encoding = 'quoted-printable';
+            $bodyEncoding = 'quoted-printable';
+        }
+
+        $altBodyEncoding = $this->Encoding;
+        $altBodyCharSet = $this->CharSet;
+        //Can we do a 7-bit downgrade?
+        if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
+            $altBodyEncoding = '7bit';
+            $altBodyCharSet = 'us-ascii';
+        }
+        //If lines are too long, change to quoted-printable transfer encoding
+        if (self::hasLineLongerThanMax($this->AltBody)) {
+            $altBodyEncoding = 'quoted-printable';
+        }
+        //Use this as a preamble in all multipart message types
+        $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE;
+        switch ($this->message_type) {
+            case 'inline':
+                $body .= $mimepre;
+                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->attachAll('inline', $this->boundary[1]);
+                break;
+            case 'attach':
+                $body .= $mimepre;
+                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->attachAll('attachment', $this->boundary[1]);
+                break;
+            case 'inline_attach':
+                $body .= $mimepre;
+                $body .= $this->textLine('--' . $this->boundary[1]);
+                $body .= $this->headerLine('Content-Type', 'multipart/related;');
+                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
+                $body .= $this->LE;
+                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->attachAll('inline', $this->boundary[2]);
+                $body .= $this->LE;
+                $body .= $this->attachAll('attachment', $this->boundary[1]);
+                break;
+            case 'alt':
+                $body .= $mimepre;
+                $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
+                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                if (!empty($this->Ical)) {
+                    $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', '');
+                    $body .= $this->encodeString($this->Ical, $this->Encoding);
+                    $body .= $this->LE . $this->LE;
+                }
+                $body .= $this->endBoundary($this->boundary[1]);
+                break;
+            case 'alt_inline':
+                $body .= $mimepre;
+                $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
+                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->textLine('--' . $this->boundary[1]);
+                $body .= $this->headerLine('Content-Type', 'multipart/related;');
+                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
+                $body .= $this->LE;
+                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->attachAll('inline', $this->boundary[2]);
+                $body .= $this->LE;
+                $body .= $this->endBoundary($this->boundary[1]);
+                break;
+            case 'alt_attach':
+                $body .= $mimepre;
+                $body .= $this->textLine('--' . $this->boundary[1]);
+                $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
+                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
+                $body .= $this->LE;
+                $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
+                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->endBoundary($this->boundary[2]);
+                $body .= $this->LE;
+                $body .= $this->attachAll('attachment', $this->boundary[1]);
+                break;
+            case 'alt_inline_attach':
+                $body .= $mimepre;
+                $body .= $this->textLine('--' . $this->boundary[1]);
+                $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
+                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
+                $body .= $this->LE;
+                $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
+                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->textLine('--' . $this->boundary[2]);
+                $body .= $this->headerLine('Content-Type', 'multipart/related;');
+                $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"');
+                $body .= $this->LE;
+                $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding);
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                $body .= $this->LE . $this->LE;
+                $body .= $this->attachAll('inline', $this->boundary[3]);
+                $body .= $this->LE;
+                $body .= $this->endBoundary($this->boundary[2]);
+                $body .= $this->LE;
+                $body .= $this->attachAll('attachment', $this->boundary[1]);
+                break;
+            default:
+                // catch case 'plain' and case ''
+                $body .= $this->encodeString($this->Body, $bodyEncoding);
+                break;
+        }
+
+        if ($this->isError()) {
+            $body = '';
+        } elseif ($this->sign_key_file) {
+            try {
+                if (!defined('PKCS7_TEXT')) {
+                    throw new phpmailerException($this->lang('extension_missing') . 'openssl');
+                }
+                // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1
+                $file = tempnam(sys_get_temp_dir(), 'mail');
+                if (false === file_put_contents($file, $body)) {
+                    throw new phpmailerException($this->lang('signing') . ' Could not write temp file');
+                }
+                $signed = tempnam(sys_get_temp_dir(), 'signed');
+                //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197
+                if (empty($this->sign_extracerts_file)) {
+                    $sign = @openssl_pkcs7_sign(
+                        $file,
+                        $signed,
+                        'file://' . realpath($this->sign_cert_file),
+                        array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
+                        null
+                    );
+                } else {
+                    $sign = @openssl_pkcs7_sign(
+                        $file,
+                        $signed,
+                        'file://' . realpath($this->sign_cert_file),
+                        array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
+                        null,
+                        PKCS7_DETACHED,
+                        $this->sign_extracerts_file
+                    );
+                }
+                if ($sign) {
+                    @unlink($file);
+                    $body = file_get_contents($signed);
+                    @unlink($signed);
+                    //The message returned by openssl contains both headers and body, so need to split them up
+                    $parts = explode("\n\n", $body, 2);
+                    $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE;
+                    $body = $parts[1];
+                } else {
+                    @unlink($file);
+                    @unlink($signed);
+                    throw new phpmailerException($this->lang('signing') . openssl_error_string());
+                }
+            } catch (phpmailerException $exc) {
+                $body = '';
+                if ($this->exceptions) {
+                    throw $exc;
+                }
+            }
+        }
+        return $body;
+    }
+
+    /**
+     * Return the start of a message boundary.
+     * @access protected
+     * @param string $boundary
+     * @param string $charSet
+     * @param string $contentType
+     * @param string $encoding
+     * @return string
+     */
+    protected 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;
+        // RFC1341 part 5 says 7bit is assumed if not specified
+        if ($encoding != '7bit') {
+            $result .= $this->headerLine('Content-Transfer-Encoding', $encoding);
+        }
+        $result .= $this->LE;
+
+        return $result;
+    }
+
+    /**
+     * Return the end of a message boundary.
+     * @access protected
+     * @param string $boundary
+     * @return string
+     */
+    protected function endBoundary($boundary)
+    {
+        return $this->LE . '--' . $boundary . '--' . $this->LE;
+    }
+
+    /**
+     * Set the message type.
+     * PHPMailer only supports some preset message types,
+     * not arbitrary MIME structures.
+     * @access protected
+     * @return void
+     */
+    protected function setMessageType()
+    {
+        $type = array();
+        if ($this->alternativeExists()) {
+            $type[] = 'alt';
+        }
+        if ($this->inlineImageExists()) {
+            $type[] = 'inline';
+        }
+        if ($this->attachmentExists()) {
+            $type[] = 'attach';
+        }
+        $this->message_type = implode('_', $type);
+        if ($this->message_type == '') {
+            $this->message_type = 'plain';
+        }
+    }
+
+    /**
+     * Format a header line.
+     * @access public
+     * @param string $name
+     * @param string $value
+     * @return string
+     */
+    public function headerLine($name, $value)
+    {
+        return $name . ': ' . $value . $this->LE;
+    }
+
+    /**
+     * Return a formatted mail line.
+     * @access public
+     * @param string $value
+     * @return string
+     */
+    public function textLine($value)
+    {
+        return $value . $this->LE;
+    }
+
+    /**
+     * Add an attachment from a path on the filesystem.
+     * Returns false if the file could not be found or read.
+     * @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.
+     * @param string $disposition Disposition to use
+     * @throws phpmailerException
+     * @return boolean
+     */
+    public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
+    {
+        try {
+            if (!@is_file($path)) {
+                throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
+            }
+
+            // If a MIME type is not specified, try to work it out from the file name
+            if ($type == '') {
+                $type = self::filenameToType($path);
+            }
+
+            $filename = basename($path);
+            if ($name == '') {
+                $name = $filename;
+            }
+
+            $this->attachment[] = array(
+                0 => $path,
+                1 => $filename,
+                2 => $name,
+                3 => $encoding,
+                4 => $type,
+                5 => false, // isStringAttachment
+                6 => $disposition,
+                7 => 0
+            );
+
+        } catch (phpmailerException $exc) {
+            $this->setError($exc->getMessage());
+            $this->edebug($exc->getMessage());
+            if ($this->exceptions) {
+                throw $exc;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Return the array of attachments.
+     * @return array
+     */
+    public function getAttachments()
+    {
+        return $this->attachment;
+    }
+
+    /**
+     * Attach all file, string, and binary attachments to the message.
+     * Returns an empty string on failure.
+     * @access protected
+     * @param string $disposition_type
+     * @param string $boundary
+     * @return string
+     */
+    protected function attachAll($disposition_type, $boundary)
+    {
+        // Return text of body
+        $mime = array();
+        $cidUniq = array();
+        $incl = array();
+
+        // Add all attachments
+        foreach ($this->attachment as $attachment) {
+            // Check if it is a valid disposition_filter
+            if ($attachment[6] == $disposition_type) {
+                // Check for string attachment
+                $string = '';
+                $path = '';
+                $bString = $attachment[5];
+                if ($bString) {
+                    $string = $attachment[0];
+                } else {
+                    $path = $attachment[0];
+                }
+
+                $inclhash = md5(serialize($attachment));
+                if (in_array($inclhash, $incl)) {
+                    continue;
+                }
+                $incl[] = $inclhash;
+                $name = $attachment[2];
+                $encoding = $attachment[3];
+                $type = $attachment[4];
+                $disposition = $attachment[6];
+                $cid = $attachment[7];
+                if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
+                    continue;
+                }
+                $cidUniq[$cid] = true;
+
+                $mime[] = sprintf('--%s%s', $boundary, $this->LE);
+                //Only include a filename property if we have one
+                if (!empty($name)) {
+                    $mime[] = sprintf(
+                        'Content-Type: %s; name="%s"%s',
+                        $type,
+                        $this->encodeHeader($this->secureHeader($name)),
+                        $this->LE
+                    );
+                } else {
+                    $mime[] = sprintf(
+                        'Content-Type: %s%s',
+                        $type,
+                        $this->LE
+                    );
+                }
+                // RFC1341 part 5 says 7bit is assumed if not specified
+                if ($encoding != '7bit') {
+                    $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
+                }
+
+                if ($disposition == 'inline') {
+                    $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);
+                }
+
+                // If a filename contains any of these chars, it should be quoted,
+                // but not otherwise: RFC2183 & RFC2045 5.1
+                // Fixes a warning in IETF's msglint MIME checker
+                // Allow for bypassing the Content-Disposition header totally
+                if (!(empty($disposition))) {
+                    $encoded_name = $this->encodeHeader($this->secureHeader($name));
+                    if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) {
+                        $mime[] = sprintf(
+                            'Content-Disposition: %s; filename="%s"%s',
+                            $disposition,
+                            $encoded_name,
+                            $this->LE . $this->LE
+                        );
+                    } else {
+                        if (!empty($encoded_name)) {
+                            $mime[] = sprintf(
+                                'Content-Disposition: %s; filename=%s%s',
+                                $disposition,
+                                $encoded_name,
+                                $this->LE . $this->LE
+                            );
+                        } else {
+                            $mime[] = sprintf(
+                                'Content-Disposition: %s%s',
+                                $disposition,
+                                $this->LE . $this->LE
+                            );
+                        }
+                    }
+                } else {
+                    $mime[] = $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', $boundary, $this->LE);
+
+        return implode('', $mime);
+    }
+
+    /**
+     * Encode a file 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'
+     * @throws phpmailerException
+     * @access protected
+     * @return string
+     */
+    protected function encodeFile($path, $encoding = 'base64')
+    {
+        try {
+            if (!is_readable($path)) {
+                throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
+            }
+            $magic_quotes = get_magic_quotes_runtime();
+            if ($magic_quotes) {
+                if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+                    set_magic_quotes_runtime(false);
+                } else {
+                    //Doesn't exist in PHP 5.4, but we don't need to check because
+                    //get_magic_quotes_runtime always returns false in 5.4+
+                    //so it will never get here
+                    ini_set('magic_quotes_runtime', false);
+                }
+            }
+            $file_buffer = file_get_contents($path);
+            $file_buffer = $this->encodeString($file_buffer, $encoding);
+            if ($magic_quotes) {
+                if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+                    set_magic_quotes_runtime($magic_quotes);
+                } else {
+                    ini_set('magic_quotes_runtime', $magic_quotes);
+                }
+            }
+            return $file_buffer;
+        } catch (Exception $exc) {
+            $this->setError($exc->getMessage());
+            return '';
+        }
+    }
+
+    /**
+     * Encode a string in 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 optimally.
+     * Picks shortest of Q, B, quoted-printable or none.
+     * @access public
+     * @param string $str
+     * @param string $position
+     * @return string
+     */
+    public function encodeHeader($str, $position = 'text')
+    {
+        $matchcount = 0;
+        switch (strtolower($position)) {
+            case 'phrase':
+                if (!preg_match('/[\200-\377]/', $str)) {
+                    // Can't use addslashes as we don't know the value of magic_quotes_sybase
+                    $encoded = addcslashes($str, "\0..\37\177\\\"");
+                    if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
+                        return ($encoded);
+                    } else {
+                        return ("\"$encoded\"");
+                    }
+                }
+                $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+                break;
+            /** @noinspection PhpMissingBreakStatementInspection */
+            case 'comment':
+                $matchcount = preg_match_all('/[()"]/', $str, $matches);
+                // Intentional fall-through
+            case 'text':
+            default:
+                $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+                break;
+        }
+
+        //There are no chars that need encoding
+        if ($matchcount == 0) {
+            return ($str);
+        }
+
+        $maxlen = 75 - 7 - strlen($this->CharSet);
+        // Try to select the encoding which should produce the shortest output
+        if ($matchcount > strlen($str) / 3) {
+            // More than a third of the content will need encoding, so B encoding will be most efficient
+            $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, "\n");
+            } 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('=' . self::CRLF, "\n", trim($encoded));
+        }
+
+        $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded);
+        $encoded = trim(str_replace("\n", $this->LE, $encoded));
+
+        return $encoded;
+    }
+
+    /**
+     * Check if a string contains multi-byte characters.
+     * @access public
+     * @param string $str multi-byte text to wrap encode
+     * @return boolean
+     */
+    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;
+        }
+    }
+
+    /**
+     * Does a string contain any 8-bit chars (in any charset)?
+     * @param string $text
+     * @return boolean
+     */
+    public function has8bitChars($text)
+    {
+        return (boolean)preg_match('/[\x80-\xFF]/', $text);
+    }
+
+    /**
+     * Encode and wrap long multibyte strings for mail headers
+     * without breaking lines within a character.
+     * Adapted from a function by paravoid
+     * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
+     * @access public
+     * @param string $str multi-byte text to wrap encode
+     * @param string $linebreak string to use as linefeed/end-of-line
+     * @return string
+     */
+    public function base64EncodeWrapMB($str, $linebreak = null)
+    {
+        $start = '=?' . $this->CharSet . '?B?';
+        $end = '?=';
+        $encoded = '';
+        if ($linebreak === null) {
+            $linebreak = $this->LE;
+        }
+
+        $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
+        $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 . $linebreak;
+        }
+
+        // Chomp the last linefeed
+        $encoded = substr($encoded, 0, -strlen($linebreak));
+        return $encoded;
+    }
+
+    /**
+     * Encode a string in quoted-printable format.
+     * According to RFC2045 section 6.7.
+     * @access public
+     * @param string $string The text to encode
+     * @param integer $line_max Number of chars allowed on a line before wrapping
+     * @return string
+     * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment
+     */
+    public function encodeQP($string, $line_max = 76)
+    {
+        // Use native function if it's available (>= PHP5.3)
+        if (function_exists('quoted_printable_encode')) {
+            return quoted_printable_encode($string);
+        }
+        // Fall back to a pure PHP implementation
+        $string = str_replace(
+            array('%20', '%0D%0A.', '%0D%0A', '%'),
+            array(' ', "\r\n=2E", "\r\n", '='),
+            rawurlencode($string)
+        );
+        return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
+    }
+
+    /**
+     * Backward compatibility wrapper for an old QP encoding function that was removed.
+     * @see PHPMailer::encodeQP()
+     * @access public
+     * @param string $string
+     * @param integer $line_max
+     * @param boolean $space_conv
+     * @return string
+     * @deprecated Use encodeQP instead.
+     */
+    public function encodeQPphp(
+        $string,
+        $line_max = 76,
+        /** @noinspection PhpUnusedParameterInspection */ $space_conv = false
+    ) {
+        return $this->encodeQP($string, $line_max);
+    }
+
+    /**
+     * Encode a string using 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
+        $pattern = '';
+        $encoded = str_replace(array("\r", "\n"), '', $str);
+        switch (strtolower($position)) {
+            case 'phrase':
+                // RFC 2047 section 5.3
+                $pattern = '^A-Za-z0-9!*+\/ -';
+                break;
+            /** @noinspection PhpMissingBreakStatementInspection */
+            case 'comment':
+                // RFC 2047 section 5.2
+                $pattern = '\(\)"';
+                // intentional fall-through
+                // for this reason we build the $pattern without including delimiters and []
+            case 'text':
+            default:
+                // RFC 2047 section 5.1
+                // Replace every high ascii, control, =, ? and _ characters
+                $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
+                break;
+        }
+        $matches = array();
+        if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
+            // If the string contains an '=', make sure it's the first thing we replace
+            // so as to avoid double-encoding
+            $eqkey = array_search('=', $matches[0]);
+            if (false !== $eqkey) {
+                unset($matches[0][$eqkey]);
+                array_unshift($matches[0], '=');
+            }
+            foreach (array_unique($matches[0]) as $char) {
+                $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
+            }
+        }
+        // Replace every spaces to _ (more readable than =20)
+        return str_replace(' ', '_', $encoded);
+    }
+
+    /**
+     * Add a string or binary attachment (non-filesystem).
+     * 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.
+     * @param string $disposition Disposition to use
+     * @return void
+     */
+    public function addStringAttachment(
+        $string,
+        $filename,
+        $encoding = 'base64',
+        $type = '',
+        $disposition = 'attachment'
+    ) {
+        // If a MIME type is not specified, try to work it out from the file name
+        if ($type == '') {
+            $type = self::filenameToType($filename);
+        }
+        // Append to $attachment array
+        $this->attachment[] = array(
+            0 => $string,
+            1 => $filename,
+            2 => basename($filename),
+            3 => $encoding,
+            4 => $type,
+            5 => true, // isStringAttachment
+            6 => $disposition,
+            7 => 0
+        );
+    }
+
+    /**
+     * Add an embedded (inline) attachment from a file.
+     * This can include images, sounds, and just about any other document type.
+     * These differ from 'regular' attachments in that they are intended to be
+     * displayed inline with the message, not just attached for download.
+     * This is used in HTML messages that embed the images
+     * the HTML refers to using the $cid value.
+     * @param string $path Path to the attachment.
+     * @param string $cid Content ID of the attachment; Use this to reference
+     *        the content when using an embedded image in HTML.
+     * @param string $name Overrides the attachment name.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File MIME type.
+     * @param string $disposition Disposition to use
+     * @return boolean True on successfully adding an attachment
+     */
+    public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
+    {
+        if (!@is_file($path)) {
+            $this->setError($this->lang('file_access') . $path);
+            return false;
+        }
+
+        // If a MIME type is not specified, try to work it out from the file name
+        if ($type == '') {
+            $type = self::filenameToType($path);
+        }
+
+        $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 => $disposition,
+            7 => $cid
+        );
         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) {
+    }
+
+    /**
+     * Add an embedded stringified attachment.
+     * This can include images, sounds, and just about any other document type.
+     * Be sure to set the $type to an image type for images:
+     * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
+     * @param string $string The attachment binary data.
+     * @param string $cid Content ID of the attachment; Use this to reference
+     *        the content when using an embedded image in HTML.
+     * @param string $name
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type MIME type.
+     * @param string $disposition Disposition to use
+     * @return boolean True on successfully adding an attachment
+     */
+    public function addStringEmbeddedImage(
+        $string,
+        $cid,
+        $name = '',
+        $encoding = 'base64',
+        $type = '',
+        $disposition = 'inline'
+    ) {
+        // If a MIME type is not specified, try to work it out from the name
+        if ($type == '' and !empty($name)) {
+            $type = self::filenameToType($name);
+        }
+
+        // Append to $attachment array
+        $this->attachment[] = array(
+            0 => $string,
+            1 => $name,
+            2 => $name,
+            3 => $encoding,
+            4 => $type,
+            5 => true, // isStringAttachment
+            6 => $disposition,
+            7 => $cid
+        );
+        return true;
+    }
+
+    /**
+     * Check if an inline attachment is present.
+     * @access public
+     * @return boolean
+     */
+    public function inlineImageExists()
+    {
+        foreach ($this->attachment as $attachment) {
+            if ($attachment[6] == 'inline') {
+                return true;
+            }
+        }
         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);
-    }
-  }
+    }
+
+    /**
+     * Check if an attachment (non-inline) is present.
+     * @return boolean
+     */
+    public function attachmentExists()
+    {
+        foreach ($this->attachment as $attachment) {
+            if ($attachment[6] == 'attachment') {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Check if this message has an alternative body set.
+     * @return boolean
+     */
+    public function alternativeExists()
+    {
+        return !empty($this->AltBody);
+    }
+
+    /**
+     * Clear queued addresses of given kind.
+     * @access protected
+     * @param string $kind 'to', 'cc', or 'bcc'
+     * @return void
+     */
+    public function clearQueuedAddresses($kind)
+    {
+        $RecipientsQueue = $this->RecipientsQueue;
+        foreach ($RecipientsQueue as $address => $params) {
+            if ($params[0] == $kind) {
+                unset($this->RecipientsQueue[$address]);
+            }
+        }
+    }
+
+    /**
+     * Clear all To recipients.
+     * @return void
+     */
+    public function clearAddresses()
+    {
+        foreach ($this->to as $to) {
+            unset($this->all_recipients[strtolower($to[0])]);
+        }
+        $this->to = array();
+        $this->clearQueuedAddresses('to');
+    }
+
+    /**
+     * Clear all CC recipients.
+     * @return void
+     */
+    public function clearCCs()
+    {
+        foreach ($this->cc as $cc) {
+            unset($this->all_recipients[strtolower($cc[0])]);
+        }
+        $this->cc = array();
+        $this->clearQueuedAddresses('cc');
+    }
+
+    /**
+     * Clear all BCC recipients.
+     * @return void
+     */
+    public function clearBCCs()
+    {
+        foreach ($this->bcc as $bcc) {
+            unset($this->all_recipients[strtolower($bcc[0])]);
+        }
+        $this->bcc = array();
+        $this->clearQueuedAddresses('bcc');
+    }
+
+    /**
+     * Clear all ReplyTo recipients.
+     * @return void
+     */
+    public function clearReplyTos()
+    {
+        $this->ReplyTo = array();
+        $this->ReplyToQueue = array();
+    }
+
+    /**
+     * Clear all recipient types.
+     * @return void
+     */
+    public function clearAllRecipients()
+    {
+        $this->to = array();
+        $this->cc = array();
+        $this->bcc = array();
+        $this->all_recipients = array();
+        $this->RecipientsQueue = array();
+    }
+
+    /**
+     * Clear all filesystem, string, and binary attachments.
+     * @return void
+     */
+    public function clearAttachments()
+    {
+        $this->attachment = array();
+    }
+
+    /**
+     * Clear all custom headers.
+     * @return void
+     */
+    public function clearCustomHeaders()
+    {
+        $this->CustomHeader = array();
+    }
+
+    /**
+     * Add an error message to the error container.
+     * @access protected
+     * @param string $msg
+     * @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['error'])) {
+                $msg .= $this->lang('smtp_error') . $lasterror['error'];
+                if (!empty($lasterror['detail'])) {
+                    $msg .= ' Detail: '. $lasterror['detail'];
+                }
+                if (!empty($lasterror['smtp_code'])) {
+                    $msg .= ' SMTP code: ' . $lasterror['smtp_code'];
+                }
+                if (!empty($lasterror['smtp_code_ex'])) {
+                    $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
+                }
+            }
+        }
+        $this->ErrorInfo = $msg;
+    }
+
+    /**
+     * Return an RFC 822 formatted date.
+     * @access public
+     * @return string
+     * @static
+     */
+    public static function rfcDate()
+    {
+        // Set the time zone to whatever the default is to avoid 500 errors
+        // Will default to UTC if it's not set properly in php.ini
+        date_default_timezone_set(@date_default_timezone_get());
+        return date('D, j M Y H:i:s O');
+    }
+
+    /**
+     * Get the server hostname.
+     * Returns 'localhost.localdomain' if unknown.
+     * @access protected
+     * @return string
+     */
+    protected function serverHostname()
+    {
+        $result = 'localhost.localdomain';
+        if (!empty($this->Hostname)) {
+            $result = $this->Hostname;
+        } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
+            $result = $_SERVER['SERVER_NAME'];
+        } elseif (function_exists('gethostname') && gethostname() !== false) {
+            $result = gethostname();
+        } elseif (php_uname('n') !== false) {
+            $result = php_uname('n');
+        }
+        return $result;
+    }
+
+    /**
+     * Get an error message in the current language.
+     * @access protected
+     * @param string $key
+     * @return string
+     */
+    protected function lang($key)
+    {
+        if (count($this->language) < 1) {
+            $this->setLanguage('en'); // set the default language
+        }
+
+        if (array_key_exists($key, $this->language)) {
+            if ($key == 'smtp_connect_failed') {
+                //Include a link to troubleshooting docs on SMTP connection failure
+                //this is by far the biggest cause of support questions
+                //but it's usually not PHPMailer's fault.
+                return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
+            }
+            return $this->language[$key];
+        } else {
+            //Return the key as a fallback
+            return $key;
+        }
+    }
+
+    /**
+     * Check if an error occurred.
+     * @access public
+     * @return boolean True if an error did occur.
+     */
+    public function isError()
+    {
+        return ($this->error_count > 0);
+    }
+
+    /**
+     * Ensure consistent line endings in a string.
+     * Changes every end of line from CRLF, CR or LF to $this->LE.
+     * @access public
+     * @param string $str String to fixEOL
+     * @return string
+     */
+    public function fixEOL($str)
+    {
+        // Normalise to \n
+        $nstr = str_replace(array("\r\n", "\r"), "\n", $str);
+        // Now convert LE as needed
+        if ($this->LE !== "\n") {
+            $nstr = str_replace("\n", $this->LE, $nstr);
+        }
+        return $nstr;
+    }
+
+    /**
+     * Add a custom header.
+     * $name value can be overloaded to contain
+     * both header name and value (name:value)
+     * @access public
+     * @param string $name Custom header name
+     * @param string $value Header value
+     * @return void
+     */
+    public function addCustomHeader($name, $value = null)
+    {
+        if ($value === null) {
+            // Value passed in as name:value
+            $this->CustomHeader[] = explode(':', $name, 2);
+        } else {
+            $this->CustomHeader[] = array($name, $value);
+        }
+    }
+
+    /**
+     * Returns all custom headers.
+     * @return array
+     */
+    public function getCustomHeaders()
+    {
+        return $this->CustomHeader;
+    }
+
+    /**
+     * Create a message from an HTML string.
+     * Automatically makes modifications for inline images and backgrounds
+     * and creates a plain-text version by converting the HTML.
+     * Overwrites any existing values in $this->Body and $this->AltBody
+     * @access public
+     * @param string $message HTML message string
+     * @param string $basedir baseline directory for path
+     * @param boolean|callable $advanced Whether to use the internal HTML to text converter
+     *    or your own custom converter @see PHPMailer::html2text()
+     * @return string $message
+     */
+    public function msgHTML($message, $basedir = '', $advanced = false)
+    {
+        preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
+        if (array_key_exists(2, $images)) {
+            foreach ($images[2] as $imgindex => $url) {
+                // Convert data URIs into embedded images
+                if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
+                    $data = substr($url, strpos($url, ','));
+                    if ($match[2]) {
+                        $data = base64_decode($data);
+                    } else {
+                        $data = rawurldecode($data);
+                    }
+                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
+                    if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
+                        $message = str_replace(
+                            $images[0][$imgindex],
+                            $images[1][$imgindex] . '="cid:' . $cid . '"',
+                            $message
+                        );
+                    }
+                } elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
+                    // Do not change urls for absolute images (thanks to corvuscorax)
+                    // Do not change urls that are already inline images
+                    $filename = basename($url);
+                    $directory = dirname($url);
+                    if ($directory == '.') {
+                        $directory = '';
+                    }
+                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
+                    if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
+                        $basedir .= '/';
+                    }
+                    if (strlen($directory) > 1 && substr($directory, -1) != '/') {
+                        $directory .= '/';
+                    }
+                    if ($this->addEmbeddedImage(
+                        $basedir . $directory . $filename,
+                        $cid,
+                        $filename,
+                        'base64',
+                        self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION))
+                    )
+                    ) {
+                        $message = preg_replace(
+                            '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
+                            $images[1][$imgindex] . '="cid:' . $cid . '"',
+                            $message
+                        );
+                    }
+                }
+            }
+        }
+        $this->isHTML(true);
+        // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
+        $this->Body = $this->normalizeBreaks($message);
+        $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
+        if (empty($this->AltBody)) {
+            $this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
+                self::CRLF . self::CRLF;
+        }
+        return $this->Body;
+    }
+
+    /**
+     * Convert an HTML string into plain text.
+     * This is used by msgHTML().
+     * Note - older versions of this function used a bundled advanced converter
+     * which was been removed for license reasons in #232
+     * Example usage:
+     * <code>
+     * // Use default conversion
+     * $plain = $mail->html2text($html);
+     * // Use your own custom converter
+     * $plain = $mail->html2text($html, function($html) {
+     *     $converter = new MyHtml2text($html);
+     *     return $converter->get_text();
+     * });
+     * </code>
+     * @param string $html The HTML text to convert
+     * @param boolean|callable $advanced Any boolean value to use the internal converter,
+     *   or provide your own callable for custom conversion.
+     * @return string
+     */
+    public function html2text($html, $advanced = false)
+    {
+        if (is_callable($advanced)) {
+            return call_user_func($advanced, $html);
+        }
+        return html_entity_decode(
+            trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))),
+            ENT_QUOTES,
+            $this->CharSet
+        );
+    }
+
+    /**
+     * Get the MIME type for a file extension.
+     * @param string $ext File extension
+     * @access public
+     * @return string MIME type of file.
+     * @static
+     */
+    public static function _mime_types($ext = '')
+    {
+        $mimes = array(
+            'xl'    => 'application/excel',
+            'js'    => 'application/javascript',
+            'hqx'   => 'application/mac-binhex40',
+            'cpt'   => 'application/mac-compactpro',
+            'bin'   => 'application/macbinary',
+            'doc'   => 'application/msword',
+            'word'  => 'application/msword',
+            'xlsx'  => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+            'xltx'  => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+            'potx'  => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+            'ppsx'  => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+            'pptx'  => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+            'sldx'  => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+            'docx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+            'dotx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+            'xlam'  => 'application/vnd.ms-excel.addin.macroEnabled.12',
+            'xlsb'  => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+            'class' => 'application/octet-stream',
+            'dll'   => 'application/octet-stream',
+            'dms'   => 'application/octet-stream',
+            'exe'   => 'application/octet-stream',
+            'lha'   => 'application/octet-stream',
+            'lzh'   => 'application/octet-stream',
+            'psd'   => 'application/octet-stream',
+            'sea'   => 'application/octet-stream',
+            'so'    => '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',
+            'php3'  => 'application/x-httpd-php',
+            'php4'  => 'application/x-httpd-php',
+            'php'   => 'application/x-httpd-php',
+            'phtml' => 'application/x-httpd-php',
+            'phps'  => 'application/x-httpd-php-source',
+            'swf'   => 'application/x-shockwave-flash',
+            'sit'   => 'application/x-stuffit',
+            'tar'   => 'application/x-tar',
+            'tgz'   => 'application/x-tar',
+            'xht'   => 'application/xhtml+xml',
+            'xhtml' => 'application/xhtml+xml',
+            'zip'   => 'application/zip',
+            'mid'   => 'audio/midi',
+            'midi'  => 'audio/midi',
+            'mp2'   => 'audio/mpeg',
+            'mp3'   => 'audio/mpeg',
+            'mpga'  => 'audio/mpeg',
+            'aif'   => 'audio/x-aiff',
+            'aifc'  => 'audio/x-aiff',
+            'aiff'  => 'audio/x-aiff',
+            'ram'   => 'audio/x-pn-realaudio',
+            'rm'    => 'audio/x-pn-realaudio',
+            'rpm'   => 'audio/x-pn-realaudio-plugin',
+            'ra'    => 'audio/x-realaudio',
+            'wav'   => 'audio/x-wav',
+            'bmp'   => 'image/bmp',
+            'gif'   => 'image/gif',
+            'jpeg'  => 'image/jpeg',
+            'jpe'   => 'image/jpeg',
+            'jpg'   => 'image/jpeg',
+            'png'   => 'image/png',
+            'tiff'  => 'image/tiff',
+            'tif'   => 'image/tiff',
+            'eml'   => 'message/rfc822',
+            'css'   => 'text/css',
+            'html'  => 'text/html',
+            'htm'   => 'text/html',
+            'shtml' => 'text/html',
+            'log'   => 'text/plain',
+            'text'  => 'text/plain',
+            'txt'   => 'text/plain',
+            'rtx'   => 'text/richtext',
+            'rtf'   => 'text/rtf',
+            'vcf'   => 'text/vcard',
+            'vcard' => 'text/vcard',
+            'xml'   => 'text/xml',
+            'xsl'   => 'text/xml',
+            'mpeg'  => 'video/mpeg',
+            'mpe'   => 'video/mpeg',
+            'mpg'   => 'video/mpeg',
+            'mov'   => 'video/quicktime',
+            'qt'    => 'video/quicktime',
+            'rv'    => 'video/vnd.rn-realvideo',
+            'avi'   => 'video/x-msvideo',
+            'movie' => 'video/x-sgi-movie'
+        );
+        if (array_key_exists(strtolower($ext), $mimes)) {
+            return $mimes[strtolower($ext)];
+        }
+        return 'application/octet-stream';
+    }
+
+    /**
+     * Map a file name to a MIME type.
+     * Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
+     * @param string $filename A file name or full path, does not need to exist as a file
+     * @return string
+     * @static
+     */
+    public static function filenameToType($filename)
+    {
+        // In case the path is a URL, strip any query string before getting extension
+        $qpos = strpos($filename, '?');
+        if (false !== $qpos) {
+            $filename = substr($filename, 0, $qpos);
+        }
+        $pathinfo = self::mb_pathinfo($filename);
+        return self::_mime_types($pathinfo['extension']);
+    }
+
+    /**
+     * Multi-byte-safe pathinfo replacement.
+     * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe.
+     * Works similarly to the one in PHP >= 5.2.0
+     * @link http://www.php.net/manual/en/function.pathinfo.php#107461
+     * @param string $path A filename or path, does not need to exist as a file
+     * @param integer|string $options Either a PATHINFO_* constant,
+     *      or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
+     * @return string|array
+     * @static
+     */
+    public static function mb_pathinfo($path, $options = null)
+    {
+        $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
+        $pathinfo = array();
+        if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
+            if (array_key_exists(1, $pathinfo)) {
+                $ret['dirname'] = $pathinfo[1];
+            }
+            if (array_key_exists(2, $pathinfo)) {
+                $ret['basename'] = $pathinfo[2];
+            }
+            if (array_key_exists(5, $pathinfo)) {
+                $ret['extension'] = $pathinfo[5];
+            }
+            if (array_key_exists(3, $pathinfo)) {
+                $ret['filename'] = $pathinfo[3];
+            }
+        }
+        switch ($options) {
+            case PATHINFO_DIRNAME:
+            case 'dirname':
+                return $ret['dirname'];
+            case PATHINFO_BASENAME:
+            case 'basename':
+                return $ret['basename'];
+            case PATHINFO_EXTENSION:
+            case 'extension':
+                return $ret['extension'];
+            case PATHINFO_FILENAME:
+            case 'filename':
+                return $ret['filename'];
+            default:
+                return $ret;
+        }
+    }
+
+    /**
+     * Set or reset instance properties.
+     * You should avoid this function - it's more verbose, less efficient, more error-prone and
+     * harder to debug than setting properties directly.
+     * Usage Example:
+     * `$mail->set('SMTPSecure', 'tls');`
+     *   is the same as:
+     * `$mail->SMTPSecure = 'tls';`
+     * @access public
+     * @param string $name The property name to set
+     * @param mixed $value The value to set the property to
+     * @return boolean
+     * @TODO Should this not be using the __set() magic function?
+     */
+    public function set($name, $value = '')
+    {
+        if (property_exists($this, $name)) {
+            $this->$name = $value;
+            return true;
+        } else {
+            $this->setError($this->lang('variable_set') . $name);
+            return false;
+        }
+    }
+
+    /**
+     * Strip newlines to prevent header injection.
+     * @access public
+     * @param string $str
+     * @return string
+     */
+    public function secureHeader($str)
+    {
+        return trim(str_replace(array("\r", "\n"), '', $str));
+    }
+
+    /**
+     * Normalize line breaks in a string.
+     * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format.
+     * Defaults to CRLF (for message bodies) and preserves consecutive breaks.
+     * @param string $text
+     * @param string $breaktype What kind of line break to use, defaults to CRLF
+     * @return string
+     * @access public
+     * @static
+     */
+    public static function normalizeBreaks($text, $breaktype = "\r\n")
+    {
+        return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
+    }
+
+    /**
+     * Set the public and private key files and password for S/MIME signing.
+     * @access public
+     * @param string $cert_filename
+     * @param string $key_filename
+     * @param string $key_pass Password for private key
+     * @param string $extracerts_filename Optional path to chain certificate
+     */
+    public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')
+    {
+        $this->sign_cert_file = $cert_filename;
+        $this->sign_key_file = $key_filename;
+        $this->sign_key_pass = $key_pass;
+        $this->sign_extracerts_file = $extracerts_filename;
+    }
+
+    /**
+     * Quoted-Printable-encode a DKIM header.
+     * @access public
+     * @param string $txt
+     * @return string
+     */
+    public function DKIM_QP($txt)
+    {
+        $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 a DKIM signature.
+     * @access public
+     * @param string $signHeader
+     * @throws phpmailerException
+     * @return string
+     */
+    public function DKIM_Sign($signHeader)
+    {
+        if (!defined('PKCS7_TEXT')) {
+            if ($this->exceptions) {
+                throw new phpmailerException($this->lang('extension_missing') . 'openssl');
+            }
+            return '';
+        }
+        $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($signHeader, $signature, $privKey)) {
+            return base64_encode($signature);
+        }
+        return '';
+    }
+
+    /**
+     * Generate a DKIM canonicalization header.
+     * @access public
+     * @param string $signHeader Header
+     * @return string
+     */
+    public function DKIM_HeaderC($signHeader)
+    {
+        $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader);
+        $lines = explode("\r\n", $signHeader);
+        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
+        }
+        $signHeader = implode("\r\n", $lines);
+        return $signHeader;
+    }
+
+    /**
+     * Generate a DKIM canonicalization body.
+     * @access public
+     * @param string $body Message Body
+     * @return string
+     */
+    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 and body in a new message header.
+     * @access public
+     * @param string $headers_line Header lines
+     * @param string $subject Subject
+     * @param string $body Body
+     * @return string
+     */
+    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($this->LE, $headers_line);
+        $from_header = '';
+        $to_header = '';
+        $current = '';
+        foreach ($headers as $header) {
+            if (strpos($header, 'From:') === 0) {
+                $from_header = $header;
+                $current = 'from_header';
+            } elseif (strpos($header, 'To:') === 0) {
+                $to_header = $header;
+                $current = 'to_header';
+            } else {
+                if (!empty($$current) && strpos($header, ' =?') === 0) {
+                    $$current .= $header;
+                } else {
+                    $current = '';
+                }
+            }
+        }
+        $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
+        if ('' == $this->DKIM_identity) {
+            $ident = '';
+        } else {
+            $ident = ' 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 $dkimhdrs . $signed . "\r\n";
+    }
+
+    /**
+     * Detect if a string contains a line longer than the maximum line length allowed.
+     * @param string $str
+     * @return boolean
+     * @static
+     */
+    public static function hasLineLongerThanMax($str)
+    {
+        //+2 to include CRLF line break for a 1000 total
+        return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str);
+    }
+
+    /**
+     * Allows for public read access to 'to' property.
+     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
+     * @access public
+     * @return array
+     */
+    public function getToAddresses()
+    {
+        return $this->to;
+    }
+
+    /**
+     * Allows for public read access to 'cc' property.
+     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
+     * @access public
+     * @return array
+     */
+    public function getCcAddresses()
+    {
+        return $this->cc;
+    }
+
+    /**
+     * Allows for public read access to 'bcc' property.
+     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
+     * @access public
+     * @return array
+     */
+    public function getBccAddresses()
+    {
+        return $this->bcc;
+    }
+
+    /**
+     * Allows for public read access to 'ReplyTo' property.
+     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
+     * @access public
+     * @return array
+     */
+    public function getReplyToAddresses()
+    {
+        return $this->ReplyTo;
+    }
+
+    /**
+     * Allows for public read access to 'all_recipients' property.
+     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
+     * @access public
+     * @return array
+     */
+    public function getAllRecipientAddresses()
+    {
+        return $this->all_recipients;
+    }
+
+    /**
+     * Perform a callback.
+     * @param boolean $isSent
+     * @param array $to
+     * @param array $cc
+     * @param array $bcc
+     * @param string $subject
+     * @param string $body
+     * @param string $from
+     */
+    protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
+    {
+        if (!empty($this->action_function) && is_callable($this->action_function)) {
+            $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
+            call_user_func_array($this->action_function, $params);
+        }
+    }
 }
 
-class phpmailerException extends Exception {
-  public function errorMessage() {
-    $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
-    return $errorMsg;
-  }
+/**
+ * PHPMailer exception handler
+ * @package PHPMailer
+ */
+class phpmailerException extends Exception
+{
+    /**
+     * Prettify error message output
+     * @return string
+     */
+    public function errorMessage()
+    {
+        $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
+        return $errorMsg;
+    }
 }
-?>
diff --git a/www/plugins/facteur/phpmailer-php5/class.phpmaileroauth.php b/www/plugins/facteur/phpmailer-php5/class.phpmaileroauth.php
new file mode 100644 (file)
index 0000000..f9cd7b4
--- /dev/null
@@ -0,0 +1,196 @@
+<?php
+/**
+ * PHPMailer - PHP email creation and transport class.
+ * PHP Version 5.4
+ * @package PHPMailer
+ * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ * @note 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.
+ */
+
+/**
+ * PHPMailerOAuth - PHPMailer subclass adding OAuth support.
+ * @package PHPMailer
+ * @author @sherryl4george
+ * @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
+ */
+class PHPMailerOAuth extends PHPMailer
+{
+    /**
+     * The OAuth user's email address
+     * @var string
+     */
+    public $oauthUserEmail = '';
+
+    /**
+     * The OAuth refresh token
+     * @var string
+     */
+    public $oauthRefreshToken = '';
+
+    /**
+     * The OAuth client ID
+     * @var string
+     */
+    public $oauthClientId = '';
+
+    /**
+     * The OAuth client secret
+     * @var string
+     */
+    public $oauthClientSecret = '';
+
+    /**
+     * An instance of the PHPMailerOAuthGoogle class.
+     * @var PHPMailerOAuthGoogle
+     * @access protected
+     */
+    protected $oauth = null;
+
+    /**
+     * Get a PHPMailerOAuthGoogle instance to use.
+     * @return PHPMailerOAuthGoogle
+     */
+    public function getOAUTHInstance()
+    {
+        if (!is_object($this->oauth)) {
+            $this->oauth = new PHPMailerOAuthGoogle(
+                $this->oauthUserEmail,
+                $this->oauthClientSecret,
+                $this->oauthClientId,
+                $this->oauthRefreshToken
+            );
+        }
+        return $this->oauth;
+    }
+
+    /**
+     * Initiate a connection to an SMTP server.
+     * Overrides the original smtpConnect method to add support for OAuth.
+     * @param array $options An array of options compatible with stream_context_create()
+     * @uses SMTP
+     * @access public
+     * @return bool
+     */
+    public function smtpConnect($options = array())
+    {
+        if (is_null($this->smtp)) {
+            $this->smtp = $this->getSMTPInstance();
+        }
+
+        if (is_null($this->oauth)) {
+            $this->oauth = $this->getOAUTHInstance();
+        }
+
+        // Already connected?
+        if ($this->smtp->connected()) {
+            return true;
+        }
+
+        $this->smtp->setTimeout($this->Timeout);
+        $this->smtp->setDebugLevel($this->SMTPDebug);
+        $this->smtp->setDebugOutput($this->Debugoutput);
+        $this->smtp->setVerp($this->do_verp);
+        $hosts = explode(';', $this->Host);
+        $lastexception = null;
+
+        foreach ($hosts as $hostentry) {
+            $hostinfo = array();
+            if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
+                // Not a valid host entry
+                continue;
+            }
+            // $hostinfo[2]: optional ssl or tls prefix
+            // $hostinfo[3]: the hostname
+            // $hostinfo[4]: optional port number
+            // The host string prefix can temporarily override the current setting for SMTPSecure
+            // If it's not specified, the default value is used
+            $prefix = '';
+            $secure = $this->SMTPSecure;
+            $tls = ($this->SMTPSecure == 'tls');
+            if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
+                $prefix = 'ssl://';
+                $tls = false; // Can't have SSL and TLS at the same time
+                $secure = 'ssl';
+            } elseif ($hostinfo[2] == 'tls') {
+                $tls = true;
+                // tls doesn't use a prefix
+                $secure = 'tls';
+            }
+            //Do we need the OpenSSL extension?
+            $sslext = defined('OPENSSL_ALGO_SHA1');
+            if ('tls' === $secure or 'ssl' === $secure) {
+                //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
+                if (!$sslext) {
+                    throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
+                }
+            }
+            $host = $hostinfo[3];
+            $port = $this->Port;
+            $tport = (integer)$hostinfo[4];
+            if ($tport > 0 and $tport < 65536) {
+                $port = $tport;
+            }
+            if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
+                try {
+                    if ($this->Helo) {
+                        $hello = $this->Helo;
+                    } else {
+                        $hello = $this->serverHostname();
+                    }
+                    $this->smtp->hello($hello);
+                    //Automatically enable TLS encryption if:
+                    // * it's not disabled
+                    // * we have openssl extension
+                    // * we are not already using SSL
+                    // * the server offers STARTTLS
+                    if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
+                        $tls = true;
+                    }
+                    if ($tls) {
+                        if (!$this->smtp->startTLS()) {
+                            throw new phpmailerException($this->lang('connect_host'));
+                        }
+                        // We must resend HELO after tls negotiation
+                        $this->smtp->hello($hello);
+                    }
+                    if ($this->SMTPAuth) {
+                        if (!$this->smtp->authenticate(
+                            $this->Username,
+                            $this->Password,
+                            $this->AuthType,
+                            $this->Realm,
+                            $this->Workstation,
+                            $this->oauth
+                        )
+                        ) {
+                            throw new phpmailerException($this->lang('authenticate'));
+                        }
+                    }
+                    return true;
+                } catch (phpmailerException $exc) {
+                    $lastexception = $exc;
+                    $this->edebug($exc->getMessage());
+                    // We must have connected, but then failed TLS or Auth, so close connection nicely
+                    $this->smtp->quit();
+                }
+            }
+        }
+        // If we get here, all connection attempts have failed, so close connection hard
+        $this->smtp->close();
+        // As we've caught all exceptions, just report whatever the last one was
+        if ($this->exceptions and !is_null($lastexception)) {
+            throw $lastexception;
+        }
+        return false;
+    }
+}
diff --git a/www/plugins/facteur/phpmailer-php5/class.phpmaileroauthgoogle.php b/www/plugins/facteur/phpmailer-php5/class.phpmaileroauthgoogle.php
new file mode 100644 (file)
index 0000000..ab6292b
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * PHPMailer - PHP email creation and transport class.
+ * PHP Version 5.4
+ * @package PHPMailer
+ * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ * @note 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.
+ */
+
+/**
+ * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider.
+ * @package PHPMailer
+ * @author @sherryl4george
+ * @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
+ * @link https://github.com/thephpleague/oauth2-client
+ */
+class PHPMailerOAuthGoogle
+{
+    private $oauthUserEmail = '';
+    private $oauthRefreshToken = '';
+    private $oauthClientId = '';
+    private $oauthClientSecret = '';
+
+    /**
+     * @param string $UserEmail
+     * @param string $ClientSecret
+     * @param string $ClientId
+     * @param string $RefreshToken
+     */
+    public function __construct(
+        $UserEmail,
+        $ClientSecret,
+        $ClientId,
+        $RefreshToken
+    ) {
+        $this->oauthClientId = $ClientId;
+        $this->oauthClientSecret = $ClientSecret;
+        $this->oauthRefreshToken = $RefreshToken;
+        $this->oauthUserEmail = $UserEmail;
+    }
+
+    private function getProvider() {
+        return new League\OAuth2\Client\Provider\Google([
+            'clientId' => $this->oauthClientId,
+            'clientSecret' => $this->oauthClientSecret
+        ]);
+    }
+
+    private function getGrant()
+    {
+        return new \League\OAuth2\Client\Grant\RefreshToken();
+    }
+
+    private function getToken()
+    {
+        $provider = $this->getProvider();
+        $grant = $this->getGrant();
+        return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
+    }
+
+    public function getOauth64()
+    {
+        $token = $this->getToken();
+        return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
+    }
+}
index f9fd3b2..403b573 100755 (executable)
 <?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
+ * PHPMailer POP-Before-SMTP Authentication Class.
+ * PHP Version 5
  * @package PHPMailer
- * @author Andy Prevost
- * @author Marcus Bointon
+ * @link https://github.com/PHPMailer/PHPMailer/
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
  * @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 $
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ * @note 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.
  */
 
 /**
- * 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.
- *
+ * PHPMailer POP-Before-SMTP Authentication Class.
+ * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
+ * Does not support APOP.
  * @package PHPMailer
- * @author Richard Davey
+ * @author Richard Davey (original author) <rich@corephp.co.uk>
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
  */
-
-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;
-      }
-
+class POP3
+{
+    /**
+     * The POP3 PHPMailer Version number.
+     * @var string
+     * @access public
+     */
+    public $Version = '5.2.14';
+
+    /**
+     * Default POP3 port number.
+     * @var integer
+     * @access public
+     */
+    public $POP3_PORT = 110;
+
+    /**
+     * Default timeout in seconds.
+     * @var integer
+     * @access public
+     */
+    public $POP3_TIMEOUT = 30;
+
+    /**
+     * POP3 Carriage Return + Line Feed.
+     * @var string
+     * @access public
+     * @deprecated Use the constant instead
+     */
+    public $CRLF = "\r\n";
+
+    /**
+     * Debug display level.
+     * Options: 0 = no, 1+ = yes
+     * @var integer
+     * @access public
+     */
+    public $do_debug = 0;
+
+    /**
+     * POP3 mail server hostname.
+     * @var string
+     * @access public
+     */
+    public $host;
+
+    /**
+     * POP3 port number.
+     * @var integer
+     * @access public
+     */
+    public $port;
+
+    /**
+     * POP3 Timeout Value in seconds.
+     * @var integer
+     * @access public
+     */
+    public $tval;
+
+    /**
+     * POP3 username
+     * @var string
+     * @access public
+     */
+    public $username;
+
+    /**
+     * POP3 password.
+     * @var string
+     * @access public
+     */
+    public $password;
+
+    /**
+     * Resource handle for the POP3 connection socket.
+     * @var resource
+     * @access protected
+     */
+    protected $pop_conn;
+
+    /**
+     * Are we connected?
+     * @var boolean
+     * @access protected
+     */
+    protected $connected = false;
+
+    /**
+     * Error container.
+     * @var array
+     * @access protected
+     */
+    protected $errors = array();
+
+    /**
+     * Line break constant
+     */
+    const CRLF = "\r\n";
+
+    /**
+     * Simple static wrapper for all-in-one POP before SMTP
+     * @param $host
+     * @param integer|boolean $port The port number to connect to
+     * @param integer|boolean $timeout The timeout value
+     * @param string $username
+     * @param string $password
+     * @param integer $debug_level
+     * @return boolean
+     */
+    public static function popBeforeSmtp(
+        $host,
+        $port = false,
+        $timeout = false,
+        $username = '',
+        $password = '',
+        $debug_level = 0
+    ) {
+        $pop = new POP3;
+        return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
     }
 
-    //  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;
+    /**
+     * Authenticate with a POP3 server.
+     * A connect, login, disconnect sequence
+     * appropriate for POP-before SMTP authorisation.
+     * @access public
+     * @param string $host The hostname to connect to
+     * @param integer|boolean $port The port number to connect to
+     * @param integer|boolean $timeout The timeout value
+     * @param string $username
+     * @param string $password
+     * @param integer $debug_level
+     * @return boolean
+     */
+    public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
+    {
+        $this->host = $host;
+        // If no port value provided, use default
+        if (false === $port) {
+            $this->port = $this->POP3_PORT;
+        } else {
+            $this->port = (integer)$port;
+        }
+        // If no timeout value provided, use default
+        if (false === $timeout) {
+            $this->tval = $this->POP3_TIMEOUT;
+        } else {
+            $this->tval = (integer)$timeout;
+        }
+        $this->do_debug = $debug_level;
+        $this->username = $username;
+        $this->password = $password;
+        //  Reset the error log
+        $this->errors = array();
+        //  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 of whether the login succeeded
+        $this->disconnect();
+        return false;
     }
 
-    /*
-    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();
+    /**
+     * Connect to a POP3 server.
+     * @access public
+     * @param string $host
+     * @param integer|boolean $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 suppress it with @fsockopen, capture it cleanly instead
+        set_error_handler(array($this, 'catchWarning'));
+
+        if (false === $port) {
+            $port = $this->POP3_PORT;
+        }
+
+        //  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();
+
+        //  Did we connect?
+        if (false === $this->pop_conn) {
+            //  It would appear not...
+            $this->setError(array(
+                'error' => "Failed to connect to server $host on port $port",
+                'errno' => $errno,
+                'errstr' => $errstr
+            ));
+            return false;
+        }
+
+        //  Increase the stream time-out
+        stream_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;
+        }
+        return false;
     }
 
-    //  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;
+    /**
+     * Log in to the POP3 server.
+     * Does not support APOP (RFC 2828, 4949).
+     * @access public
+     * @param string $username
+     * @param string $password
+     * @return boolean
+     */
+    public function login($username = '', $password = '')
+    {
+        if (!$this->connected) {
+            $this->setError('Not connected to POP3 server');
+        }
+        if (empty($username)) {
+            $username = $this->username;
+        }
+        if (empty($password)) {
+            $password = $this->password;
+        }
+
+        // Send the Username
+        $this->sendString("USER $username" . self::CRLF);
+        $pop3_response = $this->getResponse();
+        if ($this->checkResponse($pop3_response)) {
+            // Send the Password
+            $this->sendString("PASS $password" . self::CRLF);
+            $pop3_response = $this->getResponse();
+            if ($this->checkResponse($pop3_response)) {
+                return true;
+            }
+        }
+        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);
-      }
+    /**
+     * Disconnect from the POP3 server.
+     * @access public
+     */
+    public function disconnect()
+    {
+        $this->sendString('QUIT');
+        //The QUIT command may cause the daemon to exit, which will kill our connection
+        //So ignore errors here
+        try {
+            @fclose($this->pop_conn);
+        } catch (Exception $e) {
+            //Do nothing
+        };
     }
 
-    //  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;
+    /**
+     * Get a response from the POP3 server.
+     * $size is the maximum number of bytes to retrieve
+     * @param integer $size
+     * @return string
+     * @access protected
+     */
+    protected function getResponse($size = 128)
+    {
+        $response = fgets($this->pop_conn, $size);
+        if ($this->do_debug >= 1) {
+            echo "Server -> Client: $response";
+        }
+        return $response;
     }
 
-  }
-
-  /**
-   * 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();
-      }
+    /**
+     * Send raw data to the POP3 server.
+     * @param string $string
+     * @return integer
+     * @access protected
+     */
+    protected function sendString($string)
+    {
+        if ($this->pop_conn) {
+            if ($this->do_debug >= 2) { //Show client messages when debug >= 2
+                echo "Client -> Server: $string";
+            }
+            return fwrite($this->pop_conn, $string, strlen($string));
+        }
+        return 0;
     }
 
-    if (empty($username)) {
-      $username = $this->username;
+    /**
+     * Checks the POP3 server response.
+     * Looks for for +OK or -ERR.
+     * @param string $string
+     * @return boolean
+     * @access protected
+     */
+    protected function checkResponse($string)
+    {
+        if (substr($string, 0, 3) !== '+OK') {
+            $this->setError(array(
+                'error' => "Server reported an error: $string",
+                'errno' => 0,
+                'errstr' => ''
+            ));
+            return false;
+        } else {
+            return true;
+        }
     }
 
-    if (empty($password)) {
-      $password = $this->password;
+    /**
+     * Add an error to the internal error store.
+     * Also display debug output if it's enabled.
+     * @param $error
+     * @access protected
+     */
+    protected function setError($error)
+    {
+        $this->errors[] = $error;
+        if ($this->do_debug >= 1) {
+            echo '<pre>';
+            foreach ($this->errors as $error) {
+                print_r($error);
+            }
+            echo '</pre>';
+        }
     }
 
-    $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;
+    /**
+     * Get an array of error messages, if any.
+     * @return array
+     */
+    public function getErrors()
+    {
+        return $this->errors;
     }
 
-  }
-
-  /**
-   * 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);
+    /**
+     * POP3 connection error handler.
+     * @param integer $errno
+     * @param string $errstr
+     * @param string $errfile
+     * @param integer $errline
+     * @access protected
+     */
+    protected function catchWarning($errno, $errstr, $errfile, $errline)
+    {
+        $this->setError(array(
+            'error' => "Connecting to the POP3 server raised a PHP warning: ",
+            'errno' => $errno,
+            'errstr' => $errstr,
+            'errfile' => $errfile,
+            'errline' => $errline
+        ));
     }
-
-    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
index c2ca1cb..2e32e2f 100755 (executable)
-<?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
+<?php
+/**
+ * PHPMailer RFC821 SMTP email transport class.
+ * PHP Version 5
+ * @package PHPMailer
+ * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2014 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ * @note 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.
+ */
+
+/**
+ * PHPMailer RFC821 SMTP email transport class.
+ * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
+ * @package PHPMailer
+ * @author Chris Ryan
+ * @author Marcus Bointon <phpmailer@synchromedia.co.uk>
+ */
+class SMTP
+{
+    /**
+     * The PHPMailer SMTP version number.
+     * @var string
+     */
+    const VERSION = '5.2.14';
+
+    /**
+     * SMTP line break constant.
+     * @var string
+     */
+    const CRLF = "\r\n";
+
+    /**
+     * The SMTP port to use if one is not specified.
+     * @var integer
+     */
+    const DEFAULT_SMTP_PORT = 25;
+
+    /**
+     * The maximum line length allowed by RFC 2822 section 2.1.1
+     * @var integer
+     */
+    const MAX_LINE_LENGTH = 998;
+
+    /**
+     * Debug level for no output
+     */
+    const DEBUG_OFF = 0;
+
+    /**
+     * Debug level to show client -> server messages
+     */
+    const DEBUG_CLIENT = 1;
+
+    /**
+     * Debug level to show client -> server and server -> client messages
+     */
+    const DEBUG_SERVER = 2;
+
+    /**
+     * Debug level to show connection status, client -> server and server -> client messages
+     */
+    const DEBUG_CONNECTION = 3;
+
+    /**
+     * Debug level to show all messages
+     */
+    const DEBUG_LOWLEVEL = 4;
+
+    /**
+     * The PHPMailer SMTP Version number.
+     * @var string
+     * @deprecated Use the `VERSION` constant instead
+     * @see SMTP::VERSION
+     */
+    public $Version = '5.2.14';
+
+    /**
+     * SMTP server port number.
+     * @var integer
+     * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
+     * @see SMTP::DEFAULT_SMTP_PORT
+     */
+    public $SMTP_PORT = 25;
+
+    /**
+     * SMTP reply line ending.
+     * @var string
+     * @deprecated Use the `CRLF` constant instead
+     * @see SMTP::CRLF
+     */
+    public $CRLF = "\r\n";
+
+    /**
+     * Debug output level.
+     * Options:
+     * * self::DEBUG_OFF (`0`) No debug output, default
+     * * self::DEBUG_CLIENT (`1`) Client commands
+     * * self::DEBUG_SERVER (`2`) Client commands and server responses
+     * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
+     * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
+     * @var integer
+     */
+    public $do_debug = self::DEBUG_OFF;
+
+    /**
+     * How to handle debug output.
+     * Options:
+     * * `echo` Output plain-text as-is, appropriate for CLI
+     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
+     * * `error_log` Output to error log as configured in php.ini
+     *
+     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
+     * <code>
+     * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
+     * </code>
+     * @var string|callable
+     */
+    public $Debugoutput = 'echo';
+
+    /**
+     * Whether to use VERP.
+     * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
+     * @link http://www.postfix.org/VERP_README.html Info on VERP
+     * @var boolean
+     */
+    public $do_verp = false;
+
+    /**
+     * The timeout value for connection, in seconds.
+     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
+     * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
+     * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
+     * @var integer
+     */
+    public $Timeout = 300;
+
+    /**
+     * How long to wait for commands to complete, in seconds.
+     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
+     * @var integer
+     */
+    public $Timelimit = 300;
+
+    /**
+     * The socket for the server connection.
+     * @var resource
+     */
+    protected $smtp_conn;
+
+    /**
+     * Error information, if any, for the last SMTP command.
+     * @var array
+     */
+    protected $error = array(
+        'error' => '',
+        'detail' => '',
+        'smtp_code' => '',
+        'smtp_code_ex' => ''
+    );
+
+    /**
+     * The reply the server sent to us for HELO.
+     * If null, no HELO string has yet been received.
+     * @var string|null
+     */
+    protected $helo_rply = null;
+
+    /**
+     * The set of SMTP extensions sent in reply to EHLO command.
+     * Indexes of the array are extension names.
+     * Value at index 'HELO' or 'EHLO' (according to command that was sent)
+     * represents the server name. In case of HELO it is the only element of the array.
+     * Other values can be boolean TRUE or an array containing extension options.
+     * If null, no HELO/EHLO string has yet been received.
+     * @var array|null
+     */
+    protected $server_caps = null;
+
+    /**
+     * The most recent reply received from the server.
+     * @var string
+     */
+    protected $last_reply = '';
+
+    /**
+     * Output debugging info via a user-selected method.
+     * @see SMTP::$Debugoutput
+     * @see SMTP::$do_debug
+     * @param string $str Debug string to output
+     * @param integer $level The debug level of this message; see DEBUG_* constants
+     * @return void
+     */
+    protected function edebug($str, $level = 0)
+    {
+        if ($level > $this->do_debug) {
+            return;
+        }
+        //Avoid clash with built-in function names
+        if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
+            call_user_func($this->Debugoutput, $str, $this->do_debug);
+            return;
+        }
+        switch ($this->Debugoutput) {
+            case 'error_log':
+                //Don't output, just log
+                error_log($str);
+                break;
+            case 'html':
+                //Cleans up output a bit for a better looking, HTML-safe output
+                echo htmlentities(
+                    preg_replace('/[\r\n]+/', '', $str),
+                    ENT_QUOTES,
+                    'UTF-8'
+                )
+                . "<br>\n";
+                break;
+            case 'echo':
+            default:
+                //Normalize line breaks
+                $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
+                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
+                    "\n",
+                    "\n                   \t                  ",
+                    trim($str)
+                )."\n";
+        }
+    }
+
+    /**
+     * Connect to an SMTP server.
+     * @param string $host SMTP server IP or host name
+     * @param integer $port The port number to connect to
+     * @param integer $timeout How long to wait for the connection to open
+     * @param array $options An array of options for stream_context_create()
+     * @access public
+     * @return boolean
+     */
+    public function connect($host, $port = null, $timeout = 30, $options = array())
+    {
+        static $streamok;
+        //This is enabled by default since 5.0.0 but some providers disable it
+        //Check this once and cache the result
+        if (is_null($streamok)) {
+            $streamok = function_exists('stream_socket_client');
+        }
+        // Clear errors to avoid confusion
+        $this->setError('');
+        // Make sure we are __not__ connected
+        if ($this->connected()) {
+            // Already connected, generate error
+            $this->setError('Already connected to a server');
+            return false;
+        }
+        if (empty($port)) {
+            $port = self::DEFAULT_SMTP_PORT;
+        }
+        // Connect to the SMTP server
+        $this->edebug(
+            "Connection: opening to $host:$port, timeout=$timeout, options=".var_export($options, true),
+            self::DEBUG_CONNECTION
+        );
+        $errno = 0;
+        $errstr = '';
+        if ($streamok) {
+            $socket_context = stream_context_create($options);
+            //Suppress errors; connection failures are handled at a higher level
+            $this->smtp_conn = @stream_socket_client(
+                $host . ":" . $port,
+                $errno,
+                $errstr,
+                $timeout,
+                STREAM_CLIENT_CONNECT,
+                $socket_context
+            );
+        } else {
+            //Fall back to fsockopen which should work in more places, but is missing some features
+            $this->edebug(
+                "Connection: stream_socket_client not available, falling back to fsockopen",
+                self::DEBUG_CONNECTION
+            );
+            $this->smtp_conn = fsockopen(
+                $host,
+                $port,
+                $errno,
+                $errstr,
+                $timeout
+            );
+        }
+        // Verify we connected properly
+        if (!is_resource($this->smtp_conn)) {
+            $this->setError(
+                'Failed to connect to server',
+                $errno,
+                $errstr
+            );
+            $this->edebug(
+                'SMTP ERROR: ' . $this->error['error']
+                . ": $errstr ($errno)",
+                self::DEBUG_CLIENT
+            );
+            return false;
+        }
+        $this->edebug('Connection: opened', self::DEBUG_CONNECTION);
+        // SMTP server can take longer to respond, give longer timeout for first read
+        // Windows does not have support for this timeout function
+        if (substr(PHP_OS, 0, 3) != 'WIN') {
+            $max = ini_get('max_execution_time');
+            // Don't bother if unlimited
+            if ($max != 0 && $timeout > $max) {
+                @set_time_limit($timeout);
+            }
+            stream_set_timeout($this->smtp_conn, $timeout, 0);
+        }
+        // Get any announcement
+        $announce = $this->get_lines();
+        $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
+        return true;
+    }
+
+    /**
+     * Initiate a TLS (encrypted) session.
+     * @access public
+     * @return boolean
+     */
+    public function startTLS()
+    {
+        if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
+            return false;
+        }
+        // Begin encrypted connection
+        if (!stream_socket_enable_crypto(
+            $this->smtp_conn,
+            true,
+            STREAM_CRYPTO_METHOD_TLS_CLIENT
+        )) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Perform SMTP authentication.
+     * Must be run after hello().
+     * @see hello()
+     * @param string $username The user name
+     * @param string $password The password
+     * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
+     * @param string $realm The auth realm for NTLM
+     * @param string $workstation The auth workstation for NTLM
+     * @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
+     * @return bool True if successfully authenticated.* @access public
+     */
+    public function authenticate(
+        $username,
+        $password,
+        $authtype = null,
+        $realm = '',
+        $workstation = '',
+        $OAuth = null
+    ) {
+        if (!$this->server_caps) {
+            $this->setError('Authentication is not allowed before HELO/EHLO');
+            return false;
+        }
+
+        if (array_key_exists('EHLO', $this->server_caps)) {
+        // SMTP extensions are available. Let's try to find a proper authentication method
+
+            if (!array_key_exists('AUTH', $this->server_caps)) {
+                $this->setError('Authentication is not allowed at this stage');
+                // 'at this stage' means that auth may be allowed after the stage changes
+                // e.g. after STARTTLS
+                return false;
+            }
+
+            self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
+            self::edebug(
+                'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
+                self::DEBUG_LOWLEVEL
+            );
+
+            if (empty($authtype)) {
+                foreach (array('LOGIN', 'CRAM-MD5', 'NTLM', 'PLAIN', 'XOAUTH2') as $method) {
+                    if (in_array($method, $this->server_caps['AUTH'])) {
+                        $authtype = $method;
+                        break;
+                    }
+                }
+                if (empty($authtype)) {
+                    $this->setError('No supported authentication methods found');
+                    return false;
+                }
+                self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL);
+            }
+
+            if (!in_array($authtype, $this->server_caps['AUTH'])) {
+                $this->setError("The requested authentication method \"$authtype\" is not supported by the server");
+                return false;
+            }
+        } elseif (empty($authtype)) {
+            $authtype = 'LOGIN';
+        }
+        switch ($authtype) {
+            case 'PLAIN':
+                // Start authentication
+                if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
+                    return false;
+                }
+                // Send encoded username and password
+                if (!$this->sendCommand(
+                    'User & Password',
+                    base64_encode("\0" . $username . "\0" . $password),
+                    235
+                )
+                ) {
+                    return false;
+                }
+                break;
+            case 'LOGIN':
+                // Start authentication
+                if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
+                    return false;
+                }
+                if (!$this->sendCommand("Username", base64_encode($username), 334)) {
+                    return false;
+                }
+                if (!$this->sendCommand("Password", base64_encode($password), 235)) {
+                    return false;
+                }
+                break;
+            case 'XOAUTH2':
+                //If the OAuth Instance is not set. Can be a case when PHPMailer is used
+                //instead of PHPMailerOAuth
+                if (is_null($OAuth)) {
+                    return false;
+                }
+                $oauth = $OAuth->getOauth64();
+
+                // Start authentication
+                if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
+                    return false;
+                }
+                break;
+            case 'NTLM':
+                /*
+                 * ntlm_sasl_client.php
+                 * Bundled with Permission
+                 *
+                 * How to telnet in windows:
+                 * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
+                 * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
+                 */
+                require_once 'extras/ntlm_sasl_client.php';
+                $temp = new stdClass;
+                $ntlm_client = new ntlm_sasl_client_class;
+                //Check that functions are available
+                if (!$ntlm_client->Initialize($temp)) {
+                    $this->setError($temp->error);
+                    $this->edebug(
+                        'You need to enable some modules in your php.ini file: '
+                        . $this->error['error'],
+                        self::DEBUG_CLIENT
+                    );
+                    return false;
+                }
+                //msg1
+                $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1
+
+                if (!$this->sendCommand(
+                    'AUTH NTLM',
+                    'AUTH NTLM ' . base64_encode($msg1),
+                    334
+                )
+                ) {
+                    return false;
+                }
+                //Though 0 based, there is a white space after the 3 digit number
+                //msg2
+                $challenge = substr($this->last_reply, 3);
+                $challenge = base64_decode($challenge);
+                $ntlm_res = $ntlm_client->NTLMResponse(
+                    substr($challenge, 24, 8),
+                    $password
+                );
+                //msg3
+                $msg3 = $ntlm_client->TypeMsg3(
+                    $ntlm_res,
+                    $username,
+                    $realm,
+                    $workstation
+                );
+                // send encoded username
+                return $this->sendCommand('Username', base64_encode($msg3), 235);
+            case 'CRAM-MD5':
+                // Start authentication
+                if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
+                    return false;
+                }
+                // Get the challenge
+                $challenge = base64_decode(substr($this->last_reply, 4));
+
+                // Build the response
+                $response = $username . ' ' . $this->hmac($challenge, $password);
+
+                // send encoded credentials
+                return $this->sendCommand('Username', base64_encode($response), 235);
+            default:
+                $this->setError("Authentication method \"$authtype\" is not supported");
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * Calculate an MD5 HMAC hash.
+     * Works like hash_hmac('md5', $data, $key)
+     * in case that function is not available
+     * @param string $data The data to hash
+     * @param string $key  The key to hash with
+     * @access protected
+     * @return string
+     */
+    protected function hmac($data, $key)
+    {
+        if (function_exists('hash_hmac')) {
+            return hash_hmac('md5', $data, $key);
+        }
+
+        // The following borrowed from
+        // http://php.net/manual/en/function.mhash.php#27225
+
+        // RFC 2104 HMAC implementation for php.
+        // Creates an md5 HMAC.
+        // Eliminates the need to install mhash to compute a HMAC
+        // by Lance Rushing
+
+        $bytelen = 64; // byte length for md5
+        if (strlen($key) > $bytelen) {
+            $key = pack('H*', md5($key));
+        }
+        $key = str_pad($key, $bytelen, chr(0x00));
+        $ipad = str_pad('', $bytelen, chr(0x36));
+        $opad = str_pad('', $bytelen, chr(0x5c));
+        $k_ipad = $key ^ $ipad;
+        $k_opad = $key ^ $opad;
+
+        return md5($k_opad . pack('H*', md5($k_ipad . $data)));
+    }
+
+    /**
+     * Check connection state.
+     * @access public
+     * @return boolean True if connected.
+     */
+    public function connected()
+    {
+        if (is_resource($this->smtp_conn)) {
+            $sock_status = stream_get_meta_data($this->smtp_conn);
+            if ($sock_status['eof']) {
+                // The socket is valid but we are not connected
+                $this->edebug(
+                    'SMTP NOTICE: EOF caught while checking if connected',
+                    self::DEBUG_CLIENT
+                );
+                $this->close();
+                return false;
+            }
+            return true; // everything looks good
+        }
+        return false;
+    }
+
+    /**
+     * Close the socket and clean up the state of the class.
+     * Don't use this function without first trying to use QUIT.
+     * @see quit()
+     * @access public
+     * @return void
+     */
+    public function close()
+    {
+        $this->setError('');
+        $this->server_caps = null;
+        $this->helo_rply = null;
+        if (is_resource($this->smtp_conn)) {
+            // close the connection and cleanup
+            fclose($this->smtp_conn);
+            $this->smtp_conn = null; //Makes for cleaner serialization
+            $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
+        }
+    }
+
+    /**
+     * Send an SMTP DATA command.
+     * Issues a data command and sends the msg_data to the server,
+     * finializing the mail transaction. $msg_data is the message
+     * that is to be send with the headers. Each header needs to be
+     * on a single line followed by a <CRLF> with the message headers
+     * and the message body being separated by and additional <CRLF>.
+     * Implements rfc 821: DATA <CRLF>
+     * @param string $msg_data Message data to send
+     * @access public
+     * @return boolean
+     */
+    public function data($msg_data)
+    {
+        //This will use the standard timelimit
+        if (!$this->sendCommand('DATA', 'DATA', 354)) {
+            return false;
+        }
+
+        /* The server is ready to accept data!
+         * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
+         * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
+         * smaller lines to fit within the limit.
+         * We will also look for lines that start with a '.' and prepend an additional '.'.
+         * NOTE: this does not count towards line-length limit.
+         */
+
+        // Normalize line breaks before exploding
+        $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
+
+        /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
+         * of the first line (':' separated) does not contain a space then it _should_ be a header and we will
+         * process all lines before a blank line as headers.
+         */
+
+        $field = substr($lines[0], 0, strpos($lines[0], ':'));
+        $in_headers = false;
+        if (!empty($field) && strpos($field, ' ') === false) {
+            $in_headers = true;
+        }
+
+        foreach ($lines as $line) {
+            $lines_out = array();
+            if ($in_headers and $line == '') {
+                $in_headers = false;
+            }
+            //Break this line up into several smaller lines if it's too long
+            //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),
+            while (isset($line[self::MAX_LINE_LENGTH])) {
+                //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
+                //so as to avoid breaking in the middle of a word
+                $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
+                //Deliberately matches both false and 0
+                if (!$pos) {
+                    //No nice break found, add a hard break
+                    $pos = self::MAX_LINE_LENGTH - 1;
+                    $lines_out[] = substr($line, 0, $pos);
+                    $line = substr($line, $pos);
+                } else {
+                    //Break at the found point
+                    $lines_out[] = substr($line, 0, $pos);
+                    //Move along by the amount we dealt with
+                    $line = substr($line, $pos + 1);
+                }
+                //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
+                if ($in_headers) {
+                    $line = "\t" . $line;
+                }
+            }
+            $lines_out[] = $line;
+
+            //Send the lines to the server
+            foreach ($lines_out as $line_out) {
+                //RFC2821 section 4.5.2
+                if (!empty($line_out) and $line_out[0] == '.') {
+                    $line_out = '.' . $line_out;
+                }
+                $this->client_send($line_out . self::CRLF);
+            }
+        }
+
+        //Message data has been sent, complete the command
+        //Increase timelimit for end of DATA command
+        $savetimelimit = $this->Timelimit;
+        $this->Timelimit = $this->Timelimit * 2;
+        $result = $this->sendCommand('DATA END', '.', 250);
+        //Restore timelimit
+        $this->Timelimit = $savetimelimit;
+        return $result;
+    }
+
+    /**
+     * Send an SMTP HELO or EHLO command.
+     * Used to identify the sending server to the receiving server.
+     * This makes sure that client and server are in a known state.
+     * Implements RFC 821: HELO <SP> <domain> <CRLF>
+     * and RFC 2821 EHLO.
+     * @param string $host The host name or IP to connect to
+     * @access public
+     * @return boolean
+     */
+    public function hello($host = '')
+    {
+        //Try extended hello first (RFC 2821)
+        return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
+    }
+
+    /**
+     * Send an SMTP HELO or EHLO command.
+     * Low-level implementation used by hello()
+     * @see hello()
+     * @param string $hello The HELO string
+     * @param string $host The hostname to say we are
+     * @access protected
+     * @return boolean
+     */
+    protected function sendHello($hello, $host)
+    {
+        $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
+        $this->helo_rply = $this->last_reply;
+        if ($noerror) {
+            $this->parseHelloFields($hello);
+        } else {
+            $this->server_caps = null;
+        }
+        return $noerror;
+    }
+
+    /**
+     * Parse a reply to HELO/EHLO command to discover server extensions.
+     * In case of HELO, the only parameter that can be discovered is a server name.
+     * @access protected
+     * @param string $type - 'HELO' or 'EHLO'
+     */
+    protected function parseHelloFields($type)
+    {
+        $this->server_caps = array();
+        $lines = explode("\n", $this->last_reply);
+
+        foreach ($lines as $n => $s) {
+            //First 4 chars contain response code followed by - or space
+            $s = trim(substr($s, 4));
+            if (empty($s)) {
+                continue;
+            }
+            $fields = explode(' ', $s);
+            if (!empty($fields)) {
+                if (!$n) {
+                    $name = $type;
+                    $fields = $fields[0];
+                } else {
+                    $name = array_shift($fields);
+                    switch ($name) {
+                        case 'SIZE':
+                            $fields = ($fields ? $fields[0] : 0);
+                            break;
+                        case 'AUTH':
+                            if (!is_array($fields)) {
+                                $fields = array();
+                            }
+                            break;
+                        default:
+                            $fields = true;
+                    }
+                }
+                $this->server_caps[$name] = $fields;
+            }
+        }
+    }
+
+    /**
+     * Send an SMTP MAIL command.
+     * Starts a mail transaction from the email address specified in
+     * $from. Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more recipient
+     * commands may be called followed by a data command.
+     * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
+     * @param string $from Source address of this message
+     * @access public
+     * @return boolean
+     */
+    public function mail($from)
+    {
+        $useVerp = ($this->do_verp ? ' XVERP' : '');
+        return $this->sendCommand(
+            'MAIL FROM',
+            'MAIL FROM:<' . $from . '>' . $useVerp,
+            250
+        );
+    }
+
+    /**
+     * Send an SMTP QUIT command.
+     * Closes the socket if there is no error or the $close_on_error argument is true.
+     * Implements from rfc 821: QUIT <CRLF>
+     * @param boolean $close_on_error Should the connection close if an error occurs?
+     * @access public
+     * @return boolean
+     */
+    public function quit($close_on_error = true)
+    {
+        $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
+        $err = $this->error; //Save any error
+        if ($noerror or $close_on_error) {
+            $this->close();
+            $this->error = $err; //Restore any error from the quit command
+        }
+        return $noerror;
+    }
+
+    /**
+     * Send an SMTP RCPT command.
+     * Sets the TO argument to $toaddr.
+     * Returns true if the recipient was accepted false if it was rejected.
+     * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
+     * @param string $address The address the message is being sent to
+     * @access public
+     * @return boolean
+     */
+    public function recipient($address)
+    {
+        return $this->sendCommand(
+            'RCPT TO',
+            'RCPT TO:<' . $address . '>',
+            array(250, 251)
+        );
+    }
+
+    /**
+     * Send an SMTP RSET command.
+     * Abort any transaction that is currently in progress.
+     * Implements rfc 821: RSET <CRLF>
+     * @access public
+     * @return boolean True on success.
+     */
+    public function reset()
+    {
+        return $this->sendCommand('RSET', 'RSET', 250);
+    }
+
+    /**
+     * Send a command to an SMTP server and check its return code.
+     * @param string $command The command name - not sent to the server
+     * @param string $commandstring The actual command to send
+     * @param integer|array $expect One or more expected integer success codes
+     * @access protected
+     * @return boolean True on success.
+     */
+    protected function sendCommand($command, $commandstring, $expect)
+    {
+        if (!$this->connected()) {
+            $this->setError("Called $command without being connected");
+            return false;
+        }
+        //Reject line breaks in all commands
+        if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
+            $this->setError("Command '$command' contained line breaks");
+            return false;
+        }
+        $this->client_send($commandstring . self::CRLF);
+
+        $this->last_reply = $this->get_lines();
+        // Fetch SMTP code and possible error code explanation
+        $matches = array();
+        if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
+            $code = $matches[1];
+            $code_ex = (count($matches) > 2 ? $matches[2] : null);
+            // Cut off error code from each response line
+            $detail = preg_replace(
+                "/{$code}[ -]".($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '')."/m",
+                '',
+                $this->last_reply
+            );
+        } else {
+            // Fall back to simple parsing if regex fails
+            $code = substr($this->last_reply, 0, 3);
+            $code_ex = null;
+            $detail = substr($this->last_reply, 4);
+        }
+
+        $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
+
+        if (!in_array($code, (array)$expect)) {
+            $this->setError(
+                "$command command failed",
+                $detail,
+                $code,
+                $code_ex
+            );
+            $this->edebug(
+                'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
+                self::DEBUG_CLIENT
+            );
+            return false;
+        }
+
+        $this->setError('');
+        return true;
+    }
+
+    /**
+     * Send an SMTP SAML command.
+     * Starts a mail transaction from the email address specified in $from.
+     * Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more recipient
+     * commands may be called followed by a data command. This command
+     * will send the message to the users terminal if they are logged
+     * in and send them an email.
+     * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
+     * @param string $from The address the message is from
+     * @access public
+     * @return boolean
+     */
+    public function sendAndMail($from)
+    {
+        return $this->sendCommand('SAML', "SAML FROM:$from", 250);
+    }
+
+    /**
+     * Send an SMTP VRFY command.
+     * @param string $name The name to verify
+     * @access public
+     * @return boolean
+     */
+    public function verify($name)
+    {
+        return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
+    }
+
+    /**
+     * Send an SMTP NOOP command.
+     * Used to keep keep-alives alive, doesn't actually do anything
+     * @access public
+     * @return boolean
+     */
+    public function noop()
+    {
+        return $this->sendCommand('NOOP', 'NOOP', 250);
+    }
+
+    /**
+     * Send an SMTP TURN command.
+     * This is an optional command for SMTP that this class does not support.
+     * This method is here to make the RFC821 Definition complete for this class
+     * and _may_ be implemented in future
+     * Implements from rfc 821: TURN <CRLF>
+     * @access public
+     * @return boolean
+     */
+    public function turn()
+    {
+        $this->setError('The SMTP TURN command is not implemented');
+        $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
+        return false;
+    }
+
+    /**
+     * Send raw data to the server.
+     * @param string $data The data to send
+     * @access public
+     * @return integer|boolean The number of bytes sent to the server or false on error
+     */
+    public function client_send($data)
+    {
+        $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
+        return fwrite($this->smtp_conn, $data);
+    }
+
+    /**
+     * Get the latest error.
+     * @access public
+     * @return array
+     */
+    public function getError()
+    {
+        return $this->error;
+    }
+
+    /**
+     * Get SMTP extensions available on the server
+     * @access public
+     * @return array|null
+     */
+    public function getServerExtList()
+    {
+        return $this->server_caps;
+    }
+
+    /**
+     * A multipurpose method
+     * The method works in three ways, dependent on argument value and current state
+     *   1. HELO/EHLO was not sent - returns null and set up $this->error
+     *   2. HELO was sent
+     *     $name = 'HELO': returns server name
+     *     $name = 'EHLO': returns boolean false
+     *     $name = any string: returns null and set up $this->error
+     *   3. EHLO was sent
+     *     $name = 'HELO'|'EHLO': returns server name
+     *     $name = any string: if extension $name exists, returns boolean True
+     *       or its options. Otherwise returns boolean False
+     * In other words, one can use this method to detect 3 conditions:
+     *  - null returned: handshake was not or we don't know about ext (refer to $this->error)
+     *  - false returned: the requested feature exactly not exists
+     *  - positive value returned: the requested feature exists
+     * @param string $name Name of SMTP extension or 'HELO'|'EHLO'
+     * @return mixed
+     */
+    public function getServerExt($name)
+    {
+        if (!$this->server_caps) {
+            $this->setError('No HELO/EHLO was sent');
+            return null;
+        }
+
+        // the tight logic knot ;)
+        if (!array_key_exists($name, $this->server_caps)) {
+            if ($name == 'HELO') {
+                return $this->server_caps['EHLO'];
+            }
+            if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) {
+                return false;
+            }
+            $this->setError('HELO handshake was used. Client knows nothing about server extensions');
+            return null;
+        }
+
+        return $this->server_caps[$name];
+    }
+
+    /**
+     * Get the last reply from the server.
+     * @access public
+     * @return string
+     */
+    public function getLastReply()
+    {
+        return $this->last_reply;
+    }
+
+    /**
+     * Read the SMTP server's response.
+     * Either before eof or socket timeout occurs on the operation.
+     * With SMTP we can tell if we have more lines to read if the
+     * 4th character is '-' symbol. If it is a space then we don't
+     * need to read anything else.
+     * @access protected
+     * @return string
+     */
+    protected function get_lines()
+    {
+        // If the connection is bad, give up straight away
+        if (!is_resource($this->smtp_conn)) {
+            return '';
+        }
+        $data = '';
+        $endtime = 0;
+        stream_set_timeout($this->smtp_conn, $this->Timeout);
+        if ($this->Timelimit > 0) {
+            $endtime = time() + $this->Timelimit;
+        }
+        while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
+            $str = @fgets($this->smtp_conn, 515);
+            $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
+            $this->edebug("SMTP -> get_lines(): \$str is  \"$str\"", self::DEBUG_LOWLEVEL);
+            $data .= $str;
+            // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
+            if ((isset($str[3]) and $str[3] == ' ')) {
+                break;
+            }
+            // Timed-out? Log and break
+            $info = stream_get_meta_data($this->smtp_conn);
+            if ($info['timed_out']) {
+                $this->edebug(
+                    'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
+                    self::DEBUG_LOWLEVEL
+                );
+                break;
+            }
+            // Now check if reads took too long
+            if ($endtime and time() > $endtime) {
+                $this->edebug(
+                    'SMTP -> get_lines(): timelimit reached ('.
+                    $this->Timelimit . ' sec)',
+                    self::DEBUG_LOWLEVEL
+                );
+                break;
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * Enable or disable VERP address generation.
+     * @param boolean $enabled
+     */
+    public function setVerp($enabled = false)
+    {
+        $this->do_verp = $enabled;
+    }
+
+    /**
+     * Get VERP address generation mode.
+     * @return boolean
+     */
+    public function getVerp()
+    {
+        return $this->do_verp;
+    }
+
+    /**
+     * Set error messages and codes.
+     * @param string $message The error message
+     * @param string $detail Further detail on the error
+     * @param string $smtp_code An associated SMTP error code
+     * @param string $smtp_code_ex Extended SMTP code
+     */
+    protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
+    {
+        $this->error = array(
+            'error' => $message,
+            'detail' => $detail,
+            'smtp_code' => $smtp_code,
+            'smtp_code_ex' => $smtp_code_ex
+        );
+    }
+
+    /**
+     * Set debug output method.
+     * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
+     */
+    public function setDebugOutput($method = 'echo')
+    {
+        $this->Debugoutput = $method;
+    }
+
+    /**
+     * Get debug output method.
+     * @return string
+     */
+    public function getDebugOutput()
+    {
+        return $this->Debugoutput;
+    }
+
+    /**
+     * Set debug output level.
+     * @param integer $level
+     */
+    public function setDebugLevel($level = 0)
+    {
+        $this->do_debug = $level;
+    }
+
+    /**
+     * Get debug output level.
+     * @return integer
+     */
+    public function getDebugLevel()
+    {
+        return $this->do_debug;
+    }
+
+    /**
+     * Set SMTP timeout.
+     * @param integer $timeout
+     */
+    public function setTimeout($timeout = 0)
+    {
+        $this->Timeout = $timeout;
+    }
+
+    /**
+     * Get SMTP timeout.
+     * @return integer
+     */
+    public function getTimeout()
+    {
+        return $this->Timeout;
+    }
+}
diff --git a/www/plugins/facteur/phpmailer-php5/composer.json b/www/plugins/facteur/phpmailer-php5/composer.json
new file mode 100644 (file)
index 0000000..9521a12
--- /dev/null
@@ -0,0 +1,45 @@
+{
+    "name": "phpmailer/phpmailer",
+    "type": "library",
+    "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
+    "authors": [
+        {
+            "name": "Marcus Bointon",
+            "email": "phpmailer@synchromedia.co.uk"
+        },
+        {
+            "name": "Jim Jagielski",
+            "email": "jimjag@gmail.com"
+        },
+        {
+            "name": "Andy Prevost",
+            "email": "codeworxtech@users.sourceforge.net"
+        },
+        {
+            "name": "Brent R. Matzelle"
+        }
+    ],
+    "require": {
+        "php": ">=5.0.0"
+    },
+    "require-dev": {
+        "phpdocumentor/phpdocumentor": "*",
+        "phpunit/phpunit": "4.7.*"
+    },
+    "suggest": {
+        "league/oauth2-client": "Needed for XOAUTH2 authentication",
+        "league/oauth2-google": "Needed for Gmail XOAUTH2"
+    },
+    "autoload": {
+        "classmap": [
+            "class.phpmailer.php",
+            "class.phpmaileroauth.php",
+            "class.phpmaileroauthgoogle.php",
+            "class.smtp.php",
+            "class.pop3.php",
+            "extras/EasyPeasyICS.php",
+            "extras/ntlm_sasl_client.php"
+        ]
+    },
+    "license": "LGPL-2.1"
+}
diff --git a/www/plugins/facteur/phpmailer-php5/extras/EasyPeasyICS.php b/www/plugins/facteur/phpmailer-php5/extras/EasyPeasyICS.php
new file mode 100644 (file)
index 0000000..d8bfcfa
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/**
+ * EasyPeasyICS Simple ICS/vCal data generator.
+ * @author Marcus Bointon <phpmailer@synchromedia.co.uk>
+ * @author Manuel Reinhard <manu@sprain.ch>
+ *
+ * Built with inspiration from
+ * http://stackoverflow.com/questions/1463480/how-can-i-use-php-to-dynamically-publish-an-ical-file-to-be-read-by-google-calend/1464355#1464355
+ * History:
+ * 2010/12/17 - Manuel Reinhard - when it all started
+ * 2014 PHPMailer project becomes maintainer
+ */
+
+/**
+ * Class EasyPeasyICS.
+ * Simple ICS data generator
+ * @package phpmailer
+ * @subpackage easypeasyics
+ */
+class EasyPeasyICS
+{
+    /**
+     * The name of the calendar
+     * @var string
+     */
+    protected $calendarName;
+    /**
+     * The array of events to add to this calendar
+     * @var array
+     */
+    protected $events = array();
+
+    /**
+     * Constructor
+     * @param string $calendarName
+     */
+    public function __construct($calendarName = "")
+    {
+        $this->calendarName = $calendarName;
+    }
+
+    /**
+     * Add an event to this calendar.
+     * @param string $start The start date and time as a unix timestamp
+     * @param string $end The end date and time as a unix timestamp
+     * @param string $summary A summary or title for the event
+     * @param string $description A description of the event
+     * @param string $url A URL for the event
+     * @param string $uid A unique identifier for the event - generated automatically if not provided
+     * @return array An array of event details, including any generated UID
+     */
+    public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '')
+    {
+        if (empty($uid)) {
+            $uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS';
+        }
+        $event = array(
+            'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z',
+            'end' => gmdate('Ymd', $end) . 'T' . gmdate('His', $end) . 'Z',
+            'summary' => $summary,
+            'description' => $description,
+            'url' => $url,
+            'uid' => $uid
+        );
+        $this->events[] = $event;
+        return $event;
+    }
+
+    /**
+     * @return array Get the array of events.
+     */
+    public function getEvents()
+    {
+        return $this->events;
+    }
+
+    /**
+     * Clear all events.
+     */
+    public function clearEvents()
+    {
+        $this->events = array();
+    }
+
+    /**
+     * Get the name of the calendar.
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->calendarName;
+    }
+
+    /**
+     * Set the name of the calendar.
+     * @param $name
+     */
+    public function setName($name)
+    {
+        $this->calendarName = $name;
+    }
+
+    /**
+     * Render and optionally output a vcal string.
+     * @param bool $output Whether to output the calendar data directly (the default).
+     * @return string The complete rendered vlal
+     */
+    public function render($output = true)
+    {
+        //Add header
+        $ics = 'BEGIN:VCALENDAR
+METHOD:PUBLISH
+VERSION:2.0
+X-WR-CALNAME:' . $this->calendarName . '
+PRODID:-//hacksw/handcal//NONSGML v1.0//EN';
+
+        //Add events
+        foreach ($this->events as $event) {
+            $ics .= '
+BEGIN:VEVENT
+UID:' . $event['uid'] . '
+DTSTAMP:' . gmdate('Ymd') . 'T' . gmdate('His') . 'Z
+DTSTART:' . $event['start'] . '
+DTEND:' . $event['end'] . '
+SUMMARY:' . str_replace("\n", "\\n", $event['summary']) . '
+DESCRIPTION:' . str_replace("\n", "\\n", $event['description']) . '
+URL;VALUE=URI:' . $event['url'] . '
+END:VEVENT';
+        }
+
+        //Add footer
+        $ics .= '
+END:VCALENDAR';
+
+        if ($output) {
+            //Output
+            $filename = $this->calendarName;
+            //Filename needs quoting if it contains spaces
+            if (strpos($filename, ' ') !== false) {
+                $filename = '"'.$filename.'"';
+            }
+            header('Content-type: text/calendar; charset=utf-8');
+            header('Content-Disposition: inline; filename=' . $filename . '.ics');
+            echo $ics;
+        }
+        return $ics;
+    }
+}
diff --git a/www/plugins/facteur/phpmailer-php5/extras/README.md b/www/plugins/facteur/phpmailer-php5/extras/README.md
new file mode 100644 (file)
index 0000000..dac79e0
--- /dev/null
@@ -0,0 +1,17 @@
+#PHPMailer Extras
+
+These classes provide optional additional functions to PHPMailer.
+
+These are not loaded by the PHPMailer autoloader, so in some cases you may need to `require` them yourself before using them.
+
+##EasyPeasyICS
+
+This class was originally written by Manuel Reinhard and provides a simple means of generating ICS/vCal files that are used in sending calendar events. PHPMailer does not use it directly, but you can use it to generate content appropriate for placing in the `Ical` property of PHPMailer. The PHPMailer project is now its official home as Manuel has given permission for that and is no longer maintaining it himself.
+
+##htmlfilter
+
+This class by Konstantin Riabitsev and Jim Jagielski implements HTML filtering to remove potentially malicious tags, such as `<script>` or `onclick=` attributes that can result in XSS attacks. This is a simple filter and is not as comprehensive as [HTMLawed](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) or [HTMLPurifier](http://htmlpurifier.org), but it's easier to use and considerably better than nothing! PHPMailer does not use it directly, but you may want to apply it to user-supplied HTML before using it as a message body.
+
+##NTLM_SASL_client
+
+This class by Manuel Lemos (bundled with permission) adds the ability to authenticate with Microsoft Windows mail servers that use NTLM-based authentication. It is used by PHPMailer if you send via SMTP and set the `AuthType` property to `NTLM`; you will also need to use the `Realm` and `Workstation` properties. The original source is [here](http://www.phpclasses.org/browse/file/7495.html).
diff --git a/www/plugins/facteur/phpmailer-php5/extras/htmlfilter.php b/www/plugins/facteur/phpmailer-php5/extras/htmlfilter.php
new file mode 100644 (file)
index 0000000..5ac7d13
--- /dev/null
@@ -0,0 +1,1166 @@
+<?php
+/**
+ * htmlfilter.inc
+ * ---------------
+ * This set of functions allows you to filter html in order to remove
+ * any malicious tags from it. Useful in cases when you need to filter
+ * user input for any cross-site-scripting attempts.
+ *
+ * Copyright (C) 2002-2004 by Duke University
+ *
+ * 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 St, Fifth Floor, Boston, MA
+ * 02110-1301  USA
+ *
+ * @Author     Konstantin Riabitsev <icon@linux.duke.edu>
+ * @Author  Jim Jagielski <jim@jaguNET.com / jimjag@gmail.com>
+ * @Version 1.1 ($Date$)
+ */
+
+/**
+ * This function returns the final tag out of the tag name, an array
+ * of attributes, and the type of the tag. This function is called by
+ * tln_sanitize internally.
+ *
+ * @param string $tagname the name of the tag.
+ * @param array $attary the array of attributes and their values
+ * @param integer $tagtype The type of the tag (see in comments).
+ * @return string A string with the final tag representation.
+ */
+function tln_tagprint($tagname, $attary, $tagtype)
+{
+    if ($tagtype == 2) {
+        $fulltag = '</' . $tagname . '>';
+    } else {
+        $fulltag = '<' . $tagname;
+        if (is_array($attary) && sizeof($attary)) {
+            $atts = array();
+            while (list($attname, $attvalue) = each($attary)) {
+                array_push($atts, "$attname=$attvalue");
+            }
+            $fulltag .= ' ' . join(' ', $atts);
+        }
+        if ($tagtype == 3) {
+            $fulltag .= ' /';
+        }
+        $fulltag .= '>';
+    }
+    return $fulltag;
+}
+
+/**
+ * A small helper function to use with array_walk. Modifies a by-ref
+ * value and makes it lowercase.
+ *
+ * @param string $val a value passed by-ref.
+ * @return             void since it modifies a by-ref value.
+ */
+function tln_casenormalize(&$val)
+{
+    $val = strtolower($val);
+}
+
+/**
+ * This function skips any whitespace from the current position within
+ * a string and to the next non-whitespace value.
+ *
+ * @param string $body the string
+ * @param integer $offset the offset within the string where we should start
+ *                                looking for the next non-whitespace character.
+ * @return integer          the location within the $body where the next
+ *                                non-whitespace char is located.
+ */
+function tln_skipspace($body, $offset)
+{
+    preg_match('/^(\s*)/s', substr($body, $offset), $matches);
+    if (sizeof($matches[1])) {
+        $count = strlen($matches[1]);
+        $offset += $count;
+    }
+    return $offset;
+}
+
+/**
+ * This function looks for the next character within a string. It's
+ * really just a glorified "strpos", except it catches the failures
+ * nicely.
+ *
+ * @param string $body   The string to look for needle in.
+ * @param integer $offset Start looking from this position.
+ * @param string $needle The character/string to look for.
+ * @return integer           location of the next occurrence of the needle, or
+ *                                strlen($body) if needle wasn't found.
+ */
+function tln_findnxstr($body, $offset, $needle)
+{
+    $pos = strpos($body, $needle, $offset);
+    if ($pos === false) {
+        $pos = strlen($body);
+    }
+    return $pos;
+}
+
+/**
+ * This function takes a PCRE-style regexp and tries to match it
+ * within the string.
+ *
+ * @param string $body   The string to look for needle in.
+ * @param integer $offset Start looking from here.
+ * @param string $reg       A PCRE-style regex to match.
+ * @return array|boolean  Returns a false if no matches found, or an array
+ *                                with the following members:
+ *                                - integer with the location of the match within $body
+ *                                - string with whatever content between offset and the match
+ *                                - string with whatever it is we matched
+ */
+function tln_findnxreg($body, $offset, $reg)
+{
+    $matches = array();
+    $retarr = array();
+    $preg_rule = '%^(.*?)(' . $reg . ')%s';
+    preg_match($preg_rule, substr($body, $offset), $matches);
+    if (!isset($matches[0]) || !$matches[0]) {
+        $retarr = false;
+    } else {
+        $retarr[0] = $offset + strlen($matches[1]);
+        $retarr[1] = $matches[1];
+        $retarr[2] = $matches[2];
+    }
+    return $retarr;
+}
+
+/**
+ * This function looks for the next tag.
+ *
+ * @param string $body   String where to look for the next tag.
+ * @param integer $offset Start looking from here.
+ * @return array|boolean false if no more tags exist in the body, or
+ *                                an array with the following members:
+ *                                - string with the name of the tag
+ *                                - array with attributes and their values
+ *                                - integer with tag type (1, 2, or 3)
+ *                                - integer where the tag starts (starting "<")
+ *                                - integer where the tag ends (ending ">")
+ *                                first three members will be false, if the tag is invalid.
+ */
+function tln_getnxtag($body, $offset)
+{
+    if ($offset > strlen($body)) {
+        return false;
+    }
+    $lt = tln_findnxstr($body, $offset, '<');
+    if ($lt == strlen($body)) {
+        return false;
+    }
+    /**
+     * We are here:
+     * blah blah <tag attribute="value">
+     * \---------^
+     */
+    $pos = tln_skipspace($body, $lt + 1);
+    if ($pos >= strlen($body)) {
+        return array(false, false, false, $lt, strlen($body));
+    }
+    /**
+     * There are 3 kinds of tags:
+     * 1. Opening tag, e.g.:
+     *   <a href="blah">
+     * 2. Closing tag, e.g.:
+     *   </a>
+     * 3. XHTML-style content-less tag, e.g.:
+     *   <img src="blah"/>
+     */
+    switch (substr($body, $pos, 1)) {
+    case '/':
+        $tagtype = 2;
+        $pos++;
+        break;
+    case '!':
+        /**
+         * A comment or an SGML declaration.
+         */
+            if (substr($body, $pos + 1, 2) == '--') {
+            $gt = strpos($body, '-->', $pos);
+            if ($gt === false) {
+                $gt = strlen($body);
+            } else {
+                $gt += 2;
+            }
+            return array(false, false, false, $lt, $gt);
+        } else {
+            $gt = tln_findnxstr($body, $pos, '>');
+            return array(false, false, false, $lt, $gt);
+        }
+        break;
+    default:
+        /**
+         * Assume tagtype 1 for now. If it's type 3, we'll switch values
+         * later.
+         */
+        $tagtype = 1;
+        break;
+    }
+
+    /**
+     * Look for next [\W-_], which will indicate the end of the tag name.
+     */
+    $regary = tln_findnxreg($body, $pos, '[^\w\-_]');
+    if ($regary == false) {
+        return array(false, false, false, $lt, strlen($body));
+    }
+    list($pos, $tagname, $match) = $regary;
+    $tagname = strtolower($tagname);
+
+    /**
+     * $match can be either of these:
+     * '>'     indicating the end of the tag entirely.
+     * '\s' indicating the end of the tag name.
+     * '/'     indicating that this is type-3 xhtml tag.
+     *
+     * Whatever else we find there indicates an invalid tag.
+     */
+    switch ($match) {
+    case '/':
+        /**
+         * This is an xhtml-style tag with a closing / at the
+         * end, like so: <img src="blah"/>. Check if it's followed
+         * by the closing bracket. If not, then this tag is invalid
+         */
+        if (substr($body, $pos, 2) == '/>') {
+            $pos++;
+            $tagtype = 3;
+        } else {
+            $gt = tln_findnxstr($body, $pos, '>');
+            $retary = array(false, false, false, $lt, $gt);
+            return $retary;
+        }
+            //intentional fall-through
+    case '>':
+        return array($tagname, false, $tagtype, $lt, $pos);
+        break;
+    default:
+        /**
+         * Check if it's whitespace
+         */
+        if (!preg_match('/\s/', $match)) {
+            /**
+             * This is an invalid tag! Look for the next closing ">".
+             */
+            $gt = tln_findnxstr($body, $lt, '>');
+            return array(false, false, false, $lt, $gt);
+        }
+        break;
+    }
+
+    /**
+     * At this point we're here:
+     * <tagname         attribute='blah'>
+     * \-------^
+     *
+     * At this point we loop in order to find all attributes.
+     */
+    $attary = array();
+
+    while ($pos <= strlen($body)) {
+        $pos = tln_skipspace($body, $pos);
+        if ($pos == strlen($body)) {
+            /**
+             * Non-closed tag.
+             */
+            return array(false, false, false, $lt, $pos);
+        }
+        /**
+         * See if we arrived at a ">" or "/>", which means that we reached
+         * the end of the tag.
+         */
+        $matches = array();
+        if (preg_match('%^(\s*)(>|/>)%s', substr($body, $pos), $matches)) {
+            /**
+             * Yep. So we did.
+             */
+            $pos += strlen($matches[1]);
+            if ($matches[2] == '/>') {
+                $tagtype = 3;
+                $pos++;
+            }
+            return array($tagname, $attary, $tagtype, $lt, $pos);
+        }
+
+        /**
+         * There are several types of attributes, with optional
+         * [:space:] between members.
+         * Type 1:
+         *      attrname[:space:]=[:space:]'CDATA'
+         * Type 2:
+         *      attrname[:space:]=[:space:]"CDATA"
+         * Type 3:
+         *      attr[:space:]=[:space:]CDATA
+         * Type 4:
+         *      attrname
+         *
+         * We leave types 1 and 2 the same, type 3 we check for
+         * '"' and convert to "&quot" if needed, then wrap in
+         * double quotes. Type 4 we convert into:
+         * attrname="yes".
+         */
+        $regary = tln_findnxreg($body, $pos, '[^\w\-_]');
+        if ($regary == false) {
+            /**
+             * Looks like body ended before the end of tag.
+             */
+            return array(false, false, false, $lt, strlen($body));
+        }
+        list($pos, $attname, $match) = $regary;
+        $attname = strtolower($attname);
+        /**
+         * We arrived at the end of attribute name. Several things possible
+         * here:
+         * '>' means the end of the tag and this is attribute type 4
+         * '/' if followed by '>' means the same thing as above
+         * '\s' means a lot of things -- look what it's followed by.
+         *             anything else means the attribute is invalid.
+         */
+        switch ($match) {
+        case '/':
+            /**
+             * This is an xhtml-style tag with a closing / at the
+             * end, like so: <img src="blah"/>. Check if it's followed
+             * by the closing bracket. If not, then this tag is invalid
+             */
+            if (substr($body, $pos, 2) == '/>') {
+                $pos++;
+                $tagtype = 3;
+            } else {
+                $gt = tln_findnxstr($body, $pos, '>');
+                $retary = array(false, false, false, $lt, $gt);
+                return $retary;
+            }
+                //intentional fall-through
+        case '>':
+            $attary{$attname} = '"yes"';
+            return array($tagname, $attary, $tagtype, $lt, $pos);
+            break;
+        default:
+            /**
+             * Skip whitespace and see what we arrive at.
+             */
+            $pos = tln_skipspace($body, $pos);
+            $char = substr($body, $pos, 1);
+            /**
+             * Two things are valid here:
+             * '=' means this is attribute type 1 2 or 3.
+             * \w means this was attribute type 4.
+             * anything else we ignore and re-loop. End of tag and
+             * invalid stuff will be caught by our checks at the beginning
+             * of the loop.
+             */
+            if ($char == '=') {
+                $pos++;
+                $pos = tln_skipspace($body, $pos);
+                /**
+                 * Here are 3 possibilities:
+                 * "'" attribute type 1
+                 * '"' attribute type 2
+                 * everything else is the content of tag type 3
+                 */
+                $quot = substr($body, $pos, 1);
+                if ($quot == '\'') {
+                        $regary = tln_findnxreg($body, $pos + 1, '\'');
+                    if ($regary == false) {
+                        return array(false, false, false, $lt, strlen($body));
+                    }
+                    list($pos, $attval, $match) = $regary;
+                    $pos++;
+                    $attary{$attname} = '\'' . $attval . '\'';
+                } elseif ($quot == '"') {
+                    $regary = tln_findnxreg($body, $pos + 1, '\"');
+                    if ($regary == false) {
+                        return array(false, false, false, $lt, strlen($body));
+                    }
+                    list($pos, $attval, $match) = $regary;
+                    $pos++;
+                            $attary{$attname} = '"' . $attval . '"';
+                } else {
+                    /**
+                     * These are hateful. Look for \s, or >.
+                     */
+                    $regary = tln_findnxreg($body, $pos, '[\s>]');
+                    if ($regary == false) {
+                        return array(false, false, false, $lt, strlen($body));
+                    }
+                    list($pos, $attval, $match) = $regary;
+                    /**
+                     * If it's ">" it will be caught at the top.
+                     */
+                    $attval = preg_replace('/\"/s', '&quot;', $attval);
+                    $attary{$attname} = '"' . $attval . '"';
+                }
+            } elseif (preg_match('|[\w/>]|', $char)) {
+                /**
+                 * That was attribute type 4.
+                 */
+                $attary{$attname} = '"yes"';
+            } else {
+                /**
+                 * An illegal character. Find next '>' and return.
+                 */
+                $gt = tln_findnxstr($body, $pos, '>');
+                return array(false, false, false, $lt, $gt);
+            }
+            break;
+        }
+    }
+    /**
+     * The fact that we got here indicates that the tag end was never
+     * found. Return invalid tag indication so it gets stripped.
+     */
+    return array(false, false, false, $lt, strlen($body));
+}
+
+/**
+ * Translates entities into literal values so they can be checked.
+ *
+ * @param string $attvalue the by-ref value to check.
+ * @param string $regex    the regular expression to check against.
+ * @param boolean $hex        whether the entites are hexadecimal.
+ * @return boolean            True or False depending on whether there were matches.
+ */
+function tln_deent(&$attvalue, $regex, $hex = false)
+{
+    preg_match_all($regex, $attvalue, $matches);
+    if (is_array($matches) && sizeof($matches[0]) > 0) {
+        $repl = array();
+        for ($i = 0; $i < sizeof($matches[0]); $i++) {
+            $numval = $matches[1][$i];
+            if ($hex) {
+                $numval = hexdec($numval);
+            }
+            $repl{$matches[0][$i]} = chr($numval);
+        }
+        $attvalue = strtr($attvalue, $repl);
+        return true;
+    } else {
+        return false;
+    }
+}
+
+/**
+ * This function checks attribute values for entity-encoded values
+ * and returns them translated into 8-bit strings so we can run
+ * checks on them.
+ *
+ * @param string $attvalue A string to run entity check against.
+ * @return             Void, modifies a reference value.
+ */
+function tln_defang(&$attvalue)
+{
+    /**
+     * Skip this if there aren't ampersands or backslashes.
+     */
+    if (strpos($attvalue, '&') === false
+        && strpos($attvalue, '\\') === false
+    ) {
+        return;
+    }
+    do {
+        $m = false;
+        $m = $m || tln_deent($attvalue, '/\&#0*(\d+);*/s');
+        $m = $m || tln_deent($attvalue, '/\&#x0*((\d|[a-f])+);*/si', true);
+        $m = $m || tln_deent($attvalue, '/\\\\(\d+)/s', true);
+    } while ($m == true);
+    $attvalue = stripslashes($attvalue);
+}
+
+/**
+ * Kill any tabs, newlines, or carriage returns. Our friends the
+ * makers of the browser with 95% market value decided that it'd
+ * be funny to make "java[tab]script" be just as good as "javascript".
+ *
+ * @param string $attvalue     The attribute value before extraneous spaces removed.
+ * @return     Void, modifies a reference value.
+ */
+function tln_unspace(&$attvalue)
+{
+    if (strcspn($attvalue, "\t\r\n\0 ") != strlen($attvalue)) {
+        $attvalue = str_replace(
+            array("\t", "\r", "\n", "\0", " "),
+            array('', '', '', '', ''),
+            $attvalue
+        );
+    }
+}
+
+/**
+ * This function runs various checks against the attributes.
+ *
+ * @param string $tagname            String with the name of the tag.
+ * @param array $attary            Array with all tag attributes.
+ * @param array $rm_attnames        See description for tln_sanitize
+ * @param array $bad_attvals        See description for tln_sanitize
+ * @param array $add_attr_to_tag See description for tln_sanitize
+ * @param string $trans_image_path
+ * @param boolean $block_external_images
+ * @return                                     Array with modified attributes.
+ */
+function tln_fixatts(
+    $tagname,
+    $attary,
+    $rm_attnames,
+    $bad_attvals,
+    $add_attr_to_tag,
+    $trans_image_path,
+    $block_external_images
+) {
+    while (list($attname, $attvalue) = each($attary)) {
+        /**
+         * See if this attribute should be removed.
+         */
+        foreach ($rm_attnames as $matchtag => $matchattrs) {
+            if (preg_match($matchtag, $tagname)) {
+                foreach ($matchattrs as $matchattr) {
+                    if (preg_match($matchattr, $attname)) {
+                        unset($attary{$attname});
+                        continue;
+                    }
+                }
+            }
+        }
+        /**
+         * Remove any backslashes, entities, or extraneous whitespace.
+         */
+        $oldattvalue = $attvalue;
+        tln_defang($attvalue);
+        if ($attname == 'style' && $attvalue !== $oldattvalue) {
+            $attvalue = "idiocy";
+            $attary{$attname} = $attvalue;
+        }
+        tln_unspace($attvalue);
+
+        /**
+         * Now let's run checks on the attvalues.
+         * I don't expect anyone to comprehend this. If you do,
+         * get in touch with me so I can drive to where you live and
+         * shake your hand personally. :)
+         */
+        foreach ($bad_attvals as $matchtag => $matchattrs) {
+            if (preg_match($matchtag, $tagname)) {
+                foreach ($matchattrs as $matchattr => $valary) {
+                    if (preg_match($matchattr, $attname)) {
+                        /**
+                         * There are two arrays in valary.
+                         * First is matches.
+                         * Second one is replacements
+                         */
+                        list($valmatch, $valrepl) = $valary;
+                        $newvalue = preg_replace($valmatch, $valrepl, $attvalue);
+                        if ($newvalue != $attvalue) {
+                            $attary{$attname} = $newvalue;
+                            $attvalue = $newvalue;
+                        }
+                    }
+                }
+            }
+        }
+        if ($attname == 'style') {
+            if (preg_match('/[\0-\37\200-\377]+/', $attvalue)) {
+                $attary{$attname} = '"disallowed character"';
+            }
+            preg_match_all("/url\s*\((.+)\)/si", $attvalue, $aMatch);
+            if (count($aMatch)) {
+                foreach($aMatch[1] as $sMatch) {
+                    $urlvalue = $sMatch;
+                    tln_fixurl($attname, $urlvalue, $trans_image_path, $block_external_images);
+                    $attary{$attname} = str_replace($sMatch, $urlvalue, $attvalue);
+                }
+            }
+        }
+     }
+    /**
+     * See if we need to append any attributes to this tag.
+     */
+    foreach ($add_attr_to_tag as $matchtag => $addattary) {
+        if (preg_match($matchtag, $tagname)) {
+            $attary = array_merge($attary, $addattary);
+        }
+    }
+    return $attary;
+}
+
+function tln_fixurl($attname, &$attvalue, $trans_image_path, $block_external_images)
+{
+    $sQuote = '"';
+    $attvalue = trim($attvalue);
+    if ($attvalue && ($attvalue[0] =='"'|| $attvalue[0] == "'")) {
+        // remove the double quotes
+        $sQuote = $attvalue[0];
+        $attvalue = trim(substr($attvalue,1,-1));
+    }
+
+    /**
+     * Replace empty src tags with the blank image.  src is only used
+     * for frames, images, and image inputs.  Doing a replace should
+     * not affect them working as should be, however it will stop
+     * IE from being kicked off when src for img tags are not set
+     */
+    if ($attvalue == '') {
+        $attvalue = $sQuote . $trans_image_path . $sQuote;
+    } else {
+        // first, disallow 8 bit characters and control characters
+        if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) {
+            switch ($attname) {
+                case 'href':
+                    $attvalue = $sQuote . 'http://invalid-stuff-detected.example.com' . $sQuote;
+                    break;
+                default:
+                    $attvalue = $sQuote . $trans_image_path . $sQuote;
+                    break;
+            }
+        } else {
+            $aUrl = parse_url($attvalue);
+            if (isset($aUrl['scheme'])) {
+                switch(strtolower($aUrl['scheme'])) {
+                    case 'mailto':
+                    case 'http':
+                    case 'https':
+                    case 'ftp':
+                        if ($attname != 'href') {
+                            if ($block_external_images == true) {
+                                $attvalue = $sQuote . $trans_image_path . $sQuote;
+                            } else {
+                                if (!isset($aUrl['path'])) {
+                                    $attvalue = $sQuote . $trans_image_path . $sQuote;
+                                }
+                            }
+                        } else {
+                            $attvalue = $sQuote . $attvalue . $sQuote;
+                        }
+                        break;
+                    case 'outbind':
+                        $attvalue = $sQuote . $attvalue . $sQuote;
+                        break;
+                    case 'cid':
+                        $attvalue = $sQuote . $attvalue . $sQuote;
+                        break;
+                    default:
+                        $attvalue = $sQuote . $trans_image_path . $sQuote;
+                        break;
+                }
+            } else {
+                if (!isset($aUrl['path']) || $aUrl['path'] != $trans_image_path) {
+                    $$attvalue = $sQuote . $trans_image_path . $sQuote;
+                }
+            }
+        }
+    }
+}
+
+function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
+{
+    $me = 'tln_fixstyle';
+    // workaround for </style> in between comments
+    $iCurrentPos = $pos;
+    $content = '';
+    $sToken = '';
+    $bSucces = false;
+    $bEndTag = false;
+    for ($i=$pos,$iCount=strlen($body);$i<$iCount;++$i) {
+        $char = $body{$i};
+        switch ($char) {
+            case '<':
+                $sToken = $char;
+                break;
+            case '/':
+                 if ($sToken == '<') {
+                    $sToken .= $char;
+                    $bEndTag = true;
+                 } else {
+                    $content .= $char;
+                 }
+                 break;
+            case '>':
+                 if ($bEndTag) {
+                    $sToken .= $char;
+                    if (preg_match('/\<\/\s*style\s*\>/i',$sToken,$aMatch)) {
+                        $newpos = $i + 1;
+                        $bSucces = true;
+                        break 2;
+                    } else {
+                        $content .= $sToken;
+                    }
+                    $bEndTag = false;
+                 } else {
+                    $content .= $char;
+                 }
+                 break;
+            case '!':
+                if ($sToken == '<') {
+                    // possible comment
+                    if (isset($body{$i+2}) && substr($body,$i,3) == '!--') {
+                        $i = strpos($body,'-->',$i+3);
+                        if ($i === false) { // no end comment
+                            $i = strlen($body);
+                        }
+                        $sToken = '';
+                    }
+                } else {
+                    $content .= $char;
+                }
+                break;
+            default:
+                if ($bEndTag) {
+                    $sToken .= $char;
+                } else {
+                    $content .= $char;
+                }
+                break;
+        }
+    }
+    if ($bSucces == FALSE){
+        return array(FALSE, strlen($body));
+    }
+
+
+
+    /**
+     * First look for general BODY style declaration, which would be
+     * like so:
+     * body {background: blah-blah}
+     * and change it to .bodyclass so we can just assign it to a <div>
+     */
+    $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content);
+
+    $trans_image_path = $trans_image_path;
+
+    /**
+    * Fix url('blah') declarations.
+    */
+    //   $content = preg_replace("|url\s*\(\s*([\'\"])\s*\S+script\s*:.*?([\'\"])\s*\)|si",
+    //                           "url(\\1$trans_image_path\\2)", $content);
+
+    // first check for 8bit sequences and disallowed control characters
+    if (preg_match('/[\16-\37\200-\377]+/',$content)) {
+        $content = '<!-- style block removed by html filter due to presence of 8bit characters -->';
+        return array($content, $newpos);
+    }
+
+    // remove @import line
+    $content = preg_replace("/^\s*(@import.*)$/mi","\n<!-- @import rules forbidden -->\n",$content);
+
+    $content = preg_replace("/(\\\\)?u(\\\\)?r(\\\\)?l(\\\\)?/i", 'url', $content);
+    preg_match_all("/url\s*\((.+)\)/si",$content,$aMatch);
+    if (count($aMatch)) {
+        $aValue = $aReplace = array();
+        foreach($aMatch[1] as $sMatch) {
+            // url value
+            $urlvalue = $sMatch;
+            tln_fixurl('style',$urlvalue, $trans_image_path, $block_external_images);
+            $aValue[] = $sMatch;
+            $aReplace[] = $urlvalue;
+        }
+        $content = str_replace($aValue,$aReplace,$content);
+    }
+
+    /**
+     * Remove any backslashes, entities, and extraneous whitespace.
+     */
+    $contentTemp = $content;
+    tln_defang($contentTemp);
+    tln_unspace($contentTemp);
+
+    $match   = Array('/\/\*.*\*\//',
+                    '/expression/i',
+                    '/behaviou*r/i',
+                    '/binding/i',
+                    '/include-source/i',
+                    '/javascript/i',
+                    '/script/i',
+                    '/position/i');
+    $replace = Array('','idiocy', 'idiocy', 'idiocy', 'idiocy', 'idiocy', 'idiocy', '');
+    $contentNew = preg_replace($match, $replace, $contentTemp);
+    if ($contentNew !== $contentTemp) {
+        $content = $contentNew;
+    }
+    return array($content, $newpos);
+}
+
+function tln_body2div($attary, $trans_image_path)
+{
+    $me = 'tln_body2div';
+    $divattary = array('class' => "'bodyclass'");
+    $text = '#000000';
+    $has_bgc_stl = $has_txt_stl = false;
+    $styledef = '';
+    if (is_array($attary) && sizeof($attary) > 0){
+        foreach ($attary as $attname=>$attvalue){
+            $quotchar = substr($attvalue, 0, 1);
+            $attvalue = str_replace($quotchar, "", $attvalue);
+            switch ($attname){
+                case 'background':
+                    $styledef .= "background-image: url('$trans_image_path'); ";
+                    break;
+                case 'bgcolor':
+                    $has_bgc_stl = true;
+                    $styledef .= "background-color: $attvalue; ";
+                    break;
+                case 'text':
+                    $has_txt_stl = true;
+                    $styledef .= "color: $attvalue; ";
+                    break;
+            }
+        }
+        // Outlook defines a white bgcolor and no text color. This can lead to
+        // white text on a white bg with certain themes.
+        if ($has_bgc_stl && !$has_txt_stl) {
+            $styledef .= "color: $text; ";
+        }
+        if (strlen($styledef) > 0){
+            $divattary{"style"} = "\"$styledef\"";
+        }
+    }
+    return $divattary;
+}
+
+/**
+ *
+ * @param string $body                    The HTML you wish to filter
+ * @param array $tag_list                see description above
+ * @param array $rm_tags_with_content see description above
+ * @param array $self_closing_tags    see description above
+ * @param boolean $force_tag_closing    see description above
+ * @param array $rm_attnames            see description above
+ * @param array $bad_attvals            see description above
+ * @param array $add_attr_to_tag        see description above
+ * @param string $trans_image_path
+ * @param boolean $block_external_images
+
+ * @return string                       Sanitized html safe to show on your pages.
+ */
+function tln_sanitize(
+    $body,
+    $tag_list,
+    $rm_tags_with_content,
+    $self_closing_tags,
+    $force_tag_closing,
+    $rm_attnames,
+    $bad_attvals,
+    $add_attr_to_tag,
+    $trans_image_path,
+    $block_external_images
+) {
+    /**
+     * Normalize rm_tags and rm_tags_with_content.
+     */
+    $rm_tags = array_shift($tag_list);
+    @array_walk($tag_list, 'tln_casenormalize');
+    @array_walk($rm_tags_with_content, 'tln_casenormalize');
+    @array_walk($self_closing_tags, 'tln_casenormalize');
+    /**
+     * See if tag_list is of tags to remove or tags to allow.
+     * false  means remove these tags
+     * true      means allow these tags
+     */
+    $curpos = 0;
+    $open_tags = array();
+    $trusted = "<!-- begin tln_sanitized html -->\n";
+    $skip_content = false;
+    /**
+     * Take care of netscape's stupid javascript entities like
+     * &{alert('boo')};
+     */
+    $body = preg_replace('/&(\{.*?\};)/si', '&amp;\\1', $body);
+    while (($curtag = tln_getnxtag($body, $curpos)) != false) {
+        list($tagname, $attary, $tagtype, $lt, $gt) = $curtag;
+        $free_content = substr($body, $curpos, $lt-$curpos);
+        /**
+         * Take care of <style>
+         */
+        if ($tagname == "style" && $tagtype == 1){
+            list($free_content, $curpos) =
+                tln_fixstyle($body, $gt+1, $trans_image_path, $block_external_images);
+            if ($free_content != FALSE){
+                if ( !empty($attary) ) {
+                    $attary = tln_fixatts($tagname,
+                                         $attary,
+                                         $rm_attnames,
+                                         $bad_attvals,
+                                         $add_attr_to_tag,
+                                         $trans_image_path,
+                                         $block_external_images
+                                         );
+                }
+                $trusted .= tln_tagprint($tagname, $attary, $tagtype);
+                $trusted .= $free_content;
+                $trusted .= tln_tagprint($tagname, false, 2);
+            }
+            continue;
+        }
+        if ($skip_content == false){
+            $trusted .= $free_content;
+        }
+        if ($tagname != false) {
+            if ($tagtype == 2) {
+                if ($skip_content == $tagname) {
+                    /**
+                     * Got to the end of tag we needed to remove.
+                     */
+                    $tagname = false;
+                    $skip_content = false;
+                } else {
+                    if ($skip_content == false) {
+                        if ($tagname == "body") {
+                            $tagname = "div";
+                        }
+                        if (isset($open_tags{$tagname}) &&
+                            $open_tags{$tagname} > 0
+                        ) {
+                            $open_tags{$tagname}--;
+                        } else {
+                            $tagname = false;
+                        }
+                    }
+                }
+            } else {
+                /**
+                 * $rm_tags_with_content
+                 */
+                if ($skip_content == false) {
+                    /**
+                     * See if this is a self-closing type and change
+                     * tagtype appropriately.
+                     */
+                    if ($tagtype == 1
+                        && in_array($tagname, $self_closing_tags)
+                    ) {
+                        $tagtype = 3;
+                    }
+                    /**
+                     * See if we should skip this tag and any content
+                     * inside it.
+                     */
+                    if ($tagtype == 1
+                        && in_array($tagname, $rm_tags_with_content)
+                    ) {
+                        $skip_content = $tagname;
+                    } else {
+                        if (($rm_tags == false
+                             && in_array($tagname, $tag_list)) ||
+                            ($rm_tags == true
+                                && !in_array($tagname, $tag_list))
+                        ) {
+                            $tagname = false;
+                        } else {
+                            /**
+                             * Convert body into div.
+                             */
+                            if ($tagname == "body"){
+                                $tagname = "div";
+                                $attary = tln_body2div($attary, $trans_image_path);
+                            }
+                            if ($tagtype == 1) {
+                                if (isset($open_tags{$tagname})) {
+                                    $open_tags{$tagname}++;
+                                } else {
+                                    $open_tags{$tagname} = 1;
+                                }
+                            }
+                            /**
+                             * This is where we run other checks.
+                             */
+                            if (is_array($attary) && sizeof($attary) > 0) {
+                                $attary = tln_fixatts(
+                                    $tagname,
+                                    $attary,
+                                    $rm_attnames,
+                                    $bad_attvals,
+                                    $add_attr_to_tag,
+                                    $trans_image_path,
+                                    $block_external_images
+                                );
+                            }
+                        }
+                    }
+                }
+            }
+            if ($tagname != false && $skip_content == false) {
+                $trusted .= tln_tagprint($tagname, $attary, $tagtype);
+            }
+        }
+        $curpos = $gt + 1;
+    }
+    $trusted .= substr($body, $curpos, strlen($body) - $curpos);
+    if ($force_tag_closing == true) {
+        foreach ($open_tags as $tagname => $opentimes) {
+            while ($opentimes > 0) {
+                $trusted .= '</' . $tagname . '>';
+                $opentimes--;
+            }
+        }
+        $trusted .= "\n";
+    }
+    $trusted .= "<!-- end tln_sanitized html -->\n";
+    return $trusted;
+}
+
+//
+// Use the nifty htmlfilter library
+//
+
+
+function HTMLFilter($body, $trans_image_path, $block_external_images = false)
+{
+
+    $tag_list = array(
+        false,
+        "object",
+        "meta",
+        "html",
+        "head",
+        "base",
+        "link",
+        "frame",
+        "iframe",
+        "plaintext",
+        "marquee"
+    );
+
+    $rm_tags_with_content = array(
+        "script",
+        "applet",
+        "embed",
+        "title",
+        "frameset",
+        "xmp",
+        "xml"
+    );
+
+    $self_closing_tags =  array(
+        "img",
+        "br",
+        "hr",
+        "input",
+        "outbind"
+    );
+
+    $force_tag_closing = true;
+
+    $rm_attnames = array(
+        "/.*/" =>
+            array(
+                // "/target/i",
+                "/^on.*/i",
+                "/^dynsrc/i",
+                "/^data.*/i",
+                "/^lowsrc.*/i"
+            )
+    );
+
+    $bad_attvals = array(
+        "/.*/" =>
+        array(
+            "/^src|background/i" =>
+            array(
+                array(
+                    '/^([\'"])\s*\S+script\s*:.*([\'"])/si',
+                    '/^([\'"])\s*mocha\s*:*.*([\'"])/si',
+                    '/^([\'"])\s*about\s*:.*([\'"])/si'
+                ),
+                array(
+                    "\\1$trans_image_path\\2",
+                    "\\1$trans_image_path\\2",
+                    "\\1$trans_image_path\\2"
+                )
+            ),
+            "/^href|action/i" =>
+            array(
+                array(
+                    '/^([\'"])\s*\S+script\s*:.*([\'"])/si',
+                    '/^([\'"])\s*mocha\s*:*.*([\'"])/si',
+                    '/^([\'"])\s*about\s*:.*([\'"])/si'
+                ),
+                array(
+                    "\\1#\\1",
+                    "\\1#\\1",
+                    "\\1#\\1"
+                )
+            ),
+            "/^style/i" =>
+            array(
+                array(
+                    "/\/\*.*\*\//",
+                    "/expression/i",
+                    "/binding/i",
+                    "/behaviou*r/i",
+                    "/include-source/i",
+                    '/position\s*:/i',
+                    '/(\\\\)?u(\\\\)?r(\\\\)?l(\\\\)?/i',
+                    '/url\s*\(\s*([\'"])\s*\S+script\s*:.*([\'"])\s*\)/si',
+                    '/url\s*\(\s*([\'"])\s*mocha\s*:.*([\'"])\s*\)/si',
+                    '/url\s*\(\s*([\'"])\s*about\s*:.*([\'"])\s*\)/si',
+                    '/(.*)\s*:\s*url\s*\(\s*([\'"]*)\s*\S+script\s*:.*([\'"]*)\s*\)/si'
+                ),
+                array(
+                    "",
+                    "idiocy",
+                    "idiocy",
+                    "idiocy",
+                    "idiocy",
+                    "idiocy",
+                    "url",
+                    "url(\\1#\\1)",
+                    "url(\\1#\\1)",
+                    "url(\\1#\\1)",
+                    "\\1:url(\\2#\\3)"
+                )
+            )
+        )
+    );
+
+    if ($block_external_images) {
+        array_push(
+            $bad_attvals{'/.*/'}{'/^src|background/i'}[0],
+            '/^([\'\"])\s*https*:.*([\'\"])/si'
+        );
+        array_push(
+            $bad_attvals{'/.*/'}{'/^src|background/i'}[1],
+            "\\1$trans_image_path\\1"
+        );
+        array_push(
+            $bad_attvals{'/.*/'}{'/^style/i'}[0],
+            '/url\(([\'\"])\s*https*:.*([\'\"])\)/si'
+        );
+        array_push(
+            $bad_attvals{'/.*/'}{'/^style/i'}[1],
+            "url(\\1$trans_image_path\\1)"
+        );
+    }
+
+    $add_attr_to_tag = array(
+        "/^a$/i" =>
+            array('target' => '"_blank"')
+    );
+
+    $trusted = tln_sanitize(
+        $body,
+        $tag_list,
+        $rm_tags_with_content,
+        $self_closing_tags,
+        $force_tag_closing,
+        $rm_attnames,
+        $bad_attvals,
+        $add_attr_to_tag,
+        $trans_image_path,
+        $block_external_images
+    );
+    return $trusted;
+}
diff --git a/www/plugins/facteur/phpmailer-php5/extras/ntlm_sasl_client.php b/www/plugins/facteur/phpmailer-php5/extras/ntlm_sasl_client.php
new file mode 100644 (file)
index 0000000..4a08561
--- /dev/null
@@ -0,0 +1,185 @@
+<?php
+/*
+ * ntlm_sasl_client.php
+ *
+ * @(#) $Id: ntlm_sasl_client.php,v 1.3 2004/11/17 08:00:37 mlemos Exp $
+ *
+ */
+
+define("SASL_NTLM_STATE_START", 0);
+define("SASL_NTLM_STATE_IDENTIFY_DOMAIN", 1);
+define("SASL_NTLM_STATE_RESPOND_CHALLENGE", 2);
+define("SASL_NTLM_STATE_DONE", 3);
+define("SASL_FAIL", -1);
+define("SASL_CONTINUE", 1);
+
+class ntlm_sasl_client_class
+{
+    public $credentials = array();
+    public $state = SASL_NTLM_STATE_START;
+
+    public function initialize(&$client)
+    {
+        if (!function_exists($function = "mcrypt_encrypt")
+            || !function_exists($function = "mhash")
+        ) {
+            $extensions = array(
+                "mcrypt_encrypt" => "mcrypt",
+                "mhash" => "mhash"
+            );
+            $client->error = "the extension " . $extensions[$function] .
+                " required by the NTLM SASL client class is not available in this PHP configuration";
+            return (0);
+        }
+        return (1);
+    }
+
+    public function ASCIIToUnicode($ascii)
+    {
+        for ($unicode = "", $a = 0; $a < strlen($ascii); $a++) {
+            $unicode .= substr($ascii, $a, 1) . chr(0);
+        }
+        return ($unicode);
+    }
+
+    public function typeMsg1($domain, $workstation)
+    {
+        $domain_length = strlen($domain);
+        $workstation_length = strlen($workstation);
+        $workstation_offset = 32;
+        $domain_offset = $workstation_offset + $workstation_length;
+        return (
+            "NTLMSSP\0" .
+            "\x01\x00\x00\x00" .
+            "\x07\x32\x00\x00" .
+            pack("v", $domain_length) .
+            pack("v", $domain_length) .
+            pack("V", $domain_offset) .
+            pack("v", $workstation_length) .
+            pack("v", $workstation_length) .
+            pack("V", $workstation_offset) .
+            $workstation .
+            $domain
+        );
+    }
+
+    public function NTLMResponse($challenge, $password)
+    {
+        $unicode = $this->ASCIIToUnicode($password);
+        $md4 = mhash(MHASH_MD4, $unicode);
+        $padded = $md4 . str_repeat(chr(0), 21 - strlen($md4));
+        $iv_size = mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB);
+        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+        for ($response = "", $third = 0; $third < 21; $third += 7) {
+            for ($packed = "", $p = $third; $p < $third + 7; $p++) {
+                $packed .= str_pad(decbin(ord(substr($padded, $p, 1))), 8, "0", STR_PAD_LEFT);
+            }
+            for ($key = "", $p = 0; $p < strlen($packed); $p += 7) {
+                $s = substr($packed, $p, 7);
+                $b = $s . ((substr_count($s, "1") % 2) ? "0" : "1");
+                $key .= chr(bindec($b));
+            }
+            $ciphertext = mcrypt_encrypt(MCRYPT_DES, $key, $challenge, MCRYPT_MODE_ECB, $iv);
+            $response .= $ciphertext;
+        }
+        return $response;
+    }
+
+    public function typeMsg3($ntlm_response, $user, $domain, $workstation)
+    {
+        $domain_unicode = $this->ASCIIToUnicode($domain);
+        $domain_length = strlen($domain_unicode);
+        $domain_offset = 64;
+        $user_unicode = $this->ASCIIToUnicode($user);
+        $user_length = strlen($user_unicode);
+        $user_offset = $domain_offset + $domain_length;
+        $workstation_unicode = $this->ASCIIToUnicode($workstation);
+        $workstation_length = strlen($workstation_unicode);
+        $workstation_offset = $user_offset + $user_length;
+        $lm = "";
+        $lm_length = strlen($lm);
+        $lm_offset = $workstation_offset + $workstation_length;
+        $ntlm = $ntlm_response;
+        $ntlm_length = strlen($ntlm);
+        $ntlm_offset = $lm_offset + $lm_length;
+        $session = "";
+        $session_length = strlen($session);
+        $session_offset = $ntlm_offset + $ntlm_length;
+        return (
+            "NTLMSSP\0" .
+            "\x03\x00\x00\x00" .
+            pack("v", $lm_length) .
+            pack("v", $lm_length) .
+            pack("V", $lm_offset) .
+            pack("v", $ntlm_length) .
+            pack("v", $ntlm_length) .
+            pack("V", $ntlm_offset) .
+            pack("v", $domain_length) .
+            pack("v", $domain_length) .
+            pack("V", $domain_offset) .
+            pack("v", $user_length) .
+            pack("v", $user_length) .
+            pack("V", $user_offset) .
+            pack("v", $workstation_length) .
+            pack("v", $workstation_length) .
+            pack("V", $workstation_offset) .
+            pack("v", $session_length) .
+            pack("v", $session_length) .
+            pack("V", $session_offset) .
+            "\x01\x02\x00\x00" .
+            $domain_unicode .
+            $user_unicode .
+            $workstation_unicode .
+            $lm .
+            $ntlm
+        );
+    }
+
+    public function start(&$client, &$message, &$interactions)
+    {
+        if ($this->state != SASL_NTLM_STATE_START) {
+            $client->error = "NTLM authentication state is not at the start";
+            return (SASL_FAIL);
+        }
+        $this->credentials = array(
+            "user" => "",
+            "password" => "",
+            "realm" => "",
+            "workstation" => ""
+        );
+        $defaults = array();
+        $status = $client->GetCredentials($this->credentials, $defaults, $interactions);
+        if ($status == SASL_CONTINUE) {
+            $this->state = SASL_NTLM_STATE_IDENTIFY_DOMAIN;
+        }
+        unset($message);
+        return ($status);
+    }
+
+    public function step(&$client, $response, &$message, &$interactions)
+    {
+        switch ($this->state) {
+            case SASL_NTLM_STATE_IDENTIFY_DOMAIN:
+                $message = $this->TypeMsg1($this->credentials["realm"], $this->credentials["workstation"]);
+                $this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE;
+                break;
+            case SASL_NTLM_STATE_RESPOND_CHALLENGE:
+                $ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]);
+                $message = $this->TypeMsg3(
+                    $ntlm_response,
+                    $this->credentials["user"],
+                    $this->credentials["realm"],
+                    $this->credentials["workstation"]
+                );
+                $this->state = SASL_NTLM_STATE_DONE;
+                break;
+            case SASL_NTLM_STATE_DONE:
+                $client->error = "NTLM authentication was finished without success";
+                return (SASL_FAIL);
+            default:
+                $client->error = "invalid NTLM authentication step state";
+                return (SASL_FAIL);
+        }
+        return (SASL_CONTINUE);
+    }
+}
diff --git a/www/plugins/facteur/phpmailer-php5/get_oauth_token.php b/www/plugins/facteur/phpmailer-php5/get_oauth_token.php
new file mode 100644 (file)
index 0000000..46eb28a
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Get an OAuth2 token from Google.
+ * * Install this script on your server so that it's accessible
+ * as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
+ * e.g.: http://localhost/phpmail/get_oauth_token.php
+ * * Ensure dependencies are installed with 'composer install'
+ * * Set up an app in your Google developer console
+ * * Set the script address as the app's redirect URL
+ * If no refresh token is obtained when running this file, revoke access to your app
+ * using link: https://accounts.google.com/b/0/IssuedAuthSubTokens and run the script again.
+ * This script requires PHP 5.4 or later
+ * PHP Version 5.4
+ */
+
+require 'vendor/autoload.php';
+
+session_start();
+
+//If this automatic URL doesn't work, set it yourself manually
+$redirectUri = isset($_SERVER['HTTPS']) ? 'https://' : 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
+//$redirectUri = 'http://localhost/phpmailer/get_oauth_token.php';
+
+//These details obtained are by setting up app in Google developer console.
+$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
+$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
+
+//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
+$provider = new League\OAuth2\Client\Provider\Google(
+    array(
+        'clientId' => $clientId,
+        'clientSecret' => $clientSecret,
+        'redirectUri' => $redirectUri,
+        'scopes' => array('https://mail.google.com/'),
+        'accessType' => 'offline'
+    )
+);
+
+if (!isset($_GET['code'])) {
+    // If we don't have an authorization code then get one
+    $authUrl = $provider->getAuthorizationUrl();
+    $_SESSION['oauth2state'] = $provider->getState();
+    header('Location: ' . $authUrl);
+    exit;
+// Check given state against previously stored one to mitigate CSRF attack
+} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
+    unset($_SESSION['oauth2state']);
+    exit('Invalid state');
+} else {
+    // Try to get an access token (using the authorization code grant)
+    $token = $provider->getAccessToken(
+        'authorization_code',
+        array(
+            'code' => $_GET['code']
+        )
+    );
+
+    // Use this to get a new access token if the old one expires
+    echo 'Refresh Token: ' . $token->getRefreshToken();
+}
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-am.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-am.php
new file mode 100755 (executable)
index 0000000..ff2a969
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Armenian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Hrayr Grigoryan <hrayr@bits.am>
+ */
+$PHPMAILER_LANG['authenticate']         = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';
+$PHPMAILER_LANG['empty_message']        = 'Հաղորդագրությունը դատարկ է';
+$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_address']      = 'Հասցեն սխալ է: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.';
+$PHPMAILER_LANG['provide_address']      = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: ';
+$PHPMAILER_LANG['signing']              = 'Ստորագրման սխալ: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP -ի connect() ֆունկցիան չի հաջողվել';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP սերվերի սխալ: ';
+$PHPMAILER_LANG['variable_set']         = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: ';
+$PHPMAILER_LANG['extension_missing']    = 'Հավելվածը բացակայում է: ';
index b7c5057..790e2a5 100755 (executable)
@@ -1,27 +1,27 @@
 <?php
 /**
-* PHPMailer language file: refer to English translation for definitive list
-* Arabic Version, UTF-8
-* by : bahjat al mostafa <bahjat983@hotmail.com>
-*/
+ * Arabic PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author 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['authenticate']         = 'خطأ SMTP : لا يمكن تأكيد الهوية.';
+$PHPMAILER_LANG['connect_host']         = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'خطأ SMTP: لم يتم قبول المعلومات .';
+$PHPMAILER_LANG['empty_message']        = 'نص الرسالة فارغ';
 $PHPMAILER_LANG['encoding']             = 'ترميز غير معروف: ';
-$PHPMAILER_LANG['execute']              = 'لم أستطع تنفيذ : ';
-$PHPMAILER_LANG['file_access']          = 'لم نستطع الوصول للملف: ';
-$PHPMAILER_LANG['file_open']            = 'File Error: لم نستطع فتح الملف: ';
-$PHPMAILER_LANG['from_failed']          = 'اÙ\84برÙ\8aد Ø§Ù\84تاÙ\84Ù\8a Ù\84Ù\85 Ù\86ستطع Ø§Ø±Ø³Ø§Ù\84 Ø§Ù\84برÙ\8aد Ù\84Ù\87 : ';
-$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['execute']              = 'لا يمكن تنفيذ : ';
+$PHPMAILER_LANG['file_access']          = 'لا يمكن الوصول للملف: ';
+$PHPMAILER_LANG['file_open']            = 'خطأ في الملف: لا يمكن فتحه: ';
+$PHPMAILER_LANG['from_failed']          = 'خطأ Ø¹Ù\84Ù\89 Ù\85ستÙ\88Ù\89 Ø¹Ù\86Ù\88اÙ\86 Ø§Ù\84Ù\85رسÙ\84 : ';
+$PHPMAILER_LANG['instantiate']          = 'لا يمكن توفير خدمة البريد.';
+$PHPMAILER_LANG['invalid_address']      = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
+$PHPMAILER_LANG['provide_address']      = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
+$PHPMAILER_LANG['recipients_failed']    = 'خطأ SMTP: الأخطاء التالية ' .
                                           'فشل في الارسال لكل من : ';
 $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
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() غير ممكن.';
+$PHPMAILER_LANG['smtp_error']           = 'خطأ على مستوى الخادم SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'لا يمكن تعيين أو إعادة تعيين متغير: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-az.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-az.php
new file mode 100644 (file)
index 0000000..3749d83
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Azerbaijani PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author @mirjalal
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP xətası: Giriş uğursuz oldu.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP xətası: SMTP serverinə qoşulma uğursuz oldu.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP xətası: Verilənlər qəbul edilməyib.';
+$PHPMAILER_LANG['empty_message']        = 'Boş mesaj göndərilə bilməz.';
+$PHPMAILER_LANG['encoding']             = 'Qeyri-müəyyən kodlaşdırma: ';
+$PHPMAILER_LANG['execute']              = 'Əmr yerinə yetirilmədi: ';
+$PHPMAILER_LANG['file_access']          = 'Fayla giriş yoxdur: ';
+$PHPMAILER_LANG['file_open']            = 'Fayl xətası: Fayl açıla bilmədi: ';
+$PHPMAILER_LANG['from_failed']          = 'Göstərilən poçtlara göndərmə uğursuz oldu: ';
+$PHPMAILER_LANG['instantiate']          = 'Mail funksiyası işə salına bilmədi.';
+$PHPMAILER_LANG['invalid_address']      = 'Düzgün olmayan e-mail adresi: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - e-mail kitabxanası dəstəklənmir.';
+$PHPMAILER_LANG['provide_address']      = 'Ən azı bir e-mail adresi daxil edilməlidir.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP xətası: Aşağıdakı ünvanlar üzrə alıcılara göndərmə uğursuzdur: ';
+$PHPMAILER_LANG['signing']              = 'İmzalama xətası: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP serverinə qoşulma uğursuz oldu.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP serveri xətası: ';
+$PHPMAILER_LANG['variable_set']         = 'Dəyişənin quraşdırılması uğursuz oldu: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-be.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-be.php
new file mode 100644 (file)
index 0000000..e2f98f0
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Belarusian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Aleksander Maksymiuk <info@setpro.pl>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Памылка SMTP: памылка ідэнтыфікацыі.';
+$PHPMAILER_LANG['connect_host']         = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Памылка SMTP: звесткі непрынятыя.';
+$PHPMAILER_LANG['empty_message']        = 'Пустое паведамленне.';
+$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_address']      = 'Нельга даслаць паведамленне, няправільны email атрымальніка: ';
+$PHPMAILER_LANG['provide_address']      = 'Запоўніце, калі ласка, правільны email атрымальніка.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.';
+$PHPMAILER_LANG['recipients_failed']    = 'Памылка SMTP: няправільныя атрымальнікі: ';
+$PHPMAILER_LANG['signing']              = 'Памылка подпісу паведамлення: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Памылка сувязі з SMTP-серверам.';
+$PHPMAILER_LANG['smtp_error']           = 'Памылка SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-bg.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-bg.php
new file mode 100644 (file)
index 0000000..b22941f
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Bulgarian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Mikhail Kyosev <mialygk@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP грешка: Не може да се удостовери пред сървъра.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP грешка: Не може да се свърже с SMTP хоста.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP грешка: данните не са приети.';
+$PHPMAILER_LANG['empty_message']        = 'Съдържанието на съобщението е празно';
+$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_address']      = 'Невалиден адрес: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.';
+$PHPMAILER_LANG['provide_address']      = 'Трябва да предоставите поне един email адрес за получател.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP грешка: Следните адреси за Получател са невалидни: ';
+$PHPMAILER_LANG['signing']              = 'Грешка при подписване: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP провален connect().';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP сървърна грешка: ';
+$PHPMAILER_LANG['variable_set']         = 'Не може да се установи или възстанови променлива: ';
+$PHPMAILER_LANG['extension_missing']    = 'Липсва разширение: ';
index 7d64ce4..2020c3d 100755 (executable)
@@ -1,26 +1,28 @@
-<?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
+<?php
+/**
+ * Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Paulo Henrique Garcia <paulo@controllerweb.com.br>
+ * @author Lucas Guimarães <lucas@lucasguimaraes.com>
+ * @author Phelipe Alves <phelipealvesdesouza@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Erro de SMTP: Não foi possível autenticar.';
+$PHPMAILER_LANG['connect_host']         = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Erro de SMTP: Dados rejeitados.';
+$PHPMAILER_LANG['empty_message']        = 'Corpo da mensagem vazio';
+$PHPMAILER_LANG['encoding']             = 'Codificação desconhecida: ';
+$PHPMAILER_LANG['execute']              = 'Não foi possível executar: ';
+$PHPMAILER_LANG['file_access']          = 'Não foi possível acessar o arquivo: ';
+$PHPMAILER_LANG['file_open']            = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
+$PHPMAILER_LANG['from_failed']          = 'Os endereços dos remententes a seguir falharam: ';
+$PHPMAILER_LANG['instantiate']          = 'Não foi possível iniciar uma instância da função mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Não enviando, endereço de e-mail inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
+$PHPMAILER_LANG['provide_address']      = 'Você deve fornecer pelo menos um endereço de destinatário de e-mail.';
+$PHPMAILER_LANG['recipients_failed']    = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
+$PHPMAILER_LANG['signing']              = 'Erro ao assinar: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falhou.';
+$PHPMAILER_LANG['smtp_error']           = 'Erro de servidor SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Não foi possível definir ou resetar a variável: ';
+$PHPMAILER_LANG['extension_missing']    = 'Extensão ausente: ';
index 1127567..4117596 100644 (file)
@@ -1,26 +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
+<?php
+/**
+ * Catalan PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Ivan <web AT microstudi DOT com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Error SMTP: No s’ha pogut autenticar.';
+$PHPMAILER_LANG['connect_host']         = 'Error SMTP: No es pot connectar al servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Dades no acceptades.';
+$PHPMAILER_LANG['empty_message']        = 'El cos del missatge està buit.';
+$PHPMAILER_LANG['encoding']             = 'Codificació desconeguda: ';
+$PHPMAILER_LANG['execute']              = 'No es pot executar: ';
+$PHPMAILER_LANG['file_access']          = 'No es pot accedir a l’arxiu: ';
+$PHPMAILER_LANG['file_open']            = 'Error d’Arxiu: No es pot obrir l’arxiu: ';
+$PHPMAILER_LANG['from_failed']          = 'La(s) següent(s) adreces de remitent han fallat: ';
+$PHPMAILER_LANG['instantiate']          = 'No s’ha pogut crear una instància de la funció Mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Adreça d’email invalida: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
+$PHPMAILER_LANG['provide_address']      = 'S’ha de proveir almenys una adreça d’email com a destinatari.';
+$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Els següents destinataris han fallat: ';
+$PHPMAILER_LANG['signing']              = 'Error al signar: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Ha fallat el SMTP Connect().';
+$PHPMAILER_LANG['smtp_error']           = 'Error del servidor SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'No s’ha pogut establir o restablir la variable: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 31ebd86..4fda6b8 100755 (executable)
@@ -1,26 +1,26 @@
 <?php
 /**
-* PHPMailer language file: refer to English translation for definitive list
-* Chinese Version
-* By LiuXin: www.80x86.cn/blog/
-*/
+ * Chinese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author LiuXin <http://www.80x86.cn/blog/>
+ */
 
-$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
-$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
-$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
+$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['encoding']             = '未知编码:';
+$PHPMAILER_LANG['execute']              = '不能执行: ';
+$PHPMAILER_LANG['file_access']          = '不能访问文件:';
+$PHPMAILER_LANG['file_open']            = '文件错误:不能打开文件:';
+$PHPMAILER_LANG['from_failed']          = '下面的发送地址邮件发送失败了: ';
+$PHPMAILER_LANG['instantiate']          = '不能实现mail方法。';
+//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
 $PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
-$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
-$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
+$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
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index f9589ca..8cb1a3d 100755 (executable)
@@ -1,25 +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
+<?php
+/**
+ * Czech PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Chyba SMTP: Autentizace selhala.';
+$PHPMAILER_LANG['connect_host']         = 'Chyba SMTP: Nelze navázat spojení se SMTP serverem.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Chyba SMTP: Data nebyla přijata.';
+$PHPMAILER_LANG['empty_message']        = 'Prázdné tělo zprávy';
+$PHPMAILER_LANG['encoding']             = 'Neznámé kódování: ';
+$PHPMAILER_LANG['execute']              = 'Nelze provést: ';
+$PHPMAILER_LANG['file_access']          = 'Nelze získat přístup k souboru: ';
+$PHPMAILER_LANG['file_open']            = 'Chyba souboru: Nelze otevřít soubor pro čtení: ';
+$PHPMAILER_LANG['from_failed']          = 'Následující adresa odesílatele je nesprávná: ';
+$PHPMAILER_LANG['instantiate']          = 'Nelze vytvořit instanci emailové funkce.';
+$PHPMAILER_LANG['invalid_address']      = 'Neplatná adresa: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
+$PHPMAILER_LANG['provide_address']      = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
+$PHPMAILER_LANG['recipients_failed']    = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';
+$PHPMAILER_LANG['signing']              = 'Chyba přihlašování: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() selhal.';
+$PHPMAILER_LANG['smtp_error']           = 'Chyba SMTP serveru: ';
+$PHPMAILER_LANG['variable_set']         = 'Nelze nastavit nebo změnit proměnnou: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 165a86f..43057ef 100755 (executable)
@@ -1,25 +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
+<?php
+/**
+ * German PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Fehler: Daten werden nicht akzeptiert.';
+$PHPMAILER_LANG['empty_message']        = 'E-Mail Inhalt ist leer.';
+$PHPMAILER_LANG['encoding']             = 'Unbekanntes Encoding-Format: ';
+$PHPMAILER_LANG['execute']              = 'Konnte folgenden Befehl nicht ausführen: ';
+$PHPMAILER_LANG['file_access']          = 'Zugriff auf folgende Datei fehlgeschlagen: ';
+$PHPMAILER_LANG['file_open']            = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
+$PHPMAILER_LANG['from_failed']          = 'Die folgende Absenderadresse ist nicht korrekt: ';
+$PHPMAILER_LANG['instantiate']          = 'Mail Funktion konnte nicht initialisiert werden.';
+$PHPMAILER_LANG['invalid_address']      = 'E-Mail wird nicht gesendet, die Adresse ist ungültig: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
+$PHPMAILER_LANG['provide_address']      = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
+$PHPMAILER_LANG['signing']              = 'Fehler beim Signieren: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Verbindung zu SMTP Server fehlgeschlagen.';
+$PHPMAILER_LANG['smtp_error']           = 'Fehler vom SMTP Server: ';
+$PHPMAILER_LANG['variable_set']         = 'Kann Variable nicht setzen oder zurücksetzen: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 59b58c0..e725f4b 100644 (file)
@@ -1,26 +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
+<?php
+/**
+ * Danish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Mikael Stokkebro <info@stokkebro.dk>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP fejl: Kunne ikke logge på.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fejl: Data kunne ikke accepteres.';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'Ukendt encode-format: ';
+$PHPMAILER_LANG['execute']              = 'Kunne ikke køre: ';
+$PHPMAILER_LANG['file_access']          = 'Ingen adgang til fil: ';
+$PHPMAILER_LANG['file_open']            = 'Fil fejl: Kunne ikke åbne filen: ';
+$PHPMAILER_LANG['from_failed']          = 'Følgende afsenderadresse er forkert: ';
+$PHPMAILER_LANG['instantiate']          = 'Kunne ikke initialisere email funktionen.';
+//$PHPMAILER_LANG['invalid_address']        = 'Invalid address: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
+$PHPMAILER_LANG['provide_address']      = 'Du skal indtaste mindst en modtagers emailadresse.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP fejl: Følgende modtagere er forkerte: ';
+//$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: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-el.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-el.php
new file mode 100644 (file)
index 0000000..7109641
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Greek PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
+$PHPMAILER_LANG['empty_message']        = 'Το E-Mail δεν έχει περιεχόμενο .';
+$PHPMAILER_LANG['encoding']             = 'Αγνωστο Encoding-Format: ';
+$PHPMAILER_LANG['execute']              = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
+$PHPMAILER_LANG['file_access']          = 'Αδυναμία προσπέλασης του αρχείου: ';
+$PHPMAILER_LANG['file_open']            = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
+$PHPMAILER_LANG['from_failed']          = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
+$PHPMAILER_LANG['instantiate']          = 'Αδυναμία εκκίνησης Mail function.';
+$PHPMAILER_LANG['invalid_address']      = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
+$PHPMAILER_LANG['provide_address']      = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
+$PHPMAILER_LANG['signing']              = 'Σφάλμα υπογραφής: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Αποτυχία σύνδεσης στον SMTP Server.';
+$PHPMAILER_LANG['smtp_error']           = 'Σφάλμα από τον SMTP Server: ';
+$PHPMAILER_LANG['variable_set']         = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-en.php
deleted file mode 100755 (executable)
index f7d4286..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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-eo.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-eo.php
new file mode 100644 (file)
index 0000000..2cf7d5c
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Esperanto PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.';
+$PHPMAILER_LANG['connect_host']         = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Eraro de servilo SMTP : neĝustaj datumoj.';
+$PHPMAILER_LANG['empty_message']        = 'Teksto de mesaĝo mankas.';
+$PHPMAILER_LANG['encoding']             = 'Nekonata kodoprezento: ';
+$PHPMAILER_LANG['execute']              = 'Lanĉi rulumadon ne eblis: ';
+$PHPMAILER_LANG['file_access']          = 'Aliro al dosiero ne sukcesis: ';
+$PHPMAILER_LANG['file_open']            = 'Eraro de dosiero: malfermo neeblas: ';
+$PHPMAILER_LANG['from_failed']          = 'Jena adreso de sendinto malsukcesis: ';
+$PHPMAILER_LANG['instantiate']          = 'Genero de retmesaĝa funkcio neeblis.';
+$PHPMAILER_LANG['invalid_address']      = 'Retadreso ne validas: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mesaĝilo ne subtenata.';
+$PHPMAILER_LANG['provide_address']      = 'Vi devas tajpi almenaŭ unu recevontan retadreson.';
+$PHPMAILER_LANG['recipients_failed']    = 'Eraro de servilo SMTP : la jenaj poŝtrecivuloj kaŭzis eraron: ';
+$PHPMAILER_LANG['signing']              = 'Eraro de subskribo: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP konektado malsukcesis.';
+$PHPMAILER_LANG['smtp_error']           = 'Eraro de servilo SMTP : ';
+$PHPMAILER_LANG['variable_set']         = 'Variablo ne pravalorizeblas aŭ ne repravalorizeblas: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 0b69825..5ef716e 100755 (executable)
@@ -1,26 +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
+<?php
+/**
+ * Spanish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Matt Sturdy <matt.sturdy@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Error SMTP: Imposible autentificar.';
+$PHPMAILER_LANG['connect_host']         = 'Error SMTP: Imposible conectar al servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Datos no aceptados.';
+$PHPMAILER_LANG['empty_message']        = 'El cuerpo del mensaje está vacío';
+$PHPMAILER_LANG['encoding']             = 'Codificación desconocida: ';
+$PHPMAILER_LANG['execute']              = 'Imposible ejecutar: ';
+$PHPMAILER_LANG['file_access']          = 'Imposible acceder al archivo: ';
+$PHPMAILER_LANG['file_open']            = 'Error de Archivo: Imposible abrir el archivo: ';
+$PHPMAILER_LANG['from_failed']          = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
+$PHPMAILER_LANG['instantiate']          = 'Imposible crear una instancia de la función Mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Imposible enviar: dirección de email inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
+$PHPMAILER_LANG['provide_address']      = 'Debe proporcionar al menos una dirección de email de destino.';
+$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Los siguientes destinos fallaron: ';
+$PHPMAILER_LANG['signing']              = 'Error al firmar: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falló.';
+$PHPMAILER_LANG['smtp_error']           = 'Error del servidor SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'No se pudo configurar la variable: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index cf61779..7e06da1 100755 (executable)
@@ -1,26 +1,27 @@
 <?php
 /**
-* PHPMailer language file: refer to English translation for definitive list
-* Estonian Version
-* By Indrek Päri
-*/
+ * Estonian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Indrek Päri
+ * @author Elan Ruusamäe <glen@delfi.ee>
+ */
 
 $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['empty_message']        = 'Tühi kirja sisu';
+$PHPMAILER_LANG["encoding"]             = 'Tundmatu 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['invalid_address']      = 'Saatmine peatatud, e-posti address vigane: ';
 $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
+$PHPMAILER_LANG["signing"]              = 'Viga allkirjastamisel: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() ebaõnnestus.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP serveri viga: ';
+$PHPMAILER_LANG['variable_set']         = 'Ei õnnestunud määrata või lähtestada muutujat: ';
+$PHPMAILER_LANG['extension_missing']    = 'Nõutud laiendus on puudu: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fa.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-fa.php
new file mode 100644 (file)
index 0000000..ad0745c
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Persian/Farsi PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Ali Jazayeri <jaza.ali@gmail.com>
+ * @author Mohammad Hossein Mojtahedi <mhm5000@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'خطای SMTP: احراز هویت با شکست مواجه شد.';
+$PHPMAILER_LANG['connect_host']         = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.';
+$PHPMAILER_LANG['data_not_accepted']    = 'خطای SMTP: داده‌ها نا‌درست هستند.';
+$PHPMAILER_LANG['empty_message']        = 'بخش متن پیام خالی است.';
+$PHPMAILER_LANG['encoding']             = 'کد‌گذاری نا‌شناخته: ';
+$PHPMAILER_LANG['execute']              = 'امکان اجرا وجود ندارد: ';
+$PHPMAILER_LANG['file_access']          = 'امکان دسترسی به فایل وجود ندارد: ';
+$PHPMAILER_LANG['file_open']            = 'خطای File: امکان بازکردن فایل وجود ندارد: ';
+$PHPMAILER_LANG['from_failed']          = 'آدرس فرستنده اشتباه است: ';
+$PHPMAILER_LANG['instantiate']          = 'امکان معرفی تابع ایمیل وجود ندارد.';
+$PHPMAILER_LANG['invalid_address']      = 'آدرس ایمیل معتبر نیست: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.';
+$PHPMAILER_LANG['provide_address']      = 'باید حداقل یک آدرس گیرنده وارد کنید.';
+$PHPMAILER_LANG['recipients_failed']    = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: ';
+$PHPMAILER_LANG['signing']              = 'خطا در امضا: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'خطا در اتصال به SMTP.';
+$PHPMAILER_LANG['smtp_error']           = 'خطا در SMTP Server: ';
+$PHPMAILER_LANG['variable_set']         = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 6d7dcce..ec4e752 100644 (file)
@@ -1,27 +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
+<?php
+/**
+ * Finnish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Jyry Kuukanen
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-virhe: data on virheellinen.';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';
+$PHPMAILER_LANG['execute']              = 'Suoritus epäonnistui: ';
+$PHPMAILER_LANG['file_access']          = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
+$PHPMAILER_LANG['file_open']            = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
+$PHPMAILER_LANG['from_failed']          = 'Seuraava lähettäjän osoite on virheellinen: ';
+$PHPMAILER_LANG['instantiate']          = 'mail-funktion luonti epäonnistui.';
+//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
+$PHPMAILER_LANG['provide_address']      = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
+$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';
+//$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: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 704c477..68cdef1 100644 (file)
@@ -1,27 +1,26 @@
-<?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
+<?php
+/**
+ * Faroese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Dávur Sørensen <http://www.profo-webdesign.dk>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP feilur: Kundi ikki góðkenna.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP feilur: Data ikki góðkent.';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'Ókend encoding: ';
+$PHPMAILER_LANG['execute']              = 'Kundi ikki útføra: ';
+$PHPMAILER_LANG['file_access']          = 'Kundi ikki tilganga fílu: ';
+$PHPMAILER_LANG['file_open']            = 'Fílu feilur: Kundi ikki opna fílu: ';
+$PHPMAILER_LANG['from_failed']          = 'fylgjandi Frá/From adressa miseydnaðist: ';
+$PHPMAILER_LANG['instantiate']          = 'Kuni ikki instantiera mail funktión.';
+//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
+$PHPMAILER_LANG['provide_address']      = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
+//$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: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 52e9ae2..a661f98 100755 (executable)
@@ -1,25 +1,29 @@
-<?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
+<?php
+/**
+ * French PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * Some French punctuation requires a thin non-breaking space (U+202F) character before it,
+ * for example before a colon or exclamation mark.
+ * There is one of these characters between these quotes: " "
+ * @link http://unicode.org/udhr/n/notes_fra.html
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Erreur SMTP : échec de l\'authentification.';
+$PHPMAILER_LANG['connect_host']         = 'Erreur SMTP : impossible de se connecter au serveur SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Erreur SMTP : données incorrectes.';
+$PHPMAILER_LANG['empty_message']        = 'Corps du message vide.';
+$PHPMAILER_LANG['encoding']             = 'Encodage inconnu : ';
+$PHPMAILER_LANG['execute']              = 'Impossible de lancer l\'exécution : ';
+$PHPMAILER_LANG['file_access']          = 'Impossible d\'accéder au fichier : ';
+$PHPMAILER_LANG['file_open']            = 'Ouverture du fichier impossible : ';
+$PHPMAILER_LANG['from_failed']          = 'L\'adresse d\'expéditeur suivante a échoué : ';
+$PHPMAILER_LANG['instantiate']          = 'Impossible d\'instancier la fonction mail.';
+$PHPMAILER_LANG['invalid_address']      = 'L\'adresse courriel n\'est pas valide : ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
+$PHPMAILER_LANG['provide_address']      = 'Vous devez fournir au moins une adresse de destinataire.';
+$PHPMAILER_LANG['recipients_failed']    = 'Erreur SMTP : les destinataires suivants sont en erreur : ';
+$PHPMAILER_LANG['signing']              = 'Erreur de signature : ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Échec de la connexion SMTP.';
+$PHPMAILER_LANG['smtp_error']           = 'Erreur du serveur SMTP : ';
+$PHPMAILER_LANG['variable_set']         = 'Impossible d\'initialiser ou de réinitialiser une variable : ';
+$PHPMAILER_LANG['extension_missing']    = 'Extension manquante : ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-gl.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-gl.php
new file mode 100644 (file)
index 0000000..9b4ce4d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Galician PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author by Donato Rouco <donatorouco@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Erro SMTP: Non puido ser autentificado.';
+$PHPMAILER_LANG['connect_host']         = 'Erro SMTP: Non puido conectar co servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Erro SMTP: Datos non aceptados.';
+$PHPMAILER_LANG['empty_message']        = 'Corpo da mensaxe vacía';
+$PHPMAILER_LANG['encoding']             = 'Codificación descoñecida: ';
+$PHPMAILER_LANG['execute']              = 'Non puido ser executado: ';
+$PHPMAILER_LANG['file_access']          = 'Nob puido acceder ó arquivo: ';
+$PHPMAILER_LANG['file_open']            = 'Erro de Arquivo: No puido abrir o arquivo: ';
+$PHPMAILER_LANG['from_failed']          = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: ';
+$PHPMAILER_LANG['instantiate']          = 'Non puido crear unha instancia da función Mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Non puido envia-lo correo: dirección de email inválida: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.';
+$PHPMAILER_LANG['provide_address']      = 'Debe engadir polo menos unha dirección de email coma destino.';
+$PHPMAILER_LANG['recipients_failed']    = 'Erro SMTP: Os seguintes destinos fallaron: ';
+$PHPMAILER_LANG['signing']              = 'Erro ó firmar: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() fallou.';
+$PHPMAILER_LANG['smtp_error']           = 'Erro do servidor SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Non puidemos axustar ou reaxustar a variábel: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-he.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-he.php
new file mode 100644 (file)
index 0000000..70eb717
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Hebrew PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Ronny Sherer <ronny@hoojima.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'שגיאת SMTP: פעולת האימות נכשלה.';
+$PHPMAILER_LANG['connect_host']         = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'שגיאת SMTP: מידע לא התקבל.';
+$PHPMAILER_LANG['empty_message']        = 'גוף ההודעה ריק';
+$PHPMAILER_LANG['invalid_address']      = 'כתובת שגויה: ';
+$PHPMAILER_LANG['encoding']             = 'קידוד לא מוכר: ';
+$PHPMAILER_LANG['execute']              = 'לא הצלחתי להפעיל את: ';
+$PHPMAILER_LANG['file_access']          = 'לא ניתן לגשת לקובץ: ';
+$PHPMAILER_LANG['file_open']            = 'שגיאת קובץ: לא ניתן לגשת לקובץ: ';
+$PHPMAILER_LANG['from_failed']          = 'כתובות הנמענים הבאות נכשלו: ';
+$PHPMAILER_LANG['instantiate']          = 'לא הצלחתי להפעיל את פונקציית המייל.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.';
+$PHPMAILER_LANG['provide_address']      = 'חובה לספק לפחות כתובת אחת של מקבל המייל.';
+$PHPMAILER_LANG['recipients_failed']    = 'שגיאת SMTP: הנמענים הבאים נכשלו: ';
+$PHPMAILER_LANG['signing']              = 'שגיאת חתימה: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
+$PHPMAILER_LANG['smtp_error']           = 'שגיאת שרת SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'לא ניתן לקבוע או לשנות את המשתנה: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hr.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-hr.php
new file mode 100644 (file)
index 0000000..3822920
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Croatian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Hrvoj3e <hrvoj3e@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Greška: Neuspjela autentikacija.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Greška: Podatci nisu prihvaćeni.';
+$PHPMAILER_LANG['empty_message']        = 'Sadržaj poruke je prazan.';
+$PHPMAILER_LANG['encoding']             = 'Nepoznati encoding: ';
+$PHPMAILER_LANG['execute']              = 'Nije moguće izvršiti naredbu: ';
+$PHPMAILER_LANG['file_access']          = 'Nije moguće pristupiti datoteci: ';
+$PHPMAILER_LANG['file_open']            = 'Nije moguće otvoriti datoteku: ';
+$PHPMAILER_LANG['from_failed']          = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: ';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: ';
+$PHPMAILER_LANG['instantiate']          = 'Ne mogu pokrenuti mail funkcionalnost.';
+$PHPMAILER_LANG['invalid_address']      = 'E-mail nije poslan. Neispravna e-mail adresa: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
+$PHPMAILER_LANG['provide_address']      = 'Definirajte barem jednu adresu primatelja.';
+$PHPMAILER_LANG['signing']              = 'Greška prilikom prijave: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Spajanje na SMTP poslužitelj nije uspjelo.';
+$PHPMAILER_LANG['smtp_error']           = 'Greška SMTP poslužitelja: ';
+$PHPMAILER_LANG['variable_set']         = 'Ne mogu postaviti varijablu niti ju vratiti nazad: ';
+$PHPMAILER_LANG['extension_missing']    = 'Nedostaje proširenje: ';
index a266484..d7ca888 100644 (file)
@@ -1,25 +1,26 @@
-<?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
+<?php
+/**
+ * Hungarian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author @dominicus-75
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP hiba: az azonosítás sikertelen.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP hiba: nem lehet kapcsolódni az SMTP-szerverhez.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP hiba: adatok visszautasítva.';
+$PHPMAILER_LANG['empty_message']        = 'Üres az üzenettörzs.';
+$PHPMAILER_LANG['encoding']             = 'Ismeretlen kódolás: ';
+$PHPMAILER_LANG['execute']              = 'Nem lehet végrehajtani: ';
+$PHPMAILER_LANG['file_access']          = 'A következő fájl nem elérhető: ';
+$PHPMAILER_LANG['file_open']            = 'Fájl hiba: a következő fájlt nem lehet megnyitni: ';
+$PHPMAILER_LANG['from_failed']          = 'A feladóként megadott következő cím hibás: ';
+$PHPMAILER_LANG['instantiate']          = 'A PHP mail() függvényt nem sikerült végrehajtani.';
+$PHPMAILER_LANG['invalid_address']      = 'Érvénytelen cím: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' a mailer-osztály nem támogatott.';
+$PHPMAILER_LANG['provide_address']      = 'Legalább egy címzettet fel kell tüntetni.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP hiba: a címzettként megadott következő címek hibásak: ';
+$PHPMAILER_LANG['signing']              = 'Hibás aláírás: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Hiba az SMTP-kapcsolatban.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP-szerver hiba: ';
+$PHPMAILER_LANG['variable_set']         = 'A következő változók beállítása nem sikerült: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-id.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-id.php
new file mode 100644 (file)
index 0000000..e57b524
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Indonesian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Cecep Prawiro <cecep.prawiro@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Kesalahan SMTP: Tidak dapat mengautentikasi.';
+$PHPMAILER_LANG['connect_host']         = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Kesalahan SMTP: Data tidak diterima peladen.';
+$PHPMAILER_LANG['empty_message']        = 'Isi pesan kosong';
+$PHPMAILER_LANG['encoding']             = 'Pengkodean karakter tidak dikenali: ';
+$PHPMAILER_LANG['execute']              = 'Tidak dapat menjalankan proses : ';
+$PHPMAILER_LANG['file_access']          = 'Tidak dapat mengakses berkas : ';
+$PHPMAILER_LANG['file_open']            = 'Kesalahan File: Berkas tidak bisa dibuka : ';
+$PHPMAILER_LANG['from_failed']          = 'Alamat pengirim berikut mengakibatkan error : ';
+$PHPMAILER_LANG['instantiate']          = 'Tidak dapat menginisialisasi fungsi email';
+$PHPMAILER_LANG['invalid_address']      = 'Gagal terkirim, alamat email tidak valid : ';
+$PHPMAILER_LANG['provide_address']      = 'Harus disediakan minimal satu alamat tujuan';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer tidak didukung';
+$PHPMAILER_LANG['recipients_failed']    = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan error : ';
+$PHPMAILER_LANG['signing']              = 'Kesalahan dalam tanda tangan : ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() gagal.';
+$PHPMAILER_LANG['smtp_error']           = 'Kesalahan peladen SMTP : ';
+$PHPMAILER_LANG['variable_set']         = 'Tidak berhasil mengatur atau mengatur ulang variable : ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 59bf4fb..d2f4643 100755 (executable)
@@ -1,27 +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
+<?php
+/**
+ * Italian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Ilias Bartolini <brain79@inwind.it>
+ * @author Stefano Sabatini <sabas88@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Impossibile autenticarsi.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Dati non accettati dal server.';
+$PHPMAILER_LANG['empty_message']        = 'Il corpo del messaggio è vuoto';
+$PHPMAILER_LANG['encoding']             = 'Codifica dei caratteri sconosciuta: ';
+$PHPMAILER_LANG['execute']              = 'Impossibile eseguire l\'operazione: ';
+$PHPMAILER_LANG['file_access']          = 'Impossibile accedere al file: ';
+$PHPMAILER_LANG['file_open']            = 'File Error: Impossibile aprire il file: ';
+$PHPMAILER_LANG['from_failed']          = 'I seguenti indirizzi mittenti hanno generato errore: ';
+$PHPMAILER_LANG['instantiate']          = 'Impossibile istanziare la funzione mail';
+$PHPMAILER_LANG['invalid_address']      = 'Impossibile inviare, l\'indirizzo email non è valido: ';
+$PHPMAILER_LANG['provide_address']      = 'Deve essere fornito almeno un indirizzo ricevente';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: ';
+$PHPMAILER_LANG['signing']              = 'Errore nella firma: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() fallita.';
+$PHPMAILER_LANG['smtp_error']           = 'Errore del server SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Impossibile impostare o resettare la variabile: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 66da1b6..2d77872 100644 (file)
@@ -1,26 +1,27 @@
-<?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
+<?php
+/**
+ * Japanese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Mitsuhiro Yoshida <http://mitstek.com/>
+ * @author Yoshi Sakai <http://bluemooninc.jp/>
+ */
+
+$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']          = 'Fromアドレスを登録する際にエラーが発生しました: ';
+$PHPMAILER_LANG['instantiate']          = 'メール関数が正常に動作しませんでした。';
+//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
+$PHPMAILER_LANG['provide_address']      = '少なくとも1つメールアドレスを 指定する必要があります。';
+$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: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ka.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ka.php
new file mode 100644 (file)
index 0000000..cdf3168
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Georgian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.';
+$PHPMAILER_LANG['encoding']             = 'კოდირების უცნობი ტიპი: ';
+$PHPMAILER_LANG['execute']              = 'შეუძლებელია შემდეგი ბრძანების შესრულება: ';
+$PHPMAILER_LANG['file_access']          = 'შეუძლებელია წვდომა ფაილთან: ';
+$PHPMAILER_LANG['file_open']            = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: ';
+$PHPMAILER_LANG['from_failed']          = 'გამგზავნის არასწორი მისამართი: ';
+$PHPMAILER_LANG['instantiate']          = 'mail ფუნქციის გაშვება ვერ ხერხდება.';
+$PHPMAILER_LANG['provide_address']      = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: ';
+$PHPMAILER_LANG['empty_message']        = 'შეტყობინება ცარიელია';
+$PHPMAILER_LANG['invalid_address']      = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: ';
+$PHPMAILER_LANG['signing']              = 'ხელმოწერის შეცდომა: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP სერვერის შეცდომა: ';
+$PHPMAILER_LANG['variable_set']         = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ko.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ko.php
new file mode 100644 (file)
index 0000000..9599fa6
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Korean PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author ChalkPE <amato0617@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP 오류: 인증할 수 없습니다.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.';
+$PHPMAILER_LANG['empty_message']        = '메세지 내용이 없습니다';
+$PHPMAILER_LANG['encoding']             = '알 수 없는 인코딩: ';
+$PHPMAILER_LANG['execute']              = '실행 불가: ';
+$PHPMAILER_LANG['file_access']          = '파일 접근 불가: ';
+$PHPMAILER_LANG['file_open']            = '파일 오류: 파일을 열 수 없습니다: ';
+$PHPMAILER_LANG['from_failed']          = '다음 From 주소에서 오류가 발생했습니다: ';
+$PHPMAILER_LANG['instantiate']          = 'mail 함수를 인스턴스화할 수 없습니다';
+$PHPMAILER_LANG['invalid_address']      = '잘못된 주소: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.';
+$PHPMAILER_LANG['provide_address']      = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: ';
+$PHPMAILER_LANG['signing']              = '서명 오류: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP 연결을 실패하였습니다.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP 서버 오류: ';
+$PHPMAILER_LANG['variable_set']         = '변수 설정 및 초기화 불가: ';
+$PHPMAILER_LANG['extension_missing']    = '확장자 없음: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lt.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lt.php
new file mode 100644 (file)
index 0000000..1253a4f
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Lithuanian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Dainius Kaupaitis <dk@sum.lt>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP klaida: autentifikacija nepavyko.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP klaida: duomenys nepriimti.';
+$PHPMAILER_LANG['empty_message']        = 'Laiško turinys tuščias';
+$PHPMAILER_LANG['encoding']             = 'Neatpažinta koduotė: ';
+$PHPMAILER_LANG['execute']              = 'Nepavyko įvykdyti komandos: ';
+$PHPMAILER_LANG['file_access']          = 'Byla nepasiekiama: ';
+$PHPMAILER_LANG['file_open']            = 'Bylos klaida: Nepavyksta atidaryti: ';
+$PHPMAILER_LANG['from_failed']          = 'Neteisingas siuntėjo adresas: ';
+$PHPMAILER_LANG['instantiate']          = 'Nepavyko paleisti mail funkcijos.';
+$PHPMAILER_LANG['invalid_address']      = 'Neteisingas adresas: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.';
+$PHPMAILER_LANG['provide_address']      = 'Nurodykite bent vieną gavėjo adresą.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: ';
+$PHPMAILER_LANG['signing']              = 'Prisijungimo klaida: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP susijungimo klaida';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP stoties klaida: ';
+$PHPMAILER_LANG['variable_set']         = 'Nepavyko priskirti reikšmės kintamajam: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lv.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-lv.php
new file mode 100644 (file)
index 0000000..39bf9a1
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Latvian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Eduards M. <e@npd.lv>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP kļūda: Autorizācija neizdevās.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Kļūda: Nepieņem informāciju.';
+$PHPMAILER_LANG['empty_message']        = 'Ziņojuma teksts ir tukšs';
+$PHPMAILER_LANG['encoding']             = 'Neatpazīts kodējums: ';
+$PHPMAILER_LANG['execute']              = 'Neizdevās izpildīt komandu: ';
+$PHPMAILER_LANG['file_access']          = 'Fails nav pieejams: ';
+$PHPMAILER_LANG['file_open']            = 'Faila kļūda: Nevar atvērt failu: ';
+$PHPMAILER_LANG['from_failed']          = 'Nepareiza sūtītāja adrese: ';
+$PHPMAILER_LANG['instantiate']          = 'Nevar palaist sūtīšanas funkciju.';
+$PHPMAILER_LANG['invalid_address']      = 'Nepareiza adrese: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.';
+$PHPMAILER_LANG['provide_address']      = 'Lūdzu, norādiet vismaz vienu adresātu.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: ';
+$PHPMAILER_LANG['signing']              = 'Autorizācijas kļūda: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP savienojuma kļūda';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP servera kļūda: ';
+$PHPMAILER_LANG['variable_set']         = 'Nevar piešķirt mainīgā vērtību: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ms.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-ms.php
new file mode 100644 (file)
index 0000000..4e2c340
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Malaysian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Nawawi Jamili <nawawi@rutweb.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Ralat SMTP: Tidak dapat pengesahan.';
+$PHPMAILER_LANG['connect_host']         = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Ralat SMTP: Data tidak diterima oleh pelayan.';
+$PHPMAILER_LANG['empty_message']        = 'Tiada isi untuk mesej';
+$PHPMAILER_LANG['encoding']             = 'Pengekodan tidak diketahui: ';
+$PHPMAILER_LANG['execute']              = 'Tidak dapat melaksanakan: ';
+$PHPMAILER_LANG['file_access']          = 'Tidak dapat mengakses fail: ';
+$PHPMAILER_LANG['file_open']            = 'Ralat Fail: Tidak dapat membuka fail: ';
+$PHPMAILER_LANG['from_failed']          = 'Berikut merupakan ralat dari alamat e-mel: ';
+$PHPMAILER_LANG['instantiate']          = 'Tidak dapat memberi contoh fungsi e-mel.';
+$PHPMAILER_LANG['invalid_address']      = 'Alamat emel tidak sah: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.';
+$PHPMAILER_LANG['provide_address']      = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.';
+$PHPMAILER_LANG['recipients_failed']    = 'Ralat SMTP: Penerima e-mel berikut telah gagal: ';
+$PHPMAILER_LANG['signing']              = 'Ralat pada tanda tangan: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() telah gagal.';
+$PHPMAILER_LANG['smtp_error']           = 'Ralat pada pelayan SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 355dcdc..0fc38be 100755 (executable)
@@ -1,25 +1,26 @@
-<?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
+<?php
+/**
+ * Dutch PHPMailer language file: refer to class.phpmailer.php for definitive list.
+ * @package PHPMailer
+ * @author Tuxion <team@tuxion.nl>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP-fout: authenticatie mislukt.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP-fout: kon niet verbinden met SMTP-host.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-fout: data niet geaccepteerd.';
+$PHPMAILER_LANG['empty_message']        = 'Berichttekst is leeg';
+$PHPMAILER_LANG['encoding']             = 'Onbekende codering: ';
+$PHPMAILER_LANG['execute']              = 'Kon niet uitvoeren: ';
+$PHPMAILER_LANG['file_access']          = 'Kreeg geen toegang tot bestand: ';
+$PHPMAILER_LANG['file_open']            = 'Bestandsfout: kon bestand niet openen: ';
+$PHPMAILER_LANG['from_failed']          = 'Het volgende afzendersadres is mislukt: ';
+$PHPMAILER_LANG['instantiate']          = 'Kon mailfunctie niet initialiseren.';
+$PHPMAILER_LANG['invalid_address']      = 'Ongeldig adres: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
+$PHPMAILER_LANG['provide_address']      = 'Er moet minstens één ontvanger worden opgegeven.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';
+$PHPMAILER_LANG['signing']              = 'Signeerfout: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Verbinding mislukt.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP-serverfout: ';
+$PHPMAILER_LANG['variable_set']         = 'Kan de volgende variabele niet instellen of resetten: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index bf2f84e..383dd51 100755 (executable)
@@ -1,25 +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
+<?php
+/**
+ * Norwegian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Feil: Kunne ikke autentisere.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Feil: Kunne ikke koble til SMTP tjener.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Feil: Data ble ikke akseptert.';
+$PHPMAILER_LANG['empty_message']        = 'Meldingsinnholdet er tomt';
+$PHPMAILER_LANG['encoding']             = 'Ukjent tegnkoding: ';
+$PHPMAILER_LANG['execute']              = 'Kunne ikke utføre: ';
+$PHPMAILER_LANG['file_access']          = 'Får ikke tilgang til filen: ';
+$PHPMAILER_LANG['file_open']            = 'Fil feil: Kunne ikke åpne filen: ';
+$PHPMAILER_LANG['from_failed']          = 'Følgende avsenderadresse feilet: ';
+$PHPMAILER_LANG['instantiate']          = 'Kunne ikke initialisere mailfunksjonen.';
+$PHPMAILER_LANG['invalid_address']      = 'Meldingen ble ikke sendt, følgende adresse er ugyldig: ';
+$PHPMAILER_LANG['provide_address']      = 'Du må angi minst en mottakeradresse.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feil: Følgende mottagere feilet: ';
+$PHPMAILER_LANG['signing']              = 'Signeringsfeil: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() feilet.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP-serverfeil: ';
+$PHPMAILER_LANG['variable_set']         = 'Kan ikke sette eller resette variabelen: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index e8bd512..991914f 100644 (file)
@@ -1,25 +1,26 @@
-<?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
+<?php
+/**
+ * Polish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
+$PHPMAILER_LANG['connect_host']         = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Błąd SMTP: Dane nie zostały przyjęte.';
+$PHPMAILER_LANG['empty_message']        = 'Wiadomość jest pusta.';
+$PHPMAILER_LANG['encoding']             = 'Nieznany sposób kodowania znaków: ';
+$PHPMAILER_LANG['execute']              = 'Nie można uruchomić: ';
+$PHPMAILER_LANG['file_access']          = 'Brak dostępu do pliku: ';
+$PHPMAILER_LANG['file_open']            = 'Nie można otworzyć pliku: ';
+$PHPMAILER_LANG['from_failed']          = 'Następujący adres Nadawcy jest nieprawidłowy: ';
+$PHPMAILER_LANG['instantiate']          = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
+$PHPMAILER_LANG['invalid_address']      = 'Nie można wysłać wiadomości, '.
+    'następujący adres Odbiorcy jest nieprawidłowy: ';
+$PHPMAILER_LANG['provide_address']      = 'Należy podać prawidłowy adres email Odbiorcy.';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
+$PHPMAILER_LANG['recipients_failed']    = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
+$PHPMAILER_LANG['signing']              = 'Błąd podpisywania wiadomości: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() zakończone niepowodzeniem.';
+$PHPMAILER_LANG['smtp_error']           = 'Błąd SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Nie można ustawić lub zmodyfikować zmiennej: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pt.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-pt.php
new file mode 100644 (file)
index 0000000..f365d5d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Portuguese (European) PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Jonadabe <jonadabe@hotmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Erro do SMTP: Não foi possível realizar a autenticação.';
+$PHPMAILER_LANG['connect_host']         = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Erro do SMTP: Os dados foram rejeitados.';
+$PHPMAILER_LANG['empty_message']        = 'A mensagem no e-mail está vazia.';
+$PHPMAILER_LANG['encoding']             = 'Codificação desconhecida: ';
+$PHPMAILER_LANG['execute']              = 'Não foi possível executar: ';
+$PHPMAILER_LANG['file_access']          = 'Não foi possível aceder o ficheiro: ';
+$PHPMAILER_LANG['file_open']            = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
+$PHPMAILER_LANG['from_failed']          = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
+$PHPMAILER_LANG['instantiate']          = 'Não foi possível iniciar uma instância da função mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
+$PHPMAILER_LANG['provide_address']      = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
+$PHPMAILER_LANG['recipients_failed']    = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
+$PHPMAILER_LANG['signing']              = 'Erro ao assinar: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falhou.';
+$PHPMAILER_LANG['smtp_error']           = 'Erro de servidor SMTP: ';
+$PHPMAILER_LANG['variable_set']         = 'Não foi possível definir ou redefinir a variável: ';
+$PHPMAILER_LANG['extension_missing']    = 'Extensão em falta: ';
index 17cddb7..cf37cc1 100644 (file)
@@ -1,27 +1,26 @@
-<?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
+<?php
+/**
+ * Romanian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Catalin Constantin <catalin@dazoot.ro>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Eroare SMTP: Nu a functionat autentificarea.';
+$PHPMAILER_LANG['connect_host']         = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
+$PHPMAILER_LANG['empty_message']        = 'Mesajul este gol.';
+$PHPMAILER_LANG['encoding']             = 'Encodare necunoscuta: ';
+$PHPMAILER_LANG['execute']              = 'Nu pot executa:  ';
+$PHPMAILER_LANG['file_access']          = 'Nu pot accesa fisierul: ';
+$PHPMAILER_LANG['file_open']            = 'Eroare de fisier: Nu pot deschide fisierul: ';
+$PHPMAILER_LANG['from_failed']          = 'Urmatoarele adrese From au dat eroare: ';
+$PHPMAILER_LANG['instantiate']          = 'Nu am putut instantia functia mail.';
+$PHPMAILER_LANG['invalid_address']      = 'Adresa de email nu este valida: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
+$PHPMAILER_LANG['provide_address']      = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
+$PHPMAILER_LANG['recipients_failed']    = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
+$PHPMAILER_LANG['signing']              = 'A aparut o problema la semnarea emailului. ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Conectarea la serverul SMTP a esuat.';
+$PHPMAILER_LANG['smtp_error']           = 'A aparut o eroare la serverul SMTP. ';
+$PHPMAILER_LANG['variable_set']         = 'Nu se poate seta/reseta variabila. ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 295a56e..50020d5 100644 (file)
@@ -1,25 +1,27 @@
-<?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
+<?php
+/**
+ * Russian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Alexey Chumakov <alex@chumakov.ru>
+ * @author Foster Snowhill <i18n@forstwoof.ru>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Ошибка SMTP: ошибка авторизации.';
+$PHPMAILER_LANG['connect_host']         = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Ошибка SMTP: данные не приняты.';
+$PHPMAILER_LANG['encoding']             = 'Неизвестный вид кодировки: ';
+$PHPMAILER_LANG['execute']              = 'Невозможно выполнить команду: ';
+$PHPMAILER_LANG['file_access']          = 'Нет доступа к файлу: ';
+$PHPMAILER_LANG['file_open']            = 'Файловая ошибка: не удается открыть файл: ';
+$PHPMAILER_LANG['from_failed']          = 'Неверный адрес отправителя: ';
+$PHPMAILER_LANG['instantiate']          = 'Невозможно запустить функцию mail.';
+$PHPMAILER_LANG['provide_address']      = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
+$PHPMAILER_LANG['recipients_failed']    = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
+$PHPMAILER_LANG['empty_message']        = 'Пустое тело сообщения';
+$PHPMAILER_LANG['invalid_address']      = 'Не отослано, неправильный формат email адреса: ';
+$PHPMAILER_LANG['signing']              = 'Ошибка подписывания: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Ошибка соединения с SMTP-сервером';
+$PHPMAILER_LANG['smtp_error']           = 'Ошибка SMTP-сервера: ';
+$PHPMAILER_LANG['variable_set']         = 'Невозможно установить или переустановить переменную: ';
+$PHPMAILER_LANG['extension_missing']    = 'Расширение отсутствует: ';
index d459667..2c9ecec 100755 (executable)
@@ -1,26 +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
+<?php
+/**
+ * Swedish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Johan Linnér <johan@linner.biz>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP fel: Kunde inte autentisera.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fel: Data accepterades inte.';
+//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
+$PHPMAILER_LANG['encoding']             = 'Okänt encode-format: ';
+$PHPMAILER_LANG['execute']              = 'Kunde inte köra: ';
+$PHPMAILER_LANG['file_access']          = 'Ingen åtkomst till fil: ';
+$PHPMAILER_LANG['file_open']            = 'Fil fel: Kunde inte öppna fil: ';
+$PHPMAILER_LANG['from_failed']          = 'Följande avsändaradress är felaktig: ';
+$PHPMAILER_LANG['instantiate']          = 'Kunde inte initiera e-postfunktion.';
+//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
+$PHPMAILER_LANG['provide_address']      = 'Du måste ange minst en mottagares e-postadress.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP fel: Följande mottagare är felaktig: ';
+//$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: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sk.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sk.php
new file mode 100644 (file)
index 0000000..a38f4e5
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Slovak PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Michal Tinka <michaltinka@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Chyba autentifikácie.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Dáta neboli prijaté';
+$PHPMAILER_LANG['empty_message']        = 'Prázdne telo správy.';
+$PHPMAILER_LANG['encoding']             = 'Neznáme kódovanie: ';
+$PHPMAILER_LANG['execute']              = 'Nedá sa vykonať: ';
+$PHPMAILER_LANG['file_access']          = 'Súbor nebol nájdený: ';
+$PHPMAILER_LANG['file_open']            = 'File Error: Súbor sa otvoriť pre čítanie: ';
+$PHPMAILER_LANG['from_failed']          = 'Následujúca adresa From je nesprávna: ';
+$PHPMAILER_LANG['instantiate']          = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
+$PHPMAILER_LANG['invalid_address']      = 'Neodoslané, emailová adresa je nesprávna: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
+$PHPMAILER_LANG['provide_address']      = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: Adresy príjemcov niesu správne ';
+$PHPMAILER_LANG['signing']              = 'Chyba prihlasovania: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() zlyhalo.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP chyba serveru: ';
+$PHPMAILER_LANG['variable_set']         = 'Nemožno nastaviť alebo resetovať premennú: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sl.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sl.php
new file mode 100644 (file)
index 0000000..54c9572
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Slovene PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Klemen Tušar <techouse@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP napaka: Avtentikacija ni uspela.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP napaka: Ne morem vzpostaviti povezave s SMTP gostiteljem.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP napaka: Strežnik zavrača podatke.';
+$PHPMAILER_LANG['empty_message']        = 'E-poštno sporočilo nima vsebine.';
+$PHPMAILER_LANG['encoding']             = 'Nepoznan tip kodiranja: ';
+$PHPMAILER_LANG['execute']              = 'Operacija ni uspela: ';
+$PHPMAILER_LANG['file_access']          = 'Nimam dostopa do datoteke: ';
+$PHPMAILER_LANG['file_open']            = 'Ne morem odpreti datoteke: ';
+$PHPMAILER_LANG['from_failed']          = 'Neveljaven e-naslov pošiljatelja: ';
+$PHPMAILER_LANG['instantiate']          = 'Ne morem inicializirati mail funkcije.';
+$PHPMAILER_LANG['invalid_address']      = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
+$PHPMAILER_LANG['provide_address']      = 'Prosim vnesite vsaj enega naslovnika.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
+$PHPMAILER_LANG['signing']              = 'Napaka pri podpisovanju: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';
+$PHPMAILER_LANG['smtp_error']           = 'Napaka SMTP strežnika: ';
+$PHPMAILER_LANG['variable_set']         = 'Ne morem nastaviti oz. ponastaviti spremenljivke: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sr.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-sr.php
new file mode 100644 (file)
index 0000000..ed95ca6
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Serbian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Александар Јевремовић <ajevremovic@gmail.com>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP грешка: аутентификација није успела.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP грешка: није могуће повезивање са SMTP сервером.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP грешка: подаци нису прихваћени.';
+$PHPMAILER_LANG['empty_message']        = 'Садржај поруке је празан.';
+$PHPMAILER_LANG['encoding']             = 'Непознато кодовање: ';
+$PHPMAILER_LANG['execute']              = 'Није могуће извршити наредбу: ';
+$PHPMAILER_LANG['file_access']          = 'Није могуће приступити датотеци: ';
+$PHPMAILER_LANG['file_open']            = 'Није могуће отворити датотеку: ';
+$PHPMAILER_LANG['from_failed']          = 'SMTP грешка: слање са следећих адреса није успело: ';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP грешка: слање на следеће адресе није успело: ';
+$PHPMAILER_LANG['instantiate']          = 'Није могуће покренути mail функцију.';
+$PHPMAILER_LANG['invalid_address']      = 'Порука није послата због неисправне адресе: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.';
+$PHPMAILER_LANG['provide_address']      = 'Потребно је задати најмање једну адресу.';
+$PHPMAILER_LANG['signing']              = 'Грешка приликом пријављивања: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Повезивање са SMTP сервером није успело.';
+$PHPMAILER_LANG['smtp_error']           = 'Грешка SMTP сервера: ';
+$PHPMAILER_LANG['variable_set']         = 'Није могуће задати променљиву, нити је вратити уназад: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index 8a069d1..323fb4b 100755 (executable)
@@ -1,27 +1,29 @@
-<?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
+<?php
+/**
+ * Turkish PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Elçin Özel
+ * @author Can Yılmaz
+ * @author Mehmet Benlioğlu
+ * @author @yasinaydin
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'SMTP Hatası: Oturum açılamadı.';
+$PHPMAILER_LANG['connect_host']         = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Hatası: Veri kabul edilmedi.';
+$PHPMAILER_LANG['empty_message']        = 'Mesajın içeriği boş';
+$PHPMAILER_LANG['encoding']             = 'Bilinmeyen karakter kodlama: ';
+$PHPMAILER_LANG['execute']              = 'Çalıştırılamadı: ';
+$PHPMAILER_LANG['file_access']          = 'Dosyaya erişilemedi: ';
+$PHPMAILER_LANG['file_open']            = 'Dosya Hatası: Dosya açılamadı: ';
+$PHPMAILER_LANG['from_failed']          = 'Belirtilen adreslere gönderme başarısız: ';
+$PHPMAILER_LANG['instantiate']          = 'Örnek e-posta fonksiyonu oluşturulamadı.';
+$PHPMAILER_LANG['invalid_address']      = 'Geçersiz e-posta adresi: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
+$PHPMAILER_LANG['provide_address']      = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
+$PHPMAILER_LANG['signing']              = 'İmzalama hatası: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP connect() fonksiyonu başarısız.';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP sunucu hatası: ';
+$PHPMAILER_LANG['variable_set']         = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-uk.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-uk.php
new file mode 100644 (file)
index 0000000..9a7b346
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Ukrainian PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author Yuriy Rudyy <yrudyy@prs.net.ua>
+ * @fixed by Boris Yurchenko <boris@yurchenko.pp.ua>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Помилка SMTP: помилка авторизації.';
+$PHPMAILER_LANG['connect_host']         = 'Помилка SMTP: не вдається під\'єднатися до серверу SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Помилка SMTP: дані не прийняті.';
+$PHPMAILER_LANG['encoding']             = 'Невідомий тип кодування: ';
+$PHPMAILER_LANG['execute']              = 'Неможливо виконати команду: ';
+$PHPMAILER_LANG['file_access']          = 'Немає доступу до файлу: ';
+$PHPMAILER_LANG['file_open']            = 'Помилка файлової системи: не вдається відкрити файл: ';
+$PHPMAILER_LANG['from_failed']          = 'Невірна адреса відправника: ';
+$PHPMAILER_LANG['instantiate']          = 'Неможливо запустити функцію mail.';
+$PHPMAILER_LANG['provide_address']      = 'Будь-ласка, введіть хоча б одну адресу e-mail отримувача.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
+$PHPMAILER_LANG['recipients_failed']    = 'Помилка SMTP: відправлення наступним отримувачам не вдалося: ';
+$PHPMAILER_LANG['empty_message']        = 'Пусте тіло повідомлення';
+$PHPMAILER_LANG['invalid_address']      = 'Не відправлено, невірний формат адреси e-mail: ';
+$PHPMAILER_LANG['signing']              = 'Помилка підпису: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Помилка з\'єднання із SMTP-сервером';
+$PHPMAILER_LANG['smtp_error']           = 'Помилка SMTP-сервера: ';
+$PHPMAILER_LANG['variable_set']         = 'Неможливо встановити або перевстановити змінну: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-vi.php b/www/plugins/facteur/phpmailer-php5/language/phpmailer.lang-vi.php
new file mode 100644 (file)
index 0000000..c60dade
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
+ * @package PHPMailer
+ * @author VINADES.,JSC <contact@vinades.vn>
+ */
+
+$PHPMAILER_LANG['authenticate']         = 'Lỗi SMTP: Không thể xác thực.';
+$PHPMAILER_LANG['connect_host']         = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
+$PHPMAILER_LANG['data_not_accepted']    = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
+$PHPMAILER_LANG['empty_message']        = 'Không có nội dung';
+$PHPMAILER_LANG['encoding']             = 'Mã hóa không xác định: ';
+$PHPMAILER_LANG['execute']              = 'Không thực hiện được: ';
+$PHPMAILER_LANG['file_access']          = 'Không thể truy cập tệp tin ';
+$PHPMAILER_LANG['file_open']            = 'Lỗi Tập tin: Không thể mở tệp tin: ';
+$PHPMAILER_LANG['from_failed']          = 'Lỗi địa chỉ gửi đi: ';
+$PHPMAILER_LANG['instantiate']          = 'Không dùng được các hàm gửi thư.';
+$PHPMAILER_LANG['invalid_address']      = 'Đại chỉ emai không đúng: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
+$PHPMAILER_LANG['provide_address']      = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
+$PHPMAILER_LANG['recipients_failed']    = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
+$PHPMAILER_LANG['signing']              = 'Lỗi đăng nhập: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'Lỗi kết nối với SMTP';
+$PHPMAILER_LANG['smtp_error']           = 'Lỗi máy chủ smtp ';
+$PHPMAILER_LANG['variable_set']         = 'Không thể thiết lập hoặc thiết lập lại biến: ';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
index fef66f8..3e9e358 100755 (executable)
@@ -1,26 +1,28 @@
 <?php
 /**
-* PHPMailer language file: refer to English translation for definitive list
-* Traditional Chinese Version
-* @author liqwei <liqwei@liqwei.com>
-*/
+ * Traditional Chinese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author liqwei <liqwei@liqwei.com>
+ * @author Peter Dave Hello <@PeterDaveHello/>
+ * @author Jason Chiang <xcojad@gmail.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
+$PHPMAILER_LANG['authenticate']         = 'SMTP 錯誤:登入失敗。';
+$PHPMAILER_LANG['connect_host']         = 'SMTP 錯誤:無法連線到 SMTP 主機。';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 錯誤:無法接受的資料。';
+$PHPMAILER_LANG['empty_message']        = '郵件內容為空';
+$PHPMAILER_LANG['encoding']             = '未知編碼: ';
+$PHPMAILER_LANG['execute']              = '無法執行:';
+$PHPMAILER_LANG['file_access']          = '無法存取檔案:';
+$PHPMAILER_LANG['file_open']            = '檔案錯誤:無法開啟檔案:';
+$PHPMAILER_LANG['from_failed']          = '發送地址錯誤:';
+$PHPMAILER_LANG['instantiate']          = '未知函數呼叫。';
+$PHPMAILER_LANG['invalid_address']      = '因為電子郵件地址無效,無法傳送: ';
+$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。';
+$PHPMAILER_LANG['provide_address']      = '必須提供至少一個收件人地址。';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP 錯誤:以下收件人地址錯誤:';
+$PHPMAILER_LANG['signing']              = '電子簽章錯誤: ';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP 連線失敗';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP 伺服器錯誤: ';
+$PHPMAILER_LANG['variable_set']         = '無法設定或重設變數: ';
+$PHPMAILER_LANG['extension_missing']    = '遺失模組 Extension: ';
index b188404..d85a0b1 100755 (executable)
@@ -1,26 +1,27 @@
 <?php
 /**
-* PHPMailer language file: refer to English translation for definitive list
-* Simplified Chinese Version
-* @author liqwei <liqwei@liqwei.com>
-*/
+ * Simplified Chinese PHPMailer language file: refer to English translation for definitive list
+ * @package PHPMailer
+ * @author liqwei <liqwei@liqwei.com>
+ * @author young <masxy@foxmail.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['authenticate']         = 'SMTP 错误:登录失败。';
+$PHPMAILER_LANG['connect_host']         = 'SMTP 错误:无法连接到 SMTP 主机。';
+$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 错误:数据不被接受。';
+$PHPMAILER_LANG['empty_message']        = '邮件正文为空。';
+$PHPMAILER_LANG['encoding']             = '未知编码: ';
+$PHPMAILER_LANG['execute']              = '无法执行:';
+$PHPMAILER_LANG['file_access']          = '无法访问文件:';
+$PHPMAILER_LANG['file_open']            = '文件错误:无法打开文件:';
+$PHPMAILER_LANG['from_failed']          = '发送地址错误:';
+$PHPMAILER_LANG['instantiate']          = '未知函数调用。';
+$PHPMAILER_LANG['invalid_address']      = '发送失败,电子邮箱地址是无效的:';
 $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
+$PHPMAILER_LANG['provide_address']      = '必须提供至少一个收件人地址。';
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP 错误:收件人地址错误:';
+$PHPMAILER_LANG['signing']              = '登录失败:';
+$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP服务器连接失败。';
+$PHPMAILER_LANG['smtp_error']           = 'SMTP服务器出错: ';
+$PHPMAILER_LANG['variable_set']         = '无法设置或重置变量:';
+//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
diff --git a/www/plugins/facteur/phpmailer-php5/travis.phpunit.xml.dist b/www/plugins/facteur/phpmailer-php5/travis.phpunit.xml.dist
new file mode 100644 (file)
index 0000000..8edfd44
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit
+         verbose="false"
+         stopOnError="false"
+         stopOnFailure="false"
+         stopOnIncomplete="false"
+         stopOnSkipped="false"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         colors="false"
+         forceCoversAnnotation="false"
+         processIsolation="false">
+    <testsuites>
+        <testsuite name="PHPMailer Tests">
+            <directory>./test/</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <blacklist>
+            <directory suffix=".php">./extras</directory>
+        </blacklist>
+    </filter>
+    <groups>
+        <exclude>
+            <group>languages</group>
+        </exclude>
+    </groups>
+    <logging>
+        <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
+        <log type="coverage-clover" target="build/logs/clover.xml"/>
+        <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
+    </logging>
+</phpunit>
index 3669571..16f7af6 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/facteur/trunk
-Revision: 84587
-Dernier commit: 2014-09-13 14:12:08 +0200 
+Revision: 98944
+Dernier commit: 2016-07-19 09:19:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/facteur/trunk</origine>
-<revision>84587</revision>
-<commit>2014-09-13 14:12:08 +0200 </commit>
+<revision>98944</revision>
+<commit>2016-07-19 09:19:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 90a5f15..cfe9a86 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/config');
 
@@ -10,15 +12,16 @@ include_spip('inc/config');
  * @param unknown_type $arg
  * @return unknown_type
  */
-function action_dupliquer_formulaire_dist($arg=null) {
-       if (is_null($arg)){
+function action_dupliquer_formulaire_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
        $id_formulaire = intval($arg);
 
        // Si le formulaire existe bien
-       if ($id_formulaire > 0 and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id_formulaire)){
+       if ($id_formulaire > 0
+               and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id_formulaire)) {
                include_spip('action/editer_formulaire');
                // On enlève les champs inutiles
                unset($formulaire['id_formulaire']);
@@ -29,9 +32,10 @@ function action_dupliquer_formulaire_dist($arg=null) {
                // On insère un nouveau formulaire
                $id_formulaire = insert_formulaire();
                // Si ça a marché on modifie les champs de base
-               if ($id_formulaire > 0 and !($erreur = formulaire_set($id_formulaire, $formulaire))){
+               if ($id_formulaire > 0
+                       and !($erreur = formulaire_set($id_formulaire, $formulaire))) {
                        // Et ensuite les saisies et les traitements
-                       $ok = sql_updateq(
+                       sql_updateq(
                                'spip_formulaires',
                                array(
                                        'saisies' => $formulaire['saisies'],
@@ -49,22 +53,23 @@ function action_dupliquer_formulaire_dist($arg=null) {
                        }
                        // Et on redirige vers la vue
                        $redirect = parametre_url(generer_url_ecrire('formulaire'), 'id_formulaire', $id_formulaire, '&');
-               }
-               // Sinon on reste sur la page qui liste tout
-               else{
+               } else {
+                       // Sinon on reste sur la page qui liste tout
                        $redirect = generer_url_ecrire('formulaires');
                }
        }
 
        // Si on a précisé une direction on va plutôt là
        if (_request('redirect')) {
-               $redirect = parametre_url(urldecode(_request('redirect')),
-                       'id_formulaire', $id_formulaire, '&') . $erreur;
+               $redirect = parametre_url(
+                       urldecode(_request('redirect')),
+                       'id_formulaire',
+                       $id_formulaire,
+                       '&'
+               ) . $erreur;
        }
-       
+
        // On redirige
        include_spip('inc/headers');
        redirige_par_entete($redirect);
 }
-
-?>
index 13ec60a..4c601c5 100644 (file)
@@ -1,15 +1,17 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Action de création / Modification d'un formulaire
  * @param unknown_type $arg
  * @return unknown_type
  */
-function action_editer_formulaire_dist($arg=null) {
-       if (is_null($arg)){
+function action_editer_formulaire_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
@@ -20,17 +22,23 @@ function action_editer_formulaire_dist($arg=null) {
        }
 
        // Enregistre l'envoi dans la BD
-       if ($id_formulaire > 0) $err = formulaire_modifier($id_formulaire);
+       if ($id_formulaire > 0) {
+               $err = formulaire_modifier($id_formulaire);
+       }
 
        if (_request('redirect')) {
-               $redirect = parametre_url(urldecode(_request('redirect')),
-                       'id_formulaire', $id_formulaire, '&') . $err;
+               $redirect = parametre_url(
+                       urldecode(_request('redirect')),
+                       'id_formulaire',
+                       $id_formulaire,
+                       '&'
+               ) . $err;
 
                include_spip('inc/headers');
                redirige_par_entete($redirect);
-       }
-       else
+       } else {
                return array($id_formulaire,$err);
+       }
 }
 
 /**
@@ -44,7 +52,8 @@ function formulaire_inserer() {
                'date_creation' => date('Y-m-d H:i:s'),
        );
        // Envoyer aux plugins
-       $champs = pipeline('pre_insertion',
+       $champs = pipeline(
+               'pre_insertion',
                array(
                        'args' => array(
                                'table' => 'spip_formulaires',
@@ -52,9 +61,10 @@ function formulaire_inserer() {
                        'data' => $champs
                )
        );
-       $id_formulaire = sql_insertq("spip_formulaires", $champs);
+       $id_formulaire = sql_insertq('spip_formulaires', $champs);
 
-       pipeline('post_insertion',
+       pipeline(
+               'post_insertion',
                array(
                        'args' => array(
                                'table' => 'spip_formulaires',
@@ -74,14 +84,14 @@ function formulaire_inserer() {
  * @param array|null $set
  * @return string
  */
-function formulaire_modifier($id_formulaire, $set=null) {
+function formulaire_modifier($id_formulaire, $set = null) {
        include_spip('inc/modifier');
        include_spip('inc/filtres');
        $err = '';
 
        $c = collecter_requests(
                // white list
-               objet_info('formulaire','champs_editables'),
+               objet_info('formulaire', 'champs_editables'),
                // black list
                array('statut'),
                // donnees eventuellement fournies
@@ -90,24 +100,33 @@ function formulaire_modifier($id_formulaire, $set=null) {
 
 
        $invalideur = "id='id_formulaire/$id_formulaire'";
-       if ($err = objet_modifier_champs('formulaire', $id_formulaire,
+       if ($err = objet_modifier_champs(
+               'formulaire',
+               $id_formulaire,
                array(
+                       'data' => $set,
                        'nonvide' => array('titre' => _T('info_sans_titre')),
                        'invalideur' => $invalideur,
                ),
-               $c))
+               $c
+       )) {
                return $err;
+       }
 
        // Modification de statut, changement de rubrique ?
-       $c = collecter_requests(array('statut'),array(),$set);
-       include_spip("action/editer_objet");
-       $err = objet_instituer('formulaire',$id_formulaire, $c);
+       $c = collecter_requests(array('statut'), array(), $set);
+       include_spip('action/editer_objet');
+       $err = objet_instituer('formulaire', $id_formulaire, $c);
 
        return $err;
 }
 
-
-
-function revision_formulaire($id_formulaire, $c=false) { return formulaire_modifier($id_formulaire, $c);}
-function insert_formulaire() { return formulaire_inserer();}
-function formulaire_set($id_formulaire, $set=null) {   return formulaire_modifier($id_formulaire, $set);}
+function revision_formulaire($id_formulaire, $c = false) {
+       return formulaire_modifier($id_formulaire, $c);
+}
+function insert_formulaire() {
+       return formulaire_inserer();
+}
+function formulaire_set($id_formulaire, $set = null) {
+       return formulaire_modifier($id_formulaire, $set);
+}
diff --git a/www/plugins/formidable/action/exporter_analyse_reponses.php b/www/plugins/formidable/action/exporter_analyse_reponses.php
deleted file mode 100755 (executable)
index a4e7e92..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-
-// Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-/*
- * Exporter l'analyse des réponses d'un formulaire
- * @param unknown_type $arg
- * @return unknown_type
- */
-function action_exporter_analyse_reponses_dist($arg=null) {
-       if (is_null($arg)){
-               $securiser_action = charger_fonction('securiser_action', 'inc');
-               $arg = $securiser_action();
-       }
-
-       // on ne fait des choses seulements si le formulaire existe et qu'il a des enregistrements
-       $ok = false;
-       if (
-               $id_formulaire = intval($arg)
-               and $formulaire = sql_fetsel('*','spip_formulaires','id_formulaire = '.$id_formulaire)
-               and $reponses = sql_allfetsel('*', 'spip_formulaires_reponses', 'id_formulaire = '.$id_formulaire.' and statut = '.sql_quote('publie'))
-       ) {
-               include_spip('inc/saisies');
-               include_spip('classes/facteur');
-               include_spip('inc/filtres');
-        $reponses_completes = array();
-        
-        $saisies = saisies_lister_par_nom(unserialize($formulaire['saisies']), false);
-        
-        // exclure les champs non analysés
-        $traitement = unserialize($formulaire['traitements']);
-        foreach (explode("|",$traitement['enregistrement']['analyse_exclure_champs']) as $exclure){
-            unset($saisies[$exclure]);
-        }
-               $res = sql_select(
-            array('nom, valeur'),
-
-            'spip_formulaires_reponses_champs AS FRC,
-            spip_formulaires_reponses AS FR,
-            spip_formulaires AS F',
-
-            "FRC.id_formulaires_reponse=FR.id_formulaires_reponse
-            AND FR.statut='publie'
-            AND F.id_formulaire=FR.id_formulaire
-            AND F.id_formulaire=$id_formulaire"
-        );
-
-        $valeurs = array();
-        while($r = sql_fetch($res)) {
-            $valeurs[$r['nom']][] = is_array(unserialize($r['valeur']))
-                ? unserialize($r['valeur'])
-                : $r['valeur'];
-        }
-
-        foreach ($saisies as $nom=>$saisie){
-            $valeur = sql_getfetsel(
-                'valeur',
-                'spip_formulaires_reponses_champs',
-                'id_formulaires_reponse = '.intval($reponse['id_formulaires_reponse']).' and nom = '.sql_quote($nom)
-            );
-            if (is_array(unserialize($valeur)))
-                $valeur = unserialize($valeur);
-
-            $reponse_complete[] = formidable_analyser_saisie($saisie, $valeurs, 0, true);
-        }
-
-        $colonnes = array(_T('formidable:champs'), _T('formidable:sans_reponses'));
-        foreach($reponse_complete as $reponses) {
-            foreach($reponses as $key => $reponse) {
-                if ($key == 'header' || $key == 'sans_reponse') continue;
-                if (in_array($key, $colonnes) == false)
-                    array_push($colonnes, $key);
-            }
-        }
-
-        $csv = array();
-        foreach($reponse_complete as $reponses) {
-            foreach($colonnes as $colonne) {
-                $csv[$reponses['header']][$colonne] =
-                    isset($reponses[$colonne])
-                        ? $reponses[$colonne]
-                        : '';
-            }
-            $csv[$reponses['header']][_T('formidable:champs')] = $reponses['header'];
-            $csv[$reponses['header']][_T('formidable:sans_reponses')]
-                = $reponses['formidable:sans_reponse'];
-        }
-
-        $cpt_ligne = 1;
-        $reponses_completes = array();
-        $reponses_completes[0] = $colonnes;
-        foreach($csv as $ligne => $colonnes) {
-            $cpt_colonne = 0;
-            foreach($colonnes as $colonne) {
-                $reponses_completes[$cpt_ligne][$cpt_colonne++] = $colonne;
-            }
-            $cpt_ligne++;
-        }
-
-               if ($reponses_completes and $exporter_csv = charger_fonction('exporter_csv', 'inc/', true)){
-                       $exporter_csv('analyses-formulaire-'.$formulaire['identifiant'], $reponses_completes);
-                       exit();
-               }
-       }
-}
-
-?>
index 8b5e662..d32fa50 100644 (file)
@@ -1,24 +1,24 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function action_exporter_formulaire_dist($arg=null){
+function action_exporter_formulaire_dist($arg = null) {
        include_spip('inc/formidable');
-       if (is_null($arg)){
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
-       
+
        list($id_formulaire, $type_export) = preg_split('/[\W]/', $arg);
-       
+
        if ($id_formulaire > 0
                and $type_export
                and $types_echange = echanges_formulaire_lister_disponibles()
                and $exporter = $types_echange['exporter'][$type_export]
-       ){
+       ) {
                $exporter($id_formulaire);
        }
 }
-
-?>
diff --git a/www/plugins/formidable/action/exporter_formulaires_reponses.php b/www/plugins/formidable/action/exporter_formulaires_reponses.php
deleted file mode 100644 (file)
index 2330710..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-
-// Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-/*
- * Exporter toutes les réponses d'un formulaire
- * @param unknown_type $arg
- * @return unknown_type
- */
-function action_exporter_formulaires_reponses_dist($arg=null) {
-       if (is_null($arg)){
-               $securiser_action = charger_fonction('securiser_action', 'inc');
-               $arg = $securiser_action();
-       }
-
-       // on ne fait des choses seulements si le formulaire existe et qu'il a des enregistrements
-       $ok = false;
-       if (
-               $id_formulaire = intval($arg)
-               and $formulaire = sql_fetsel('*','spip_formulaires','id_formulaire = '.$id_formulaire)
-               and $reponses = sql_allfetsel('*', 'spip_formulaires_reponses', 'id_formulaire = '.$id_formulaire.' and statut = '.sql_quote('publie'))
-       ) {
-               include_spip('inc/saisies');
-               include_spip('classes/facteur');
-               include_spip('inc/filtres');
-               $reponses_completes = array();
-               
-               // La première ligne des titres
-               $titres = array(_T('public:date'), _T('formidable:reponses_auteur'), _T('formidable:reponses_ip'));
-               $saisies = saisies_lister_par_nom(unserialize($formulaire['saisies']), false);
-               foreach ($saisies as $nom=>$saisie){
-                       $options = $saisie['options'];
-                       $titres[] = sinon($options['label_case'], sinon($options['label'], $nom));
-               }
-               $reponses_completes[] = $titres;
-               
-               // On parcourt chaque réponse
-               foreach ($reponses as $reponse){
-                       // Est-ce qu'il y a un auteur avec un nom
-                       $nom_auteur = '';
-                       if ($id_auteur = intval($reponse['id_auteur'])){
-                               $nom_auteur = sql_getfetsel('nom', 'spip_auteurs', 'id_auteur = '.$id_auteur);
-                       }
-                       if (!$nom_auteur) $nom_auteur = '';
-                       
-                       // Le début de la réponse avec les infos (date, auteur, etc)
-                       $reponse_complete = array($reponse['date'], $nom_auteur, $reponse['ip']);
-                       
-                       // Ensuite tous les champs
-                       foreach ($saisies as $nom=>$saisie){
-                               $valeur = sql_getfetsel(
-                                       'valeur',
-                                       'spip_formulaires_reponses_champs',
-                                       'id_formulaires_reponse = '.intval($reponse['id_formulaires_reponse']).' and nom = '.sql_quote($nom)
-                               );
-                               if (is_array(unserialize($valeur)))
-                                       $valeur = unserialize($valeur);
-                               $reponse_complete[] = Facteur::html2text(
-                                       recuperer_fond(
-                                               'saisies-vues/_base',
-                                               array_merge(
-                                                       array(
-                                                               'valeur_uniquement' => 'oui',
-                                                               'type_saisie' => $saisie['saisie'],
-                                                               'valeur' => $valeur
-                                                       ),
-                                                       $saisie['options']
-                                               )
-                                       )
-                               );
-                       }
-                       
-                       // On ajoute la ligne à l'ensemble des réponses
-                       $reponses_completes[] = $reponse_complete;
-               }
-               
-               if ($reponses_completes and $exporter_csv = charger_fonction('exporter_csv', 'inc/', true)){
-                       $exporter_csv('reponses-formulaire-'.$formulaire['identifiant'], $reponses_completes);
-                       exit();
-               }
-       }
-}
-
-?>
index 36fafcc..00dbc40 100644 (file)
@@ -1,28 +1,25 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Action de suppression d'un formulaire
  * @param int $arg
  * @return unknown_type
  */
-function action_supprimer_formulaire_dist($arg=null) {
-       if (is_null($arg)){
+function action_supprimer_formulaire_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
 
        // si id_formulaire n'est pas un nombre, on ne fait rien
        if ($id_formulaire = intval($arg)) {
-
-               $set = array('statut'=>'poubelle');
-               include_spip("action/editer_formulaire");
-               formulaire_modifier($id_formulaire,$set);
-
+               $set = array('statut' => 'poubelle');
+               include_spip('action/editer_formulaire');
+               formulaire_modifier($id_formulaire, $set);
        }
-
 }
-
-?>
index 5f8759e..985e01f 100644 (file)
@@ -1,28 +1,25 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Action de suppression d'une réponse
  * @param int $arg
  * @return unknown_type
  */
-function action_supprimer_formulaires_reponse_dist($arg=null) {
-       if (is_null($arg)){
+function action_supprimer_formulaires_reponse_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
 
        // si id_formulaires_reponse n'est pas un nombre, on ne fait rien
        if ($id_formulaires_reponse = intval($arg)) {
-
-               include_spip("action/editer_objet");
-               $set = array('statut'=>'refuse');
-               objet_modifier('formulaires_reponse',$id_formulaires_reponse,$set);
-
+               include_spip('action/editer_objet');
+               $set = array('statut' => 'refuse');
+               objet_modifier('formulaires_reponse', $id_formulaires_reponse, $set);
        }
-       
 }
-
-?>
index 41de12a..8ab7bb8 100644 (file)
@@ -1,37 +1,37 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /*
  * Action de suppression des réponses à un formulaire
  * @param int $arg
  * @return unknown_type
  */
-function action_vider_formulaire_dist($arg=null) {
-       if (is_null($arg)){
+function action_vider_formulaire_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
 
+       include_spip('inc/autoriser');
        // si id_formulaires_reponse n'est pas un nombre, on ne fait rien
-       if ($id_formulaire = intval($arg)) {
-               // On supprime les réponse (statut => poubelle
-               $ok = sql_update(
+       if ($id_formulaire = intval($arg)
+               and autoriser('instituer', 'formulairesreponse', $id_formulaire)) {
+               // On supprime les réponse (statut => refuse)
+               $ok = sql_updateq(
                        'spip_formulaires_reponses',
-                       array('statut' => sql_quote('poubelle')),
-                       'id_formulaire = '.$id_formulaire
+                       array('statut' => 'refuse'),
+                       'id_formulaire=' . intval($id_formulaire)
                );
-       }
-       
-       if ($ok) {
-               /* on n'a plus de réponses à montrer, retour vers la page du formulaire */
-               if (!$redirect = _request('redirect'))
-                       $redirect = parametre_url(generer_url_ecrire('formulaire'), 'id_formulaire', $id_formulaire);
-               
-               include_spip('inc/headers');
-               redirige_par_entete(str_replace("&amp;","&",urldecode($redirect)));
+
+               if ($ok) {
+                       /* on n'a plus de réponses à montrer, retour vers la page du formulaire */
+                       if (!$redirect = _request('redirect')) {
+                               $GLOBALS['redirect'] = parametre_url(generer_url_ecrire('formulaire'), 'id_formulaire', $id_formulaire);
+                       }
+               }
        }
 }
-
-?>
index 5ab76da..cfecc5e 100644 (file)
@@ -2,18 +2,20 @@
 
 /**
  * Déclarations relatives à la base de données
- * 
+ *
  * @package SPIP\Formidable\Pipelines
 **/
 
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Déclarer les interfaces des tables de formidable pour le compilateur
- * 
+ *
  * @pipeline declarer_tables_interfaces
- * 
+ *
  * @param array $interfaces
  *     Déclarations d'interface pour le compilateur
  * @return array
@@ -56,27 +58,32 @@ function formidable_declarer_tables_objets_sql($tables) {
                'info_aucun_objet'=> 'formidable:info_aucun_formulaire',
                'info_1_objet' => 'formidable:info_1_formulaire',
                'info_nb_objets' => 'formidable:info_nb_formulaires',
+               'texte_creer_associer' => 'formidable:liens_creer_associer',
+               'texte_ajouter' => 'formidable:liens_ajouter',
 
-               'champs_editables' => array('titre', 'identifiant', 'descriptif','message_retour', 'saisies', 'traitements', 'public','apres','url_redirect','resume_reponse'),
-               'champs_versionnes' => array('titre', 'identifiant', 'descriptif','message_retour', 'saisies', 'traitements', 'public','apres','url_redirect','resume_reponse'),
+               'champs_editables' => array('titre', 'identifiant', 'descriptif', 'css', 'message_retour', 'saisies', 'traitements', 'public','apres','unicite','message_erreur_unicite','url_redirect','resume_reponse'),
+               'champs_versionnes' => array('titre', 'identifiant', 'descriptif', 'css', 'message_retour', 'saisies', 'traitements', 'public','apres','unicite','message_erreur_unicite','url_redirect','resume_reponse'),
                'field' => array(
-                       "id_formulaire" => "bigint(21) NOT NULL",
-                       "identifiant" => "varchar(200)",
-                       "titre" => "text NOT NULL default ''",
-                       "descriptif" => "text",
-                       "message_retour" => "text NOT NULL default ''",
-                       "saisies" => "longtext NOT NULL default ''",
-                       "traitements" => "text NOT NULL default ''",
-                       "public" => "enum('non', 'oui') DEFAULT 'non' NOT NULL",
-                       "apres" => "varchar(12) NOT NULL default ''",
-                       "url_redirect" => "varchar(255)",
-                       "statut" => "varchar(10) NOT NULL default ''",
-                       "resume_reponse" => "text NOT NULL default ''",
-                       "date_creation" => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
-                       "maj" => "timestamp",
+                       'id_formulaire' => 'bigint(21) NOT NULL',
+                       'identifiant' => 'varchar(200)',
+                       'titre' => "text NOT NULL default ''",
+                       'descriptif' => 'text',
+                       'css' => 'varchar(255) not null default ""',
+                       'message_retour' => "text NOT NULL default ''",
+                       'saisies' => "longtext NOT NULL default ''",
+                       'traitements' => "text NOT NULL default ''",
+                       'public' => "enum('non', 'oui') DEFAULT 'non' NOT NULL",
+                       'apres' => "varchar(12) NOT NULL default ''",
+                       'unicite' => "text NOT NULL default ''",
+                       'message_erreur_unicite' => "text NOT NULL default ''",
+                       'url_redirect' => 'varchar(255)',
+                       'statut' => "varchar(10) NOT NULL default ''",
+                       'resume_reponse' => "text NOT NULL default ''",
+                       'date_creation' => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
+                       'maj' => 'timestamp',
                ),
                'key' => array(
-                       "PRIMARY KEY" => "id_formulaire"
+                       'PRIMARY KEY' => 'id_formulaire'
                ),
                'join'=> array(
                        'id_formulaire' => 'id_formulaire'
@@ -110,7 +117,10 @@ function formidable_declarer_tables_objets_sql($tables) {
        );
 
        $tables['spip_formulaires_reponses'] = array(
+               'type_objet'=>'formulaires_reponse',
+               'table_objet_surnoms' => array('formulairesreponse'),
                'type'=>'formulaires_reponse',
+               'type_surnoms' => array('formulairesreponse'),
                'titre' => "'' AS titre, '' AS lang",
                'date' => 'date',
                'principale' => 'oui',
@@ -119,20 +129,20 @@ function formidable_declarer_tables_objets_sql($tables) {
                'info_nb_objets' => 'formidable:info_nb_reponses',
 
                'field' => array(
-                       "id_formulaires_reponse" => "bigint(21) NOT NULL",
-                       "id_formulaire" => "bigint(21) NOT NULL default 0",
-                       "date" => "datetime NOT NULL default '0000-00-00 00:00:00'",
-                       "ip" => "varchar(255) NOT NULL default ''",
-                       "id_auteur" => "bigint(21) NOT NULL default 0",
-                       "cookie" => "varchar(255) NOT NULL default ''",
-                       "statut" => "varchar(10) NOT NULL default ''",
-                       "maj" => "timestamp"
+                       'id_formulaires_reponse' => 'bigint(21) NOT NULL',
+                       'id_formulaire' => 'bigint(21) NOT NULL default 0',
+                       'date' => "datetime NOT NULL default '0000-00-00 00:00:00'",
+                       'ip' => "varchar(255) NOT NULL default ''",
+                       'id_auteur' => 'bigint(21) NOT NULL default 0',
+                       'cookie' => "varchar(255) NOT NULL default ''",
+                       'statut' => "varchar(10) NOT NULL default ''",
+                       'maj' => 'timestamp'
                ),
                'key' => array(
-                       "PRIMARY KEY" => "id_formulaires_reponse",
-                       "KEY id_formulaire" => "id_formulaire",
-                       "KEY id_auteur" => "id_auteur",
-                       "KEY cookie" => "cookie"
+                       'PRIMARY KEY' => 'id_formulaires_reponse',
+                       'KEY id_formulaire' => 'id_formulaire',
+                       'KEY id_auteur' => 'id_auteur',
+                       'KEY cookie' => 'cookie'
                ),
                'join' => array(
                        'id_formulaires_reponse' => 'id_formulaires_reponse',
@@ -175,27 +185,27 @@ function formidable_declarer_tables_objets_sql($tables) {
  * @return array
  *     Description complétée des tables
 **/
-function formidable_declarer_tables_principales($tables_principales){
+function formidable_declarer_tables_principales($tables_principales) {
 
-       // Table formulaires_reponses_champs 
+       // Table formulaires_reponses_champs
        $formulaires_reponses_champs = array(
-               "id_formulaires_reponses_champ" => "bigint(21) NOT NULL",
-               "id_formulaires_reponse" => "bigint(21) NOT NULL default 0",
-               "nom" => "varchar(255) NOT NULL default ''",
-               "valeur" => "text NOT NULL DEFAULT ''",
-               "maj" => "timestamp"
+               'id_formulaires_reponses_champ' => 'bigint(21) NOT NULL',
+               'id_formulaires_reponse' => 'bigint(21) NOT NULL default 0',
+               'nom' => "varchar(255) NOT NULL default ''",
+               'valeur' => "text NOT NULL DEFAULT ''",
+               'maj' => 'timestamp'
        );
        $formulaires_reponses_champs_cles = array(
-               "PRIMARY KEY" => "id_formulaires_reponses_champ",
-               "KEY id_formulaires_reponse" => "id_formulaires_reponse",
-               "KEY nom" => "nom",
-               "UNIQUE reponse" => "id_formulaires_reponse,nom",
+               'PRIMARY KEY' => 'id_formulaires_reponses_champ',
+               'KEY id_formulaires_reponse' => 'id_formulaires_reponse',
+               'KEY nom' => 'nom',
+               'UNIQUE reponse' => 'id_formulaires_reponse,nom',
        );
        $tables_principales['spip_formulaires_reponses_champs'] = array(
                'field' => &$formulaires_reponses_champs,
                'key' => &$formulaires_reponses_champs_cles
        );
-       
+
        return $tables_principales;
 }
 
@@ -208,26 +218,22 @@ function formidable_declarer_tables_principales($tables_principales){
  * @return array
  *     Description complétée des tables
 **/
-function formidable_declarer_tables_auxiliaires($tables_auxiliaires){
+function formidable_declarer_tables_auxiliaires($tables_auxiliaires) {
        $formulaires_liens = array(
-               "id_formulaire" => "bigint(21) DEFAULT '0' NOT NULL",
-               "id_objet"      => "bigint(21) DEFAULT '0' NOT NULL",
-               "objet" => "VARCHAR (25) DEFAULT '' NOT NULL"
+               'id_formulaire' => "bigint(21) DEFAULT '0' NOT NULL",
+               'id_objet'      => "bigint(21) DEFAULT '0' NOT NULL",
+               'objet' => "VARCHAR (25) DEFAULT '' NOT NULL"
        );
 
        $formulaires_liens_cles = array(
-               "PRIMARY KEY" => "id_formulaire,id_objet,objet",
-               "KEY id_formulaire" => "id_formulaire"
+               'PRIMARY KEY' => 'id_formulaire,id_objet,objet',
+               'KEY id_formulaire' => 'id_formulaire'
        );
-       
+
        $tables_auxiliaires['spip_formulaires_liens'] = array(
                'field' => &$formulaires_liens,
                'key' => &$formulaires_liens_cles
        );
-       
+
        return $tables_auxiliaires;
 }
-
-
-
-?>
index 97650d4..0f18687 100644 (file)
-<?php\r
-\r
-// Sécurité\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-// Importation d'un formulaire forms&table\r
-\r
-function echanger_formulaire_forms_importer_dist($fichier){\r
-       include_spip('inc/xml');\r
-       $arbre = spip_xml_load($fichier, false);\r
-       \r
-       if ($arbre and is_array($arbre) and isset($arbre['forms'])){\r
-               foreach($arbre['forms'] as $forms){\r
-                       foreach ($forms['form'] as $form){\r
-                               $formulaire = array();\r
-\r
-                               $form_source = array(\r
-                                       'id_form' => intval(trim(spip_xml_aplatit($form['id_form']))),\r
-                                       'titre' => trim(spip_xml_aplatit($form['titre'])),\r
-                                       'descriptif' => trim(spip_xml_aplatit($form['descriptif'])),\r
-                                       'texte' => trim(spip_xml_aplatit($form['texte'])),\r
-                                       'email' => unserialize(trim(spip_xml_aplatit($form['email']))),\r
-                                       'moderation' => trim(spip_xml_aplatit($form['moderation'])),\r
-                                       'modifiable' => trim(spip_xml_aplatit($form['modifiable'])),\r
-                                       'multiple' => trim(spip_xml_aplatit($form['multiple'])),\r
-                                       'champconfirm' => trim(spip_xml_aplatit($form['champconfirm'])),\r
-                               );\r
-\r
-                               // configurer le formulaire (titre etc)\r
-                               forms_configure_formulaire($form_source,$formulaire);\r
-\r
-                               // ajouter les champs de saisies\r
-                               foreach($form['fields'] as $fields){\r
-                                       foreach($fields['field'] as $field){\r
-                                               $champ = array(\r
-                                                       'champ'=>trim(spip_xml_aplatit($field['champ'])),\r
-                                                       'titre'=>trim(spip_xml_aplatit($field['titre'])),\r
-                                                       'type'=>trim(spip_xml_aplatit($field['type'])),\r
-                                                       'obligatoire'=>trim(spip_xml_aplatit($field['obligatoire'])),\r
-                                                       'taille'=>trim(spip_xml_aplatit($field['taille'])),\r
-                                                       'extra_info'=>trim(spip_xml_aplatit($field['extra_info'])),\r
-                                                       'aide'=>trim(spip_xml_aplatit($field['aide'])),\r
-                                                       'saisie'=>trim(spip_xml_aplatit($field['saisie'])),\r
-                                               );\r
-\r
-                                               // Les choix pour les types select et multiple\r
-                                               if(isset($field['les_choix']) and is_array($field['les_choix'])){\r
-                                                       $champ['choix'] = array();\r
-                                                       foreach($field['les_choix'] as $les_choix){\r
-                                                               foreach($les_choix['un_choix'] as $un_choix){\r
-                                                                       $champ['choix'][] = array(\r
-                                                                               'choix'=>trim(spip_xml_aplatit($un_choix['choix'])),\r
-                                                                               'titre'=>trim(spip_xml_aplatit($un_choix['titre'])),\r
-                                                                       );\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-\r
-                                               if ($saisie = forms_champ_vers_saisie($champ))\r
-                                                       $formulaire['saisies'][] = $saisie;\r
-                                       }\r
-                               }\r
-                               \r
-                               // les traitements\r
-                               forms_configure_traitement_formulaire($form_source,$formulaire);\r
-                               $id_formulaire = forms_importe_en_base($formulaire);\r
-                       }\r
-               }\r
-       }\r
-       \r
-       if ($id_formulaire){\r
-               return $id_formulaire;\r
-       }\r
-       else{\r
-               return _T('formidable:erreur_importer_forms');\r
-       }\r
-}\r
-\r
-/**\r
- * Importer le tableau $formulaire en base\r
- * @param array $formulaire\r
- * @return bool|int\r
- */\r
-function forms_importe_en_base($formulaire){\r
-       include_spip('action/editer_formulaire');\r
-       // On insère un nouveau formulaire\r
-       // cas utilise par l'installation/import f&t\r
-       if (isset($formulaire['id_formulaire']) AND !sql_countsel("spip_formulaires","id_formulaire=".intval($formulaire['id_formulaire']))){\r
-               $champs = array(\r
-                       'id_formulaire' => $formulaire['id_formulaire'],\r
-                       'statut' => 'prop',\r
-                       'date_creation' => date('Y-m-d H:i:s'),\r
-               );\r
-               // Envoyer aux plugins\r
-               $champs = pipeline('pre_insertion',\r
-                       array(\r
-                               'args' => array(\r
-                                       'table' => 'spip_formulaires',\r
-                               ),\r
-                               'data' => $champs\r
-                       )\r
-               );\r
-               $id_formulaire = sql_insertq("spip_formulaires", $champs);\r
-\r
-               pipeline('post_insertion',\r
-                       array(\r
-                               'args' => array(\r
-                                       'table' => 'spip_formulaires',\r
-                                       'id_objet' => $id_formulaire\r
-                               ),\r
-                               'data' => $champs\r
-                       )\r
-               );\r
-       }\r
-       else\r
-               $id_formulaire = formulaire_inserer();\r
-\r
-       $formulaire['saisies'] = forms_regroupe_saisies_fieldset($formulaire['saisies']);\r
-\r
-       if (is_array($formulaire['saisies']))\r
-               $formulaire['saisies'] = serialize($formulaire['saisies']);\r
-       if (is_array($formulaire['traitements']))\r
-               $formulaire['traitements'] = serialize($formulaire['traitements']);\r
-\r
-       // si l'identifiant existe deja (multiples imports du meme form)\r
-       // le dater\r
-       if (sql_countsel("spip_formulaires","identifiant=".sql_quote($formulaire['identifiant']))){\r
-               $formulaire['identifiant'] .= "_".date('Ymd_His');\r
-       }\r
-\r
-       // Si ok on modifie les champs de base\r
-       if ($id_formulaire>0\r
-               AND !($erreur = formulaire_modifier($id_formulaire, $formulaire))){\r
-\r
-               return $id_formulaire;\r
-       }\r
-\r
-       return false;\r
-}\r
-\r
-/**\r
- * Configuration de l'objet formulaire formidable a partir du form f&t\r
- * @param array $form\r
- * @param array $formulaire\r
- */\r
-function forms_configure_formulaire($form,&$formulaire){\r
-\r
-       // Le titre\r
-       $formulaire['titre'] = ($form['titre'] ? $form['titre'] : _T('info_sans_titre'));\r
-\r
-       // Generer un identifiant\r
-       // si id_form fourni, on s'en sert\r
-       if (isset($form['id_form'])){\r
-               $formulaire['identifiant'] = "form_import_".$form['id_form'];\r
-       }\r
-       else {\r
-               $formulaire['identifiant'] = "form_import_".preg_replace(",\W,","_",strtolower($formulaire['titre']));\r
-       }\r
-\r
-       // Le descriptif\r
-       $formulaire['descriptif'] = (isset($form['descriptif']) ? $form['descriptif'] : '');\r
-\r
-       // Le message de retour si ok\r
-       $formulaire['message_retour'] = (isset($form['texte']) ? $form['texte'] : '');\r
-\r
-       if (!isset($formulaire['traitements']))\r
-               $formulaire['traitements'] = array();\r
-\r
-       if (!isset($formulaire['saisies']))\r
-               $formulaire['saisies'] = array();\r
-}\r
-\r
-/**\r
- * Configurer les traitements\r
- *\r
- * @param array $form\r
- * @param array $formulaire\r
- */\r
-function forms_configure_traitement_formulaire($form,&$formulaire){\r
-       // Le traitement email\r
-       if ($form['champconfirm']){\r
-               if (!isset($formulaire['traitements']['email']))\r
-                       $formulaire['traitements']['email'] = array();\r
-               $formulaire['traitements']['email']['champ_courriel_destinataire_form'] = $form['champconfirm'];\r
-       }\r
-\r
-       // $form['email'] est possiblement serialize\r
-       if (is_string($form['email']) AND $a=unserialize($form['email']))\r
-               $form['email'] = $a;\r
-       if (is_array($form['email'])){\r
-\r
-               if ($email_defaut = $form['email']['defaut']){\r
-                       if (!isset($formulaire['traitements']['email']))\r
-                               $formulaire['traitements']['email'] = array();\r
-                       $formulaire['traitements']['email']['destinataires_plus'] = $email_defaut;\r
-               }\r
-\r
-               // TODO email route : feature qui n'existe pas dans formidable\r
-               if ($route = $form['email']['route']){\r
-\r
-               }\r
-       }\r
-\r
-       // Le traitement enregistrement : toujours\r
-       $formulaire['traitements']['enregistrement'] = array(\r
-               'moderation' => ($form['moderation'] == 'priori') ? 'priori' : 'posteriori',\r
-               'modifiable' => ($form['modifiable'] == 'oui') ? 'on' : '',\r
-               'multiple' => ($form['multiple'] == 'non') ? '' : 'on'\r
-       );\r
-\r
-}\r
-\r
-\r
-/**\r
- * On a genere un fieldset pour chaque separateur de f&t\r
- * il faut le peupler avec les saisies qui le suivent\r
- *\r
- * @param array $saisies\r
- * @return array\r
- */\r
-function forms_regroupe_saisies_fieldset($saisies){\r
-       $s = array();\r
-       $ins = &$s;\r
-\r
-       foreach($saisies as $k=>$saisie){\r
-               if ($saisie['saisie']=='fieldset'){\r
-                       if (!isset($saisies[$k]['saisies']))\r
-                               $saisies[$k]['saisies'] = array();\r
-                       $ins = &$saisies[$k]['saisies'];\r
-                       $s[] = &$saisies[$k];\r
-               }\r
-               else\r
-                       $ins[] = &$saisies[$k];\r
-       }\r
-\r
-       return $s;\r
-}\r
-\r
-/**\r
- * Transforme un champ f&t en Saisie\r
- * @param array $champ\r
- *   string champ\r
- *   string titre\r
- *   string type\r
- *   string obligatoire\r
- *   string taille\r
- *   string aide\r
- *   string extra_info\r
- *   string saisie oui/non\r
- *   array choix\r
- *     string choix\r
- *     string titre\r
- * @return array|bool\r
- */\r
-function forms_champ_vers_saisie($champ){\r
-\r
-       // Le truc par défaut\r
-       $saisie = array(\r
-               'saisie' => 'input',\r
-               'options' => array('size'=>40)\r
-       );\r
-\r
-       // On essaye de traduire tous les types de champs\r
-       $type = $champ['type'];\r
-       switch ($type){\r
-               case 'texte':\r
-                       $saisie['saisie'] = 'textarea';\r
-                       unset($saisie['options']['size']);\r
-                       $saisie['options']['rows'] = 5;\r
-                       $saisie['options']['cols'] = 40;\r
-                       break;\r
-               case 'password':\r
-                       $saisie['options']['type'] = 'password';\r
-                       break;\r
-               case 'date':\r
-                       $saisie['saisie'] = 'date';\r
-                       $saisie['verifier'] = array(\r
-                               'type' => 'date'\r
-                       );\r
-                       break;\r
-               case 'num':\r
-               case 'monnaie':\r
-                       if (!isset($champ['taille']) OR !intval($taille = $champ['taille'])){\r
-                               $saisie['verifier'] = array(\r
-                                       'type' => 'entier'\r
-                               );\r
-                       }\r
-                       else {\r
-                               $saisie['verifier'] = array(\r
-                                       'type' => 'decimal'\r
-                               );\r
-                               $saisie['verifier']['options'] = array('nb_decimales' => $taille);\r
-                       }\r
-                       break;\r
-               case 'email':\r
-                       $saisie['verifier'] = array(\r
-                               'type' => 'email'\r
-                       );\r
-                       break;\r
-               case 'telephone':\r
-                       $saisie['verifier'] = array(\r
-                               'type' => 'telephone'\r
-                       );\r
-                       break;\r
-               case 'select':\r
-                       unset($saisie['options']['size']);\r
-                       $liste = $champ['extra_info'];\r
-                       if ($liste == 'radio')\r
-                               $saisie['saisie'] = 'radio';\r
-                       else\r
-                               $saisie['saisie'] = 'selection';\r
-                       break;\r
-               case 'multiple':\r
-                       $saisie['saisie'] = 'checkbox';\r
-                       unset($saisie['options']['size']);\r
-                       break;\r
-               case 'mot':\r
-                       $saisie['saisie'] = 'mot';\r
-                       $saisie['options']['id_groupe'] = $champ['extra_info'];\r
-                       unset($saisie['options']['size']);\r
-                       break;\r
-               case 'textestatique':\r
-                       $saisie['saisie'] = 'explication';\r
-                       unset($saisie['options']['size']);\r
-                       $saisie['options']['texte'] = $champ['titre'];\r
-                       unset($champ['titre']);\r
-                       unset($champ['aide']);\r
-                       break;\r
-               case 'separateur':\r
-                       $saisie['saisie'] = 'fieldset';\r
-                       $saisie['saisies'] = array();\r
-                       unset($saisie['options']['size']);\r
-                       break;\r
-               case 'fichier':\r
-                       // TODO saisie file NIY\r
-                       $saisie = null;\r
-                       break;\r
-       }\r
-\r
-       // On continue seulement si on a toujours une saisie\r
-       if (!$saisie)\r
-               return false;\r
-\r
-       // Les choix pour les types select et multiple\r
-       if(isset($champ['choix']) and is_array($champ['choix'])){\r
-               $saisie['options']['datas'] = array();\r
-               foreach($champ['choix'] as $un_choix){\r
-                       $choix = $un_choix['choix'];\r
-                       $titre = $un_choix['titre'];\r
-                       $saisie['options']['datas'][$choix] = $titre;\r
-               }\r
-       }\r
-\r
-       // Le nom\r
-       $saisie['options']['nom'] = $champ['champ'];\r
-\r
-       // Le label\r
-       if (isset($champ['titre']) AND $champ['titre'])\r
-               $saisie['options']['label'] = $champ['titre'];\r
-\r
-       // Obligatoire\r
-       if (isset($champ['obligatoire']) AND $champ['obligatoire'] == 'oui')\r
-               $saisie['options']['obligatoire'] = 'on';\r
-\r
-       // Explication éventuelle\r
-       if (isset($champ['aide']) AND $explication = $champ['aide'])\r
-               $saisie['options']['explication'] = $explication;\r
-\r
-       if (isset($champ['saisie']) AND $champ['saisie']=='non'){\r
-               $saisie['options']['disable'] = 'on';\r
-               // masquer en JS, fallback\r
-               $saisie['options']['afficher_si'] = 'false';\r
-       }\r
-\r
-       return $saisie;\r
-}\r
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+// Importation d'un formulaire forms&table
+
+function echanger_formulaire_forms_importer_dist($fichier) {
+       include_spip('inc/xml');
+       $arbre = spip_xml_load($fichier, false);
+
+       if ($arbre and is_array($arbre) and isset($arbre['forms'])) {
+               foreach ($arbre['forms'] as $forms) {
+                       foreach ($forms['form'] as $form) {
+                               $formulaire = array();
+                               $form_source = array(
+                                       'id_form' => intval(trim(spip_xml_aplatit($form['id_form']))),
+                                       'titre' => trim(spip_xml_aplatit($form['titre'])),
+                                       'descriptif' => trim(spip_xml_aplatit($form['descriptif'])),
+                                       'texte' => trim(spip_xml_aplatit($form['texte'])),
+                                       'email' => unserialize(trim(spip_xml_aplatit($form['email']))),
+                                       'moderation' => trim(spip_xml_aplatit($form['moderation'])),
+                                       'modifiable' => trim(spip_xml_aplatit($form['modifiable'])),
+                                       'multiple' => trim(spip_xml_aplatit($form['multiple'])),
+                                       'champconfirm' => trim(spip_xml_aplatit($form['champconfirm'])),
+                               );
+
+                               // configurer le formulaire (titre etc)
+                               forms_configure_formulaire($form_source, $formulaire);
+
+                               // ajouter les champs de saisies
+                               foreach ($form['fields'] as $fields) {
+                                       foreach ($fields['field'] as $field) {
+                                               $champ = array(
+                                                       'champ'=>trim(spip_xml_aplatit($field['champ'])),
+                                                       'titre'=>trim(spip_xml_aplatit($field['titre'])),
+                                                       'type'=>trim(spip_xml_aplatit($field['type'])),
+                                                       'obligatoire'=>trim(spip_xml_aplatit($field['obligatoire'])),
+                                                       'taille'=>trim(spip_xml_aplatit($field['taille'])),
+                                                       'extra_info'=>trim(spip_xml_aplatit($field['extra_info'])),
+                                                       'aide'=>trim(spip_xml_aplatit($field['aide'])),
+                                                       'saisie'=>trim(spip_xml_aplatit($field['saisie'])),
+                                               );
+
+                                               // Les choix pour les types select et multiple
+                                               if (isset($field['les_choix']) and is_array($field['les_choix'])) {
+                                                       $champ['choix'] = array();
+                                                       foreach ($field['les_choix'] as $les_choix) {
+                                                               foreach ($les_choix['un_choix'] as $un_choix) {
+                                                                       $champ['choix'][] = array(
+                                                                               'choix'=>trim(spip_xml_aplatit($un_choix['choix'])),
+                                                                               'titre'=>trim(spip_xml_aplatit($un_choix['titre'])),
+                                                                       );
+                                                               }
+                                                       }
+                                               }
+
+                                               if ($saisie = forms_champ_vers_saisie($champ)) {
+                                                       $formulaire['saisies'][] = $saisie;
+                                               }
+                                       }
+                               }
+
+                               // les traitements
+                               forms_configure_traitement_formulaire($form_source, $formulaire);
+                               $id_formulaire = forms_importe_en_base($formulaire);
+                       }
+               }
+       }
+
+       if ($id_formulaire) {
+               return $id_formulaire;
+       } else {
+               return _T('formidable:erreur_importer_forms');
+       }
+}
+
+/**
+ * Importer le tableau $formulaire en base
+ * @param array $formulaire
+ * @return bool|int
+ */
+function forms_importe_en_base($formulaire) {
+       include_spip('action/editer_formulaire');
+       // On insère un nouveau formulaire
+       // cas utilise par l'installation/import f&t
+       if (isset($formulaire['id_formulaire'])
+               and !sql_countsel('spip_formulaires', 'id_formulaire='.intval($formulaire['id_formulaire']))) {
+               $champs = array(
+                       'id_formulaire' => $formulaire['id_formulaire'],
+                       'statut' => 'prop',
+                       'date_creation' => date('Y-m-d H:i:s'),
+               );
+               // Envoyer aux plugins
+               $champs = pipeline(
+                       'pre_insertion',
+                       array(
+                               'args' => array(
+                                       'table' => 'spip_formulaires',
+                               ),
+                               'data' => $champs
+                       )
+               );
+               $id_formulaire = sql_insertq('spip_formulaires', $champs);
+
+               pipeline(
+                       'post_insertion',
+                       array(
+                               'args' => array(
+                                       'table' => 'spip_formulaires',
+                                       'id_objet' => $id_formulaire
+                               ),
+                               'data' => $champs
+                       )
+               );
+       } else {
+               $id_formulaire = formulaire_inserer();
+       }
+
+       $formulaire['saisies'] = forms_regroupe_saisies_fieldset($formulaire['saisies']);
+
+       if (is_array($formulaire['saisies'])) {
+               $formulaire['saisies'] = serialize($formulaire['saisies']);
+       }
+       if (is_array($formulaire['traitements'])) {
+               $formulaire['traitements'] = serialize($formulaire['traitements']);
+       }
+
+       // si l'identifiant existe deja (multiples imports du meme form)
+       // le dater
+       if (sql_countsel('spip_formulaires', 'identifiant='.sql_quote($formulaire['identifiant']))) {
+               $formulaire['identifiant'] .= '_'.date('Ymd_His');
+       }
+
+       // Si ok on modifie les champs de base
+       if ($id_formulaire > 0
+               and !($erreur = formulaire_modifier($id_formulaire, $formulaire))) {
+               return $id_formulaire;
+       }
+
+       return false;
+}
+
+/**
+ * Configuration de l'objet formulaire formidable a partir du form f&t
+ * @param array $form
+ * @param array $formulaire
+ */
+function forms_configure_formulaire($form, &$formulaire) {
+
+       // Le titre
+       $formulaire['titre'] = ($form['titre'] ? $form['titre'] : _T('info_sans_titre'));
+
+       // Generer un identifiant
+       // si id_form fourni, on s'en sert
+       if (isset($form['id_form'])) {
+               $formulaire['identifiant'] = 'form_import_'.$form['id_form'];
+       } else {
+               $formulaire['identifiant'] = 'form_import_'.preg_replace(',\W,', '_', strtolower($formulaire['titre']));
+       }
+
+       // Le descriptif
+       $formulaire['descriptif'] = (isset($form['descriptif']) ? $form['descriptif'] : '');
+
+       // Le message de retour si ok
+       $formulaire['message_retour'] = (isset($form['texte']) ? $form['texte'] : '');
+
+       if (!isset($formulaire['traitements'])) {
+               $formulaire['traitements'] = array();
+       }
+
+       if (!isset($formulaire['saisies'])) {
+               $formulaire['saisies'] = array();
+       }
+}
+
+/**
+ * Configurer les traitements
+ *
+ * @param array $form
+ * @param array $formulaire
+ */
+function forms_configure_traitement_formulaire($form, &$formulaire) {
+       // Le traitement email
+       if ($form['champconfirm']) {
+               if (!isset($formulaire['traitements']['email'])) {
+                       $formulaire['traitements']['email'] = array();
+               }
+               $formulaire['traitements']['email']['champ_courriel_destinataire_form'] = $form['champconfirm'];
+       }
+
+       // $form['email'] est possiblement serialize
+       if (is_string($form['email']) and $a=unserialize($form['email'])) {
+               $form['email'] = $a;
+       }
+       if (is_array($form['email'])) {
+               if ($email_defaut = $form['email']['defaut']) {
+                       if (!isset($formulaire['traitements']['email'])) {
+                               $formulaire['traitements']['email'] = array();
+                       }
+                       $formulaire['traitements']['email']['destinataires_plus'] = $email_defaut;
+               }
+
+               // TODO email route : feature qui n'existe pas dans formidable
+               if ($route = $form['email']['route']) {
+               }
+       }
+
+       // Le traitement enregistrement : toujours
+       $formulaire['traitements']['enregistrement'] = array(
+               'moderation' => ($form['moderation'] == 'priori') ? 'priori' : 'posteriori',
+               'modifiable' => ($form['modifiable'] == 'oui') ? 'on' : '',
+               'multiple' => ($form['multiple'] == 'non') ? '' : 'on'
+       );
+
+}
+
+
+/**
+ * On a genere un fieldset pour chaque separateur de f&t
+ * il faut le peupler avec les saisies qui le suivent
+ *
+ * @param array $saisies
+ * @return array
+ */
+function forms_regroupe_saisies_fieldset($saisies) {
+       $s = array();
+       $ins = &$s;
+
+       foreach ($saisies as $k => $saisie) {
+               if ($saisie['saisie']=='fieldset') {
+                       if (!isset($saisies[$k]['saisies'])) {
+                               $saisies[$k]['saisies'] = array();
+                       }
+                       $ins = &$saisies[$k]['saisies'];
+                       $s[] = &$saisies[$k];
+               } else {
+                       $ins[] = &$saisies[$k];
+               }
+       }
+
+       return $s;
+}
+
+/**
+ * Transforme un champ f&t en Saisie
+ * @param array $champ
+ *   string champ
+ *   string titre
+ *   string type
+ *   string obligatoire
+ *   string taille
+ *   string aide
+ *   string extra_info
+ *   string saisie oui/non
+ *   array choix
+ *     string choix
+ *     string titre
+ * @return array|bool
+ */
+function forms_champ_vers_saisie($champ) {
+       // Le truc par défaut
+       $saisie = array(
+               'saisie' => 'input',
+               'options' => array('size'=>40)
+       );
+
+       // On essaye de traduire tous les types de champs
+       $type = $champ['type'];
+       switch ($type) {
+               case 'texte':
+                       $saisie['saisie'] = 'textarea';
+                       unset($saisie['options']['size']);
+                       $saisie['options']['rows'] = 5;
+                       $saisie['options']['cols'] = 40;
+                       break;
+               case 'password':
+                       $saisie['options']['type'] = 'password';
+                       break;
+               case 'date':
+                       $saisie['saisie'] = 'date';
+                       $saisie['verifier'] = array(
+                               'type' => 'date'
+                       );
+                       break;
+               case 'num':
+               case 'monnaie':
+                       if (!isset($champ['taille']) or !intval($taille = $champ['taille'])) {
+                               $saisie['verifier'] = array(
+                                       'type' => 'entier'
+                               );
+                       } else {
+                               $saisie['verifier'] = array(
+                                       'type' => 'decimal'
+                               );
+                               $saisie['verifier']['options'] = array('nb_decimales' => $taille);
+                       }
+                       break;
+               case 'email':
+                       $saisie['verifier'] = array(
+                               'type' => 'email'
+                       );
+                       break;
+               case 'telephone':
+                       $saisie['verifier'] = array(
+                               'type' => 'telephone'
+                       );
+                       break;
+               case 'select':
+                       unset($saisie['options']['size']);
+                       $liste = $champ['extra_info'];
+                       if ($liste == 'radio') {
+                               $saisie['saisie'] = 'radio';
+                       } else {
+                               $saisie['saisie'] = 'selection';
+                       }
+                       break;
+               case 'multiple':
+                       $saisie['saisie'] = 'checkbox';
+                       unset($saisie['options']['size']);
+                       break;
+               case 'mot':
+                       $saisie['saisie'] = 'mot';
+                       $saisie['options']['id_groupe'] = $champ['extra_info'];
+                       unset($saisie['options']['size']);
+                       break;
+               case 'textestatique':
+                       $saisie['saisie'] = 'explication';
+                       unset($saisie['options']['size']);
+                       $saisie['options']['texte'] = $champ['titre'];
+                       unset($champ['titre']);
+                       unset($champ['aide']);
+                       break;
+               case 'separateur':
+                       $saisie['saisie'] = 'fieldset';
+                       $saisie['saisies'] = array();
+                       unset($saisie['options']['size']);
+                       break;
+               case 'fichier':
+                       // TODO saisie file NIY
+                       $saisie = null;
+                       break;
+       }
+
+       // On continue seulement si on a toujours une saisie
+       if (!$saisie) {
+               return false;
+       }
+
+       // Les choix pour les types select et multiple
+       if (isset($champ['choix']) and is_array($champ['choix'])) {
+               $saisie['options']['datas'] = array();
+               foreach ($champ['choix'] as $un_choix) {
+                       $choix = $un_choix['choix'];
+                       $titre = $un_choix['titre'];
+                       $saisie['options']['datas'][$choix] = $titre;
+               }
+       }
+
+       // Le nom
+       $saisie['options']['nom'] = $champ['champ'];
+
+       // Le label
+       if (isset($champ['titre']) and $champ['titre']) {
+               $saisie['options']['label'] = $champ['titre'];
+       }
+
+       // Obligatoire
+       if (isset($champ['obligatoire']) and $champ['obligatoire'] == 'oui') {
+               $saisie['options']['obligatoire'] = 'on';
+       }
+
+       // Explication éventuelle
+       if (isset($champ['aide']) and $explication = $champ['aide']) {
+               $saisie['options']['explication'] = $explication;
+       }
+
+       if (isset($champ['saisie']) and $champ['saisie']=='non') {
+               $saisie['options']['disable'] = 'on';
+               // masquer en JS, fallback
+               $saisie['options']['afficher_si'] = 'false';
+       }
+
+       return $saisie;
+}
index 4151a5a..7df626d 100644 (file)
@@ -1,22 +1,24 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function echanger_formulaire_wcs_importer_dist($fichier){
+function echanger_formulaire_wcs_importer_dist($fichier) {
        include_spip('inc/xml');
        include_spip('inc/filtres');
        include_spip('inc/saisies');
        $arbre = spip_xml_load($fichier, false);
-       
-       if ($arbre and is_array($arbre) and isset($arbre['formdef'])){
-               foreach($arbre['formdef'] as $form){
+
+       if ($arbre and is_array($arbre) and isset($arbre['formdef'])) {
+               foreach ($arbre['formdef'] as $form) {
                        $formulaire = array();
-                       
+
                        // Le titre
                        $titre = filtrer_entites(trim(spip_xml_aplatit($form['name'])));
                        $formulaire['titre'] = $titre ? $titre : _T('info_sans_titre');
-                       
+
                        // On vérifie que l'identifiant n'existe pas déjà
                                $formulaire['identifiant'] = str_replace('-', '_', trim(spip_xml_aplatit($form['url_name'])));
                                $deja = sql_getfetsel(
@@ -24,31 +26,32 @@ function echanger_formulaire_wcs_importer_dist($fichier){
                                        'spip_formulaires',
                                        'identifiant = '.sql_quote($formulaire['identifiant'])
                                );
-                               if ($deja)
+                               if ($deja) {
                                        $formulaire['identifiant'] = $formulaire['identifiant'].'_'.time();
-                       
+                               }
+
                        // Les champs
                        $formulaire['saisies'] = array();
                        // Par défaut le conteneur c'est le formulaire
                        $conteneur =& $formulaire;
-                       foreach($form['fields'] as $fields){
-                               foreach($fields['field'] as $field){
+                       foreach ($form['fields'] as $fields) {
+                               foreach ($fields['field'] as $field) {
                                        $changer_conteneur = false;
-                                       
+
                                        // Le truc par défaut
                                        $saisie = array(
                                                'saisie' => 'input',
                                                'options' => array('size'=>40)
                                        );
-                                       
+
                                        // Le label
                                        $saisie['options']['label'] = filtrer_entites(trim(spip_xml_aplatit($field['label'])));
-                                       
+
                                        // On essaye de traduire tous les types de champs
                                        $type = trim(spip_xml_aplatit($field['type']));
-                                       switch ($type){
+                                       switch ($type) {
                                                case 'string':
-                                                       if ($size = intval(trim(spip_xml_aplatit($field['size'])))){
+                                                       if ($size = intval(trim(spip_xml_aplatit($field['size'])))) {
                                                                $saisie['options']['maxlength'] = $size;
                                                                $saisie['verifier'] = array(
                                                                        'type' => 'taille',
@@ -61,10 +64,10 @@ function echanger_formulaire_wcs_importer_dist($fichier){
                                                        unset($saisie['options']['size']);
                                                        $saisie['options']['rows'] = 5;
                                                        $saisie['options']['cols'] = 40;
-                                                       if ($rows = intval(trim(spip_xml_aplatit($field['rows'])))){
+                                                       if ($rows = intval(trim(spip_xml_aplatit($field['rows'])))) {
                                                                $saisie['options']['rows'] = $rows;
                                                        }
-                                                       if ($cols = intval(trim(spip_xml_aplatit($field['cols'])))){
+                                                       if ($cols = intval(trim(spip_xml_aplatit($field['cols'])))) {
                                                                $saisie['options']['cols'] = $cols;
                                                        }
                                                        break;
@@ -110,65 +113,64 @@ function echanger_formulaire_wcs_importer_dist($fichier){
                                                case 'file':
                                                        $saisie = null;
                                        }
-                                       
+
                                        // On continue seulement si on a toujours une saisie
-                                       if ($saisie){
+                                       if ($saisie) {
                                                // Les choix pour les types select
-                                               if(isset($field['items']) and is_array($field['items'])){
+                                               if (isset($field['items']) and is_array($field['items'])) {
                                                        $saisie['options']['datas'] = array();
-                                                       foreach($field['items'] as $items){
-                                                               foreach($items['item'] as $cle=>$item){
+                                                       foreach ($field['items'] as $items) {
+                                                               foreach ($items['item'] as $cle => $item) {
                                                                        $titre = filtrer_entites(trim($item));
                                                                        $saisie['options']['datas']['choix_'.$cle] = $titre;
                                                                }
                                                        }
                                                }
-                                       
+
                                                // Le nom
                                                $saisie['options']['nom'] = saisies_generer_nom($formulaire['saisies'], $saisie['saisie']);
-                                       
+
                                                // Obligatoire
-                                               if (trim(spip_xml_aplatit($field['required'])) == 'True')
+                                               if (trim(spip_xml_aplatit($field['required'])) == 'True') {
                                                        $saisie['options']['obligatoire'] = 'on';
-                                       
+                                               }
+
                                                // Explication éventuelle
-                                               if ($explication = trim(spip_xml_aplatit($field['hint'])))
+                                               if ($explication = trim(spip_xml_aplatit($field['hint']))) {
                                                        $saisie['options']['explication'] = $explication;
-                                       
+                                               }
+
                                                // On ajoute enfin la saisie
                                                $conteneur['saisies'][] = $saisie;
-                                               
+
                                                // Faut-il changer de conteneur ?
-                                               if ($changer_conteneur){
+                                               if ($changer_conteneur) {
                                                        $conteneur =& $conteneur['saisies'][count($conteneur['saisies'])-1];
                                                }
                                        }
                                }
                        }
-                       
+
                        include_spip('action/editer_formulaire');
                        // On insère un nouveau formulaire
                        $id_formulaire = formulaire_inserer();
                        // Si ça a marché on transforme les tableaux et on modifie les champs
-                       if ($id_formulaire > 0){
-                               if (is_array($formulaire['saisies'])){
+                       if ($id_formulaire > 0) {
+                               if (is_array($formulaire['saisies'])) {
                                        $formulaire['saisies'] = serialize($formulaire['saisies']);
                                }
-                               if (is_array($formulaire['traitements'])){
+                               if (is_array($formulaire['traitements'])) {
                                        $formulaire['traitements'] = serialize($formulaire['traitements']);
                                }
-                               
+
                                $erreur = formulaire_modifier($id_formulaire, $formulaire);
                        }
                }
        }
-       
-       if ($id_formulaire and !$erreur){
+
+       if ($id_formulaire and !$erreur) {
                return $id_formulaire;
-       }
-       else{
-               return _T('formidable:erreur_importer_yaml').' : '.$erreur;
+       } else {
+               return _T('formidable:erreur_importer_wcs').' : '.$erreur;
        }
 }
-
-?>
index 061f66d..4756515 100644 (file)
@@ -1,46 +1,48 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function echanger_formulaire_yaml_exporter_dist($id_formulaire){
+function echanger_formulaire_yaml_exporter_dist($id_formulaire) {
        include_spip('base/abstract_sql');
        include_spip('inc/yaml');
        $id_formulaire = intval($id_formulaire);
        $export = '';
-       
-       if ($id_formulaire > 0){
+
+       if ($id_formulaire > 0) {
                // On récupère le formulaire
                $formulaire = sql_fetsel(
                        '*',
                        'spip_formulaires',
                        'id_formulaire = '.$id_formulaire
                );
-               
+
                // On décompresse les trucs sérialisés
                $formulaire['saisies'] = unserialize($formulaire['saisies']);
                $formulaire['traitements'] = unserialize($formulaire['traitements']);
-               
+
                // On envode en yaml
                $export = yaml_encode($formulaire);
        }
-       
-       Header("Content-Type: text/x-yaml;");
+
+       Header('Content-Type: text/x-yaml;');
        Header('Content-Disposition: attachment; filename=formulaire-'.$formulaire['identifiant'].'.yaml');
-       Header("Content-Length: ".strlen($export));
+       Header('Content-Length: '.strlen($export));
        echo $export;
        exit();
 }
 
-function echanger_formulaire_yaml_importer_dist($fichier){
+function echanger_formulaire_yaml_importer_dist($fichier) {
        $yaml = '';
        lire_fichier($fichier, $yaml);
        // Si on a bien recupere une chaine on tente de la decoder
-       if ($yaml){
+       if ($yaml) {
                include_spip('inc/yaml');
                $formulaire = yaml_decode($yaml);
                // Si le decodage marche on importe alors le contenu
-               if (is_array($formulaire)){
+               if (is_array($formulaire)) {
                        include_spip('action/editer_formulaire');
                        // On enlève les champs inutiles
                        unset($formulaire['id_formulaire']);
@@ -50,32 +52,29 @@ function echanger_formulaire_yaml_importer_dist($fichier){
                                'spip_formulaires',
                                'identifiant = '.sql_quote($formulaire['identifiant'])
                        );
-                       if ($deja){
+                       if ($deja) {
                                $formulaire['identifiant'] .= '_'.date('Ymd_His');
                        }
-                       
+
                        // On insère un nouveau formulaire
                        $id_formulaire = formulaire_inserer();
                        // Si ça a marché on transforme les tableaux et on modifie les champs
-                       if ($id_formulaire > 0){
-                               if (is_array($formulaire['saisies'])){
+                       if ($id_formulaire > 0) {
+                               if (is_array($formulaire['saisies'])) {
                                        $formulaire['saisies'] = serialize($formulaire['saisies']);
                                }
-                               if (is_array($formulaire['traitements'])){
+                               if (is_array($formulaire['traitements'])) {
                                        $formulaire['traitements'] = serialize($formulaire['traitements']);
                                }
-                               
+
                                $erreur = formulaire_modifier($id_formulaire, $formulaire);
                        }
                }
        }
-       
-       if ($id_formulaire and !$erreur){
+
+       if ($id_formulaire and !$erreur) {
                return $id_formulaire;
-       }
-       else{
+       } else {
                return _T('formidable:erreur_importer_yaml').' : '.$erreur;
        }
 }
-
-?>
index 6aadef3..103ea77 100644 (file)
@@ -1,12 +1,13 @@
 <?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
 /**
  * Gestion des puces d'action rapide de formulaires
  *
  * @package SPIP\Formidable\Puce_statut
-**/
+ **/
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/presentation');
 
@@ -15,13 +16,12 @@ include_spip('inc/presentation');
  *
  * Récupère l'identifiant id et le type d'objet dans les données postées
  * et appelle la fonction de traitement de cet exec.
- * 
+ *
  * @see exec_puce_statut_formulaires_args()
  * @return string Code HTML
 **/
-function exec_puce_statut_formulaires_dist()
-{
-       exec_puce_statut_formulaires_args(_request('id'),  _request('type'));
+function exec_puce_statut_formulaires_dist() {
+       exec_puce_statut_formulaires_args(_request('id'), _request('type'));
 }
 
 /**
@@ -30,20 +30,19 @@ function exec_puce_statut_formulaires_dist()
  * Appelle la fonction de traitement des puces statuts
  * après avoir retrouvé le statut en cours de l'objet
  * et son parent s'il en a un
- * 
+ *
  * @param int $id
  *     Identifiant de l'objet
  * @param string $type
  *     Type d'objet
  * @return string Code HTML
 **/
-function exec_puce_statut_formulaires_args($id, $type)
-{
-       if (in_array($type,array('formulaires','formulaires_reponse'))) {
+function exec_puce_statut_formulaires_args($id, $type) {
+       if (in_array($type, array('formulaires', 'formulaires_reponse'))) {
                $table = table_objet_sql($type);
                $prim = id_table_objet($type);
                $id = intval($id);
-               $r = sql_fetsel("id_formulaire,statut", "$table", "$prim=$id");
+               $r = sql_fetsel('id_formulaire,statut', $table, "$prim=$id");
                $statut = $r['statut'];
                $id_formulaire = $r['id_formulaire'];
        } else {
@@ -53,5 +52,3 @@ function exec_puce_statut_formulaires_args($id, $type)
        $puce_statut = charger_fonction('puce_statut', 'inc');
        ajax_retour($puce_statut($id,$statut,$id_formulaire,$type, true));
 }
-
-?>
index 428fe29..b9e7eab 100644 (file)
@@ -7,7 +7,9 @@
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Installation/maj des tables de formidable...
@@ -18,7 +20,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  *     Version du schéma de données dans ce plugin (déclaré dans paquet.xml)
  * @return void
  */
-function formidable_upgrade($nom_meta_base_version, $version_cible){
+function formidable_upgrade($nom_meta_base_version, $version_cible) {
        // Création des tables
        include_spip('base/create');
        include_spip('base/abstract_sql');
@@ -47,12 +49,10 @@ function formidable_upgrade($nom_meta_base_version, $version_cible){
        $maj['0.5.3'] = array(array('sql_alter','TABLE spip_formulaires ADD date_crea datetime NOT NULL DEFAULT "0000-00-00 00:00:00"'));
        // Renommer la date de création (pas d'abbréviations dans les noms)
        $maj['0.5.5'] = array(array('sql_alter','TABLE spip_formulaires CHANGE date_crea date_creation datetime NOT NULL DEFAULT "0000-00-00 00:00:00"'));
-
        // statut publie sur les formulaires sans statut
        $maj['0.5.6'] = array(
-               array('sql_updateq','spip_formulaires',array('statut'=>'publie'),"statut=".sql_quote('')),
+               array('sql_updateq', 'spip_formulaires', array('statut'=>'publie'), 'statut='.sql_quote('')),
        );
-
        $maj['0.6.0'] = array(
                array('sql_alter','TABLE spip_formulaires_reponses_champs RENAME TO spip_formulaires_reponses_champs_bad'),
                array('maj_tables',array('spip_formulaires_reponses_champs')),
@@ -69,93 +69,110 @@ function formidable_upgrade($nom_meta_base_version, $version_cible){
                // champ resume_reponse
                array('maj_tables',array('spip_formulaires')),
        );
+       // Pouvoir rendre un champ unique
+       $maj['0.6.5'] = array(
+               // champ resume_reponse
+               array('maj_tables',array('spip_formulaires')),
+       );
+       $maj['0.6.6'] = array(
+               array('sql_updateq', 'spip_formulaires_reponses', array('statut' => 'refuse'), 'statut='.sql_quote('poubelle')),
+       );
+       // Ajouter un champ "css" sur les formulaires
+       $maj['0.7.0'] = array(
+               array('maj_tables', array('spip_formulaires')),
+       );
 
        include_spip('base/upgrade');
        maj_plugin($nom_meta_base_version, $version_cible, $maj);
 }
 
 
-function formidable_unifier_reponses_champs(){
+function formidable_unifier_reponses_champs() {
 
-       $rows = sql_allfetsel("DISTINCT id_formulaires_reponses_champ,id_formulaires_reponse,nom,count(id_formulaires_reponse) AS N","spip_formulaires_reponses_champs",'nom LIKE '.sql_quote('multiple%').' OR nom LIKE '.sql_quote('mot%'),'concat( id_formulaires_reponse, nom )','id_formulaires_reponse','0,100','N>1');
+       $rows = sql_allfetsel(
+               'DISTINCT id_formulaires_reponses_champ,id_formulaires_reponse,nom,count(id_formulaires_reponse) AS N',
+               'spip_formulaires_reponses_champs',
+               'nom LIKE '.sql_quote('multiple%').' OR nom LIKE '.sql_quote('mot%'),
+               'concat( id_formulaires_reponse, nom )',
+               'id_formulaires_reponse',
+               '0,100',
+               'N>1'
+       );
        do {
-
-
-               foreach($rows as $row){
-
+               foreach ($rows as $row) {
                        #var_dump($row);
-
                        // pour chaque reponse on recupere tous les champs
-                       $reponse = sql_allfetsel("*","spip_formulaires_reponses_champs","id_formulaires_reponse=".intval($row['id_formulaires_reponse']));
-                       spip_log("id_formulaires_reponse ".$row['id_formulaires_reponse'],"formidable_unifier_reponses_champs"._LOG_INFO_IMPORTANTE);
+                       $reponse = sql_allfetsel(
+                               '*',
+                               'spip_formulaires_reponses_champs',
+                               'id_formulaires_reponse='.intval($row['id_formulaires_reponse'])
+                       );
+                       spip_log('id_formulaires_reponse '.$row['id_formulaires_reponse'], 'formidable_unifier_reponses_champs'._LOG_INFO_IMPORTANTE);
                        // on les reinsere un par un dans la nouvelle table propre
                        $data = array();
-                       foreach($reponse as $champ){
+                       foreach ($reponse as $champ) {
                                $data[$champ['nom']][] = $champ;
                        }
 
-                       foreach($data as $nom=>$champs){
-                               if (count($champs)>1){
+                       foreach ($data as $nom => $champs) {
+                               if (count($champs)>1) {
                                        #var_dump($champs);
                                        $keep = $champs[0]['id_formulaires_reponses_champ'];
                                        $delete = array();
                                        $valeurs = array();
-                                       foreach($champs as $champ){
+                                       foreach ($champs as $champ) {
                                                $valeurs[] = $champ['valeur'];
-                                               if ($champ['id_formulaires_reponses_champ']!==$keep)
+                                               if ($champ['id_formulaires_reponses_champ'] !== $keep) {
                                                        $delete[] = $champ['id_formulaires_reponses_champ'];
+                                               }
                                        }
                                        $valeurs = serialize($valeurs);
                                        #var_dump($valeurs);
                                        #var_dump($keep);
                                        #var_dump($delete);
-                                       sql_updateq('spip_formulaires_reponses_champs',array('valeur'=>$valeurs),'id_formulaires_reponses_champ='.intval($keep));
-                                       sql_delete('spip_formulaires_reponses_champs',sql_in('id_formulaires_reponses_champ',$delete));
+                                       sql_updateq('spip_formulaires_reponses_champs', array('valeur'=>$valeurs), 'id_formulaires_reponses_champ='.intval($keep));
+                                       sql_delete('spip_formulaires_reponses_champs', sql_in('id_formulaires_reponses_champ', $delete));
                                        //die();
                                }
                        }
                        #var_dump($data);
                        //die('nothing?');
 
-                       if (time()>_TIME_OUT)
+                       if (time()>_TIME_OUT) {
                                return;
+                       }
                }
 
-               if (time()>_TIME_OUT)
+               if (time()>_TIME_OUT) {
                        return;
-
-       }
-       while ($rows = sql_allfetsel("DISTINCT id_formulaires_reponses_champ,id_formulaires_reponse,nom,count( id_formulaires_reponse ) AS N","spip_formulaires_reponses_champs",'nom LIKE '.sql_quote('multiple%').' OR nom LIKE '.sql_quote('mot%'),'concat( id_formulaires_reponse, nom )','id_formulaires_reponse','0,100','N>1'));
+               }
+       } while ($rows = sql_allfetsel('DISTINCT id_formulaires_reponses_champ,id_formulaires_reponse,nom,count( id_formulaires_reponse ) AS N', 'spip_formulaires_reponses_champs', 'nom LIKE '.sql_quote('multiple%').' OR nom LIKE '.sql_quote('mot%'), 'concat( id_formulaires_reponse, nom )', 'id_formulaires_reponse', '0,100', 'N>1'));
        //die('fini?');
 }
 
 
-function formidable_transferer_reponses_champs(){
+function formidable_transferer_reponses_champs() {
 
-       $rows = sql_allfetsel("DISTINCT id_formulaires_reponse","spip_formulaires_reponses_champs_bad",'','id_formulaires_reponse','','0,100');
+       $rows = sql_allfetsel('DISTINCT id_formulaires_reponse', 'spip_formulaires_reponses_champs_bad', '', 'id_formulaires_reponse', '', '0,100');
        do {
-
-               foreach($rows as $row){
-
+               foreach ($rows as $row) {
                        // pour chaque reponse on recupere tous les champs
-                       $reponse = sql_allfetsel("*","spip_formulaires_reponses_champs_bad","id_formulaires_reponse=".intval($row['id_formulaires_reponse']));
+                       $reponse = sql_allfetsel('*', 'spip_formulaires_reponses_champs_bad', 'id_formulaires_reponse='.intval($row['id_formulaires_reponse']));
                        // on les reinsere un par un dans la nouvelle table propre
-                       foreach($reponse as $champ){
-                               sql_insertq("spip_formulaires_reponses_champs",$champ);
+                       foreach ($reponse as $champ) {
+                               sql_insertq('spip_formulaires_reponses_champs', $champ);
                        }
                        // et on les vire de la mauvaise
-                       sql_delete("spip_formulaires_reponses_champs_bad","id_formulaires_reponse=".intval($row['id_formulaires_reponse']));
-
-                       if (time()>_TIME_OUT)
+                       sql_delete('spip_formulaires_reponses_champs_bad', 'id_formulaires_reponse='.intval($row['id_formulaires_reponse']));
+                       if (time()>_TIME_OUT) {
                                return;
+                       }
                }
 
-               if (time()>_TIME_OUT)
+               if (time()>_TIME_OUT) {
                        return;
-
-       }
-       while ($rows = sql_allfetsel("DISTINCT id_formulaires_reponse","spip_formulaires_reponses_champs_bad",'','id_formulaires_reponse','','0,100'));
-
+               }
+       } while ($rows = sql_allfetsel('DISTINCT id_formulaires_reponse', 'spip_formulaires_reponses_champs_bad', '', 'id_formulaires_reponse', '', '0,100'));
 }
 
 
@@ -166,7 +183,7 @@ function formidable_transferer_reponses_champs(){
  *     Nom de la meta informant de la version du schéma de données du plugin installé dans SPIP
  * @return void
  */
-function formidable_vider_tables($nom_meta_base_version){
+function formidable_vider_tables($nom_meta_base_version) {
 
        include_spip('inc/meta');
        include_spip('base/abstract_sql');
@@ -178,15 +195,13 @@ function formidable_vider_tables($nom_meta_base_version){
        sql_drop_table('spip_formulaires_liens');
 
        // on efface les champs d'import de f&t si il y a lieu
-       $trouver_table = charger_fonction("trouver_table","base");
-       if ($trouver_table('spip_forms')){
-               sql_alter("TABLE spip_forms DROP id_formulaire");
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       if ($trouver_table('spip_forms')) {
+               sql_alter('TABLE spip_forms DROP id_formulaire');
        }
-       if ($trouver_table('spip_forms_donnees')){
-               sql_alter("TABLE spip_forms_donnees DROP id_formulaires_reponse");
+       if ($trouver_table('spip_forms_donnees')) {
+               sql_alter('TABLE spip_forms_donnees DROP id_formulaires_reponse');
        }
-
-
        // On efface la version entregistrée
        effacer_meta($nom_meta_base_version);
 }
@@ -194,152 +209,154 @@ function formidable_vider_tables($nom_meta_base_version){
 /**
  * Associer les <formXX> issus de f&t aux articles concernes
  */
-function formidable_associer_forms(){
-       include_spip("inc/rechercher");
-       include_spip("inc/editer_liens");
-       $forms = sql_allfetsel("*","spip_formulaires","identifiant REGEXP ".sql_quote('^form[0-9]+$'));
-       foreach($forms as $form){
-               if (!sql_countsel("spip_formulaires_liens","id_formulaire=".intval($form['id_formulaire']))){
+function formidable_associer_forms() {
+       include_spip('inc/rechercher');
+       include_spip('inc/editer_liens');
+       $forms = sql_allfetsel('*', 'spip_formulaires', 'identifiant REGEXP '.sql_quote('^form[0-9]+$'));
+       foreach ($forms as $form) {
+               if (!sql_countsel('spip_formulaires_liens', 'id_formulaire='.intval($form['id_formulaire']))) {
                        $articles = array();
                        $id = $form['identifiant'];
                        #var_dump($id);
-                       $res = recherche_en_base("/<{$id}[>|]/","article");
+                       $res = recherche_en_base("/<{$id}[>|]/", 'article');
                        #var_dump($res);
-                       if (count($res) AND isset($res['article'])){
-                               foreach($res['article'] as $id_article=>$details){
+                       if (count($res) and isset($res['article'])) {
+                               foreach ($res['article'] as $id_article => $details) {
                                        $articles[] = $id_article;
                                }
                        }
                        #var_dump($form['id_formulaire']);
                        #var_dump($articles);
-                       objet_associer(array('formulaire'=>array($form['id_formulaire'])),array('article'=>$articles));
+                       objet_associer(array('formulaire' => array($form['id_formulaire'])), array('article' => $articles));
                }
-               if (time()>_TIME_OUT)
+               if (time()>_TIME_OUT) {
                        return;
+               }
        }
 }
 
 /**
  * Importer les formulaires de f&t
  */
-function formidable_importer_forms(){
-       $trouver_table = charger_fonction("trouver_table","base");
-       if ($trouver_table('spip_forms')){
-               sql_alter("TABLE spip_forms ADD id_formulaire bigint(21) NOT NULL DEFAULT 0");
+function formidable_importer_forms() {
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       if ($trouver_table('spip_forms')) {
+               sql_alter('TABLE spip_forms ADD id_formulaire bigint(21) NOT NULL DEFAULT 0');
 
-               include_spip("echanger/formulaire/forms");
+               include_spip('echanger/formulaire/forms');
 
-               $forms = sql_allfetsel("*","spip_forms",'id_formulaire=0 AND type_form='.sql_quote('')." OR type_form=".sql_quote('sondage'),'','id_form');
-               foreach($forms as $form){
+               $forms = sql_allfetsel('*', 'spip_forms', 'id_formulaire=0 AND type_form='.sql_quote('').' OR type_form='.sql_quote('sondage'), '', 'id_form');
+               foreach ($forms as $form) {
                        $formulaire = array();
                        // configurer le formulaire (titre etc)
-                       forms_configure_formulaire($form,$formulaire);
+                       forms_configure_formulaire($form, $formulaire);
 
                        // identifiant formXX puisqu'on est en installation, pas de risque de conflits
                        // et facilite la migration de modele
-                       $formulaire['identifiant'] = "form".$form['id_form'];
+                       $formulaire['identifiant'] = 'form' . $form['id_form'];
                        // on peut faire ca aussi puisqu'on est a l'installation
                        $formulaire['id_formulaire'] = $form['id_form'];
 
-                       $fields = sql_allfetsel("*","spip_forms_champs","id_form=".intval($form['id_form']),"","rang");
-                       foreach($fields as $field){
-                               $choix = sql_allfetsel("*","spip_forms_champs_choix","id_form=".intval($form['id_form'])." AND champ=".sql_quote($field['champ']),'','rang');
-                               if (count($choix))
+                       $fields = sql_allfetsel('*', 'spip_forms_champs', 'id_form='.intval($form['id_form']), '', 'rang');
+                       foreach ($fields as $field) {
+                               $choix = sql_allfetsel('*', 'spip_forms_champs_choix', 'id_form='.intval($form['id_form']).' AND champ='.sql_quote($field['champ']), '', 'rang');
+                               if (count($choix)) {
                                        $field['choix'] = $choix;
+                               }
 
-                               if ($saisie = forms_champ_vers_saisie($field))
+                               if ($saisie = forms_champ_vers_saisie($field)) {
                                        $formulaire['saisies'][] = $saisie;
+                               }
                        }
 
                        // les traitements
-                       forms_configure_traitement_formulaire($form,$formulaire);
+                       forms_configure_traitement_formulaire($form, $formulaire);
 
                        // si ce formulaire a des reponses on le met en publie
-                       if (sql_countsel("spip_forms_donnees","id_form=".intval($form['id_form'])))
+                       if (sql_countsel('spip_forms_donnees', 'id_form='.intval($form['id_form']))) {
                                $formulaire['statut'] = 'publie';
+                       }
 
                        $id_formulaire = forms_importe_en_base($formulaire);
-                       spip_log("Import spip_forms #".$form['id_form']." en spip_formulaires #$id_formulaire","maj"._LOG_INFO_IMPORTANTE);
+                       spip_log('Import spip_forms #'.$form['id_form']." en spip_formulaires #$id_formulaire", 'maj'._LOG_INFO_IMPORTANTE);
 
-                       sql_update('spip_forms',array('id_formulaire'=>$id_formulaire),'id_form='.intval($form['id_form']));
+                       sql_update('spip_forms', array('id_formulaire' => $id_formulaire), 'id_form='.intval($form['id_form']));
 
-                       if (time()>_TIME_OUT)
+                       if (time()>_TIME_OUT) {
                                return;
+                       }
                }
-
        }
-
-       include_spip("inc/drapeau_edition");
+       include_spip('inc/drapeau_edition');
        debloquer_tous($GLOBALS['visiteur_session']['id_auteur']);
 }
 
-function formidable_importer_forms_donnees(){
-       $trouver_table = charger_fonction("trouver_table","base");
-       if ($trouver_table('spip_forms')){
-               sql_alter("TABLE spip_forms_donnees ADD id_formulaires_reponse bigint(21) NOT NULL DEFAULT 0");
+function formidable_importer_forms_donnees() {
+       $trouver_table = charger_fonction('trouver_table', 'base');
+       if ($trouver_table('spip_forms')) {
+               sql_alter('TABLE spip_forms_donnees ADD id_formulaires_reponse bigint(21) NOT NULL DEFAULT 0');
 
                // 2 champs de plus pour ne pas perdre des donnees
                sql_alter("TABLE spip_formulaires_reponses ADD url varchar(255) NOT NULL default ''");
                sql_alter("TABLE spip_formulaires_reponses ADD confirmation varchar(10) NOT NULL default ''");
 
                // table de correspondance id_form=>id_formulaire
-               $rows = sql_allfetsel("id_form,id_formulaire","spip_forms","id_formulaire>0");
+               $rows = sql_allfetsel('id_form,id_formulaire', 'spip_forms', 'id_formulaire>0');
                $trans = array();
-               foreach($rows as $row)
+               foreach ($rows as $row) {
                        $trans[$row['id_form']] = $row['id_formulaire'];
+               }
 
-               $rows = sql_allfetsel("*","spip_forms_donnees",sql_in('id_form',array_keys($trans))." AND id_formulaires_reponse=0",'','id_donnee','0,100');
+               $rows = sql_allfetsel('*', 'spip_forms_donnees', sql_in('id_form', array_keys($trans)).' AND id_formulaires_reponse=0', '', 'id_donnee', '0,100');
                do {
-
-                       foreach($rows as $row){
-
+                       foreach ($rows as $row) {
                                #var_dump($row);
                                $reponse = array(
-                                       "id_formulaires_reponse"=>$row['id_donnee'], // conserver le meme id par facilite (on est sur une creation de base)
-                                       "id_formulaire" => $trans[$row['id_form']],
-                                       "date" => $row["date"],
-                                       "ip" => $row["ip"],
-                                       "id_auteur" => $row["id_auteur"],
-                                       "cookie" => $row["cookie"],
-                                       "statut" => $row["statut"],
-                                       "url" => $row["url"],
-                                       "confirmation" => $row["confirmation"],
+                                       'id_formulaires_reponse' => $row['id_donnee'], // conserver le meme id par facilite (on est sur une creation de base)
+                                       'id_formulaire' => $trans[$row['id_form']],
+                                       'date' => $row['date'],
+                                       'ip' => $row['ip'],
+                                       'id_auteur' => $row['id_auteur'],
+                                       'cookie' => $row['cookie'],
+                                       'statut' => $row['statut'],
+                                       'url' => $row['url'],
+                                       'confirmation' => $row['confirmation'],
                                );
 
                                #var_dump($reponse);
-                               $id_formulaires_reponse = sql_insertq("spip_formulaires_reponses",$reponse);
+                               $id_formulaires_reponse = sql_insertq('spip_formulaires_reponses', $reponse);
                                #var_dump($id_formulaires_reponse);
-                               if ($id_formulaires_reponse){
-                                       $donnees = sql_allfetsel("$id_formulaires_reponse as id_formulaires_reponse,champ as nom,valeur","spip_forms_donnees_champs","id_donnee=".intval($row['id_donnee']));
+                               if ($id_formulaires_reponse) {
+                                       $donnees = sql_allfetsel("$id_formulaires_reponse as id_formulaires_reponse,champ as nom,valeur", 'spip_forms_donnees_champs', 'id_donnee='.intval($row['id_donnee']));
                                        $data = array();
-                                       foreach($donnees AS $donnee){
+                                       foreach ($donnees as $donnee) {
                                                $data[$donnee['nom']][] = $donnee;
                                        }
                                        $ins = array();
-                                       foreach($data as $nom=>$valeurs){
-                                               if (count($valeurs)==1)
+                                       foreach ($data as $nom => $valeurs) {
+                                               if (count($valeurs) == 1) {
                                                        $ins[] = reset($valeurs);
-                                               else {
+                                               else {
                                                        $v = array();
-                                                       foreach($valeurs as $valeur)
+                                                       foreach ($valeurs as $valeur) {
                                                                $v[] = $valeur['valeur'];
+                                                       }
                                                        $valeurs[0]['valeur'] = serialize($v);
                                                        $ins[] = $valeurs[0];
                                                }
                                        }
-                                       sql_insertq_multi("spip_formulaires_reponses_champs",$ins);
+                                       sql_insertq_multi('spip_formulaires_reponses_champs', $ins);
                                        // et on marque la donnee pour ne pas la rejouer
-                                       sql_update("spip_forms_donnees",array("id_formulaires_reponse"=>$id_formulaires_reponse),"id_donnee=".intval($row['id_donnee']));
+                                       sql_update('spip_forms_donnees', array('id_formulaires_reponse' => $id_formulaires_reponse), 'id_donnee='.intval($row['id_donnee']));
                                }
-                               if (time()>_TIME_OUT)
+                               if (time()>_TIME_OUT) {
                                        return;
+                               }
                        }
-
-                       if (time()>_TIME_OUT)
+                       if (time()>_TIME_OUT) {
                                return;
-
-               } while ($rows = sql_allfetsel("*","spip_forms_donnees",sql_in('id_form',array_keys($trans))." AND id_formulaires_reponse=0",'','id_donnee','0,100'));
-
+                       }
+               } while ($rows = sql_allfetsel('*', 'spip_forms_donnees', sql_in('id_form', array_keys($trans)).' AND id_formulaires_reponse=0', '', 'id_donnee', '0,100'));
        }
 
 }
index 91b3ed6..2551a3e 100644 (file)
@@ -7,7 +7,9 @@
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('action/editer_liens');
 include_spip('inc/config');
@@ -23,17 +25,19 @@ include_spip('inc/config');
  *
 */
 function formidable_autoriser_par_auteur($id, $id_auteur = 0) {
-       if ($id == 0) return true;
+       if ($id == 0) {
+               return true;
+       }
 
        $retour = false;
 
-       if ($id_auteur == 0)
+       if ($id_auteur == 0) {
                $id_auteur = session_get('id_auteur');
-
+       }
        if ($id_auteur == null) {
                $retour = false;
        } else {
-               $autorisations = objet_trouver_liens(array('formulaire'=>$id),array('auteur'=>$id_auteur));
+               $autorisations = objet_trouver_liens(array('formulaire' => $id), array('auteur' => $id_auteur));
                $retour = count($autorisations) > 0;
        }
 
@@ -65,7 +69,8 @@ function formidable_auteur_admin_reponse($qui) {
  * Fonction d'appel pour le pipeline
  * @pipeline autoriser
  */
-function formidable_autoriser(){}
+function formidable_autoriser() {
+}
 
 /**
  * Autorisation d'éditer un formulaire formidable
@@ -79,22 +84,28 @@ function formidable_autoriser(){}
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulaire_editer_dist($faire, $type, $id, $qui, $opt){
+function autoriser_formulaire_editer_dist($faire, $type, $id, $qui, $opt) {
        $auteurs = lire_config('formidable/analyse/auteur');
 
        /* administrateur ? */
-       if (isset($qui['statut']) and $qui['statut'] <= '0minirezo' and (!$qui['restreint']))
+       if (isset($qui['statut']) and $qui['statut'] <= '0minirezo' and (count($qui['restreint']) == 0)) {
                return true;
+       }
 
        /* Test des autorisations par auteur */
        if ($auteurs == 'on') {
                return formidable_autoriser_par_auteur($id);
-       } else {
-               /* dans un else car la config 'auteurs' doit primer sur l'admin restreint */
-               if ($GLOBALS['formulaires']['autoriser_admin_restreint'])
-                       return true;
-               else
-                       return false;
+       }
+
+       /* Test des autorisations pour un admin restreint */
+       if (count($qui['restreint'])) {
+               $autoriser_admin_restreint = isset($GLOBALS['autoriser_admin_restreint'])
+                               ? $GLOBALS['autoriser_admin_restreint']
+                                       : lire_config('formidable/analyse/autoriser_admin_restreint') == 'on'
+                                               ? true
+                                               : false;
+
+               return $autoriser_admin_restreint;
        }
 }
 
@@ -110,9 +121,12 @@ function autoriser_formulaire_editer_dist($faire, $type, $id, $qui, $opt){
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulaires_menu_dist($faire, $type, $id, $qui, $opt){
-    if (isset($qui['statut']) and $qui['statut'] <= '1comite') return true;
-    else return false;
+function autoriser_formulaires_menu_dist($faire, $type, $id, $qui, $opt) {
+       if (isset($qui['statut']) and $qui['statut'] <= '1comite') {
+               return true;
+       } else {
+               return false;
+       }
 }
 
 
@@ -132,39 +146,42 @@ function autoriser_formulaires_menu_dist($faire, $type, $id, $qui, $opt){
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulaire_repondre_dist($faire, $type, $id, $qui, $opt){
-// On regarde si il y a déjà le formulaire dans les options
-    if (isset($options['formulaire']))
-        $formulaire = $options['formulaire'];
-    // Sinon on va le chercher
-    else{
-        $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id);
-    }
-
-    $traitements = unserialize($formulaire['traitements']);
-
-    // S'il n'y a pas d'enregistrement, c'est forcément bon
-    if (!($options = $traitements['enregistrement']))
-        return true;
-    // Sinon faut voir les options
-    else{
-        // Si multiple = oui c'est bon
-        if ($options['multiple'])
-            return true;
-        else{
-            // Si c'est modifiable, c'est bon
-            if ($options['modifiable'])
-                return true;
-            else{
-                include_spip('inc/formidable');
-                // Si la personne n'a jamais répondu, c'est bon
-                if (!formidable_verifier_reponse_formulaire($id))
-                    return true;
-                else
-                    return false;
-            }
-        }
-    }
+function autoriser_formulaire_repondre_dist($faire, $type, $id, $qui, $opt) {
+       $id = intval($id);
+
+       // On regarde si il y a déjà le formulaire dans les options
+       if (isset($opt['formulaire'])) {
+               $formulaire = $opt['formulaire'];
+       } else {
+               // Sinon on va le chercher
+               $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id);
+       }
+
+       $traitements = unserialize($formulaire['traitements']);
+
+       // S'il n'y a pas d'enregistrement, c'est forcément bon
+       if (!isset($traitements['enregistrement']) or !($options = $traitements['enregistrement'])) {
+               return true;
+       } else {
+               // Sinon faut voir les options
+               // Si multiple = oui c'est bon
+               if ($options['multiple']) {
+                       return true;
+               } else {
+                       // Si c'est modifiable, c'est bon
+                       if ($options['modifiable']) {
+                               return true;
+                       } else {
+                               include_spip('inc/formidable');
+                               // Si la personne n'a jamais répondu, c'est bon
+                               if (!formidable_verifier_reponse_formulaire($id)) {
+                                       return true;
+                               } else {
+                                       return false;
+                               }
+                       }
+               }
+       }
 }
 
 /**
@@ -200,7 +217,7 @@ function autoriser_formulaire_modifier_dist($faire, $type, $id, $qui, $opt) {
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulairesreponse_instituer_dist($faire, $type, $id, $qui, $opt){
+function autoriser_formulairesreponse_instituer_dist($faire, $type, $id, $qui, $opt) {
        return formidable_auteur_admin_reponse($qui);
 }
 
@@ -216,7 +233,7 @@ function autoriser_formulairesreponse_instituer_dist($faire, $type, $id, $qui, $
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulairesreponse_voir_dist($faire, $type, $id, $qui, $opt){
+function autoriser_formulairesreponse_voir_dist($faire, $type, $id, $qui, $opt) {
        return autoriser_formulaire_editer_dist($faire, $type, $id, $qui, $opt);
 }
 
@@ -233,14 +250,22 @@ function autoriser_formulairesreponse_voir_dist($faire, $type, $id, $qui, $opt){
  * @param  array  $opt   Options de cette autorisation
  * @return bool          true s'il a le droit, false sinon
 **/
-function autoriser_formulairesreponse_modifier_dist($faire, $type, $id, $qui, $opt){
-    if ($id_formulaire = intval(sql_getfetsel(
-                       'id_formulaire', 'spip_formulaires_reponses', "id_formulaires_reponse=$id"))) {
+function autoriser_formulairesreponse_modifier_dist($faire, $type, $id, $qui, $opt) {
+       $id = intval($id);
 
-               $retour = (autoriser_formulaire_editer_dist($faire, $type, $id_formulaire, $qui, $opt)
-                               and formidable_auteur_admin_reponse($qui));
+       if ($id_formulaire = intval(
+               sql_getfetsel(
+                       'id_formulaire',
+                       'spip_formulaires_reponses',
+                       "id_formulaires_reponse=$id"
+               )
+       )) {
+               return
+                       autoriser_formulaire_editer_dist($faire, $type, $id_formulaire, $qui, $opt)
+                       and formidable_auteur_admin_reponse($qui);
        }
-       return $retour;
+
+       return false;
 }
 
 /**
@@ -257,7 +282,22 @@ function autoriser_formulairesreponse_modifier_dist($faire, $type, $id, $qui, $o
 **/
 function autoriser_formulairesreponse_supprimer_dist($faire, $type, $id, $qui, $opt) {
        $retour = autoriser_formulairesreponse_modifier_dist($faire, $type, $id, $qui, $opt);
+
        return $retour;
 }
 
-?>
+/**
+ * Autorisation de poster une réponse en Collection+JSON
+ *
+ * Tout le monde peut, l'autorisation réelle se fera après pendant le traitement, suivant l'id_formulaire envoyé
+ *
+ * @param  string $faire Action demandée
+ * @param  string $type  Type d'objet sur lequel appliquer l'action
+ * @param  int    $id    Identifiant de l'objet
+ * @param  array  $qui   Description de l'auteur demandant l'autorisation
+ * @param  array  $opt   Options de cette autorisation
+ * @return bool          true s'il a le droit, false sinon
+**/
+function autoriser_formulairesreponse_post_collection_dist($faire, $type, $id, $qui, $opt) {
+       return true;
+}
index d3a7524..0655172 100644 (file)
@@ -1,11 +1,15 @@
 <?php
 
 /**
- * Chargement des fonctions pour les squelettes 
+ * Chargement des fonctions pour les squelettes
  *
  * @package SPIP\Formidable\Fonctions
 **/
 
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
 include_spip('inc/formidable');
 include_spip('public/formidable_criteres');
 
@@ -17,8 +21,12 @@ include_spip('public/formidable_criteres');
  */
 function balise_VOIR_REPONSE_dist($p) {
        $nom = interprete_argument_balise(1, $p);
-       if (!$type_retour = interprete_argument_balise(2, $p)) { $type_retour = 'null'; }
-       if (!$sans_reponse = interprete_argument_balise(3, $p)) { $sans_reponse = 'null'; }
+       if (!$type_retour = interprete_argument_balise(2, $p)) {
+               $type_retour = 'null';
+       }
+       if (!$sans_reponse = interprete_argument_balise(3, $p)) {
+               $sans_reponse = 'null';
+       }
        $id_formulaires_reponse = champ_sql('id_formulaires_reponse', $p);
        $id_formulaire = champ_sql('id_formulaire', $p);
        $p->code = "calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $nom, $type_retour, $sans_reponse)";
@@ -37,11 +45,11 @@ function balise_VOIR_REPONSE_dist($p) {
  *   texte affiche si aucune valeur en base pour ce champ
  * @return array|string
  */
-function calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $nom, $type_retour=null, $sans_reponse=null){
+function calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $nom, $type_retour = null, $sans_reponse = null) {
        static $formulaires_saisies = array();
        static $reponses_valeurs = array();
        $tenter_unserialize = charger_fonction('tenter_unserialize', 'filtre/');
-       
+
        // Si pas déjà présent, on cherche les saisies de ce formulaire
        if (is_null($formulaires_saisies[$id_formulaire])) {
                $formulaires_saisies[$id_formulaire] = unserialize(sql_getfetsel('saisies', 'spip_formulaires', 'id_formulaire = '.intval($id_formulaire)));
@@ -54,12 +62,12 @@ function calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $nom, $t
                        }
                }
        }
-       
+
        // Si on demande la valeur brute, on ne génère rien, on renvoie telle quelle
        if ($type_retour == 'brut') {
                return $reponses_valeurs[$id_formulaires_reponse][$nom];
        }
-       
+
        // Si on trouve bien la saisie demandée
        if ($saisie = saisies_chercher($formulaires_saisies[$id_formulaire], $nom)) {
                // On génère la vue de cette saisie avec la valeur trouvée précédemment
@@ -86,41 +94,45 @@ function calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $nom, $t
  * @param string $resume_reponse
  * @return string
  */
-function affiche_resume_reponse($id_formulaires_reponse, $id_formulaire=null, $modele_resume=null){
+function affiche_resume_reponse($id_formulaires_reponse, $id_formulaire = null, $modele_resume = null) {
        static $modeles_resume = array();
        static $modeles_vars = array();
 
-       if (is_null($id_formulaire)){
-               $id_formulaire = sql_getfetsel("id_formulaire","spip_formulaires_reponses","id_formulaires_reponse=".intval($id_formulaires_reponse));
+       if (is_null($id_formulaire)) {
+               $id_formulaire = sql_getfetsel('id_formulaire', 'spip_formulaires_reponses', 'id_formulaires_reponse='.intval($id_formulaires_reponse));
        }
-       if (is_null($modele_resume) AND !isset($modeles_resume[$id_formulaire])){
-               $modeles_resume[$id_formulaire] = sql_getfetsel("resume_reponse","spip_formulaires","id_formulaire=".intval($id_formulaire));
+       if (is_null($modele_resume) and !isset($modeles_resume[$id_formulaire])) {
+               $modeles_resume[$id_formulaire] = sql_getfetsel('resume_reponse', 'spip_formulaires', 'id_formulaire='.intval($id_formulaire));
        }
-       if (is_null($modele_resume))
+       if (is_null($modele_resume)) {
                $modele_resume = $modeles_resume[$id_formulaire];
+       }
 
-       if (!$modele_resume)
-               return "";
+       if (!$modele_resume) {
+               return '';
+       }
 
-       if (!isset($modeles_vars[$modele_resume])){
-               preg_match_all(",@(.*)@,Uims",$modele_resume,$matches);
+       if (!isset($modeles_vars[$modele_resume])) {
+               preg_match_all(',@(.*)@,Uims', $modele_resume, $matches);
                $modeles_vars[$modele_resume] = $matches[1];
        }
 
        $valeurs = array();
-       foreach($modeles_vars[$modele_resume] as $var){
+       foreach ($modeles_vars[$modele_resume] as $var) {
                $valeur = calculer_voir_reponse($id_formulaires_reponse, $id_formulaire, $var, 'valeur_uniquement', '');
-               $valeur = str_ireplace("</p>","",$valeur); // on ne veut pas du \n de PtoBR, mais on ne veut pas non plus faire un trim
+               // on ne veut pas du \n de PtoBR, mais on ne veut pas non plus faire un trim
+               $valeur = str_ireplace('</p>', '', $valeur);
                $valeur = PtoBR($valeur);
-               if (strpos($valeur,"</li>")){
-                       $valeur = explode("</li>",$valeur);
+               if (strpos($valeur, '</li>')) {
+                       $valeur = explode('</li>', $valeur);
                        array_pop($valeur);
-                       $valeur = implode(", ",$valeur);
+                       $valeur = implode(', ', $valeur);
                }
                $valeur = supprimer_tags($valeur);
                $valeurs["@$var@"] = $valeur;
        }
-       return pipeline('formidable_affiche_resume_reponse',
+       return pipeline(
+               'formidable_affiche_resume_reponse',
                array(
                        'args' => array(
                                'id_formulaire' => $id_formulaire,
@@ -128,7 +140,7 @@ function affiche_resume_reponse($id_formulaires_reponse, $id_formulaire=null, $m
                                'modele_resume' => $modele_resume,
                                'valeurs' => $valeurs,
                        ),
-                       'data' => str_replace(array_keys($valeurs),array_values($valeurs),$modele_resume),
+                       'data' => str_replace(array_keys($valeurs), array_values($valeurs), $modele_resume),
                )
        );
-}
\ No newline at end of file
+}
index e501114..c34a0cc 100644 (file)
@@ -7,8 +7,9 @@
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /* déclaration des différentes variables utilisées pour effectuer l'anonymisation */
 $GLOBALS['formulaires']['variables_anonymisation'] = array(
@@ -26,27 +27,21 @@ if (isset($GLOBALS['formulaires']['passwd']) == false) {
        );
 }
 
-if (isset($GLOBALS['formulaires']['autoriser_admin_restreint']) == false) {
-       $GLOBALS['formulaires']['autoriser_admin_restreint'] = false;
-}
-
 if (!function_exists('array_fill_keys')) {
-    /**
-     * Remplit un tableau avec des valeurs, en spécifiant les clés
-     *
-     * Fonction dans PHP 5.2+
-     * @see http://php.net/manual/fr/function.array-fill-keys.php
-     *
-     * @param array $keys
-     *     Tableau de valeurs qui sera utilisé comme clés.
-     * @param mixed $value
-     *     Valeur à utiliser pour remplir le tableau.
-     * @return array
-     *     Le tableau rempli.
-    **/
-    function array_fill_keys($keys, $value){
-        array_combine($keys,array_fill(0,count($keys),$value));
-    }
+       /**
+        * Remplit un tableau avec des valeurs, en spécifiant les clés
+        *
+        * Fonction dans PHP 5.2+
+        * @see http://php.net/manual/fr/function.array-fill-keys.php
+        *
+        * @param array $keys
+        *       Tableau de valeurs qui sera utilisé comme clés.
+        * @param mixed $value
+        *       Valeur à utiliser pour remplir le tableau.
+        * @return array
+        *       Le tableau rempli.
+       **/
+       function array_fill_keys($keys, $value) {
+               array_combine($keys, array_fill(0, count($keys), $value));
+       }
 }
-
-?>
index 71f119d..bb7ef9c 100644 (file)
@@ -2,50 +2,64 @@
 
 /**
  * Utilisation de pipelines
- * 
+ *
  * @package SPIP\Formidable\Pipelines
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-define('_RACCOURCI_MODELE_FORMIDABLE',
-        '(<(formulaire\|formidable|formidable|form)' # <modele
+define(
+       '_RACCOURCI_MODELE_FORMIDABLE',
+       '(<(formulaire\|formidable|formidable|form)' # <modele
        .'([0-9]*)\s*' # id
        .'([|](?:<[^<>]*>|[^>])*)?' # |arguments (y compris des tags <...>)
        .'>)' # fin du modele >
        .'\s*(<\/a>)?' # eventuel </a>
-       );
+);
+
+/**
+ * Ajouter la protection NoSpam de base a formidable (jeton)
+ *
+ * @param $formulaires
+ * @return array
+ */
+function formidable_nospam_lister_formulaires($formulaires) {
+       $formulaires[] = 'formidable';
+       return $formulaires;
+}
 
 /**
  * Trouver les liens <form
  * @param $texte
  * @return array
  */
-function formidable_trouve_liens($texte){
+function formidable_trouve_liens($texte) {
        $formulaires = array();
-       if (preg_match_all(','._RACCOURCI_MODELE_FORMIDABLE.',ims', $texte, $regs, PREG_SET_ORDER)){
+       if (preg_match_all(','._RACCOURCI_MODELE_FORMIDABLE.',ims', $texte, $regs, PREG_SET_ORDER)) {
                foreach ($regs as $r) {
                        $id_formulaire = 0;
-                       if ($r[2]=="formidable")
+                       if ($r[2] == 'formidable') {
                                $id_formulaire = $r[3];
-                       elseif ($r[2]=="form")
-                               $id_formulaire = sql_getfetsel("id_formulaire","spip_formulaires","identifiant=".sql_quote("form".$r[3]));
-                       elseif ($r[2]=="formulaire|formidable"){
-                               $args = ltrim($r[4],"|");
-                               $args = explode("=",$args);
+                       } elseif ($r[2] == 'form') {
+                               $id_formulaire = sql_getfetsel('id_formulaire', 'spip_formulaires', 'identifiant='.sql_quote('form'.$r[3]));
+                       } elseif ($r[2] == 'formulaire|formidable') {
+                               $args = ltrim($r[4], '|');
+                               $args = explode('=', $args);
                                $args = $args[1];
-                               $args = explode("|",$args);
+                               $args = explode('|', $args);
                                $args = trim(reset($args));
-                               if (is_numeric($args))
+                               if (is_numeric($args)) {
                                        $id_formulaire = intval($args);
-                               else
-                                       $id_formulaire = sql_getfetsel("id_formulaire","spip_formulaires","identifiant=".sql_quote($args));
+                               } else {
+                                       $id_formulaire = sql_getfetsel('id_formulaire', 'spip_formulaires', 'identifiant='.sql_quote($args));
+                               }
                        }
-                       if ($id_formulaire = intval($id_formulaire))
+                       if ($id_formulaire = intval($id_formulaire)) {
                                $formulaires[$id_formulaire] = $id_formulaire;
+                       }
                }
        }
        return $formulaires;
@@ -56,31 +70,33 @@ function formidable_trouve_liens($texte){
  * @param $flux
  * @return mixed
  */
-function formidable_post_edition($flux){
-       if ($table = $flux['args']['table']
-         AND $id_objet = intval($flux['args']['id_objet'])
-               AND $primary = id_table_objet($table)
-         AND $row = sql_fetsel("*",$table,"$primary=".intval($id_objet))){
-
+function formidable_post_edition($flux) {
+       if (isset($flux['args']['table'])
+               and $table = $flux['args']['table']
+               and $id_objet = intval($flux['args']['id_objet'])
+               and $primary = id_table_objet($table)
+               and $row = sql_fetsel('*', $table, "$primary=".intval($id_objet))
+       ) {
                $objet = objet_type($table);
-               $contenu = implode(' ',$row);
+               $contenu = implode(' ', $row);
                $formulaires = formidable_trouve_liens($contenu);
-               include_spip("action/editer_liens");
-               $deja = objet_trouver_liens(array("formulaire"=>"*"),array($objet=>$id_objet));
+               include_spip('action/editer_liens');
+               $deja = objet_trouver_liens(array('formulaire' => '*'), array($objet => $id_objet));
                $del = array();
-               if (count($deja)){
-                       foreach($deja as $l){
-                               if (isset($formulaires[$l['id_formulaire']]))
+               if (count($deja)) {
+                       foreach ($deja as $l) {
+                               if (isset($formulaires[$l['id_formulaire']])) {
                                        unset($formulaires[$l['id_formulaire']]);
-                               else
+                               } else {
                                        $del[] = $l['id_formulaire'];
+                               }
                        }
                }
-               if (count($formulaires)){
-                       objet_associer(array("formulaire"=>$formulaires),array($objet=>$id_objet));
+               if (count($formulaires)) {
+                       objet_associer(array('formulaire' => $formulaires), array($objet => $id_objet));
                }
-               if (count($del)){
-                       objet_dissocier(array("formulaire"=>$del),array($objet=>$id_objet));
+               if (count($del)) {
+                       objet_dissocier(array('formulaire' => $del), array($objet=>$id_objet));
                }
        }
        return $flux;
@@ -91,29 +107,56 @@ function formidable_post_edition($flux){
  * @param $flux
  * @return mixed
  */
-function formidable_affiche_droite($flux){
+function formidable_affiche_droite($flux) {
        if ($e = trouver_objet_exec($flux['args']['exec'])
-               AND isset($e['type'])
-               AND $objet = $e['type']
-               AND isset($flux['args'][$e['id_table_objet']])
-         AND $id = $flux['args'][$e['id_table_objet']]
-         AND sql_countsel("spip_formulaires_liens","objet=".sql_quote($objet)." AND id_objet=".intval($id))){
+               and isset($e['type'])
+               and $objet = $e['type']
+               and isset($flux['args'][$e['id_table_objet']])
+               and $id = $flux['args'][$e['id_table_objet']]
+               and sql_countsel('spip_formulaires_liens', 'objet='.sql_quote($objet).' AND id_objet='.intval($id))) {
+               $flux['data'] .= recuperer_fond('prive/squelettes/inclure/formulaires_lies', array('objet' => $objet, 'id_objet' => $id));
+       }
+       return $flux;
+}
 
-               $flux['data'] .= recuperer_fond('prive/squelettes/inclure/formulaires_lies',array('objet'=>$objet,'id_objet'=>$id));
+/**
+ * Afficher l'édition des liens sur les objets configurés
+ **/
+function formidable_affiche_milieu($flux) {
+       include_spip('inc/config');
+       $texte = "";
+       $e = trouver_objet_exec($flux['args']['exec']);
+       
+       if (!$e['edition'] and in_array($e['table_objet_sql'], lire_config('formidable/analyse/objets', array()))) {
+               $texte .= recuperer_fond('prive/objets/editer/liens', array(
+                       'table_source' => 'formulaires',
+                       'objet' => $e['type'],
+                       'id_objet' => $flux['args'][$e['id_table_objet']]
+               ));
        }
+       
+       if ($texte) {
+               if ($p=strpos($flux['data'], '<!--affiche_milieu-->')) {
+                       $flux['data'] = substr_replace($flux['data'], $texte, $p, 0);
+               }
+               else {
+                       $flux['data'] .= $texte;
+               }
+       }
+       
        return $flux;
 }
 
 /**
  * Optimiser la base de donnée en enlevant les liens de formulaires supprimés
- * 
+ *
  * @pipeline optimiser_base_disparus
  * @param array $flux
  *     Données du pipeline
  * @return array
  *     Données du pipeline
  */
-function formidable_optimiser_base_disparus($flux){
+function formidable_optimiser_base_disparus($flux) {
        // Les formulaires qui sont à la poubelle
        $res = sql_select(
                'id_formulaire AS id',
@@ -126,12 +169,11 @@ function formidable_optimiser_base_disparus($flux){
 
 
        # les reponses qui sont associees a un formulaire inexistant
-       $res = sql_select("R.id_formulaire AS id",
-                       "spip_formulaires_reponses AS R
-                       LEFT JOIN spip_formulaires AS F
-                         ON R.id_formulaire=F.id_formulaire",
-                        "R.id_formulaire > 0
-                        AND F.id_formulaire IS NULL");
+       $res = sql_select(
+               'R.id_formulaire AS id',
+               'spip_formulaires_reponses AS R LEFT JOIN spip_formulaires AS F ON R.id_formulaire=F.id_formulaire',
+               'R.id_formulaire > 0 AND F.id_formulaire IS NULL'
+       );
 
        $flux['data'] += optimiser_sansref('spip_formulaires_reponses', 'id_formulaire', $res);
 
@@ -140,20 +182,19 @@ function formidable_optimiser_base_disparus($flux){
        $res = sql_select(
                'id_formulaires_reponse AS id',
                'spip_formulaires_reponses',
-               sql_in('statut',array('refuse','poubelle'))
+               sql_in('statut', array('refuse', 'poubelle'))
        );
-       
+
        // On génère la suppression
        $flux['data'] += optimiser_sansref('spip_formulaires_reponses', 'id_formulaires_reponse', $res);
 
 
        // les champs des reponses associes a une reponse inexistante
-       $res = sql_select("C.id_formulaires_reponse AS id",
-                       "spip_formulaires_reponses_champs AS C
-                       LEFT JOIN spip_formulaires_reponses AS R
-                         ON C.id_formulaires_reponse=R.id_formulaires_reponse",
-                        "C.id_formulaires_reponse > 0
-                        AND R.id_formulaires_reponse IS NULL");
+       $res = sql_select(
+               'C.id_formulaires_reponse AS id',
+               'spip_formulaires_reponses_champs AS C LEFT JOIN spip_formulaires_reponses AS R ON C.id_formulaires_reponse=R.id_formulaires_reponse',
+               'C.id_formulaires_reponse > 0 AND R.id_formulaires_reponse IS NULL'
+       );
 
        $flux['data'] += optimiser_sansref('spip_formulaires_reponses_champs', 'id_formulaires_reponse', $res);
 
@@ -168,7 +209,7 @@ function formidable_optimiser_base_disparus($flux){
        if (!defined('_CNIL_PERIODE')) {
                define('_CNIL_PERIODE', 3600*24*31*4);
        }
-       
+
        if (_CNIL_PERIODE) {
                $critere_cnil = 'date<"'.date('Y-m-d', time()-_CNIL_PERIODE).'"'
                        . ' AND statut != "spam"'
@@ -179,8 +220,6 @@ function formidable_optimiser_base_disparus($flux){
                        sql_update('spip_formulaires_reponses', array('ip' => 'MD5(ip)'), $critere_cnil);
                }
        }
-       
+
        return $flux;
 }
-
-?>
\ No newline at end of file
index 9509faa..302019b 100644 (file)
@@ -8,10 +8,10 @@
        <form method="post" action="#ENV{action}">
        <div>
                #ACTION_FORMULAIRE{#ENV{action}}
-
-               [(#SAISIE{input,classe,
-                       label=<:formidable:cfg_analyse_classe_label:>,
-                       explication=<:formidable:cfg_analyse_classe_explication:>
+               
+               [(#SAISIE{choisir_objets,objets,
+                       label=<:formidable:cfg_objets_label:>,
+                       explication=<:formidable:cfg_objets_explication:>
                        })]
                [(#SAISIE{case,auteur,
                        li_class='pleine_largeur',
                        label_case=<:formidable:activer_pages_label:>,
                        explication=<:formidable:activer_pages_explication:>
                        })]
+               [(#SAISIE{case,autoriser_admin_restreint,
+                       li_class='pleine_largeur',
+                       label_case=<:formidable:autoriser_admin_restreint:>,
+                       explication=<:formidable:autoriser_admin_restreint_explication:>
+                       })]
+               [(#SAISIE{input,classe,
+                       label=<:formidable:cfg_analyse_classe_label:>,
+                       explication=<:formidable:cfg_analyse_classe_explication:>
+                       })]
 
                <input type="hidden" name="_meta_casier" value="formidable/analyse" />
                <p class="boutons"><span class="image_loading">&nbsp;</span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p>
index 02effa9..0fd4c56 100644 (file)
@@ -7,7 +7,7 @@
                parametre : url d'action ]
                #ACTION_FORMULAIRE{#ENV{action}}
                
-               <ul>
+               <ul class="editer-groupe">
                        #SET{name,titre}#SET{obli,'obligatoire'}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
                        <li class="editer editer_[(#GET{name})][ (#GET{obli})] multilang[ (#GET{erreurs}|oui)erreur]">
                                <label for="#GET{name}"><:formidable:editer_titre:></label>[
                                <textarea name="#GET{name}" class="textarea" rows="5">
 #ENV*{#GET{name},#GET{defaut}}</textarea>
                        </li>
+                       #SET{name,css}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:formidable:editer_css:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                       </li>
                        #SET{name,apres}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
                        <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
                                <label for="#GET{name}"><:formidable:editer_apres_label:></label>[
@@ -69,6 +75,7 @@
                                ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
                                <p class="explication"><:formidable:editer_resume_reponse_explication:></p>
                        </li>
+                       #INCLURE{fond=formulaires/inc-formidable-unicite, env}
                </ul>
                
                [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
index 724c55f..47dafa3 100644 (file)
@@ -1,58 +1,61 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/saisies');
 include_spip('action/editer_liens');
 include_spip('inc/config');
 
-function formulaires_editer_formulaire_charger($id_formulaire, $nouveau){
+function formulaires_editer_formulaire_charger($id_formulaire, $nouveau) {
        $id_formulaire = intval($nouveau?0:$id_formulaire);
        include_spip('inc/editer');
 
        // Est-ce qu'on a le droit ?
-       if (!autoriser('editer', 'formulaire', $id_formulaire)){
+       if (!autoriser('editer', 'formulaire', $id_formulaire)) {
                $contexte = array();
                $contexte['editable'] = false;
                $contexte['message_erreur'] = _T('formidable:erreur_autorisation');
+       } else {
+               $contexte = formulaires_editer_objet_charger('formulaire', $id_formulaire, 0, 0, '', '');
        }
-       else
-               $contexte = formulaires_editer_objet_charger('formulaire', $id_formulaire,0,0,'','');
        unset($contexte['id_formulaire']);
-       
+
        return $contexte;
 }
 
-function formulaires_editer_formulaire_verifier($id_formulaire, $nouveau){
+function formulaires_editer_formulaire_verifier($id_formulaire, $nouveau) {
        $id_formulaire = intval($nouveau?0:$id_formulaire);
        $erreurs = array();
 
        include_spip('inc/editer');
-       $erreurs = formulaires_editer_objet_verifier('formulaire',$id_formulaire,array('titre','identifiant'));
+       $erreurs = formulaires_editer_objet_verifier('formulaire', $id_formulaire, array('titre', 'identifiant'));
 
-       if (!isset($erreurs['identifiant'])){
+       if (!isset($erreurs['identifiant'])) {
                $identifiant = _request('identifiant');
                // format de l'identifiant
-               if (!preg_match("/^[\w]+$/",$identifiant))
+               if (!preg_match('/^[\w]+$/', $identifiant)) {
                        $erreurs['identifiant'] = _T('formidable:erreur_identifiant_format');
-               // unicite de l'identifiant
-               elseif (sql_getfetsel('id_formulaire', 'spip_formulaires', 'identifiant = '.sql_quote($identifiant).' AND id_formulaire != '.intval($id_formulaire)))
+               } elseif (sql_getfetsel('id_formulaire', 'spip_formulaires', 'identifiant = '.sql_quote($identifiant).' AND id_formulaire != '.intval($id_formulaire))) {
+                       // unicite de l'identifiant
                        $erreurs['identifiant'] = _T('formidable:erreur_identifiant');
+               }
        }
 
        return $erreurs;
 }
 
-function formulaires_editer_formulaire_traiter($id_formulaire, $nouveau){
+function formulaires_editer_formulaire_traiter($id_formulaire, $nouveau) {
        include_spip('inc/editer');
        $id_formulaire = $id_formulaire ? $id_formulaire : $nouveau;
        $retours = formulaires_editer_objet_traiter('formulaire', $id_formulaire);
-       
+
        // S'il n'y a pas d'erreur et que le formulaire est bien là
-       if (!$retours['message_erreur'] and $retours['id_formulaire'] > 0){
+       if (empty($retours['message_erreur']) and $retours['id_formulaire'] > 0) {
                // Si c'était un nouveau on reste sur l'édition
-               if (!intval($id_formulaire) and $nouveau == 'oui'){
+               if (!intval($id_formulaire) and $nouveau == 'oui') {
                        // Tout a fonctionné. En fonction de la config, on attribue l'auteur courant
                        $auteurs = lire_config('formidable/analyse/auteur');
                        if ($auteurs == 'on') {
@@ -62,14 +65,11 @@ function formulaires_editer_formulaire_traiter($id_formulaire, $nouveau){
                                }
                        }
                        $retours['redirect'] = parametre_url(generer_url_ecrire('formulaire_edit'), 'id_formulaire', $retours['id_formulaire'], '&');
-               }
-               // Sinon on redirige vers la page de visualisation
-               else{
+               } else {
+                       // Sinon on redirige vers la page de visualisation
                        $retours['redirect'] = parametre_url(generer_url_ecrire('formulaire'), 'id_formulaire', $retours['id_formulaire'], '&');
                }
        }
-       
+
        return $retours;
 }
-
-?>
index 1e825d1..bb70bf7 100644 (file)
@@ -1,71 +1,74 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function formulaires_editer_formulaire_champs_charger($id_formulaire){
+function formulaires_editer_formulaire_champs_charger($id_formulaire) {
        $contexte = array();
        $id_formulaire = intval($id_formulaire);
-       
+
        // On teste si le formulaire existe
        if ($id_formulaire
                and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id_formulaire)
                and autoriser('editer', 'formulaire', $id_formulaire)
-       ){
+       ) {
                $saisies = unserialize($formulaire['saisies']);
-               if (!is_array($saisies)) $saisies = array();
+               if (!is_array($saisies)) {
+                       $saisies = array();
+               }
                $contexte['_saisies'] = $saisies;
                $contexte['id'] = $id_formulaire;
                $contexte['saisie_id'] = "formidable_$id_formulaire";
        }
-       
+
        return $contexte;
 }
 
-function formulaires_editer_formulaire_champs_verifier($id_formulaire){
+function formulaires_editer_formulaire_champs_verifier($id_formulaire) {
        include_spip('inc/saisies');
        $erreurs = array();
-       
+
        // Si c'est pas une confirmation ni une annulation
        if (!_request('enregistrer_confirmation')
-               AND !($annulation = _request('annulation'))){
+               and !($annulation = _request('annulation'))) {
                // On récupère le formulaire dans la session
                $saisies_nouvelles = session_get("constructeur_formulaire_formidable_$id_formulaire");
-       
+
                // On récupère les anciennes saisies
                $saisies_anciennes = unserialize(sql_getfetsel(
                        'saisies',
                        'spip_formulaires',
                        'id_formulaire = '.$id_formulaire
                ));
-       
+
                // On compare
                $comparaison = saisies_comparer($saisies_anciennes, $saisies_nouvelles);
-       
+
                // S'il y a des suppressions, on demande confirmation avec attention
-               if ($comparaison['supprimees'])
+               if ($comparaison['supprimees']) {
                        $erreurs['message_erreur'] = _T('saisies:construire_attention_supprime');
-       }
-       // Si on annule on génère une erreur bidon juste pour réafficher le formulaire
-       elseif ($annulation){
+               }
+       } elseif ($annulation) {
+               // Si on annule on génère une erreur bidon juste pour réafficher le formulaire
                $erreurs['pouetpouet'] = true;
        }
-       
+
        return $erreurs;
 }
 
-function formulaires_editer_formulaire_champs_traiter($id_formulaire){
+function formulaires_editer_formulaire_champs_traiter($id_formulaire) {
        include_spip('inc/saisies');
        $retours = array();
        $id_formulaire = intval($id_formulaire);
 
-       if (_request('revert')){
+       if (_request('revert')) {
                session_set("constructeur_formulaire_formidable_$id_formulaire");
                $retours = array('editable'=>true);
        }
 
-       if (_request('enregistrer') OR _request('enregistrer_confirmation')){
+       if (_request('enregistrer') or _request('enregistrer_confirmation')) {
                // On récupère le formulaire dans la session
                $saisies_nouvelles = session_get("constructeur_formulaire_formidable_$id_formulaire");
 
@@ -85,8 +88,9 @@ function formulaires_editer_formulaire_champs_traiter($id_formulaire){
                        'id_formulaire = '.$id_formulaire
                );
 
-               // Si c'est bon on appelle d'éventuelles fonctions d'update des traitements puis on renvoie vers la config des traitements
-               if ($ok){
+               // Si c'est bon on appelle d'éventuelles fonctions d'update des traitements
+               // puis on renvoie vers la config des traitements
+               if ($ok) {
                        // On va chercher les traitements
                        $traitements = unserialize(sql_getfetsel(
                                'traitements',
@@ -95,29 +99,29 @@ function formulaires_editer_formulaire_champs_traiter($id_formulaire){
                        ));
 
                        // Pour chaque traitements on regarde s'i y a une fonction d'update
-                       if (is_array($traitements))
-                               foreach ($traitements as $type_traitement => $traitement){
-                                       if ($update = charger_fonction('update', "traiter/$type_traitement", true)){
+                       if (is_array($traitements)) {
+                               foreach ($traitements as $type_traitement => $traitement) {
+                                       if ($update = charger_fonction('update', "traiter/$type_traitement", true)) {
                                                $update($id_formulaire, $traitement, $saisies_anciennes, $saisies_nouvelles);
                                        }
                                }
-
+                       }
                        // On redirige vers la config suivante
                        $retours['redirect'] = parametre_url(
                                parametre_url(
                                        parametre_url(
-                                               generer_url_ecrire('formulaire_edit')
-                                               , 'id_formulaire', $id_formulaire
-                                       )
-                                       , 'configurer', 'traitements'
-                               )
-                               , 'avertissement', 'oui'
+                                               generer_url_ecrire('formulaire_edit'),
+                                               'id_formulaire',
+                                               $id_formulaire
+                                       ),
+                                       'configurer',
+                                       'traitements'
+                               ),
+                               'avertissement',
+                               'oui'
                        );
                }
        }
 
-       
        return $retours;
 }
-
-?>
index 07bf8dd..8ab2a74 100644 (file)
@@ -8,9 +8,9 @@
                parametre : url d'action ]
                #ACTION_FORMULAIRE{#ENV{action}}
                
-               <ul>
+               <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">
                        #GENERER_SAISIES{#ENV{_configurer_traitements}}
-               </ul>
+               </[(#VAL{ul}|saisie_balise_structure_formulaire)]>
                
                [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
                <!--extra-->
index 274a01d..4eedb79 100644 (file)
@@ -1,31 +1,37 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/formidable');
 
-function formulaires_editer_formulaire_traitements_charger($id_formulaire){
+function formulaires_editer_formulaire_traitements_charger($id_formulaire) {
        $contexte = array();
        $id_formulaire = intval($id_formulaire);
-       
+
        // On teste si le formulaire existe
        if ($id_formulaire
                and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id_formulaire)
                and autoriser('editer', 'formulaire', $id_formulaire)
-       ){
+       ) {
                $traitements = unserialize($formulaire['traitements']);
                $saisies = unserialize($formulaire['saisies']);
-               if (!is_array($traitements)) $traitements = array();
-               if (!is_array($saisies)) $saisies = array();
+               if (!is_array($traitements)) {
+                       $traitements = array();
+               }
+               if (!is_array($saisies)) {
+                       $saisies = array();
+               }
                $contexte['traitements'] = $traitements;
                $contexte['traitements_choisis'] = array_keys($traitements);
                $contexte['formulaire'] = _T_ou_typo($saisies, 'multi');
                $contexte['id'] = $id_formulaire;
-               
+
                $traitements_disponibles = traitements_lister_disponibles();
                $configurer_traitements = array();
-               foreach ($traitements_disponibles as $type_traitement => $traitement){
+               foreach ($traitements_disponibles as $type_traitement => $traitement) {
                        $configurer_traitements[] = array(
                                'saisie' => 'checkbox',
                                'options' => array(
@@ -49,47 +55,49 @@ function formulaires_editer_formulaire_traitements_charger($id_formulaire){
                $contexte['_configurer_traitements'] = $configurer_traitements;
 
                // Si on demande un avertissement et qu'il y a déjà des traitements de configurés
-               if (_request('avertissement') == 'oui')
+               if (_request('avertissement') == 'oui') {
                        $contexte['message_ok'] = $traitements ? _T('formidable:traitements_avertissement_modification') : _T('formidable:traitements_avertissement_creation');
-       }
-       else{
+               }
+       } else {
                $contexte['editable'] = false;
        }
-       
+
        // On enlève l'éventuel avertissement pour le prochain envoi
        $contexte['action'] = parametre_url(self(), 'avertissement', '');
-       
+
        return $contexte;
 }
 
-function formulaires_editer_formulaire_traitements_verifier($id_formulaire){
+function formulaires_editer_formulaire_traitements_verifier($id_formulaire) {
        include_spip('inc/saisies');
        $erreurs = array();
        $traitements_disponibles = traitements_lister_disponibles();
-       
+
        // On regarde quels traitements sont demandés
        $traitements_choisis = _request('traitements_choisis');
-       
-       if (is_array($traitements_choisis))
-               foreach ($traitements_choisis as $type_traitement){
+
+       if (is_array($traitements_choisis)) {
+               foreach ($traitements_choisis as $type_traitement) {
                        $erreurs = array_merge($erreurs, saisies_verifier(saisies_transformer_noms($traitements_disponibles[$type_traitement]['options'], '/^.*$/', "traitements[$type_traitement][\\0]")));
                }
-       
+       }
        return $erreurs;
 }
 
-function formulaires_editer_formulaire_traitements_traiter($id_formulaire){
+function formulaires_editer_formulaire_traitements_traiter($id_formulaire) {
        $retours = array();
        $id_formulaire = intval($id_formulaire);
-       
+
        // On récupère tout le tableau des traitements
        $traitements = _request('traitements');
        // On ne garde que les morceaux qui correspondent aux traitements choisis
        $traitements_choisis = _request('traitements_choisis');
-       if (!$traitements_choisis) $traitements_choisis = array();
+       if (!$traitements_choisis) {
+               $traitements_choisis = array();
+       }
        $traitements_choisis = array_flip($traitements_choisis);
        $traitements = array_intersect_key($traitements, $traitements_choisis);
-       
+
        // Et on l'enregistre tel quel
        $ok = sql_updateq(
                'spip_formulaires',
@@ -98,17 +106,14 @@ function formulaires_editer_formulaire_traitements_traiter($id_formulaire){
                ),
                'id_formulaire = '.$id_formulaire
        );
-       
+
        // On va sur la page de visualisation quand c'est fini
-       if ($ok){
+       if ($ok) {
                $retours['redirect'] = parametre_url(generer_url_ecrire('formulaire'), 'id_formulaire', $id_formulaire);
-       }
-       else{
+       } else {
                $retours['editable'] = true;
                $retours['message_erreur'] = _T('formidable:erreur_base');
        }
-       
+
        return $retours;
 }
-
-?>
diff --git a/www/plugins/formidable/formulaires/exporter_formulaire_analyse.html b/www/plugins/formidable/formulaires/exporter_formulaire_analyse.html
new file mode 100644 (file)
index 0000000..228fe49
--- /dev/null
@@ -0,0 +1,29 @@
+[(#SET{type_export, #ARRAY{csv,<:formidable:reponses_exporter_format_csv:>,xls,<:formidable:reponses_exporter_format_xls:>}})]
+
+<div class="formulaire_spip formulaire_#ENV{form}[ formulaire_#ENV{form}-(#ENV{id})]">
+       <h3 class="titrem">
+       [(#CHEMIN{images/formulaire-analyse-24.png}|balise_img{horizontale})] 
+      <:formidable:analyse_exporter:></h3>
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+       
+       [(#ENV{editable}|oui)
+       <form method="post" action="#ENV{action}"><div>
+               #ACTION_FORMULAIRE{#ENV{action}}
+               <input type="hidden" name="id_formulaire" value="#ID_FORMULAIRE" />
+               <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">
+                       [(#SAISIE{selection, type_export,
+                               label=<:formidable:exporter_formulaire_format_label:>,
+                               datas=#GET{type_export},
+        defaut=csv,
+        cacher_option_intro=oui})]
+               </[(#VAL{ul}|saisie_balise_structure_formulaire)]>
+               
+    
+               [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
+               <!--extra-->
+               
+               <p class="boutons"><span class="image_loading"></span><input type="submit" class="submit" value="<:bouton_telecharger:>" /></p>
+       </div></form>
+       ]
+</div>
diff --git a/www/plugins/formidable/formulaires/exporter_formulaire_analyse.php b/www/plugins/formidable/formulaires/exporter_formulaire_analyse.php
new file mode 100644 (file)
index 0000000..b2146d9
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/formidable');
+include_spip('inc/config');
+
+function formulaires_exporter_formulaire_analyse_charger($id_formulaire = 0) {
+       $contexte = array();
+       $contexte['id_formulaire'] = intval($id_formulaire);
+       return $contexte;
+}
+
+function formulaires_exporter_formulaire_analyse_verifier($id_formulaire = 0) {
+       $erreurs = array();
+
+       return $erreurs;
+}
+
+function formulaires_exporter_formulaire_analyse_traiter($id_formulaire = 0) {
+       $retours = array();
+
+       if (_request('type_export') == 'csv') {
+               action_exporter_analyse_reponses($id_formulaire);
+       } else if (_request('type_export') == 'xls') {
+                       action_exporter_analyse_reponses($id_formulaire, 'TAB');
+       }
+
+       return $retours;
+}
+
+
+/*
+ * Exporter les analyses d'un formulaire (anciennement action/exporter_analyse_reponses_dist)
+ * @param integer $id_formulaire
+ * @return unknown_type
+ */
+function action_exporter_analyse_reponses($id_formulaire, $delim = ',') {
+       // on ne fait des choses seulements si le formulaire existe et qu'il a des enregistrements
+       $ok = false;
+       if ($id_formulaire > 0
+               and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = '.$id_formulaire)
+               and $reponses = sql_allfetsel('*', 'spip_formulaires_reponses', 'id_formulaire = '.$id_formulaire.' and statut = '.sql_quote('publie'))
+       ) {
+               include_spip('inc/saisies');
+               include_spip('classes/facteur');
+               include_spip('inc/filtres');
+               $reponses_completes = array();
+
+               $saisies = saisies_lister_par_nom(unserialize($formulaire['saisies']), false);
+
+               // exclure les champs non analysés
+               $traitement = unserialize($formulaire['traitements']);
+               foreach (explode('|', $traitement['enregistrement']['analyse_exclure_champs']) as $exclure) {
+                       unset($saisies[$exclure]);
+               }
+               $res = sql_select(
+                       array('nom, valeur'),
+                       'spip_formulaires_reponses_champs AS FRC,
+                       spip_formulaires_reponses AS FR,
+                       spip_formulaires AS F',
+                       "FRC.id_formulaires_reponse=FR.id_formulaires_reponse AND FR.statut='publie'
+                       AND F.id_formulaire=FR.id_formulaire
+                       AND F.id_formulaire=$id_formulaire"
+               );
+
+               $valeurs = array();
+               while ($r = sql_fetch($res)) {
+                       $valeurs[$r['nom']][] = is_array(unserialize($r['valeur']))
+                               ? unserialize($r['valeur'])
+                               : $r['valeur'];
+               }
+
+               foreach ($saisies as $nom => $saisie) {
+                       $valeur = sql_getfetsel(
+                               'valeur',
+                               'spip_formulaires_reponses_champs',
+                               'id_formulaires_reponse = '.intval($reponse['id_formulaires_reponse']).' and nom = '.sql_quote($nom)
+                       );
+                       if (is_array(unserialize($valeur))) {
+                               $valeur = unserialize($valeur);
+                       }
+
+                       $reponse_complete[] = formidable_analyser_saisie($saisie, $valeurs, 0, true);
+               }
+
+               $colonnes = array(_T('formidable:champs'), _T('formidable:sans_reponses'));
+               foreach ($reponse_complete as $reponses) {
+                       foreach ($reponses as $key => $reponse) {
+                               if ($key == 'header' || $key == 'sans_reponse') {
+                                       continue;
+                               }
+                               if (in_array($key, $colonnes) == false) {
+                                       array_push($colonnes, $key);
+                               }
+                       }
+               }
+
+               $csv = array();
+               foreach ($reponse_complete as $reponses) {
+                       foreach ($colonnes as $colonne) {
+                               $csv[$reponses['header']][$colonne] =
+                                       isset($reponses[$colonne])
+                                               ? $reponses[$colonne]
+                                               : '';
+                       }
+                       $csv[$reponses['header']][_T('formidable:champs')] = $reponses['header'];
+                       $csv[$reponses['header']][_T('formidable:sans_reponses')]
+                               = $reponses['formidable:sans_reponse'];
+               }
+
+               $cpt_ligne = 1;
+               $reponses_completes = array();
+               $reponses_completes[0] = $colonnes;
+               foreach ($csv as $ligne => $colonnes) {
+                       $cpt_colonne = 0;
+                       foreach ($colonnes as $colonne) {
+                               $reponses_completes[$cpt_ligne][$cpt_colonne++] = $colonne;
+                       }
+                       $cpt_ligne++;
+               }
+
+               if ($reponses_completes and $exporter_csv = charger_fonction('exporter_csv', 'inc/', true)) {
+                       $exporter_csv('analyses-formulaire-'.$formulaire['identifiant'], $reponses_completes, $delim);
+                       exit();
+               }
+       }
+}
diff --git a/www/plugins/formidable/formulaires/exporter_formulaire_reponses.html b/www/plugins/formidable/formulaires/exporter_formulaire_reponses.html
new file mode 100644 (file)
index 0000000..4e75bb8
--- /dev/null
@@ -0,0 +1,35 @@
+[(#SET{type_export, #ARRAY{csv,<:formidable:reponses_exporter_format_csv:>,xls,<:formidable:reponses_exporter_format_xls:>}})]
+[(#SET{statut, #ARRAY{publie,<:formidable:reponses_exporter_statut_publie:>,tout,<:formidable:reponses_exporter_statut_tout:>}})]
+
+<div class="formulaire_spip formulaire_#ENV{form}[ formulaire_#ENV{form}-(#ENV{id})]">
+       <h3 class="titrem">
+       [(#CHEMIN{images/formulaire-reponses-exporter-24.png}|balise_img{horizontale})]
+       <:formidable:reponses_exporter:></h3>
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+       
+       [(#ENV{editable}|oui)
+       <form method="post" action="#ENV{action}"><div>
+               #ACTION_FORMULAIRE{#ENV{action}}
+               <input type="hidden" name="id_formulaire" value="#ID_FORMULAIRE" />
+               <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">
+                       [(#SAISIE{selection, type_export,
+                               label=<:formidable:exporter_formulaire_format_label:>,
+                               datas=#GET{type_export},
+                               defaut=csv,
+                               cacher_option_intro=oui})]
+                       [(#SAISIE{selection, statut_reponses,
+                               label=<:formidable:exporter_formulaire_statut_label:>,
+                               datas=#GET{statut},
+                               defaut=publie,
+                               cacher_option_intro=oui})]
+               </[(#VAL{ul}|saisie_balise_structure_formulaire)]>
+               
+    
+               [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
+               <!--extra-->
+               
+               <p class="boutons"><span class="image_loading"></span><input type="submit" class="submit" value="<:bouton_telecharger:>" /></p>
+       </div></form>
+       ]
+</div>
diff --git a/www/plugins/formidable/formulaires/exporter_formulaire_reponses.php b/www/plugins/formidable/formulaires/exporter_formulaire_reponses.php
new file mode 100644 (file)
index 0000000..898117c
--- /dev/null
@@ -0,0 +1,155 @@
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/formidable');
+include_spip('inc/config');
+
+function formulaires_exporter_formulaire_reponses_charger($id_formulaire = 0) {
+       $contexte                  = array();
+       $contexte['id_formulaire'] = intval($id_formulaire);
+
+       return $contexte;
+}
+
+function formulaires_exporter_formulaire_reponses_verifier($id_formulaire = 0) {
+       $erreurs = array();
+
+       return $erreurs;
+}
+
+function formulaires_exporter_formulaire_reponses_traiter($id_formulaire = 0) {
+       $retours = array();
+       $statut_reponses  = _request('statut_reponses');
+
+       if (_request('type_export') == 'csv') {
+               $ok = exporter_formulaires_reponses($id_formulaire, ',', $statut_reponses);
+       } elseif (_request('type_export') == 'xls') {
+               $ok = exporter_formulaires_reponses($id_formulaire, 'TAB', $statut_reponses);
+       }
+
+       if (!$ok) {
+               $retours['editable']       = 1;
+               $retours['message_erreur'] = _T('formidable:info_aucune_reponse');
+       }
+
+       return $retours;
+}
+
+
+/*
+ * Exporter toutes les réponses d'un formulaire (anciennement action/exporter_formulaire_reponses)
+ * @param integer $id_formulaire
+ * @return unknown_type
+ */
+function exporter_formulaires_reponses($id_formulaire, $delim = ',', $statut_reponses = 'publie') {
+       include_spip('inc/puce_statut');
+       // on ne fait des choses seulements si le formulaire existe et qu'il a des enregistrements
+       if ($id_formulaire > 0
+               and $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = ' . $id_formulaire)
+               and $reponses = sql_allfetsel('*', 'spip_formulaires_reponses', 'id_formulaire = ' . $id_formulaire . ($statut_reponses == 'publie' ? ' and statut = "publie"' : ''))
+       ) {
+               include_spip('inc/saisies');
+               include_spip('facteur_fonctions');
+               include_spip('inc/filtres');
+               $reponses_completes = array();
+
+               // La première ligne des titres
+               $titres  = array(
+                       _T('public:date'),
+                       _T('formidable:reponses_auteur'),
+                       _T('formidable:reponses_ip')
+               );
+               if ($statut_reponses != 'publie') {
+                       $titres[] = _T('formidable:reponse_statut');
+               }
+               $saisies = saisies_lister_par_nom(unserialize($formulaire['saisies']), false);
+               foreach ($saisies as $nom => $saisie) {
+                       if ($saisie['saisie'] != 'explication') {    // on exporte tous les champs sauf explications
+                               $options  = $saisie['options'];
+                               $titres[] = sinon($options['label_case'], sinon($options['label'], $nom));
+                       }
+               }
+               
+               // On passe la ligne des titres de colonnes dans un pipeline
+               $titres = pipeline(
+                       'formidable_exporter_formulaire_reponses_titres',
+                       array(
+                               'args' => array('id_formulaire'=>$id_formulaire, 'formulaire'=>$formulaire),
+                               'data' => $titres,
+                       )
+               );
+               $reponses_completes[] = $titres;
+
+               // On parcourt chaque réponse
+               foreach ($reponses as $reponse) {
+                       // Est-ce qu'il y a un auteur avec un nom
+                       $nom_auteur = '';
+                       if ($id_auteur = intval($reponse['id_auteur'])) {
+                               $nom_auteur = sql_getfetsel('nom', 'spip_auteurs', 'id_auteur = ' . $id_auteur);
+                       }
+                       if (!$nom_auteur) {
+                               $nom_auteur = '';
+                       }
+
+                       // Le début de la réponse avec les infos (date, auteur, etc)
+                       $reponse_complete = array(
+                               $reponse['date'],
+                               $nom_auteur,
+                               $reponse['ip']
+                       );
+                       if ($statut_reponses != 'publie') {
+                               $reponse_complete[] = statut_texte_instituer('formulaires_reponse', $reponse['statut']);
+                       }
+
+                       // Ensuite tous les champs
+                       foreach ($saisies as $nom => $saisie) {
+                               if ($saisie['saisie'] != 'explication') {
+                                       $valeur = sql_getfetsel(
+                                               'valeur',
+                                               'spip_formulaires_reponses_champs',
+                                               'id_formulaires_reponse = ' . intval($reponse['id_formulaires_reponse']) . ' and nom = ' . sql_quote($nom)
+                                       );
+                                       if (is_array(unserialize($valeur))) {
+                                               $valeur = unserialize($valeur);
+                                       }
+                                       $reponse_complete[] = facteur_mail_html2text(
+                                               recuperer_fond(
+                                                       'saisies-vues/_base',
+                                                       array_merge(
+                                                               array(
+                                                                       'valeur_uniquement' => 'oui',
+                                                                       'type_saisie'       => $saisie['saisie'],
+                                                                       'valeur'            => $valeur
+                                                               ),
+                                                               $saisie['options']
+                                                       )
+                                               )
+                                       );
+                               }
+                       }
+                       
+                       // On passe la ligne de réponse dans un pipeline
+                       $reponse_complete = pipeline(
+                               'formidable_exporter_formulaire_reponses_reponse',
+                               array(
+                                       'args' => array('id_formulaire'=>$id_formulaire, 'formulaire'=>$formulaire, 'reponse'=>$reponse),
+                                       'data' => $reponse_complete,
+                               )
+                       );
+
+                       // On ajoute la ligne à l'ensemble des réponses
+                       $reponses_completes[] = $reponse_complete;
+               }
+
+               if ($reponses_completes and $exporter_csv = charger_fonction('exporter_csv', 'inc/', true)) {
+                       $exporter_csv('reponses-formulaire-' . $formulaire['identifiant'], $reponses_completes, $delim);
+                       exit();
+               }
+       } else {
+               return false;
+       }
+}
index fd5da5b..5655960 100644 (file)
@@ -7,7 +7,7 @@
        [(#SET{anonymiser,[(#GET{enregistrement}|table_valeur{'anonymiser'})]})]\r
        [(#GET{anonymiser}|=={on}|oui)<h3><:formidable:formulaire_anonyme_explication:></h3>]\r
 </BOUCLE_formulaire>\r
-<div class="formulaire_spip formulaire_[(#ENV{form})] formulaire_#ENV{form}_[(#ENV{_formidable}|table_valeur{id_formulaire})] formulaire_#ENV{form}_[(#ENV{_formidable}|table_valeur{identifiant})][ formulaire_#ENV{form}-(#ENV{id,nouveau})]" id="[formulaire_#ENV{form}-(#ENV{id,nouveau})]">\r
+<div class="formulaire_spip formulaire_[(#ENV{form})] formulaire_#ENV{form}_[(#ENV{_formidable}|table_valeur{id_formulaire})] formulaire_#ENV{form}_[(#ENV{_formidable}|table_valeur{identifiant})][ formulaire_#ENV{form}-(#ENV{id,nouveau})][ (#ENV{_css})]" id="[formulaire_#ENV{form}-(#ENV{id,nouveau})]">\r
        [<h3 class="titrem"><span>(#ENV{_titre})</span></h3>]\r
        [<div class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok}|propre)</div>]\r
        [<div class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur}|propre)</div>]\r
         parametre : url d'action ]\r
         #ACTION_FORMULAIRE{#ENV{action}}\r
 \r
-        <ul>\r
+        <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">\r
             #GENERER_SAISIES{#ENV{_saisies}}\r
-            <li style="display:none;">\r
+            <[(#VAL{li}|saisie_balise_structure_formulaire)] style="display:none;">\r
                 <label for="mechantrobot-#ENV{id}"><:antispam_champ_vide:></label>\r
                 <input type="text" id="mechantrobot-#ENV{id}" name="mechantrobot" value="#ENV{mechantrobot}" />\r
-            </li>\r
-        </ul>\r
+            </[(#VAL{li}|saisie_balise_structure_formulaire)]>\r
+        </[(#VAL{ul}|saisie_balise_structure_formulaire)]>\r
 \r
         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]\r
         <!--extra-->\r
index b497ef0..e2f897f 100644 (file)
@@ -7,33 +7,38 @@
  **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/formidable');
 include_spip('inc/saisies');
 include_spip('base/abstract_sql');
 include_spip('inc/autoriser');
 
-function formidable_id_formulaire($id){
+function formidable_id_formulaire($id) {
        // on utilise une static pour etre sur que si l'appel dans verifier() passe, celui dans traiter() passera aussi
        // meme si entre temps on perds la base
        static $id_formulaires = array();
-       if (isset($id_formulaires[$id]))
+       if (isset($id_formulaires[$id])) {
                return $id_formulaires[$id];
+       }
 
-    if (is_numeric($id))
+       if (is_numeric($id)) {
                $where = 'id_formulaire = ' . intval($id);
-       elseif (is_string($id))
+       } elseif (is_string($id)) {
                $where = 'identifiant = ' . sql_quote($id);
-       else
+       } else {
                return 0;
+       }
 
-       $id_formulaire = intval(sql_getfetsel('id_formulaire','spip_formulaires',$where));
+       $id_formulaire = intval(sql_getfetsel('id_formulaire', 'spip_formulaires', $where));
 
        if ($id_formulaire
-               AND !test_espace_prive()
-         AND !objet_test_si_publie("formulaire",$id_formulaire))
+               and !test_espace_prive()
+               and !objet_test_si_publie('formulaire', $id_formulaire)) {
                return $id_formulaires[$id] = 0;
+       }
 
        return $id_formulaires[$id] = $id_formulaire;
 }
@@ -54,24 +59,42 @@ function formidable_id_formulaire($id){
  * @return array
  *     Contexte envoyé au squelette HTML du formulaire.
  **/
-function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires_reponse = false){
+function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires_reponse = false) {
        $contexte = array();
 
        // On peut donner soit un id soit un identifiant
-       if (!$id_formulaire = formidable_id_formulaire($id))
+       if (!$id_formulaire = formidable_id_formulaire($id)) {
                return;
+       }
 
        // On cherche si le formulaire existe
-       if ($formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = ' . intval($id_formulaire))){
+       if ($formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = ' . intval($id_formulaire))) {
                // On ajoute un point d'entrée avec les infos de ce formulaire
                // pour d'eventuels plugins qui en ont l'utilité
                $contexte['_formidable'] = $formulaire;
+               
+               // Classes CSS 
+               $contexte['_css'] = $formulaire['css'];
 
                // Est-ce que la personne a le droit de répondre ?
-               if (autoriser('repondre', 'formulaire', $formulaire['id_formulaire'], null, array('formulaire' => $formulaire))){
+               if (autoriser('repondre', 'formulaire', $formulaire['id_formulaire'], null, array('formulaire' => $formulaire))) {
                        $saisies = unserialize($formulaire['saisies']);
                        $traitements = unserialize($formulaire['traitements']);
 
+                       // Si on est en train de réafficher les valeurs postées,
+                       // ne pas afficher les saisies hidden
+                       if ($formulaire['apres'] == 'valeurs'
+                               and _request('formidable_afficher_apres') == 'valeurs'
+                       ) {
+                               foreach ($saisies as $k => $saisie) {
+                                       if (isset($saisie['saisie'])
+                                               and $saisie['saisie'] == 'hidden'
+                                       ) {
+                                               unset($saisies[$k]);
+                                       }
+                               }
+                       }
+
                        // On déclare les champs avec les valeurs par défaut
                        $contexte = array_merge(saisies_lister_valeurs_defaut($saisies), $contexte);
                        $contexte['mechantrobot'] = '';
@@ -82,33 +105,34 @@ function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires
                        $contexte['_hidden'] = '<input type="hidden" name="id_formulaire" value="' . $contexte['id'] . '"/>';
 
                        // S'il y a des valeurs par défaut dans l'appel, alors on pré-remplit
-                       if ($valeurs){
+                       if ($valeurs) {
                                // Si c'est une chaine on essaye de la parser
-                               if (is_string($valeurs)){
+                               if (is_string($valeurs)) {
                                        $liste = explode(',', $valeurs);
                                        $liste = array_map('trim', $liste);
                                        $valeurs = array();
-                                       foreach ($liste as $i => $cle_ou_valeur){
-                                               if ($i%2==0)
+                                       foreach ($liste as $i => $cle_ou_valeur) {
+                                               if ($i%2 == 0) {
                                                        $valeurs[$liste[$i]] = $liste[$i+1];
+                                               }
                                        }
                                }
 
-                               // Si on a un tableau, alors on écrase avec les valeurs données depuis l'appel
-                               if ($valeurs and is_array($valeurs)){
+                               // Si on a un tableau,
+                               // alors on écrase avec les valeurs données depuis l'appel
+                               if ($valeurs and is_array($valeurs)) {
                                        $contexte = array_merge($contexte, $valeurs);
                                }
                        }
 
                        // Si on passe un identifiant de reponse, on edite cette reponse si elle existe
-                       if ($id_formulaires_reponse = intval($id_formulaires_reponse)){
+                       if ($id_formulaires_reponse = intval($id_formulaires_reponse)) {
                                $contexte = formidable_definir_contexte_avec_reponse($contexte, $id_formulaires_reponse, $ok);
-                               if ($ok == false){
+                               if ($ok == false) {
                                        $contexte['editable'] = false;
                                        $contexte['message_erreur'] = _T('formidable:traiter_enregistrement_erreur_edition_reponse_inexistante');
                                }
                        } else {
-
                                // calcul des paramètres d'anonymisation
                                $options = isset($traitements['enregistrement']) ? $traitements['enregistrement'] : null;
 
@@ -122,17 +146,16 @@ function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires
                                        and !$options['multiple']
                                        and $options['modifiable']
                                        and $reponses = formidable_verifier_reponse_formulaire($formulaire['id_formulaire'], $options['identification'], $anonymisation)
-                               ){
+                               ) {
                                        $id_formulaires_reponse = array_pop($reponses);
                                        $contexte = formidable_definir_contexte_avec_reponse($contexte, $id_formulaires_reponse, $ok);
                                }
-
                        }
                } else {
                        $contexte['editable'] = false;
                        // le formulaire a déjà été répondu.
                        // peut être faut il afficher les statistiques des réponses
-                       if ($formulaire['apres']=='stats'){
+                       if ($formulaire['apres']=='stats') {
                                // Nous sommes face à un sondage auquel on a déjà répondu !
                                // On remplace complètement l'affichage du formulaire
                                // par un affichage du résultat de sondage !
@@ -147,7 +170,7 @@ function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires
                $contexte['editable'] = false;
                $contexte['message_erreur'] = _T('formidable:erreur_inexistant');
        }
-       if (!isset($contexte['_hidden'])){
+       if (!isset($contexte['_hidden'])) {
                $contexte['_hidden'] = '';
        }
        $contexte['_hidden'] .= "\n" . '<input type="hidden" name="formidable_afficher_apres' /*.$formulaire['id_formulaire']*/ . '" value="' . $formulaire['apres'] . '"/>'; // marche pas
@@ -175,19 +198,15 @@ function formulaires_formidable_charger($id, $valeurs = array(), $id_formulaires
  * @return array
  *     Tableau des erreurs
  **/
-function formulaires_formidable_verifier($id, $valeurs = array(), $id_formulaires_reponse = false){
+function formulaires_formidable_verifier($id, $valeurs = array(), $id_formulaires_reponse = false) {
        $erreurs = array();
 
        // On peut donner soit un id soit un identifiant
-       if (!$id_formulaire = formidable_id_formulaire($id)){
-
+       if (!$id_formulaire = formidable_id_formulaire($id)) {
                $erreurs['message_erreur'] = _T('formidable:erreur_base');
-
-       }
-       else {
-
+       } else {
                // Sale bête !
-               if (_request('mechantrobot')!=''){
+               if (_request('mechantrobot')!='') {
                        $erreurs['hahahaha'] = 'hahahaha';
                        return $erreurs;
                }
@@ -197,11 +216,31 @@ function formulaires_formidable_verifier($id, $valeurs = array(), $id_formulaire
 
                $erreurs = saisies_verifier($saisies);
 
-               if ($erreurs and !isset($erreurs['message_erreur']))
-                       $erreurs['message_erreur'] = _T('formidable:erreur_generique');
+               // Si on a pas déjà une erreur sur le champ unicite, on lance une verification
+               if ($formulaire['unicite'] != '') {
+                       if (!$erreurs[$formulaire['unicite']]) {
+                               $reponses = sql_allfetsel(
+                                       'R.id_formulaire AS id',
+                                       'spip_formulaires_reponses AS R
+                                               LEFT JOIN spip_formulaires AS F
+                                               ON R.id_formulaire=F.id_formulaire
+                                               LEFT JOIN spip_formulaires_reponses_champs AS C
+                                               ON R.id_formulaires_reponse=C.id_formulaires_reponse',
+                                       'R.id_formulaire = ' . $id_formulaire . '
+                                               AND C.nom='.sql_quote($formulaire['unicite']).'
+                                               AND C.valeur='.sql_quote(_request($formulaire['unicite'])).'
+                                               AND R.statut = "publie"'
+                               );
+                               if (is_array($reponses) && count($reponses) > 0) {
+                                       $erreurs[$formulaire['unicite']] = $formulaire['message_erreur_unicite'] ? _T($formulaire['message_erreur_unicite']) : _T('formidable:erreur_unicite');
+                               }
+                       }
+               }
 
+               if ($erreurs and !isset($erreurs['message_erreur'])) {
+                       $erreurs['message_erreur'] = _T('formidable:erreur_generique');
+               }
        }
-
        return $erreurs;
 }
 
@@ -229,17 +268,18 @@ function formulaires_formidable_verifier($id, $valeurs = array(), $id_formulaire
  * @return array
  *     Tableau des erreurs
  **/
-function formulaires_formidable_traiter($id, $valeurs = array(), $id_formulaires_reponse = false){
+function formulaires_formidable_traiter($id, $valeurs = array(), $id_formulaires_reponse = false) {
        $retours = array();
 
        // POST Mortem de securite : on log le $_POST pour ne pas le perdre si quelque chose se passe mal
-       include_spip("inc/json");
+       include_spip('inc/json');
        $post = json_encode($_POST);
-       spip_log($post,"formidable_post"._LOG_INFO_IMPORTANTE);
+       spip_log($post, 'formidable_post'._LOG_INFO_IMPORTANTE);
 
        // On peut donner soit un id soit un identifiant
-       if (!$id_formulaire = formidable_id_formulaire($id))
+       if (!$id_formulaire = formidable_id_formulaire($id)) {
                return array('message_erreur'=>_T('formidable:erreur_base'));
+       }
 
        $formulaire = sql_fetsel('*', 'spip_formulaires', 'id_formulaire = ' . $id_formulaire);
        $traitements = unserialize($formulaire['traitements']);
@@ -250,12 +290,12 @@ function formulaires_formidable_traiter($id, $valeurs = array(), $id_formulaires
        $retours['id_formulaire'] = $id_formulaire;
 
        // Si on a une redirection valide
-       if (($formulaire['apres']=="redirige") AND ($formulaire['url_redirect']!="")){
+       if (($formulaire['apres'] == 'redirige') and ($formulaire['url_redirect'] != '')) {
                refuser_traiter_formulaire_ajax();
                // traiter les raccourcis artX, brX
-               include_spip("inc/lien");
+               include_spip('inc/lien');
                $url_redirect = typer_raccourci($formulaire['url_redirect']);
-               if (count($url_redirect)>2){
+               if (count($url_redirect) > 2) {
                        $url_redirect = $url_redirect[0] . $url_redirect[2];
                } else {
                        $url_redirect = $formulaire['url_redirect']; // URL classique
@@ -270,66 +310,62 @@ function formulaires_formidable_traiter($id, $valeurs = array(), $id_formulaires
        // et que B n'est pas fait quand il est appele, il peut rendre la main sans rien faire au premier coup
        // et sera rappele au second tour
        $retours['traitements'] = array();
-       $erreur_texte = "";
+       $erreur_texte = '';
 
        // Si on a des traitements
-       if (is_array($traitements) and !empty($traitements)){
+       if (is_array($traitements) and !empty($traitements)) {
                $maxiter = 5;
                do {
-                       foreach ($traitements as $type_traitement => $options){
+                       foreach ($traitements as $type_traitement => $options) {
                                // si traitement deja appele, ne pas le relancer
-                               if (!isset($retours['traitements'][$type_traitement])){
-                                 if ($appliquer_traitement = charger_fonction($type_traitement, 'traiter/', true)){
+                               if (!isset($retours['traitements'][$type_traitement])) {
+                                       if ($appliquer_traitement = charger_fonction($type_traitement, 'traiter/', true)) {
                                                $retours = $appliquer_traitement(
                                                        array(
                                                                'formulaire' => $formulaire,
                                                                'options' => $options,
-                                                       'id_formulaire' => $id_formulaire,
-                                                       'valeurs' => $valeurs,
-                                                       'id_formulaires_reponse' => $id_formulaires_reponse,
+                                                               'id_formulaire' => $id_formulaire,
+                                                               'valeurs' => $valeurs,
+                                                               'id_formulaires_reponse' => $id_formulaires_reponse,
                                                        ),
                                                        $retours
                                                );
-                                       }
-                                       else {
+                                       } else {
                                                // traitement introuvable, ne pas retenter
                                                $retours['traitements'][$type_traitement] = true;
                                        }
                                }
                        }
-               }
-               while (count($retours['traitements'])<count($traitements) AND $maxiter--);
+               } while (count($retours['traitements']) < count($traitements) and $maxiter--);
 
                // si on ne peut pas traiter correctement, alerter le webmestre
-               if (count($retours['traitements'])<count($traitements)){
+               if (count($retours['traitements']) < count($traitements)) {
                        $erreur_texte = "Impossible de traiter correctement le formulaire $id\n"
-                               . "Traitements attendus :".implode(',',array_keys($traitements))."\n"
-                               . "Traitements realises :".implode(',',array_keys($retours['traitements']))."\n";
+                               . 'Traitements attendus :'.implode(',', array_keys($traitements))."\n"
+                               . 'Traitements realises :'.implode(',', array_keys($retours['traitements']))."\n";
                }
 
                // Si on a personnalisé le message de retour, c'est lui qui est affiché uniquement
-               if ($formulaire['message_retour']){
+               if ($formulaire['message_retour']) {
                        $retours['message_ok'] = _T_ou_typo($formulaire['message_retour']);
                }
-       }
-       else {
+       } else {
                $retours['message_erreur'] = _T('formidable:retour_aucun_traitement');
        }
 
        // si aucun traitement, alerter le webmestre pour ne pas perdre les donnees
-       if (!$erreur_texte AND !count($retours['traitements'])){
+       if (!$erreur_texte and !count($retours['traitements'])) {
                $erreur_texte = "Aucun traitement pour le formulaire $id\n";
        }
 
-       if ($erreur_texte){
+       if ($erreur_texte) {
                $erreur_sujet = "[ERREUR] Traitement Formulaire $id";
                // dumper la saisie pour ne pas la perdre
-               $erreur_texte .= "\n".var_export($_REQUEST,true);
-               $envoyer_mail = charger_fonction("envoyer_mail","inc");
-               $envoyer_mail($GLOBALS['meta']['email_webmaster'],$erreur_sujet,$erreur_texte);
+               $erreur_texte .= "\n".var_export($_REQUEST, true);
+               $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
+               $envoyer_mail($GLOBALS['meta']['email_webmaster'], $erreur_sujet, $erreur_texte);
        }
        unset($retours['traitements']);
-
        return $retours;
 }
 
@@ -348,7 +384,7 @@ function formulaires_formidable_traiter($id, $valeurs = array(), $id_formulaires
  *     Contexte complète des nouvelles informations
  *
  **/
-function formidable_definir_contexte_avec_reponse($contexte, $id_formulaires_reponse, &$ok){
+function formidable_definir_contexte_avec_reponse($contexte, $id_formulaires_reponse, &$ok) {
        // On va chercher tous les champs
        $champs = sql_allfetsel(
                'nom, valeur',
@@ -358,7 +394,7 @@ function formidable_definir_contexte_avec_reponse($contexte, $id_formulaires_rep
        $ok = count($champs) ? true : false;
 
        // On remplit le contexte avec
-       foreach ($champs as $champ){
+       foreach ($champs as $champ) {
                $test_array = unserialize($champ['valeur']);
                $contexte[$champ['nom']] = is_array($test_array) ? $test_array : $champ['valeur'];
        }
index 139193d..45d34a6 100644 (file)
@@ -9,7 +9,7 @@
                parametre : url d'action ]
                #ACTION_FORMULAIRE{#ENV{action}}
                
-               <ul>
+               <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">
                        [(#SAISIE{selection, type_import,
                                label=<:formidable:importer_formulaire_format_label:>,
                                datas=#ENV{_types_import},
@@ -20,7 +20,7 @@
                                label=<:formidable:importer_formulaire_fichier_label:>,
                                type=file,
                                size=6})]
-               </ul>
+               </[(#VAL{ul}|saisie_balise_structure_formulaire)]>
                
                [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
                <!--extra-->
index 9ecfa15..222c12e 100644 (file)
@@ -1,54 +1,54 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/formidable');
 include_spip('inc/config');
 
-function formulaires_importer_formulaire_charger(){
-       
+function formulaires_importer_formulaire_charger() {
+
        $contexte = array();
-       
+
        // On va chercher toutes les fonctions d'importation existantes
        $types_echange = echanges_formulaire_lister_disponibles();
        $types_import = array();
-       foreach ($types_echange['importer'] as $type=>$fonction){
+       foreach ($types_echange['importer'] as $type => $fonction) {
                $types_import[$type] = _T("formidable:echanger_formulaire_${type}_importer");
        }
-       
+
        $contexte['_types_import'] = $types_import;
-       
+
        return $contexte;
 }
 
-function formulaires_importer_formulaire_verifier(){
+function formulaires_importer_formulaire_verifier() {
        $erreurs = array();
-       
+
        return $erreurs;
 }
 
-function formulaires_importer_formulaire_traiter(){
+function formulaires_importer_formulaire_traiter() {
        $retours = array();
-       
-       if (!$_FILES['fichier']['error']){
+
+       if (!$_FILES['fichier']['error']) {
                $type_import = _request('type_import');
                $fichier = $_FILES['fichier']['tmp_name'];
-       
+
                $importer = charger_fonction('importer', "echanger/formulaire/$type_import", true);
 
                try {
                        $erreur_ou_id = $importer($fichier);
-               }
-               catch (Exception $e){
+               } catch (Exception $e) {
                        $erreur_ou_id = $e->getMessage();
                }
 
-               if (!is_numeric($erreur_ou_id)){
+               if (!is_numeric($erreur_ou_id)) {
                        $retours['message_erreur'] = $erreur_ou_id;
                        $retours['editable'] = true;
-               }
-               else{
+               } else {
                        $id_formulaire = intval($erreur_ou_id);
                        // Tout a fonctionné. En fonction de la config, on attribue l'auteur courant
                        $auteurs = lire_config('formidable/analyse/auteur');
@@ -61,8 +61,6 @@ function formulaires_importer_formulaire_traiter(){
                        $retours['redirect'] = generer_url_ecrire('formulaire', "id_formulaire=$id_formulaire");
                }
        }
-       
+
        return $retours;
 }
-
-?>
diff --git a/www/plugins/formidable/formulaires/inc-formidable-unicite.html b/www/plugins/formidable/formulaires/inc-formidable-unicite.html
new file mode 100644 (file)
index 0000000..c70f5cb
--- /dev/null
@@ -0,0 +1,21 @@
+#SET{name,unicite}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+<B_champs_unicite>
+<li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+       <label for="#GET{name}"><:formidable:editer_unicite_label:></label>[
+       <span class='erreur_message'>(#GET{erreurs})</span>
+       ]<p class="explication"><:formidable:editer_unicite_explication:></p>
+       <select name="#GET{name}" class="select" id="#GET{name}">
+               <option value=""></option>
+               <BOUCLE_champs_unicite(POUR){tableau #ENV*{saisies}|unserialize}>
+               <option value="[(#VALEUR|table_valeur{options}|table_valeur{nom})]"[(#ENV{unicite,#GET{defaut}}|=={#VALEUR|table_valeur{options}|table_valeur{nom}}|oui)selected="selected"]>[(#VALEUR|table_valeur{options}|table_valeur{label})]</option>
+               </BOUCLE_champs_unicite>
+       </select>
+</li>
+#SET{name,message_erreur_unicite}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+<li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+       <label for="#GET{name}"><:formidable:editer_message_erreur_unicite_label:></label>[
+       <span class='erreur_message'>(#GET{erreurs})</span>
+       ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+       <p class="explication"><:formidable:editer_message_erreur_unicite_explication:></p>
+</li>
+</B_champs_unicite>
diff --git a/www/plugins/formidable/http/collectionjson/formulaires-ressource.html b/www/plugins/formidable/http/collectionjson/formulaires-ressource.html
new file mode 100644 (file)
index 0000000..35f9e07
--- /dev/null
@@ -0,0 +1,11 @@
+<BOUCLE_formulaire(FORMULAIRES){id_formulaire}{statut?}>
+{
+       "collection": {
+               "version": "1.0",
+               "href": "[(#VAL{&}|self|url_absolue)]",
+               "items": [
+                       <INCLURE{fond=http/collectionjson/inc-formulaire, id_formulaire, mode, url_self=#SELF}>
+               ]
+       }
+}
+</BOUCLE_formulaire>
diff --git a/www/plugins/formidable/http/collectionjson/formulaires.html b/www/plugins/formidable/http/collectionjson/formulaires.html
new file mode 100644 (file)
index 0000000..a0e87e9
--- /dev/null
@@ -0,0 +1,38 @@
+[(#SET{defaut_tri,#ARRAY{
+       titre,1,
+       date_creation,#ENV{date_sens,-1},
+       maj,#ENV{date_sens,-1},
+       id_formulaire,1,
+       points,-1,
+}})]
+
+{
+       "collection": {
+               "version": "1.0",
+               "href": "[(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires}|url_absolue)]",
+               "title": "#NOM_SITE_SPIP - <:formidable:bouton_formulaires:>",
+               "updated": "[(#DATE|date_iso)]"
+               <B_formulaires>
+               ,
+               "links": [
+                       {"rel":"self", "type":"application/json", "href":"[(#VAL{&}|self|url_absolue)]"}[,
+                       (#PAGINATION{collectionjson})]
+               ],
+               "totalResults": #GRAND_TOTAL,
+               "startIndex": #ENV{debut_formulaires,0},
+               "itemsPerPage": #ENV{pagination,100},
+               "items": [
+               <BOUCLE_formulaires(FORMULAIRES formulaires_liens)
+                       {statut IN #ENV{statut,#LISTE{publie}}}
+                       {id_auteur?}
+                       {formulaires_liens.objet?}{formulaires_liens.id_objet?}
+                       {recherche?}
+                       {tri #ENV{par,#ENV{recherche}|?{points,date_creation}},#GET{defaut_tri}}
+                       {pagination #ENV{pagination,100}}{","}
+               >
+                       <INCLURE{fond=http/collectionjson/inc-formulaire, id_formulaire, mode, objet=#ENV{objet}, id_objet=#ENV{id_objet}, url_self=#SELF}>
+               </BOUCLE_formulaires>
+               ]
+               </B_formulaires>
+       }
+}
diff --git a/www/plugins/formidable/http/collectionjson/formulaires_reponses-ressource.html b/www/plugins/formidable/http/collectionjson/formulaires_reponses-ressource.html
new file mode 100644 (file)
index 0000000..2b60e1d
--- /dev/null
@@ -0,0 +1,11 @@
+<BOUCLE_formulaires_reponse(FORMULAIRES_REPONSES){id_formulaires_reponse}{statut?}>
+{
+       "collection": {
+               "version": "1.0",
+               "href": "[(#VAL{&}|self|url_absolue)]",
+               "items": [
+                       <INCLURE{fond=http/collectionjson/inc-formulaires_reponse, id_formulaires_reponse, mode, url_self=#SELF}>
+               ]
+       }
+}
+</BOUCLE_formulaires_reponse>
diff --git a/www/plugins/formidable/http/collectionjson/formulaires_reponses.html b/www/plugins/formidable/http/collectionjson/formulaires_reponses.html
new file mode 100644 (file)
index 0000000..8d02f0f
--- /dev/null
@@ -0,0 +1,39 @@
+[(#SET{defaut_tri,#ARRAY{
+       titre,1,
+       date,#ENV{date_sens,-1},
+       maj,#ENV{date_sens,-1},
+       id_formulaires_reponse,1,
+       points,-1,
+}})]
+
+{
+       "collection": {
+               "version": "1.0",
+               "href": "[(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires_reponses}|url_absolue)]",
+               "title": "#NOM_SITE_SPIP - <:formidable:reponses_liste:>",
+               "updated": "[(#DATE|date_iso)]"
+               <B_formulaires_reponses>
+               ,
+               "links": [
+                       {"rel":"self", "type":"application/json", "href":"[(#VAL{&}|self|url_absolue)]"}[,
+                       (#PAGINATION{collectionjson})]
+               ],
+               "totalResults": #GRAND_TOTAL,
+               "startIndex": #ENV{debut_formulaires_reponses,0},
+               "itemsPerPage": #ENV{pagination,100},
+               "items": [
+               <BOUCLE_formulaires_reponses(FORMULAIRES_REPONSES)
+                       {id_formulaire?}
+                       {statut IN #ENV{statut,#LISTE{publie}}}
+                       {id_auteur?}
+                       {cookie?}
+                       {recherche?}
+                       {tri #ENV{par,#ENV{recherche}|?{points,date}},#GET{defaut_tri}}
+                       {pagination #ENV{pagination,100}}{","}
+               >
+                       <INCLURE{fond=http/collectionjson/inc-formulaires_reponse, id_formulaires_reponse, mode, url_self=#SELF}>
+               </BOUCLE_formulaires_reponses>
+               ]
+               </B_formulaires_reponses>
+       }
+}
diff --git a/www/plugins/formidable/http/collectionjson/formulaires_reponses.php b/www/plugins/formidable/http/collectionjson/formulaires_reponses.php
new file mode 100644 (file)
index 0000000..0f54a5c
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Répondre à un formulaire Formidable en Collection+JSON
+ * 
+ * Il faut avoir un id_formulaire et pouvoir y répondre.
+ *
+ * @param Request $requete
+ * @param Response $reponse
+ * @return void
+ */
+function http_collectionjson_formulaires_reponses_post_collection_dist($requete, $reponse){
+       include_spip('inc/session');
+       include_spip('inc/autoriser');
+       $fonction_erreur = charger_fonction('erreur', "http/collectionjson/");
+       
+       // On teste si on a bien du contenu au bon format
+       if (
+               $contenu = $requete->getContent()
+               and $json = json_decode($contenu, true)
+               and is_array($json)
+               and isset($json['collection']['items'][0]['data'])
+               and $data = $json['collection']['items'][0]['data']
+               and is_array($data)
+       ) {
+               // Pour chaque champ envoyé, ça dépend ce que c'est
+               foreach ($data as $champ) {
+                       if (
+                               isset($champ['name'])
+                               and isset($champ['value'])
+                       ) {
+                               // Si c'est id_formulaire, on le garde de côté pour l'autorisation et pour le traitement
+                               if ($champ['name'] == 'id_formulaire') {
+                                       $id_formulaire = intval($champ['value']);
+                               }
+                               // Sinon on le met dans le post pour verifier/traiter
+                               set_request($champ['name'], $champ['value']);
+                       }
+               }
+               
+               // On teste l'autorisation
+               if ($id_formulaire > 0 and autoriser('repondre', 'formulaire', $id_formulaire)) {
+                       // On vérifie maintenant les erreurs
+                       $formidable_verifier = charger_fonction('verifier', 'formulaires/formidable');
+                       $erreurs = $formidable_verifier($id_formulaire);
+               
+                       // On passe les erreurs dans le pipeline "verifier" (par exemple pour Saisies)
+                       $erreurs = pipeline('formulaire_verifier', array(
+                               'args' => array(
+                                       'form' => 'formidable',
+                                       'args' => array($id_formulaire),
+                               ),
+                               'data' => $erreurs,
+                       ));
+                       
+                       // S'il y a des erreurs, on va générer un JSON les listant
+                       if ($erreurs) {
+                               $reponse->setStatusCode(400);
+                               $reponse->headers->set('Content-Type', 'application/json');
+                               $reponse->setCharset('utf-8');
+                               
+                               $json_reponse = array(
+                                       'collection' => array(
+                                               'version' => '1.0',
+                                               'href' => url_absolue(self('&')),
+                                               'error' => array(
+                                                       'title' => _T('erreur'),
+                                                       'code' => 400,
+                                               ),
+                                               'errors' => array(),
+                                       ),
+                               );
+                               
+                               foreach ($erreurs as $nom => $erreur) {
+                                       $json_reponse['collection']['errors'][$nom] = array(
+                                               'title' => $erreur,
+                                               'code' => 400,
+                                       );
+                               }
+                               $reponse->setContent(json_encode($json_reponse));
+                       }
+                       // Sinon on continue le traitement
+                       else {
+                               // On lance le traitement de la réponse
+                               $formidable_traiter = charger_fonction('traiter', 'formulaires/formidable', true);
+                               $retours_formidable = $formidable_traiter($id_formulaire);
+                               
+                               // On passe dans le pipeline "traiter" (par exemple pour les quizz)
+                               $retours_formidable = pipeline('formulaire_traiter', array(
+                                       'args' => array(
+                                               'form' => 'formidable',
+                                               'args' => array($id_formulaire),
+                                       ),
+                                       'data' => $retours_formidable,
+                               ));
+                               
+                               // Si à la fin on a bien un identifiant de réponse
+                               if ($id_formulaires_reponse = $retours_formidable['id_formulaires_reponse']) {
+                                       // On va cherche la fonction qui génère la vue d'une ressource
+                                       if ($fonction_ressource = charger_fonction('get_ressource', 'http/collectionjson/', true)) {
+                                               // On ajoute à la requête, l'identifiant de la nouvelle ressource
+                                               $requete->attributes->set('ressource', $id_formulaires_reponse);
+                                               $reponse = $fonction_ressource($requete, $reponse);
+                                               
+                                               // C'est une création, on renvoie 201
+                                               $reponse->setStatusCode(201);
+                                       }
+                               }
+                               // Sinon l'enregistrement n'a pas fonctionné donc erreur
+                               // (TODO : il faudrait les chaînes pour les 5XX dans le plugin HTTP)
+                               else {
+                                       $reponse = $fonction_erreur(500, $requete, $reponse);
+                               }
+                       }
+               }
+               // Sinon pas le droit
+               else {
+                       $reponse = $fonction_erreur(403, $requete, $reponse);
+               }
+       }
+       // Sinon on ne comprend pas ce qui se passe
+       else {
+               $reponse = $fonction_erreur(415, $requete, $reponse);
+       }
+       
+       return $reponse;
+}
diff --git a/www/plugins/formidable/http/collectionjson/inc-formulaire.html b/www/plugins/formidable/http/collectionjson/inc-formulaire.html
new file mode 100644 (file)
index 0000000..58e222d
--- /dev/null
@@ -0,0 +1,43 @@
+<BOUCLE_formulaire(FORMULAIRES){id_formulaire}{statut?}>
+[(#SET{item, [(#ARRAY{
+       href, [(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires/#ID_FORMULAIRE})],
+       published, [(#DATE_CREATION|date_iso)],
+       updated, [(#MAJ|date_iso)],
+       links, [(#LISTE{
+               [(#ARRAY{rel,edit, type,application/json, href,[(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires/#ID_FORMULAIRE})]})],
+       })],
+       data, [(#LISTE{
+               #ARRAY{name,id_formulaire, value,#ID_FORMULAIRE},
+               #ARRAY{name,identifiant, value,#IDENTIFIANT},
+               #ARRAY{name,statut, value,#STATUT},
+               #ARRAY{name,date_creation, value,#DATE_CREATION},
+               #ARRAY{name,maj, value,#MAJ},
+       })],
+})]})]
+
+[(#REM) Si on trouve un logo, on ajoute un lien "preview" ]
+#SET{logo, #LOGO_FORMULAIRE}
+[(#GET{logo}|oui)
+[(#SET{item, [(#GET{item}|push_table_valeur{links, #ARRAY{rel,preview, href,#GET{logo}|image_reduire{1200,0}|extraire_attribut{src}|url_absolue}})]})]
+]
+
+[(#REM) Des champs au contenu interprété en HTML ]
+[(#ENV{mode}|!={raw}|oui)
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,titre, value,#TITRE, prompt,<:info_titre:>})]})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,descriptif, value,#DESCRIPTIF, prompt,<:info_descriptif:>})], #DESCRIPTIF})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,message_retour, value,[(#MESSAGE_RETOUR|propre)], prompt,<:formidable:editer_message_ok:>})], #MESSAGE_RETOUR})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,saisies, array,[(#SAISIES|unserialize)], prompt,<:formidable:champs:>})], #SAISIES})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,traitements, array,[(#TRAITEMENTS|unserialize)], prompt,<:formidable:voir_traitements:>})], #TRAITEMENTS})]})]
+]
+
+[(#REM) Des champs au contenu BRUT qui peut être modifié ]
+[(#ENV{mode}|=={raw}|oui)
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,titre, value,#TITRE*, prompt,<:info_titre:>})]})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,descriptif, value,#DESCRIPTIF*, prompt,<:info_descriptif:>})], #DESCRIPTIF*})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,message_retour, value,#MESSAGE_RETOUR*, prompt,<:formidable:editer_message_ok:>})], #MESSAGE_RETOUR})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,saisies, value,#SAISIES*, prompt,<:formidable:champs:>})], #SAISIES})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,traitements, value,#TRAITEMENTS*, prompt,<:formidable:voir_traitements:>})], #TRAITEMENTS})]})]
+]
+
+[(#GET{item}|json_encode)]
+</BOUCLE_formulaire>
diff --git a/www/plugins/formidable/http/collectionjson/inc-formulaires_reponse.html b/www/plugins/formidable/http/collectionjson/inc-formulaires_reponse.html
new file mode 100644 (file)
index 0000000..831dcb2
--- /dev/null
@@ -0,0 +1,36 @@
+<BOUCLE_formulaires_reponse(FORMULAIRES_REPONSES){id_formulaires_reponse}{statut?}>
+[(#SET{item, [(#ARRAY{
+       href, [(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires_reponses/#ID_FORMULAIRES_REPONSE})],
+       published, [(#DATE|date_iso)],
+       updated, [(#MAJ|date_iso)],
+       links, [(#LISTE{
+               [(#ARRAY{rel,edit, type,application/json, href,[(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires_reponses/#ID_FORMULAIRES_REPONSE})]})],
+               [(#ARRAY{rel,up, type,application/json, href,[(#URL_SITE_SPIP|concat{/http.api/collectionjson/formulaires/#ID_FORMULAIRE})]})],
+       })],
+       data, [(#LISTE{
+               #ARRAY{name,id_formulaires_reponse, value,#ID_FORMULAIRES_REPONSE},
+               #ARRAY{name,statut, value,#STATUT},
+               #ARRAY{name,date, value,#DATE},
+               #ARRAY{name,maj, value,#MAJ},
+       })],
+})]})]
+
+[(#REM) Si on a le plugin de quizz ]
+[(#PLUGIN{formidable_quizz}|oui)
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,quizz_score, value,#QUIZZ_SCORE, prompt,<:formidable_quizz:resultats_score_label:>})]})]})]
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,quizz_total, value,#QUIZZ_TOTAL, prompt,<:formidable_quizz:resultats_total_label:>})]})]})]
+]
+
+[(#REM) On va chercher chaque champ ]
+<BOUCLE_champs(FORMULAIRES_REPONSES_CHAMPS){id_formulaires_reponse}>
+[(#ENV{mode}|!={raw}|oui)
+       #SET{valeur, #ID_FORMULAIRES_REPONSE|calculer_voir_reponse{#ID_FORMULAIRE, #NOM, valeur_uniquement}|trim}
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,#NOM, value,#GET{valeur}})]})]})]
+]
+[(#ENV{mode}|=={raw}|oui)
+       [(#SET{item, [(#GET{item}|push_table_valeur{data, [(#ARRAY{name,#NOM, value,#VALEUR})]})]})]
+]
+</BOUCLE_champs>
+
+[(#GET{item}|json_encode)]
+</BOUCLE_formulaires_reponse>
index 0cf4900..ef6eae5 100644 (file)
Binary files a/www/plugins/formidable/icones_barre/formulaire.png and b/www/plugins/formidable/icones_barre/formulaire.png differ
index 8d6b21c..f30905e 100644 (file)
Binary files a/www/plugins/formidable/images/formidable-128.png and b/www/plugins/formidable/images/formidable-128.png differ
index c8c577f..50510d0 100644 (file)
Binary files a/www/plugins/formidable/images/formidable-24.png and b/www/plugins/formidable/images/formidable-24.png differ
index 80d5ab8..7093aeb 100644 (file)
Binary files a/www/plugins/formidable/images/formidable-64.png and b/www/plugins/formidable/images/formidable-64.png differ
index ff847d0..bd657c2 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-24.png and b/www/plugins/formidable/images/formulaire-24.png differ
index 8aef295..5ba908a 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-action-ajouter.png and b/www/plugins/formidable/images/formulaire-action-ajouter.png differ
index 9965646..2d4abfa 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-analyse-24.png and b/www/plugins/formidable/images/formulaire-analyse-24.png differ
index 30f5ec5..0050a97 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-config-auteurs-24.png and b/www/plugins/formidable/images/formulaire-config-auteurs-24.png differ
index 0d77271..f400bab 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-config-champs-24.png and b/www/plugins/formidable/images/formulaire-config-champs-24.png differ
index f362e72..d0d689d 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-config-traitements-24.png and b/www/plugins/formidable/images/formulaire-config-traitements-24.png differ
index a4ec44f..338618e 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-dupliquer-24.png and b/www/plugins/formidable/images/formulaire-dupliquer-24.png differ
index 0bb3e26..bf913de 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-editer-24.png and b/www/plugins/formidable/images/formulaire-editer-24.png differ
index 3350857..9e18a29 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-exporter-24.png and b/www/plugins/formidable/images/formulaire-exporter-24.png differ
index a0c803e..e308819 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-nouveau-48.png and b/www/plugins/formidable/images/formulaire-nouveau-48.png differ
index 1bbdb51..4fc0f89 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-reponse-24.png and b/www/plugins/formidable/images/formulaire-reponse-24.png differ
index 897c63e..000f135 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-reponse-supprimer-24.png and b/www/plugins/formidable/images/formulaire-reponse-supprimer-24.png differ
index ec0a2b0..26d2247 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-reponses-24.png and b/www/plugins/formidable/images/formulaire-reponses-24.png differ
index 94d0cec..fc4f1ba 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-reponses-exporter-24.png and b/www/plugins/formidable/images/formulaire-reponses-exporter-24.png differ
index f491594..a8096fe 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-reponses-supprimer-24.png and b/www/plugins/formidable/images/formulaire-reponses-supprimer-24.png differ
index 1819e5e..8e00019 100644 (file)
Binary files a/www/plugins/formidable/images/formulaire-supprimer-24.png and b/www/plugins/formidable/images/formulaire-supprimer-24.png differ
index e55bd6a..fd8e325 100644 (file)
@@ -1,38 +1,39 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /*
  * Liste tous les traitements configurables (ayant une description)
  *
  * @return array Un tableau listant des saisies et leurs options
  */
-function traitements_lister_disponibles(){
-    static $traitements = null;
+function traitements_lister_disponibles() {
+       static $traitements = null;
 
-    if (is_null($traitements)){
-        $traitements = array();
-        $liste = find_all_in_path('traiter/', '.+[.]yaml$');
+       if (is_null($traitements)) {
+               $traitements = array();
+               $liste = find_all_in_path('traiter/', '.+[.]yaml$');
                ksort($liste);
-               
-        if (count($liste)){
-            foreach ($liste as $fichier=>$chemin){
-                $type_traitement = preg_replace(',[.]yaml$,i', '', $fichier);
-                $dossier = str_replace($fichier, '', $chemin);
-                // On ne garde que les traitements qui ont bien la fonction
-                if (charger_fonction($type_traitement, 'traiter', true)
-                    and (
-                        is_array($traitement = traitements_charger_infos($type_traitement))
-                    )
-                ){
-                    $traitements[$type_traitement] = $traitement;
-                }
-            }
-        }
-    }
-
-    return $traitements;
+
+               if (count($liste)) {
+                       foreach ($liste as $fichier => $chemin) {
+                               $type_traitement = preg_replace(',[.]yaml$,i', '', $fichier);
+                               // On ne garde que les traitements qui ont bien la fonction
+                               if (charger_fonction($type_traitement, 'traiter', true)
+                                       and (
+                                               is_array($traitement = traitements_charger_infos($type_traitement))
+                                       )
+                               ) {
+                                       $traitements[$type_traitement] = $traitement;
+                               }
+                       }
+               }
+       }
+
+       return $traitements;
 }
 
 /**
@@ -41,18 +42,18 @@ function traitements_lister_disponibles(){
  * @param string $type_saisie Le type de la saisie
  * @return array Un tableau contenant le YAML décodé
  */
-function traitements_charger_infos($type_traitement){
-    include_spip('inc/yaml');
-    $fichier = find_in_path("traiter/$type_traitement.yaml");
-    $traitement = yaml_decode_file($fichier);
-
-    if (is_array($traitement)) {
-        $traitement += array('titre' => '', 'description' => '', 'icone' => '');
-        $traitement['titre'] = $traitement['titre'] ? _T_ou_typo($traitement['titre']) : $type_traitement;
-        $traitement['description'] = $traitement['description'] ? _T_ou_typo($traitement['description']) : '';
-        $traitement['icone'] = $traitement['icone'] ? find_in_path($traitement['icone']) : '';
-    }
-    return $traitement;
+function traitements_charger_infos($type_traitement) {
+       include_spip('inc/yaml');
+       $fichier = find_in_path("traiter/$type_traitement.yaml");
+       $traitement = yaml_decode_file($fichier);
+
+       if (is_array($traitement)) {
+               $traitement += array('titre' => '', 'description' => '', 'icone' => '');
+               $traitement['titre'] = $traitement['titre'] ? _T_ou_typo($traitement['titre']) : $type_traitement;
+               $traitement['description'] = $traitement['description'] ? _T_ou_typo($traitement['description']) : '';
+               $traitement['icone'] = $traitement['icone'] ? find_in_path($traitement['icone']) : '';
+       }
+       return $traitement;
 }
 
 /*
@@ -60,24 +61,24 @@ function traitements_charger_infos($type_traitement){
  *
  * @return array Retourne un tableau listant les types d'échanges
  */
-function echanges_formulaire_lister_disponibles(){
-    // On va chercher toutes les fonctions existantes
-    $liste = find_all_in_path('echanger/formulaire/', '.+[.]php$');
-    $types_echange = array('exporter'=>array(), 'importer'=>array());
-    if (count($liste)){
-        foreach ($liste as $fichier=>$chemin){
-            $type_echange = preg_replace(',[.]php$,i', '', $fichier);
-            $dossier = str_replace($fichier, '', $chemin);
-            // On ne garde que les échanges qui ont bien la fonction
-            if ($f = charger_fonction('exporter', "echanger/formulaire/$type_echange", true)){
-                $types_echange['exporter'][$type_echange] = $f;
-            }
-            if ($f = charger_fonction('importer', "echanger/formulaire/$type_echange", true)){
-                $types_echange['importer'][$type_echange] = $f;
-            }
-        }
-    }
-    return $types_echange;
+function echanges_formulaire_lister_disponibles() {
+       // On va chercher toutes les fonctions existantes
+       $liste = find_all_in_path('echanger/formulaire/', '.+[.]php$');
+       $types_echange = array('exporter' => array(), 'importer' => array());
+       if (count($liste)) {
+               foreach ($liste as $fichier => $chemin) {
+                       $type_echange = preg_replace(',[.]php$,i', '', $fichier);
+
+                       // On ne garde que les échanges qui ont bien la fonction
+                       if ($f = charger_fonction('exporter', "echanger/formulaire/$type_echange", true)) {
+                               $types_echange['exporter'][$type_echange] = $f;
+                       }
+                       if ($f = charger_fonction('importer', "echanger/formulaire/$type_echange", true)) {
+                               $types_echange['importer'][$type_echange] = $f;
+                       }
+               }
+       }
+       return $types_echange;
 }
 
 /*
@@ -87,8 +88,8 @@ function echanges_formulaire_lister_disponibles(){
  * @param int $id_formulaire L'identifiant du formulaire
  * @return string Retourne le nom du cookie
  */
-function formidable_generer_nom_cookie($id_formulaire){
-    return $GLOBALS['cookie_prefix'].'cookie_formidable_'.$id_formulaire;
+function formidable_generer_nom_cookie($id_formulaire) {
+       return $GLOBALS['cookie_prefix'].'cookie_formidable_'.$id_formulaire;
 }
 
 /*
@@ -99,60 +100,63 @@ function formidable_generer_nom_cookie($id_formulaire){
  * @param string $anonymisation : vaut '' si le formulaire n'est pas anonymisé, sinon c'est la variable d'anonymisation
  * @return unknown_type Retourne un tableau contenant les id des réponses si elles existent, sinon false
  */
-function formidable_verifier_reponse_formulaire($id_formulaire, $choix_identification='cookie', $anonymisation=''){
-    global $auteur_session;
-    $id_auteur = $auteur_session ? intval($auteur_session['id_auteur']) : 0;
-    $nom_cookie = formidable_generer_nom_cookie($id_formulaire);
-    $cookie = isset($_COOKIE[$nom_cookie]) ? $_COOKIE[$nom_cookie] : false;
-
-    $anonymiser = ($anonymisation == '') ? false : true;
-    if ($anonymiser) $anonymiser_variable = $anonymisation;
-
-    // traitement de l'anonymisation
-    if ($anonymiser) {
-        // mod de l'id_auteur
-        $variables_anonymisation =
-                $GLOBALS['formulaires']['variables_anonymisation'][$anonymiser_variable];
-        $id = eval("return $variables_anonymisation;");
-        $id_auteur = formidable_scramble($id, $id_formulaire);
-    }
-    // ni cookie ni id, on ne peut rien faire
-    if (!$cookie and !$id_auteur) {
-        return false;
-    }
-
-    // priorite sur le cookie
-    if ($choix_identification == 'cookie' or !$choix_identification) {
-        if ($cookie)
-            $where = '(cookie='.sql_quote($cookie).($id_auteur ? ' OR id_auteur='.$id_auteur.')' : ')');
-        else
-            $where = 'id_auteur='.$id_auteur;
-    }
-
-    // sinon sur l'id_auteur
-    else {
-        if ($id_auteur)
-            $where = 'id_auteur='.$id_auteur;
-        else
-            $where = '(cookie='.sql_quote($cookie).($id_auteur ? ' OR id_auteur='.$id_auteur.')' : ')');
-    }
-
-    $reponses = sql_allfetsel(
-        'id_formulaires_reponse',
-        'spip_formulaires_reponses',
-        array(
-            array('=', 'id_formulaire', intval($id_formulaire)),
-            array('=', 'statut', sql_quote('publie')),
-            $where
-        ),
-        '',
-        'date'
-    );
-
-    if (is_array($reponses))
-        return array_map('reset', $reponses);
-    else
-        return false;
+function formidable_verifier_reponse_formulaire($id_formulaire, $choix_identification = 'cookie', $anonymisation = '') {
+       global $auteur_session;
+       $id_auteur = $auteur_session ? intval($auteur_session['id_auteur']) : 0;
+       $nom_cookie = formidable_generer_nom_cookie($id_formulaire);
+       $cookie = isset($_COOKIE[$nom_cookie]) ? $_COOKIE[$nom_cookie] : false;
+
+       $anonymiser = ($anonymisation == '') ? false : true;
+       if ($anonymiser) {
+               $anonymiser_variable = $anonymisation;
+       }
+
+       // traitement de l'anonymisation
+       if ($anonymiser) {
+               // mod de l'id_auteur
+               $variables_anonymisation =
+                               $GLOBALS['formulaires']['variables_anonymisation'][$anonymiser_variable];
+               $id = eval("return $variables_anonymisation;");
+               $id_auteur = formidable_scramble($id, $id_formulaire);
+       }
+       // ni cookie ni id, on ne peut rien faire
+       if (!$cookie and !$id_auteur) {
+               return false;
+       }
+
+       // priorite sur le cookie
+       if ($choix_identification == 'cookie' or !$choix_identification) {
+               if ($cookie) {
+                       $where = '(cookie='.sql_quote($cookie).($id_auteur ? ' OR id_auteur='.$id_auteur.')' : ')');
+               } else {
+                       $where = 'id_auteur='.$id_auteur;
+               }
+       } else {
+               // sinon sur l'id_auteur
+               if ($id_auteur) {
+                       $where = 'id_auteur='.$id_auteur;
+               } else {
+                       $where = '(cookie='.sql_quote($cookie).($id_auteur ? ' OR id_auteur='.$id_auteur.')' : ')');
+               }
+       }
+
+       $reponses = sql_allfetsel(
+               'id_formulaires_reponse',
+               'spip_formulaires_reponses',
+               array(
+                       array('=', 'id_formulaire', intval($id_formulaire)),
+                       array('=', 'statut', sql_quote('publie')),
+                       $where
+               ),
+               '',
+               'date'
+       );
+
+       if (is_array($reponses)) {
+               return array_map('reset', $reponses);
+       } else {
+               return false;
+       }
 }
 
 /*
@@ -162,42 +166,44 @@ function formidable_verifier_reponse_formulaire($id_formulaire, $choix_identific
  * @param array $env L'environnement, contenant normalement la réponse à la saisie
  * @return string Retour le HTML des vues
  */
-function formidable_analyser_saisie($saisie, $valeurs=array(), $reponses_total=0, $format_brut=false) {
-    // Si le paramètre n'est pas bon ou que c'est un conteneur, on génère du vide
-    if (!is_array($saisie) or (isset($saisie['saisies']) and $saisie['saisies']))
-        return '';
-
-    $contexte = array('reponses_total'=>$reponses_total);
-
-    // On sélectionne le type de saisie
-    $contexte['type_saisie'] = $saisie['saisie'];
-
-    // Peut-être des transformations à faire sur les options textuelles
-    $options = $saisie['options'];
-    foreach ($options as $option => $valeur){
-        $options[$option] = _T_ou_typo($valeur, 'multi');
-    }
-
-    // On ajoute les options propres à la saisie
-    $contexte = array_merge($contexte, $options);
-
-    // On récupère toutes les valeurs du champ
-    if (isset($valeurs[$contexte['nom']]) and $valeurs[$contexte['nom']] and is_array($valeurs[$contexte['nom']])){
-        $contexte['valeurs'] = $valeurs[$contexte['nom']];
-    }
-    else{
-        $contexte['valeurs'] = array();
-    }
-
-    // On génère la saisie
-    if ($format_brut) {
-        return analyser_saisie($contexte);
-    } else {
-        return recuperer_fond(
-            'saisies-analyses/_base',
-            $contexte
-        );
-    }
+function formidable_analyser_saisie($saisie, $valeurs = array(), $reponses_total = 0, $format_brut = false) {
+       // Si le paramètre n'est pas bon ou que c'est un conteneur, on génère du vide
+       if (!is_array($saisie) or (isset($saisie['saisies']) and $saisie['saisies'])) {
+               return '';
+       }
+
+       $contexte = array('reponses_total'=>$reponses_total);
+
+       // On sélectionne le type de saisie
+       $contexte['type_saisie'] = $saisie['saisie'];
+
+       // Peut-être des transformations à faire sur les options textuelles
+       $options = $saisie['options'];
+       foreach ($options as $option => $valeur) {
+               $options[$option] = _T_ou_typo($valeur, 'multi');
+       }
+
+       // On ajoute les options propres à la saisie
+       $contexte = array_merge($contexte, $options);
+
+       // On récupère toutes les valeurs du champ
+       if (isset($valeurs[$contexte['nom']])
+               and $valeurs[$contexte['nom']]
+               and is_array($valeurs[$contexte['nom']])) {
+               $contexte['valeurs'] = $valeurs[$contexte['nom']];
+       } else {
+               $contexte['valeurs'] = array();
+       }
+
+       // On génère la saisie
+       if ($format_brut) {
+               return analyser_saisie($contexte);
+       } else {
+               return recuperer_fond(
+                       'saisies-analyses/_base',
+                       $contexte
+               );
+       }
 }
 
 /*
@@ -207,88 +213,106 @@ function formidable_analyser_saisie($saisie, $valeurs=array(), $reponses_total=0
  * @return array Tableau contenant une ligne
  */
 function analyser_saisie($saisie) {
-    if (!isset($saisie['type_saisie']) or $saisie['type_saisie'] == '')
-        return '';
-
-    $ligne = array();
-
-    switch($saisie['type_saisie']) {
-        case 'selecteur_rubrique' :
-        case 'selecteur_rubrique_article' :
-        case 'selecteur_article' :
-            $ligne['plein'] = count(array_filter($saisie['valeurs']));
-            $ligne['vide'] = count(array_diff_key($saisie['valeurs']
-                , array_filter($saisie['valeurs'])));
-        break;
-        case 'radio' :
-        case 'selection' :
-        case 'selection_multiple' :
-        case 'choix_couleur':
-        case 'checkbox' :
-            $stats = array();
-            foreach($saisie['valeurs'] as $valeur) {
-                if (is_array($valeur)) {
-                    foreach($valeur as $choix) {
-                        if (isset($stats["choix-$choix"]))
-                            $stats["choix-$choix"]++;
-                        else $stats["choix-$choix"] = 1;
-                    }
-                } else {
-                    if (isset($stats["choix-$valeur"]))
-                            $stats["choix-$valeur"]++;
-                        else $stats["choix-$valeur"] = 1;
-                }
-            }
-            $datas = is_string($saisie['datas'])
-                ? saisies_chaine2tableau(saisies_aplatir_chaine($saisie['datas']))
-                : $saisie['datas'];
-            foreach($datas as $key => $val) {
-                $nb = (isset($stats["choix-$key"]))
-                    ? $stats["choix-$key"]
-                    : 0;
-                $ligne[$val] = $nb;
-            }
-        break;
-        case 'destinataires' :
-            $stats = array();
-            foreach($saisie['valeurs'] as $valeur) {
-                foreach($valeur as $choix) {
-                    if (isset($stats["choix-$choix"]))
-                        $stats["choix-$choix"]++;
-                    else $stats["choix-$choix"] = 1;
-                }
-            }
-            foreach($stats as $key => $val) {
-                $key = str_replace('choix-', '', $key);
-                if ($key == '') $key = '<valeur vide>';
-                $auteur = sql_getfetsel('nom','spip_auteurs',"id_auteur=$key");
-                $ligne[$auteur] = $val;
-            }
-        break;
-    }
-
-    $vide = 0;
-    foreach($saisie['valeurs'] as $valeur) {
-        if ($valeur == '') $vide++;
-        switch($saisie['type_saisie']) {
-            case 'case' :
-            case 'oui_non' :
-                if(isset($ligne['oui']) == false) $ligne['oui'] = 0;
-                if(isset($ligne['non']) == false) $ligne['non'] = 0;
-                if ($valeur) $ligne['oui']++; else $ligne['non']++;
-            break;
-            case 'input' :
-            case 'hidden' :
-            case 'explication' :
-            break;
-        }
-    }
-    $ligne['sans_reponse'] = $vide;
-    $ligne['header'] = $saisie['label'] != ''
-        ? $saisie['label']
-        : $saisie['type_saisie'];
-
-    return $ligne;
+       if (!isset($saisie['type_saisie']) or $saisie['type_saisie'] == '') {
+               return '';
+       }
+
+       $ligne = array();
+
+       switch ($saisie['type_saisie']) {
+               case 'selecteur_rubrique':
+               case 'selecteur_rubrique_article':
+               case 'selecteur_article':
+                       $ligne['plein'] = count(array_filter($saisie['valeurs']));
+                       $ligne['vide'] = count(array_diff_key($saisie['valeurs'], array_filter($saisie['valeurs'])));
+                       break;
+               case 'radio':
+               case 'selection':
+               case 'selection_multiple':
+               case 'choix_couleur':
+               case 'checkbox':
+                       $stats = array();
+                       foreach ($saisie['valeurs'] as $valeur) {
+                               if (is_array($valeur)) {
+                                       foreach ($valeur as $choix) {
+                                               if (isset($stats["choix-$choix"])) {
+                                                       $stats["choix-$choix"]++;
+                                               } else {
+                                                       $stats["choix-$choix"] = 1;
+                                               }
+                                       }
+                               } else {
+                                       if (isset($stats["choix-$valeur"])) {
+                                               $stats["choix-$valeur"]++;
+                                       } else {
+                                               $stats["choix-$valeur"] = 1;
+                                       }
+                               }
+                       }
+                       $datas = is_string($saisie['datas'])
+                               ? saisies_chaine2tableau(saisies_aplatir_chaine($saisie['datas']))
+                               : $saisie['datas'];
+                       foreach ($datas as $key => $val) {
+                               $nb = (isset($stats["choix-$key"]))
+                                       ? $stats["choix-$key"]
+                                       : 0;
+                               $ligne[$val] = $nb;
+                       }
+                       break;
+               case 'destinataires':
+                       $stats = array();
+                       foreach ($saisie['valeurs'] as $valeur) {
+                               foreach ($valeur as $choix) {
+                                       if (isset($stats["choix-$choix"])) {
+                                               $stats["choix-$choix"]++;
+                                       } else {
+                                               $stats["choix-$choix"] = 1;
+                                       }
+                               }
+                       }
+                       foreach ($stats as $key => $val) {
+                               $key = str_replace('choix-', '', $key);
+                               if ($key == '') {
+                                       $key = '<valeur vide>';
+                               }
+                               $auteur = sql_getfetsel('nom', 'spip_auteurs', "id_auteur=$key");
+                               $ligne[$auteur] = $val;
+                       }
+                       break;
+       }
+
+       $vide = 0;
+       foreach ($saisie['valeurs'] as $valeur) {
+               if ($valeur == '') {
+                       $vide++;
+               }
+               switch ($saisie['type_saisie']) {
+                       case 'case':
+                       case 'oui_non':
+                               if (isset($ligne['oui']) == false) {
+                                       $ligne['oui'] = 0;
+                               }
+                               if (isset($ligne['non']) == false) {
+                                       $ligne['non'] = 0;
+                               }
+                               if ($valeur) {
+                                       $ligne['oui']++;
+                               } else {
+                                       $ligne['non']++;
+                               }
+                               break;
+                       case 'input':
+                       case 'hidden':
+                       case 'explication':
+                               break;
+               }
+       }
+       $ligne['sans_reponse'] = $vide;
+       $ligne['header'] = $saisie['label'] != ''
+               ? $saisie['label']
+               : $saisie['type_saisie'];
+
+       return $ligne;
 }
 
 
@@ -302,18 +326,18 @@ function analyser_saisie($saisie) {
  * @filtre
  *
  * @param string|array $texte
- *     Le texte (possiblement sérializé) ou un tableau
+ *      Le texte (possiblement sérializé) ou un tableau
  * @return array|string
- *     Tableau, texte désérializé ou texte
+ *      Tableau, texte désérializé ou texte
 **/
 function filtre_tenter_unserialize_dist($texte) {
-    if (is_array($texte)) {
-        return $texte;
-    }
-    if ($tmp = @unserialize($texte)) {
-        return $tmp;
-    }
-    return $texte;
+       if (is_array($texte)) {
+               return $texte;
+       }
+       if ($tmp = @unserialize($texte)) {
+               return $tmp;
+       }
+       return $texte;
 }
 
 
@@ -321,14 +345,18 @@ function filtre_tenter_unserialize_dist($texte) {
  * Retourne un texte du nombre de réponses
  *
  * @param int $nb
- *     Nombre de réponses
+ *      Nombre de réponses
  * @return string
- *     Texte indiquant le nombre de réponses
+ *      Texte indiquant le nombre de réponses
 **/
 function titre_nb_reponses($nb) {
-    if (!$nb) return _T('formidable:reponse_aucune');
-    if ($nb == 1) return _T('formidable:reponse_une');
-    return _T('formidable:reponses_nb', array('nb' => $nb));
+       if (!$nb) {
+               return _T('formidable:reponse_aucune');
+       }
+       if ($nb == 1) {
+               return _T('formidable:reponse_une');
+       }
+       return _T('formidable:reponses_nb', array('nb' => $nb));
 }
 
 /**
@@ -339,18 +367,21 @@ function titre_nb_reponses($nb) {
  * @return string Valeur numérique
 */
 function md5_hex_to_dec($hex_str) {
-    $arr = str_split($hex_str, 4);
-    foreach ($arr as $grp) {
-        $dec[] = str_pad(hexdec($grp), 5, '0', STR_PAD_LEFT);
-    }
-
-    /* on s'assure que $result ne commence pas par un zero */
-    $result = implode('', $dec);
-    for ($cpt = 0 ; $cpt < strlen($result) ; $cpt++) {
-        if ($result[$cpt] != '0') break;
-    }
-    $result = substr($result, $cpt);
-    return $result;
+       $arr = str_split($hex_str, 4);
+       $dec = array();
+       foreach ($arr as $grp) {
+               $dec[] = str_pad(hexdec($grp), 5, '0', STR_PAD_LEFT);
+       }
+
+       /* on s'assure que $result ne commence pas par un zero */
+       $result = implode('', $dec);
+       for ($cpt = 0; $cpt < strlen($result); $cpt++) {
+               if ($result[$cpt] != '0') {
+                       break;
+               }
+       }
+       $result = substr($result, $cpt);
+       return $result;
 }
 
 /**
@@ -368,13 +399,12 @@ function md5_hex_to_dec($hex_str) {
  * @return string Un nombre de 19 chiffres
 */
 function formidable_scramble($login, $id_form, $passwd = '') {
-    if ($passwd == '')
-        $passwd = $GLOBALS['formulaires']['passwd']['interne'];
-    $login_md5 = md5("$login$passwd$id_form");
-    $login_num = md5_hex_to_dec($login_md5);
-    $login_num = substr($login_num, 0, 19);
-
-    return $login_num;
+       if ($passwd == '') {
+               $passwd = $GLOBALS['formulaires']['passwd']['interne'];
+       }
+       $login_md5 = md5("$login$passwd$id_form");
+       $login_num = md5_hex_to_dec($login_md5);
+       $login_num = substr($login_num, 0, 19);
+
+       return $login_num;
 }
-
-?>
index f526be0..1edad5a 100644 (file)
@@ -1,14 +1,30 @@
 <?php
 
-// Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+// Securite
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function inc_rechercher_joints_formulaires_reponse_formulaires_reponses_champ_dist($table,$table_liee,$ids_trouves, $serveur){
+function inc_rechercher_joints_formulaires_reponse_formulaires_reponses_champ_dist(
+       $table,
+       $table_liee,
+       $ids_trouves,
+       $serveur
+) {
 
-       $cle_depart =  "id_formulaires_reponse";
-       $cle_arrivee =  "id_formulaires_reponse";
+       $cle_depart = 'id_formulaires_reponse';
+       $cle_arrivee = 'id_formulaires_reponse';
 
-       $s = sql_select("DISTINCT R.$cle_depart", "spip_formulaires_reponses AS R JOIN spip_formulaires_reponses_champs AS C ON C.id_formulaires_reponse=R.id_formulaires_reponse", sql_in("C.id_formulaires_reponses_champ", $ids_trouves), '','','','',$serveur);
+       $s = sql_select(
+               "DISTINCT R.$cle_depart",
+               'spip_formulaires_reponses AS R JOIN spip_formulaires_reponses_champs AS C ON C.id_formulaires_reponse=R.id_formulaires_reponse',
+               sql_in('C.id_formulaires_reponses_champ', $ids_trouves),
+               '',
+               '',
+               '',
+               '',
+               $serveur
+       );
 
        return array($cle_depart, $cle_arrivee, $s);
-}
\ No newline at end of file
+}
index ae4fba2..98fd963 100644 (file)
@@ -1,23 +1,36 @@
 <traduction module="formidable" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/formidable/trunk/lang/" reference="fr">
-       <langue code="de" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=de" total="179" traduits="97" relire="0" modifs="4" nouveaux="78" pourcent="54.19">
+       <langue code="ar" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=ar" total="205" traduits="135" relire="0" modifs="1" nouveaux="69" pourcent="65.85">
+               <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
+       </langue>
+       <langue code="de" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=de" total="205" traduits="98" relire="0" modifs="4" nouveaux="103" pourcent="47.80">
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
        </langue>
-       <langue code="en" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=en" total="179" traduits="165" relire="1" modifs="0" nouveaux="13" pourcent="92.18">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=en" total="205" traduits="196" relire="0" modifs="1" nouveaux="8" pourcent="95.61">
                <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
+               <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
+               <traducteur nom="jack31" lien="http://trad.spip.net/auteur/jack31" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
                <traducteur nom="Paolo" lien="http://trad.spip.net/auteur/paolo" />
                <traducteur nom="twelf" lien="http://trad.spip.net/auteur/twelf" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=es" total="179" traduits="175" relire="0" modifs="0" nouveaux="4" pourcent="97.77">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=es" total="205" traduits="177" relire="0" modifs="1" nouveaux="27" pourcent="86.34">
                <traducteur nom="severo" lien="http://trad.spip.net/auteur/severo" />
                <traducteur nom="tin" lien="http://trad.spip.net/auteur/tin" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=fr" total="179" traduits="179" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=fr" total="205" traduits="205" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="it" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=it" total="179" traduits="114" relire="0" modifs="3" nouveaux="62" pourcent="63.69">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=it" total="205" traduits="115" relire="0" modifs="3" nouveaux="87" pourcent="56.10">
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=sk" total="179" traduits="135" relire="0" modifs="3" nouveaux="41" pourcent="75.42">
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=pt_br" total="205" traduits="197" relire="0" modifs="0" nouveaux="8" pourcent="96.10">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+               <traducteur nom="telopa" lien="http://trad.spip.net/auteur/telopa" />
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=ru" total="205" traduits="178" relire="2" modifs="0" nouveaux="25" pourcent="86.83">
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/formidable?lang_cible=sk" total="205" traduits="136" relire="0" modifs="3" nouveaux="66" pourcent="66.34">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
diff --git a/www/plugins/formidable/lang/formidable_ar.php b/www/plugins/formidable/lang/formidable_ar.php
new file mode 100644 (file)
index 0000000..2cbda39
--- /dev/null
@@ -0,0 +1,171 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=ar
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'activer_pages_explication' => 'افتراضياً صفحات الاستمارات العمومية غير مسموح بها',
+       'activer_pages_label' => 'السماح بإنشاء صفحات عمومية للاستمارات',
+       'admin_reponses_auteur' => 'السماح لواضعي الاستمارات بتعديل إجاباتهم',
+       'analyse_avec_reponse' => 'أجابات غير فارغة',
+       'analyse_exclure_champs_label' => 'الحقول المطلوب استبعادها',
+       'analyse_exporter' => 'تصدير التحليل',
+       'analyse_longueur_moyenne' => 'متوسط الطول بعدد الكلمات',
+       'analyse_nb_reponses_total' => '@nb@ شخص أجابوا على الاستمارة.',
+       'analyse_sans_reponse' => 'بدون جواب',
+       'analyse_une_reponse_total' => 'شخص واحد أجاب على هذه الاستمارة',
+       'analyse_zero_reponse_total' => 'لم يجب أحد على هذه الاستمارة.',
+       'aucun_traitement' => 'لا يوجد اي معالجة',
+       'autoriser_admin_restreint' => 'السماح للمدراء المحدودين بإنشاء الاستمارات وتعديلها',
+       'autoriser_admin_restreint_explication' => 'افتراضياً، لا يحق الا للمدراء الوصول الي الاستمارات وإنشائها وتعديلها',
+
+       // B
+       'bouton_formulaires' => 'الاستمارات',
+       'bouton_revert_formulaire' => 'العودة الى آخر إصدار تم حفظه',
+
+       // C
+       'cfg_titre_page_configurer_formidable' => 'إعداد ملحق الاستمارات',
+       'cfg_titre_parametrages_analyse' => 'إعداد وحدة تحليل الإجابات',
+       'champs' => 'الحقول',
+       'changer_statut' => 'هذه الاستمارة:',
+
+       // E
+       'editer_apres_choix_formulaire' => 'الاستمارة من جديد',
+       'editer_apres_choix_redirige' => 'إعادة التوجيه الى عنوان جديد',
+       'editer_apres_choix_rien' => 'لا شيء',
+       'editer_apres_choix_stats' => 'إحصاءات الإجابات',
+       'editer_apres_choix_valeurs' => 'القيم المدخلة',
+       'editer_apres_explication' => 'بعد التصديق، عرض مكان الاستمارة:',
+       'editer_apres_label' => 'عرض بعد ذلك',
+       'editer_descriptif' => 'الوصف',
+       'editer_descriptif_explication' => 'وصف للاستمارة مخصص للمجال الخاص.',
+       'editer_identifiant' => 'المعرّف',
+       'editer_identifiant_explication' => 'أدخل معرّف نصي فريد سيسمح لك تفعيل الاستمارة بسهولة أكبر.',
+       'editer_menu_auteurs' => 'إعداد المؤلفين',
+       'editer_menu_champs' => 'إعداد الحقول',
+       'editer_menu_formulaire' => 'إعداد الاستمارة',
+       'editer_menu_traitements' => 'إعداد المعالجات',
+       'editer_message_erreur_unicite_label' => 'رساسلة الخطأ في حال لم يكن الحقل فريداً',
+       'editer_message_ok' => 'رسالة الاياب',
+       'editer_message_ok_explication' => 'يمكن تخصيص الرسالة التي ستعرض على المستخدم بعد تصديقه على إجاباته للاستمارة.',
+       'editer_modifier_formulaire' => 'تعديل الاستمارة',
+       'editer_nouveau' => 'استمارة جديدة',
+       'editer_redirige_url' => 'عنوان إعادة التوجيه بعد التصديق',
+       'editer_redirige_url_explication' => 'أترك فارغاً اذا اردت البقاء في الصفحة نفسها',
+       'editer_resume_reponse' => 'عرض مقتضب للإجابة',
+       'editer_titre' => 'العنوان',
+       'erreur_identifiant' => 'هذا المعرّف مستخدم سايقاً',
+       'erreur_inexistant' => 'هذه الاستمارة غير موجودة',
+       'erreur_unicite' => 'هذه القيمة مستخدمة سابقاً',
+       'exporter_formulaire_format_label' => 'تنسيق الملف',
+       'exporter_formulaire_statut_label' => 'الإجابات',
+
+       // F
+       'formulaires_aucun' => 'حالياً لا يوجد اي استمارة.',
+       'formulaires_aucun_champ' => 'حالياً لا يوجد اي حقل إدخال في هذه الاستمارة.',
+       'formulaires_dupliquer' => 'تكرار الاستمارة',
+       'formulaires_dupliquer_copie' => '(نسخة)',
+       'formulaires_introduction' => 'هنا يتم إنشاء استمارات الموقع وإعدادها.',
+       'formulaires_nouveau' => 'إنشاء استمارة جديدة',
+       'formulaires_supprimer' => 'حذف الاستمارة',
+       'formulaires_tous' => 'كل الاستمارات',
+
+       // I
+       'identification_par_cookie' => 'بواسطة الكعكة',
+       'identification_par_id_auteur' => 'بواسطة معرّف (id_auteur) الشخص المعرّف به',
+       'importer_formulaire' => 'استيراد استمارة',
+       'importer_formulaire_format_label' => 'تنسيق الملف',
+       'info_1_formulaire' => 'استمارة واحدة',
+       'info_1_reponse' => 'إجابة واحدة',
+       'info_aucun_formulaire' => 'لا توجد استمارات',
+       'info_aucune_reponse' => 'لا توجد إجابات',
+       'info_nb_formulaires' => '@nb@ استمارة',
+       'info_nb_reponses' => '@nb@ إجابة',
+       'info_reponse_publiee' => 'مصدّقة',
+       'info_reponse_publiees' => 'مصدّقة',
+       'info_reponse_supprimee' => 'محذوفة',
+       'info_reponse_supprimees' => 'محذوفة',
+       'info_reponse_toutes' => 'الكل',
+
+       // M
+       'modele_label_formulaire_formidable' => 'اي استمارة',
+       'modele_nom_formulaire' => 'استمارة',
+
+       // N
+       'noisette_label_afficher_titre_formulaire' => 'عرض عنوان الاستمارة؟',
+       'noisette_nom_noisette_formulaire' => 'إستمارة',
+
+       // R
+       'reponse_aucune' => 'لا توجد إجابات',
+       'reponse_numero' => 'إجابة رقم:',
+       'reponse_statut' => 'هذه الإجابة:',
+       'reponse_supprimer' => 'حذف هذه الإجابة',
+       'reponse_une' => 'إجابة واحدة',
+       'reponses_analyse' => 'تحليل الإجابات',
+       'reponses_anonyme' => 'مغفّل',
+       'reponses_auteur' => 'مستخدم',
+       'reponses_exporter' => 'تصدير الإجابات',
+       'reponses_exporter_format_csv' => 'جدول إلكتروني .CSV',
+       'reponses_exporter_format_xls' => 'إكسل .XLS',
+       'reponses_exporter_statut_publie' => 'منشورة',
+       'reponses_exporter_statut_tout' => 'الكل',
+       'reponses_exporter_telecharger' => 'تحميل',
+       'reponses_ip' => 'عنوان IP',
+       'reponses_liste' => 'لائحة الإجابات',
+       'reponses_liste_prop' => 'إجابات بانتظار التصديق',
+       'reponses_liste_publie' => 'كل الإجابات المصدّقة',
+       'reponses_supprimer' => 'حذف كل الإجابات على هذه الاستمارة', # MODIF
+       'reponses_voir_detail' => 'عرض الإجابة',
+
+       // S
+       'sans_reponses' => 'بدون إجابة',
+
+       // T
+       'texte_statut_poubelle' => 'محذوفة',
+       'texte_statut_propose_evaluation' => 'مقترحة',
+       'texte_statut_publie' => 'مصدّقة',
+       'titre_cadre_raccourcis' => 'إختصارات',
+       'titre_reponses' => 'إجابات',
+       'traitements_aide_memoire' => 'مفكرة:',
+       'traiter_email_description' => 'يرسل نتيجة الاستمارة بالبريد الإلكتروني الى لائحة من المتلقين.',
+       'traiter_email_option_activer_accuse_label' => 'إقرار بالاستلام',
+       'traiter_email_option_activer_accuse_label_case' => 'أيضاً إرسال بريد الى عنوان المرسِل يحتوي على رسالة تأكيد الاستلام.',
+       'traiter_email_option_destinataires_explication' => 'اختيار الحقل المناسب للمرسَل اليهم.',
+       'traiter_email_option_destinataires_label' => 'المرسَل اليهم',
+       'traiter_email_option_destinataires_plus_explication' => 'لائحة عناوين بريد تفصل بينها فواصل.',
+       'traiter_email_option_destinataires_plus_label' => 'المرسل اليهم الإضافيون',
+       'traiter_email_option_envoyeur_courriel_explication' => 'اختيار الحقل الذي سيحتوي على عنوان بريد المرسِل.',
+       'traiter_email_option_envoyeur_courriel_label' => 'بريد المرسِل',
+       'traiter_email_option_envoyeur_nom_explication' => 'تكوين هذا الاسم بواسطة الاختصارات @raccourcis@ (أنظر المفكرة). اذا ترك فارغاً سيتم استخدام اسم الموقع.',
+       'traiter_email_option_envoyeur_nom_label' => 'اسم المرسِل',
+       'traiter_email_option_sujet_accuse_label' => 'موضوع الإقرار بالاستلام',
+       'traiter_email_option_sujet_explication' => 'تكوين الموضوع بواسطة الاختصارات @raccourcis@. اذا ترك فارغاً سيتم تكوين الموضوع آلياً.',
+       'traiter_email_option_sujet_label' => 'موضوع الرسالة',
+       'traiter_email_titre' => 'إرسال بالبريد الإلكتروني',
+       'traiter_enregistrement_description' => 'يسجل نتائج الاستمارة في قاعدة البيانات.',
+       'traiter_enregistrement_option_anonymiser_label' => 'جعل الاستمارة مغفّلة',
+       'traiter_enregistrement_option_auteur' => 'استخدام المؤلفين للاستمارات',
+       'traiter_enregistrement_option_auteur_explication' => 'تخصيص مؤلف او اكثر لايتمارة. اذا تم تفعيل هذا الخيار، مؤلفو الاستمارة وحدهم يمكنهم الوصول الى بياناتهم.',
+       'traiter_enregistrement_option_choix_select_label' => 'اختيار معامل من بين الماملات المقترحة',
+       'traiter_enregistrement_option_identification_explication' => 'اذا كانت الإجابات قابلة للتعديل، اي اسلوب مفضل استخدامه لمعرفة اي جواب يجب تعديله؟ ',
+       'traiter_enregistrement_option_identification_label' => 'تعريف',
+       'traiter_enregistrement_option_ip_label' => 'تسجيل عناوين IP (تحجب بعد فترة محددة)',
+       'traiter_enregistrement_option_moderation_label' => 'مراقبة',
+       'traiter_enregistrement_option_modifiable_explication' => 'قابل للتعديل: يمكن للزوار تعديل إجاباتهم بعد حين.',
+       'traiter_enregistrement_option_modifiable_label' => 'إجابات يمكن تعديلها',
+       'traiter_enregistrement_option_multiple_explication' => 'متعدد: الشخص نفسه يمكنه الإجابة عدة مرات.',
+       'traiter_enregistrement_option_multiple_label' => 'إجابات متعددة',
+       'traiter_enregistrement_titre' => 'تسجيل النتائج',
+
+       // V
+       'voir_exporter' => 'تصدير الاستمارة',
+       'voir_numero' => 'استمارة رقم:',
+       'voir_reponses' => 'عرض الإجابات',
+       'voir_traitements' => 'المعالجات'
+);
index 2ca93c2..3ca90ce 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -37,12 +39,13 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'editer_titre' => 'Titel',
        'erreur_autorisation' => 'Sie sind nicht berechtigt, die Formulare der Website zu ändern.',
        'erreur_base' => 'Beim Speichern ist ein technischer Fehler aufgetreten.',
-       'erreur_generique' => 'Die Felder enthalten Fehler. Bitte überprüfen sie ihre Eingaben.',
+       'erreur_generique' => 'Die Felder enthalten Fehler. Bitte überprüfen Sie Ihre Eingaben.',
        'erreur_identifiant' => 'Diese Bezeichnung wird bereits verwendet.',
        'erreur_importer_forms' => 'Fehler beim Importieren des Formulars aus Forms&Tables',
        'erreur_importer_wcs' => 'Fehler beim Importieren des Formulars aus W.C.S',
        'erreur_importer_yaml' => 'Fehler beim Importieren des Formulars aus YAML',
        'erreur_inexistant' => 'Formular nicht vorhanden.',
+       'exporter_formulaire_format_label' => 'Format der Datei',
 
        // F
        'formulaire_anonyme_explication' => 'Diese Form ist anonym, dh die Identität des Benutzers nicht registriert ist.', # MODIF
@@ -128,5 +131,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'Antworten anzeigen',
        'voir_traitements' => 'Verarbeitungsoptionen'
 );
-
-?>
index fa28a98..aab1f48 100644 (file)
@@ -3,12 +3,22 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // A
+       'activer_pages_explication' => 'By default, public pages of the forms are not allowed',
+       'activer_pages_label' => 'Allow creation of public pages for the forms.',
+       'admin_reponses_auteur' => 'Allow forms author to modify the answers',
+       'admin_reponses_auteur_explication' => 'Only administrators can normally modify the answers filled in a form (to the bin, published, proposed to evaluation). This option allows the author of a form to modify the status (with the risk to alterate potentiall statistics)
+',
        'analyse_avec_reponse' => 'Non-empty answers',
+       'analyse_exclure_champs_explication' => 'Insert the name of the fields to exclude, separated by <code>|</code>. Do not insert <code>@</code>.
+
+',
        'analyse_exclure_champs_label' => 'Fields to exclude',
        'analyse_exporter' => 'Export analysis',
        'analyse_longueur_moyenne' => 'Average number in words length',
@@ -17,6 +27,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'analyse_une_reponse_total' => 'One person responded to this form.',
        'analyse_zero_reponse_total' => 'No one responded to this form.',
        'aucun_traitement' => 'No treatment',
+       'autoriser_admin_restreint' => 'Allow restricted administrators to create and modify forms',
+       'autoriser_admin_restreint_explication' => 'By default, only administrators have access to the creation and modification of forms',
 
        // B
        'bouton_formulaires' => 'Forms',
@@ -51,25 +63,37 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'editer_menu_champs' => 'Configure the fields',
        'editer_menu_formulaire' => 'Configure the form',
        'editer_menu_traitements' => 'Configure the treatments',
+       'editer_message_erreur_unicite_explication' => 'If you leave this field empty, the Formidable default error message will be shown',
+       'editer_message_erreur_unicite_label' => 'Error message when a field is not unique',
        'editer_message_ok' => 'Return message',
        'editer_message_ok_explication' => 'You can customize the message that will be displayed to the user after submitting a valid form.',
        'editer_modifier_formulaire' => 'Modify the form',
        'editer_nouveau' => 'New form',
        'editer_redirige_url' => 'Forwarding address after validation',
        'editer_redirige_url_explication' => 'Leave blank if you want to stay on the same page',
+       'editer_resume_reponse' => 'Display summary of the response',
+       'editer_resume_reponse_explication' => '
+This string is used to display a summary of each reply in the lists. Fields such as <tt>@input_1@</tt> will be replaced as indicated by the following reminder',
        'editer_titre' => 'Title',
+       'editer_unicite_explication' => 'Save the form only if a field is unique',
+       'editer_unicite_label' => 'Verify that this field is unique',
        'erreur_autorisation' => 'You do not have the right to edit the website forms',
        'erreur_base' => 'An error occurred as the data was being saved.',
        'erreur_generique' => 'There are errors in the fields below. Please check.',
        'erreur_identifiant' => 'This login is already used.',
+       'erreur_identifiant_format' => 'The ID can only contain numbers, letters and "_" character',
        'erreur_importer_forms' => 'Error while importing the Forms&Tables form',
        'erreur_importer_wcs' => 'Error while importing the W.C.S form',
        'erreur_importer_yaml' => 'Error while importing the YAML file',
        'erreur_inexistant' => 'This form doesn’t exist.',
+       'erreur_unicite' => 'This value is already in use',
+       'exporter_formulaire_format_label' => 'File format',
+       'exporter_formulaire_statut_label' => 'Answers',
 
        // F
        'formulaire_anonyme_explication' => 'This form is anonymous; meaning that the user’s identity won’t be recorded.',
        'formulaires_aucun' => 'There is no form for now',
+       'formulaires_aucun_champ' => 'There is currently no entry field for this form.',
        'formulaires_dupliquer' => 'Duplicate the form',
        'formulaires_dupliquer_copie' => '(copy)',
        'formulaires_introduction' => 'Create and configure forms on your site here.',
@@ -123,12 +147,18 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'reponses_anonyme' => 'Anonymous',
        'reponses_auteur' => 'User',
        'reponses_exporter' => 'Export the answers',
+       'reponses_exporter_format_csv' => 'Spreadsheet.CSV',
+       'reponses_exporter_format_xls' => 'Excel .XLS',
+       'reponses_exporter_statut_publie' => 'Published',
+       'reponses_exporter_statut_tout' => 'All',
+       'reponses_exporter_telecharger' => 'Download',
        'reponses_ip' => 'IP address',
        'reponses_liste' => 'Answers list',
        'reponses_liste_prop' => 'Answers pending for validation',
        'reponses_liste_publie' => 'All validated answers',
        'reponses_nb' => '@nb@ answers',
-       'reponses_supprimer' => 'Delete all the answers to this form',
+       'reponses_supprimer' => 'Delete all the answers to this form', # MODIF
+       'reponses_supprimer_confirmation' => 'Are you sure you want to delete all answers to this form?',
        'reponses_voir_detail' => 'See the answer',
        'retour_aucun_traitement' => 'Your reply was accepted. But as the function of the form has not yet been configured, nothing was done with your data!',
 
@@ -154,6 +184,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_email_message_ok' => 'Your message has been successfully sent by email.',
        'traiter_email_option_activer_accuse_label' => 'Acknowledgement of receipt',
        'traiter_email_option_activer_accuse_label_case' => 'Also send an email to the sender with a confirmation message.',
+       'traiter_email_option_courriel_envoyeur_accuse_explication' => 'Specify the email used to send the acknowledgment. Otherwise, the recipient will be the sender.',
+       'traiter_email_option_courriel_envoyeur_accuse_label' => 'Email of the acknowledgement of receipt',
+       'traiter_email_option_destinataires_champ_form_explication' => 'If one of the fields is an email address and you want to send the form to this address, select the field.',
+       'traiter_email_option_destinataires_champ_form_label' => 'The recipient is in one of the fields of the forms',
        'traiter_email_option_destinataires_explication' => 'Choose the field that corresponds to the message recipients.',
        'traiter_email_option_destinataires_label' => 'Recipients',
        'traiter_email_option_destinataires_plus_explication' => 'A list of addresses separated by commas.',
@@ -162,6 +196,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_email_option_envoyeur_courriel_label' => 'Sender Email',
        'traiter_email_option_envoyeur_nom_explication' => 'Build this name using the @raccourcis@ (see the notes). If you enter nothing, it will be the name of the site.',
        'traiter_email_option_envoyeur_nom_label' => 'Name of sender',
+       'traiter_email_option_nom_envoyeur_accuse_explication' => 'Specify the name of the sender used to send the acknowledgment. Otherwise, the recipient will be the sender.',
+       'traiter_email_option_nom_envoyeur_accuse_label' => 'Name of the sender of the acknowledgment',
        'traiter_email_option_sujet_accuse_label' => 'Subject of the acknowledgement of receipt',
        'traiter_email_option_sujet_explication' => 'Build topic using @raccourcis@. If you enter nothing, the subject will be built automatically.',
        'traiter_email_option_sujet_label' => 'Message subject',
@@ -176,7 +212,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_enregistrement_erreur_base' => 'An error occurred while writing to the database',
        'traiter_enregistrement_erreur_deja_repondu' => 'You have already filled in this form.',
        'traiter_enregistrement_erreur_edition_reponse_inexistante' => 'The answer to edit can not be found.',
-       'traiter_enregistrement_message_ok' => 'Thanks. Your answers have been correctly saved', # RELIRE
+       'traiter_enregistrement_message_ok' => 'Thanks. Your answers have been correctly saved',
        'traiter_enregistrement_option_anonymiser_explication' => 'Results anonymous (don’t keep any tracks of user who have answered).',
        'traiter_enregistrement_option_anonymiser_label' => 'Anonymize form',
        'traiter_enregistrement_option_anonymiser_variable_explication' => 'What system variable used to calculate a single value for each author without revealing his identity.',
@@ -186,6 +222,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_enregistrement_option_choix_select_label' => 'Select a variable from the available',
        'traiter_enregistrement_option_identification_explication' => 'If the answers can be changed, which method is used first to know the answer to modify ?',
        'traiter_enregistrement_option_identification_label' => 'Identification',
+       'traiter_enregistrement_option_ip_label' => 'Record IPs (hidden after a period of retention)',
        'traiter_enregistrement_option_moderation_label' => 'Moderation',
        'traiter_enregistrement_option_modifiable_explication' => 'Editable: Visitors can change their answers afterwards.',
        'traiter_enregistrement_option_modifiable_label' => 'Answers can be modified',
@@ -199,5 +236,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'See the answers',
        'voir_traitements' => 'Treatments'
 );
-
-?>
index 072d1a1..be26e69 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -69,6 +71,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_importer_wcs' => 'Error durante la importación del formulario W.C.S',
        'erreur_importer_yaml' => 'Error durante la importación del archivo YAML',
        'erreur_inexistant' => 'Este formulario no existe. ',
+       'exporter_formulaire_format_label' => 'Formato de archivo',
+       'exporter_formulaire_statut_label' => 'Respuestas',
 
        // F
        'formulaire_anonyme_explication' => 'Este formulario es anónimo; significa que que la identidad del usuario no será guardada. ',
@@ -127,12 +131,13 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'reponses_anonyme' => 'Anónimo',
        'reponses_auteur' => 'Usuario',
        'reponses_exporter' => 'Exportar las respuestas',
+       'reponses_exporter_statut_tout' => 'Todas',
        'reponses_ip' => 'Dirección IP',
        'reponses_liste' => 'Lista de respuestas',
        'reponses_liste_prop' => 'Respuestas pendientes de validación',
        'reponses_liste_publie' => 'Todas las respuestas validadas',
        'reponses_nb' => '@nb@ respuestas',
-       'reponses_supprimer' => 'Borrar todas las respuestas a este formulario',
+       'reponses_supprimer' => 'Borrar todas las respuestas a este formulario', # MODIF
        'reponses_supprimer_confirmation' => '¿Confirma la supresión de todas las respuestas a este formulario?',
        'reponses_voir_detail' => 'Ver la respuesta',
        'retour_aucun_traitement' => 'Su respuesta ha sido enviada, pero ningún tratamiento ha sido definido para este formulario. ¡No se hizo nada con sus datos!',
@@ -207,5 +212,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'Ver las respuesta',
        'voir_traitements' => 'Tratamientos'
 );
-
-?>
index eaeed40..1efb263 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/formidable/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -20,6 +22,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'analyse_une_reponse_total' => 'Une personne a répondu à ce formulaire.',
        'analyse_zero_reponse_total' => 'Aucune personne n’a répondu à ce formulaire.',
        'aucun_traitement' => 'Aucun traitement',
+       'autoriser_admin_restreint' => 'Autoriser les administrateurs restreints à créer et modifier les formulaires',
+       'autoriser_admin_restreint_explication' => 'Par défaut, seuls les administrateurs ont accès à la création et modification des formulaires',
 
        // B
        'bouton_formulaires' => 'Formulaires',
@@ -30,6 +34,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
                sur le conteneur de chaque graphique, tel que <code>gray</code>,<code>blue</code>,
                <code>orange</code>, <code>green</code> ou tout ce qui vous plairait !',
        'cfg_analyse_classe_label' => 'Classe CSS de la barre de progression',
+       'cfg_objets_explication' => 'Choisir les contenus auxquels pourront être liés les formulaires.',
+       'cfg_objets_label' => 'Lier les formulaires aux contenus',
        'cfg_titre_page_configurer_formidable' => 'Configurer Formidable',
        'cfg_titre_parametrages_analyse' => 'Paramétrages de l’analyse des réponses',
        'champs' => 'Champs',
@@ -46,6 +52,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'editer_apres_choix_valeurs' => 'Les valeurs saisies',
        'editer_apres_explication' => 'Après validation, afficher à la place du formulaire :',
        'editer_apres_label' => 'Afficher ensuite',
+       'editer_css' => 'Classes CSS',
        'editer_descriptif' => 'Descriptif',
        'editer_descriptif_explication' => 'Une explication du formulaire destinée à l’espace privé.',
        'editer_identifiant' => 'Identifiant',
@@ -54,6 +61,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'editer_menu_champs' => 'Configurer les champs',
        'editer_menu_formulaire' => 'Configurer le formulaire',
        'editer_menu_traitements' => 'Configurer les traitements',
+       'editer_message_erreur_unicite_explication' => 'Si vous laissez ce champ vide, le message d’erreur par défaut de formidable s’affichera',
+       'editer_message_erreur_unicite_label' => 'Message d’erreur quand un champ n’est pas unique',
        'editer_message_ok' => 'Message de retour',
        'editer_message_ok_explication' => 'Vous pouvez personnaliser le message qui sera affiché à l’utilisateur après l’envoi d’un formulaire valide.',
        'editer_modifier_formulaire' => 'Modifier le formulaire',
@@ -63,6 +72,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'editer_resume_reponse' => 'Affichage résumé de la réponse',
        'editer_resume_reponse_explication' => 'Cette chaîne sera utilisée pour afficher un résumé de chaque réponse dans les listes. Les champs comme <tt>@input_1@</tt> seront remplacés comme indiqué par l’aide mémoire ci-contre.',
        'editer_titre' => 'Titre',
+       'editer_unicite_explication' => 'Enregistrer le formulaire seulement si un champ est unique',
+       'editer_unicite_label' => 'Vérifier l’unicité d’un champ',
        'erreur_autorisation' => 'Vous n’avez pas le droit d’éditer les formulaires du site.',
        'erreur_base' => 'Une erreur technique est survenue durant l’enregistrement.',
        'erreur_generique' => 'Il y a des erreurs dans les champs ci-dessous, veuillez vérifier votre envoi.',
@@ -72,6 +83,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_importer_wcs' => 'Erreur durant l’importation du formulaire W.C.S',
        'erreur_importer_yaml' => 'Erreur durant l’importation du fichier YAML',
        'erreur_inexistant' => 'Le formulaire n’existe pas.',
+       'erreur_unicite' => 'Cette valeur est déjà utilisée',
+       'exporter_formulaire_format_label' => 'Format du fichier',
+       'exporter_formulaire_statut_label' => 'Réponses',
 
        // F
        'formulaire_anonyme_explication' => 'Ce formulaire est anonyme, c’est à dire que l’identité de l’utilisateur n’est pas enregistrée.',
@@ -109,6 +123,13 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'info_utilise_1_formulaire' => 'Formulaire utilisé :',
        'info_utilise_nb_formulaires' => 'Formulaires utilisés :',
 
+       // L
+       'liens_ajouter' => 'Ajouter un formulaire',
+       'liens_ajouter_lien' => 'Ajouter ce formulaire',
+       'liens_creer_associer' => 'Créer et associer un formulaire',
+       'liens_retirer_lien_formulaire' => 'Retirer ce formulaire',
+       'liens_retirer_tous_liens_formulaires' => 'Retirer tous les formulaires',
+
        // M
        'modele_label_formulaire_formidable' => 'Quel formulaire ?',
        'modele_nom_formulaire' => 'un formulaire',
@@ -130,12 +151,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'reponses_anonyme' => 'Anonyme',
        'reponses_auteur' => 'Utilisateur',
        'reponses_exporter' => 'Exporter les réponses',
+       'reponses_exporter_format_csv' => 'Tableur .CSV',
+       'reponses_exporter_format_xls' => 'Excel .XLS',
+       'reponses_exporter_statut_publie' => 'Publiées',
+       'reponses_exporter_statut_tout' => 'Toutes',
+       'reponses_exporter_telecharger' => 'Télécharger',
        'reponses_ip' => 'Adresse IP',
        'reponses_liste' => 'Liste des réponses',
        'reponses_liste_prop' => 'Réponses en attente de validation',
        'reponses_liste_publie' => 'Toutes les réponses validées',
        'reponses_nb' => '@nb@ réponses',
-       'reponses_supprimer' => 'Supprimer toutes les réponses à ce formulaire',
+       'reponses_supprimer' => 'Supprimer toutes les réponses',
        'reponses_supprimer_confirmation' => 'Êtes-vous sûr de vouloir supprimer toutes les réponses à ce formulaire ?',
        'reponses_voir_detail' => 'Voir la réponse',
        'retour_aucun_traitement' => 'Votre réponse a bien été envoyée, mais aucun traitement n’a été défini pour ce formulaire. Il ne fait donc rien. :)',
@@ -162,6 +188,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_email_message_ok' => 'Votre message a bien été envoyé par courriel.',
        'traiter_email_option_activer_accuse_label' => 'Accusé de réception',
        'traiter_email_option_activer_accuse_label_case' => 'Envoyer aussi un courriel à l’adresse de l’envoyeur avec un message de confirmation.',
+       'traiter_email_option_courriel_envoyeur_accuse_explication' => 'Précisez le courriel utilisé pour envoyer l’accusé de réception. À défaut, le destinataire sera l’expéditeur.',
+       'traiter_email_option_courriel_envoyeur_accuse_label' => 'Courriel de l’accusé de réception',
        'traiter_email_option_destinataires_champ_form_explication' => 'Si un de vos champ est une adresse email et que vous souhaitez envoyer le formulaire à cette adresse, sélectionnez le champ.',
        'traiter_email_option_destinataires_champ_form_label' => 'Destinaire présent dans un des champ des formulaires',
        'traiter_email_option_destinataires_explication' => 'Choisissez le champ qui correspondra aux destinataires du message.',
@@ -172,6 +200,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'traiter_email_option_envoyeur_courriel_label' => 'Courriel de l’envoyeur',
        'traiter_email_option_envoyeur_nom_explication' => 'Construisez ce nom à l’aide des @raccourcis@ (cf. l’aide mémoire). Si vous ne mettez rien, ce sera le nom du site.',
        'traiter_email_option_envoyeur_nom_label' => 'Nom de l’envoyeur',
+       'traiter_email_option_nom_envoyeur_accuse_explication' => 'Précisez le nom de l’expéditeur utilisé pour envoyer l’accusé de réception. À défaut, le destinataire sera l’expéditeur.',
+       'traiter_email_option_nom_envoyeur_accuse_label' => 'Nom de l’expéditeur de l’accusé de réception',
        'traiter_email_option_sujet_accuse_label' => 'Sujet de l’accusé de réception',
        'traiter_email_option_sujet_explication' => 'Construisez le sujet à l’aide des @raccourcis@. Si vous ne mettez rien, le sujet sera construit automatiquement.',
        'traiter_email_option_sujet_label' => 'Sujet du message',
@@ -210,5 +240,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'Voir les réponses',
        'voir_traitements' => 'Traitements'
 );
-
-?>
index c20ae86..7196850 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -51,6 +53,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_importer_wcs' => 'Errore durante l’importazione del modulo W.C.S',
        'erreur_importer_yaml' => 'Errore durante l’importazione del modulo YAML',
        'erreur_inexistant' => 'Il modulo non esiste.',
+       'exporter_formulaire_format_label' => 'Formato del file',
 
        // F
        'formulaires_aucun' => 'Al momento non è presente alcun modulo.',
@@ -148,5 +151,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'Vedi le risposte',
        'voir_traitements' => 'Trattamenti'
 );
-
-?>
diff --git a/www/plugins/formidable/lang/formidable_pt_br.php b/www/plugins/formidable/lang/formidable_pt_br.php
new file mode 100644 (file)
index 0000000..0639c75
--- /dev/null
@@ -0,0 +1,233 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'activer_pages_explication' => 'Por default, as páginas publicadas dos formulários não são autorizadas',
+       'activer_pages_label' => 'Autorizar a criação de páginas publicadas por formulários',
+       'admin_reponses_auteur' => 'Autorizar os autores dos formulários a modificar as respostas',
+       'admin_reponses_auteur_explication' => 'Somente os administradores podem modificar as respostas enviadas por um formulário (Na lixeira, publicado, proposto). Essa opção permite a um autor de formulário de modificar o status (com risco de criar eventuais erros estatísticos).',
+       'analyse_avec_reponse' => 'Respostas não vazias',
+       'analyse_exclure_champs_explication' => 'Liste os nomes de campos a serem excluídos da análise, separados por <code>|</code>. Não inserir <code>@</code>.',
+       'analyse_exclure_champs_label' => 'Campos a excluir',
+       'analyse_exporter' => 'Exportar análise',
+       'analyse_longueur_moyenne' => 'Comprimento médio em número de palavras',
+       'analyse_nb_reponses_total' => '@nb@ pessoas preencheram esse formulário.',
+       'analyse_sans_reponse' => 'Deixado em branco',
+       'analyse_une_reponse_total' => 'Uma pessoa preencheu esse formulário.',
+       'analyse_zero_reponse_total' => 'Ninguém ainda preencheu esse formulário.',
+       'aucun_traitement' => 'Nenhuma interação',
+       'autoriser_admin_restreint' => 'Autorizar administradores restritos a criar e modificar os formulários',
+       'autoriser_admin_restreint_explication' => 'Por default, somente administradores têm acesso à criação e modificação dos formulários',
+
+       // B
+       'bouton_formulaires' => 'Formulários',
+       'bouton_revert_formulaire' => 'Reverter à última versão gravada',
+
+       // C
+       'cfg_analyse_classe_explication' => 'Indique as classes CSS que serão adicionadas ao conteúdo de cada gráfico, como <code>gray</code>,<code>blue</code>,<code>orange</code>,<code>green</code> ou como preferir!',
+       'cfg_analyse_classe_label' => 'Classe CSS da barra de progresso',
+       'cfg_titre_page_configurer_formidable' => 'Configurar Formidable',
+       'cfg_titre_parametrages_analyse' => 'Parâmetros de análise dos preenchimentos',
+       'champs' => 'Campos',
+       'changer_statut' => 'Este formulário está:',
+
+       // E
+       'echanger_formulaire_forms_importer' => 'Forms & Tables (.xml)',
+       'echanger_formulaire_wcs_importer' => 'W.C.S. (.wcs)',
+       'echanger_formulaire_yaml_importer' => 'Formidable (.yaml)',
+       'editer_apres_choix_formulaire' => 'Retornar ao formulário',
+       'editer_apres_choix_redirige' => 'Redirecionar a outro endereço',
+       'editer_apres_choix_rien' => '
+Nada',
+       'editer_apres_choix_stats' => 'Estatísticas de preenchimentos',
+       'editer_apres_choix_valeurs' => 'Valores preenchidos',
+       'editer_apres_explication' => 'Após validação, exibir no lugar do formulário:',
+       'editer_apres_label' => 'Exibir em seguida',
+       'editer_descriptif' => 'Descrição',
+       'editer_descriptif_explication' => 'Explicação do formulário destinada ao espaço privado.',
+       'editer_identifiant' => 'Identificador',
+       'editer_identifiant_explication' => 'Insira um identificador único que com o qual se acessará o formulário.',
+       'editer_menu_auteurs' => 'Configurar autores',
+       'editer_menu_champs' => 'Configurar campos',
+       'editer_menu_formulaire' => 'Configurar o formulário',
+       'editer_menu_traitements' => 'Configurar interações',
+       'editer_message_erreur_unicite_explication' => 'Se você deixar o campo em branco, a mensagem de erro padrão do Formidable será exibida',
+       'editer_message_erreur_unicite_label' => 'Mensagem de erro quando um campo não é único',
+       'editer_message_ok' => 'Mensagem de retorno',
+       'editer_message_ok_explication' => 'Personalize a mensagem que será exibida ao usuário após o envio de um formulário válido.',
+       'editer_modifier_formulaire' => 'Modificar formulário',
+       'editer_nouveau' => 'Novo formulário',
+       'editer_redirige_url' => 'Endereço de redirecionamento após validação',
+       'editer_redirige_url_explication' => 'Deixar em branco se quiser que fique na mesma página',
+       'editer_resume_reponse' => 'Exibe resumo do preenchimento',
+       'editer_resume_reponse_explication' => 'Esta cadeia será utilizada para exibir um resumo de cada resposta nas listas. Campos como <tt>@input_1@</tt> serão substituídos conforme indicado no lembrete  ao lado.',
+       'editer_titre' => 'Título',
+       'editer_unicite_explication' => 'Gravar o formulário apenas se um campo for único',
+       'editer_unicite_label' => 'Verificar a unicidade do campo',
+       'erreur_autorisation' => 'Você não tem permissão para editar os formulários do site.',
+       'erreur_base' => 'Aconteceu um erro técnico durante a gravação.',
+       'erreur_generique' => 'Há erro(s) no preenchimento do(s) campo(s) indicado(s) abaixo.',
+       'erreur_identifiant' => 'Esse identificador já está em uso.',
+       'erreur_identifiant_format' => 'O identificador só pode conter números, letras e o caracter "_"',
+       'erreur_importer_forms' => 'Erro na importação do formulário Forms&Tables',
+       'erreur_importer_wcs' => 'Erro na importação do formulário W.C.S',
+       'erreur_importer_yaml' => 'Erro na importação do arquivo YAML',
+       'erreur_inexistant' => 'Formulário inexistente.',
+       'erreur_unicite' => 'Este valor já está sendo usado',
+       'exporter_formulaire_format_label' => 'Formato do arquivo',
+       'exporter_formulaire_statut_label' => 'Preenchimentos',
+
+       // F
+       'formulaire_anonyme_explication' => 'Este formulário é anônimo, ou seja, a identificação de usuário não será gravada.',
+       'formulaires_aucun' => 'No momento não há nenhum formulário.',
+       'formulaires_aucun_champ' => 'No momento não há nenhum campo de entrada para esse formulário.',
+       'formulaires_dupliquer' => 'Duplicar formulário',
+       'formulaires_dupliquer_copie' => '(cópia)',
+       'formulaires_introduction' => 'Crie e configure aqui os formulários do site.',
+       'formulaires_nouveau' => 'Criar um novo formulário',
+       'formulaires_supprimer' => 'Apagar formulário',
+       'formulaires_supprimer_confirmation' => 'Atenção, isto apagará também todos os preenchimentos. Tem certeza de que quer apagar este formulário?',
+       'formulaires_tous' => 'Todos os formulários',
+
+       // I
+       'identification_par_cookie' => 'Por cookie',
+       'identification_par_id_auteur' => 'Por identificação (id_auteur) de usuário autenticado',
+       'importer_formulaire' => 'Importar um formulário',
+       'importer_formulaire_fichier_label' => 'Arquivo a importar',
+       'importer_formulaire_format_label' => 'Formato do arquivo',
+       'info_1_formulaire' => '1 formulário',
+       'info_1_reponse' => '1 preenchimento',
+       'info_aucun_formulaire' => 'Nenhum formulário',
+       'info_aucune_reponse' => 'Nenhum preenchimento',
+       'info_formulaire_refuse' => 'Arquivado',
+       'info_formulaire_utilise_par' => 'Formulário utilizado por:',
+       'info_nb_formulaires' => '@nb@ formulários',
+       'info_nb_reponses' => '@nb@ preenchimentos',
+       'info_reponse_proposee' => 'A moderar',
+       'info_reponse_proposees' => 'A moderar',
+       'info_reponse_publiee' => 'Validado',
+       'info_reponse_publiees' => 'Validados',
+       'info_reponse_supprimee' => 'Apagado',
+       'info_reponse_supprimees' => 'Apagados',
+       'info_reponse_toutes' => 'Todos',
+       'info_utilise_1_formulaire' => 'Formulário utilizado:',
+       'info_utilise_nb_formulaires' => 'Formulários utilizados:',
+
+       // M
+       'modele_label_formulaire_formidable' => 'Qual formulário?',
+       'modele_nom_formulaire' => 'um formulário',
+
+       // N
+       'noisette_label_afficher_titre_formulaire' => 'Exibir título do formulário?',
+       'noisette_label_identifiant' => 'Formulário a exibir:',
+       'noisette_nom_noisette_formulaire' => 'Formulário',
+
+       // R
+       'reponse_aucune' => 'Nenhum preenchimento',
+       'reponse_intro' => '@auteur@ preencheu o formulário @formulaire@',
+       'reponse_numero' => 'Preenchimento número:',
+       'reponse_statut' => 'Este preenchimento está:',
+       'reponse_supprimer' => 'Apagar este preenchimento',
+       'reponse_supprimer_confirmation' => 'Tem certeza de que quer apagar este preenchimento?',
+       'reponse_une' => '1 preenchimento',
+       'reponses_analyse' => 'Análise dos preenchimentos',
+       'reponses_anonyme' => 'Anônimo',
+       'reponses_auteur' => 'Usuário',
+       'reponses_exporter' => 'Exportar preenchimentos',
+       'reponses_exporter_format_csv' => 'Tableur .CSV',
+       'reponses_exporter_format_xls' => 'Excel .XLS',
+       'reponses_exporter_statut_publie' => 'Publicados',
+       'reponses_exporter_statut_tout' => 'Todos',
+       'reponses_exporter_telecharger' => 'Download',
+       'reponses_ip' => 'Endereço IP',
+       'reponses_liste' => 'Lista de preenchimentos',
+       'reponses_liste_prop' => 'Preenchimentos aguardando validação',
+       'reponses_liste_publie' => 'Todos os preenchimentos validados',
+       'reponses_nb' => '@nb@ preenchimentos',
+       'reponses_supprimer' => 'Excluir todas as respostas',
+       'reponses_supprimer_confirmation' => 'Tem certeza de que quer apagar todos os preenchimentos deste formulário?',
+       'reponses_voir_detail' => 'Ver preenchimento',
+       'retour_aucun_traitement' => 'Seu preenchimento foi enviado com sucesso, mas não há interação prevista para esse formulário.',
+
+       // S
+       'sans_reponses' => 'Não preenchido',
+
+       // T
+       'texte_statut_poubelle' => 'apagado',
+       'texte_statut_propose_evaluation' => 'proposto',
+       'texte_statut_publie' => 'validado',
+       'texte_statut_refuse' => 'arquivado',
+       'titre_cadre_raccourcis' => 'Atalhos',
+       'titre_formulaires_archives' => 'Arquivos',
+       'titre_reponses' => 'Preenchimentos',
+       'traitements_actives' => 'Interações ativadas',
+       'traitements_aide_memoire' => 'Colinha:',
+       'traitements_avertissement_creation' => 'As modificações nos campos do formulário foram gravadas com sucesso. Defina agora quais interações serão efetuadas na utilização do formulário.',
+       'traitements_avertissement_modification' => 'As modificações nos campos do formulário foram gravadas com sucesso. <strong>Talvez seja necessário reconfigurar algumas interações.</strong>',
+       'traitements_champ_aucun' => 'Nenhum',
+       'traiter_email_description' => 'Postar o resultado do formulário por correio eletrônico a uma lista de destinatários.',
+       'traiter_email_horodatage' => 'Formulário "@formulaire@" postado em @date@ às @heure@.',
+       'traiter_email_message_erreur' => 'Aconteceu um erro no envio do correio eletrônico.',
+       'traiter_email_message_ok' => 'Sua mensagem foi enviada por correio eletrônico.',
+       'traiter_email_option_activer_accuse_label' => 'Acusar recebimento',
+       'traiter_email_option_activer_accuse_label_case' => 'Enviar também um correio eletrônico para o remetente com uma mensagem de confirmação.',
+       'traiter_email_option_courriel_envoyeur_accuse_explication' => 'Indique o correio eletrônico utilizado para enviar a acusação de recebimento. Por default, o destinatário será o remetente.',
+       'traiter_email_option_courriel_envoyeur_accuse_label' => 'Correio eletrônico de acusação de recebimento',
+       'traiter_email_option_destinataires_champ_form_explication' => 'Se um dos campos é um endereço de email, selecione-o se quiser enviar-lhe o formulário.',
+       'traiter_email_option_destinataires_champ_form_label' => 'Destinatário presente em um dos campos dos formulários',
+       'traiter_email_option_destinataires_explication' => 'Escolha o campo que corresponde aos destinatários da mensagem.',
+       'traiter_email_option_destinataires_label' => 'Destinatários',
+       'traiter_email_option_destinataires_plus_explication' => 'Uma lista de endereços eletrônicos separados por vírgulas.',
+       'traiter_email_option_destinataires_plus_label' => 'Destinatários suplementares',
+       'traiter_email_option_envoyeur_courriel_explication' => 'Escolha o campo que contém o correio eletrônico do remetente.',
+       'traiter_email_option_envoyeur_courriel_label' => 'Correio eletrônico do remetente',
+       'traiter_email_option_envoyeur_nom_explication' => 'Construa o nome com ajuda dos @raccourcis@ (cf. colinha). Deixando em branco, será o nome do site.',
+       'traiter_email_option_envoyeur_nom_label' => 'Nome do remetente',
+       'traiter_email_option_nom_envoyeur_accuse_explication' => 'Indique o nome do remetente utilizado para enviar a acusação de recebimento. Por default, o destinatário será o remetente.',
+       'traiter_email_option_nom_envoyeur_accuse_label' => 'Nome do remetente da acusação de recebimento',
+       'traiter_email_option_sujet_accuse_label' => 'Assunto da acusação de recebimento',
+       'traiter_email_option_sujet_explication' => 'Construa o assunto com ajuda dos @raccourcis@. Deixando em branco, o assunto será automatizado.',
+       'traiter_email_option_sujet_label' => 'Assunto da mensagem',
+       'traiter_email_option_vrai_envoyeur_explication' => 'Alguns servidores SMTP não permitem a utilização de correio eletrônico arbitrário para o campo "From". Por isso, Formidable insere por default o correio eletrônico do remetente no campo "Reply-To". Verifique aqui para inserir o correio eletrônico no campo "From".',
+       'traiter_email_option_vrai_envoyeur_label' => 'Inserir o correio eletrônico do remetente no campo "From"',
+       'traiter_email_page' => '<a href="@url@">nesta página</a>.',
+       'traiter_email_sujet' => '@nom@  enviou mensagem',
+       'traiter_email_sujet_accuse' => 'Obrigado por preencher.',
+       'traiter_email_titre' => 'Enviar por correio eletrônico',
+       'traiter_email_url_enregistrement' => 'Gerenciamento de preenchimentos <a href="@url@">aqui</a>.',
+       'traiter_enregistrement_description' => 'Gravar preenchimentos dos formulários na base de dados',
+       'traiter_enregistrement_erreur_base' => 'Aconteceu um erro técnico durante a gravação na base de dados',
+       'traiter_enregistrement_erreur_deja_repondu' => 'Você já preencheu este formulário.',
+       'traiter_enregistrement_erreur_edition_reponse_inexistante' => 'O preenchimento a editar não foi encontrado.',
+       'traiter_enregistrement_message_ok' => 'Sucesso. Seu preenchimento foi registrado',
+       'traiter_enregistrement_option_anonymiser_explication' => 'Preenchimentos anônimos (não guardar identificação das pessoas que responderam).',
+       'traiter_enregistrement_option_anonymiser_label' => 'Formulário anônimo',
+       'traiter_enregistrement_option_anonymiser_variable_explication' => 'Variável utilizada para calcular um valor único para cada autor sem revelar sua identidade.',
+       'traiter_enregistrement_option_anonymiser_variable_label' => 'Variável a partir da qual anonimar o formulário',
+       'traiter_enregistrement_option_auteur' => 'Utilizar autores para os formulários',
+       'traiter_enregistrement_option_auteur_explication' => 'Atribuir um ou vários autores a um formulário. Se esta opção estiver ativa, somente os autores do formulário podem acessar esses dados.',
+       'traiter_enregistrement_option_choix_select_label' => 'Escolher uma variável entre as opções',
+       'traiter_enregistrement_option_identification_explication' => 'Se os preenchimentos são modificáveis, qual o procedimento preferencialmente utilizado para saber qual preenchimento modificar?',
+       'traiter_enregistrement_option_identification_label' => 'Identificação',
+       'traiter_enregistrement_option_ip_label' => 'Gravar IPs (masquées après un délai de garde)',
+       'traiter_enregistrement_option_moderation_label' => 'Moderação',
+       'traiter_enregistrement_option_modifiable_explication' => 'Modificável: visitantes podem modificar seus preenchimentos realizados.',
+       'traiter_enregistrement_option_modifiable_label' => 'Preenchimentos modificáveis',
+       'traiter_enregistrement_option_multiple_explication' => 'Múltiplos: Uma mesma pessoa pode preencher várias vezes.',
+       'traiter_enregistrement_option_multiple_label' => 'Preenchimentos múltiplos',
+       'traiter_enregistrement_titre' => 'Gravar resultados',
+
+       // V
+       'voir_exporter' => 'Exportar formulário',
+       'voir_numero' => 'Formulário número:',
+       'voir_reponses' => 'Ver preenchimentos',
+       'voir_traitements' => 'Interações'
+);
diff --git a/www/plugins/formidable/lang/formidable_ru.php b/www/plugins/formidable/lang/formidable_ru.php
new file mode 100644 (file)
index 0000000..099113e
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'analyse_avec_reponse' => 'Ответили',
+       'analyse_exclure_champs_explication' => 'Укажите названия полей, которіе необходимо выводить в статистике ответов. Используйте разделитель <code>|</code>. Не надо использовать символ <code>@</code>.',
+       'analyse_exclure_champs_label' => 'Исключить поля',
+       'analyse_exporter' => 'Экспортировать',
+       'analyse_longueur_moyenne' => 'Средняя длина в словах',
+       'analyse_nb_reponses_total' => '@nb@ человек(а) заполнило форму.',
+       'analyse_sans_reponse' => 'Не ответили',
+       'analyse_une_reponse_total' => 'Человек заполнил форму.',
+       'analyse_zero_reponse_total' => 'Никто еще не заполнял форму.',
+       'aucun_traitement' => 'Нет обраточиков',
+
+       // B
+       'bouton_formulaires' => 'Формы',
+       'bouton_revert_formulaire' => 'Вернуться к последней сохраненной версии',
+
+       // C
+       'cfg_titre_page_configurer_formidable' => 'Настройки Formidable',
+       'cfg_titre_parametrages_analyse' => 'Настройки просмотра ответов',
+       'champs' => 'Поля',
+       'changer_statut' => 'Статус формы:',
+
+       // E
+       'echanger_formulaire_forms_importer' => 'Forms & Tables (.xml)',
+       'echanger_formulaire_wcs_importer' => 'W.C.S. (.wcs)',
+       'echanger_formulaire_yaml_importer' => 'Formidable (.yaml)',
+       'editer_apres_choix_formulaire' => 'Очистить значения и вывести форму заново',
+       'editer_apres_choix_redirige' => 'Перенаправить на  другую страницу',
+       'editer_apres_choix_rien' => 'Ничего не делать',
+       'editer_apres_choix_stats' => 'Показать статистику ответов',
+       'editer_apres_choix_valeurs' => 'Показать введенные значения',
+       'editer_apres_explication' => 'После обработки, показывать на месте формы:',
+       'editer_apres_label' => 'Действие после обработки:',
+       'editer_descriptif' => 'Описание',
+       'editer_descriptif_explication' => 'Описание формы а административной части.',
+       'editer_identifiant' => 'ID',
+       'editer_identifiant_explication' => 'Укажите текстовый ID, который позволяет быстро вызывать форму.',
+       'editer_menu_auteurs' => 'Настроить авторов',
+       'editer_menu_champs' => 'Настройка полей',
+       'editer_menu_formulaire' => 'Настройка формы',
+       'editer_menu_traitements' => 'Настройка обработчиков',
+       'editer_message_erreur_unicite_explication' => 'Если оставить поле пустым, будет использовано сообщение об ошибке по умолчанию.',
+       'editer_message_erreur_unicite_label' => 'Сообщение об ошибке, если значение поля неуникально',
+       'editer_message_ok' => 'Сообщение после заполнения формы:',
+       'editer_message_ok_explication' => 'Вы можете настроить сообщение которое будет выводиться пользователю после отправки данной формы.',
+       'editer_modifier_formulaire' => 'Изменить форму',
+       'editer_nouveau' => 'Новая форма',
+       'editer_redirige_url' => 'Адрес переадресации после обработки формы',
+       'editer_redirige_url_explication' => 'Оставьте пустым, если хотите остаться на той же странице',
+       'editer_resume_reponse' => 'Показать сводную информацию по ответам',
+       'editer_titre' => 'Название',
+       'editer_unicite_explication' => 'Сохранять ответ только если значение поля уникально ( не встречалось в других ответах).',
+       'editer_unicite_label' => 'Проверять уникальность значения для поля',
+       'erreur_autorisation' => 'У Вас нет прав на редактирование форм сайта.',
+       'erreur_base' => 'Произошла техническая ошибка при сохранении.',
+       'erreur_generique' => 'Вы не заполнили все обязательные поля. (*) - обязательные поля!',
+       'erreur_identifiant' => 'Этот ID уже используется.',
+       'erreur_importer_forms' => 'Ошибка при импорте формы Forms&Tables',
+       'erreur_importer_wcs' => 'Ошибка при импорте формы W.C.S',
+       'erreur_importer_yaml' => 'Ошибка при импорте формы YAML',
+       'erreur_inexistant' => 'Такая форма не существует.',
+       'erreur_unicite' => 'Это значение уже используется',
+       'exporter_formulaire_format_label' => 'Формат файла',
+       'exporter_formulaire_statut_label' => 'Ответы',
+
+       // F
+       'formulaires_aucun' => 'Пока нет ни одной формы.',
+       'formulaires_aucun_champ' => 'У формы нет полей для ввода информации.',
+       'formulaires_dupliquer' => 'Дублировать форму',
+       'formulaires_dupliquer_copie' => '(копия)',
+       'formulaires_introduction' => 'Создание и настройка форм сайта.',
+       'formulaires_nouveau' => 'Создать новую форму',
+       'formulaires_supprimer' => 'Удалить форму',
+       'formulaires_supprimer_confirmation' => 'Внимание, это приведет к удалению всех результатов. Вы уверены, что хотите удалить эту форму ?',
+       'formulaires_tous' => 'Все формы',
+
+       // I
+       'identification_par_cookie' => 'Через cookie',
+       'identification_par_id_auteur' => 'Через идентификатор (id_auteur) авторизированного пользователя',
+       'importer_formulaire' => 'Импортировать форму',
+       'importer_formulaire_fichier_label' => 'Файл для импорта',
+       'importer_formulaire_format_label' => 'Формат файла',
+       'info_1_formulaire' => '1 форма',
+       'info_1_reponse' => '1 ответ',
+       'info_aucun_formulaire' => 'Форм нет',
+       'info_aucune_reponse' => 'Нет ответов',
+       'info_formulaire_refuse' => 'Архив',
+       'info_formulaire_utilise_par' => 'Форма используется:',
+       'info_nb_formulaires' => '@nb@ форм(ы)',
+       'info_nb_reponses' => '@nb@ ответов',
+       'info_reponse_proposee' => 'На проверке',
+       'info_reponse_proposees' => 'На проверке',
+       'info_reponse_publiee' => 'Опубликованные',
+       'info_reponse_publiees' => 'Опубликованные',
+       'info_reponse_supprimee' => 'Удаленные',
+       'info_reponse_supprimees' => 'Удаленные',
+       'info_reponse_toutes' => 'Все',
+       'info_utilise_1_formulaire' => 'Форма использует:',
+       'info_utilise_nb_formulaires' => 'Формы используют:',
+
+       // M
+       'modele_label_formulaire_formidable' => 'Какая форма ?',
+       'modele_nom_formulaire' => 'форма',
+
+       // N
+       'noisette_label_afficher_titre_formulaire' => 'Показывать название формы?',
+       'noisette_label_identifiant' => 'Форма для отображения:', # RELIRE
+       'noisette_nom_noisette_formulaire' => 'Форма',
+
+       // R
+       'reponse_aucune' => 'Нет ответов',
+       'reponse_intro' => '@auteur@ ответил на форму @formulaire@',
+       'reponse_numero' => 'Ответ номер:',
+       'reponse_statut' => 'Статус ответа:',
+       'reponse_supprimer' => 'Удалить ответ',
+       'reponse_supprimer_confirmation' => 'Вы действительно хотите удалить этот ответ ?',
+       'reponse_une' => '1 ответ',
+       'reponses_analyse' => 'Статистика ответов',
+       'reponses_anonyme' => 'Анонимный',
+       'reponses_auteur' => 'Пользователь',
+       'reponses_exporter' => 'Экспортировать',
+       'reponses_exporter_format_csv' => 'Файл .CSV',
+       'reponses_exporter_format_xls' => 'Excel .XLS',
+       'reponses_exporter_statut_publie' => 'Опубликованные',
+       'reponses_exporter_statut_tout' => 'Все',
+       'reponses_exporter_telecharger' => 'Скачать',
+       'reponses_ip' => 'IP адрес',
+       'reponses_liste' => 'Список ответов',
+       'reponses_liste_prop' => 'Ответы ожидающие проверки',
+       'reponses_liste_publie' => 'Все проверенные ответы',
+       'reponses_nb' => '@nb@ ответа(ов)',
+       'reponses_supprimer' => 'Удалить все ответы',
+       'reponses_supprimer_confirmation' => 'Вы уверенны, что хотите удалить ВСЕ ответы этой формы ?',
+       'reponses_voir_detail' => 'Посмотреть ответ',
+       'retour_aucun_traitement' => 'Ваш ответ был отправолен на обработку, но ни один обработчик не был выбран для этой формы. Эта форма попросту ничего не делает :)',
+
+       // S
+       'sans_reponses' => 'Без ответа',
+
+       // T
+       'texte_statut_poubelle' => 'удалить',
+       'texte_statut_propose_evaluation' => 'на проверку',
+       'texte_statut_publie' => 'опубликовать',
+       'texte_statut_refuse' => 'архивировать',
+       'titre_cadre_raccourcis' => 'Ярлыки',
+       'titre_formulaires_archives' => 'Архив',
+       'titre_reponses' => 'Ответы',
+       'traitements_actives' => 'Активные обработчики',
+       'traitements_aide_memoire' => 'Памятка помощи :',
+       'traitements_avertissement_creation' => 'Изменения, внесенные в поля формы были записаны успешно. Теперь вы можете определить, какие обработчики будут выполняться при использовании формы.',
+       'traitements_avertissement_modification' => 'Изменения, внесенные в поля формы были записаны успешно. <strong>Некоторые обработчики, возможно, придется обновить соответственно.</strong>',
+       'traitements_champ_aucun' => 'Нет',
+       'traiter_email_description' => 'Отправлять сообщение по электронной почте списку получателей.',
+       'traiter_email_horodatage' => 'Форма "@formulaire@" отправлена @date@ @heure@.',
+       'traiter_email_message_erreur' => 'Произошла ошибка при отправке электронной почты.',
+       'traiter_email_message_ok' => 'Ваше сообщение было отправлено.',
+       'traiter_email_option_activer_accuse_label' => 'Подтверждение',
+       'traiter_email_option_activer_accuse_label_case' => 'Кроме указанных получателей, отправить отправителю сообщение с подтверждением.',
+       'traiter_email_option_courriel_envoyeur_accuse_label' => 'Уведомление электронной почтой',
+       'traiter_email_option_destinataires_champ_form_label' => 'Емейл получатель указывается в одном из полей формы',
+       'traiter_email_option_destinataires_explication' => 'Выберите поле, которое соответствует получателям сообщения.',
+       'traiter_email_option_destinataires_label' => 'Получатели',
+       'traiter_email_option_destinataires_plus_explication' => 'Список адресов, разделенных запятыми.',
+       'traiter_email_option_destinataires_plus_label' => 'Дополнительные получатели',
+       'traiter_email_option_envoyeur_courriel_explication' => 'Выберите поле, которое будет содержать электронный адрес отправителя.',
+       'traiter_email_option_envoyeur_courriel_label' => 'Адрес отправителя',
+       'traiter_email_option_envoyeur_nom_explication' => 'Можно создать имя отправителя с использованием @ярлыков@ (см. памятку помощи). Если оставить пустым, это будет название сайта.',
+       'traiter_email_option_envoyeur_nom_label' => 'Имя отправителя',
+       'traiter_email_option_sujet_accuse_label' => 'Тема подтверждающего сообщения',
+       'traiter_email_option_sujet_explication' => 'Можно создать тему с использованием @ярлыков@. Если оставить пустым, тема будет создана автоматически.',
+       'traiter_email_option_sujet_label' => 'Тема сообщения',
+       'traiter_email_option_vrai_envoyeur_label' => 'Использовать емейл отправителя для поля "From"',
+       'traiter_email_page' => '<a href="@url@">На этой странице</a>.',
+       'traiter_email_sujet' => '@nom@ вы написали.',
+       'traiter_email_sujet_accuse' => 'Спасибо за ваш ответ.',
+       'traiter_email_titre' => 'Отправлять данные формы электронной почтой',
+       'traiter_email_url_enregistrement' => 'Вы можете управлять ответами <a href="@url@">на этой странице</a>.',
+       'traiter_enregistrement_description' => 'Сохранять заполненные формы в базе данных',
+       'traiter_enregistrement_erreur_base' => 'Техническая ошибка при работе с базой данных.',
+       'traiter_enregistrement_erreur_deja_repondu' => 'Вы уже заполнили эту форму',
+       'traiter_enregistrement_erreur_edition_reponse_inexistante' => 'Ответ для редактирования не найден.', # RELIRE
+       'traiter_enregistrement_message_ok' => 'Спасибо. Ваш ответ был сохранен',
+       'traiter_enregistrement_option_anonymiser_explication' => 'Анонимные ответы (не сохранять идентифицирующую пользователя информацию)',
+       'traiter_enregistrement_option_anonymiser_label' => 'Анонимизировать форму',
+       'traiter_enregistrement_option_anonymiser_variable_label' => 'Переменные, при помощи которых анонимизируется ответ',
+       'traiter_enregistrement_option_auteur' => 'Использовать авторов в форме',
+       'traiter_enregistrement_option_auteur_explication' => 'Назначить одного или нескольких авторов форме. Если эта настройка включена, то только назначенные автора будут иметь к ней доступ',
+       'traiter_enregistrement_option_choix_select_label' => 'Выберите значение из предложенных вариантов',
+       'traiter_enregistrement_option_identification_explication' => 'Если можно изменять ответы, выберите метод аутентификации пользователя',
+       'traiter_enregistrement_option_identification_label' => 'ID',
+       'traiter_enregistrement_option_ip_label' => 'Сохранять IP ',
+       'traiter_enregistrement_option_moderation_label' => 'Модерация',
+       'traiter_enregistrement_option_modifiable_explication' => 'Посетители могут изменять свои ответы после заполнения формы',
+       'traiter_enregistrement_option_modifiable_label' => 'Ответы можно изменить',
+       'traiter_enregistrement_option_multiple_explication' => 'Пользователь может ответить (заполнить) форму несколько раз.',
+       'traiter_enregistrement_option_multiple_label' => 'Несколько ответов',
+       'traiter_enregistrement_titre' => 'Сохранять результаты',
+
+       // V
+       'voir_exporter' => 'Экспорт формы',
+       'voir_numero' => 'Номер формы:',
+       'voir_reponses' => 'Просмотр ответов',
+       'voir_traitements' => 'Обработчики'
+);
index 41bb947..0305389 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/formidable?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -63,6 +65,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_importer_wcs' => 'Chyba počas nahrávania formulára W.C.S',
        'erreur_importer_yaml' => 'Chyba počas nahrávania súboru YAML',
        'erreur_inexistant' => 'Formulár neexistuje.',
+       'exporter_formulaire_format_label' => 'Formát súboru',
 
        // F
        'formulaire_anonyme_explication' => 'Tento formulár je anonymný, tzn., že záznamy o identite používateľov sa neukladajú.',
@@ -171,5 +174,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'voir_reponses' => 'Zobraziť odpovede',
        'voir_traitements' => 'Funkcie'
 );
-
-?>
diff --git a/www/plugins/formidable/lang/formulaire.xml b/www/plugins/formidable/lang/formulaire.xml
new file mode 100644 (file)
index 0000000..33efdf9
--- /dev/null
@@ -0,0 +1,7 @@
+<traduction module="formulaire" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/formidable/trunk/lang/" reference="fr">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/formulaire?lang_cible=fr" total="5" traduits="5" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/formulaire?lang_cible=ru" total="5" traduits="4" relire="0" modifs="0" nouveaux="1" pourcent="80.00">
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+</traduction>
index f6663cd..857b445 100644 (file)
@@ -1,9 +1,12 @@
 <?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_/formidable/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
+
        // I
        'icone_creer_formulaire' => 'Créer un nouveau formulaire',
 
@@ -11,8 +14,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'modifier_formulaire' => 'Modifier ce formulaire',
 
        // T
-       'titre_formulaires' => 'Formulaires',
-       'titre_logo_formulaire' => 'Logo de ce formulaire',
        'titre_formulaire' => 'Formulaire',
-
+       'titre_formulaires' => 'Formulaires',
+       'titre_logo_formulaire' => 'Logo de ce formulaire'
 );
diff --git a/www/plugins/formidable/lang/formulaire_ru.php b/www/plugins/formidable/lang/formulaire_ru.php
new file mode 100644 (file)
index 0000000..f435447
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/formulaire?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // I
+       'icone_creer_formulaire' => 'Создать новую форму',
+
+       // M
+       'modifier_formulaire' => 'Изменить форму',
+
+       // T
+       'titre_formulaire' => 'Форма',
+       'titre_formulaires' => 'Формы'
+);
diff --git a/www/plugins/formidable/lang/formulaires_reponse.xml b/www/plugins/formidable/lang/formulaires_reponse.xml
new file mode 100644 (file)
index 0000000..5be520e
--- /dev/null
@@ -0,0 +1,4 @@
+<traduction module="formulaires_reponse" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/formidable/trunk/lang/" reference="fr">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/formulaires_reponse?lang_cible=fr" total="8" traduits="8" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+</traduction>
index 108f4e2..b381384 100644 (file)
@@ -1,27 +1,29 @@
 <?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_/formidable/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'changer_statut' => 'Cette réponse de formulaire est :',
+
+       // F
+       'formulaires_reponse_numero' => 'Réponse de formulaire n°@nb@',
+
        // I
        'icone_creer_formulaire' => 'Créer une nouvelle réponse de formulaire',
 
        // M
        'modifier_formulaire' => 'Modifier cette réponse de formulaire',
 
-       'changer_statut' => 'Cette réponse de formulaire est :',
-
-       // F
-       'formulaires_reponse_numero' => 'Réponse de formulaire n°@nb@',
-
        // R
-       'reponses_donnees' => 'Réponses données :',
+       'reponses_donnees' => 'Réponses données :',
 
        // T
-       'titre_formulaires_reponses' => 'Réponses de formulaire',
-       'titre_logo_formulaires_reponse' => 'Logo de cette réponse de formulaire',
        'titre_formulaires_reponse' => 'Réponse de formulaire',
-
-
+       'titre_formulaires_reponses' => 'Réponses de formulaire',
+       'titre_logo_formulaires_reponse' => 'Logo de cette réponse de formulaire'
 );
index 800e0bb..0d34dac 100644 (file)
@@ -1,4 +1,7 @@
 <traduction module="paquet-formidable" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/formidable/trunk/lang/" reference="fr">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-formidable?lang_cible=en" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Gilles" lien="http://trad.spip.net/auteur/gilles" />
+       </langue>
        <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-formidable?lang_cible=es" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="severo" lien="http://trad.spip.net/auteur/severo" />
        </langue>
diff --git a/www/plugins/formidable/lang/paquet-formidable_en.php b/www/plugins/formidable/lang/paquet-formidable_en.php
new file mode 100644 (file)
index 0000000..ce22cff
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-formidable?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // F
+       'formidable_description' => 'Create forms within a graphical interface and configure the associated treatments (send email, record responses, etc.).',
+       'formidable_slogan' => 'Forms generator'
+);
index e16d5c4..3226b16 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-formidable?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'formidable_description' => 'Creación de formularios con una interfaz gráfica y configuración de los procesamientos asociados (enviar por correo electrónico, grabar las respuestas, etc.)',
        'formidable_slogan' => 'Generador de formularios'
 );
-
-?>
index 3647950..7c3243f 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/formidable/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'formidable_description' => 'Création de formulaires avec une interface graphique et configuration des traitements associés (envoyer par courriel, enregistrer les réponses, etc).',
        'formidable_slogan' => 'Générateur de formulaires'
 );
-
-?>
index ac7460c..85917df 100644 (file)
@@ -1,12 +1,10 @@
-<BOUCLE_fet(FORMS){id_form}{si #PLUGIN{forms}}>
-#FORMS
-</BOUCLE_fet>
-<BOUCLE_f(FORMULAIRES){identifiant=form#ID}{0,1}>#SET{titre,#TITRE}[(#REM|test_espace_prive|oui)
+<BOUCLE_fet(FORMS?){id_form}{si #PLUGIN{forms}}>#FORMS</BOUCLE_fet>
+<BOUCLE_f(FORMULAIRES){identifiant=form#ENV{id,#ENV{id_form}}}{0,1}>#SET{titre,#TITRE}[(#REM|test_espace_prive|oui)
 #FORMULAIRE_FORMIDABLE{#ID_FORMULAIRE,#ARRAY{_titre,#TITRE}}
 ]</BOUCLE_f>
 <div><?php
 /* une fonction qui produit du php qui ne sera execute qu'au service final de la page */
-echo executer_balise_dynamique('FORMULAIRE_FORMIDABLE',[(#LISTE{form#ID,#ARRAY{_titre,#GET{titre}}}|var_export{true})],array('','','','','[(#ENV{lang}|texte_script)]'));
+echo executer_balise_dynamique('FORMULAIRE_FORMIDABLE',[(#LISTE{form#ENV{id,#ENV{id_form}},#ARRAY{_titre,#GET{titre}}}|var_export{true})],array('','','','','[(#ENV{lang}|texte_script)]'));
 ?></div>
 <//B_f>
 <//B_fet>
\ No newline at end of file
index 02d78a0..d613e79 100644 (file)
@@ -5,7 +5,7 @@
 #SET_MERGE{valeurs,#ARRAY{#NOM,#VALEUR|tenter_unserialize}}
 </BOUCLE_champs>
 
-<BOUCLE_formulaire(FORMULAIRES){id_formulaire}>
+<BOUCLE_formulaire(FORMULAIRES){tout}{id_formulaire}>
 #VOIR_SAISIES{(#SAISIES|unserialize), #GET{valeurs}}
 </BOUCLE_formulaire>
 
index 5b18bb0..30d74d8 100644 (file)
@@ -1,14 +1,13 @@
 <paquet
        prefix="formidable"
        categorie="communication"
-       version="2.7.1"
+       version="2.13.0"
        etat="stable"
-       compatibilite="[3.0.0;3.0.*]"
+       compatibilite="[3.0.0;3.1.*]"
        logo="images/formidable-64.png"
-       schema="0.6.4"
+       schema="0.7.0"
        documentation="http://contrib.spip.net/Formidable-le-generateur-de-formulaires"
 >
-
        <nom>Formidable</nom>
        <!-- Générateur de formulaires -->
 
@@ -18,6 +17,8 @@
        <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
 
        <pipeline nom="formidable_affiche_resume_reponse" action="" />
+       <pipeline nom="formidable_exporter_formulaire_reponses_titres" action="" />
+       <pipeline nom="formidable_exporter_formulaire_reponses_reponse" action="" />
 
        <pipeline nom="autoriser" inclure="formidable_autorisations.php" />
        <pipeline nom="declarer_tables_objets_sql" inclure="base/formidable_tables.php" />
        <pipeline nom="declarer_tables_auxiliaires" inclure="base/formidable_tables.php" />
        <pipeline nom="declarer_tables_interfaces" inclure="base/formidable_tables.php" />
 
+       <pipeline nom="nospam_lister_formulaires" inclure="formidable_pipelines.php" />
        <pipeline nom="affiche_droite" inclure="formidable_pipelines.php" />
+       <pipeline nom="affiche_milieu" inclure="formidable_pipelines.php" />
        <pipeline nom="post_edition" inclure="formidable_pipelines.php" />
        <pipeline nom="optimiser_base_disparus" inclure="formidable_pipelines.php" />
 
        <necessite nom="spip_bonux" compatibilite="[3.0.0;[" />
-       <necessite nom="saisies" compatibilite="[1.40.3;[" />
-       <necessite nom="verifier" compatibilite="[0.1.0;[" />
-       <necessite nom="yaml" compatibilite="[1.5.0;[" />
+       <necessite nom="saisies" compatibilite="[2.3.0;[" />
+       <necessite nom="verifier" compatibilite="[0.1.11;[" />
+       <necessite nom="yaml" compatibilite="[1.5.2;[" />
        <necessite nom="facteur" compatibilite="[3.0.3;[" />
+       <utilise nom="collectionjson" compatibilite="[1.5.0;[" />
 
        <menu nom="formulaires" titre="formidable:bouton_formulaires" parent="menu_edition" icone="images/formulaire-16.png" />
-</paquet>
\ No newline at end of file
+</paquet>
index 19456e9..c37de66 100644 (file)
@@ -23,7 +23,9 @@
                        <td class="statut">[(#STATUT|puce_statut{formulaire,#ID_FORMULAIRE})]</td>
                        <td class="titre"><a href="[(#ID_FORMULAIRE|generer_url_entite{formulaire})]">#TITRE</a></td>
                        <td class="identifiant">#IDENTIFIANT</td>
-                       <td class="reponses">[<a href="#URL_ECRIRE{formulaires_reponses,id_formulaire=#ID_FORMULAIRE}">(#COMPTEUR{formulaires_reponses}|?{#COMPTEUR{formulaires_reponses},''})</a>]</td>
+                       <td class="reponses">[<a href="#URL_ECRIRE{formulaires_reponses,id_formulaire=#ID_FORMULAIRE}">(#COMPTEUR{formulaires_reponses}|?{#COMPTEUR{formulaires_reponses},''})</a>]
+                       <BOUCLE_pub(FORMULAIRES_REPONSES){id_formulaire}{statut=publie}/>[<span class="small"><br />(#TOTAL_BOUCLE|!={#COMPTEUR{formulaires_reponses}}|et{#COMPTEUR{formulaires_reponses}}|?{#TOTAL_BOUCLE})&nbsp;[(#TOTAL_BOUCLE|>{1}|?{<:formidable:info_reponse_publiees:>,<:formidable:info_reponse_publiee:>})]</span>]<//B_pub>
+                       </td>
                        <td class="id_formulaire id">[(#AUTORISER{modifier,formulaire,#ID_FORMULAIRE}|?{
                                                        <a href="[(#URL_ECRIRE{formulaire_edit,id_formulaire=#ID_FORMULAIRE})]">#ID_FORMULAIRE</a>,
                                                        #ID_FORMULAIRE
diff --git a/www/plugins/formidable/prive/objets/liste/formulaires_associer.html b/www/plugins/formidable/prive/objets/liste/formulaires_associer.html
new file mode 100644 (file)
index 0000000..f198a83
--- /dev/null
@@ -0,0 +1,72 @@
+[(#SET{defaut_tri,#ARRAY{
+       multi titre,1,
+       date_naissance,-1, 
+       id_formulaire,1
+}})
+]
+#SET{exclus,#ENV**{exclus,#ENV{objet_source}|lister_objets_lies{#ENV{objet},#ENV{id_objet},#ENV{_objet_lien}}}}
+#SET{debut,#ENV{debutgeoa,#EVAL{_request("debutgeoa");}}}
+<B_liste_formulaires>
+[(#REM) En cas de pagination indirecte @32, il faut refaire le set car la boucle
+a mis a jour la valeur avec la page reelle]
+#SET{debut,#ENV{debutgeoa,#EVAL{_request("debutgeoa");}}}
+#SET{afficher_lettres,#TRI|=={'multi titre'}|oui}
+#ANCRE_PAGINATION
+<div class="liste-objets liste-objets-associer formulaires">
+<table class="spip liste">
+[<caption><span class="caption"><strong>(#ENV*{titre,#GRAND_TOTAL|singulier_ou_pluriel{formidable:info_1_formulaire,formidable:info_nb_formulaires}})</strong>
+<span class="recherche">
+       <label for="recherche-#ENV{id}"><:info_rechercher_02:></label>
+       <input type="text" class="recherche" name="recherche" id="recherche-#ENV{id}" value="#ENV{recherche}" />
+       <input type="submit" class="tout_voir" name="tout_voir" value="<:info_tout_afficher:>" />
+</span>
+</span>
+</caption>]
+       <thead>
+               #SET{p,''}
+               <BOUCLE_lettre(FORMULAIRES){tout}{!id_formulaire IN #GET{exclus}}{where?}{recherche?}{statut?}
+                       {tri #ENV{par,multi titre},#GET{defaut_tri}}{id_formulaire==#GET{afficher_lettres}|?{'.*','A'}}>[
+               (#TITRE**|extraire_multi|initiale|unique|oui)
+               [(#SET{p,#GET{p}|concat{
+               #SELF|parametre_url{debutgeoa,@#ID_FORMULAIRE}|ancre_url{paginationgeoa}|afficher_initiale{#TITRE**|extraire_multi|initiale{},#COMPTEUR_BOUCLE,#GET{debut},#ENV{nb,10}}
+               }})]
+               ]#SAUTER{#ENV{nb,10}|moins{#COMPTEUR_BOUCLE|=={1}|?{2,1}}}</BOUCLE_lettre>[
+               (#SET{p,
+                       #GET{p}|concat{
+                               #REM|afficher_initiale{#REM,#TOTAL_BOUCLE,#GET{debut},#ENV{nb,10}}
+                       }
+               })]</B_lettre>
+               [<tr><td colspan="3"><p class="pagination">(#GET{p})</p></td></tr>]
+       
+               <tr class="first_row">
+                       <th class="statut" scope="col">[(#TRI{statut,<span title="<:lien_trier_statut|attribut_html:>">#</span>,ajax})]</th> 
+                       <th class="titre" scope="col">[(#TRI{multi titre,<:formidable:editer_titre:>,ajax})]</th>
+                       <th class="action" scope="col"></th>
+               </tr>
+       </thead>
+       <tbody>
+       <BOUCLE_liste_formulaires(FORMULAIRES){!id_formulaire IN #GET{exclus}}{where?}{recherche?}{statut?}
+               {tri #ENV{par,multi titre},#GET{defaut_tri}}{pagination #ENV{nb,10} forma}>
+               <tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})][ (#EXPOSE|unique)][ (#TITRE**|extraire_multi|initiale|=={#ENV{i}}|?{on}|unique)]">
+                       <td class="statut">[(#STATUT|puce_statut{formulaire})]</td> 
+                       <td class="titre">[(#LOGO_FORMULAIRE|image_reduire{20,20})]<a href="[(#ID_FORMULAIRE|generer_url_entite{formulaire})]">#TITRE</a></td>
+                       <td class="action">
+                               <button type="submit" class="button link add" name="ajouter_lien\[formulaire-#ID_FORMULAIRE-#OBJET-#ID_OBJET\]" value="+"><:formidable:liens_ajouter_lien:> [(#CHEMIN_IMAGE{ajouter-12.png}|balise_img{'+'})]</button>
+                       </td>
+               </tr>
+       </BOUCLE_liste_formulaires>
+       </tbody>
+</table>
+[<p class="pagination">(#PAGINATION{prive})</p>]
+</div>
+</B_liste_formulaires>[(#ENV{recherche}|oui)
+<div class="liste-objets liste-objets-associer formulaires caption-wrap">
+<span class="caption"><strong>[(#VAL{info_recherche_auteur_zero}|_T{#ARRAY{cherche_auteur,#ENV{recherche}}})]</strong>
+<span class="recherche">
+       <label for="recherche-#ENV{id}"><:info_rechercher_02:></label>
+       <input type="text" class="recherche" name="recherche" id="recherche-#ENV{id}" value="#ENV{recherche}" />
+       <input type="submit" class="tout_voir" name="tout_voir" value="<:info_tout_afficher:>" />
+</span>
+</span>
+</div>
+]<//B_liste_formulaires>
diff --git a/www/plugins/formidable/prive/objets/liste/formulaires_associer_fonctions.php b/www/plugins/formidable/prive/objets/liste/formulaires_associer_fonctions.php
new file mode 100644 (file)
index 0000000..71e8bf9
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Fonctions du squelette associé
+ *
+ * @plugin     GéoCulture : noyau fonctionnel
+ * @copyright  2016
+ * @author     Les Développements Durables
+ * @licence    GNU/GPL
+ * @package    SPIP\Geoculture_core\Fonctions
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+
+// pour initiale et afficher_initiale
+include_spip('prive/objets/liste/auteurs_fonctions');
\ No newline at end of file
diff --git a/www/plugins/formidable/prive/objets/liste/formulaires_lies.html b/www/plugins/formidable/prive/objets/liste/formulaires_lies.html
new file mode 100644 (file)
index 0000000..777d964
--- /dev/null
@@ -0,0 +1,62 @@
+[(#SET{defaut_tri,#ARRAY{
+       multi titre,1,
+       id_formulaire,1
+}})
+]
+#SET{selection,#ENV**{selection,#ENV{objet_source}|lister_objets_lies{#ENV{objet},#ENV{id_objet},#ENV{_objet_lien}}}}
+#SET{debut,#ENV{debutgeol,#EVAL{_request("debutgeol");}}}
+<B_liste_formulaires>
+[(#REM) En cas de pagination indirecte @32, il faut refaire le set car la boucle
+a mis a jour la valeur avec la page reelle]
+#SET{debut,#ENV{debutgeol,#EVAL{_request("debutgeol");}}}
+#SET{afficher_lettres,#TRI|=={'multi titre'}|oui}
+#ANCRE_PAGINATION
+<div class="liste-objets liste-objets-lies formulaires">
+<table class="spip liste">
+[<caption><strong class="caption">(#ENV*{titre,#GRAND_TOTAL|singulier_ou_pluriel{formidable:info_1_formulaire,formidable:info_nb_formulaires}})</strong></caption>]
+       <thead>
+               #SET{p,''}
+               <BOUCLE_lettre(FORMULAIRES){tout}{id_formulaire IN #GET{selection}}{where?}{statut?}
+                       {tri #ENV{par,multi titre},#GET{defaut_tri}}{id_formulaire==#GET{afficher_lettres}|?{'.*','A'}}>[
+               (#TITRE**|extraire_multi|initiale|unique|oui)
+               [(#SET{p,#GET{p}|concat{
+               #SELF|parametre_url{debutgeol,@#ID_FORMULAIRE}|ancre_url{paginationgeol}|afficher_initiale{#TITRE**|extraire_multi|initiale{},#COMPTEUR_BOUCLE,#GET{debut},#ENV{nb,10}}
+               }})]
+               ]#SAUTER{#ENV{nb,10}|moins{#COMPTEUR_BOUCLE|=={1}|?{2,1}}}</BOUCLE_lettre>[
+               (#SET{p,
+                       #GET{p}|concat{
+                               #REM|afficher_initiale{#REM,#TOTAL_BOUCLE,#GET{debut},#ENV{nb,10}}
+                       }
+               })]</B_lettre>
+               [<tr><td colspan="4"><p class="pagination">(#GET{p})</p></td></tr>]
+
+               <tr class="first_row">
+                       <th class="statut" scope="col">[(#TRI{statut,<span title="<:lien_trier_statut|attribut_html:>">#</span>,ajax})]</th> 
+                       <th class="titre" scope="col">[(#TRI{multi titre,<:formidable:editer_titre:>,ajax})]</th>
+                       <th class="action" scope="col"></th>
+               </tr>
+       </thead>
+       <tbody>
+       <BOUCLE_liste_formulaires(FORMULAIRES){id_formulaire IN #GET{selection}}{statut?}
+               {tri #ENV{par,multi titre},#GET{defaut_tri}}{pagination #ENV{nb,10} forml}>
+               <tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})][ (#EXPOSE|unique)][ (#TITRE**|extraire_multi|initiale|=={#ENV{i}}|?{on}|unique)][(#ID_FORMULAIRE|=={#ENV{id_lien_ajoute}}|oui)append]">
+                       <td class="statut">[(#STATUT|puce_statut{formulaire})]</td> 
+                       <td class="titre">[(#LOGO_FORMULAIRE|image_reduire{20,20})]<a href="[(#ID_FORMULAIRE|generer_url_entite{formulaire})]">#TITRE</a></td>
+
+                       <td class="action">
+                               [(#ENV{editable}|oui)
+                                       <button type="submit" class="button link delete" name="supprimer_lien\[formulaire-#ID_FORMULAIRE-#OBJET-#ID_OBJET\]" value="X"><:formidable:liens_retirer_lien_formulaire:> [(#CHEMIN_IMAGE{supprimer-12.png}|balise_img{'X'})]</button>
+                               ]
+                       </td>
+               </tr>
+       </BOUCLE_liste_formulaires>
+       </tbody>
+</table>
+[<p class="pagination">(#PAGINATION{prive})</p>]
+[(#GRAND_TOTAL|>{3}|oui)<div class="action"><button type="submit" class="button link" name="supprimer_lien\[formulaire-*-#OBJET-#ID_OBJET\]" value="X"><:formidable:liens_retirer_tous_liens_formulaires:> [(#CHEMIN_IMAGE{supprimer-8.png}|balise_img{'X'})]</button></div>]
+</div>
+</B_liste_formulaires>
+<div class="liste-objets liste-objets-lies formulaires caption-wrap">
+       <strong class="caption">[(#ENV*{titre,<:formidable:formulaires_aucun:>})]</strong>
+</div>
+<//B_liste_formulaires>
diff --git a/www/plugins/formidable/prive/objets/liste/formulaires_lies_fonctions.php b/www/plugins/formidable/prive/objets/liste/formulaires_lies_fonctions.php
new file mode 100644 (file)
index 0000000..bb06808
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Fonctions du squelette associé
+ *
+ * @plugin     GéoCulture : noyau fonctionnel
+ * @copyright  2016
+ * @author     Les Développements Durables
+ * @licence    GNU/GPL
+ * @package    SPIP\Geoculture_core\Fonctions
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+// pour initiale et afficher_initiale
+include_spip('prive/objets/liste/auteurs_fonctions');
\ No newline at end of file
index 34980af..b61b10b 100644 (file)
@@ -40,6 +40,6 @@
 [(#VAL{formulaire}|concat{-enfants}|trouver_fond{prive/objets/contenu/}|oui)\r
        [(#SET{enfants,[(#INCLURE{fond=prive/objets/contenu/formulaire-enfants,id_objet,env})]})]\r
 ]\r
-[(#PIPELINE{affiche_enfants,[(#ARRAY{args,#ARRAY{objet,formulaire,id_objet,#ID_FORMULAIRE},data,#GET{enfants}})]})]\r
+[(#PIPELINE{affiche_enfants,[(#ARRAY{args,#ARRAY{exec,formulaire,objet,formulaire,id_objet,#ID_FORMULAIRE},data,#GET{enfants}})]})]\r
 \r
 </BOUCLE_formulaire>\r
index 04575fc..67b1b01 100644 (file)
@@ -27,7 +27,7 @@
 [(#VAL{formulaires_reponse}|concat{-enfants}|trouver_fond{prive/objets/contenu/}|oui)
        [(#SET{enfants,[(#INCLURE{fond=prive/objets/contenu/formulaires_reponse-enfants,id_objet,env})]})]
 ]
-[(#PIPELINE{affiche_enfants,[(#ARRAY{args,#ARRAY{objet,formulaires_reponse,id_objet,#ID_FORMULAIRES_REPONSE},data,#GET{enfants}})]})]
+[(#PIPELINE{affiche_enfants,[(#ARRAY{args,#ARRAY{exec,formulaires_reponse,objet,formulaires_reponse,id_objet,#ID_FORMULAIRES_REPONSE},data,#GET{enfants}})]})]
 
 </BOUCLE_autoriser>
 </BOUCLE_formulaires_reponse>
index 0b375c6..c760353 100644 (file)
@@ -1,7 +1,7 @@
 <BOUCLE_formulaire(FORMULAIRES){id_formulaire}{tout}>
 <!--#extra-->
 [(#BOITE_OUVRIR{<:formidable:titre_cadre_raccourcis:>,'raccourcis'})]
-       [(#AUTORISER{editer, formulaire}|oui)
+       [(#AUTORISER{editer, formulaire, #ID_FORMULAIRE}|oui)
        [(#URL_ACTION_AUTEUR{dupliquer_formulaire, #ID_FORMULAIRE}|icone_horizontale{<:formidable:formulaires_dupliquer:>,formulaire-dupliquer-24})]
        ]
        <BOUCLE_exports(POUR){tableau #VAL|echanges_formulaire_lister_disponibles|table_valeur{exporter}}>
index 6c2c020..f8fd58a 100755 (executable)
@@ -1,8 +1,5 @@
 <BOUCLE_formulaire(FORMULAIRES){id_formulaire}{tout}>
-<BOUCLE_autoriser(CONDITION){si #AUTORISER{voir, formulaires_analyse}}>
-[(#BOITE_OUVRIR{<:formidable:titre_cadre_raccourcis:>,'info'})]
-[(#URL_ACTION_AUTEUR{exporter_analyse_reponses,#ID_FORMULAIRE}
-    |icone_horizontale{<:formidable:analyse_exporter:>,formulaire-analyse-24})]
-#BOITE_FERMER
-</BOUCLE_autoriser>
+[(#AUTORISER{voir, formulaires_analyse, #ID_FORMULAIRE}|oui)
+#FORMULAIRE_EXPORTER_FORMULAIRE_ANALYSE{#ID_FORMULAIRE}
+]
 </BOUCLE_formulaire>
index b0719a3..f891d13 100644 (file)
@@ -1,16 +1,8 @@
 <BOUCLE_formulaire(FORMULAIRES){id_formulaire}{tout}>
-[(#SET{ouvre_boite,[(#AUTORISER{voir, formulaires_reponse, #ID_FORMULAIRE}|ou{#AUTORISER{modifier, formulaires_reponse, #ID_FORMULAIRE}})]})]
-[(#GET{ouvre_boite}|oui)[(#BOITE_OUVRIR{<:formidable:titre_cadre_raccourcis:>,'info'})]]
 
-<BOUCLE_autoriser_1(CONDITION){si #AUTORISER{voir, formulaires_reponse}}>
-[(#URL_ACTION_AUTEUR{exporter_formulaires_reponses,#ID_FORMULAIRE}
-       |icone_horizontale{<:formidable:reponses_exporter:>,formulaire,formulaire-reponses-exporter-24,center})]
-</BOUCLE_autoriser_1>
+[(#AUTORISER{voir, formulaires_reponse, #ID_FORMULAIRE}|oui)
+       #FORMULAIRE_EXPORTER_FORMULAIRE_REPONSES{#ID_FORMULAIRE}
+]
 
-<BOUCLE_autoriser_2(CONDITION){si #AUTORISER{editer, formulaires,#ID_FORMULAIRE}}>
-[(#URL_ACTION_AUTEUR{vider_formulaire,#ID_FORMULAIRE}
-       |icone_horizontale{<:formidable:reponses_supprimer:>,formulaire,formulaire-reponses-supprimer-24,'',onclick="return confirm('<:formidable:reponses_supprimer_confirmation:>');"})]
-</BOUCLE_autoriser_2>
 
-[(#GET{ouvre_boite}|oui)#BOITE_FERMER]
 </BOUCLE_formulaire>
index d6f327c..27f15d5 100644 (file)
@@ -1,9 +1,24 @@
 <div class='onglets_simple clearfix'>
        <ul>
                <li>[(#SELF|parametre_url{statut|id_formulaires_reponse,'XXX'}|replace{XXX,''}|lien_ou_expose{<:formidable:info_reponse_toutes:>,[(#ENV{statut}|non|et{#ENV{id_formulaires_reponse,''}|non})],ajax})]</li>
-               <li>[(#SELF|parametre_url{statut,'prop'}|lien_ou_expose{<:formidable:info_reponse_proposees:>,#ENV{statut}|=={prop},ajax})]</li>
-               <li>[(#SELF|parametre_url{statut,'publie'}|lien_ou_expose{<:formidable:info_reponse_publiees:>,#ENV{statut}|=={publie},ajax})]</li>
-               <li>[(#SELF|parametre_url{statut,'refuse'}|lien_ou_expose{<:formidable:info_reponse_supprimees:>,#ENV{statut}|=={refuse},ajax})]</li>
+               <BOUCLE_repprop(FORMULAIRES_REPONSES){id_formulaire}{statut=prop} />
+               <li>[(#SELF|parametre_url{statut,'prop'}|lien_ou_expose{<:formidable:info_reponse_proposees:>[ \((#TOTAL_BOUCLE|>{0}|?{#TOTAL_BOUCLE})\)],#ENV{statut}|=={prop},ajax})]</li>
+               <//B_repprop><BOUCLE_reppub(FORMULAIRES_REPONSES){id_formulaire}{statut=publie} />
+               <li>[(#SELF|parametre_url{statut,'publie'}|lien_ou_expose{<:formidable:info_reponse_publiees:>[ \((#TOTAL_BOUCLE|>{0}|?{#TOTAL_BOUCLE})\)],#ENV{statut}|=={publie},ajax})]</li>
+               <//B_reppub><BOUCLE_repref(FORMULAIRES_REPONSES){id_formulaire}{statut=refuse} />
+               <li>[(#SELF|parametre_url{statut,'refuse'}|lien_ou_expose{<:formidable:info_reponse_supprimees:>[ \((#TOTAL_BOUCLE|>{0}|?{#TOTAL_BOUCLE})\)],#ENV{statut}|=={refuse},ajax})]</li>
+               <//B_repref>
        </ul>
 </div>
-<INCLURE{fond=prive/objets/liste/formulaires_reponses, env, ajax, nb=#ENV{nb,30}, sinon=<:formidable:info_aucune_reponse:>} />
\ No newline at end of file
+<INCLURE{fond=prive/objets/liste/formulaires_reponses, env, ajax, nb=#ENV{nb,30}, sinon=<:formidable:info_aucune_reponse:>} />
+
+<BOUCLE_repall(FORMULAIRES_REPONSES){id_formulaire}{statut!=refuse}/>
+[(#ENV{statut}|non
+       |et{#ENV{id_formulaires_reponse,''}|non}
+       |et{#TOTAL_BOUCLE|>{10}}
+       |et{#AUTORISER{instituer,formulairesreponse,#ID_FORMULAIRE}})
+
+       [(#URL_ACTION_AUTEUR{vider_formulaire,#ID_FORMULAIRE}
+               |icone_verticale{<:formidable:reponses_supprimer:>,formulaire,formulaire-reponses-supprimer-24,'right danger',onclick="return confirm('<:formidable:reponses_supprimer_confirmation:>');"})]
+]
+<//B_repall>
\ No newline at end of file
index c30ccdd..6c8ed4d 100644 (file)
@@ -2,47 +2,53 @@
 #BOITE_OUVRIR{'','info'}
 #PIPELINE{boite_infos,#ARRAY{data,'',args,#ARRAY{'type','formulaire','id',#ENV{id_formulaire}}}}
 
-[(#AUTORISER{editer, formulaire, #ID_FORMULAIRE}|oui)
 
-[(#URL_ECRIRE{formulaire_edit}
-       |parametre_url{id_formulaire, #ID_FORMULAIRE}
-       |parametre_url{configurer,formulaire}
-       |parametre_url{avertissement,''}
-       |icone_horizontale{<:formidable:editer_menu_formulaire:>,formulaire-editer-24})]
-
-[(#CONFIG{formidable/analyse/auteur}|=={on}|oui)[(#URL_ECRIRE{formulaire_edit}
-       |parametre_url{id_formulaire, #ID_FORMULAIRE}
-       |parametre_url{configurer,auteurs}
-       |parametre_url{avertissement,''}
-       |icone_horizontale{<:formidable:editer_menu_auteurs:>,formulaire-config-auteurs-24})]
-]
+[(#AUTORISER{editer, formulaire, #ID_FORMULAIRE}|oui)
 
-[(#URL_ECRIRE{formulaire_edit}
-       |parametre_url{id_formulaire, #ID_FORMULAIRE}
-       |parametre_url{configurer,champs}
-       |parametre_url{avertissement,''}
-       |icone_horizontale{<:formidable:editer_menu_champs:>,formulaire-config-champs-24})]
+       [(#URL_ECRIRE{formulaire_edit}
+               |parametre_url{id_formulaire, #ID_FORMULAIRE}
+               |parametre_url{configurer,formulaire}
+               |parametre_url{avertissement,''}
+               |icone_horizontale{<:formidable:editer_menu_formulaire:>,formulaire-editer-24})]
+
+       [(#CONFIG{formidable/analyse/auteur}|=={on}|oui)
+               [(#URL_ECRIRE{formulaire_edit}
+                       |parametre_url{id_formulaire, #ID_FORMULAIRE}
+                       |parametre_url{configurer,auteurs}
+                       |parametre_url{avertissement,''}
+                       |icone_horizontale{<:formidable:editer_menu_auteurs:>,formulaire-config-auteurs-24})]
+       ]
+
+       [(#URL_ECRIRE{formulaire_edit}
+               |parametre_url{id_formulaire, #ID_FORMULAIRE}
+               |parametre_url{configurer,champs}
+               |parametre_url{avertissement,''}
+               |icone_horizontale{<:formidable:editer_menu_champs:>,formulaire-config-champs-24})]
 
-[(#URL_ECRIRE{formulaire_edit}
-       |parametre_url{id_formulaire, #ID_FORMULAIRE}
-       |parametre_url{configurer,traitements}
-       |parametre_url{avertissement,''}
-       |icone_horizontale{<:formidable:editer_menu_traitements:>,formulaire-config-traitements-24})]
+       [(#URL_ECRIRE{formulaire_edit}
+               |parametre_url{id_formulaire, #ID_FORMULAIRE}
+               |parametre_url{configurer,traitements}
+               |parametre_url{avertissement,''}
+               |icone_horizontale{<:formidable:editer_menu_traitements:>,formulaire-config-traitements-24})]
 
 ]
 
-<BOUCLE_resultats(FORMULAIRES_REPONSES){id_formulaire} {statut!=poubelle} />
-[(#TOTAL_BOUCLE|oui)
-       [(#AUTORISER{voir,formulaires_reponse,#ID_FORMULAIRE}|oui)
-       <div class='navigation_resultats'>
-       [(#URL_ECRIRE{formulaires_reponses}
-               |parametre_url{id_formulaire, #ID_FORMULAIRE}
-               |icone_horizontale{#TOTAL_BOUCLE|singulier_ou_pluriel{formidable:info_1_reponse,formidable:info_nb_reponses},formulaire-reponses-24})]
-       [(#URL_ECRIRE{formulaires_analyse}
-               |parametre_url{id_formulaire, #ID_FORMULAIRE}
-               |icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})]
-       </div>]
-]
+
+<BOUCLE_resultats(FORMULAIRES_REPONSES){id_formulaire}{statut==.*}/>
+       <BOUCLE_si(CONDITION){si #_resultats:TOTAL_BOUCLE|et{#AUTORISER{voir,formulaires_reponse,#ID_FORMULAIRE}}}>
+               <div class='navigation_resultats'>
+                       [(#URL_ECRIRE{formulaires_reponses}
+                               |parametre_url{id_formulaire, #ID_FORMULAIRE}
+                               |icone_horizontale{#_resultats:TOTAL_BOUCLE|singulier_ou_pluriel{formidable:info_1_reponse,formidable:info_nb_reponses},formulaire-reponses-24})
+                       ]
+                       <BOUCLE_publies(FORMULAIRES_REPONSES){id_formulaire}{statut=publie}{0,1}>
+                       [(#URL_ECRIRE{formulaires_analyse}
+                               |parametre_url{id_formulaire, #ID_FORMULAIRE}
+                               |icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})
+                       ]
+                       </BOUCLE_publies>
+               </div>
+       </BOUCLE_si>
 <//B_resultats>
 
 #BOITE_FERMER
index 900ae76..c904d26 100644 (file)
@@ -4,9 +4,7 @@
 #PIPELINE{boite_infos,#ARRAY{data,'',args,#ARRAY{'type','formulaire','id',#ENV{id_formulaire}}}}
 
 [(#URL_ECRIRE{formulaires_reponses}|parametre_url{id_formulaire,#ID_FORMULAIRE}|icone_horizontale{<:formidable:reponses_liste:>,formulaire-reponses-24})]
-
-[(#SELF|icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})]
-
+       
 #BOITE_FERMER
 </BOUCLE_autoriser>
 </BOUCLE_formulaire>
index e75a0d6..ac1bfcd 100644 (file)
@@ -5,9 +5,13 @@
        [(#PIPELINE{boite_infos,#ARRAY{data,'',
                args,#ARRAY{'type','formulaires_reponse','id',#ENV{id_formulaires_reponse}}}})]
 
+       [(#URL_ECRIRE{formulaires_reponses}|parametre_url{id_formulaire,#ID_FORMULAIRE}|icone_horizontale{<:formidable:reponses_liste:>,formulaire-reponses-24})]
+
+       <BOUCLE_publies(FORMULAIRES_REPONSES){id_formulaire}{statut=publie}{0,1}>
        [(#URL_ECRIRE{formulaires_analyse}
                |parametre_url{id_formulaire,#ID_FORMULAIRE}
                |icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})]
+       </BOUCLE_publies>
 
 #BOITE_FERMER
 
index 366fd37..70e205b 100644 (file)
@@ -3,9 +3,10 @@
 #BOITE_OUVRIR{'','info'}
 #PIPELINE{boite_infos,#ARRAY{data,'',args,#ARRAY{'type','formulaire','id',#ENV{id_formulaire}}}}
 
-[(#SELF|icone_horizontale{<:formidable:reponses_liste:>,formulaire,formulaire-reponses-24,left})]
+       <BOUCLE_publies(FORMULAIRES_REPONSES){id_formulaire}{statut=publie}{0,1}>
+       [(#URL_ECRIRE{formulaires_analyse}|parametre_url{id_formulaire,#ID_FORMULAIRE}|icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})]
+       </BOUCLE_publies>
 
-[(#URL_ECRIRE{formulaires_analyse}|parametre_url{id_formulaire,#ID_FORMULAIRE}|icone_horizontale{<:formidable:reponses_analyse:>,formulaire-analyse-24})]
 
 #BOITE_FERMER
 </BOUCLE_autoriser>
index 8ca21ea..4a9e915 100644 (file)
Binary files a/www/plugins/formidable/prive/themes/basic/images/formulaire-16.png and b/www/plugins/formidable/prive/themes/basic/images/formulaire-16.png differ
index 8ca21ea..4a9e915 100644 (file)
Binary files a/www/plugins/formidable/prive/themes/spip/images/formulaire-16.png and b/www/plugins/formidable/prive/themes/spip/images/formulaire-16.png differ
index ff847d0..3c6a1b4 100644 (file)
Binary files a/www/plugins/formidable/prive/themes/spip/images/formulaire-24.png and b/www/plugins/formidable/prive/themes/spip/images/formulaire-24.png differ
index ec0a2b0..26d2247 100644 (file)
Binary files a/www/plugins/formidable/prive/themes/spip/images/formulaires_reponse-24.png and b/www/plugins/formidable/prive/themes/spip/images/formulaires_reponse-24.png differ
index 38d7d96..1754344 100644 (file)
@@ -1,18 +1,20 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
        // {tri_donnee champ}
 /**
  * Depuis la boucle FORMULAIRES_REPONSES, trier les résulats en fonction d'un champ
  * de la table FORMULAIRES_REPONSES_CHAMPS
- * {tri_selon_donnee} 
+ * {tri_selon_donnee}
  *
  * @global array $exceptions_des_tables
  * @param string $idb
  * @param array $boucles
  * @param <type> $crit
- * 
+ *
  * Auteurs :
  * Antoine Pitrou
  * Cedric Morin
@@ -20,15 +22,16 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @ 2005,2006 - Distribue sous licence GNU/GPL
  */
 
-function critere_tri_selon_donnee_dist($idb, &$boucles, $crit) { // Garder cette fontion pour compatibilité
+function critere_tri_selon_donnee_dist($idb, &$boucles, $crit) {
+       // Garder cette fontion pour compatibilité
        critere_tri_selon_reponse_dist($idb, $boucles, $crit) ;
 }
 function critere_tri_selon_reponse_dist($idb, &$boucles, $crit) {
 
        $boucle = &$boucles[$idb];
        $t = $boucle->id_table;
-       
-       if ($t=='formulaires_reponses'){
+
+       if ($t=='formulaires_reponses') {
                $not = $crit->not;
                $_quoi = calculer_liste($crit->param[0], array(), $boucles, $boucles[$idb]->id_parent);
                $k = count($boucle->join)+1;
@@ -46,11 +49,12 @@ function critere_recherche_reponse_dist($idb, &$boucles, $crit) {
        global $table_des_tables;
        $boucle = &$boucles[$idb];
        $t = $boucle->id_table;
-       if ($t=='formulaires_reponses'){
-               if (isset($crit->param[0]))
+       if ($t=='formulaires_reponses') {
+               if (isset($crit->param[0])) {
                        $_quoi = calculer_liste($crit->param[0], array(), $boucles, $boucles[$idb]->id_parent);
-               else
+               } else {
                        $_quoi = '@$Pile[0]["recherche"]';
+               }
 
                $k = count($boucle->join)+1;
                $boucle->join[$k]= array($t,'id_formulaires_reponse');
@@ -59,6 +63,3 @@ function critere_recherche_reponse_dist($idb, &$boucles, $crit) {
                $boucle->where[]= array("'?'",$_quoi,$op,"''");
        }
 }
-
-
-?>
index 0efc6f9..48fabd5 100644 (file)
@@ -8,7 +8,7 @@
 
 /**
  * Gestion des puces statuts des formulaires
- * 
+ *
  * Retourne le contenu d'une puce avec changement de statut possible
  * si on en a l'autorisation, sinon simplement l'image de la puce
  *
  * @return string
  *     Code HTML de l'image de puce de statut à insérer (et du menu de changement si présent)
 **/
-function puce_statut_formulaires_reponse_dist($id, $statut, $id_parent, $type='article', $ajax = false, $menu_rapide=_ACTIVER_PUCE_RAPIDE) {
+function puce_statut_formulaires_reponse_dist($id, $statut, $id_parent, $type = 'article', $ajax = false, $menu_rapide = _ACTIVER_PUCE_RAPIDE) {
 
        $src = statut_image($type, $statut);
-       if (!$src)
+       if (!$src) {
                return $src;
+       }
 
        if (!$id
-         OR !_SPIP_AJAX
-         OR !$menu_rapide
-         OR !autoriser('instituer', $type, $id)) {
-         $ajax_node ='';
-       }
-       else
+               or !_SPIP_AJAX
+               or !$menu_rapide
+               or !autoriser('instituer', $type, $id)) {
+               $ajax_node ='';
+       } else {
                $ajax_node = " class='imgstatut$type$id'";
+       }
 
-       $inser_puce = http_img_pack($src,statut_titre($type, $statut),$ajax_node);
+       $inser_puce = http_img_pack($src, statut_titre($type, $statut), $ajax_node);
 
-       if (!$ajax_node)
+       if (!$ajax_node) {
                return $inser_puce;
+       }
 
        $table = table_objet_sql($type);
        $desc = lister_tables_objets_sql($table);
-       if (!isset($desc['statut_textes_instituer']))
+       if (!isset($desc['statut_textes_instituer'])) {
                return $inser_puce;
+       }
 
        $coord = array_flip(array_keys($desc['statut_textes_instituer']));
-       if (!isset($coord[$statut]))
+       if (!isset($coord[$statut])) {
                return $inser_puce;
+       }
 
        $unit = 8/*widh de img*/+4/*padding*/;
        $margin = 4; /* marge a gauche + droite */
        $zero = 1 /*border*/ + $margin/2 + 2 /*padding*/;
        $clip = $zero+ ($unit*$coord[$statut]);
-       if ($ajax){
-
+       if ($ajax) {
                $width = $unit*count($desc['statut_textes_instituer'])+$margin;
                $out = "<span class='puce_objet_fixe $type'>"
                . $inser_puce
-               . "</span>"
+               . '</span>'
                . "<span class='puce_objet_popup $type statutdecal$type$id' style='width:{$width}px;margin-left:-{$clip}px;'>";
                $i=0;
-               foreach($desc['statut_textes_instituer'] as $s=>$t){
-                       $out .= afficher_script_statut($id, $type, -$zero-$i++*$unit, statut_image($type,$s), $s, _T($t));
+               foreach ($desc['statut_textes_instituer'] as $s => $t) {
+                       $out .= afficher_script_statut($id, $type, -$zero-$i++*$unit, statut_image($type, $s), $s, _T($t));
                }
-               $out .= "</span>";
+               $out .= '</span>';
                return $out;
-       }
-       else {
+       } else {
+               $nom = 'puce_statut_';
+               $action = generer_url_ecrire('puce_statut_formulaires', '', true);
+               $action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, '$nom', '$type', '$id', '$action'); }";
+               $over = " onmouseover=\"$action\"";
 
-               $nom = "puce_statut_";
-         $action = generer_url_ecrire('puce_statut_formulaires',"",true);
-         $action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, '$nom', '$type', '$id', '$action'); }";
-         $over = " onmouseover=\"$action\"";
-
-               $lang_dir = lang_dir(isset($GLOBALS['lang_objet']) ? $GLOBALS['lang_objet'] : "");
+               $lang_dir = lang_dir(isset($GLOBALS['lang_objet']) ? $GLOBALS['lang_objet'] : '');
                return  "<span class='puce_objet $type' id='$nom$type$id' dir='$lang_dir'$over>"
                . $inser_puce
                . '</span>';
        }
 }
-
-
index a8c5c23..25fc191 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/formidable/trunk
-Revision: 84748
-Dernier commit: 2014-09-18 21:39:20 +0200 
+Revision: 98973
+Dernier commit: 2016-07-22 06:04:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/formidable/trunk</origine>
-<revision>84748</revision>
-<commit>2014-09-18 21:39:20 +0200 </commit>
+<revision>98973</revision>
+<commit>2016-07-22 06:04:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 8096a97..ef4f075 100644 (file)
@@ -1,22 +1,24 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function traiter_email_dist($args, $retours){
+function traiter_email_dist($args, $retours) {
        $formulaire = $args['formulaire'];
        $options = $args['options'];
        $saisies = unserialize($formulaire['saisies']);
        $traitements = unserialize($formulaire['traitements']);
        $champs = saisies_lister_champs($saisies);
-       
+
        // On récupère les destinataires
-       if ($options['champ_destinataires']){
+       if ($options['champ_destinataires']) {
                $destinataires = _request($options['champ_destinataires']);
-               if (!is_array($destinataires) and intval($destinataires)){
+               if (!is_array($destinataires) and intval($destinataires)) {
                        $destinataires = array($destinataires);
                }
-               if (is_array($destinataires)){
+               if (is_array($destinataires)) {
                        // On récupère les mails des destinataires
                        $destinataires = array_map('intval', $destinataires);
                        $destinataires = sql_allfetsel(
@@ -27,76 +29,88 @@ function traiter_email_dist($args, $retours){
                        $destinataires = array_map('reset', $destinataires);
                }
        }
-       if (!$destinataires)
+       if (!$destinataires) {
                $destinataires = array();
+       }
        if ($options['champ_courriel_destinataire_form']) {
                $courriel_champ_form = _request($options['champ_courriel_destinataire_form']);
                $destinataires[] = $courriel_champ_form;
        }
-       
+
 
        // On ajoute les destinataires en plus
-       if ($options['destinataires_plus']){
+       if ($options['destinataires_plus']) {
                $destinataires_plus = explode(',', $options['destinataires_plus']);
                $destinataires_plus = array_map('trim', $destinataires_plus);
                $destinataires = array_merge($destinataires, $destinataires_plus);
                $destinataires = array_unique($destinataires);
        }
-       
+
        // On récupère le courriel de l'envoyeur s'il existe
-       if ($options['champ_courriel']){
+       if ($options['champ_courriel']) {
                $courriel_envoyeur = _request($options['champ_courriel']);
        }
-       if (!$courriel_envoyeur) $courriel_envoyeur = '';
-       
+       if (!$courriel_envoyeur) {
+               $courriel_envoyeur = '';
+       }
+
        // Si on a bien des destinataires, on peut continuer
-       if ($destinataires or ($courriel_envoyeur and $options['activer_accuse'])){
+       if ($destinataires or ($courriel_envoyeur and $options['activer_accuse'])) {
                include_spip('inc/filtres');
                include_spip('inc/texte');
-               
+
                $nom_site_spip = supprimer_tags(typo($GLOBALS['meta']['nom_site']));
-               
+
                // On parcourt les champs pour générer le tableau des valeurs
                $valeurs = array();
-               foreach ($champs as $champ){
+               foreach ($champs as $champ) {
                        $valeurs[$champ] = _request($champ);
                }
-               
+
                // On récupère le nom de l'envoyeur
-               if ($options['champ_nom']){
+               if ($options['champ_nom']) {
                        $a_remplacer = array();
-                       if (preg_match_all('/@[\w]+@/', $options['champ_nom'], $a_remplacer)){
+                       if (preg_match_all('/@[\w]+@/', $options['champ_nom'], $a_remplacer)) {
                                $a_remplacer = $a_remplacer[0];
-                               foreach ($a_remplacer as $cle=>$val) $a_remplacer[$cle] = trim($val, '@');
+                               foreach ($a_remplacer as $cle => $val) {
+                                       $a_remplacer[$cle] = trim($val, '@');
+                               }
                                $a_remplacer = array_flip($a_remplacer);
                                $a_remplacer = array_intersect_key($valeurs, $a_remplacer);
                                $a_remplacer = array_merge($a_remplacer, array('nom_site_spip' => $nom_site_spip));
                        }
                        $nom_envoyeur = trim(_L($options['champ_nom'], $a_remplacer));
                }
-               if (!$nom_envoyeur) $nom_envoyeur = $nom_site_spip;
-               
+               if (!$nom_envoyeur) {
+                       $nom_envoyeur = $nom_site_spip;
+               }
+
                // On récupère le sujet s'il existe sinon on le construit
-               if ($options['champ_sujet']){
+               if ($options['champ_sujet']) {
                        $a_remplacer = array();
-                       if (preg_match_all('/@[\w]+@/', $options['champ_sujet'], $a_remplacer)){
+                       if (preg_match_all('/@[\w]+@/', $options['champ_sujet'], $a_remplacer)) {
                                $a_remplacer = $a_remplacer[0];
-                               foreach ($a_remplacer as $cle=>$val) $a_remplacer[$cle] = trim($val, '@');
+                               foreach ($a_remplacer as $cle => $val) {
+                                       $a_remplacer[$cle] = trim($val, '@');
+                               }
                                $a_remplacer = array_flip($a_remplacer);
                                $a_remplacer = array_intersect_key($valeurs, $a_remplacer);
                                $a_remplacer = array_merge($a_remplacer, array('nom_site_spip' => $nom_site_spip));
                        }
                        $sujet = trim(_L($options['champ_sujet'], $a_remplacer));
                }
-               if (!$sujet) $sujet = _T('formidable:traiter_email_sujet', array('nom'=>$nom_envoyeur));
+               if (!$sujet) {
+                       $sujet = _T('formidable:traiter_email_sujet', array('nom'=>$nom_envoyeur));
+               }
                $sujet = filtrer_entites($sujet);
-               
+
                // Mais quel va donc être le fond ?
-               if (find_in_path('notifications/formulaire_'.$formulaire['identifiant'].'_email.html'))
+               if (find_in_path('notifications/formulaire_'.$formulaire['identifiant'].'_email.html')) {
                        $notification = 'notifications/formulaire_'.$formulaire['identifiant'].'_email';
-               else
+               } else {
                        $notification = 'notifications/formulaire_email';
-               
+               }
+
                // On génère le mail avec le fond
                $html = recuperer_fond(
                        $notification,
@@ -108,11 +122,11 @@ function traiter_email_dist($args, $retours){
                                'valeurs' => $valeurs
                        )
                );
-               
+
                // On génère le texte brut
                include_spip('facteur_fonctions');
                $texte = facteur_mail_html2text($html);
-               
+
                // On utilise la forme avancé de Facteur
                $corps = array(
                        'html' => $html,
@@ -122,43 +136,70 @@ function traiter_email_dist($args, $retours){
                // Si l'utilisateur n'a pas indiqué autrement, on met le courriel de l'envoyeur dans
                // Reply-To et on laisse le from par defaut de Facteur car sinon ca bloque sur les
                // SMTP un peu restrictifs.
-               $courriel_from = "";
-               if ($courriel_envoyeur && $options['activer_vrai_envoyeur']){
+               $courriel_from = '';
+               if ($courriel_envoyeur && $options['activer_vrai_envoyeur']) {
                        $courriel_from = $courriel_envoyeur;
                } else if ($courriel_envoyeur) {
                        $corps['repondre_a'] = $courriel_envoyeur;
                }
-               
+
                // On envoie enfin le message
-               $envoyer_mail = charger_fonction('envoyer_mail','inc');
-               
+               $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
+
                // On envoie aux destinataires
-               if ($destinataires)
-                       $ok = $envoyer_mail($destinataires, $sujet, $corps, $courriel_from, "X-Originating-IP: ".$GLOBALS['ip']);
-               
+               if ($destinataires) {
+                       $ok = $envoyer_mail($destinataires, $sujet, $corps, $courriel_from, 'X-Originating-IP: '.$GLOBALS['ip']);
+               }
+
                // Si c'est bon, on envoie l'accusé de réception
-               if ($ok and $courriel_envoyeur and $options['activer_accuse']){
+               if ($ok and $courriel_envoyeur and $options['activer_accuse']) {
                        // On récupère le sujet s'il existe sinon on le construit
-                       if ($options['sujet_accuse']){
+                       if ($options['sujet_accuse']) {
                                $a_remplacer = array();
-                               if (preg_match_all('/@[\w]+@/', $options['sujet_accuse'], $a_remplacer)){
+                               if (preg_match_all('/@[\w]+@/', $options['sujet_accuse'], $a_remplacer)) {
                                        $a_remplacer = $a_remplacer[0];
-                                       foreach ($a_remplacer as $cle=>$val) $a_remplacer[$cle] = trim($val, '@');
+                                       foreach ($a_remplacer as $cle => $val) {
+                                               $a_remplacer[$cle] = trim($val, '@');
+                                       }
                                        $a_remplacer = array_flip($a_remplacer);
                                        $a_remplacer = array_intersect_key($valeurs, $a_remplacer);
                                        $a_remplacer = array_merge($a_remplacer, array('nom_site_spip' => $nom_site_spip));
                                }
                                $sujet_accuse = trim(_L($options['sujet_accuse'], $a_remplacer));
                        }
-                       if (!$sujet_accuse) $sujet_accuse = _T('formidable:traiter_email_sujet_accuse');
+                       if (!$sujet_accuse) {
+                               $sujet_accuse = _T('formidable:traiter_email_sujet_accuse');
+                       }
                        $sujet_accuse = filtrer_entites($sujet_accuse);
-                       
+
+                       // Si un nom d'expéditeur est précisé pour l'AR, on l'utilise, sinon on utilise le nomde l'envoyeur du courriel principal
+                       $nom_envoyeur_accuse = trim($options['nom_envoyeur_accuse']);
+                       if (!$nom_envoyeur_accuse) {
+                               $nom_envoyeur_accuse = $nom_envoyeur;
+                       }
+
+                       //A fortiori, si un courriel d'expéditeur est précisé pour l'AR, on l'utilise
+                       if ($options['courriel_envoyeur_accuse']) {
+                               $courriel_envoyeur_accuse = $options['courriel_envoyeur_accuse'];
+                       } else {
+                               $courriel_envoyeur_accuse = $courriel_envoyeur;
+                       }
+
+                       //Et on teste si on doit mettre cela en from ou en reply-to
+                       if ($options['activer_vrai_envoyeur'] and $courriel_envoyeur_accuse) {
+                               $courriel_from_accuse = $courriel_envoyeur_accuse;
+                       } elseif ($courriel_envoyeur_accuse) {
+                               $corps['repondre_a'] = $courriel_envoyeur_accuse;
+                               $courriel_from_accuse = '';
+                       }
+
                        // Mais quel va donc être le fond ?
-                       if (find_in_path('notifications/formulaire_'.$formulaire['identifiant'].'_accuse.html'))
+                       if (find_in_path('notifications/formulaire_'.$formulaire['identifiant'].'_accuse.html')) {
                                $accuse = 'notifications/formulaire_'.$formulaire['identifiant'].'_accuse';
-                       else
+                       } else {
                                $accuse = 'notifications/formulaire_accuse';
-                               
+                       }
+
                        // On génère l'accusé de réception
                        $html_accuse = recuperer_fond(
                                $accuse,
@@ -171,30 +212,27 @@ function traiter_email_dist($args, $retours){
                                        'valeurs' => $valeurs
                                )
                        );
-                       
+
                        // On génère le texte brut
                        $texte = facteur_mail_html2text($html_accuse);
-                       
+
                        $corps = array(
                                'html' => $html_accuse,
                                'texte' => $texte,
-                               'nom_envoyeur' => filtrer_entites($nom_site_spip),
+                               'nom_envoyeur' => filtrer_entites($nom_envoyeur_accuse),
                        );
 
-                       $ok = $envoyer_mail($courriel_envoyeur, $sujet_accuse, $corps, $courriel_from, "X-Originating-IP: ".$GLOBALS['ip']);
+                       $ok = $envoyer_mail($courriel_envoyeur, $sujet_accuse, $corps, $courriel_from_accuse, 'X-Originating-IP: '.$GLOBALS['ip']);
                }
-               
-               if ($ok){
+
+               if ($ok) {
                        $retours['message_ok'] .= "\n"._T('formidable:traiter_email_message_ok');
-               }
-               else{
+               } else {
                        $retours['message_erreur'] .= "\n"._T('formidable:traiter_email_message_erreur');
                }
        }
-       
+
        // noter qu'on a deja fait le boulot, pour ne pas risquer double appel
        $retours['traitements']['email'] = true;
        return $retours;
 }
-
-?>
index e731dd1..d82ca2a 100644 (file)
@@ -62,3 +62,15 @@ options:
       nom: 'sujet_accuse'
       label: '<:formidable:traiter_email_option_sujet_accuse_label:>'
       explication: '<:formidable:traiter_email_option_sujet_explication:>'
+  -
+    saisie: 'input'
+    options:
+      nom: 'courriel_envoyeur_accuse'
+      label: '<:formidable:traiter_email_option_courriel_envoyeur_accuse_label:>'
+      explication: '<:formidable:traiter_email_option_courriel_envoyeur_accuse_explication:>'
+  -
+    saisie: 'input'
+    options:
+      nom: 'nom_envoyeur_accuse'
+      label: '<:formidable:traiter_email_option_nom_envoyeur_accuse_label:>'
+      explication: '<:formidable:traiter_email_option_nom_envoyeur_accuse_explication:>'
index 81516f2..adc94a8 100644 (file)
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-function traiter_enregistrement_dist($args, $retours){
-    include_spip('inc/formidable');
-    include_spip('base/abstract_sql');
-    $options = $args['options'];
-    $formulaire = $args['formulaire'];
-    $id_formulaire = $args['id_formulaire'];
-    $saisies = unserialize($formulaire['saisies']);
-    $saisies = saisies_lister_par_nom($saisies);
-
-    // La personne a-t-elle un compte ?
-    global $auteur_session;
-    $id_auteur = $auteur_session ? intval($auteur_session['id_auteur']) : 0;
-
-    // traitement de l'anonymisation
-    if ($options['anonymiser'] == 'on') {
-        // mod de l'id_auteur
-        $variables_anonymisation =
-            $GLOBALS['formulaires']['variables_anonymisation'][$options['anonymiser_variable']];
-        $id = eval("return $variables_anonymisation;");
-        $id_auteur = formidable_scramble($id, $id_formulaire);
-    }
-    // On cherche le cookie et sinon on le crée
-    $nom_cookie = formidable_generer_nom_cookie($id_formulaire);
-    if (isset($_COOKIE[$nom_cookie]))
-        $cookie = $_COOKIE[$nom_cookie];
-    else {
-        include_spip("inc/acces");
-        $cookie = creer_uniqid();
-    }
-
-    // On regarde si c'est une modif d'une réponse existante
-    $id_formulaires_reponse = $args['id_formulaires_reponse'];
-
-    // recherche d'éventuelles anciennes réponses
-       $reponses = formidable_verifier_reponse_formulaire(
-                       $id_formulaire, 
-                       $options['identification'], 
-                       ($options['anonymiser'] == 'on') 
-                               ? $options['anonymiser_variable'] 
-                               : false
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function traiter_enregistrement_dist($args, $retours) {
+       include_spip('inc/formidable');
+       include_spip('base/abstract_sql');
+       $options = $args['options'];
+       $formulaire = $args['formulaire'];
+       $id_formulaire = $args['id_formulaire'];
+       $saisies = unserialize($formulaire['saisies']);
+       $saisies = saisies_lister_par_nom($saisies);
+
+       // La personne a-t-elle un compte ?
+       $id_auteur = isset($GLOBALS['visiteur_session']) ? (isset($GLOBALS['visiteur_session']['id_auteur']) ? $GLOBALS['visiteur_session']['id_auteur'] : 0) : 0;
+
+       // traitement de l'anonymisation
+       if ($options['anonymiser'] == 'on') {
+               // mod de l'id_auteur
+               $variables_anonymisation =
+                       $GLOBALS['formulaires']['variables_anonymisation'][$options['anonymiser_variable']];
+               $id = eval("return $variables_anonymisation;");
+               $id_auteur = formidable_scramble($id, $id_formulaire);
+       }
+
+       // On cherche le cookie et sinon on le crée
+       $nom_cookie = formidable_generer_nom_cookie($id_formulaire);
+       if (isset($_COOKIE[$nom_cookie])) {
+               $cookie = $_COOKIE[$nom_cookie];
+       } else {
+               include_spip('inc/acces');
+               $cookie = creer_uniqid();
+       }
+
+       // On regarde si c'est une modif d'une réponse existante
+       $id_formulaires_reponse = $args['id_formulaires_reponse'];
+
+       // recherche d'éventuelles anciennes réponses
+       $reponses = formidable_verifier_reponse_formulaire(
+               $id_formulaire,
+               $options['identification'],
+               ($options['anonymiser'] == 'on')
+                       ? $options['anonymiser_variable']
+                       : false
        );
-       
-    // pas d'id_formulaires_reponse : on cherche une éventuelle réponse en base
-    if ($id_formulaires_reponse == false) {
-       $traitements_formulaire = unserialize($formulaire['traitements']);
-       
-       if (isset($traitements_formulaire['enregistrement'])) {
-               $options =  $traitements_formulaire['enregistrement'];
-
-                       if (isset($options['multiple']) && $options['multiple'] == ''
-                               && isset($options['modifiable']) && $options['modifiable'] == 'on'
+
+       // pas d'id_formulaires_reponse : on cherche une éventuelle réponse en base
+       if ($id_formulaires_reponse == false) {
+               $traitements_formulaire = unserialize($formulaire['traitements']);
+
+               if (isset($traitements_formulaire['enregistrement'])) {
+                       $options =  $traitements_formulaire['enregistrement'];
+
+                       if (isset($options['multiple']) && $options['multiple'] == ''
+                                       && isset($options['modifiable']) && $options['modifiable'] == 'on'
                                        && is_array($reponses) && count($reponses) > 0) {
-                       $id_formulaires_reponse = max($reponses);
-               }
-       }
-    } else {
-       // vérifier que l'auteur est bien l'auteur de la réponse, si non, on invalide l'id_formulaires_reponse
-       if (in_array($id_formulaires_reponse, $reponses) == false) $id_formulaires_reponse = false;
-    }
-    
-    // Si la moderation est a posteriori ou que la personne est un boss, on publie direct
-    if ($options['moderation'] == 'posteriori' or autoriser('instituer', 'formulaires_reponse', $id_formulaires_reponse, null, array('id_formulaire'=>$id_formulaire, 'nouveau_statut'=>'publie')))
-        $statut='publie';
-    else
-        $statut = 'prop';
-
-    // Si ce n'est pas une modif d'une réponse existante, on crée d'abord la réponse
-    if (!$id_formulaires_reponse){
-        $id_formulaires_reponse = sql_insertq(
-            'spip_formulaires_reponses',
-            array(
-                'id_formulaire' => $id_formulaire,
-                'id_auteur' => $id_auteur,
-                'cookie' => $cookie,
-                'ip' => $args['options']['ip'] == 'on' ? $GLOBALS['ip'] : '',
-                'date' => 'NOW()',
-                'statut' => $statut
-            )
-        );
-        // Si on a pas le droit de répondre plusieurs fois ou que les réponses seront modifiables, il faut poser un cookie
-        if (!$options['multiple'] or $options['modifiable']){
-            include_spip("inc/cookie");
-            // Expiration dans 30 jours
-            spip_setcookie($nom_cookie, $_COOKIE[$nom_cookie] = $cookie, time() + 30 * 24 * 3600);
-        }
-    } else {
-       // simple mise à jour du champ maj de la table spip_formulaires_reponses
-       sql_updateq(
-               'spip_formulaires_reponses', 
-               array('maj' => 'NOW()'), 
-               "id_formulaires_reponse = $id_formulaires_reponse"
-       );
-    }
-
-    // Si l'id n'a pas été créé correctement alors erreur
-    if (!($id_formulaires_reponse > 0)){
-        $retours['message_erreur'] .= "\n<br/>"._T('formidable:traiter_enregistrement_erreur_base');
-    }
-    // Sinon on continue à mettre à jour
-    else{
-        $champs = array();
-        $insertions = array();
-        foreach($saisies as $nom => $saisie){
-            // On ne prend que les champs qui ont effectivement été envoyés par le formulaire
-            if (($valeur = _request($nom)) !== null){
-                $champs[] = $nom;
-                $insertions[] = array(
-                    'id_formulaires_reponse' => $id_formulaires_reponse,
-                    'nom' => $nom,
-                    'valeur' => is_array($valeur) ? serialize($valeur) : $valeur
-                );
-            }
-        }
-
-        // S'il y a bien des choses à modifier
-        if ($champs){
-            // On supprime d'abord les champs
-            sql_delete(
-                'spip_formulaires_reponses_champs',
-                array(
-                    'id_formulaires_reponse = '.$id_formulaires_reponse,
-                    sql_in('nom', $champs)
-                )
-            );
-
-            // Puis on insère les nouvelles valeurs
-            sql_insertq_multi(
-                'spip_formulaires_reponses_champs',
-                $insertions
-            );
-        }
-        $retours['message_ok'] .= "\n"._T('formidable:traiter_enregistrement_message_ok');
-             $retours['id_formulaires_reponse'] = $id_formulaires_reponse;
-    }
-
-    // noter qu'on a deja fait le boulot, pour ne pas risquer double appel
-    $retours['traitements']['enregistrement'] = true;
-    return $retours;
+                               $id_formulaires_reponse = max($reponses);
+                       }
+               }
+       } else {
+               // vérifier que l'auteur est bien l'auteur de la réponse, si non, on invalide l'id_formulaires_reponse
+               if (in_array($id_formulaires_reponse, $reponses) == false) {
+                       $id_formulaires_reponse = false;
+               }
+       }
+
+       // Si la moderation est a posteriori ou que la personne est un boss, on publie direct
+       if ($options['moderation'] == 'posteriori'
+               or autoriser('instituer', 'formulaires_reponse', $id_formulaires_reponse, null, array('id_formulaire' => $id_formulaire, 'nouveau_statut' => 'publie'))) {
+               $statut='publie';
+       } else {
+               $statut = 'prop';
+       }
+
+       // Si ce n'est pas une modif d'une réponse existante, on crée d'abord la réponse
+       if (!$id_formulaires_reponse) {
+               $id_formulaires_reponse = sql_insertq(
+                       'spip_formulaires_reponses',
+                       array(
+                               'id_formulaire' => $id_formulaire,
+                               'id_auteur' => $id_auteur,
+                               'cookie' => $cookie,
+                               'ip' => $args['options']['ip'] == 'on' ? $GLOBALS['ip'] : '',
+                               'date' => 'NOW()',
+                               'statut' => $statut
+                       )
+               );
+               // Si on a pas le droit de répondre plusieurs fois ou que les réponses seront modifiables,
+               // il faut poser un cookie
+               if (!$options['multiple'] or $options['modifiable']) {
+                       include_spip('inc/cookie');
+                       // Expiration dans 30 jours
+                       spip_setcookie($nom_cookie, $_COOKIE[$nom_cookie] = $cookie, time() + 30 * 24 * 3600);
+               }
+       } else {
+               // simple mise à jour du champ maj de la table spip_formulaires_reponses
+               sql_updateq(
+                       'spip_formulaires_reponses',
+                       array('maj' => 'NOW()'),
+                       "id_formulaires_reponse = $id_formulaires_reponse"
+               );
+       }
+
+       // Si l'id n'a pas été créé correctement alors erreur
+       if (!($id_formulaires_reponse > 0)) {
+               $retours['message_erreur'] .= "\n<br/>"._T('formidable:traiter_enregistrement_erreur_base');
+       } else {
+               // Sinon on continue à mettre à jour
+               $champs = array();
+               $insertions = array();
+               foreach ($saisies as $nom => $saisie) {
+                       // On ne prend que les champs qui ont effectivement été envoyés par le formulaire
+                       if (($valeur = _request($nom)) !== null) {
+                               $champs[] = $nom;
+                               $insertions[] = array(
+                                       'id_formulaires_reponse' => $id_formulaires_reponse,
+                                       'nom' => $nom,
+                                       'valeur' => is_array($valeur) ? serialize($valeur) : $valeur
+                               );
+                       }
+               }
+
+               // S'il y a bien des choses à modifier
+               if ($champs) {
+                       // On supprime d'abord les champs
+                       sql_delete(
+                               'spip_formulaires_reponses_champs',
+                               array(
+                                       'id_formulaires_reponse = '.$id_formulaires_reponse,
+                                       sql_in('nom', $champs)
+                               )
+                       );
+
+                       // Puis on insère les nouvelles valeurs
+                       sql_insertq_multi(
+                               'spip_formulaires_reponses_champs',
+                               $insertions
+                       );
+               }
+               if (!isset($retours['message_ok'])) {
+                       $retours['message_ok'] = '';
+               }
+               $retours['message_ok'] .= "\n"._T('formidable:traiter_enregistrement_message_ok');
+               $retours['id_formulaires_reponse'] = $id_formulaires_reponse;
+       }
+
+       // noter qu'on a deja fait le boulot, pour ne pas risquer double appel
+       $retours['traitements']['enregistrement'] = true;
+       return $retours;
 }
 
-function traiter_enregistrement_update_dist($id_formulaire, $traitement, $saisies_anciennes, $saisies_nouvelles){
-    include_spip('inc/saisies');
-    include_spip('base/abstract_sql');
-    $comparaison = saisies_comparer($saisies_anciennes, $saisies_nouvelles);
-
-    // Si des champs ont été supprimés, il faut supprimer les réponses à ces champs
-    if ($comparaison['supprimees']){
-        // On récupère les réponses du formulaire
-        $reponses = sql_allfetsel(
-            'id_formulaires_reponse',
-            'spip_formulaires_reponses',
-            'id_formulaire = '.$id_formulaire
-        );
-        $reponses = array_map('reset', $reponses);
-
-        // Tous les noms de champs à supprimer
-        $noms = array_keys($comparaison['supprimees']);
-
-        // On supprime
-        sql_delete(
-            'spip_formulaires_reponses_champs',
-            array(
-                sql_in('id_formulaires_reponse', $reponses),
-                sql_in('nom', $noms)
-            )
-        );
-    }
+function traiter_enregistrement_update_dist($id_formulaire, $traitement, $saisies_anciennes, $saisies_nouvelles) {
+       include_spip('inc/saisies');
+       include_spip('base/abstract_sql');
+       $comparaison = saisies_comparer($saisies_anciennes, $saisies_nouvelles);
+
+       // Si des champs ont été supprimés, il faut supprimer les réponses à ces champs
+       if ($comparaison['supprimees']) {
+               // On récupère les réponses du formulaire
+               $reponses = sql_allfetsel(
+                       'id_formulaires_reponse',
+                       'spip_formulaires_reponses',
+                       'id_formulaire = '.$id_formulaire
+               );
+               $reponses = array_map('reset', $reponses);
+
+               // Tous les noms de champs à supprimer
+               $noms = array_keys($comparaison['supprimees']);
+
+               // On supprime
+               sql_delete(
+                       'spip_formulaires_reponses_champs',
+                       array(
+                               sql_in('id_formulaires_reponse', $reponses),
+                               sql_in('nom', $noms)
+                       )
+               );
+       }
 }
-
-?>
index f28a5ca..55e9220 100644 (file)
@@ -1,19 +1,22 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/autoriser');
 
-function action_editer_gis_dist($arg=null) {
-       if (is_null($arg)){
+function action_editer_gis_dist($arg = null) {
+       if (is_null($arg)) {
                $securiser_action = charger_fonction('securiser_action', 'inc');
                $arg = $securiser_action();
        }
-       
+
        // si id_gis n'est pas un nombre, c'est une creation
        if (!$id_gis = intval($arg)) {
-               if (!autoriser('creer','gis') or !$id_gis = gis_inserer())
-                       return array(false,_L('echec'));
+               if (!autoriser('creer', 'gis') or !$id_gis = gis_inserer()) {
+                       return array(false, _L('echec'));
+               }
        }
        $err = gis_modifier($id_gis);
        return array($id_gis,$err);
@@ -21,12 +24,12 @@ function action_editer_gis_dist($arg=null) {
 
 /**
  * Fonction d'insertion d'un gis vide
- * 
+ *
  * @return int/false $id_gis : l'identifiant numérique du point ou false en cas de non création
  */
 function gis_inserer() {
        $champs = array();
-       
+
        // Envoyer aux plugins
        $champs = pipeline('pre_insertion', array(
                'args' => array(
@@ -34,10 +37,11 @@ function gis_inserer() {
                ),
                'data' => $champs
        ));
-       
-       $id_gis = sql_insertq("spip_gis", $champs);
-       
-       pipeline('post_insertion',
+
+       $id_gis = sql_insertq('spip_gis', $champs);
+
+       pipeline(
+               'post_insertion',
                array(
                        'args' => array(
                                'table' => 'spip_gis',
@@ -50,66 +54,61 @@ function gis_inserer() {
 }
 
 /**
- *  Enregistrer certaines modifications d'un gis
- * 
- * @param int $id_gis : l'identifiant numérique du point
- * @param array $c : un array des valeurs à mettre en base (par défaut false, on récupère les valeurs passées en dans le POST)
- */
-/**
+ * Enregistrer certaines modifications d'un gis
+ *
  * Appelle toutes les fonctions de modification d'un point gis
  * $err est de la forme chaine de langue ou vide si pas d'erreur
  * http://doc.spip.org/@articles_set
  *
- * @param  $id_gis
- * @param null $set
+ * @param int $id_gis l'identifiant numérique du point
+ * @param null/array $set un array des valeurs à mettre en base (par défaut false, on récupère les valeurs passées en dans le POST)
  * @return string
  */
-function gis_modifier($id_gis, $set=null) {
+function gis_modifier($id_gis, $set = null) {
        include_spip('inc/modifier');
        include_spip('inc/filtres');
        $c = collecter_requests(
                // white list
-               objet_info('gis','champs_editables'),
+               objet_info('gis', 'champs_editables'),
                // black list
                array('id_objet','objet'),
                // donnees eventuellement fournies
                $set
        );
 
-       if(isset($c['lon'])){
-               if($c['lon'] > 180){
-                       while($c['lon'] > 180){
+       if (isset($c['lon'])) {
+               if ($c['lon'] > 180) {
+                       while ($c['lon'] > 180) {
                                $c['lon'] = $c['lon'] - 360;
                        }
-               }else if($c['lon'] <= -180){
-                       while($c['lon'] <= -180){
+               } elseif ($c['lon'] <= -180) {
+                       while ($c['lon'] <= -180) {
                                $c['lon'] = $c['lon'] + 360;
                        }
                }
        }
-       if(isset($c['lat'])){
-               if($c['lat'] > 90){
-                       while($c['lat'] > 90){
+       if (isset($c['lat'])) {
+               if ($c['lat'] > 90) {
+                       while ($c['lat'] > 90) {
                                $c['lat'] = $c['lat'] - 180;
                        }
-               }else if($c['lat'] <= -90){
-                       while($c['lat'] <= -90){
+               } elseif ($c['lat'] <= -90) {
+                       while ($c['lat'] <= -90) {
                                $c['lat'] = $c['lat'] + 180;
                        }
                }
        }
-       if ($err = objet_modifier_champs('gis', $id_gis,
-               array(
+       if ($err = objet_modifier_champs('gis', $id_gis, array(
                        //'nonvide' => array('nom' => _T('info_sans_titre')),
                        'data' => $set,
                        'invalideur' => "id='gis/$id_gis'",
-               ),
-               $c))
+               ), $c)) {
                return $err;
+       }
 
        // lier a un parent ?
-       $c = collecter_requests(array('id_objet', 'objet'),array(),$set);
-       if (isset($c['id_objet']) AND intval($c['id_objet']) AND isset($c['objet']) AND $c['objet']) {
+       $c = collecter_requests(array('id_objet', 'objet'), array(), $set);
+       if (isset($c['id_objet']) and intval($c['id_objet']) and isset($c['objet']) and $c['objet']) {
                lier_gis($id_gis, $c['objet'], $c['id_objet']);
        }
 
@@ -131,7 +130,7 @@ function gis_modifier($id_gis, $set=null) {
  * @param array $qualif
  * @return string
  */
-function gis_associer($id_gis,$objets, $qualif = null){
+function gis_associer($id_gis, $objets, $qualif = null) {
        include_spip('action/editer_liens');
        $res = objet_associer(array('gis'=>$id_gis), $objets, $qualif);
        include_spip('inc/invalideur');
@@ -150,27 +149,25 @@ function gis_associer($id_gis,$objets, $qualif = null){
  * @param array $objets
  * @return string
  */
-function gis_dissocier($id_gis,$objets){
+function gis_dissocier($id_gis, $objets) {
        include_spip('action/editer_liens');
-       $res = objet_dissocier(array('gis'=>$id_gis), $objets);
+       $res = objet_dissocier(array('gis' => $id_gis), $objets);
        include_spip('inc/invalideur');
        suivre_invalideur("id='gis/$id_gis'");
        return $res;
 }
 
-
-
 /**
  * Supprimer définitivement un point géolocalisé
- * 
+ *
  * @param int $id_gis identifiant numérique du point
  * @return int|false 0 si réussite, false dans le cas ou le point n'existe pas
  */
-function gis_supprimer($id_gis){
-       $valide = sql_getfetsel('id_gis','spip_gis','id_gis='.intval($id_gis));
-       if($valide && autoriser('supprimer','gis',$valide)){
-               sql_delete("spip_gis_liens", "id_gis=".intval($id_gis));
-               sql_delete("spip_gis", "id_gis=".intval($id_gis));
+function gis_supprimer($id_gis) {
+       $valide = sql_getfetsel('id_gis', 'spip_gis', 'id_gis=' . intval($id_gis));
+       if ($valide && autoriser('supprimer', 'gis', $valide)) {
+               sql_delete('spip_gis_liens', 'id_gis=' . intval($id_gis));
+               sql_delete('spip_gis', 'id_gis=' . intval($id_gis));
                $id_gis = 0;
                include_spip('inc/invalideur');
                suivre_invalideur("id='id_gis/$id_gis'");
@@ -179,7 +176,6 @@ function gis_supprimer($id_gis){
        return false;
 }
 
-
 /**
  * Délier un point géolocalisé d'un objet SPIP
  *
@@ -189,13 +185,13 @@ function gis_supprimer($id_gis){
  *
  * @return bool : true si la suppression de la liaison s'est bien passée, false à l'inverse
  */
-function delier_gis($id_gis, $objet, $id_objet){
+function delier_gis($id_gis, $objet, $id_objet) {
        //$objet = objet_type($objet);
-       if ($id_objet AND $id_gis
-       AND preg_match('/^[a-z0-9_]+$/i', $objet) # securite
-       AND autoriser('delier','gis',$id_gis,$GLOBALS['visiteur_session'],array('objet' => $objet,'id_objet'=>$id_objet))
+       if ($id_objet and $id_gis
+               and preg_match('/^[a-z0-9_]+$/i', $objet) # securite
+               and autoriser('delier', 'gis', $id_gis, $GLOBALS['visiteur_session'], array('objet' => $objet,'id_objet'=>$id_objet))
        ) {
-               gis_dissocier($id_gis,array($objet=>$id_objet));
+               gis_dissocier($id_gis, array($objet => $id_objet));
                return true;
        }
        return false;
@@ -210,21 +206,25 @@ function delier_gis($id_gis, $objet, $id_objet){
  *
  * @return bool : true si la liaison s'est bien passée, false à l'inverse
  */
-function lier_gis($id_gis, $objet, $id_objet){
+function lier_gis($id_gis, $objet, $id_objet) {
        //$objet = objet_type($objet);
-       if ($id_objet AND $id_gis
-       AND preg_match('/^[a-z0-9_]+$/i', $objet) # securite
-       AND !sql_getfetsel("id_gis", "spip_gis_liens", "id_gis=$id_gis AND id_objet=$id_objet AND objet=".sql_quote($objet))
-       AND autoriser('lier','gis',$id_gis,$GLOBALS['visiteur_session'],array('objet' => $objet,'id_objet'=>$id_objet))
+       if ($id_objet and $id_gis
+               and preg_match('/^[a-z0-9_]+$/i', $objet) # securite
+               and !sql_getfetsel('id_gis', 'spip_gis_liens', "id_gis=$id_gis AND id_objet=$id_objet AND objet=".sql_quote($objet))
+               and autoriser('lier', 'gis', $id_gis, $GLOBALS['visiteur_session'], array('objet' => $objet,'id_objet'=>$id_objet))
        ) {
-               gis_associer($id_gis,array($objet=>$id_objet));
+               gis_associer($id_gis, array($objet=>$id_objet));
                return true;
        }
        return false;
 }
 
-function insert_gis() {return gis_inserer();}
-function revisions_gis($id_gis, $c=false) {return gis_modifier($id_gis,$c);}
-function supprimer_gis($id_gis){return gis_supprimer($id_gis);}
-
-?>
+function insert_gis() {
+       return gis_inserer();
+}
+function revisions_gis($id_gis, $c = false) {
+       return gis_modifier($id_gis, $c);
+}
+function supprimer_gis($id_gis) {
+       return gis_supprimer($id_gis);
+}
index f5633d3..46fd07f 100644 (file)
@@ -1,21 +1,22 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 
-function action_editer_lien_gis_dist(){
+function action_editer_lien_gis_dist() {
        $securiser_action = charger_fonction('securiser_action', 'inc');
        $arg = $securiser_action();
-       list($action,$id_gis, $objet, $id_objet) = explode('/',$arg);
-       
+       list($action,$id_gis, $objet, $id_objet) = explode('/', $arg);
+
        include_spip('inc/autoriser');
-       if (intval($id_gis) AND autoriser('lier','gis',$id_gis,$GLOBALS['visiteur_session'],array('objet' => $objet,'id_objet'=>$id_objet))){
+       if (intval($id_gis) and autoriser('lier', 'gis', $id_gis, $GLOBALS['visiteur_session'], array('objet' => $objet,'id_objet'=>$id_objet))) {
                include_spip('action/editer_gis');
-               if ($action == 'lier')
+               if ($action == 'lier') {
                        lier_gis($id_gis, $objet, $id_objet);
-               elseif ($action == 'delier')
+               } elseif ($action == 'delier') {
                        delier_gis($id_gis, $objet, $id_objet);
+               }
        }
 }
-
-?>
\ No newline at end of file
index 2419d98..0fc48fb 100644 (file)
@@ -1,28 +1,49 @@
 <?php
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-include_spip("inc/distant");
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+include_spip('inc/distant');
 
 /**
  * Proxy vers le service Nomatim d'OpenStreetMap.
  *
  * Cette fonction permet de transmettre une requete auprès du service
  * de recherche d'adresse d'OpenStreetMap (Nomatim).
- * 
+ *
  * Seuls les arguments spécifiques à Nomatim sont transmis.
  */
 function action_gis_geocoder_rechercher_dist() {
-       include_spip("inc/modifier");
+       include_spip('inc/modifier');
 
-       $mode = _request("mode");
-       if(!$mode || !in_array($mode, array("search", "reverse")))
+       $mode = _request('mode');
+       if (!$mode || !in_array($mode, array('search', 'reverse'))) {
                return;
+       }
 
        /* On filtre les arguments à renvoyer à Nomatim (liste blanche) */
-       $arguments = collecter_requests(array("json_callback", "format", "q", "limit", "addressdetails", "accept-language", "lat", "lon"), array());
+       $arguments = collecter_requests(array('json_callback', 'format', 'q', 'limit', 'addressdetails', 'accept-language', 'lat', 'lon'), array());
+
+       $geocoder = defined('_GIS_GEOCODER') ? _GIS_GEOCODER : 'nominatim';
 
-       if(!empty($arguments)) {
+       if (!empty($arguments) && in_array($geocoder, array('photon','nominatim'))) {
                header('Content-Type: application/json; charset=UTF-8');
-               echo recuperer_page("http://nominatim.openstreetmap.org/{$mode}?" . http_build_query($arguments));
+               if ($geocoder == 'photon') {
+                       if (isset($arguments['accept-language'])) {
+                               $arguments['lang'] = $arguments['accept-language'];
+                               unset($arguments['accept-language']);
+                       }
+                       if ($mode == 'search') {
+                               $mode = 'api/';
+                       } else {
+                               $mode = 'reverse';
+                       }
+                       $url = 'http://photon.komoot.de/';
+               } else {
+                       $url = 'http://nominatim.openstreetmap.org/';
+               }
+
+               $url = defined('_GIS_GEOCODER_URL') ? _GIS_GEOCODER_URL : $url;
+               $data = recuperer_page("{$url}{$mode}?" . http_build_query($arguments));
+               echo $data;
        }
 }
index eda2049..aada771 100644 (file)
@@ -1,61 +1,61 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/charsets');  # pour le nom de fichier
 include_spip('inc/actions');
 
-function action_kml_infos_dist(){
+function action_kml_infos_dist() {
        global $redirect;
 
        $securiser_action = charger_fonction('securiser_action', 'inc');
        $arg = $securiser_action();
 
-       if (!preg_match(",^(-?)(\d+)\W(\w+)\W?(\d*)\W?(\d*)$,", $arg, $r)){
-               spip_log("action_kml_infos_dist incompris: " . $arg);
+       if (!preg_match(',^(-?)(\d+)\W(\w+)\W?(\d*)\W?(\d*)$,', $arg, $r)) {
+               spip_log('action_kml_infos_dist incompris: ' . $arg);
                $redirect = urldecode(_request('redirect'));
                return;
-       }
-       else{
+       } else {
                action_kml_infos_post($r);
        }
 }
 
-function action_kml_infos_post($r){
+function action_kml_infos_post($r) {
        list(, $sign, $id_objet, $objet, $id_document, $suite) = $r;
 
-       if(intval($id_document)){
-               $recuperer_info = charger_fonction('kml_infos','inc');
+       if (intval($id_document)) {
+               $recuperer_info = charger_fonction('kml_infos', 'inc');
                $infos = $recuperer_info($id_document);
-               if($infos){
+               if ($infos) {
                        include_spip('inc/documents');
-                       $fichier = sql_getfetsel('fichier','spip_documents','id_document='.intval($id_document));
-                       if(is_numeric($latitude = $infos['latitude']) && is_numeric($longitude = $infos['longitude'])){
+                       $fichier = sql_getfetsel('fichier', 'spip_documents', 'id_document='.intval($id_document));
+                       if (is_numeric($latitude = $infos['latitude']) and is_numeric($longitude = $infos['longitude'])) {
                                $c = array(
                                        'titre' => $infos['titre'] ? $infos['titre'] : basename($fichier),
                                        'lat'=> $latitude,
                                        'lon' => $longitude,
                                        'zoom' => $config['zoom'] ? $config['zoom'] :'4'
                                );
-               
+
                                include_spip('action/editer_gis');
-       
-                               if($id_gis = sql_getfetsel("G.id_gis","spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis ","T.id_objet=" . intval($id_document) . " AND T.objet='document'")){
+
+                               if ($id_gis = sql_getfetsel('G.id_gis', 'spip_gis AS G LEFT JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis', 'T.id_objet=' . intval($id_document) . " AND T.objet='document'")) {
                                        // Des coordonnées sont déjà définies pour ce document => on les update
-                                       revisions_gis($id_gis,$c);
-                                       spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
-                               }
-                               else{
+                                       revisions_gis($id_gis, $c);
+                                       spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
+                               } else {
                                        // Aucune coordonnée n'est définie pour ce document  => on les crées
                                        $id_gis = insert_gis();
-                                       revisions_gis($id_gis,$c);
+                                       revisions_gis($id_gis, $c);
                                        lier_gis($id_gis, 'document', $id_document);
-                                       spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
+                                       spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
                                }
                        }
                        unset($infos['longitude']);
                        unset($infos['latitude']);
-                       if(count($infos) > 0){
+                       if (count($infos) > 0) {
                                include_spip('action/editer_document');
                                document_modifier($id_document, $infos);
                        }
@@ -64,5 +64,3 @@ function action_kml_infos_post($r){
        $redirect = urldecode(_request('redirect'));
        return $redirect;
 }
-
-?>
\ No newline at end of file
index 6c838f2..a5a8f6a 100644 (file)
@@ -1,19 +1,19 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
 
+function action_supprimer_gis_dist() {
 
-function action_supprimer_gis_dist(){
-       
        $securiser_action = charger_fonction('securiser_action', 'inc');
        $arg = $securiser_action();
-       
-       list($id_gis) = preg_split(',[^0-9],',$arg);
+
+       list($id_gis) = preg_split(',[^0-9],', $arg);
        include_spip('inc/autoriser');
-       if (intval($id_gis) AND autoriser('supprimer','gis',$id_gis)){
-               include_spip("action/editer_gis");
+       if (intval($id_gis) and autoriser('supprimer', 'gis', $id_gis)) {
+               include_spip('action/editer_gis');
                supprimer_gis($id_gis);
        }
 }
-
-?>
\ No newline at end of file
index 89aa1cb..5764755 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function gis_declarer_tables_interfaces($interface){
+function gis_declarer_tables_interfaces($interface) {
        $interface['table_des_tables']['gis'] = 'gis';
        $interface['table_des_tables']['gis_liens'] = 'gis_liens';
 
@@ -21,7 +23,7 @@ function gis_declarer_tables_interfaces($interface){
        return $interface;
 }
 
-function gis_declarer_tables_objets_sql($tables){
+function gis_declarer_tables_objets_sql($tables) {
        /* Declaration de la table de points gis */
        $tables['spip_gis'] = array(
                /* Declarations principales */
@@ -32,22 +34,27 @@ function gis_declarer_tables_objets_sql($tables){
 
                /* La table */
                'field' => array(
-                       "id_gis" => "bigint(21) NOT NULL",
-                       "titre" => "text NOT NULL DEFAULT ''",
-                       "descriptif" => "text NOT NULL DEFAULT ''",
-                       "lat" => "double NULL NULL",
-                       "lon" => "double NULL NULL",
-                       "zoom" => "tinyint(4) NULL NULL",
-                       "adresse" => "text NOT NULL DEFAULT ''",
-                       "pays" => "text NOT NULL DEFAULT ''",
-                       "code_pays" => "varchar(255) NOT NULL DEFAULT ''",
-                       "region" => "text NOT NULL DEFAULT ''",
-                       "departement" => "text NOT NULL DEFAULT ''",
-                       "ville" => "text NOT NULL DEFAULT ''",
-                       "code_postal" => "varchar(255) NOT NULL DEFAULT ''"
+                       'id_gis' => 'bigint(21) NOT NULL',
+                       'titre' => "text NOT NULL DEFAULT ''",
+                       'descriptif' => "text NOT NULL DEFAULT ''",
+                       'lat' => 'double NULL NULL',
+                       'lon' => 'double NULL NULL',
+                       'zoom' => 'tinyint(4) NULL NULL',
+                       'adresse' => "text NOT NULL DEFAULT ''",
+                       'pays' => "text NOT NULL DEFAULT ''",
+                       'code_pays' => "varchar(255) NOT NULL DEFAULT ''",
+                       'region' => "text NOT NULL DEFAULT ''",
+                       'departement' => "text NOT NULL DEFAULT ''",
+                       'ville' => "text NOT NULL DEFAULT ''",
+                       'code_postal' => "varchar(255) NOT NULL DEFAULT ''",
+                       'color' => "varchar(25) NOT NULL DEFAULT ''",
+                       'weight' => "varchar(4) NOT NULL DEFAULT ''",
+                       'opacity' => "varchar(4) NOT NULL DEFAULT ''",
+                       'fillcolor' => "varchar(25) NOT NULL DEFAULT ''",
+                       'fillopacity' => "varchar(4) NOT NULL DEFAULT ''"
                ),
                'key' => array(
-                       "PRIMARY KEY" => "id_gis",
+                       'PRIMARY KEY' => 'id_gis',
                        'KEY lat' => 'lat',
                        'KEY lon' => 'lon',
                        'KEY pays' => 'pays(500)',
@@ -58,7 +65,7 @@ function gis_declarer_tables_objets_sql($tables){
                        'KEY code_postal' => 'code_postal',
                ),
                'join' => array(
-                               "id_gis"=>"id_gis"
+                               'id_gis' => 'id_gis'
                ),
                'principale' => 'oui',
                'modeles' => array('carte_gis', 'carte_gis_preview'),
@@ -71,8 +78,9 @@ function gis_declarer_tables_objets_sql($tables){
                'url_voir' => 'gis',
                'url_edit' => 'gis_edit',
                'editable' => 'oui',
-               'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
-               'champs_versionnes' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
+               'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays', 'color', 'weight', 'opacity', 'fillcolor', 'fillopacity'),
+               'champs_versionnes' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays', 'color', 'weight', 'opacity', 'fillcolor', 'fillopacity'),
+               'champs_critere_gis' => array('gis.titre AS titre_gis', 'gis.descriptif AS descriptif_gis', 'gis.adresse AS adresse_gis', 'gis.pays AS pays_gis', 'gis.code_pays AS code_pays_gis', 'gis.region AS region_gis', 'gis.departement AS departement_gis', 'gis.ville AS ville_gis', 'gis.code_postal AS code_postal_gis'),
                'icone_objet' => 'gis',
                'rechercher_champs' => array(
                        'titre' => 8,
@@ -115,17 +123,17 @@ function gis_declarer_tables_objets_sql($tables){
        return $tables;
 }
 
-function gis_declarer_tables_auxiliaires($tables_auxiliaires){
+function gis_declarer_tables_auxiliaires($tables_auxiliaires) {
        $spip_gis_liens = array(
-               "id_gis" => "bigint(21) NOT NULL",
-               "objet" => "VARCHAR (25) DEFAULT '' NOT NULL",
-               "id_objet" => "bigint(21) NOT NULL");
+               'id_gis' => 'bigint(21) NOT NULL',
+               'objet' => "VARCHAR (25) DEFAULT '' NOT NULL",
+               'id_objet' => 'bigint(21) NOT NULL');
 
        $spip_gis_liens_key = array(
-               "PRIMARY KEY" => "id_gis,id_objet,objet",
-               "KEY id_gis" => "id_gis",
-               "KEY id_objet" => "id_objet",
-               "KEY objet" => "objet"
+               'PRIMARY KEY' => 'id_gis,id_objet,objet',
+               'KEY id_gis' => 'id_gis',
+               'KEY id_objet' => 'id_objet',
+               'KEY objet' => 'objet'
        );
 
        $tables_auxiliaires['spip_gis_liens'] = array(
@@ -134,5 +142,3 @@ function gis_declarer_tables_auxiliaires($tables_auxiliaires){
 
        return $tables_auxiliaires;
 }
-
-?>
index ab9e955..602d3b8 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('action/editer_gis');
 
@@ -11,34 +13,35 @@ include_spip('action/editer_gis');
 /**
  * Create :
  * Crée un point géolocalisé
- * 
+ *
  * @param $dummy
  * @param array $set : Le contenu des champs à mettre en base
- * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id créé 
+ * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id créé
  */
-function crud_gis_create_dist($dummy,$set=null){
-       if (autoriser('voir','gis') && $id = gis_inserer())
-               $err = gis_modifier($id,$set);
-       else
-               $err = _T('crud:erreur_creation',array('objet'=>'gis'));
-       return array('success'=>($err && strlen($err)>0)?false:true,'message'=>$err,'result'=>array('id'=>$id));
+function crud_gis_create_dist($dummy, $set = null) {
+       if (autoriser('voir', 'gis') and $id = gis_inserer()) {
+               $err = gis_modifier($id, $set);
+       } else {
+               $err = _T('crud:erreur_creation', array('objet' => 'gis'));
+       }
+       return array('success' => ($err and strlen($err) > 0) ? false : true, 'message' => $err, 'result' => array('id' => $id));
 }
 
 /**
  * Update :
  * Met à jour un point géolocalisé
- * 
+ *
  * @param $dummy
  * @param array $set : Le contenu des champs à mettre en base
- * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id créé 
+ * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id créé
  */
-function crud_gis_update_dist($id,$set=null){
-       $id_gis = sql_getfetsel('id_gis','spip_gis','id_gis='.intval($id));
-       if(!$id_gis){
-               $err = _T('gis:erreur_gis_inconnu',array('id'=>$id));
-       }else if(autoriser('modifier','gis',$id)){
-               $err = gis_modifier($id,$set);
-       }else{
+function crud_gis_update_dist($id, $set = null) {
+       $id_gis = sql_getfetsel('id_gis', 'spip_gis', 'id_gis=' . intval($id));
+       if (!$id_gis) {
+               $err = _T('gis:erreur_gis_inconnu', array('id'=>$id));
+       } elseif (autoriser('modifier', 'gis', $id)) {
+               $err = gis_modifier($id, $set);
+       } else {
                $err = _L('update error');
        }
        return array('success'=>($err && strlen($err)>0)?false:true,'message'=>$err,'result'=>array('id'=>$id));
@@ -47,16 +50,14 @@ function crud_gis_update_dist($id,$set=null){
 /**
  * Delete :
  * Supprime un point géolocalisé
- * 
+ *
  * @param $dummy
  * @param int $id : L'identifiant numérique du point à supprimer
- * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id supprimé 
+ * @return array : un array avec (bool) success, (string) message et (array) result indiquant l'id supprimé
  */
-function crud_gis_delete_dist($id){
-       if(autoriser('supprimer','gis',$id)){
+function crud_gis_delete_dist($id) {
+       if (autoriser('supprimer', 'gis', $id)) {
                $err = gis_supprimer($id);
        }
-       return array('success'=>is_numeric($err)?true:false,'message'=>$err,'result'=>array('id'=>$id));
+       return array('success' => is_numeric($err) ? true : false, 'message' => $err, 'result' => array('id' => $id));
 }
-
-?>
\ No newline at end of file
diff --git a/www/plugins/gis/css/leaflet_nodirection.css b/www/plugins/gis/css/leaflet_nodirection.css
new file mode 100644 (file)
index 0000000..35cf734
--- /dev/null
@@ -0,0 +1,19 @@
+.leaflet-map-pane,
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-tile-pane,
+.leaflet-tile-container,
+.leaflet-overlay-pane,
+.leaflet-shadow-pane,
+.leaflet-marker-pane,
+.leaflet-popup-pane,
+.leaflet-overlay-pane svg,
+.leaflet-zoom-box,
+.leaflet-image-layer,
+.leaflet-layer {
+       position: absolute;
+       left: 0;
+       top: 0;
+       right:auto;
+       }
\ No newline at end of file
index 7ad44a3..7531956 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * On inclue le fichier de pipelines pour avoir les fonctions:
@@ -8,5 +10,3 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * gis_insert_head
  */
 include_spip('gis_pipelines');
-
-?>
index d612571..132009a 100755 (executable)
                        label=<:gis:cfg_lbl_api_key_bing:>,
                        explication=<:gis:cfg_inf_bing{url=https://www.bingmapsportal.com/}:>,
                        size=40})]
+                       
+               [(#SAISIE{input,api_key_google,
+                       label=<:gis:cfg_lbl_api_key_google:>,
+                       explication=<:gis:cfg_inf_google{url=https://developers.google.com/maps/documentation/javascript/get-api-key}:>,
+                       size=40})]
        
                [(#SAISIE{oui_non,geocoder,
                        defaut='',
                        label=<:gis:cfg_lbl_adresse:>,
                        explication=<:gis:cfg_inf_adresse:>})]
                
+               [(#PLUGIN{gisgeom}|oui)
+               [(#SAISIE{oui_non,styles,
+                       defaut='',
+                       label=<:gis:cfg_lbl_styles:>,
+                       explication=<:gis:cfg_inf_styles:>})]
+               ]
+               
                [(#SAISIE{oui_non,geolocaliser_user_html5,
                        defaut='',
                        label=<:gis:cfg_lbl_geolocaliser_user_html5:>,
        function geocode(query) {
                if(!query.error)
                        maj_inputs(map,query,'geocoding');
-               else
-                       alert('<:gis:erreur_geocoder:> '+query.search);
+               else{
+                       if(query.search == 'undefined'){
+                               alert('<:gis:erreur_geocoder:>\n'+query.search);
+                       }else{
+                               alert('<:gis:erreur_geocoder:>');
+                       }
+               }
        }
 
        var init_config = function() {
index 23999bd..4da15a8 100644 (file)
@@ -1,37 +1,38 @@
-<?php 
+<?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Fonction de verification du formulaire de configuration
  * - On vérifie que la clé Bing est présente si cette couche est sélectionnée
  */
-function formulaires_configurer_gis_verifier_dist(){
+function formulaires_configurer_gis_verifier_dist() {
        $erreurs = array();
        $layers = _request('layers');
        if (!is_array($layers)) {
                $layers = array();
        }
 
-       if ((_request('layer_defaut') == 'bing_aerial') OR in_array('bing_aerial', $layers)){
+       if ((_request('layer_defaut') == 'bing_aerial') or in_array('bing_aerial', $layers)) {
                $obligatoire = 'api_key_bing';
-               if (!_request($obligatoire)){
+               if (!_request($obligatoire)) {
                        $erreurs[$obligatoire] = _T('info_obligatoire');
                }
        }
-       
+
        // S'il n'y a pas d'erreur on va chercher l'ancienne couche par défaut pour voir si elle a changé
-       if (empty($erreurs)){
+       if (empty($erreurs)) {
                include_spip('inc/config');
                $layer_defaut = lire_config('gis/layer_defaut');
                // Si on change la couche par défaut ou si une couche google est présente dans la conf, le formulaire ne doit pas etre traiter en ajax
                if ((_request('layer_defaut') != $layer_defaut)
-                       OR (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), $layers)) > 0)
-                       OR (in_array('bing_aerial', $layers)))
+                       or (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), $layers)) > 0)
+                       or (in_array('bing_aerial', $layers))) {
                        refuser_traiter_formulaire_ajax();
+               }
        }
-       
+
        return $erreurs;
 }
-
-?>
index 0f3db59..7a560f7 100755 (executable)
@@ -1,17 +1,20 @@
 #CACHE{0}
 <div class="formulaire_spip formulaire_editer formulaire_editer_gis">
-       <!-- br class='spacer' / -->
        [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
        [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
        <BOUCLE_editable(CONDITION){si #ENV{editable}}>
-       <form method='post' action='#ENV{action}' enctype='multipart/form-data' name='formulaire_editer_gis' id='formulaire_editer_gis'><div>
+       <form method="post" action="#ENV{action}" enctype="multipart/form-data" name="formulaire_editer_gis" id="formulaire_editer_gis"><div>
                [(#REM) declarer les hidden qui declencheront le service du formulaire 
                parametre : url d'action ]
                #ACTION_FORMULAIRE{#ENV{action}}
                <[(#VAL{ul}|saisie_balise_structure_formulaire)] class="editer-groupe">
                        [(#SAISIE{hidden,objet})]
                        [(#SAISIE{hidden,id_objet})]
-                       [(#SAISIE{carte,editer_gis_#ENV{id_gis},env})]
+                       <[(#VAL{li}|saisie_balise_structure_formulaire)] class="fieldset">
+                       <fieldset><[(#VAL{ul}|saisie_balise_structure_formulaire)]>
+                               [(#SAISIE{carte,editer_gis_#ENV{id_gis},env})]
+                       </[(#VAL{ul}|saisie_balise_structure_formulaire)]></fieldset>
+                       </[(#VAL{li}|saisie_balise_structure_formulaire)]>
                        <[(#VAL{li}|saisie_balise_structure_formulaire)] class="fieldset">
                        <fieldset><[(#VAL{ul}|saisie_balise_structure_formulaire)]>
                                [(#SAISIE{input,lat,
                                [(#SAISIE{input,code_pays,
                                        label=<:gis:label_code_pays:>})]
                        </[(#VAL{ul}|saisie_balise_structure_formulaire)]></fieldset>
-                       </[(#VAL{li}|saisie_balise_structure_formulaire)]>
+                       </[(#VAL{li}|saisie_balise_structure_formulaire)]>[
+                       (#PLUGIN{gisgeom}|et{#CONFIG{gis/styles}|=={on}}|oui|et{#TYPE|!={Point}|ou{#TYPE|=={''}}})
+                       <[(#VAL{li}|saisie_balise_structure_formulaire)] class="fieldset styles">
+                       <fieldset><[(#VAL{ul}|saisie_balise_structure_formulaire)]>
+                               [(#SAISIE{input,color,
+                                       label=<:gis:label_color:>,
+                                       explication=<:gis:explication_color:>,
+                                       class=palette})]
+                               [(#SAISIE{input,weight,
+                                       label=<:gis:label_weight:>,
+                                       explication=<:gis:explication_weight:>})]
+                               [(#SAISIE{input,opacity,
+                                       label=<:gis:label_opacity:>,
+                                       explication=<:gis:explication_opacity:>})]
+                               [(#SAISIE{input,fillcolor,
+                                       label=<:gis:label_fillcolor:>,
+                                       explication=<:gis:explication_fillcolor:>,
+                                       class=palette})]
+                               [(#SAISIE{input,fillopacity,
+                                       label=<:gis:label_fillopacity:>,
+                                       explication=<:gis:explication_fillopacity:>})]
+                       </[(#VAL{ul}|saisie_balise_structure_formulaire)]></fieldset>
+                       </[(#VAL{li}|saisie_balise_structure_formulaire)]>]
                </[(#VAL{ul}|saisie_balise_structure_formulaire)]>
                [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
                <!--extra-->
-               <p class='boutons'[ style="direction: (#LANG_DIR|=={ltr}|?{rtl,ltr})"]>
-                       <input class='submit' type='submit' name='enregistrer' value='<:bouton_enregistrer:>' />
+               <p class="boutons"[ style="direction: (#LANG_DIR|=={ltr}|?{rtl,ltr})"]>
+                       <input class="submit" type="submit" name="enregistrer" value="<:bouton_enregistrer:>" />
                </p>
        </div></form>
        </BOUCLE_editable>
index 22619dd..1806b43 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Formulaire de création et d'édition d'un point géolocalisé
@@ -11,7 +13,7 @@ include_spip('inc/editer');
 
 /**
  * Chargement des valeurs par défaut du formulaire
- * 
+ *
  * @param int|string $id_gis Identifiant numérique du point ou 'new' pour un nouveau
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
@@ -19,42 +21,52 @@ include_spip('inc/editer');
  * @param string $ajaxload initialiser la carte à chaque onAjaxLoad()
  * @param array $options TODO à documenter, voir avec l'auteur de http://zone.spip.org/trac/spip-zone/changeset/53906
  */
-function formulaires_editer_gis_charger_dist($id_gis='new', $objet='', $id_objet='', $retour='', $ajaxload='oui', $options=''){
+function formulaires_editer_gis_charger_dist($id_gis = 'new', $objet = '', $id_objet = '', $retour = '', $ajaxload = 'oui', $options = '') {
        $valeurs = formulaires_editer_objet_charger('gis', $id_gis, '', '', $retour, '');
        $valeurs['objet'] = $objet;
        $valeurs['id_objet'] = $id_objet;
        $valeurs['ajaxload'] = $ajaxload;
-    /* Traitement des options */
+       /* Traitement des options */
        /* peut etre a envoyer dans une fonction generique de verification des options */
        if (is_array($options)) {
-       if (!$valeurs['lat'] and is_numeric($options['lat']))
-               $valeurs['lat']=$options['lat'];
-           if (!$valeurs['lon'] and is_numeric($options['lon']))
-               $valeurs['lon']=$options['lon'];
-       if (!$valeurs['zoom'] and is_numeric($options['zoom']) && intval($options['zoom'])==$options['zoom'])
-               $valeurs['zoom']=$options['zoom'];
+               if (is_string($options['titre'])) {
+                       $valeurs['titre']=$options['titre'];
+               }
+               if (!$valeurs['lat'] and is_numeric($options['lat'])) {
+                       $valeurs['lat']=$options['lat'];
+               }
+               if (!$valeurs['lon'] and is_numeric($options['lon'])) {
+                       $valeurs['lon']=$options['lon'];
+               }
+               if (!$valeurs['zoom'] and is_numeric($options['zoom']) && intval($options['zoom']) == $options['zoom']) {
+                       $valeurs['zoom']=$options['zoom'];
+               }
                /* Bounding Box */
-           if (is_numeric($options['sw_lat']))
-               $valeurs['sw_lat']=$options['sw_lat'];
-           if (is_numeric($options['sw_lon']))
-               $valeurs['sw_lon']=$options['sw_lon'];
-           if (is_numeric($options['ne_lat']))
-               $valeurs['ne_lat']=$options['ne_lat'];
-           if (is_numeric($options['ne_lon']))
-               $valeurs['ne_lon']=$options['ne_lon'];
+               if (is_numeric($options['sw_lat'])) {
+                       $valeurs['sw_lat']=$options['sw_lat'];
+               }
+               if (is_numeric($options['sw_lon'])) {
+                       $valeurs['sw_lon']=$options['sw_lon'];
+               }
+               if (is_numeric($options['ne_lat'])) {
+                       $valeurs['ne_lat']=$options['ne_lat'];
+               }
+               if (is_numeric($options['ne_lon'])) {
+                       $valeurs['ne_lon']=$options['ne_lon'];
+               }
        }
        return $valeurs;
 }
 
 /**
  * Vérification des valeurs du formulaire
- * 
+ *
  * 4 champs sont obligatoires :
  * -* Son titre
  * -* Sa latitude
  * -* Sa longitude
  * -* Son niveau de zoom
- * 
+ *
  * @param int|string $id_gis Identifiant numérique du point ou 'new' pour un nouveau
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
@@ -62,14 +74,14 @@ function formulaires_editer_gis_charger_dist($id_gis='new', $objet='', $id_objet
  * @param string $ajaxload initialiser la carte à chaque onAjaxLoad()
  * @param array $options ???
  */
-function formulaires_editer_gis_verifier_dist($id_gis='new', $objet='', $id_objet='', $retour='', $ajaxload='oui', $options=''){
-       $erreurs = formulaires_editer_objet_verifier('gis', $id_gis,array('titre','lat','lon','zoom'));
+function formulaires_editer_gis_verifier_dist($id_gis = 'new', $objet = '', $id_objet = '', $retour = '', $ajaxload = 'oui', $options = '') {
+       $erreurs = formulaires_editer_objet_verifier('gis', $id_gis, array('titre', 'lat', 'lon', 'zoom'));
        return $erreurs;
 }
 
 /**
  * Traitement des valeurs du formulaire
- * 
+ *
  * @param int|string $id_gis Identifiant numérique du point ou 'new' pour un nouveau
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
@@ -77,17 +89,16 @@ function formulaires_editer_gis_verifier_dist($id_gis='new', $objet='', $id_obje
  * @param string $ajaxload initialiser la carte à chaque onAjaxLoad()
  * @param array $options ???
  */
-function formulaires_editer_gis_traiter_dist($id_gis='new', $objet='', $id_objet='', $retour='', $ajaxload='oui', $options=''){
-       if (_request('supprimer')){
+function formulaires_editer_gis_traiter_dist($id_gis = 'new', $objet = '', $id_objet = '', $retour = '', $ajaxload = 'oui', $options = '') {
+       if (_request('supprimer')) {
                include_spip('action/editer_gis');
                supprimer_gis($id_gis);
                $id_table_objet = id_table_objet($objet);
-               if ($retour)
-                       $res['redirect'] = parametre_url($retour,$id_table_objet,$id_objet);
+               if ($retour) {
+                       $res['redirect'] = parametre_url($retour, $id_table_objet, $id_objet);
+               }
                return $res;
        } else {
                return formulaires_editer_objet_traiter('gis', $id_gis, '', '', $retour, '');
        }
 }
-
-?>
index 0126211..4e5efdf 100644 (file)
@@ -1,34 +1,39 @@
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-function formulaires_gis_inserer_modeles_traiter_dist($champs) {\r
-\r
-       // champs a ne pas prendre en compte\r
-       $ignorer = array('adresse','code_postal','ville','pays');\r
-\r
-       $code = '<'._request('modele');\r
-       if (_request('id_modele') && _request('id_modele')!='')\r
-               $code .= _request('id_modele');\r
-       if (_request('variante') && _request('variante')!='')\r
-               $code .= '|'._request('variante');\r
-       if (_request('classe') && _request('classe')!='')\r
-               $code .= '|'._request('classe');\r
-       if (_request('align') && _request('align')!='')\r
-               $code .= '|'._request('align');\r
-       foreach ($champs as $champ) {\r
-               if( !in_array($champ, $ignorer) && $champ != 'modele' && $champ != 'variante' && $champ != 'classe' && $champ != 'id_modele' && $champ != 'align' && _request($champ) && _request($champ)!='') {\r
-                       if($champ == _request($champ))\r
-                               $code .= "|$champ";\r
-                       // On transforme les tableaux en une liste\r
-                       elseif (is_array(_request($champ)))\r
-                               $code .= "|$champ=".implode(',',_request($champ));\r
-                       else\r
-                               $code .= "|$champ="._request($champ);\r
-               }\r
-       }\r
-       $code .= '>';\r
-\r
-       return $code;\r
-}\r
-\r
-?>\r
+<?php
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function formulaires_gis_inserer_modeles_traiter_dist($champs) {
+
+       // champs a ne pas prendre en compte
+       $ignorer = array('adresse','code_postal','ville','pays');
+
+       $code = '<' . _request('modele');
+       if (_request('id_modele') && _request('id_modele') != '') {
+               $code .= _request('id_modele');
+       }
+       if (_request('variante') && _request('variante')!='') {
+               $code .= '|'._request('variante');
+       }
+       if (_request('classe') && _request('classe')!='') {
+               $code .= '|'._request('classe');
+       }
+       if (_request('align') && _request('align')!='') {
+               $code .= '|'._request('align');
+       }
+       foreach ($champs as $champ) {
+               if (!in_array($champ, $ignorer) && $champ != 'modele' && $champ != 'variante' && $champ != 'classe' && $champ != 'id_modele' && $champ != 'align' && _request($champ) && _request($champ)!='') {
+                       if ($champ == _request($champ)) {
+                               $code .= "|$champ";
+                       } elseif (is_array(_request($champ))) {
+                               // On transforme les tableaux en une liste
+                               $code .= "|$champ=".implode(',', _request($champ));
+                       } else {
+                               $code .= "|$champ=" . _request($champ);
+                       }
+               }
+       }
+       $code .= '>';
+
+       return $code;
+}
index 7d614fe..1428a90 100755 (executable)
@@ -1,6 +1,8 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Formulaire de création et d'édition d'un point géolocalisé
@@ -11,13 +13,13 @@ include_spip('inc/editer');
 
 /**
  * Chargement des valeurs par défaut du formulaire
- * 
+ *
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
  * @param string $retour L'url de retour
  * @param string $recherche
  */
-function formulaires_rechercher_gis_charger_dist($objet='', $id_objet='', $retour='', $recherche=''){
+function formulaires_rechercher_gis_charger_dist($objet = '', $id_objet = '', $retour = '', $recherche = '') {
        $valeurs['recherche_gis'] = _request('recherche_gis');
        $valeurs['objet'] = $objet;
        $valeurs['id_objet'] = $id_objet;
@@ -26,28 +28,26 @@ function formulaires_rechercher_gis_charger_dist($objet='', $id_objet='', $retou
 
 /**
  * Vérification des valeurs du formulaire
- * 
+ *
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
  * @param string $retour L'url de retour
  * @param string $recherche
  */
-function formulaires_rechercher_gis_verifier_dist($objet='', $id_objet='', $retour='', $recherche=''){
+function formulaires_rechercher_gis_verifier_dist($objet = '', $id_objet = '', $retour = '', $recherche = '') {
        $erreurs = array();
        return $erreurs;
 }
 
 /**
  * Traitement des valeurs du formulaire
- * 
+ *
  * @param string $objet Le type d'objet SPIP auquel il est attaché
  * @param int $id_objet L'id_objet de l'objet auquel il est attaché
  * @param string $retour L'url de retour
  * @param string $recherche
  */
-function formulaires_rechercher_gis_traiter_dist($objet='', $id_objet='', $retour='', $recherche=''){
+function formulaires_rechercher_gis_traiter_dist($objet = '', $id_objet = '', $retour = '', $recherche = '') {
        $res = array();
        return $res;
 }
-
-?>
index 6ea3aa0..817b534 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Installation/maj des tables gis
@@ -9,7 +11,7 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * @param string $nom_meta_base_version
  * @param string $version_cible
  */
-function gis_upgrade($nom_meta_base_version, $version_cible){
+function gis_upgrade($nom_meta_base_version, $version_cible) {
        $maj = array();
 
        // Première installation
@@ -76,26 +78,33 @@ function gis_upgrade($nom_meta_base_version, $version_cible){
                array('sql_alter', 'TABLE spip_gis_liens ADD INDEX (id_objet)'),
        );
 
+       // Ajout des champs de styles (color, weight, opacity, fillcolor & fillopacity)
+       $maj['2.1.0'] = array(
+               array('maj_tables',array('spip_gis')),
+       );
+
        include_spip('base/upgrade');
        maj_plugin($nom_meta_base_version, $version_cible, $maj);
 }
 
-function gis_upgrade_2_0(){
+function gis_upgrade_2_0() {
        include_spip('action/editer_gis');
 
        // On déplace les liaisons articles et rubriques
-       $res = sql_select('*','spip_gis');
+       $res = sql_select('*', 'spip_gis');
        while ($row = sql_fetch($res)) {
-               if($row['id_article'] != 0)
+               if ($row['id_article'] != 0) {
                        lier_gis($row['id_gis'], 'article', $row['id_article']);
-               if($row['id_rubrique'] != 0)
+               }
+               if ($row['id_rubrique'] != 0) {
                        lier_gis($row['id_gis'], 'article', $row['id_rubrique']);
+               }
        }
 
        // On déplace les liaisons mots
-       $res = sql_select('*','spip_gis_mots');
+       $res = sql_select('*', 'spip_gis_mots');
        while ($row = sql_fetch($res)) {
-               $titre_mot = sql_getfetsel('titre','spip_mots','id_mot='.$row['id_mot']);
+               $titre_mot = sql_getfetsel('titre', 'spip_mots', 'id_mot='.$row['id_mot']);
                $c = array(
                        'titre' => $titre_mot,
                        'lat'=> $row['lat'],
@@ -103,7 +112,7 @@ function gis_upgrade_2_0(){
                        'zoom' => $row['zoom']
                );
                $id_gis = insert_gis();
-               revisions_gis($id_gis,$c);
+               revisions_gis($id_gis, $c);
                lier_gis($id_gis, 'mot', $row['id_mot']);
        }
 }
@@ -114,11 +123,9 @@ function gis_upgrade_2_0(){
  * @param string $nom_meta_base_version
  */
 function gis_vider_tables($nom_meta_base_version) {
-       sql_drop_table("spip_gis");
-       sql_drop_table("spip_gis_liens");
+       sql_drop_table('spip_gis');
+       sql_drop_table('spip_gis_liens');
        effacer_meta($nom_meta_base_version);
        // Effacer la config
        effacer_meta('gis');
 }
-
-?>
index 8f67652..ba6d41a 100644 (file)
@@ -1,13 +1,16 @@
-<?php 
+<?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function gis_autoriser(){};
+function gis_autoriser() {
+}
 
 /**
  * Autorisation a modifier le logo d'un point
  * Si on est autorisé à modifier le point en question
- * 
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -15,15 +18,15 @@ function gis_autoriser(){};
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_iconifier_dist($faire,$quoi,$id,$qui,$opts){
-       return autoriser('modifier','gis',$id,$qui,$opts);
+function autoriser_gis_iconifier_dist($faire, $quoi, $id, $qui, $opts) {
+       return autoriser('modifier', 'gis', $id, $qui, $opts);
 }
 
 /**
  * Autorisation a modifier un point
  * Avoir un statut dans les 3 fournis par SPIP
  * (On n'a pas d'auteur pour un point ...)
- * 
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -31,15 +34,30 @@ function autoriser_gis_iconifier_dist($faire,$quoi,$id,$qui,$opts){
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_modifier_dist($faire,$quoi,$id,$qui,$opts){
-       return (in_array($qui['statut'],array('0minirezo','1comite','6forum')));
+function autoriser_gis_modifier_dist($faire, $quoi, $id, $qui, $opts) {
+       return (in_array($qui['statut'], array('0minirezo', '1comite', '6forum')));
 }
 
 /**
  * Autorisation a creer un point
  * Avoir un statut dans les 3 fournis par SPIP
  * (On n'a pas d'auteur pour un point ...)
- * 
+ *
+ * @param string $faire L'action
+ * @param string $type Le type d'objet
+ * @param int $id L'identifiant numérique de l'objet
+ * @param array $qui Les informations de session de l'auteur
+ * @param array $opt Des options
+ * @return boolean true/false
+ */
+function autoriser_gis_creer_dist($faire, $quoi, $id, $qui, $opts) {
+       return (in_array($qui['statut'], array('0minirezo', '1comite', '6forum')));
+}
+
+/**
+ * Autorisation d'associer un point à un objet
+ * Un auteur peut lier un point à un autre objet que s'il peut modifier l'objet à lier en question
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -47,14 +65,14 @@ function autoriser_gis_modifier_dist($faire,$quoi,$id,$qui,$opts){
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_creer_dist($faire,$quoi,$id,$qui,$opts){
-       return (in_array($qui['statut'],array('0minirezo','1comite','6forum')));
+function autoriser_associergis_dist($faire, $quoi, $id, $qui, $opts) {
+       return autoriser('lier', 'gis', '', $qui, array('objet' => $quoi,'id_objet'=>$id));
 }
 
 /**
  * Autorisation a lier un point d'un objet
  * Un auteur peut lier un point à un autre objet que s'il peut modifier l'objet à lier en question
- * 
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -62,9 +80,9 @@ function autoriser_gis_creer_dist($faire,$quoi,$id,$qui,$opts){
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_lier_dist($faire,$quoi,$id,$qui,$opts){
-       if(is_array($opts) && isset($opts['objet']) && isset($opts['id_objet'])){
-               return autoriser('modifier',$opts['objet'],$opts['id_objet'],$qui);
+function autoriser_gis_lier_dist($faire, $quoi, $id, $qui, $opts) {
+       if (is_array($opts) and isset($opts['objet']) and isset($opts['id_objet'])) {
+               return autoriser('modifier', $opts['objet'], $opts['id_objet'], $qui);
        }
        return false;
 }
@@ -73,7 +91,7 @@ function autoriser_gis_lier_dist($faire,$quoi,$id,$qui,$opts){
  * Autorisation a délier un point d'un objet
  * Un auteur peut délier un point d'un autre objet que s'il peut modifier l'objet en question
  * Si l'objet lié n'existe plus, on vérifie que l'auteur a le droit de modifier le point
- * 
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -81,19 +99,20 @@ function autoriser_gis_lier_dist($faire,$quoi,$id,$qui,$opts){
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_delier_dist($faire,$quoi,$id,$qui,$opts){
+function autoriser_gis_delier_dist($faire, $quoi, $id, $qui, $opts) {
        $table = table_objet_sql($opts['objet']);
        $_id_objet = id_table_objet($table);
-       if (!sql_getfetsel($_id_objet,$table,"$_id_objet=".intval($opts['id_objet'])))
-               return autoriser('modifier','gis',$id,$qui,$opts);
-       else
-               return autoriser('lier','gis',$id,$qui,$opts);
+       if (!sql_getfetsel($_id_objet, $table, "$_id_objet=" . intval($opts['id_objet']))) {
+               return autoriser('modifier', 'gis', $id, $qui, $opts);
+       } else {
+               return autoriser('lier', 'gis', $id, $qui, $opts);
+       }
 }
 
 /**
  * Autorisation a supprimer un point
  * Un auteur peut supprimer un point s'il peut délier tous les objets et modifier le point
- * 
+ *
  * @param string $faire L'action
  * @param string $type Le type d'objet
  * @param int $id L'identifiant numérique de l'objet
@@ -101,13 +120,12 @@ function autoriser_gis_delier_dist($faire,$quoi,$id,$qui,$opts){
  * @param array $opt Des options
  * @return boolean true/false
  */
-function autoriser_gis_supprimer_dist($faire,$quoi,$id,$qui,$opts){
-       $liaisons = sql_select('*','spip_gis_liens','id_gis='.intval($id));
-       while($liaison = sql_fetch($liaisons)){
-               if(!autoriser('delier','gis',$liaison['id_gis'],$qui,$liaison)){
+function autoriser_gis_supprimer_dist($faire, $quoi, $id, $qui, $opts) {
+       $liaisons = sql_select('*', 'spip_gis_liens', 'id_gis=' . intval($id));
+       while ($liaison = sql_fetch($liaisons)) {
+               if (!autoriser('delier', 'gis', $liaison['id_gis'], $qui, $liaison)) {
                        return false;
                }
        }
-       return autoriser('modifier','gis',$id,$qui,$opts);
+       return autoriser('modifier', 'gis', $id, $qui, $opts);
 }
-?>
index 72f98c5..5df9b7d 100755 (executable)
@@ -1,49 +1,51 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/config');
 include_spip('inc/json');
 
-/** 
+/**
  * Filtre dec_to_dms, http://www.statemaster.com/encyclopedia/Geographic-coordinate-conversion
- * 
+ *
  * @param decimal $coord
  * @return string
  */
 function dec_to_dms($coord) {
        return sprintf(
-               "%0.0f° %2.3f",
+               '%0.0f° %2.3f',
                floor(abs($coord)),
                60*(abs($coord)-floor(abs($coord)))
        );
 }
 
-/** 
+/**
  * Filtre dms_to_dec, http://www.statemaster.com/encyclopedia/Geographic-coordinate-conversion
- * 
+ *
  * @param string $ref N, E, S, W
  * @param int $deg
  * @param int $min
  * @param int $sec
  * @return decimal
  */
-function dms_to_dec($ref,$deg,$min,$sec) {
+function dms_to_dec($ref, $deg, $min, $sec) {
 
        $arrLatLong = array();
-       $arrLatLong["N"] = 1;
-       $arrLatLong["E"] = 1;
-       $arrLatLong["S"] = -1;
-       $arrLatLong["W"] = -1;
+       $arrLatLong['N'] = 1;
+       $arrLatLong['E'] = 1;
+       $arrLatLong['S'] = -1;
+       $arrLatLong['W'] = -1;
 
        return ($deg+((($min*60)+($sec))/3600)) * $arrLatLong[$ref];
 }
 
-/** 
+/**
  * Filtre distance pour renvoyer la distance entre deux points
  * http://snipplr.com/view/2531/calculate-the-distance-between-two-coordinates-latitude-longitude/
  * sinon voir ici : http://zone.spip.org/trac/spip-zone/browser/_plugins_/forms/geoforms/inc/gPoint.php
- * 
+ *
  * @param int|array $from
  *     id_gis du point de référence ou tableau de coordonnées
  * @param int|array $to
@@ -53,23 +55,12 @@ function dms_to_dec($ref,$deg,$min,$sec) {
  * @return float
  *     Retourne la distance en kilomètre ou en miles
  */
-function distance($from, $to, $miles=false) {
+function distance($from, $to, $miles = false) {
        // On ne travaille que si on a toutes les infos
-       if (
-               // Le départ est soit un tableau soit un entier
-               (
-                       (is_array($from) and isset($from['lat']) and isset($from['lon']))
-                       or
-                       ($from = intval($from) and $from > 0 and $from = sql_fetsel('lat,lon','spip_gis',"id_gis=$from"))
-               )
-               and
-               // Le distant est soit un tableau soit un entier
-               (
-                       (is_array($to) and isset($to['lat']) and isset($to['lon']))
-                       or
-                       ($to = intval($to) and $to > 0 and $to = sql_fetsel('lat,lon','spip_gis',"id_gis=$to"))
-               )
-       ){
+       if (((is_array($from) and isset($from['lat']) and isset($from['lon'])) // Le départ est soit un tableau soit un entier
+               or ($from = intval($from) and $from > 0 and $from = sql_fetsel('lat,lon', 'spip_gis', "id_gis=$from")))
+               and ((is_array($to) and isset($to['lat']) and isset($to['lon'])) or ($to = intval($to) and $to > 0 and $to = sql_fetsel('lat,lon', 'spip_gis', "id_gis=$to"))) // Le distant est soit un tableau soit un entier
+       ) {
                $pi80 = M_PI / 180;
                $from['lat'] *= $pi80;
                $from['lon'] *= $pi80;
@@ -85,13 +76,46 @@ function distance($from, $to, $miles=false) {
 
                return ($miles ? ($km * 0.621371192) : $km);
        }
-       
+
        return false;
 }
 
+/**
+ * Afficher proprement une distance
+ *
+ * @param float $distance
+ *             Nombre indiquant une distance
+ * @param int $precision
+ *             Précision des décimales du nombre final, par défaut 2
+ * @param string $format_entree
+ *             Format de distance donnée en entrée : par défaut en kilomètres, sinon en mètres avec "m"
+ * @return string
+ *             Retourne une chaine composée d'un nombre arrondi et d'une unité de mesure de distance
+ **/
+function distance_en_metres($distance, $precision=2, $format_entree='km') {
+       if ($distance) {
+               // On passe toujours tout en kilomètres pour uniformiser
+               if ($format_entree == 'm') {
+                       $distance = $distance / 1000;
+               }
+
+               // Si c'est supérieur à 1, on reste en kilomètres
+               if ($distance > 1) {
+                       $unite = 'km';
+               }
+               elseif (($distance = $distance*1000) > 1) {
+                       $unite = 'm';
+               }
+
+               $distance = number_format($distance, $precision, ',', '') . ' ' . $unite;
+       }
+
+       return $distance;
+}
+
 /**
  * Compilation du critère {distancefrom}
- * 
+ *
  * Critère {distancefrom} qui permet de ne sélectionner que les objets se trouvant à une distance comparée avec un point de repère.
  * On doit lui passer 3 paramètres obligatoires :
  * - le point de repère qui est un tableau avec les clés "lat" et "lon" ou un id_gis
@@ -110,13 +134,10 @@ function critere_distancefrom_dist($idb, &$boucles, $crit) {
        $id_table = $boucle->id_table; // articles
        $primary = $boucle->primary; // id_article
        $objet = objet_type($id_table); // article
-       
-       if (
-               // Soit depuis une boucle (GIS) soit un autre objet mais avec {gis}
-               ($id_table == 'gis' or isset($boucle->join['gis']))
-               // Il faut aussi qu'il y ait 3 critères obligatoires
-               and count($crit->param) == 3
-       ){
+
+       if (($id_table == 'gis' or isset($boucle->join['gis'])) // Soit depuis une boucle (GIS) soit un autre objet mais avec {gis}
+               and count($crit->param) == 3 // Il faut aussi qu'il y ait 3 critères obligatoires
+       ) {
                $point_reference = calculer_liste($crit->param[0], array(), $boucles, $boucles[$idb]->id_parent);
                $operateur = calculer_liste($crit->param[1], array(), $boucles, $boucles[$idb]->id_parent);
                $distance = calculer_liste($crit->param[2], array(), $boucles, $boucles[$idb]->id_parent);
@@ -130,7 +151,7 @@ function critere_distancefrom_dist($idb, &$boucles, $crit) {
                $boucle->hierarchie .= '$operateur_distance = trim('.$operateur.');';
                $boucle->hierarchie .= 'if (!in_array($operateur_distance, array("=","<",">","<=",">="))){ $operateur_distance = false; }';
                $boucle->hierarchie .= '$distance = '.$distance.';';
-               
+
                $boucle->select[] = '".(!$point_reference ? "\'\' as distance" : "(6371 * acos( cos( radians(".$point_reference["lat"].") ) * cos( radians( gis.lat ) ) * cos( radians( gis.lon ) - radians(".$point_reference["lon"].") ) + sin( radians(".$point_reference["lat"].") ) * sin( radians( gis.lat ) ) ) ) AS distance")."';
                $boucle->having[] = '((!$point_reference or !$operateur_distance or !$distance) ? "1=1" : "distance $operateur_distance ".sql_quote($distance))';
        }
@@ -153,59 +174,57 @@ function critere_gis_dist($idb, &$boucles, $crit) {
        $id_table = $boucle->id_table; // articles
        $primary = $boucle->primary; // id_article
        $objet = objet_type($id_table); // article
-       
+
        if ($id_table == 'gis') {
                // exclure l'élément en cours des résultats
-               $id_gis = calculer_argument_precedent($idb,$primary, $boucles);
+               $id_gis = calculer_argument_precedent($idb, $primary, $boucles);
                $boucle->where[]= array("'!='", "'$boucle->id_table." . "$primary'", $id_gis);
-               
+
                // récupérer les paramètres du critère
                $op='';
                $params = $crit->param;
                $type = array_shift($params);
                $type = $type[0]->texte;
-               if(preg_match(',^(\w+)([<>=]+)([0-9]+)$,',$type,$r)){
+               if (preg_match(',^(\w+)([<>=]+)([0-9]+)$,', $type, $r)) {
                        $type=$r[1];
                        $op=$r[2];
                        $op_val=$r[3];
                }
-               if ($op)
+               if ($op) {
                        $boucle->having[]= array("'".$op."'", "'".$type."'",$op_val);
-               
+               }
+
                // récupérer lat/lon du point de la boucle englobante
-               $lat = calculer_argument_precedent($idb,'lat', $boucles);
-               $lon = calculer_argument_precedent($idb,'lon', $boucles);
-               
+               $lat = calculer_argument_precedent($idb, 'lat', $boucles);
+               $lon = calculer_argument_precedent($idb, 'lon', $boucles);
+
                // http://www.awelty.fr/developpement-web/php/
                // http://www.movable-type.co.uk/scripts/latlong-db.html
                // http://code.google.com/intl/fr/apis/maps/articles/geospatial.html#geospatial
                $select = "(6371 * acos( cos( radians(\".$lat.\") ) * cos( radians( gis.lat ) ) * cos( radians( gis.lon ) - radians(\".$lon.\") ) + sin( radians(\".$lat.\") ) * sin( radians( gis.lat ) ) ) ) AS distance";
                $order = "'distance'";
-               
+
                $boucle->select[]= $select;
                $boucle->order[]= $order;
        } else {
-
                /* Recherche d'objets SANS point */
                if ($crit->not) {
                        $boucle->from['gis_liens'] = 'spip_gis_liens';
-                       $boucle->from_type['gis_liens'] = "LEFT";
+                       $boucle->from_type['gis_liens'] = 'LEFT';
                        $boucle->join['gis_liens'] = array("'$id_table'","'id_objet'","'$primary'","'gis_liens.objet='.sql_quote('$objet')");
                        $boucle->where[] = "'gis_liens.id_gis IS NULL'";
 
                /* Recherche d'objets AVEC point + ajout des champs GIS */
                } else {
-                       // ajouter tous les champs du point au select 
+                       // ajouter tous les champs du point au select
                        // et les suffixer pour lever toute ambiguite avec des champs homonymes
-                       $boucle->select[]= 'gis.titre AS titre_gis';
-                       $boucle->select[]= 'gis.descriptif AS descriptif_gis';
-                       $boucle->select[]= 'gis.adresse AS adresse_gis';
-                       $boucle->select[]= 'gis.pays AS pays_gis';
-                       $boucle->select[]= 'gis.code_pays AS code_pays_gis';
-                       $boucle->select[]= 'gis.region AS region_gis';
-                       $boucle->select[]= 'gis.departement AS departement_gis';
-                       $boucle->select[]= 'gis.ville AS ville_gis';
-                       $boucle->select[]= 'gis.code_postal AS code_postal_gis';
+                       if (!function_exists('objet_info')) {
+                               include_spip('inc/filtres');
+                       }
+                       $champs = objet_info('gis', 'champs_critere_gis');
+                       foreach ($champs as $champ) {
+                               $boucle->select[] = $champ;
+                       }
                        // jointure sur spip_gis_liens/spip_gis
                        // cf plugin notation
                        // $boucle->join["surnom (as) table de liaison"] = array("surnom de la table a lier", "cle primaire de la table de liaison", "identifiant a lier", "type d'objet de l'identifiant");
@@ -217,7 +236,7 @@ function critere_gis_dist($idb, &$boucles, $crit) {
                        // mais attention, si on trouve en amont un groupement portant sur un champ *de GIS*,
                        // alors cela signifie que la personne veut faire une opération de groupement sur les points donc là on n'ajoute pas id_gis
                        $tous_les_points = true;
-                       foreach ($boucle->group as $champ){
+                       foreach ($boucle->group as $champ) {
                                if (in_array($champ, array('ville', 'code_postal', 'pays', 'code_pays', 'region','departement'))) {
                                        $tous_les_points = false;
                                }
@@ -229,15 +248,22 @@ function critere_gis_dist($idb, &$boucles, $crit) {
                        // permet de passer dans trouver_champ_exterieur() depuis index_tables_en_pile()
                        // cf http://article.gmane.org/gmane.comp.web.spip.zone/6628
                        $boucle->jointures[] = 'gis';
-                       if (empty($boucle->jointures_explicites)){
+                       if (empty($boucle->jointures_explicites)) {
                                $boucle->jointures_explicites = 'gis_liens gis';
-                       }
-                       else{
+                       } else {
                                $boucle->jointures_explicites .= ' gis_liens gis';
                        }
                }
        }
 }
+function critere_gis_tout_dist($idb, &$boucles, $crit) {
+       $crit->op = 'gis';
+       $critere_gis = charger_fonction('gis', 'critere/');
+       $critere_gis($idb, $boucles, $crit);
+       $boucle = &$boucles[$idb];
+       $boucle->from_type['gis_liens'] = 'LEFT';
+       $boucle->from_type['gis'] = 'LEFT';
+}
 
 /**
  * Balise #DISTANCE issue du critère {gis distance<XX}
@@ -342,12 +368,12 @@ function balise_code_postal_gis_dist($p) {
 /**
  * Définition du fond de carte à utiliser par défaut en prenant compte les defines
  */
-function gis_layer_defaut(){
+function gis_layer_defaut() {
        $defaut = 'openstreetmap_mapnik';
-       if(defined('_GIS_LAYER_DEFAUT_FORCE')){
+       if (defined('_GIS_LAYER_DEFAUT_FORCE')) {
                return _GIS_LAYER_DEFAUT_FORCE;
-       }else{
-               if(defined('_GIS_LAYER_DEFAUT')){
+       } else {
+               if (defined('_GIS_LAYER_DEFAUT')) {
                        $defaut = _GIS_LAYER_DEFAUT;
                }
                $config = lire_config('gis/layer_defaut');
@@ -360,22 +386,23 @@ function gis_layer_defaut(){
  * @param $env
  * @return array
  */
-function gis_modele_url_json_env($env){
+function gis_modele_url_json_env($env) {
        $contexte = array();
-       if (is_string($env))
+       if (is_string($env)) {
                $env = unserialize($env);
-       if ($env){
+       }
+       if ($env) {
                // d'abord toutes les cles primaires connues
                $tables_sql = lister_tables_objets_sql();
-               foreach (array_keys($tables_sql) as $table){
+               foreach (array_keys($tables_sql) as $table) {
                        $primary = id_table_objet($table);
                        if (isset($env[$primary])) {
                                $contexte[$primary] = is_array($env[$primary]) ? $env[$primary] : trim($env[$primary]);
                        }
                }
                // puis cas particuliers et ceux ajoutés par le pipeline
-               $keys = pipeline('gis_modele_parametres_autorises', array("objet", "id_objet","id_secteur","id_parent","media","recherche","mots","pays","code_pays","region","departement","ville","code_postal","adresse"));
-               foreach ($keys as $key){
+               $keys = pipeline('gis_modele_parametres_autorises', array('objet', 'id_objet', 'id_secteur', 'id_parent', 'media', 'recherche', 'mots', 'pays', 'code_pays', 'region', 'departement', 'ville', 'code_postal', 'adresse'));
+               foreach ($keys as $key) {
                        if (isset($env[$key])) {
                                $contexte[$key] = is_array($env[$key]) ? $env[$key] : trim($env[$key]);
                        }
@@ -384,6 +411,34 @@ function gis_modele_url_json_env($env){
        return $contexte;
 }
 
+
+/**
+ * Transforme un paramètre d'entrée en tableau
+ * s'il n'en est pas déjà un.
+ * 
+ * Permet d'utiliser dans l'appel au modèle de carte gis
+ * depuis un texte d'article des paramètres tabulaires,
+ * tel que des identifiants de documents de tracés kml,
+ * tel que `<carte_gis|kml=10,11,12>`
+ * 
+ * @example `#ENV{kml}|gis_param_to_array`
+ *
+ * @param string|int|array $param
+ *     Le paramètre à transformer en tableau
+ * @param string $sep
+ *     Le séparateur utilisé
+ * @return array
+**/
+function gis_param_to_array($param, $sep = ',') {
+       if (is_array($param)) {
+               return $param;
+       }
+       // enlever les espaces et exploser
+       $tab = explode($sep, trim((string)$param));
+       // enlever les champs vides, les espaces sur chaques champs.
+       return array_map('trim', array_filter($tab));
+}
+
 /**
  * Transformer le tableau de kml en tableau d'urls :
  *   si numerique c'est un id de document
@@ -391,16 +446,16 @@ function gis_modele_url_json_env($env){
  * @param array $kml
  * @return array
  */
-function gis_kml_to_urls($kml){
-       if ($kml AND count($kml)){
-               include_spip("inc/filtres_mini");
-               include_spip("inc/distant");
-               foreach($kml as $k=>$v){
-                       if (is_numeric($v)){
-                               $kml[$k] = url_absolue(generer_url_entite($v,"document"));
+function gis_kml_to_urls($kml) {
+       if ($kml and count($kml)) {
+               include_spip('inc/filtres_mini');
+               include_spip('inc/distant');
+               foreach ($kml as $k => $v) {
+                       if (is_numeric($v)) {
+                               $kml[$k] = url_absolue(generer_url_entite($v, 'document'));
+                       } else {
+                               $kml[$k] = _DIR_RACINE.copie_locale($kml[$k], 'modif');
                        }
-                       else
-                               $kml[$k] = _DIR_RACINE.copie_locale($kml[$k],"modif");
                }
        }
        return $kml;
@@ -408,39 +463,47 @@ function gis_kml_to_urls($kml){
 
 /**
  * Retourne les propriétés JSON de l'icône d'un point
- * 
+ *
  * @param string $img
  *     Balise HTML `<img ... />` ou chemin de l'image (qui peut être une URL distante).
  * @return string
  *     Les propriétés de l'icône
 **/
-function gis_icon_properties($img=''){
+function gis_icon_properties($img = '') {
        $props = $icon = '';
-       
+
        if ($img) {
-               if (largeur($img) >= 44)
-                       $icon = extraire_attribut(filtrer('image_graver',filtrer('image_recadre',filtrer('image_passe_partout',$img,32,32),32,32,'center','transparent')),'src');
-               else
-                       $icon = extraire_attribut($img,'src') ? extraire_attribut($img,'src') : $img;
-       }
-       else
+               if (largeur($img) >= 44) {
+                       $icon = extraire_attribut(filtrer('image_graver', filtrer('image_recadre', filtrer('image_passe_partout', $img, 32, 32), 32, 32, 'center', 'transparent')), 'src');
+               } else {
+                       $icon = extraire_attribut($img, 'src') ? extraire_attribut($img, 'src') : $img;
+               }
+       } else {
                $icon = find_in_path('images/marker_defaut.png');
-       
+       }
+
        if ($icon) {
-               $props .= ",\n\"icon\": ". json_encode(url_absolue($icon)).",";
+               $props .= ",\n\t\t\t\"icon\": ". json_encode(url_absolue($icon)).',';
                list($h,$w) = taille_image($icon);
-               $props .= "\n\"icon_size\": ". json_encode(array($w,$h)).",";
-               $props .= "\n\"icon_anchor\": ". json_encode(array($w/2,$h)).",";
-               $props .= "\n\"popup_anchor\": ". json_encode(array(1,-round($h/1.2,2)));
+               $props .= "\n\t\t\t\"icon_size\": ". json_encode(array($w,$h)).',';
+               /**
+                * Si l'icone est carrée, on considère que c'est soit un point soit un carré qui pointe un lieu et non une "goutte"
+                * On centre donc au milieu de l'icone
+                */
+               if ($w == $h) {
+                       $props .= "\n\t\t\t\"icon_anchor\": ". json_encode(array($w/2, $h/2)).',';
+                       $props .= "\n\t\t\t\"popup_anchor\": ". json_encode(array(0,0));
+               } else {
+                       $props .= "\n\t\t\t\"icon_anchor\": ". json_encode(array($w/2, $h)).',';
+                       $props .= "\n\t\t\t\"popup_anchor\": ". json_encode(array(1, -round($h/1.2, 2)));
+               }
        }
-       
+
        if ($shadow = find_in_path('images/marker_defaut_shadow.png')) {
-               $props .= ",\n\"shadow\": ". json_encode(url_absolue($shadow));
+               $props .= ",\n\t\t\t\"shadow\": ". json_encode(url_absolue($shadow));
                list($h,$w) = taille_image($shadow);
-               $props .= ",\n\"shadow_size\": ". json_encode(array($w,$h));
+               $props .= ",\n\t\t\t\"shadow_size\": ". json_encode(array($w,$h));
        }
-       
+
        return $props;
 }
-
-?>
index ca3b0cd..6cf5881 100755 (executable)
@@ -1,9 +1,11 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 // pour compat cf http://zone.spip.org/trac/spip-zone/changeset/79911/
-define('_DIR_LIB_GIS',find_in_path('lib/leaflet/'));
+define('_DIR_LIB_GIS', find_in_path('lib/leaflet/'));
 
 $GLOBALS['logo_libelles']['id_gis'] = _T('gis:libelle_logo_gis');
 
@@ -90,14 +92,6 @@ $gis_layers = array (
                'nom' => 'Hydda Base',
                'layer' => 'L.tileLayer.provider("Hydda.Base")'
        ),
-       'mapquestopen_osm' => array(
-               'nom' => 'Mapquest Open',
-               'layer' => 'L.tileLayer.provider("MapQuestOpen.OSM")'
-       ),
-       'mapquestopen_aerial' => array(
-               'nom' => 'Mapquest Open Aerial',
-               'layer' => 'L.tileLayer.provider("MapQuestOpen.Aerial")'
-       ),
        'stamen_toner' => array(
                'nom' => 'Stamen Toner',
                'layer' => 'L.tileLayer.provider("Stamen.Toner")'
@@ -156,24 +150,24 @@ $gis_layers = array (
        ),
        'cartodb_positron' => array(
                'nom' => 'CartoDB Positron',
-               'layer' => 'L.tileLayer.provider("CartoDB.Positron")'
+               'layer' => substr($GLOBALS['meta']['adresse_site'], 0, 5) == 'https' ? 'L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png")' : 'L.tileLayer.provider("CartoDB.Positron")'
        ),
        'cartodb_positron_base' => array(
                'nom' => 'CartoDB Positron Base',
-               'layer' => 'L.tileLayer.provider("CartoDB.PositronNoLabels")'
+               'layer' => substr($GLOBALS['meta']['adresse_site'], 0, 5) == 'https' ? 'L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_nolabels/{z}/{x}/{y}.png")' : 'L.tileLayer.provider("CartoDB.PositronNoLabels")'
        ),
        'cartodb_darkmatter' => array(
                'nom' => 'CartoDB DarkMatter',
-               'layer' => 'L.tileLayer.provider("CartoDB.DarkMatter")'
+               'layer' => substr($GLOBALS['meta']['adresse_site'], 0, 5) == 'https' ? 'L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png")' : 'L.tileLayer.provider("CartoDB.DarkMatter")'
        ),
        'cartodb_darkmatter_base' => array(
                'nom' => 'CartoDB DarkMatter Base',
-               'layer' => 'L.tileLayer.provider("CartoDB.DarkMatterNoLabels")'
+               'layer' => substr($GLOBALS['meta']['adresse_site'], 0, 5) == 'https' ? 'L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}.png")' : 'L.tileLayer.provider("CartoDB.DarkMatterNoLabels")'
        )
 );
 
 if (isset($GLOBALS['gis_layers']) and is_array($GLOBALS['gis_layers'])) {
-       $GLOBALS['gis_layers'] = array_merge($gis_layers,$GLOBALS['gis_layers']);
+       $GLOBALS['gis_layers'] = array_merge($gis_layers, $GLOBALS['gis_layers']);
 } else {
        $GLOBALS['gis_layers'] = $gis_layers;
 }
index 800ea5b..6f4056e 100755 (executable)
@@ -1,6 +1,8 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Insertion des css du plugin dans les pages publiques
@@ -8,10 +10,11 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * @param $flux
  * @return mixed
  */
-function gis_insert_head_css($flux){
-       $flux .="\n".'<link rel="stylesheet" href="'. sinon(find_in_path('css/leaflet.css'),find_in_path('lib/leaflet/dist/leaflet.css')) .'" />';
-       $flux .="\n".'<link rel="stylesheet" href="'. sinon(find_in_path('css/leaflet-plugins.css'),find_in_path('lib/leaflet/plugins/leaflet-plugins.css')) .'" />';
-       $flux .="\n".'<link rel="stylesheet" href="'. sinon(find_in_path('css/leaflet.markercluster.css'),find_in_path('lib/leaflet/plugins/leaflet.markercluster.css')) .'" />';
+function gis_insert_head_css($flux) {
+       $flux .="\n".'<link rel="stylesheet" href="'. direction_css(sinon(find_in_path('css/leaflet.css'), find_in_path('lib/leaflet/dist/leaflet.css'))) .'" />';
+       $flux .="\n".'<link rel="stylesheet" href="'. direction_css(sinon(find_in_path('css/leaflet-plugins.css'), find_in_path('lib/leaflet/plugins/leaflet-plugins.css'))) .'" />';
+       $flux .="\n".'<link rel="stylesheet" href="'. direction_css(sinon(find_in_path('css/leaflet.markercluster.css'), find_in_path('lib/leaflet/plugins/leaflet.markercluster.css'))) .'" />';
+       $flux .="\n".'<link rel="stylesheet" href="'. sinon(find_in_path('css/leaflet_nodirection.css'), find_in_path('lib/leaflet/dist/leaflet_nodirection.css')) .'" />';
        return $flux;
 }
 
@@ -21,22 +24,24 @@ function gis_insert_head_css($flux){
  * @param $flux
  * @return mixed
  */
-function gis_insert_head($flux){
-       
+function gis_insert_head($flux) {
+
        // initialisation des valeurs de config
        $config = @unserialize($GLOBALS['meta']['gis']);
-       if (!isset($config['layers']) || !is_array($config['layers']))
+       if (!isset($config['layers']) || !is_array($config['layers'])) {
                $config['layers'] = array('openstreetmap_mapnik');
-       
+       }
+
        include_spip('gis_fonctions');
-       if (!in_array(gis_layer_defaut(),$config['layers']))
+       if (!in_array(gis_layer_defaut(), $config['layers'])) {
                $config['layers'][] = gis_layer_defaut();
-       
+       }
+
        // insertion des scripts pour google si nécessaire
        if (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), $config['layers'])) > 0) {
-               $flux .="\n".'<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=false&amp;language='.$GLOBALS['spip_lang'].'"></script>';
+               $flux .="\n".'<script type="text/javascript" src="//maps.google.com/maps/api/js?language='.$GLOBALS['spip_lang'].'&amp;key='.$config['api_key_google'].'"></script>';
        }
-       
+
        return $flux;
 }
 
@@ -46,7 +51,7 @@ function gis_insert_head($flux){
  * @param $flux
  * @return mixed
  */
-function gis_header_prive($flux){
+function gis_header_prive($flux) {
        $flux .= gis_insert_head_css('');
        $flux .= gis_insert_head('');
        return $flux;
@@ -58,13 +63,12 @@ function gis_header_prive($flux){
  * @param $flux
  * @return mixed
  */
-function gis_afficher_contenu_objet($flux){
+function gis_afficher_contenu_objet($flux) {
        if ($objet = $flux['args']['type']
                and include_spip('inc/config')
                and in_array(table_objet_sql($objet), lire_config('gis/gis_objets', array()))
                and ($id = intval($flux['args']['id_objet']))
-               
-       ){
+       ) {
                $texte = recuperer_fond(
                        'prive/contenu/gis_objet',
                        array(
@@ -75,7 +79,7 @@ function gis_afficher_contenu_objet($flux){
                );
                $flux['data'] .= $texte;
        }
-       
+
        return $flux;
 }
 
@@ -86,86 +90,82 @@ function gis_afficher_contenu_objet($flux){
  * @param $flux
  * @return mixed
  */
-function gis_post_edition($flux){
-       if (is_array($flux) && isset($flux['args']['operation']) && ($flux['args']['operation'] == 'ajouter_document') 
-               AND ($document = sql_fetsel("*","spip_documents","id_document=".intval($flux['args']['id_objet'])))
-               AND (in_array(table_objet_sql('document'), lire_config('gis/gis_objets', array())))
+function gis_post_edition($flux) {
+       if (is_array($flux) && isset($flux['args']['operation']) && ($flux['args']['operation'] == 'ajouter_document')
+               and ($document = sql_fetsel('*', 'spip_documents', 'id_document=' . intval($flux['args']['id_objet'])))
+               and (in_array(table_objet_sql('document'), lire_config('gis/gis_objets', array())))
        ) {
-               if (in_array($document['extension'],array('jpg','kml','kmz'))) {
+               if (in_array($document['extension'], array('jpg', 'kml', 'kmz'))) {
                        $config = @unserialize($GLOBALS['meta']['gis']);
-                       if (!is_array($config))
+                       if (!is_array($config)) {
                                $config = array();
+                       }
                        include_spip('inc/documents');
                        $fichier = get_spip_doc($document['fichier']);
                        $id_document = $document['id_document'];
                }
                if ($document['extension'] == 'jpg') {
                        // on recupere les coords definies dans les exif du document s'il y en a
-                       if (function_exists('exif_read_data') AND $exifs =  @exif_read_data($fichier,'GPS')) {
-                               if (!function_exists('dms_to_dec'))
+                       if (function_exists('exif_read_data') and $exifs =  @exif_read_data($fichier, 'GPS')) {
+                               if (!function_exists('dms_to_dec')) {
                                        include_spip('gis_fonctions');
-                               spip_log("GIS EXIFS : Récuperation des coordonnees du fichier $fichier","gis");
-                               
-                               $LatDeg = explode("/",$exifs["GPSLatitude"][0]);
-                               if (is_numeric($LatDeg[1]) > 0)
-                                       $intLatDeg = $LatDeg[0]/$LatDeg[1];
+                               }
+                               spip_log("GIS EXIFS : Récuperation des coordonnees du fichier $fichier", 'gis');
+
+                               $LatDeg = explode('/', $exifs['GPSLatitude'][0]);
+                               $intLatDeg = $LatDeg[0] / ($LatDeg[1] ? $LatDeg[1] : 1);
 
-                               $LatMin = explode("/",$exifs["GPSLatitude"][1]);
-                               if (is_numeric($LatMin[1]) > 0)
-                                       $intLatMin = $LatMin[0]/$LatMin[1];
+                               $LatMin = explode('/', $exifs['GPSLatitude'][1]);
+                               $intLatMin = $LatMin[0] / ($LatMin[1] ? $LatMin[1] : 1);
 
-                               $LatSec = explode("/",$exifs["GPSLatitude"][2]);
-                               if (is_numeric($LatSec[1]) > 0)
-                                       $intLatSec = $LatSec[0]/$LatSec[1];
+                               $LatSec = explode('/', $exifs['GPSLatitude'][2]);
+                               $intLatSec = $LatSec[0] / ($LatSec[1] ? $LatSec[1] : 1);
 
-                               $LongDeg = explode("/",$exifs["GPSLongitude"][0]);
-                               if (is_numeric($LongDeg[1]) > 0)
-                                       $intLongDeg = $LongDeg[0]/$LongDeg[1];
+                               $LongDeg = explode('/', $exifs['GPSLongitude'][0]);
+                               $intLongDeg = $LongDeg[0] / ($LongDeg[1] ? $LongDeg[1] : 1);
 
-                               $LongMin = explode("/",$exifs["GPSLongitude"][1]);
-                               if (is_numeric($LongMin[1]) > 0)
-                                       $intLongMin = $LongMin[0]/$LongMin[1];
+                               $LongMin = explode('/', $exifs['GPSLongitude'][1]);
+                               $intLongMin = $LongMin[0] / ($LongMin[1] ? $LongMin[1] : 1);
 
-                               $LongSec = explode("/",$exifs["GPSLongitude"][2]);
-                               if (is_numeric($LongSec[1]) > 0)
-                                       $intLongSec = $LongSec[0]/$LongSec[1];
+                               $LongSec = explode('/', $exifs['GPSLongitude'][2]);
+                               $intLongSec = $LongSec[0] / ($LongSec[1] ? $LongSec[1] : 1);
 
                                // round to 5 = approximately 1 meter accuracy
-                               if (is_numeric($intLatDeg) && is_numeric($intLatMin) && is_numeric($intLatSec))
-                                       $latitude = round(dms_to_dec($exifs["GPSLatitudeRef"],
-                                               $intLatDeg,$intLatMin,$intLatSec),5);
+                               if (is_numeric($intLatDeg) && is_numeric($intLatMin) && is_numeric($intLatSec)) {
+                                       $latitude = round(dms_to_dec($exifs['GPSLatitudeRef'], $intLatDeg, $intLatMin, $intLatSec), 5);
+                               }
 
-                               if (is_numeric($intLongDeg) && is_numeric($intLongMin) && is_numeric($intLongSec))
-                                       $longitude =  round(dms_to_dec($exifs["GPSLongitudeRef"],
-                                               $intLongDeg,$intLongMin,$intLongSec), 5);
+                               if (is_numeric($intLongDeg) && is_numeric($intLongMin) && is_numeric($intLongSec)) {
+                                       $longitude =  round(dms_to_dec($exifs['GPSLongitudeRef'], $intLongDeg, $intLongMin, $intLongSec), 5);
+                               }
                                if ($config['geocoder'] == 'on') {
                                        include_spip('inc/distant');
                                        $url_geocoder = 'http://nominatim.openstreetmap.org/reverse/?format=xml&addressdetails=1&accept-language='.urlencode($GLOBALS['meta']['langue_site']).'&lat='.urlencode($latitude).'&lon='.urlencode($longitude);
                                        $json = recuperer_page($url_geocoder);
-                                       $geocoder = json_decode($json,true);
+                                       $geocoder = json_decode($json, true);
                                        if (is_array($geocoder)) {
                                                $pays = $geocoder['address']['country'];
                                                $code_pays = $geocoder['address']['country_code'];
                                                $region = $geocoder['address']['state'];
                                                if ($geocoder['address']['city']) {
                                                        $ville = $geocoder['address']['city'];
-                                               } else if ($geocoder['address']['town']) {
+                                               } elseif ($geocoder['address']['town']) {
                                                        $ville = $geocoder['address']['town'];
-                                               } else if ($geocoder['address']['village']) {
+                                               } elseif ($geocoder['address']['village']) {
                                                        $ville = $geocoder['address']['village'];
                                                }
                                                $code_postal = $geocoder['address']['postcode'];
                                                $adresse = $geocoder['address']['road'];
                                        }
                                }
-                       } else if (file_exists($fichier)) {
-                               include_spip("inc/iptc");
+                       } elseif (file_exists($fichier)) {
+                               include_spip('inc/iptc');
 
                                $er = new class_IPTC($fichier);
                                $iptc = $er->fct_lireIPTC();
                                $codesiptc = $er->h_codesIptc;
                                $string_recherche = '';
-                               
+
                                if ($iptc['city']) {
                                        $string_recherche .= $iptc['city'].', ';
                                }
@@ -179,7 +179,7 @@ function gis_post_edition($flux){
                                        include_spip('inc/distant');
                                        $url_geocoder = 'http://nominatim.openstreetmap.org/search/?format=json&addressdetails=1&limit=1&accept-language='.urlencode($GLOBALS['meta']['langue_site']).'&q='.urlencode($string_recherche);
                                        $json = recuperer_page($url_geocoder);
-                                       $geocoder = json_decode($json,true);
+                                       $geocoder = json_decode($json, true);
                                        if (is_array($geocoder[0])) {
                                                $latitude = $geocoder[0]['lat'];
                                                $longitude = $geocoder[0]['lon'];
@@ -189,9 +189,9 @@ function gis_post_edition($flux){
                                                        $region = $geocoder[0]['address']['state'];
                                                        if ($geocoder[0]['address']['city']) {
                                                                $ville = $geocoder[0]['address']['city'];
-                                                       } else if ($geocoder[0]['address']['town']) {
+                                                       } elseif ($geocoder[0]['address']['town']) {
                                                                $ville = $geocoder[0]['address']['town'];
-                                                       } else if ($geocoder[0]['address']['village']) {
+                                                       } elseif ($geocoder[0]['address']['village']) {
                                                                $ville = $geocoder[0]['address']['village'];
                                                        }
                                                }
@@ -212,28 +212,28 @@ function gis_post_edition($flux){
                                        'pays' => $pays,
                                        'code_pays' => $code_pays
                                );
-                               
+
                                if (defined('_DIR_PLUGIN_GISGEOM')) {
                                        $geojson = '{"type":"Point","coordinates":['.$longitude.','.$latitude.']}';
-                                       set_request('geojson',$geojson);
+                                       set_request('geojson', $geojson);
                                }
-                               
+
                                include_spip('action/editer_gis');
-       
-                               if ($id_gis = sql_getfetsel("G.id_gis","spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis ","T.id_objet=" . intval($id_document) . " AND T.objet='document'")) {
+
+                               if ($id_gis = sql_getfetsel('G.id_gis', 'spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis', 'T.id_objet=' . intval($id_document) . " AND T.objet='document'")) {
                                        // Des coordonnées sont déjà définies pour ce document => on les update
-                                       revisions_gis($id_gis,$c);
-                                       spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
+                                       revisions_gis($id_gis, $c);
+                                       spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
                                } else {
                                        // Aucune coordonnée n'est définie pour ce document  => on les crées
                                        $id_gis = insert_gis();
-                                       revisions_gis($id_gis,$c);
+                                       revisions_gis($id_gis, $c);
                                        lier_gis($id_gis, 'document', $id_document);
-                                       spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
+                                       spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
                                }
                        }
-               } elseif (in_array($document['extension'],array('kml','kmz','gpx'))) {
-                       $recuperer_info = charger_fonction('kml_infos','inc');
+               } elseif (in_array($document['extension'], array('kml','kmz','gpx'))) {
+                       $recuperer_info = charger_fonction('kml_infos', 'inc');
                        $infos = $recuperer_info($document['id_document']);
                        if ($infos) {
                                if (is_numeric($latitude = $infos['latitude']) && is_numeric($longitude = $infos['longitude'])) {
@@ -244,19 +244,19 @@ function gis_post_edition($flux){
                                                'lon' => $longitude,
                                                'zoom' => $config['zoom'] ? $config['zoom'] :'4'
                                        );
-                       
+
                                        include_spip('action/editer_gis');
-               
-                                       if ($id_gis = sql_getfetsel("G.id_gis","spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis ","T.id_objet=" . intval($id_document) . " AND T.objet='document'")) {
+
+                                       if ($id_gis = sql_getfetsel('G.id_gis', 'spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis', 'T.id_objet=' . intval($id_document) . " AND T.objet='document'")) {
                                                // Des coordonnées sont déjà définies pour ce document => on les update
-                                               revisions_gis($id_gis,$c);
-                                               spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
+                                               revisions_gis($id_gis, $c);
+                                               spip_log("GIS EXIFS : Update des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
                                        } else {
                                                // Aucune coordonnée n'est définie pour ce document  => on les crées
                                                $id_gis = insert_gis();
-                                               revisions_gis($id_gis,$c);
+                                               revisions_gis($id_gis, $c);
                                                lier_gis($id_gis, 'document', $id_document);
-                                               spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis","gis");
+                                               spip_log("GIS EXIFS : Création des coordonnées depuis EXIFS pour le document $id_document => id_gis = $id_gis", 'gis');
                                        }
                                }
                                unset($infos['longitude']);
@@ -268,15 +268,15 @@ function gis_post_edition($flux){
                        }
                }
        }
-       if (is_array($flux) && isset($flux['args']['operation']) && ($flux['args']['operation'] == 'supprimer_document') 
-               AND ($id_document = intval($flux['args']['id_objet'])
-               AND ($id_gis = sql_getfetsel("G.id_gis","spip_gis AS G LEFT  JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis ","T.id_objet=" . intval($id_document) . " AND T.objet='document'")))
+       if (is_array($flux) && isset($flux['args']['operation']) && ($flux['args']['operation'] == 'supprimer_document')
+               and ($id_document = intval($flux['args']['id_objet'])
+               and ($id_gis = sql_getfetsel('G.id_gis', 'spip_gis AS G LEFT JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis', 'T.id_objet=' . intval($id_document) . " AND T.objet='document'")))
        ) {
                include_spip('action/editer_gis');
                supprimer_gis($id_gis);
-               spip_log("GIS EXIFS : Suppression des coordonnées pour le document $id_document => id_gis = $id_gis","gis");
+               spip_log("GIS EXIFS : Suppression des coordonnées pour le document $id_document => id_gis = $id_gis", 'gis');
        }
-       
+
        return $flux;
 }
 
@@ -287,18 +287,18 @@ function gis_post_edition($flux){
  * @param array $flux
  * @return array
  */
-function gis_optimiser_base_disparus($flux){
+function gis_optimiser_base_disparus($flux) {
 
        include_spip('action/editer_liens');
        // optimiser les liens morts :
        // entre gis vers des objets effaces
        // depuis des gis effaces
-       $flux['data'] += objet_optimiser_liens(array('gis'=>'*'),'*');
+       $flux['data'] += objet_optimiser_liens(array('gis' => '*'), '*');
 
        return $flux;
 }
 
-function gis_saisies_autonomes($flux){
+function gis_saisies_autonomes($flux) {
        $flux[] = 'carte';
        return $flux;
 }
@@ -306,13 +306,13 @@ function gis_saisies_autonomes($flux){
 /**
  * Insertion dans le pipeline xmlrpc_methodes (xmlrpc)
  * Ajout de méthodes xml-rpc spécifiques à GIS
- * 
+ *
  * @param array $flux : un array des methodes déjà présentes, fonctionnant sous la forme :
  * -* clé = nom de la méthode;
  * -* valeur = le nom de la fonction à appeler;
- * @return array $flux : l'array complété avec nos nouvelles méthodes 
+ * @return array $flux : l'array complété avec nos nouvelles méthodes
  */
-function gis_xmlrpc_methodes($flux){
+function gis_xmlrpc_methodes($flux) {
        $flux['spip.liste_gis'] = 'spip_liste_gis';
        $flux['spip.lire_gis'] = 'spip_lire_gis';
        return $flux;
@@ -320,31 +320,30 @@ function gis_xmlrpc_methodes($flux){
 
 /**
  * Insertion dans le pipeline xmlrpc_server_class (xmlrpc)
- * Ajout de fonctions spécifiques utilisés par le serveur xml-rpc 
+ * Ajout de fonctions spécifiques utilisés par le serveur xml-rpc
  */
-function gis_xmlrpc_server_class($flux){
+function gis_xmlrpc_server_class($flux) {
        include_spip('inc/gis_xmlrpc');
        return $flux;
 }
 
 /**
  * Insertion dans le traitement du formulaire de configuration
- * 
+ *
  * Purger le répertoire js si on a une carte google dans les layers pour recalculer le js statique
  * Peut être à améliorer
- * 
+ *
  * @param array $flux
  *             Le contexte du pipeline
  * @return array $flux
  */
-function gis_formulaire_traiter($flux){
-       if($flux['args']['form'] == 'configurer_gis'){
-               if (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), _request('layers'))) > 0){
+function gis_formulaire_traiter($flux) {
+       if ($flux['args']['form'] == 'configurer_gis') {
+               if (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), _request('layers'))) > 0) {
                        include_spip('inc/invalideur');
-                       purger_repertoire(_DIR_VAR.'cache-js');
+                       purger_repertoire(_DIR_VAR . 'cache-js');
                        suivre_invalideur(1);
                }
        }
        return $flux;
 }
-?>
index b0e5a4c..399d41c 100644 (file)
Binary files a/www/plugins/gis/icones_barre/gis.png and b/www/plugins/gis/icones_barre/gis.png differ
index b0e5a4c..399d41c 100644 (file)
Binary files a/www/plugins/gis/images/gis-16.png and b/www/plugins/gis/images/gis-16.png differ
index 6cb9f54..25d1e7e 100755 (executable)
Binary files a/www/plugins/gis/images/gis-24.png and b/www/plugins/gis/images/gis-24.png differ
index 8f867fc..79d32bc 100755 (executable)
Binary files a/www/plugins/gis/images/gis.png and b/www/plugins/gis/images/gis.png differ
index e2867fc..e22e3e0 100644 (file)
@@ -1,12 +1,14 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Récupère la liste des points géolocalisés
- * 
+ *
  * Arguments possibles :
- * -* login string 
+ * -* login string
  * -* pass string
  * -* objet string : le type d'objets liés
  * -* id_objet int : l'identifiant numérique de l'objet lié
@@ -19,55 +21,57 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  */
 function spip_liste_gis($args) {
        global $spip_xmlrpc_serveur;
-       
-       if(!$spip_xmlrpc_serveur)
+
+       if (!$spip_xmlrpc_serveur) {
                return false;
-       
+       }
+
        $objet = 'gis';
-       
+
        $what[] = 'gis.id_gis';
        $from = 'spip_gis as gis LEFT JOIN spip_gis_liens as lien ON gis.id_gis=lien.id_gis';
        $where = is_array($args['where']) ? $args['where'] : array();
        $order = is_array($args['tri']) ? $args['tri'] : array();
-       if((intval($args['id_objet']) > 0) && $args['objet']){
+       if ((intval($args['id_objet']) > 0) && $args['objet']) {
                $where[] = 'lien.id_objet='.intval($args['id_objet']).' AND lien.objet='.sql_quote($args['objet']);
        }
-       
-       if(in_array('distance',$order) OR in_array('!distance',$order)){
+
+       if (in_array('distance', $order) or in_array('!distance', $order)) {
                $distance = true;
                $lat = $args['lat'];
                $lon = $args['lon'];
-               if(!is_numeric($lon) OR !is_numeric($lat)){
+               if (!is_numeric($lon) or !is_numeric($lat)) {
                        $erreur = _T('gis:erreur_xmlrpc_lat_lon');
                        return new IXR_Error(-32601, attribut_html($erreur));
-               }else{
+               } else {
                        $what[] = "(6371 * acos( cos( radians(\"$lat\") ) * cos( radians( gis.lat ) ) * cos( radians( gis.lon ) - radians(\"$lon\") ) + sin( radians(\"$lat\") ) * sin( radians( gis.lat ) ) ) ) AS distance";
                }
        }
-       
+
        /**
         * Une recherche
-        */     
-       if(is_string($args['recherche']) AND strlen($args['recherche']) > 3){
+        */
+       if (is_string($args['recherche']) and strlen($args['recherche']) > 3) {
                $prepare_recherche = charger_fonction('prepare_recherche', 'inc');
                list($rech_select, $rech_where) = $prepare_recherche($args['recherche'], $objet.'s', $where);
                $what[] = $rech_select;
                $from .= ' INNER JOIN spip_resultats AS resultats ON ( resultats.id = gis.id_gis ) ';
                $where[] = 'resultats.'.$rech_where;
        }
-       
+
        $points_struct = array();
 
-       if($points = sql_select($what,$from,$where,'',$order,$args['limite'])){
-               while($point = sql_fetch($points)){
+       if ($points = sql_select($what, $from, $where, '', $order, $args['limite'])) {
+               while ($point = sql_fetch($points)) {
                        $struct=array();
                        $args['id_gis'] = $point['id_gis'];
                        /**
                         * On utilise la fonction geodiv_lire_media pour éviter de dupliquer trop de code
                         */
                        $struct = spip_lire_gis($args);
-                       if($distance)
+                       if ($distance) {
                                $struct['distance'] = $point['distance'];
+                       }
                        $points_struct[] = $struct;
                }
        }
@@ -76,7 +80,7 @@ function spip_liste_gis($args) {
 
 /**
  * Récupère le contenu d'un point géolocalisé
- * 
+ *
  * Arguments possibles :
  * -* login
  * -* pass
@@ -84,49 +88,51 @@ function spip_liste_gis($args) {
  * -* lat : si disponible avec lon, on ajoute la distance dans les infos
  * -* lon : si disponible avec lat, on ajoute la distance dans les infos
  */
-function spip_lire_gis($args){
+function spip_lire_gis($args) {
        global $spip_xmlrpc_serveur;
-       
-       if(!$spip_xmlrpc_serveur)
+
+       if (!$spip_xmlrpc_serveur) {
                return false;
-       
-       if(!intval($args['id_gis']) > 0){
-               $erreur = _T('xmlrpc:erreur_identifiant',array('objet'=>'gis'));
+       }
+
+       if (!intval($args['id_gis']) > 0) {
+               $erreur = _T('xmlrpc:erreur_identifiant', array('objet'=>'gis'));
                return new IXR_Error(-32601, attribut_html($erreur));
        }
-       
-       $args_gis = array('objet'=>'gis','id_objet'=>$args['id_gis']);
+
+       $args_gis = array('objet' => 'gis','id_objet' => $args['id_gis']);
        $res = $spip_xmlrpc_serveur->read($args_gis);
-       if(!$res)
+       if (!$res) {
                return $spip_xmlrpc_serveur->error;
-       
-       if(isset($args['lat']) && is_numeric($args['lat']) && isset($args['lon']) && is_numeric($args['lon'])){
+       }
+
+       if (isset($args['lat']) && is_numeric($args['lat']) && isset($args['lon']) && is_numeric($args['lon'])) {
                $lat = $args['lat'];
                $lon = $args['lon'];
                $what[] = 'gis.id_gis';
                $what[] = "(6371 * acos( cos( radians(\"$lat\") ) * cos( radians( gis.lat ) ) * cos( radians( gis.lon ) - radians(\"$lon\") ) + sin( radians(\"$lat\") ) * sin( radians( gis.lat ) ) ) ) AS distance";
-               $distance = sql_fetsel($what,"spip_gis AS gis","gis.id_gis=".intval($args['id_gis']));
+               $distance = sql_fetsel($what, 'spip_gis AS gis', 'gis.id_gis='.intval($args['id_gis']));
                $res['result'][0]['distance'] = $distance['distance'];
        }
-       
-       if(autoriser('modifier','gis',$args['id_gis'],$GLOBALS['visiteur_session']))
+
+       if (autoriser('modifier', 'gis', $args['id_gis'], $GLOBALS['visiteur_session'])) {
                $res['result'][0]['modifiable'] = 1;
-       else
+       } else {
                $res['result'][0]['modifiable'] = 0;
-       $logo = quete_logo('id_gis','on', $res['result'][0]['id_gis'], '', false);
-       if(is_array($logo))
+       }
+       $logo = quete_logo('id_gis', 'on', $res['result'][0]['id_gis'], '', false);
+       if (is_array($logo)) {
                $res['result'][0]['logo'] = url_absolue($logo[0]);
+       }
 
-       if(defined('_DIR_PLUGIN_GISGEOM')){
-               if(isset($res['result'][0]['geo'])){
+       if (defined('_DIR_PLUGIN_GISGEOM')) {
+               if (isset($res['result'][0]['geo'])) {
                        include_spip('gisgeom_fonctions');
                        $res['result'][0]['geo'] = wkt_to_json($wkt);
                }
        }
 
        $gis_struct = $res['result'][0];
-       $gis_struct = array_map('texte_backend',$gis_struct);
+       $gis_struct = array_map('texte_backend', $gis_struct);
        return $gis_struct;
 }
-
-?>
\ No newline at end of file
index 9eff943..56baaa3 100644 (file)
@@ -5,48 +5,48 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
 //#############################################################################################
 //##############################################################################################
 
-/* INFOS SUR LE FICHIER 
+/* INFOS SUR LE FICHIER
 
-Nom : iptc.class.php 
-Rôle : contient la classe permettant de gérer les IPTC d'un fichier image 
-Développeur(s) : Arica Alex, Thies C. Arntzen 
+Nom : iptc.class.php
+Rôle : contient la classe permettant de gérer les IPTC d'un fichier image
+Développeur(s) : Arica Alex, Thies C. Arntzen
 
-FIN INFOS SUR LE FICHIER 
+FIN INFOS SUR LE FICHIER
 
 
-INFOS SUR LA CLASSE 'class_iptc' 
+INFOS SUR LA CLASSE 'class_iptc'
 
-REFERENCES : Développée le 04 Octobre 02 par Arica Alex avec l'aide de Thies C. Arntzen 
+REFERENCES : Développée le 04 Octobre 02 par Arica Alex avec l'aide de Thies C. Arntzen
 
-ROLE : permet de manipuler les iptc d'une image 
+ROLE : permet de manipuler les iptc d'une image
 
-VARIABLES : 
-- $h_codesIptc 
-- $h_cheminFichier 
-- $h_iptcData 
+VARIABLES :
+- $h_codesIptc
+- $h_cheminFichier
+- $h_iptcData
 
-METHODES : 
-- fct_lireIPTC 
-- fct_ecrireIPTC 
-- fct_iptcMaketag 
+METHODES :
+- fct_lireIPTC
+- fct_ecrireIPTC
+- fct_iptcMaketag
 
-FIN INFOS SUR LA CLASSE 
+FIN INFOS SUR LA CLASSE
 
-*/ 
+*/
 
 
-class class_IPTC 
-{ 
+class class_IPTC
+{
 
 
 
-/* VARIABLES statics */ 
+/* VARIABLES statics */
 
-var $h_codesIptc; /* $h_codesIptc : (tableau associatif) contient les codes des champs IPTC associés à un libellé */ 
-var $h_cheminImg; /* $h_cheminImg : (chaine) contient le chemin complet du fichier d'image */ 
-var $h_iptcData; /* $h_iptcData : (chaine) contient les données encodées de l'iptc de l'image */ 
+var $h_codesIptc; /* $h_codesIptc : (tableau associatif) contient les codes des champs IPTC associés à un libellé */
+var $h_cheminImg; /* $h_cheminImg : (chaine) contient le chemin complet du fichier d'image */
+var $h_iptcData; /* $h_iptcData : (chaine) contient les données encodées de l'iptc de l'image */
 
-/* FIN VARIABLES statics 
+/* FIN VARIABLES statics
 
 
 
@@ -56,7 +56,7 @@ var $h_iptcData; /* $h_iptcData : (chaine) contient les données encodées de l'
 
 
 
-------------------------------------------------------------------------------------------------------- 
+-------------------------------------------------------------------------------------------------------
 
 
 
@@ -65,68 +65,68 @@ var $h_iptcData; /* $h_iptcData : (chaine) contient les données encodées de l'
 
 
 
-INFOS SUR LA FONCTION 
+INFOS SUR LA FONCTION
 
-ROLE : constructeur 
-FONCTION : class_IPTC($cheminImg) 
-DESCRIPTION DES PARAMETRES : 
-- $cheminImg = (chaine) le chemin complet du fichier d'image à traiter 
+ROLE : constructeur
+FONCTION : class_IPTC($cheminImg)
+DESCRIPTION DES PARAMETRES :
+- $cheminImg = (chaine) le chemin complet du fichier d'image à traiter
 
-FIN INFOS SUR LA FONCTION */ 
+FIN INFOS SUR LA FONCTION */
 
 
-function class_IPTC($cheminImg) 
-{ 
+function class_IPTC($cheminImg)
+{
 
-// Inititalisations 
+// Inititalisations
 
-// Les valeurs IPTC pouvant être manipulées 
-$this -> h_codesIptc = array("005" => "objectName", 
-"007" => "editStatus", 
-"010" => "priority", 
-"015" => "category", 
-"020" => "supplementalCategory", 
-"022" => "fixtureIdentifier", 
-"025" => "keywords", 
-"030" => "releaseDate", 
-"035" => "releaseTime", 
-"040" => "specialInstructions", 
-"045" => "referenceService", 
-"047" => "referenceDate", 
-"050" => "referenceNumber", 
-"055" => "createdDate", 
-"060" => "createdTime", 
-"065" => "originatingProgram", 
-"070" => "programVersion", 
-"075" => "objectCycle", 
-"080" => "byline", 
-"085" => "bylineTitle", 
-"090" => "city", 
-"095" => "provinceState", 
-"100" => "countryCode", 
-"101" => "country", 
-"103" => "originalTransmissionReference", 
-"105" => "headline", 
-"110" => "credit", 
-"115" => "source", 
-"116" => "copyright", 
-"120" => "caption", 
-"121" => "localCaption", 
-"122" => "captionWriter"); 
+// Les valeurs IPTC pouvant être manipulées
+$this -> h_codesIptc = array("005" => "objectName",
+"007" => "editStatus",
+"010" => "priority",
+"015" => "category",
+"020" => "supplementalCategory",
+"022" => "fixtureIdentifier",
+"025" => "keywords",
+"030" => "releaseDate",
+"035" => "releaseTime",
+"040" => "specialInstructions",
+"045" => "referenceService",
+"047" => "referenceDate",
+"050" => "referenceNumber",
+"055" => "createdDate",
+"060" => "createdTime",
+"065" => "originatingProgram",
+"070" => "programVersion",
+"075" => "objectCycle",
+"080" => "byline",
+"085" => "bylineTitle",
+"090" => "city",
+"095" => "provinceState",
+"100" => "countryCode",
+"101" => "country",
+"103" => "originalTransmissionReference",
+"105" => "headline",
+"110" => "credit",
+"115" => "source",
+"116" => "copyright",
+"120" => "caption",
+"121" => "localCaption",
+"122" => "captionWriter");
 
 
-// On enregistre le chemin de l'image à traiter 
-$this -> h_cheminImg = $cheminImg; 
+// On enregistre le chemin de l'image à traiter
+$this -> h_cheminImg = $cheminImg;
 
 
-// On extrait les données encodées de l'iptc 
+// On extrait les données encodées de l'iptc
 // getimagesize($this -> h_cheminImg, &$info); //avant,marche pas sinon
-getimagesize($this -> h_cheminImg, $info); //marche sans le & 
-$this -> h_iptcData = $info["APP13"]; 
+getimagesize($this -> h_cheminImg, $info); //marche sans le &
+$this -> h_iptcData = $info["APP13"];
 
-} 
+}
 
-/* FIN FONCTION class_IPTC(); 
+/* FIN FONCTION class_IPTC();
 
 
 
@@ -136,7 +136,7 @@ $this -> h_iptcData = $info["APP13"];
 
 
 
-------------------------------------------------------------------------------------------------------- 
+-------------------------------------------------------------------------------------------------------
 
 
 
@@ -145,38 +145,38 @@ $this -> h_iptcData = $info["APP13"];
 
 
 
-INFOS SUR LA FONCTION 
+INFOS SUR LA FONCTION
 
-ROLE : lit les IPTC d'une image et les renvoie dans un tableau associatif 
-FONCTION : fct_lireIPTC() 
-TYPE RETOURNE : chaine sous forme de tableau associatif 
+ROLE : lit les IPTC d'une image et les renvoie dans un tableau associatif
+FONCTION : fct_lireIPTC()
+TYPE RETOURNE : chaine sous forme de tableau associatif
 
-FIN INFOS SUR LA FONCTION */ 
+FIN INFOS SUR LA FONCTION */
 
-function fct_lireIPTC() 
-{ 
-       $tblIPTC = iptcparse($this -> h_iptcData); 
-       
-       while( (is_array($tblIPTC)) && (list($codeIPTC, $valeurIPTC) = each($tblIPTC)) ) 
-       { 
-               $codeIPTC = str_replace("2#", "", $codeIPTC); 
-               
-               if( ($codeIPTC != "000") && ($codeIPTC != "140")  && $this->h_codesIptc["$codeIPTC"]) 
-               { 
-                       while(list($index, ) = each($valeurIPTC)) 
-                       { 
+function fct_lireIPTC()
+{
+       $tblIPTC = iptcparse($this -> h_iptcData);
+
+       while( (is_array($tblIPTC)) && (list($codeIPTC, $valeurIPTC) = each($tblIPTC)) )
+       {
+               $codeIPTC = str_replace("2#", "", $codeIPTC);
+
+               if( ($codeIPTC != "000") && ($codeIPTC != "140")  && $this->h_codesIptc["$codeIPTC"])
+               {
+                       while(list($index, ) = each($valeurIPTC))
+                       {
                                if ($this->h_codesIptc["$codeIPTC"]) $codeIPTC = $this->h_codesIptc["$codeIPTC"];
-                               $lesIptc[$codeIPTC] .= $valeurIPTC[$index].$retourLigne; 
-                               $retourLigne = "\n"; 
-                       } 
-               } 
-       } 
-       
-       if(is_array($lesIptc)) return $lesIptc; 
-       else return false; 
-} 
+                               $lesIptc[$codeIPTC] .= $valeurIPTC[$index].$retourLigne;
+                               $retourLigne = "\n";
+                       }
+               }
+       }
+
+       if(is_array($lesIptc)) return $lesIptc;
+       else return false;
+}
 
-/* FIN FONCTION fct_lireIPTC(); 
+/* FIN FONCTION fct_lireIPTC();
 
 
 
@@ -185,7 +185,7 @@ function fct_lireIPTC()
 
 
 
-------------------------------------------------------------------------------------------------------- 
+-------------------------------------------------------------------------------------------------------
 
 
 
@@ -194,79 +194,79 @@ function fct_lireIPTC()
 
 
 
-INFOS SUR LA FONCTION 
+INFOS SUR LA FONCTION
 
-ROLE : écrit des IPTC dans le fichier image 
-FONCTION : fct_ecrireIPTC() 
-DESCRIPTION DES PARAMETRES : 
-- $tblIPTC_util = (tableau associatif) contient les codes des champs IPTC à modifier associés leur valeur 
-- $cheminImgAModifier = (chaine) stocke le chemin de l'image dont l'IPTC est à modifier ; s'il est null 
-le chemin sera celui contenu dans '$this -> h_cheminImg' 
-TYPE RETOURNE : booléen 
+ROLE : écrit des IPTC dans le fichier image
+FONCTION : fct_ecrireIPTC()
+DESCRIPTION DES PARAMETRES :
+- $tblIPTC_util = (tableau associatif) contient les codes des champs IPTC à modifier associés leur valeur
+- $cheminImgAModifier = (chaine) stocke le chemin de l'image dont l'IPTC est à modifier ; s'il est null
+le chemin sera celui contenu dans '$this -> h_cheminImg'
+TYPE RETOURNE : booléen
 
-FIN INFOS SUR LA FONCTION */ 
+FIN INFOS SUR LA FONCTION */
 
-function fct_ecrireIPTC($tblIPTC_util, $cheminImgAModifier = "") 
-{ 
+function fct_ecrireIPTC($tblIPTC_util, $cheminImgAModifier = "")
+{
 
-// La tableau devant contenir des IPTC est vide ou n'est pas un tableau associatif 
-if( (empty($tblIPTC_util)) || (!is_array($tblIPTC_util)) ) return false; 
+// La tableau devant contenir des IPTC est vide ou n'est pas un tableau associatif
+if( (empty($tblIPTC_util)) || (!is_array($tblIPTC_util)) ) return false;
 
 
-// Si le chemin de l'image à modifier est vide alors on lui spécifie le chemin par défaut 
-if(empty($cheminImgAModifier)) $cheminImgAModifier = $this -> h_cheminImg; 
+// Si le chemin de l'image à modifier est vide alors on lui spécifie le chemin par défaut
+if(empty($cheminImgAModifier)) $cheminImgAModifier = $this -> h_cheminImg;
 
 
-// On récupère l'IPTC du fichier image courant 
-$tblIPTC_old = iptcparse($this -> h_iptcData); 
+// On récupère l'IPTC du fichier image courant
+$tblIPTC_old = iptcparse($this -> h_iptcData);
 
 
-// On prélève le tableau contenant les codes et les valeurs des IPTC de la photo 
-while(list($codeIPTC, $codeLibIPTC) = each($this -> h_codesIptc)) 
-{ 
+// On prélève le tableau contenant les codes et les valeurs des IPTC de la photo
+while(list($codeIPTC, $codeLibIPTC) = each($this -> h_codesIptc))
+{
 
-// On teste si les données originelles correspondant au code en cours sont présents 
-if (is_array($tblIPTC_old["2#".$codeIPTC])) $valIPTC_new = $tblIPTC_old["2#".$codeIPTC]; 
-else $valIPTC_new = array(); 
+// On teste si les données originelles correspondant au code en cours sont présents
+if (is_array($tblIPTC_old["2#".$codeIPTC])) $valIPTC_new = $tblIPTC_old["2#".$codeIPTC];
+else $valIPTC_new = array();
 
 
-// On remplace les valeurs des IPTC demandées 
-if (is_array($tblIPTC_util[$codeIPTC])) 
-{ 
-if (count($tblIPTC_util[$codeIPTC])) $valIPTC_new = $tblIPTC_util[$codeIPTC]; 
+// On remplace les valeurs des IPTC demandées
+if (is_array($tblIPTC_util[$codeIPTC]))
+{
+if (count($tblIPTC_util[$codeIPTC])) $valIPTC_new = $tblIPTC_util[$codeIPTC];
 
-}else{ 
+}else{
 
-$val = trim(strval($tblIPTC_util[$codeIPTC])); 
-if (strlen($val)) $valIPTC_new[0] = $val; 
-} 
+$val = trim(strval($tblIPTC_util[$codeIPTC]));
+if (strlen($val)) $valIPTC_new[0] = $val;
+}
 
 
-// On crée un nouveau iptcData à partir de '$tblIPTC_new' qui contient le code et la valeur de l'IPTC 
-foreach($valIPTC_new as $val) 
-{ 
-$iptcData_new .= $this -> fct_iptcMaketag(2, $codeIPTC, $val); 
-} 
+// On crée un nouveau iptcData à partir de '$tblIPTC_new' qui contient le code et la valeur de l'IPTC
+foreach($valIPTC_new as $val)
+{
+$iptcData_new .= $this -> fct_iptcMaketag(2, $codeIPTC, $val);
+}
 
-} 
+}
 
 
-/* A partir du nouveau iptcData contenu dans '$iptcData_new' on crée grâce à la fonction 'iptcembed()' 
-le contenu binaire du fichier image avec le nouveau IPTC inclu */ 
-$contenuImage = iptcembed($iptcData_new, $this -> h_cheminImg); 
+/* A partir du nouveau iptcData contenu dans '$iptcData_new' on crée grâce à la fonction 'iptcembed()'
+le contenu binaire du fichier image avec le nouveau IPTC inclu */
+$contenuImage = iptcembed($iptcData_new, $this -> h_cheminImg);
 
 
-// Ecriture dans le fichier image 
-$idFichier = fopen($cheminImgAModifier, "wb"); 
-fwrite($idFichier, $contenuImage); 
-fclose($idFichier); 
+// Ecriture dans le fichier image
+$idFichier = fopen($cheminImgAModifier, "wb");
+fwrite($idFichier, $contenuImage);
+fclose($idFichier);
 
 
-return true; 
+return true;
 
-} 
+}
 
-/* FIN FONCTION fct_ecrireIPTC(); 
+/* FIN FONCTION fct_ecrireIPTC();
 
 
 
@@ -275,7 +275,7 @@ return true;
 
 
 
-------------------------------------------------------------------------------------------------------- 
+-------------------------------------------------------------------------------------------------------
 
 
 
@@ -284,44 +284,44 @@ return true;
 
 
 
-INFOS SUR LA FONCTION 
+INFOS SUR LA FONCTION
 
-ROLE : permet de transformer une valeur de d'IPTC (code + valeur) en iptcData 
-AUTEUR : Thies C. Arntzen 
-FONCTION : fct_iptcMaketag($rec, $dat, $val) 
-DESCRIPTION DES PARAMETRES : 
-- $rec = (entier) toujours à mettre à 2 
-- $dat = (chaine) le code de l'IPTC (de type '110' et non '2#110') 
-- $val = (chaine) la valeur de l'IPTC 
-TYPE RETOURNE : booléen 
+ROLE : permet de transformer une valeur de d'IPTC (code + valeur) en iptcData
+AUTEUR : Thies C. Arntzen
+FONCTION : fct_iptcMaketag($rec, $dat, $val)
+DESCRIPTION DES PARAMETRES :
+- $rec = (entier) toujours à mettre à 2
+- $dat = (chaine) le code de l'IPTC (de type '110' et non '2#110')
+- $val = (chaine) la valeur de l'IPTC
+TYPE RETOURNE : booléen
 
-FIN INFOS SUR LA FONCTION */ 
+FIN INFOS SUR LA FONCTION */
 
-function fct_iptcMaketag($rec, $dat, $val) 
-{ 
-$len = strlen($val); 
-if ($len < 0x8000) 
-return chr(0x1c).chr($rec).chr($dat). 
-chr($len >> 8). 
-chr($len & 0xff). 
-$val; 
-else 
-return chr(0x1c).chr($rec).chr($dat). 
-chr(0x80).chr(0x04). 
-chr(($len >> 24) & 0xff). 
-chr(($len >> 16) & 0xff). 
-chr(($len >> 8 ) & 0xff). 
-chr(($len ) & 0xff). 
-$val; 
-} 
+function fct_iptcMaketag($rec, $dat, $val)
+{
+$len = strlen($val);
+if ($len < 0x8000)
+return chr(0x1c).chr($rec).chr($dat).
+chr($len >> 8).
+chr($len & 0xff).
+$val;
+else
+return chr(0x1c).chr($rec).chr($dat).
+chr(0x80).chr(0x04).
+chr(($len >> 24) & 0xff).
+chr(($len >> 16) & 0xff).
+chr(($len >> 8 ) & 0xff).
+chr(($len ) & 0xff).
+$val;
+}
 
-// FIN FONCTION fct_iptcMaketag(); 
+// FIN FONCTION fct_iptcMaketag();
 
 
 
 
 
-} 
+}
 
 /* Fin class_IPTC */
 
index 484c03e..3fd7663 100644 (file)
@@ -6,30 +6,33 @@
  * -* récupérer un titre
  * -* récupérer un descriptif
  */
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function inc_kml_infos($id_document){
-       if(!intval($id_document))
+function inc_kml_infos($id_document) {
+       if (!intval($id_document)) {
                return false;
+       }
        include_spip('inc/documents');
-       $document = sql_fetsel("*", "spip_documents","id_document=".intval($id_document));
+       $document = sql_fetsel('*', 'spip_documents', 'id_document=' . intval($id_document));
        $chemin = $document['fichier'];
        $chemin = get_spip_doc($chemin);
        $extension = $document['extension'];
-       
-       if(in_array($extension,array('kml','kmz'))){
+
+       if (in_array($extension, array('kml','kmz'))) {
                $supprimer_chemin = false;
                /**
                 * Si on est dans un kmz (kml + autres fichiers compressés en zip),
                 * On dézip pour trouver le kml
                 */
-               if($extension == 'kmz'){
+               if ($extension == 'kmz') {
                        include_spip('inc/pclzip');
                        $zip = new PclZip($chemin);
                        $list = $zip->listContent();
-                       foreach($list as $fichier => $info_fichier){
-                               if(substr(basename($info_fichier['filename']),-3) == 'kml'){
-                                       $zip->extractByIndex($info_fichier['index'],_DIR_TMP);
+                       foreach ($list as $fichier => $info_fichier) {
+                               if (substr(basename($info_fichier['filename']), -3) == 'kml') {
+                                       $zip->extractByIndex($info_fichier['index'], _DIR_TMP);
                                        $chemin = _DIR_TMP.$info_fichier['filename'];
                                        $supprimer_chemin = true;
                                        break;
@@ -37,50 +40,58 @@ function inc_kml_infos($id_document){
                        }
                }
                include_spip('inc/xml');
-               $ret = lire_fichier($chemin,$donnees);
+               $donnees = '';
+               lire_fichier($chemin, $donnees);
                $arbre = spip_xml_parse($donnees);
-               spip_xml_match_nodes(",^Document,",$arbre, $documents);
-               foreach($documents as $document => $info){
+               $documents = $infos = array();
+               spip_xml_match_nodes(',^Document,', $arbre, $documents);
+               foreach ($documents as $document => $info) {
                        $infos['titre'] = $info[0]['name'][0];
                        $infos['descriptif'] = $info[0]['description'][0];
                        $infos['longitude'] = $info[0]['LookAt'][0]['longitude'][0] ? $info[0]['LookAt'][0]['longitude'][0] : false;
                        $infos['latitude'] = $info[0]['LookAt'][0]['latitude'][0] ? $info[0]['LookAt'][0]['latitude'][0] : false;
                }
-               
+
                /**
-                * Si on n'a pas de longitude ou de latitude, 
+                * Si on n'a pas de longitude ou de latitude,
                 * on essaie de faire une moyenne des placemarks
                 */
-               if(!$infos['longitude'] OR !$infos['latitude']){
-                       spip_xml_match_nodes(",^Placemark,",$arbre, $placemarks);
+               if (!$infos['longitude'] or !$infos['latitude']) {
+                       $placemarks = array();
+                       spip_xml_match_nodes(',^Placemark,', $arbre, $placemarks);
                        $latitude = 0;
                        $longitude = 0;
                        $compte = 0;
-                       foreach($placemarks as $places){
-                               foreach($places as $placemark => $lieu){
-                                       if($compte > 500)
-                                                       break;  
-                                       if($lieu['LookAt'][0]['longitude'][0] && $latitude + $lieu['LookAt'][0]['latitude'][0]){
-                                               if($compte > 500)
-                                                       break;  
+                       foreach ($placemarks as $places) {
+                               foreach ($places as $lieu) {
+                                       if ($compte > 500) {
+                                               break;
+                                       }
+                                       if ($lieu['LookAt'][0]['longitude'][0] && $latitude + $lieu['LookAt'][0]['latitude'][0]) {
+                                               if ($compte > 500) {
+                                                       break;
+                                               }
                                                $latitude = $latitude + $lieu['LookAt'][0]['latitude'][0];
                                                $longitude = $longitude + $lieu['LookAt'][0]['longitude'][0];
                                                $compte++;
-                                       }else if($lieu['Point'][0]['coordinates'][0]){
-                                               if($compte > 500)
+                                       } elseif ($lieu['Point'][0]['coordinates'][0]) {
+                                               if ($compte > 500) {
                                                        break;
-                                               $coordinates = explode(',',$lieu['Point'][0]['coordinates'][0]);
+                                               }
+                                               $coordinates = explode(',', $lieu['Point'][0]['coordinates'][0]);
                                                $latitude = $latitude + trim($coordinates[1]);
                                                $longitude = $longitude + trim($coordinates[0]);
                                                $compte++;
-                                       }else if($lieu['Polygon'][0]['outerBoundaryIs'][0]['LinearRing'][0]['coordinates'][0]){
-                                               if($compte > 500)
+                                       } elseif ($lieu['Polygon'][0]['outerBoundaryIs'][0]['LinearRing'][0]['coordinates'][0]) {
+                                               if ($compte > 500) {
                                                        break;
-                                               $coordinates = explode(' ',trim($lieu['Polygon'][0]['outerBoundaryIs'][0]['LinearRing'][0]['coordinates'][0]));
-                                               foreach($coordinates as $coordinate){
-                                                       if($compte > 500)
+                                               }
+                                               $coordinates = explode(' ', trim($lieu['Polygon'][0]['outerBoundaryIs'][0]['LinearRing'][0]['coordinates'][0]));
+                                               foreach ($coordinates as $coordinate) {
+                                                       if ($compte > 500) {
                                                                break;
-                                                       $coordinate = explode(',',$coordinate);
+                                                       }
+                                                       $coordinate = explode(',', $coordinate);
                                                        $latitude = $latitude + trim($coordinate[1]);
                                                        $longitude = $longitude + trim($coordinate[0]);
                                                        $compte++;
@@ -88,100 +99,112 @@ function inc_kml_infos($id_document){
                                        }
                                }
                        }
-                       if(($latitude != 0) && ($longitude != 0)){
+                       if (($latitude != 0) and ($longitude != 0)) {
                                $infos['latitude'] = $latitude / $compte;
-                               $infos['longitude'] = $longitude / $compte; 
+                               $infos['longitude'] = $longitude / $compte;
                        }
                }
-               
+
                /**
                 * Si pas de titre ou si le titre est égal au nom de fichier ou contient kml ou kmz :
                 * -* on regarde s'il n'y a qu'un seul Folder et on récupère son nom;
                 * -* on regarde s'il n'y a qu'un seul Placemark et on récupère son nom;
                 */
-               if(!$infos['titre'] OR ($infos['titre'] == basename($chemin)) OR (preg_match(',\.km.,',$infos['titre']) > 0)){
-                       spip_xml_match_nodes(",^Folder,",$arbre, $folders);
-                       if(count($folders['Folder']) == 1){
-                               foreach($folders['Folder'] as $folder => $dossier){
-                                       if($dossier['name'][0])
+               if (!$infos['titre'] or ($infos['titre'] == basename($chemin)) or (preg_match(',\.km.,', $infos['titre']) > 0)) {
+                       $folders = array();
+                       spip_xml_match_nodes(',^Folder,', $arbre, $folders);
+                       if (count($folders['Folder']) == 1) {
+                               foreach ($folders['Folder'] as $dossier) {
+                                       if ($dossier['name'][0]) {
                                                $infos['titre'] = $dossier['name'][0];
-                                       if(!$infos['descriptif'] && $dossier['description'][0])
+                                       }
+                                       if (!$infos['descriptif'] && $dossier['description'][0]) {
                                                $infos['descriptif'] = $dossier['description'][0];
+                                       }
                                }
-                       }else{
-                               if(!is_array($placemarks)){
-                                       spip_xml_match_nodes(",^Placemark,",$arbre, $placemarks);
+                       } else {
+                               if (!is_array($placemarks)) {
+                                       spip_xml_match_nodes(',^Placemark,', $arbre, $placemarks);
                                }
-                               if(count($placemarks) == 1){
-                                       foreach($placemarks as $places){
-                                               if(count($places) == 1){
-                                                       foreach($places as $placemark => $lieu){
-                                                               if($lieu['name'][0])
+                               if (count($placemarks) == 1) {
+                                       foreach ($placemarks as $places) {
+                                               if (count($places) == 1) {
+                                                       foreach ($places as $lieu) {
+                                                               if ($lieu['name'][0]) {
                                                                        $infos['titre'] = $lieu['name'][0];
-                                                               if(!$infos['descriptif'] && $lieu['description'][0])
+                                                               }
+                                                               if (!$infos['descriptif'] && $lieu['description'][0]) {
                                                                        $infos['descriptif'] = $lieu['description'][0];
+                                                               }
                                                        }
                                                }
                                        }
                                }
                        }
                }
-       }else if(in_array($extension,array('gpx'))){
+       } elseif (in_array($extension, array('gpx'))) {
                $supprimer_chemin = false;
                include_spip('inc/xml');
-               $ret = lire_fichier($chemin,$donnees);
+               $donnees = '';
+               lire_fichier($chemin, $donnees);
                $arbre = spip_xml_parse($donnees);
-               spip_xml_match_nodes(",^metadata,",$arbre, $metadatas);
-               foreach($metadatas as $metadata => $info){
+               $metadatas = array();
+               spip_xml_match_nodes(',^metadata,', $arbre, $metadatas);
+               foreach ($metadatas as $info) {
                        $infos['titre'] = $info[0]['name'][0];
                        //$infos['date'] =  $info[0]['time'][0];
                        $infos['descriptif'] = $info[0]['description'][0];
-                       foreach($info[0] as $meta => $data){
-                               if(preg_match(',^bounds ,',$meta)){
+                       foreach ($info[0] as $meta => $data) {
+                               if (preg_match(',^bounds ,', $meta)) {
                                        $meta = '<'.$meta.'>';
-                                       $maxlat = extraire_attribut($meta,'maxlat');
-                                       $minlat = extraire_attribut($meta,'minlat');
-                                       $maxlon = extraire_attribut($meta,'maxlon');
-                                       $minlon = extraire_attribut($meta,'minlon');
-                                       if($maxlat && $minlat)
+                                       $maxlat = extraire_attribut($meta, 'maxlat');
+                                       $minlat = extraire_attribut($meta, 'minlat');
+                                       $maxlon = extraire_attribut($meta, 'maxlon');
+                                       $minlon = extraire_attribut($meta, 'minlon');
+                                       if ($maxlat && $minlat) {
                                                $infos['latitude'] = (($maxlat+$minlat)/2);
-                                       if($maxlon && $minlon)
+                                       }
+                                       if ($maxlon && $minlon) {
                                                $infos['longitude'] = (($maxlon+$minlon)/2);
+                                       }
                                }
                        }
                }
                /**
-                * Si on n'a pas de longitude ou de latitude, 
+                * Si on n'a pas de longitude ou de latitude,
                 * on essaie de faire une moyenne des placemarks
                 */
-               if(!$infos['longitude'] OR !$infos['latitude']){
-                       spip_xml_match_nodes(",^trkpt,",$arbre, $trackpoints);
+               if (!$infos['longitude'] or !$infos['latitude']) {
+                       $trackpoints = array();
+                       spip_xml_match_nodes(',^trkpt,', $arbre, $trackpoints);
                        $latitude = 0;
                        $longitude = 0;
                        $compte = 0;
-                       foreach($trackpoints as $places => $place){
-                               foreach($place as $placemark => $lieu){
-                                       if($compte > 10)
-                                                       break;
+                       foreach ($trackpoints as $places => $place) {
+                               foreach ($place as $lieu) {
+                                       if ($compte > 10) {
+                                               break;
+                                       }
                                }
                        }
-                       if(($latitude != 0) && ($longitude != 0)){
+                       if (($latitude != 0) && ($longitude != 0)) {
                                $infos['latitude'] = $latitude / $compte;
-                               $infos['longitude'] = $longitude / $compte; 
+                               $infos['longitude'] = $longitude / $compte;
                        }
                }
-       }else
+       } else {
                return false;
-       
-       if(isset($infos['titre']))
-               $infos['titre'] = preg_replace('/<!\[cdata\[(.*?)\]\]>/is', '$1',$infos['titre']);
-       if(isset($infos['descriptif']))
+       }
+
+       if (isset($infos['titre'])) {
+               $infos['titre'] = preg_replace('/<!\[cdata\[(.*?)\]\]>/is', '$1', $infos['titre']);
+       }
+       if (isset($infos['descriptif'])) {
                $infos['descriptif'] = preg_replace('/<!\[cdata\[(.*?)\]\]>/is', '$1', $infos['descriptif']);
-               
-       if($supprimer_chemin){
+       }
+       if ($supprimer_chemin) {
                supprimer_fichier($chemin);
        }
-               
+
        return $infos;
 }
-?>
\ No newline at end of file
diff --git a/www/plugins/gis/javascript/.eslintrc b/www/plugins/gis/javascript/.eslintrc
new file mode 100644 (file)
index 0000000..4ebb882
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "rules": {
+    "camelcase": 0,
+    "quotes": [2, "single", "avoid-escape"],
+    "no-mixed-spaces-and-tabs": [2, "smart-tabs"],
+    "space-before-function-paren": 2,
+    "space-in-parens": 2,
+    "object-curly-spacing": [2, "never"],
+    "array-bracket-spacing": 2,
+    "computed-property-spacing": 2,
+    "space-before-blocks": 2,
+    "keyword-spacing": 2,
+    "no-lonely-if": 2,
+    "comma-style": 2,
+    "no-underscore-dangle": 0,
+    "no-constant-condition": 0,
+    "no-multi-spaces": 0,
+    "strict": 0,
+    "key-spacing": 0,
+    "no-shadow": 0,
+    "no-unused-vars": 2
+  },
+  "globals": {
+    "L": true,
+    "module": false,
+    "define": false,
+    "require": true
+  },
+  "env": {
+    "browser": true
+  }
+}
index 8537b6a..cacd208 100644 (file)
@@ -2,19 +2,19 @@
 
 [(#INCLURE{lib/leaflet/dist/[(#CONFIG{auto_compress_js}|=={oui}|?{'leaflet','leaflet-src'})].js})]
 
-[L.Icon.Default.imagePath = "(#CHEMIN{lib/leaflet/dist/images}|url_absolue)";]
+[L.Icon.Default.imagePath = '(#CHEMIN{lib/leaflet/dist/images}|url_absolue)';]
 
 (function() {
 
 L.gisConfig = {
-       "gis_layers":#EVAL{json_encode($GLOBALS['gis_layers'])},
-       "default_layer":"[(#REM|gis_layer_defaut)]",
-       "affiche_layers":[(#CONFIG{gis/layers,#ARRAY}|json_encode)]
+       'gis_layers': #EVAL{json_encode($GLOBALS['gis_layers'])},
+       'default_layer': '[(#REM|gis_layer_defaut)]',
+       'affiche_layers': [(#CONFIG{gis/layers,#ARRAY}|json_encode)]
 };
 
 L.geocoderConfig = {
-       "forwardUrl":"[(#VAL{gis_geocoder_rechercher}|generer_url_action{mode=search}|html_entity_decode)]",
-       "reverseUrl":"[(#VAL{gis_geocoder_rechercher}|generer_url_action{mode=reverse}|html_entity_decode)]"
+       'forwardUrl': '[(#VAL{gis_geocoder_rechercher}|generer_url_action{mode=search}|html_entity_decode)]',
+       'reverseUrl': '[(#VAL{gis_geocoder_rechercher}|generer_url_action{mode=reverse}|html_entity_decode)]'
 };
 
 })();
@@ -27,6 +27,8 @@ L.geocoderConfig = {
 
 [(#INCLURE{lib/leaflet/plugins/GPX.js})]
 
+[(#INCLURE{lib/leaflet/plugins/TOPOJSON.js})]
+
 [(#INCLURE{lib/leaflet/plugins/leaflet-providers.js})]
 
 [(#INCLURE{lib/leaflet/plugins/Control.FullScreen.js})]
@@ -53,5 +55,5 @@ L.geocoderConfig = {
 [(#INCLURE{javascript/leaflet.gis.js})]
 
 [(#CONFIG{auto_compress_js}|=={oui}|oui)
-#FILTRE{compacte}
-]
+// gis.js
+#FILTRE{trim|compacte}]
\ No newline at end of file
index 1494d32..3eec60d 100644 (file)
@@ -36,7 +36,7 @@ L.Geocoder = L.Class.extend({
                                q: text,
                                limit: this.options.limit,
                                addressdetails: this.options.addressdetails,
-                               "accept-language":this.options.acceptLanguage
+                               'accept-language': this.options.acceptLanguage
                        }
                );
        },
@@ -60,66 +60,126 @@ L.Geocoder = L.Class.extend({
                        dataType: 'jsonp',
                        jsonp: 'json_callback',
                        success: this._callback,
+                       error: function (e) {
+                               /**
+                                * Photon me renvoie une erreur à chaque fois
+                                */
+                               if (e.statusText == 'OK' && e.status == '200') {
+                                       this._callback(e.responseText,e.status,e);
+                               }
+                       },
                        url: url
                });
        },
        
-       _callback: function (response,textStatus,jqXHR) {
-               var return_location = {};
-               if(this.options.search)
+       _callback: function (response, textStatus, jqXHR) {
+               var return_location = {},
+                       geocoder_server = false;
+               if (this.options.search) {
                        return_location.search = this.options.search;
+               }
+               if (typeof response === 'string') {
+                       geocoder_server = 'photon';
+                       response = JSON.parse(response);
+               }
                if (((response instanceof Array) && (!response.length)) || ((response instanceof Object) && (response.error))) {
                        return_location.error = 'not found';
                } else {
                        return_location.street = return_location.postcode = return_location.postcode = 
                        return_location.locality = return_location.region = return_location.country  = '';
+                       if (geocoder_server == 'photon') {
+                               if (!response.features.length || response.features.length == 0) {
+                                       return_location.error = 'not found';
+                               }
+                               else {
+                                       place = response.features[0];
+                                       var street_components = [];
 
-                       if (response.length > 0)
-                               place = response[0];
-                       else {
-                               place = response;
+                                       if (place.properties.country) {
+                                               return_location.country = place.properties.country;
+                                       }
+                                       if (place.properties.country_code) {
+                                               return_location.country_code = place.properties.country_code;
+                                       }
+                                       if (place.properties.state) {
+                                               return_location.region = place.properties.state;
+                                       }
+                                       if (place.properties.city) {
+                                               return_location.locality = place.properties.city;
+                                       } else if (place.properties.town) {
+                                               return_location.locality = place.properties.town;
+                                       } else if (place.properties.village) {
+                                               return_location.locality = place.properties.village;
+                                       } else if (place.properties.osm_key == 'place' && (place.properties.osm_value == 'city' || place.properties.osm_value == 'village')) {
+                                               return_location.locality = place.properties.name;
+                                       } else if (place.properties.county) {
+                                               street_components.push(place.properties.county);
+                                       }
+                                       if (place.properties.postcode) {
+                                               return_location.postcode = place.properties.postcode;
+                                       }
+                                       if (place.properties.street) {
+                                               street_components.push(place.properties.street);
+                                       }
+                                       else if (place.properties.road) {
+                                               street_components.push(place.properties.road);
+                                       } else if (place.properties.pedestrian) {
+                                               street_components.push(place.properties.pedestrian);
+                                       }
+                                       if (place.properties.housenumber) {
+                                               street_components.unshift(place.properties.housenumber);
+                                       }
+                                       if (return_location.street === '' && street_components.length > 0) {
+                                               return_location.street = street_components.join(' ');
+                                       }
+                                       place.lat = place.geometry.coordinates[1];
+                                       place.lon = place.geometry.coordinates[0];
+                                       return_location.point = new L.LatLng(place.lat, place.lon);
+                               }
                        }
+                       else {
+                               if (response.length > 0)
+                                       place = response[0];
+                               else {
+                                       place = response;
+                               }
 
-                       var street_components = [];
-
-                       if (place.address.country) {
-                               return_location.country = place.address.country;
-                       }
-                       if (place.address.country_code) {
-                               return_location.country_code = place.address.country_code;
-                       }
-                       if (place.address.state) {
-                               return_location.region = place.address.state;
-                       }
-                       /* un jour peut-être...
-                       if (place.address.county) {
-                               return_location.departement = place.address.county;
-                       }
-                       */
-                       if (place.address.city) {
-                               return_location.locality = place.address.city;
-                       } else if (place.address.town) {
-                               return_location.locality = place.address.town;
-                       } else if (place.address.village) {
-                               return_location.locality = place.address.village;
-                       } else if (place.address.county) {
-                               street_components.push(place.address.county);
-                       }
-                       if (place.address.postcode) {
-                               return_location.postcode = place.address.postcode;
-                       }
-                       if (place.address.road) {
-                               street_components.push(place.address.road);
-                       } else if (place.address.pedestrian) {
-                               street_components.push(place.address.pedestrian);
-                       }
-                       if (place.address.house_number) {
-                               street_components.unshift(place.address.house_number);
-                       }
-                       if (return_location.street === '' && street_components.length > 0) {
-                               return_location.street = street_components.join(' ');
+                               var street_components = [];
+       
+                               if (place.address.country) {
+                                       return_location.country = place.address.country;
+                               }
+                               if (place.address.country_code) {
+                                       return_location.country_code = place.address.country_code;
+                               }
+                               if (place.address.state) {
+                                       return_location.region = place.address.state;
+                               }
+                               if (place.address.city) {
+                                       return_location.locality = place.address.city;
+                               } else if (place.address.town) {
+                                       return_location.locality = place.address.town;
+                               } else if (place.address.village) {
+                                       return_location.locality = place.address.village;
+                               } else if (place.address.county) {
+                                       street_components.push(place.address.county);
+                               }
+                               if (place.address.postcode) {
+                                       return_location.postcode = place.address.postcode;
+                               }
+                               if (place.address.road) {
+                                       street_components.push(place.address.road);
+                               } else if (place.address.pedestrian) {
+                                       street_components.push(place.address.pedestrian);
+                               }
+                               if (place.address.house_number) {
+                                       street_components.unshift(place.address.house_number);
+                               }
+                               if (return_location.street === '' && street_components.length > 0) {
+                                       return_location.street = street_components.join(' ');
+                               }
+                               return_location.point = new L.LatLng(place.lat, place.lon);
                        }
-                       return_location.point = new L.LatLng(place.lat, place.lon);
                }
                this._user_callback(return_location);
        }
index 0faa8fd..c636b46 100644 (file)
@@ -1,11 +1,11 @@
-function gis_focus_marker(id, map) {
+function gis_focus_marker (id, map) {
        var carte = eval('map'+ map);
        var i, count = 0;
-       for(i in carte._layers) {
+       for (i in carte._layers) {
                if ((carte._layers[i].feature) && (carte._layers[i].feature.id == id)) {
                        carte.panTo(carte._layers[i].getLatLng());
                        carte._layers[i].openPopup();
                }
-       count++;
+               count++;
        }
 }
\ No newline at end of file
index f55cd4a..87a8992 100644 (file)
@@ -1,4 +1,4 @@
-(function() {
+(function () {
 // Plugin Leaflet L.Map.Gis
 L.Map.Gis = L.Map.extend({
        
@@ -31,38 +31,40 @@ L.Map.Gis = L.Map.extend({
                openId: false,
                affiche_points: true,
                json_points: {
-                       url: "",
-                       objets: "",
+                       url: '',
+                       objets: '',
                        limit: 500,
                        env: [],
-                       titre: "",
-                       description: "",
-                       icone: ""
+                       titre: '',
+                       description: '',
+                       icone: ''
                },
                localize_visitor: false,
                localize_visitor_zoom: 0,
                centrer_fichier: true,
                kml: false,
                gpx: false,
-               geojson: false
+               geojson: false,
+               topojson: false,
+               langue: false
        },
        
        initialize: function (id,options) {
                L.Util.setOptions(this, options);
                
-               this.on('load',function(e){
+               this.on('load', function () {
                        // Affecter sur l'objet du DOM
-                       jQuery("#"+this._container.id).get(0).map = this;
+                       jQuery('#'+this._container.id).get(0).map = this;
                        // Appeler l'éventuelle fonction de callback
-                       if (this.options.callback && typeof(this.options.callback) === "function")
+                       if (this.options.callback && typeof(this.options.callback) === 'function')
                                this.options.callback(this);
                        // trigger load sur l'objet du DOM
-                       jQuery("#"+this._container.id).trigger('load',this);
+                       jQuery('#'+this._container.id).trigger('load',this);
                });
                
                L.Map.prototype.initialize.call(this, id, options);
                
-               if (this.options.utiliser_bb){
+               if (this.options.utiliser_bb) {
                        this.fitBounds(
                                L.latLngBounds(
                                        [this.options.sw_lat, this.options.sw_lon],
@@ -79,9 +81,9 @@ L.Map.Gis = L.Map.extend({
                
                this.addOverlays();
                
-               if (this.options.localize_visitor){
+               if (this.options.localize_visitor) {
                        var maxZoom = this.options.localize_visitor_zoom;
-                       this.on('locationerror',function(e){
+                       this.on('locationerror',function (e) {
                                maxZoom = this.options.zoom;
                                alert(e.message);
                        });
@@ -89,22 +91,27 @@ L.Map.Gis = L.Map.extend({
                }
                
                // Si pas de points affichés trigger ready ici
-               if (!this.options.affiche_points || !this.options.json_points.length)
-                       jQuery("#"+this._container.id).trigger('ready',this);
+               if (!this.options.affiche_points || !Object.keys(this.options.json_points).length) {
+                       jQuery('#'+this._container.id).trigger('ready', this);
+               }
        },
 
-       populateTileLayers: function (tilelayers) {
+       populateTileLayers: function () {
                // Fond de carte par défaut
-               var default_layer = this.createTileLayer(this.options.default_layer);
-               this.addLayer(default_layer);
+               if (this.options.default_layer != 'none') {
+                       var default_layer = this.createTileLayer(this.options.default_layer);
+                       this.addLayer(default_layer);
+               }
                // Fonds de carte supplémentaires
-               if (this.options.layersControl && !this.options.noControl && this.options.affiche_layers.length>1){
+               if (this.options.layersControl && !this.options.noControl && this.options.affiche_layers.length>1) {
                        var layers_control = L.control.layers('','',this.options.layersControlOptions);
-                       layers_control.addBaseLayer(default_layer,this.options.gis_layers[this.options.default_layer].nom);
-                       for(var l in this.options.affiche_layers){
-                               if (this.options.affiche_layers[l]!==this.options.default_layer){
+                       if (this.options.default_layer != 'none') {
+                               layers_control.addBaseLayer(default_layer,this.options.gis_layers[this.options.default_layer].nom);
+                       }
+                       for (var l in this.options.affiche_layers) {
+                               if (this.options.affiche_layers[l]!==this.options.default_layer) {
                                        var layer = this.createTileLayer(this.options.affiche_layers[l]);
-                                       if (typeof layer!=="undefined")
+                                       if (typeof layer!=='undefined')
                                                layers_control.addBaseLayer(layer,this.options.gis_layers[this.options.affiche_layers[l]].nom);
                                }
                        }
@@ -120,7 +127,7 @@ L.Map.Gis = L.Map.extend({
                this.attributionControl.setPrefix('');
                if (this.options.scaleControl)
                        L.control.scale().addTo(this);
-               if (this.options.overviewControl){
+               if (this.options.overviewControl && this.options.default_layer != 'none') {
                        // todo ajouter une option pour permettre de choisir la couche à afficher dans la minimap
                        var minimap_layer = this.createTileLayer(this.options.default_layer);
                        L.control.minimap(minimap_layer,{width: 100,height: 100, toggleDisplay: true}).addTo(this);
@@ -129,15 +136,15 @@ L.Map.Gis = L.Map.extend({
        
        createTileLayer: function (name) {
                var layer;
-               if (typeof this.options.gis_layers[name]!=="undefined")
-                       eval("layer=new "+ this.options.gis_layers[name].layer +";");
+               if (typeof this.options.gis_layers[name]!=='undefined')
+                       eval('layer=new '+ this.options.gis_layers[name].layer +';');
                return layer;
        },
 
        // API setGeoJsonFeatureIcon : Pour Ajouter l'icone d'un point (feature = item d'un GeoJson)
        setGeoJsonFeatureIcon: function (feature, layer) {
                // Déclarer l'icone du points, si défini
-               if (feature.properties && feature.properties.icon){
+               if (feature.properties && feature.properties.icon) {
                        icon_options = {
                                'iconUrl': feature.properties.icon,
                                'iconSize': [feature.properties.icon_size[0], feature.properties.icon_size[1]],
@@ -156,12 +163,26 @@ L.Map.Gis = L.Map.extend({
        // API setGeoJsonFeaturePopup : Pour Ajouter le texte de popup d'un point (feature = item d'un GeoJson)
        setGeoJsonFeaturePopup: function (feature, layer) {
                // Déclarer le contenu de la popup s'il y en a
-               if (feature.properties && (feature.properties.title || feature.properties.description)){
-                       var popupContent = '';
-                       var popupOptions = '';
-                       if (feature.properties.title)
+               if (feature.properties 
+                       && !feature.properties.noclick 
+                       && (feature.properties.title || feature.properties.description || 
+                               (this.options.langue && (feature.properties['title_'+this.options.langue] || feature.properties['description_'+this.options.langue])))) {
+                       var popupContent = '',
+                               popupOptions = '',
+                               description_ok = false;
+                       if (this.options.langue) {
+                               langue = this.options.langue;
+                               if (feature.properties['title_'+langue]) {
+                                       popupContent = '<strong class="title">' + feature.properties['title_'+langue] + '</strong>';
+                               } else if (feature.properties.title)
+                                       popupContent = '<strong class="title">' + feature.properties.title + '</strong>';
+                               if (feature.properties['description_'+langue]) {
+                                       popupContent = popupContent + feature.properties['description_'+langue];
+                                       description_ok = true;
+                               }
+                       } else if(feature.properties.title)
                                popupContent = '<strong class="title">' + feature.properties.title + '</strong>';
-                       if (feature.properties.description)
+                       if (!description_ok && feature.properties.description)
                                popupContent = popupContent + feature.properties.description;
                        if (feature.properties.popup_options)
                                popupOptions = feature.properties.popup_options;
@@ -170,22 +191,29 @@ L.Map.Gis = L.Map.extend({
        },
        
        // API parseGeoJson
-       parseGeoJson: function(data) {
+       parseGeoJson: function (data) {
                var map = this;
                // Analyse des points et déclaration (sans regroupement des points en cluster)
-               if (!map.options.cluster){
-                       if (data.features.length > 0){
+               if (!map.options.cluster) {
+                       if (data.features && data.features.length > 0) {
                                var geojson = L.geoJson('', {
-                                       style: this.options.pathStyles,
+                                       style: this.options.pathStyles ? this.options.pathStyles : function (feature) {
+                                               if (feature.properties && feature.properties.styles)
+                                                       return feature.properties.styles;
+                                               else
+                                                       return '';
+                                       },
                                        onEachFeature: function (feature, layer) {
                                                // Déclarer l'icone du point
-                                               map.setGeoJsonFeatureIcon(feature, layer);
+                                               if (feature.geometry.type == 'Point') {
+                                                       map.setGeoJsonFeatureIcon(feature, layer);
+                                               }
                                                // Déclarer le contenu de la popup s'il y en a
                                                map.setGeoJsonFeaturePopup(feature, layer);
                                        }
                                }).addData(data).addTo(map);
-                               
-                               if (map.options.autocenterandzoom){
+
+                               if (map.options.autocenterandzoom) {
                                        if (data.features.length == 1 && data.features[0].geometry.type == 'Point')
                                                map.setView(geojson.getBounds().getCenter(), map.options.zoom);
                                        else
@@ -194,15 +222,15 @@ L.Map.Gis = L.Map.extend({
                                if (map.options.openId)
                                        gis_focus_marker(map.options.openId,map.options.mapId);
 
-                               if (typeof map.geojsons=="undefined") map.geojsons = [];
+                               if (typeof map.geojsons=='undefined') map.geojsons = [];
                                map.geojsons.push(geojson);
                        }
                } else {
-                       map.markers = L.markerClusterGroup(map.options.clusterOptions);
-
+                       map.markerCluster = L.markerClusterGroup(map.options.clusterOptions).addTo(map);
+                       var markers = [];
                        /* Pour chaque points présents, on crée un marqueur */
-                       jQuery.each(data.features, function(i, feature){
-                               if (feature.geometry.coordinates[0]){
+                       jQuery.each(data.features, function (i, feature) {
+                               if (feature.geometry.coordinates[0]) {
                                        var marker = L.marker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]]);
 
                                        // Déclarer l'icone du point
@@ -211,30 +239,35 @@ L.Map.Gis = L.Map.extend({
                                        map.setGeoJsonFeaturePopup(feature, marker);
 
                                        marker.id = feature.id;
-                                       map.markers.addLayer(marker);
+                                       markers.push(marker);
                                }
                        });
 
-                       map.addLayer(map.markers);
+                       map.markerCluster.addLayers(markers);
 
-                       if (map.options.autocenterandzoom){
+                       if (map.options.autocenterandzoom) {
                                if (data.features.length > 1)
-                                       map.fitBounds(map.markers.getBounds());
+                                       map.fitBounds(map.markerCluster.getBounds());
                                else
-                                       map.setView(map.markers.getBounds().getCenter(), map.options.zoom);
+                                       map.setView(map.markerCluster.getBounds().getCenter(), map.options.zoom);
                        }
                }
        },
        
        // API Compat GIS3
-       addJSON: function(data) {
+       addJSON: function (data) {
                return this.parseGeoJson(data);
        },
        
        // API Compat GIS3
-       removeAllMarkers: function(){
-               if (typeof this.geojsons=="undefined") this.geojsons = [];
-               for(var i in this.geojsons){
+       removeAllMarkers: function () {
+               // virer les éléments du cluster s'il est utilisé
+               if (this.options.cluster) {
+                       this.markerCluster.clearLayers();
+               }
+               // virer les points de la carte
+               if (typeof this.geojsons=='undefined') this.geojsons = [];
+               for (var i in this.geojsons) {
                        this.geojsons[i].clearLayers();
                        this.removeLayer(this.geojsons[i]);
                }
@@ -244,32 +277,32 @@ L.Map.Gis = L.Map.extend({
        loadData: function () {
                var map = this;
                if (map.options.affiche_points
-                       && typeof(map.options.json_points) !== "undefined"
-                       && map.options.json_points.url.length){
+                       && typeof(map.options.json_points) !== 'undefined'
+                       && map.options.json_points.url.length) {
                        // Récupération des points à mettre sur la carte, via json externe
                        var args = {};
                        jQuery.extend(true, args, map.options.json_points.env);
-                       if (typeof map.options.json_points.objets !== "undefined"){
+                       if (typeof map.options.json_points.objets !== 'undefined') {
                                args.objets = map.options.json_points.objets;
-                               if (args.objets == "point_libre"){
+                               if (args.objets == 'point_libre') {
                                        args.lat = map.options.center[0];
                                        args.lon = map.options.center[1];
-                                       if (typeof map.options.json_points.titre !== "undefined")
+                                       if (typeof map.options.json_points.titre !== 'undefined')
                                                args.titre = map.options.json_points.titre;
-                                       if (typeof map.options.json_points.description !== "undefined")
+                                       if (typeof map.options.json_points.description !== 'undefined')
                                                args.description = map.options.json_points.description;
-                                       if (typeof map.options.json_points.icone !== "undefined")
+                                       if (typeof map.options.json_points.icone !== 'undefined')
                                                args.icone = map.options.json_points.icone;
                                }
                        }
-                       if (typeof map.options.json_points.limit !== "undefined")
+                       if (typeof map.options.json_points.limit !== 'undefined')
                                args.limit = map.options.json_points.limit;
                        jQuery.getJSON(map.options.json_points.url,args,
-                               function(data) {
-                                       if (data){
+                               function (data) {
+                                       if (data) {
                                                // Charger le json (data) et déclarer les points
                                                map.parseGeoJson(data);
-                                               jQuery("#"+map._container.id).trigger('ready',map);
+                                               jQuery('#'+map._container.id).trigger('ready',map);
                                        }
                                }
                        );
@@ -278,32 +311,41 @@ L.Map.Gis = L.Map.extend({
        
        addOverlays: function () {
                var map = this;
-               if (map.options.kml && map.options.kml.length){
+               if (map.options.kml && map.options.kml.length) {
                        map.kml = {};
-                       for(var i in map.options.kml){
+                       for (var i in map.options.kml) {
                                map.kml[i] = new L.KML(map.options.kml[i], {async: true});
                                if (map.options.centrer_fichier)
-                                       map.kml[i].on("loaded", function(e) { map.fitBounds(e.target.getBounds()); });
+                                       map.kml[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
                                map.addLayer(map.kml[i]);
                        }
                }
-               if (map.options.gpx && map.options.gpx.length){
+               if (map.options.gpx && map.options.gpx.length) {
                        map.gpx = {};
-                       for(var i in map.options.gpx){
+                       for (var i in map.options.gpx) {
                                map.gpx[i] = new L.GPX(map.options.gpx[i], {async: true});
                                if (map.options.centrer_fichier)
-                                       map.gpx[i].on("loaded", function(e) { map.fitBounds(e.target.getBounds()); });
+                                       map.gpx[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
                                map.addLayer(map.gpx[i]);
                        }
                }
-               if (map.options.geojson && map.options.geojson.length){
-                       for(var i in map.options.geojson){
-                               jQuery.getJSON(map.options.geojson[i], function(data){
+               if (map.options.geojson && map.options.geojson.length) {
+                       for (var i in map.options.geojson) {
+                               jQuery.getJSON(map.options.geojson[i], function (data) {
                                        if (data)
                                                map.parseGeoJson(data);
                                });
                        }
                }
+               if (map.options.topojson && map.options.topojson.length) {
+                       for (var i in map.options.topojson) {
+                               map.topojson[i] = new L.TOPOJSON(map.options.topojson[i], {async: true});
+                               if (map.options.centrer_fichier) {
+                                       map.topojson[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
+                               }
+                               map.addLayer(map.topojson[i]);
+                       }
+               }
        }
 });
 
index 01a1967..d658695 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#TITRE*|extraire_multi|supprimer_numero|json_encode)],
                        "description":[(#DESCRIPTIF|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_gis>
index a50f389..be31840 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_ARTICLE|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_art>
\ No newline at end of file
index f988b03..dd91e96 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_ARTICLE|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_art>
\ No newline at end of file
index 5a23c09..1731fc3 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_AUTEUR|lien_ou_expose{[(#TITRE_GIS*|sinon{#NOM*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#BIO}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_auteurs>
\ No newline at end of file
index b2215c9..3f718d3 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_DOCUMENT|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_doc>
\ No newline at end of file
index f058949..968eeba 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_EVENEMENT|extraire_multi|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_events>
index e1c9861..7d10cc8 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_MOT|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_mots>
\ No newline at end of file
index d0dbbd9..63ccf74 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#TITRE_GIS*|sinon{#NOM*}|extraire_multi|supprimer_numero|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_organisations>
index dc14b2d..39516a0 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#URL_RUBRIQUE|extraire_multi|lien_ou_expose{[(#TITRE_GIS*|sinon{#TITRE*}|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_rub>
\ No newline at end of file
index a43b62f..b16fcf4 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#ID_SYNDIC|generer_url_entite{site}|lien_ou_expose{[(#TITRE_GIS*|sinon{#NOM_SITE*}|extraire_multi|supprimer_numero)]}|json_encode)],
                        "description":[(#DESCRIPTIF_GIS|sinon{#DESCRIPTIF}|json_encode)][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_sit>
\ No newline at end of file
index bceae48..7577ff3 100644 (file)
@@ -5,5 +5,6 @@
                "properties": {
                        "title":[(#VAL{<a href='[(#ID_GIS|generer_url_entite{gis,'','',0})]'>[(#TITRE*|extraire_multi|supprimer_numero|sinon{----})]</a>}|json_encode)],
                        "description":[(#DESCRIPTIF|json_encode)][(#SET{logo_doc,''})][
-                       (#LOGO_GIS|gis_icon_properties)]
+                       (#LOGO_GIS|gis_icon_properties)][,
+                       "styles": (#GEOMETRY_STYLES|appliquer_filtre{geometry_styles_to_json})]
                }}</BOUCLE_gis>
index 42f4723..f1a2f99 100644 (file)
@@ -1,29 +1,29 @@
 <traduction module="gis" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/gis/trunk/lang/" reference="fr">
-       <langue code="de" url="http://trad.spip.net/tradlang_module/gis?lang_cible=de" total="140" traduits="140" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/gis?lang_cible=de" total="151" traduits="123" relire="0" modifs="2" nouveaux="26" pourcent="81.46">
                <traducteur nom="Torsten Willmann" lien="http://trad.spip.net/auteur/torsten-willmann" />
        </langue>
-       <langue code="en" url="http://trad.spip.net/tradlang_module/gis?lang_cible=en" total="140" traduits="140" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/gis?lang_cible=en" total="151" traduits="151" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/gis?lang_cible=es" total="140" traduits="140" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/gis?lang_cible=es" total="151" traduits="123" relire="0" modifs="2" nouveaux="26" pourcent="81.46">
                <traducteur nom="alf" lien="http://trad.spip.net/auteur/alf" />
                <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
                <traducteur nom="severo" lien="http://trad.spip.net/auteur/severo" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/gis?lang_cible=fr" total="140" traduits="140" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/gis?lang_cible=fr" total="151" traduits="151" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="nl" url="http://trad.spip.net/tradlang_module/gis?lang_cible=nl" total="140" traduits="140" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/gis?lang_cible=nl" total="151" traduits="151" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
        </langue>
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/gis?lang_cible=ru" total="140" traduits="122" relire="0" modifs="2" nouveaux="16" pourcent="87.14">
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/gis?lang_cible=ru" total="151" traduits="106" relire="0" modifs="3" nouveaux="42" pourcent="70.20">
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/gis?lang_cible=sk" total="140" traduits="139" relire="0" modifs="1" nouveaux="0" pourcent="99.29">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/gis?lang_cible=sk" total="151" traduits="122" relire="0" modifs="3" nouveaux="26" pourcent="80.79">
                <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
index 73e67fc..7cd9bd3 100644 (file)
@@ -22,42 +22,27 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Geoinformationssystem<br /><a href="http://contrib.spip.net/4189" class="spip_out">zur Dokumentation</a>.',
        'cfg_inf_adresse' => 'Adressfelder anzeigen (Land, Satdt, Region, Adresse ...)',
        'cfg_inf_bing' => 'Der Layer Bing Aerial benötigt einen Schlüssel zu erzeugen auf der  <a href=\'@url@\' class="spip_out">Bing Website</a>.',
-       'cfg_inf_cloudmade' => 'Diese API benötigt einen Schlüssel. Zu erzeugen auf der <a href=\'@url@\' class="spip_out">CloudMade Website</a>.',
        'cfg_inf_geocoder' => 'Geocoding aktivieren (Suche nach einer Adresse, Anzeige von Adressen zu den Koordinaten).',
        'cfg_inf_geolocaliser_user_html5' => 'Wenn es der Browser des Nutzers erlaubt, wird sein ungefährer Standort als Voreinstellung für die Position von Punkten genommen.',
-       'cfg_inf_google' => 'Diese API benötigt einen Schlüssel. Zu erzeugen auf der <a href=\'@url@\' class="spip_out">le GoogleMaps Seite </a>.',
-       'cfg_inf_yandex' => 'Diese API benötigt einen Schlüssel. Zu erzeugen auf der <a href=\'@url@\' class="spip_out">Yandex Website</a>.',
+       'cfg_inf_google' => 'Diese API benötigt einen Schlüssel. Zu erzeugen auf der <a href=\'@url@\' class="spip_out">le GoogleMaps Seite </a>.', # MODIF
        'cfg_lbl_activer_objets' => 'Geotargeting für folgende Inhalte aktivieren:',
        'cfg_lbl_adresse' => 'Adressfelder anzeigen',
        'cfg_lbl_api' => 'Karten-API ',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Bing Schlüssel',
-       'cfg_lbl_api_key_cloudmade' => 'CloudMade Schlüssel',
        'cfg_lbl_api_key_google' => 'GoogleMaps Schlüssel',
-       'cfg_lbl_api_key_yandex' => 'Yandex Schlüssel',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Karte beim Anlegen auf den Standort des Nutzers zentrieren.',
        'cfg_lbl_layer_defaut' => 'Standardlayer',
        'cfg_lbl_layers' => 'Vorgeschlagene Layer',
        'cfg_lbl_maptype' => 'Kartentyp',
-       'cfg_lbl_maptype_carte' => 'Karte',
-       'cfg_lbl_maptype_hybride' => 'Hybrid',
-       'cfg_lbl_maptype_relief' => 'Relief',
-       'cfg_lbl_maptype_satellite' => 'Satellit',
        'cfg_titre_gis' => 'GIS Einstellungen',
 
        // E
        'editer_gis_editer' => 'Punkt bearbeiten',
        'editer_gis_nouveau' => 'Neuen Punkt anlegen',
        'editer_gis_titre' => 'GIS Punkte',
-       'erreur_geocoder' => 'Ihre Suche ergab kein Ergebnis:',
+       'erreur_geocoder' => 'Ihre Suche ergab kein Ergebnis:', # MODIF
        'erreur_recherche_pas_resultats' => 'Kein Punkt passt zu Ihrer Suche.',
        'erreur_xmlrpc_lat_lon' => 'Länge und Breite müssen als Argumente übergeben werden.',
        'explication_api_forcee' => 'Die API wird durch ein Plugin oder Skelett erzwungen.',
@@ -169,5 +154,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index 448ca41..7bed0d9 100644 (file)
@@ -14,6 +14,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'aucun_objet' => 'No object',
 
        // B
+       'bouton_annuler_title' => 'Cancel all modifications.',
+       'bouton_enregistrer_title' => 'Save your modifications.',
        'bouton_lier' => 'Link this point',
        'bouton_supprimer_gis' => 'Delete this point permanently',
        'bouton_supprimer_lien' => 'Remove this link',
@@ -22,35 +24,22 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Geographic Information System.<br /><a href="http://contrib.spip.net/4189" class="spip_out">Link to the documentation</a>.',
        'cfg_inf_adresse' => 'Displays additional address fields (country, city, state, address ...)',
        'cfg_inf_bing' => 'The Bing Aerial layer needs a key you can create on <a href=\'@url@\' class="spip_out">the Bing website</a>.',
-       'cfg_inf_cloudmade' => 'This API needs a key you can create on <a href=\'@url@\' class="spip_out">the CloudMade website</a>.',
        'cfg_inf_geocoder' => 'Enable geocoder functions (search from an address, recovery of the address from the coordinates).',
        'cfg_inf_geolocaliser_user_html5' => 'If the user’s browser allows it, its approximate geographic location is retrieved to give the default position when creating a new point.',
-       'cfg_inf_google' => 'This API needs a key you can create on <a href=\'@url@\' class="spip_out">the GoogleMaps website</a>.',
-       'cfg_inf_yandex' => 'This API needs a key you can create on <a href=\'@url@\' class="spip_out">the yandex website</a>.',
+       'cfg_inf_google' => 'This API needs a key that you can create on <a href=\'@url@\' class="spip_out">the Google Maps website</a>.',
+       'cfg_inf_styles' => 'Show additional style fields (color, opacity, thickness...)',
        'cfg_lbl_activer_objets' => 'Enable geotagging of content:',
        'cfg_lbl_adresse' => 'Show address fields',
        'cfg_lbl_api' => 'Geolocation API',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Bing key',
-       'cfg_lbl_api_key_cloudmade' => 'CloudMade API key',
        'cfg_lbl_api_key_google' => 'GoogleMaps API key',
-       'cfg_lbl_api_key_yandex' => 'Yandex API key',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Center the map on the location of the user at the creation step',
        'cfg_lbl_layer_defaut' => 'Default layer',
        'cfg_lbl_layers' => 'Proposed layers',
        'cfg_lbl_maptype' => 'Base map',
-       'cfg_lbl_maptype_carte' => 'Map',
-       'cfg_lbl_maptype_hybride' => 'Hybrid',
-       'cfg_lbl_maptype_relief' => 'Relief',
-       'cfg_lbl_maptype_satellite' => 'Satellite',
+       'cfg_lbl_styles' => 'Show the style fields',
        'cfg_titre_gis' => 'GIS configuration',
 
        // E
@@ -61,9 +50,14 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_recherche_pas_resultats' => 'No point corresponds to the searched text.',
        'erreur_xmlrpc_lat_lon' => 'Latitude and longitude should be set as arguments',
        'explication_api_forcee' => 'The is imposed by another plugin or skeleton.',
+       'explication_color' => 'Line color in CSS format (default: #0033FF)',
+       'explication_fillcolor' => 'Fill color in CSS format (default: inherited from the line color)',
+       'explication_fillopacity' => 'Filler opacity between 0 and 1 (default: 0.2)',
        'explication_import' => 'Import a file in GPX or KML format.',
        'explication_layer_forcee' => 'The layer is imposed by another plugin or skeleton.',
        'explication_maptype_force' => 'The base map is imposed by another plugin or skeleton.',
+       'explication_opacity' => 'Line opacity between 0 and 1 (default: 0.5)',
+       'explication_weight' => 'Line thickness (default: 5)',
 
        // F
        'formulaire_creer_gis' => 'Create a new location-based point:',
@@ -95,7 +89,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_adress' => 'Address',
        'label_code_pays' => 'Country code',
        'label_code_postal' => 'Postal code',
+       'label_color' => 'Color',
        'label_departement' => 'Department',
+       'label_fillcolor' => 'Fill color',
+       'label_fillopacity' => 'Filler opacity',
        'label_import' => 'Import',
        'label_inserer_modele_articles' => 'linked to articles',
        'label_inserer_modele_articles_sites' => 'linked to articles + websites',
@@ -128,16 +125,21 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_inserer_modele_rubriques' => 'linked to sections',
        'label_inserer_modele_sites' => 'linked to websites',
        'label_inserer_modele_titre_carte' => 'Map title',
+       'label_opacity' => 'Opacity',
        'label_pays' => 'Country',
        'label_rechercher_address' => 'Search for an address',
        'label_rechercher_point' => 'Search for a point',
        'label_region' => 'Region',
        'label_ville' => 'Town',
+       'label_weight' => 'Thickness',
        'lat' => 'Latitude',
        'libelle_logo_gis' => 'POINT\\’S LOGO',
        'lien_ajouter_gis' => 'Add this point',
        'lon' => 'Longitude',
 
+       // P
+       'placeholder_geocoder' => 'An address, a town, a country, a touristic site...',
+
        // T
        'telecharger_gis' => 'Download in @format@ format',
        'texte_ajouter_gis' => 'Add a location-based point',
@@ -153,9 +155,18 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'titre_nouveau_point' => 'New point',
        'titre_objet' => 'Title',
        'toolbar_actions_title' => 'Cancel the drawing',
+       'toolbar_buttons_circle' => 'Draw a circle',
        'toolbar_buttons_marker' => 'Plot a point',
        'toolbar_buttons_polygon' => 'Draw a polygon',
        'toolbar_buttons_polyline' => 'Draw a line',
+       'toolbar_buttons_rectangle' => 'Draw a rectangle',
+       'toolbar_edit_buttons_edit' => 'Modify the object',
+       'toolbar_edit_buttons_editdisabled' => 'No modifiable objects',
+       'toolbar_edit_buttons_remove' => 'Delete an object',
+       'toolbar_edit_buttons_removedisabled' => 'No objects to be deleted',
+       'toolbar_edit_handlers_edit_tooltip_subtext' => 'Clickc cancel to suppress your modifications',
+       'toolbar_edit_handlers_edit_tooltip_text' => 'Move the markers to modify the object.',
+       'toolbar_edit_handlers_remove_tooltip_text' => 'Click on an object to delete it',
        'toolbar_handlers_marker_tooltip_start' => 'Click to set marker',
        'toolbar_handlers_polygon_tooltip_cont' => 'Click to continue drawing the polygon',
        'toolbar_handlers_polygon_tooltip_end' => 'Click the first point to close the polygon',
@@ -163,11 +174,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'toolbar_handlers_polyline_tooltip_cont' => 'Click to continue to draw the line',
        'toolbar_handlers_polyline_tooltip_end' => 'Click the last point to end line',
        'toolbar_handlers_polyline_tooltip_start' => 'Click to start drawing the line',
+       'toolbar_handlers_rectangle_tooltip_start' => 'Click and drag to draw a rectangle',
+       'toolbar_handlers_simpleshape_tooltip_end' => 'Release the mouse to complete the design',
        'toolbar_undo_text' => 'Delete last point',
        'toolbar_undo_title' => 'Delete last point drawn',
 
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index cbdfaa1..a6b3741 100644 (file)
@@ -22,42 +22,27 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Sistema de Información Geográfica.<br /><a href="http://contrib.spip.net/4189" class="spip_out">Ir a la documentación</a>.',
        'cfg_inf_adresse' => 'Mostrar campos adicionales de dirección (país, ciudad, región, dirección...)',
        'cfg_inf_bing' => 'La capa Bing Aerial necesita crear una clave <a href=\'@url@\' class="spip_out">el sitio de Bing</a>.',
-       'cfg_inf_cloudmade' => 'Esta API necesita crear una clave en <a href=\'@url@\'>el sitio de CloudMade</a>.',
        'cfg_inf_geocoder' => 'Activar las funciones del geocoder (búsqueda desde una dirección, recuperación de una dirección partiendo de coordenadas).',
        'cfg_inf_geolocaliser_user_html5' => 'Si el navegador del usuario lo permite, su ubicación geográfica aproximada se recupera para dar la posición por defecto durante la creación de un punto.',
-       'cfg_inf_google' => 'Esta API necesita crear una clave en <a href=\'@url@\'>el sitio de GoogleMaps</a>.',
-       'cfg_inf_yandex' => 'Esta API necesita crear una clave en <a href=\'@url@\'>el sitio de Yandex</a>.',
+       'cfg_inf_google' => 'Esta API necesita crear una clave en <a href=\'@url@\'>el sitio de GoogleMaps</a>.', # MODIF
        'cfg_lbl_activer_objets' => 'Activar la geolocalización en los contenidos:',
        'cfg_lbl_adresse' => 'Mostrar los campos de dirección',
        'cfg_lbl_api' => 'API de cartografía',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Clave Bing',
-       'cfg_lbl_api_key_cloudmade' => 'Clave CloudMade',
        'cfg_lbl_api_key_google' => 'Clave GoogleMaps',
-       'cfg_lbl_api_key_yandex' => 'Clave Yandex',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Centrar el mapa en base a la ubicación del usuario durante la creación',
        'cfg_lbl_layer_defaut' => 'Capa por defecto',
        'cfg_lbl_layers' => 'Capas propuestas',
        'cfg_lbl_maptype' => 'Fondo cartográfico',
-       'cfg_lbl_maptype_carte' => 'Mapa',
-       'cfg_lbl_maptype_hybride' => 'Híbrido',
-       'cfg_lbl_maptype_relief' => 'Relieve',
-       'cfg_lbl_maptype_satellite' => 'Satélite',
        'cfg_titre_gis' => 'configuración de GIS',
 
        // E
        'editer_gis_editer' => 'Modificar este punto',
        'editer_gis_nouveau' => 'Crear un nuevo punto',
        'editer_gis_titre' => 'Puntos geolocalizados',
-       'erreur_geocoder' => 'Ningún resultado para su búsqueda:',
+       'erreur_geocoder' => 'Ningún resultado para su búsqueda:', # MODIF
        'erreur_recherche_pas_resultats' => 'Ningún punto corresponde a la búsqueda.',
        'erreur_xmlrpc_lat_lon' => 'La latitud y la longitud deben indicarse como parámetros',
        'explication_api_forcee' => 'La API esta impuesta por otro plugin o esqueleto.',
@@ -169,5 +154,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index dbc04ec..0199974 100644 (file)
@@ -12,6 +12,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'aucun_objet' => 'Aucun objet',
 
        // B
+       'bouton_annuler_title' => 'Annuler l’édition, effacera toutes les modifications.',
+       'bouton_enregistrer_title' => 'Enregistrez vos modifications.',
        'bouton_lier' => 'Lier ce point',
        'bouton_supprimer_gis' => 'Supprimer définitivement ce point',
        'bouton_supprimer_lien' => 'Supprimer ce lien',
@@ -20,48 +22,40 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Système d’Information Géographique.<br /><a href="http://contrib.spip.net/4189" class="spip_out">Accéder la documentation</a>.',
        'cfg_inf_adresse' => 'Affiche des champs supplémentaires d’adresse (pays, ville, région, adresse...)',
        'cfg_inf_bing' => 'La couche Bing Aerial nécessite une clé à créer sur <a href=\'@url@\' class="spip_out">le site de Bing</a>.',
-       'cfg_inf_cloudmade' => 'Cette API nécessite une clé à créer sur <a href=\'@url@\' class="spip_out">le site de CloudMade</a>.',
        'cfg_inf_geocoder' => 'Activer les fonctions du geocoder (recherche à partir d’une adresse, récupération de l’adresse à partir des coordonnées).',
        'cfg_inf_geolocaliser_user_html5' => 'Si le navigateur de l’utilisateur le permet, son emplacement géographique approximatif est récupéré pour donner la position par défaut lors de la création d’un point.',
-       'cfg_inf_google' => 'Cette API nécessite une clé à créer sur <a href=\'@url@\' class="spip_out">le site de GoogleMaps</a>.',
-       'cfg_inf_yandex' => 'Cette API nécessite une clé à créer sur <a href=\'@url@\' class="spip_out">le site de Yandex</a>.',
+       'cfg_inf_google' => 'Les couches Google nécessitent une clé à créer sur <a href=\'@url@\' class="spip_out">le site de GoogleMaps</a>.',
+       'cfg_inf_styles' => 'Affiche des champs supplémentaires de style (couleur, opacité, épaisseur...)',
        'cfg_lbl_activer_objets' => 'Activer la géolocalisation sur les contenus :',
        'cfg_lbl_adresse' => 'Afficher les champs d’adresse',
        'cfg_lbl_api' => 'API de cartographie',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Clé Bing',
-       'cfg_lbl_api_key_cloudmade' => 'Clé CloudMade',
        'cfg_lbl_api_key_google' => 'Clé GoogleMaps',
-       'cfg_lbl_api_key_yandex' => 'Clé Yandex',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Centrer la carte sur l’emplacement de l’utilisateur à la création',
        'cfg_lbl_layer_defaut' => 'Couche par défaut',
        'cfg_lbl_layers' => 'Couches proposées',
        'cfg_lbl_maptype' => 'Fond cartographique',
-       'cfg_lbl_maptype_carte' => 'Carte',
-       'cfg_lbl_maptype_hybride' => 'Hybride',
-       'cfg_lbl_maptype_relief' => 'Relief',
-       'cfg_lbl_maptype_satellite' => 'Satellite',
+       'cfg_lbl_styles' => 'Afficher les champs de styles',
        'cfg_titre_gis' => 'Configuration de GIS',
 
        // E
        'editer_gis_editer' => 'Modifier ce point',
        'editer_gis_nouveau' => 'Créer un nouveau point',
        'editer_gis_titre' => 'Les points géolocalisés',
-       'erreur_geocoder' => 'Aucun résultat pour votre recherche :',
+       'erreur_geocoder' => 'Aucun résultat pour votre recherche',
        'erreur_recherche_pas_resultats' => 'Aucun point ne correspond à la recherche.',
        'erreur_xmlrpc_lat_lon' => 'La latitude et la longitude doivent être passées en argument',
        'explication_api_forcee' => 'L’API est imposée par un autre plugin ou squelette.',
+       'explication_color' => 'Couleur de trait au format CSS (valeur par défaut : #0033FF)',
+       'explication_fillcolor' => 'Couleur de remplissage au format CSS (valeur par défaut : héritée de la couleur de trait)',
+       'explication_fillopacity' => 'Opacité du remplissage de 0 à 1 (valeur par défaut : 0.2)',
        'explication_import' => 'Importer un fichier au format GPX ou KML.',
        'explication_layer_forcee' => 'La couche est imposée par un autre plugin ou un squelette.',
        'explication_maptype_force' => 'Le fond cartographique est imposé par un autre plugin ou squelette.',
+       'explication_opacity' => 'Opacité du trait de 0 à 1 (valeur par défaut : 0.5)',
+       'explication_weight' => 'Épaisseur du trait (valeur par défaut : 5)',
 
        // F
        'formulaire_creer_gis' => 'Créer un point géolocalisé :',
@@ -93,7 +87,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_adress' => 'Adresse',
        'label_code_pays' => 'Code pays',
        'label_code_postal' => 'Code postal',
+       'label_color' => 'Couleur',
        'label_departement' => 'Département',
+       'label_fillcolor' => 'Couleur de remplissage',
+       'label_fillopacity' => 'Opacité de remplissage',
        'label_import' => 'Importer',
        'label_inserer_modele_articles' => 'liés aux articles',
        'label_inserer_modele_articles_sites' => 'liés aux articles + sites',
@@ -126,16 +123,21 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_inserer_modele_rubriques' => 'liés aux rubriques',
        'label_inserer_modele_sites' => 'liés aux sites',
        'label_inserer_modele_titre_carte' => 'Titre de la carte',
+       'label_opacity' => 'Opacité',
        'label_pays' => 'Pays',
        'label_rechercher_address' => 'Rechercher une adresse',
        'label_rechercher_point' => 'Rechercher un point',
        'label_region' => 'Région',
        'label_ville' => 'Ville',
+       'label_weight' => 'Épaisseur',
        'lat' => 'Latitude',
        'libelle_logo_gis' => 'LOGO DU POINT',
        'lien_ajouter_gis' => 'Ajouter ce point',
        'lon' => 'Longitude',
 
+       // P
+       'placeholder_geocoder' => 'Une adresse, une ville, un pays, un lieu touristique...',
+
        // T
        'telecharger_gis' => 'Télécharger au format @format@',
        'texte_ajouter_gis' => 'Ajouter un point géolocalisé',
@@ -151,9 +153,18 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'titre_nouveau_point' => 'Nouveau point',
        'titre_objet' => 'Titre',
        'toolbar_actions_title' => 'Annuler le tracé',
+       'toolbar_buttons_circle' => 'Tracer un cercle',
        'toolbar_buttons_marker' => 'Tracer un point',
        'toolbar_buttons_polygon' => 'Tracer un polygone',
        'toolbar_buttons_polyline' => 'Tracer une ligne',
+       'toolbar_buttons_rectangle' => 'Tracer un rectangle',
+       'toolbar_edit_buttons_edit' => 'Modifier l’objet',
+       'toolbar_edit_buttons_editdisabled' => 'Aucun objet modifiable',
+       'toolbar_edit_buttons_remove' => 'Supprimer un objet',
+       'toolbar_edit_buttons_removedisabled' => 'Aucun objet à supprimer',
+       'toolbar_edit_handlers_edit_tooltip_subtext' => 'Cliquez sur annuler pour supprimer les modifications',
+       'toolbar_edit_handlers_edit_tooltip_text' => 'Déplacez les poignées ou le marker pour modifier l’objet.',
+       'toolbar_edit_handlers_remove_tooltip_text' => 'Cliquez sur un objet pour le supprimer',
        'toolbar_handlers_marker_tooltip_start' => 'Cliquez pour placer le marqueur',
        'toolbar_handlers_polygon_tooltip_cont' => 'Cliquez pour continuer à tracer le polygone',
        'toolbar_handlers_polygon_tooltip_end' => 'Cliquez sur le premier point pour fermer le polygone',
@@ -161,11 +172,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'toolbar_handlers_polyline_tooltip_cont' => 'Cliquez pour continuer à tracer la ligne',
        'toolbar_handlers_polyline_tooltip_end' => 'Cliquez sur le dernier point pour terminer la ligne',
        'toolbar_handlers_polyline_tooltip_start' => 'Cliquez pour commencer à tracer la ligne',
+       'toolbar_handlers_rectangle_tooltip_start' => 'Cliquez et déplacez pour tracer un rectangle',
+       'toolbar_handlers_simpleshape_tooltip_end' => 'Relâchez la souris pour terminer le dessin',
        'toolbar_undo_text' => 'Effacer le dernier point',
        'toolbar_undo_title' => 'Effacer le dernier point tracé',
 
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index 8ac51ec..47a8a47 100644 (file)
@@ -14,6 +14,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'aucun_objet' => 'Geen object',
 
        // B
+       'bouton_annuler_title' => 'Stop en verwijder alle aanpassing.',
+       'bouton_enregistrer_title' => 'Sla je aanpassingen op.',
        'bouton_lier' => 'Koppel dit punt',
        'bouton_supprimer_gis' => 'Verwijder dit punt permanent',
        'bouton_supprimer_lien' => 'Verwijder deze link',
@@ -22,48 +24,40 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Geografisch Informatie Systeem.<br /><a href="http://www.spip-contrib.net/4189" class="spip_out">Naar de documentatie</a>.',
        'cfg_inf_adresse' => 'Toon extra addresvelden (land, stad, staat, adres ...)',
        'cfg_inf_bing' => 'De Bing Aerial layer heeft een sleutel nodig die je kunt aanmaken op <a href=\'@url@\' class="spip_out">de Bing website</a>.',
-       'cfg_inf_cloudmade' => 'Deze API heeft een sleutel nodig die je kunt aanmaken op <a href=\'@url@\' class="spip_out">de CloudMade website</a>.',
        'cfg_inf_geocoder' => 'Maak geocoder functies mogelijk (adres zoeken, adres vinden aan de hand van coördinaten).',
        'cfg_inf_geolocaliser_user_html5' => 'Als de browser het toestaat, wordt de geografische locatie gebruikt als default positie bij het aanmaken van een nieuw punt.',
-       'cfg_inf_google' => 'Deze API heeft een sleutel nodig die je kunt aanmaken op <a href=\'@url@\' class="spip_out">de GoogleMaps website</a>.',
-       'cfg_inf_yandex' => 'Deze API heeft een sleutel nodig die je kunt aanmaken op <a href=\'@url@\' class="spip_out">de Yandex website</a>.',
+       'cfg_inf_google' => 'Deze API heeft een sleutel nodig die je kunt aanmaken op <a href=\'@url@\' class="spip_out">de Google Maps website</a>.',
+       'cfg_inf_styles' => 'Toon de aanvullend stijlvelden (kleur, opaciteit, dikte...)',
        'cfg_lbl_activer_objets' => 'Maak geotagging mogelijk van inhoud:',
        'cfg_lbl_adresse' => 'Toon adresvelden',
        'cfg_lbl_api' => 'Geolocatie API',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Bing key',
-       'cfg_lbl_api_key_cloudmade' => 'CloudMade API key',
        'cfg_lbl_api_key_google' => 'GoogleMaps API key',
-       'cfg_lbl_api_key_yandex' => 'Yandex API key',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Centreer de map op de locatie van de gebruiker tijdens het aanmaken',
        'cfg_lbl_layer_defaut' => 'Standaard layer',
        'cfg_lbl_layers' => 'Voorgestelde layers',
        'cfg_lbl_maptype' => 'Basiskaart',
-       'cfg_lbl_maptype_carte' => 'Kaart',
-       'cfg_lbl_maptype_hybride' => 'Hybrid',
-       'cfg_lbl_maptype_relief' => 'Relief',
-       'cfg_lbl_maptype_satellite' => 'Satelliet',
+       'cfg_lbl_styles' => 'Toon de stijlvelden',
        'cfg_titre_gis' => 'Configuratie van GIS',
 
        // E
        'editer_gis_editer' => 'Pas dit punt aan',
        'editer_gis_nouveau' => 'Maak een nieuw punt',
        'editer_gis_titre' => 'Locatiepunten',
-       'erreur_geocoder' => 'Geen resultaat voor zoekopdracht:',
+       'erreur_geocoder' => 'Geen resultaat voor de zoekopdracht',
        'erreur_recherche_pas_resultats' => 'Geen enkel punt correspondeert met de gezochte tekst.',
        'erreur_xmlrpc_lat_lon' => 'Latitude en longitude moeten worden ingevuld',
        'explication_api_forcee' => 'Dit is vereist door een andere plugin or een ander model.',
+       'explication_color' => 'Kleur van de streep in CSS-formaat (standaardwaarde: #0033FF)',
+       'explication_fillcolor' => 'Opvulkleur in CSS-formaat (standaardwaarde: die van de streep)',
+       'explication_fillopacity' => 'Opaciteit van de opvulling tussen 0 en 1 (standaardwaarde: 0.2)',
        'explication_import' => 'Importeer een bestand in GPX of KML formaat.',
        'explication_layer_forcee' => 'De layer is vereist door een andere plugin of een ander model.',
        'explication_maptype_force' => 'De basiskaart is vereist door een andere plugin of een ander model.',
+       'explication_opacity' => 'Opaciteit van de streep tussen 0 en 1 (standaardwaarde: 0.5)',
+       'explication_weight' => 'Streepdikte (standaardwaarde: 5)',
 
        // F
        'formulaire_creer_gis' => 'Maak een nieuw locatiepunt:',
@@ -95,7 +89,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_adress' => 'Adres',
        'label_code_pays' => 'Landcode',
        'label_code_postal' => 'Postcode',
+       'label_color' => 'Kleur',
        'label_departement' => 'Departement',
+       'label_fillcolor' => 'Opvulkleur',
+       'label_fillopacity' => 'Opaciteit van de opvulling',
        'label_import' => 'Importeer',
        'label_inserer_modele_articles' => 'gekoppeld aan artikelen',
        'label_inserer_modele_articles_sites' => 'gekoppeld aan artikelen + websites',
@@ -128,16 +125,21 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'label_inserer_modele_rubriques' => 'gekoppeld aan rubrieken',
        'label_inserer_modele_sites' => 'gekoppeld aan websites',
        'label_inserer_modele_titre_carte' => 'Kaarttitel',
+       'label_opacity' => 'Opaciteit',
        'label_pays' => 'Land',
        'label_rechercher_address' => 'Zoek een adres',
        'label_rechercher_point' => 'Zoek een punt',
        'label_region' => 'Regio',
        'label_ville' => 'Stad',
+       'label_weight' => 'Dikte',
        'lat' => 'Breedtegraad',
        'libelle_logo_gis' => 'LOGO VAN HET PUNT',
        'lien_ajouter_gis' => 'Voeg dit punt toe',
        'lon' => 'Lengtegraad',
 
+       // P
+       'placeholder_geocoder' => 'Een adres, een plaats, een land, een toeristische plek...',
+
        // T
        'telecharger_gis' => 'Download in @format@ formaat',
        'texte_ajouter_gis' => 'Voeg een locatiepunt toe',
@@ -153,9 +155,18 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'titre_nouveau_point' => 'Nieuw punt',
        'titre_objet' => 'Titel',
        'toolbar_actions_title' => 'Annuleer de tekening',
+       'toolbar_buttons_circle' => 'Teken een circel',
        'toolbar_buttons_marker' => 'Plot een punt',
        'toolbar_buttons_polygon' => 'Teken een polygoon',
        'toolbar_buttons_polyline' => 'Teken een lijn',
+       'toolbar_buttons_rectangle' => 'Teken een rechthoek',
+       'toolbar_edit_buttons_edit' => 'Pas het object aan',
+       'toolbar_edit_buttons_editdisabled' => 'Geen aanpasbaar object',
+       'toolbar_edit_buttons_remove' => 'Een object verwijderen',
+       'toolbar_edit_buttons_removedisabled' => 'Geen te verwijderen object',
+       'toolbar_edit_handlers_edit_tooltip_subtext' => 'Klik op annuleren om de aanpassingen ongedaan te maken',
+       'toolbar_edit_handlers_edit_tooltip_text' => 'Verplaats de markeringen om het object aan te passen.',
+       'toolbar_edit_handlers_remove_tooltip_text' => 'Klik op een object om het te verwijderen',
        'toolbar_handlers_marker_tooltip_start' => 'Klik om de marker in te stellen',
        'toolbar_handlers_polygon_tooltip_cont' => 'Klik om de polygoon verder te tekenen',
        'toolbar_handlers_polygon_tooltip_end' => 'Klik op het eerste punt om de polygoon te sluiten',
@@ -163,11 +174,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'toolbar_handlers_polyline_tooltip_cont' => 'Klik om de lijn verder te tekenen',
        'toolbar_handlers_polyline_tooltip_end' => 'Klik het laatste punt voor het einde van de lijn',
        'toolbar_handlers_polyline_tooltip_start' => 'Klik om een lijn te gaan tekenen',
+       'toolbar_handlers_rectangle_tooltip_start' => 'Klik en verplaats om een rechthoek te tekenen',
+       'toolbar_handlers_simpleshape_tooltip_end' => 'Laat de muisknop los om het ontwerp te beëindigen',
        'toolbar_undo_text' => 'Wis het laatste punt',
        'toolbar_undo_title' => 'Wis het laatst uitgestippelde punt',
 
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index 0e4a80b..79b9a19 100644 (file)
@@ -22,35 +22,20 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Географическая Информационная Система (GIS).<br /><a href="http://contrib.spip.net/3887" class="spip_out">Документация</a>.', # MODIF
        'cfg_inf_adresse' => 'Показываются дополнительные поля для ввода адреса (страна, город, область, адрес...)',
        'cfg_inf_bing' => 'Для использования карты Bing Aerial необходимо создать ключ  <a href=\'@url@\' class="spip_out">на сайте Bing</a>.',
-       'cfg_inf_cloudmade' => 'Для использования карты необходимо создать ключ <a href=\'@url@\' class="spip_out">на сайте CloudMade</a>.',
        'cfg_inf_geocoder' => 'Включить функцию геопоиска (поиск точки на карте по адресу).',
        'cfg_inf_geolocaliser_user_html5' => 'Новая карта центрируется по расположению пользователя ( если позволяет его браузер).',
-       'cfg_inf_google' => 'Для работы с картой необходим API ключ, который  можно создать на <a href=\'@url@\' class="spip_out">сайте  GoogleMaps</a>.',
-       'cfg_inf_yandex' => 'Для работы с картой необходим API ключ. <a href=\'@url@\' class="spip_out"> Получить на сайте Yandex</a>.',
+       'cfg_inf_google' => 'Для работы с картой необходим API ключ, который  можно создать на <a href=\'@url@\' class="spip_out">сайте  GoogleMaps</a>.', # MODIF
        'cfg_lbl_activer_objets' => 'Связывать карту с объектами:',
        'cfg_lbl_adresse' => 'Показать поля для адреса',
        'cfg_lbl_api' => 'Используемое API',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'API ключ  Bing',
-       'cfg_lbl_api_key_cloudmade' => 'API ключ CloudMade ',
        'cfg_lbl_api_key_google' => 'API ключ  GoogleMaps',
-       'cfg_lbl_api_key_yandex' => 'Yandex API ключ',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Центрировать карту по месту расположения пользователя, создавшего карту',
        'cfg_lbl_layer_defaut' => 'Слой по умолчанию',
        'cfg_lbl_layers' => 'Предложенные слои',
        'cfg_lbl_maptype' => 'Тип карты',
-       'cfg_lbl_maptype_carte' => 'Карта',
-       'cfg_lbl_maptype_hybride' => 'Гибрид',
-       'cfg_lbl_maptype_relief' => 'Рельеф',
-       'cfg_lbl_maptype_satellite' => 'Спутник',
        'cfg_titre_gis' => 'GIS', # MODIF
 
        // E
@@ -153,5 +138,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'zoom' => 'Zoom'
 );
-
-?>
index b6756a9..a43eb8b 100644 (file)
@@ -22,42 +22,27 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'cfg_descr_gis' => 'Geografický informačný systém.<br /><a href="http://contrib.spip.net/4189" class="spip_out">Prejsť na dokumentáciu.</a>',
        'cfg_inf_adresse' => 'Zobrazí ďalšie polia adresy (krajinu, mesto, štát, adresu a pod.)',
        'cfg_inf_bing' => 'Vrstva Bing Aerial si vyžaduje, aby ste <a href=\'@url@\' class="spip_out">na stránke vyhľadávača Bing</a> vytvorili kľúč.',
-       'cfg_inf_cloudmade' => 'Táto aplikácia potrebuje kľúč na vytvorenie <a href=\'@url@\' class="spip_out">stránky v Cloude.</a>',
        'cfg_inf_geocoder' => 'Aktivovať funkciu geokódera (vyhľadávanie z jednej adresy, zistenie adresy zo súradníc).',
        'cfg_inf_geolocaliser_user_html5' => 'Ak to povoľuje prehliadač používateľa, na určenie predvolenej polohy pri vytváraní nového bodu sa ukladá približná geografická poloha používateľa.',
-       'cfg_inf_google' => 'Táto aplikácia potrebuje kľúč, ktorý si treba vytvoriť na <a href=\'@url@\' class="spip_out">stránke GoogleMaps.</a>',
-       'cfg_inf_yandex' => 'Táto aplikácia potrebuje kľúč na vytvorenie <a href=\'@url@\' class="spip_out">stránky v Yandexe.</a>',
+       'cfg_inf_google' => 'Táto aplikácia potrebuje kľúč, ktorý si treba vytvoriť na <a href=\'@url@\' class="spip_out">stránke GoogleMaps.</a>', # MODIF
        'cfg_lbl_activer_objets' => 'Aktivovať geolokalizáciu obsahu:',
        'cfg_lbl_adresse' => 'Zobraziť polia adresy',
        'cfg_lbl_api' => 'Geolokačná API',
-       'cfg_lbl_api_cloudmade' => 'CloudMade',
-       'cfg_lbl_api_google' => 'Google Maps v2',
-       'cfg_lbl_api_googlev3' => 'Google Maps v3',
        'cfg_lbl_api_key_bing' => 'Kľúč pre Bing',
-       'cfg_lbl_api_key_cloudmade' => 'Kľúč CloudMade',
        'cfg_lbl_api_key_google' => 'Kľúč GoogleMaps',
-       'cfg_lbl_api_key_yandex' => 'Kľúč Yandex',
-       'cfg_lbl_api_mapquest' => 'MapQuest',
        'cfg_lbl_api_microsoft' => 'Microsoft Bing',
-       'cfg_lbl_api_openlayers' => 'OpenLayers',
-       'cfg_lbl_api_ovi' => 'Ovi Nokia',
-       'cfg_lbl_api_yandex' => 'Yandex',
        'cfg_lbl_geocoder' => 'Geocoder',
        'cfg_lbl_geolocaliser_user_html5' => 'Pri vytváraní vycentrujte mapu na polohe používateľa',
        'cfg_lbl_layer_defaut' => 'Predvolená vrstva',
        'cfg_lbl_layers' => 'Navrhované vrstvy',
        'cfg_lbl_maptype' => 'Základná mapa',
-       'cfg_lbl_maptype_carte' => 'Mapa',
-       'cfg_lbl_maptype_hybride' => 'Zmiešaná',
-       'cfg_lbl_maptype_relief' => 'Reliéf',
-       'cfg_lbl_maptype_satellite' => 'Satelitná',
        'cfg_titre_gis' => 'GIS', # MODIF
 
        // E
        'editer_gis_editer' => 'Upraviť tento bod',
        'editer_gis_nouveau' => 'Vytvoriť nový bod',
        'editer_gis_titre' => 'Geolokalizované body',
-       'erreur_geocoder' => 'Žiaden výsledok k vášmu vyhľadávaniu:',
+       'erreur_geocoder' => 'Žiaden výsledok k vášmu vyhľadávaniu:', # MODIF
        'erreur_recherche_pas_resultats' => 'Vyhľadávania sa netýka žiaden bod.',
        'erreur_xmlrpc_lat_lon' => 'Zemepisná šírka a dĺžka musia byť odovzdané ako parameter',
        'explication_api_forcee' => 'Túto aplikáciu používa iný zásuvný modul alebo iná šablóna.',
@@ -169,5 +154,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'zoom' => 'Lupa'
 );
-
-?>
index 7ec83af..a88581b 100644 (file)
@@ -13,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'This plugin allows you to create location-based points that can be attached to SPIP objects to display them on maps in the pages of your site. They can use the tiles from different maps vendors through the Leaflet library.',
        'gis_slogan' => 'Geographic Information System'
 );
-
-?>
index c50b6fd..2bf3e49 100644 (file)
@@ -13,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'Este plugin permite crear puntos geolocalizados que pueden adjuntarse a los objetos de SPIP a fin de mostrarlos en los mapas de las páginas de su sitio web. Éstos útlimos pueden utilizar las tejas de diferentes proveedores gracias a la librería Leaflet. ',
        'gis_slogan' => 'Sistema de información geográfica'
 );
-
-?>
index a24c1fe..0102ada 100644 (file)
@@ -11,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'Ce plugin permet de créer des points géolocalisés qui peuvent être attachés aux objets de SPIP afin de les afficher sur des cartes dans les pages de votre site. Ces dernières peuvent utiliser les tuiles de différents fournisseurs grâce à la librairie Leaflet.',
        'gis_slogan' => 'Système d’information géographique'
 );
-
-?>
index b4a0593..e9bf901 100644 (file)
@@ -13,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'Deze plugin laat je locatiepunten maken die aan SPIP-objecten kunnen worden gekoppeld om een kaart te tonen. Verschillende soorten kaarten zijn mogelijk dankzij de Leaflet bibliotheek.',
        'gis_slogan' => 'Geografisch Informatie Systeem'
 );
-
-?>
index ec329f0..0e5298c 100644 (file)
@@ -13,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'Плагин GIS позволяет создавать элементы на карте и привязвать их к существующим объектам SPIP. Вы можете использовать созданные карты на страницах своего сайта. Могут использовать разные карты, доступ к которым обеспечивается при помощи библиотеки Leaflet.',
        'gis_slogan' => 'Географическая  Информационная Система (GIS)'
 );
-
-?>
index bd404e5..b31feb1 100644 (file)
@@ -13,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'gis_description' => 'Tento zásuvný modul umožňuje vytvárať zemepisné body, ktoré môžete pripojiť k objektom SPIPu, aby sa dali zobraziť na mapách na stránkach vášho webu. Vďaka knižnici Leaflet môžete používať rozhranie od rôznych výrobcov.',
        'gis_slogan' => 'Geografický informačný systém'
 );
-
-?>
index add1f0e..9d512e1 100644 (file)
@@ -1,33 +1,27 @@
-Sources utilisées dans la lib :\r
+Sources utilisées dans la lib :\r
 \r
-* dist/\r
-       * http://leafletjs.com/download.html\r
-* plugins/\r
-       * Bing.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js\r
-       * Control.FullScreen.js\r
-               * https://github.com/brunob/leaflet.fullscreen/blob/master/Control.FullScreen.js\r
-       * Control.MiniMap.js\r
-               * https://github.com/Norkart/Leaflet-MiniMap/blob/master/src/Control.MiniMap.js\r
-       * Google.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Google.js\r
-       * GPX.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/GPX.js\r
-       * GPX.Speed.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/GPX.Speed.js\r
-       * images\r
-               * mixed from all sources\r
-       * KML.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/KML.js\r
-       * leaflet.markercluster.css\r
-               * https://github.com/Leaflet/Leaflet.markercluster/blob/master/dist/MarkerCluster.css\r
-               * https://github.com/Leaflet/Leaflet.markercluster/blob/master/dist/MarkerCluster.Default.css\r
-       * leaflet.markercluster-src.js\r
-               * https://github.com/Leaflet/Leaflet.markercluster/blob/master/dist/leaflet.markercluster-src.js\r
-       * leaflet-plugins.css\r
-               * https://github.com/brunob/leaflet.fullscreen/blob/master/Control.FullScreen.css\r
-               * https://github.com/Norkart/Leaflet-MiniMap/blob/master/src/Control.MiniMap.css\r
-       * leaflet-providers.js\r
-               * https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js\r
-       * Marker.Rotate.js\r
-               * https://github.com/shramov/leaflet-plugins/blob/master/layer/Marker.Rotate.js\r
+## dist/\r
+
+* [http://leafletjs.com/download.html](http://leafletjs.com/download.html)\r
+
+## plugins/\r
+
+* [Bing.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js)\r
+* [Control.FullScreen.js](https://github.com/brunob/leaflet.fullscreen/blob/master/Control.FullScreen.js)\r
+* [Control.MiniMap.js](https://github.com/Norkart/Leaflet-MiniMap/blob/master/src/Control.MiniMap.js)\r
+* [Google.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Google.js)\r
+* [GPX.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/GPX.js)\r
+* [GPX.Speed.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/GPX.Speed.js)\r
+* images\r
+       * mixed from all sources\r
+* [KML.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/KML.js)\r
+* leaflet.markercluster.css\r
+       * [MarkerCluster.css](https://github.com/Leaflet/Leaflet.markercluster/blob/leaflet-0.7/dist/MarkerCluster.css)\r
+       * [MarkerCluster.Default.css](https://github.com/Leaflet/Leaflet.markercluster/blob/leaflet-0.7/dist/MarkerCluster.Default.css)\r
+* [leaflet.markercluster-src.js](https://github.com/Leaflet/Leaflet.markercluster/blob/leaflet-0.7/dist/leaflet.markercluster-src.js)\r
+* leaflet-plugins.css\r
+       * [Control.FullScreen.css](https://github.com/brunob/leaflet.fullscreen/blob/master/Control.FullScreen.css)\r
+       * [Control.MiniMap.css](https://github.com/Norkart/Leaflet-MiniMap/blob/master/src/Control.MiniMap.css)\r
+* [leaflet-providers.js](https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js)\r
+* [Marker.Rotate.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/Marker.Rotate.js)
+* [TOPOJSON.js](https://github.com/shramov/leaflet-plugins/blob/master/layer/vector/TOPOJSON.js)\r
index 1a98f70..8e2bd12 100755 (executable)
@@ -6,15 +6,16 @@ L.BingLayer = L.TileLayer.extend({
                culture: ''
        },
 
-       initialize: function(key, options) {
+       initialize: function (key, options) {
                L.Util.setOptions(this, options);
 
                this._key = key;
                this._url = null;
+               this._providers = [];
                this.metaRequested = false;
        },
 
-       tile2quad: function(x, y, z) {
+       tile2quad: function (x, y, z) {
                var quad = '';
                for (var i = z; i > 0; i--) {
                        var digit = 0;
@@ -26,16 +27,16 @@ L.BingLayer = L.TileLayer.extend({
                return quad;
        },
 
-       getTileUrl: function(p, z) {
+       getTileUrl: function (tilePoint) {
                var zoom = this._getZoomForUrl();
                var subdomains = this.options.subdomains,
-                       s = this.options.subdomains[Math.abs((p.x + p.y) % subdomains.length)];
+                       s = this.options.subdomains[Math.abs((tilePoint.x + tilePoint.y) % subdomains.length)];
                return this._url.replace('{subdomain}', s)
-                               .replace('{quadkey}', this.tile2quad(p.x, p.y, zoom))
+                               .replace('{quadkey}', this.tile2quad(tilePoint.x, tilePoint.y, zoom))
                                .replace('{culture}', this.options.culture);
        },
 
-       loadMetadata: function() {
+       loadMetadata: function () {
                if (this.metaRequested) return;
                this.metaRequested = true;
                var _this = this;
@@ -45,6 +46,7 @@ L.BingLayer = L.TileLayer.extend({
                        var e = document.getElementById(cbid);
                        e.parentNode.removeChild(e);
                        if (meta.errorDetails) {
+                               throw new Error(meta.errorDetails);
                                return;
                        }
                        _this.initMetadata(meta);
@@ -60,11 +62,10 @@ L.BingLayer = L.TileLayer.extend({
                document.getElementsByTagName('head')[0].appendChild(script);
        },
 
-       initMetadata: function(meta) {
+       initMetadata: function (meta) {
                var r = meta.resourceSets[0].resources[0];
                this.options.subdomains = r.imageUrlSubdomains;
                this._url = r.imageUrl;
-               this._providers = [];
                if (r.imageryProviders) {
                        for (var i = 0; i < r.imageryProviders.length; i++) {
                                var p = r.imageryProviders[i];
@@ -84,14 +85,14 @@ L.BingLayer = L.TileLayer.extend({
                this._update();
        },
 
-       _update: function() {
+       _update: function () {
                if (this._url === null || !this._map) return;
                this._update_attribution();
                L.TileLayer.prototype._update.apply(this, []);
        },
 
-       _update_attribution: function() {
-               var bounds = this._map.getBounds();
+       _update_attribution: function () {
+               var bounds = L.latLngBounds(this._map.getBounds().getSouthWest().wrap(),this._map.getBounds().getNorthEast().wrap());
                var zoom = this._map.getZoom();
                for (var i = 0; i < this._providers.length; i++) {
                        var p = this._providers[i];
@@ -107,13 +108,13 @@ L.BingLayer = L.TileLayer.extend({
                        }
                }
        },
-       
-       onAdd: function(map) {
+
+       onAdd: function (map) {
                this.loadMetadata();
                L.TileLayer.prototype.onAdd.apply(this, [map]);
        },
 
-       onRemove: function(map) {
+       onRemove: function (map) {
                for (var i = 0; i < this._providers.length; i++) {
                        var p = this._providers[i];
                        if (p.active && this._map.attributionControl) {
@@ -121,7 +122,7 @@ L.BingLayer = L.TileLayer.extend({
                                p.active = false;
                        }
                }
-               L.TileLayer.prototype.onRemove.apply(this, [map]);
+               L.TileLayer.prototype.onRemove.apply(this, [map]);
        }
 });
 
index d356a4e..093ea8b 100644 (file)
@@ -1,11 +1,13 @@
-(function() {
+(function () {
 
 L.Control.FullScreen = L.Control.extend({
        options: {
                position: 'topleft',
                title: 'Full Screen',
+               titleCancel: 'Exit Full Screen',
                forceSeparateButton: false,
-               forcePseudoFullscreen: false
+               forcePseudoFullscreen: false,
+               fullscreenElement: false
        },
        
        onAdd: function (map) {
@@ -25,19 +27,21 @@ L.Control.FullScreen = L.Control.extend({
 
                this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
 
+               this._map.on('enterFullscreen exitFullscreen', this._toggleTitle, this);
+
                return container;
        },
        
-       _createButton: function (title, className, content,container, fn, context) {
-               var link = L.DomUtil.create('a', className, container);
-               link.href = '#';
-               link.title = title;
-               link.innerHTML = content;
+       _createButton: function (title, className, content, container, fn, context) {
+               this.link = L.DomUtil.create('a', className, container);
+               this.link.href = '#';
+               this.link.title = title;
+               this.link.innerHTML = content;
 
                L.DomEvent
-                       .addListener(link, 'click', L.DomEvent.stopPropagation)
-                       .addListener(link, 'click', L.DomEvent.preventDefault)
-                       .addListener(link, 'click', fn, context);
+                       .addListener(this.link, 'click', L.DomEvent.stopPropagation)
+                       .addListener(this.link, 'click', L.DomEvent.preventDefault)
+                       .addListener(this.link, 'click', fn, context);
                
                L.DomEvent
                        .addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
@@ -49,7 +53,7 @@ L.Control.FullScreen = L.Control.extend({
                        .addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
                        .addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
 
-               return link;
+               return this.link;
        },
        
        toggleFullScreen: function () {
@@ -57,7 +61,7 @@ L.Control.FullScreen = L.Control.extend({
                map._exitFired = false;
                if (map._isFullscreen) {
                        if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
-                               fullScreenApi.cancelFullScreen(map._container);
+                               fullScreenApi.cancelFullScreen(this.options.fullscreenElement ? this.options.fullscreenElement : map._container);
                        } else {
                                L.DomUtil.removeClass(map._container, 'leaflet-pseudo-fullscreen');
                        }
@@ -68,7 +72,7 @@ L.Control.FullScreen = L.Control.extend({
                }
                else {
                        if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
-                               fullScreenApi.requestFullScreen(map._container);
+                               fullScreenApi.requestFullScreen(this.options.fullscreenElement ? this.options.fullscreenElement : map._container);
                        } else {
                                L.DomUtil.addClass(map._container, 'leaflet-pseudo-fullscreen');
                        }
@@ -78,6 +82,10 @@ L.Control.FullScreen = L.Control.extend({
                }
        },
        
+       _toggleTitle: function () {
+               this.link.title = this._map._isFullscreen ? this.options.title : this.options.titleCancel;
+       },
+       
        _handleEscKey: function () {
                var map = this._map;
                if (!fullScreenApi.isFullScreen(map) && !map._exitFired) {
@@ -111,9 +119,9 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
        var 
                fullScreenApi = { 
                        supportsFullScreen: false,
-                       isFullScreen: function() { return false; }, 
-                       requestFullScreen: function() {}, 
-                       cancelFullScreen: function() {},
+                       isFullScreen: function () { return false; }, 
+                       requestFullScreen: function () {}, 
+                       cancelFullScreen: function () {},
                        fullScreenEventName: '',
                        prefix: ''
                },
@@ -124,40 +132,64 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
                fullScreenApi.supportsFullScreen = true;
        } else {
                // check for fullscreen support by vendor prefix
-               for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
+               for (var i = 0, il = browserPrefixes.length; i < il; i++) {
                        fullScreenApi.prefix = browserPrefixes[i];
-                       if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] !== 'undefined' ) {
+                       if (typeof document[fullScreenApi.prefix + 'CancelFullScreen'] !== 'undefined') {
                                fullScreenApi.supportsFullScreen = true;
                                break;
                        }
                }
+               if (typeof document['msExitFullscreen'] !== 'undefined') {
+                       fullScreenApi.prefix = 'ms';
+                       fullScreenApi.supportsFullScreen = true;
+               }
        }
        
        // update methods to do something useful
        if (fullScreenApi.supportsFullScreen) {
-               fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
-               fullScreenApi.isFullScreen = function() {
-                       switch (this.prefix) {  
+               if (fullScreenApi.prefix === 'ms') {
+                       fullScreenApi.fullScreenEventName = 'MSFullscreenChange';
+               } else {
+                       fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
+               }
+               fullScreenApi.isFullScreen = function () {
+                       switch (this.prefix) {
                                case '':
                                        return document.fullScreen;
                                case 'webkit':
                                        return document.webkitIsFullScreen;
+                               case 'ms':
+                                       return document.msFullscreenElement;
                                default:
                                        return document[this.prefix + 'FullScreen'];
                        }
                };
-               fullScreenApi.requestFullScreen = function(el) {
-                       return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen']();
+               fullScreenApi.requestFullScreen = function (el) {
+                       switch (this.prefix) {
+                               case '':
+                                       return el.requestFullscreen();
+                               case 'ms':
+                                       return el.msRequestFullscreen();
+                               default:
+                                       return el[this.prefix + 'RequestFullScreen']();
+                       }
                };
-               fullScreenApi.cancelFullScreen = function(el) {
-                       return (this.prefix === '') ? document.exitFullscreen() : document[this.prefix + 'CancelFullScreen']();
+               fullScreenApi.cancelFullScreen = function () {
+                       switch (this.prefix) {
+                               case '':
+                                       return document.exitFullscreen();
+                               case 'ms':
+                                       return document.msExitFullscreen();
+                               default:
+                                       return document[this.prefix + 'CancelFullScreen']();
+                       }
                };
        }
 
        // jQuery plugin
        if (typeof jQuery !== 'undefined') {
-               jQuery.fn.requestFullScreen = function() {
-                       return this.each(function() {
+               jQuery.fn.requestFullScreen = function () {
+                       return this.each(function () {
                                var el = jQuery(this);
                                if (fullScreenApi.supportsFullScreen) {
                                        fullScreenApi.requestFullScreen(el);
index 2baef61..c2b0535 100644 (file)
-L.Control.MiniMap = L.Control.extend({
-       options: {
-               position: 'bottomright',
-               toggleDisplay: false,
-               zoomLevelOffset: -5,
-               zoomLevelFixed: false,
-               zoomAnimation: false,
-               autoToggleDisplay: false,
-               width: 150,
-               height: 150,
-               aimingRectOptions: {color: "#ff7800", weight: 1, clickable: false},
-               shadowRectOptions: {color: "#000000", weight: 1, clickable: false, opacity:0, fillOpacity:0}
-       },
-       
-       hideText: 'Hide MiniMap',
-       
-       showText: 'Show MiniMap',
-       
-       //layer is the map layer to be shown in the minimap
-       initialize: function (layer, options) {
-               L.Util.setOptions(this, options);
-               //Make sure the aiming rects are non-clickable even if the user tries to set them clickable (most likely by forgetting to specify them false)
-               this.options.aimingRectOptions.clickable = false;
-               this.options.shadowRectOptions.clickable = false;
-               this._layer = layer;
-       },
-       
-       onAdd: function (map) {
-
-               this._mainMap = map;
-
-               //Creating the container and stopping events from spilling through to the main map.
-               this._container = L.DomUtil.create('div', 'leaflet-control-minimap');
-               this._container.style.width = this.options.width + 'px';
-               this._container.style.height = this.options.height + 'px';
-               L.DomEvent.disableClickPropagation(this._container);
-               L.DomEvent.on(this._container, 'mousewheel', L.DomEvent.stopPropagation);
-
-
-               this._miniMap = new L.Map(this._container,
-               {
-                       attributionControl: false,
-                       zoomControl: false,
-                       zoomAnimation: this.options.zoomAnimation,
-                       autoToggleDisplay: this.options.autoToggleDisplay,
-                       touchZoom: !this.options.zoomLevelFixed,
-                       scrollWheelZoom: !this.options.zoomLevelFixed,
-                       doubleClickZoom: !this.options.zoomLevelFixed,
-                       boxZoom: !this.options.zoomLevelFixed,
-                       crs: map.options.crs
-               });
-
-               this._miniMap.addLayer(this._layer);
-
-               //These bools are used to prevent infinite loops of the two maps notifying each other that they've moved.
-               this._mainMapMoving = false;
-               this._miniMapMoving = false;
-
-               //Keep a record of this to prevent auto toggling when the user explicitly doesn't want it.
-               this._userToggledDisplay = false;
-               this._minimized = false;
-
-               if (this.options.toggleDisplay) {
-                       this._addToggleButton();
-               }
+// Following https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md
+(function (factory, window) {
 
-               this._miniMap.whenReady(L.Util.bind(function () {
-                       this._aimingRect = L.rectangle(this._mainMap.getBounds(), this.options.aimingRectOptions).addTo(this._miniMap);
-                       this._shadowRect = L.rectangle(this._mainMap.getBounds(), this.options.shadowRectOptions).addTo(this._miniMap);
-                       this._mainMap.on('moveend', this._onMainMapMoved, this);
-                       this._mainMap.on('move', this._onMainMapMoving, this);
-                       this._miniMap.on('movestart', this._onMiniMapMoveStarted, this);
-                       this._miniMap.on('move', this._onMiniMapMoving, this);
-                       this._miniMap.on('moveend', this._onMiniMapMoved, this);
-               }, this));
-
-               return this._container;
-       },
-
-       addTo: function (map) {
-               L.Control.prototype.addTo.call(this, map);
-               this._miniMap.setView(this._mainMap.getCenter(), this._decideZoom(true));
-               this._setDisplay(this._decideMinimized());
-               return this;
-       },
-
-       onRemove: function (map) {
-               this._mainMap.off('moveend', this._onMainMapMoved, this);
-               this._mainMap.off('move', this._onMainMapMoving, this);
-               this._miniMap.off('moveend', this._onMiniMapMoved, this);
-
-               this._miniMap.removeLayer(this._layer);
-       },
-
-       _addToggleButton: function () {
-               this._toggleDisplayButton = this.options.toggleDisplay ? this._createButton(
-                               '', this.hideText, 'leaflet-control-minimap-toggle-display', this._container, this._toggleDisplayButtonClicked, this) : undefined;
-       },
-
-       _createButton: function (html, title, className, container, fn, context) {
-               var link = L.DomUtil.create('a', className, container);
-               link.innerHTML = html;
-               link.href = '#';
-               link.title = title;
-
-               var stop = L.DomEvent.stopPropagation;
-
-               L.DomEvent
-                       .on(link, 'click', stop)
-                       .on(link, 'mousedown', stop)
-                       .on(link, 'dblclick', stop)
-                       .on(link, 'click', L.DomEvent.preventDefault)
-                       .on(link, 'click', fn, context);
-
-               return link;
-       },
-
-       _toggleDisplayButtonClicked: function () {
-               this._userToggledDisplay = true;
-               if (!this._minimized) {
-                       this._minimize();
-                       this._toggleDisplayButton.title = this.showText;
-               }
-               else {
-                       this._restore();
-                       this._toggleDisplayButton.title = this.hideText;
-               }
-       },
+       // define an AMD module that relies on 'leaflet'
+       if (typeof define === 'function' && define.amd) {
+               define(['leaflet'], factory);
+
+       // define a Common JS module that relies on 'leaflet'
+       } else if (typeof exports === 'object') {
+               module.exports = factory(require('leaflet'));
+       }
+
+       // attach your plugin to the global 'L' variable
+       if (typeof window !== 'undefined' && window.L) {
+               window.L.Control.MiniMap = factory(L);
+               window.L.control.minimap = function (layer, options) {
+                       return new window.L.Control.MiniMap(layer, options);
+               };
+       }
+}(function (L) {
+
+       var MiniMap = L.Control.extend({
+               options: {
+                       position: 'bottomright',
+                       toggleDisplay: false,
+                       zoomLevelOffset: -5,
+                       zoomLevelFixed: false,
+                       centerFixed: false,
+                       zoomAnimation: false,
+                       autoToggleDisplay: false,
+                       minimized: false,
+                       width: 150,
+                       height: 150,
+                       collapsedWidth: 19,
+                       collapsedHeight: 19,
+                       aimingRectOptions: {color: '#ff7800', weight: 1, clickable: false},
+                       shadowRectOptions: {color: '#000000', weight: 1, clickable: false, opacity: 0, fillOpacity: 0},
+                       strings: {hideText: 'Hide MiniMap', showText: 'Show MiniMap'},
+                       mapOptions: {}  // Allows definition / override of Leaflet map options.
+               },
+
+               // layer is the map layer to be shown in the minimap
+               initialize: function (layer, options) {
+                       L.Util.setOptions(this, options);
+                       // Make sure the aiming rects are non-clickable even if the user tries to set them clickable (most likely by forgetting to specify them false)
+                       this.options.aimingRectOptions.clickable = false;
+                       this.options.shadowRectOptions.clickable = false;
+                       this._layer = layer;
+               },
+
+               onAdd: function (map) {
+
+                       this._mainMap = map;
+
+                       // Creating the container and stopping events from spilling through to the main map.
+                       this._container = L.DomUtil.create('div', 'leaflet-control-minimap');
+                       this._container.style.width = this.options.width + 'px';
+                       this._container.style.height = this.options.height + 'px';
+                       L.DomEvent.disableClickPropagation(this._container);
+                       L.DomEvent.on(this._container, 'mousewheel', L.DomEvent.stopPropagation);
+
+                       var mapOptions = {
+                               attributionControl: false,
+                               dragging: !this.options.centerFixed,
+                               zoomControl: false,
+                               zoomAnimation: this.options.zoomAnimation,
+                               autoToggleDisplay: this.options.autoToggleDisplay,
+                               touchZoom: this.options.centerFixed ? 'center' : !this._isZoomLevelFixed(),
+                               scrollWheelZoom: this.options.centerFixed ? 'center' : !this._isZoomLevelFixed(),
+                               doubleClickZoom: this.options.centerFixed ? 'center' : !this._isZoomLevelFixed(),
+                               boxZoom: !this._isZoomLevelFixed(),
+                               crs: map.options.crs
+                       };
+                       mapOptions = L.Util.extend(this.options.mapOptions, mapOptions);  // merge with priority of the local mapOptions object.
+
+                       this._miniMap = new L.Map(this._container, mapOptions);
+
+                       this._miniMap.addLayer(this._layer);
+
+                       // These bools are used to prevent infinite loops of the two maps notifying each other that they've moved.
+                       this._mainMapMoving = false;
+                       this._miniMapMoving = false;
+
+                       // Keep a record of this to prevent auto toggling when the user explicitly doesn't want it.
+                       this._userToggledDisplay = false;
+                       this._minimized = false;
+
+                       if (this.options.toggleDisplay) {
+                               this._addToggleButton();
+                       }
 
-       _setDisplay: function (minimize) {
-               if (minimize != this._minimized) {
+                       this._miniMap.whenReady(L.Util.bind(function () {
+                               this._aimingRect = L.rectangle(this._mainMap.getBounds(), this.options.aimingRectOptions).addTo(this._miniMap);
+                               this._shadowRect = L.rectangle(this._mainMap.getBounds(), this.options.shadowRectOptions).addTo(this._miniMap);
+                               this._mainMap.on('moveend', this._onMainMapMoved, this);
+                               this._mainMap.on('move', this._onMainMapMoving, this);
+                               this._miniMap.on('movestart', this._onMiniMapMoveStarted, this);
+                               this._miniMap.on('move', this._onMiniMapMoving, this);
+                               this._miniMap.on('moveend', this._onMiniMapMoved, this);
+                       }, this));
+
+                       return this._container;
+               },
+
+               addTo: function (map) {
+                       L.Control.prototype.addTo.call(this, map);
+
+                       var center = this.options.centerFixed || this._mainMap.getCenter();
+                       this._miniMap.setView(center, this._decideZoom(true));
+                       this._setDisplay(this.options.minimized);
+                       return this;
+               },
+
+               onRemove: function (map) {
+                       this._mainMap.off('moveend', this._onMainMapMoved, this);
+                       this._mainMap.off('move', this._onMainMapMoving, this);
+                       this._miniMap.off('moveend', this._onMiniMapMoved, this);
+
+                       this._miniMap.removeLayer(this._layer);
+               },
+
+               changeLayer: function (layer) {
+                       this._miniMap.removeLayer(this._layer);
+                       this._layer = layer;
+                       this._miniMap.addLayer(this._layer);
+               },
+
+               _addToggleButton: function () {
+                       this._toggleDisplayButton = this.options.toggleDisplay ? this._createButton(
+                               '', this.options.strings.hideText, ('leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-' +
+                               this.options.position), this._container, this._toggleDisplayButtonClicked, this) : undefined;
+
+                       this._toggleDisplayButton.style.width = this.options.collapsedWidth + 'px';
+                       this._toggleDisplayButton.style.height = this.options.collapsedHeight + 'px';
+               },
+
+               _createButton: function (html, title, className, container, fn, context) {
+                       var link = L.DomUtil.create('a', className, container);
+                       link.innerHTML = html;
+                       link.href = '#';
+                       link.title = title;
+
+                       var stop = L.DomEvent.stopPropagation;
+
+                       L.DomEvent
+                               .on(link, 'click', stop)
+                               .on(link, 'mousedown', stop)
+                               .on(link, 'dblclick', stop)
+                               .on(link, 'click', L.DomEvent.preventDefault)
+                               .on(link, 'click', fn, context);
+
+                       return link;
+               },
+
+               _toggleDisplayButtonClicked: function () {
+                       this._userToggledDisplay = true;
                        if (!this._minimized) {
                                this._minimize();
-                       }
-                       else {
+                       } else {
                                this._restore();
                        }
-               }
-       },
-
-       _minimize: function () {
-               // hide the minimap
-               if (this.options.toggleDisplay) {
-                       this._container.style.width = '19px';
-                       this._container.style.height = '19px';
-                       this._toggleDisplayButton.className += ' minimized';
-               }
-               else {
-                       this._container.style.display = 'none';
-               }
-               this._minimized = true;
-       },
+               },
 
-       _restore: function () {
-               if (this.options.toggleDisplay) {
-                       this._container.style.width = this.options.width + 'px';
-                       this._container.style.height = this.options.height + 'px';
-                       this._toggleDisplayButton.className = this._toggleDisplayButton.className
-                                       .replace(/(?:^|\s)minimized(?!\S)/g, '');
-               }
-               else {
-                       this._container.style.display = 'block';
-               }
-               this._minimized = false;
-       },
-
-       _onMainMapMoved: function (e) {
-               if (!this._miniMapMoving) {
-                       this._mainMapMoving = true;
-                       this._miniMap.setView(this._mainMap.getCenter(), this._decideZoom(true));
-                       this._setDisplay(this._decideMinimized());
-               } else {
-                       this._miniMapMoving = false;
-               }
-               this._aimingRect.setBounds(this._mainMap.getBounds());
-       },
-
-       _onMainMapMoving: function (e) {
-               this._aimingRect.setBounds(this._mainMap.getBounds());
-       },
-
-       _onMiniMapMoveStarted:function (e) {
-               var lastAimingRect = this._aimingRect.getBounds();
-               var sw = this._miniMap.latLngToContainerPoint(lastAimingRect.getSouthWest());
-               var ne = this._miniMap.latLngToContainerPoint(lastAimingRect.getNorthEast());
-               this._lastAimingRectPosition = {sw:sw,ne:ne};
-       },
-
-       _onMiniMapMoving: function (e) {
-               if (!this._mainMapMoving && this._lastAimingRectPosition) {
-                       this._shadowRect.setBounds(new L.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne)));
-                       this._shadowRect.setStyle({opacity:1,fillOpacity:0.3});
-               }
-       },
-
-       _onMiniMapMoved: function (e) {
-               if (!this._mainMapMoving) {
-                       this._miniMapMoving = true;
-                       this._mainMap.setView(this._miniMap.getCenter(), this._decideZoom(false));
-                       this._shadowRect.setStyle({opacity:0,fillOpacity:0});
-               } else {
-                       this._mainMapMoving = false;
-               }
-       },
-
-       _decideZoom: function (fromMaintoMini) {
-               if (!this.options.zoomLevelFixed) {
-                       if (fromMaintoMini)
-                               return this._mainMap.getZoom() + this.options.zoomLevelOffset;
-                       else {
-                               var currentDiff = this._miniMap.getZoom() - this._mainMap.getZoom();
-                               var proposedZoom = this._miniMap.getZoom() - this.options.zoomLevelOffset;
-                               var toRet;
-                               
-                               if (currentDiff > this.options.zoomLevelOffset && this._mainMap.getZoom() < this._miniMap.getMinZoom() - this.options.zoomLevelOffset) {
-                                       //This means the miniMap is zoomed out to the minimum zoom level and can't zoom any more.
-                                       if (this._miniMap.getZoom() > this._lastMiniMapZoom) {
-                                               //This means the user is trying to zoom in by using the minimap, zoom the main map.
-                                               toRet = this._mainMap.getZoom() + 1;
-                                               //Also we cheat and zoom the minimap out again to keep it visually consistent.
-                                               this._miniMap.setZoom(this._miniMap.getZoom() -1);
+               _setDisplay: function (minimize) {
+                       if (minimize !== this._minimized) {
+                               if (!this._minimized) {
+                                       this._minimize();
+                               } else {
+                                       this._restore();
+                               }
+                       }
+               },
+
+               _minimize: function () {
+                       // hide the minimap
+                       if (this.options.toggleDisplay) {
+                               this._container.style.width = this.options.collapsedWidth + 'px';
+                               this._container.style.height = this.options.collapsedHeight + 'px';
+                               this._toggleDisplayButton.className += (' minimized-' + this.options.position);
+                               this._toggleDisplayButton.title = this.options.strings.showText;
+                       } else {
+                               this._container.style.display = 'none';
+                       }
+                       this._minimized = true;
+               },
+
+               _restore: function () {
+                       if (this.options.toggleDisplay) {
+                               this._container.style.width = this.options.width + 'px';
+                               this._container.style.height = this.options.height + 'px';
+                               this._toggleDisplayButton.className = this._toggleDisplayButton.className
+                                       .replace('minimized-'   + this.options.position, '');
+                               this._toggleDisplayButton.title = this.options.strings.hideText;
+                       } else {
+                               this._container.style.display = 'block';
+                       }
+                       this._minimized = false;
+               },
+
+               _onMainMapMoved: function (e) {
+                       if (!this._miniMapMoving) {
+                               var center = this.options.centerFixed || this._mainMap.getCenter();
+
+                               this._mainMapMoving = true;
+                               this._miniMap.setView(center, this._decideZoom(true));
+                               this._setDisplay(this._decideMinimized());
+                       } else {
+                               this._miniMapMoving = false;
+                       }
+                       this._aimingRect.setBounds(this._mainMap.getBounds());
+               },
+
+               _onMainMapMoving: function (e) {
+                       this._aimingRect.setBounds(this._mainMap.getBounds());
+               },
+
+               _onMiniMapMoveStarted: function (e) {
+                       if (!this.options.centerFixed) {
+                               var lastAimingRect = this._aimingRect.getBounds();
+                               var sw = this._miniMap.latLngToContainerPoint(lastAimingRect.getSouthWest());
+                               var ne = this._miniMap.latLngToContainerPoint(lastAimingRect.getNorthEast());
+                               this._lastAimingRectPosition = {sw: sw, ne: ne};
+                       }
+               },
+
+               _onMiniMapMoving: function (e) {
+                       if (!this.options.centerFixed) {
+                               if (!this._mainMapMoving && this._lastAimingRectPosition) {
+                                       this._shadowRect.setBounds(new L.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw), this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne)));
+                                       this._shadowRect.setStyle({opacity: 1, fillOpacity: 0.3});
+                               }
+                       }
+               },
+
+               _onMiniMapMoved: function (e) {
+                       if (!this._mainMapMoving) {
+                               this._miniMapMoving = true;
+                               this._mainMap.setView(this._miniMap.getCenter(), this._decideZoom(false));
+                               this._shadowRect.setStyle({opacity: 0, fillOpacity: 0});
+                       } else {
+                               this._mainMapMoving = false;
+                       }
+               },
+
+               _isZoomLevelFixed: function () {
+                       var zoomLevelFixed = this.options.zoomLevelFixed;
+                       return this._isDefined(zoomLevelFixed) && this._isInteger(zoomLevelFixed);
+               },
+
+               _decideZoom: function (fromMaintoMini) {
+                       if (!this._isZoomLevelFixed()) {
+                               if (fromMaintoMini) {
+                                       return this._mainMap.getZoom() + this.options.zoomLevelOffset;
+                               } else {
+                                       var currentDiff = this._miniMap.getZoom() - this._mainMap.getZoom();
+                                       var proposedZoom = this._miniMap.getZoom() - this.options.zoomLevelOffset;
+                                       var toRet;
+
+                                       if (currentDiff > this.options.zoomLevelOffset && this._mainMap.getZoom() < this._miniMap.getMinZoom() - this.options.zoomLevelOffset) {
+                                               // This means the miniMap is zoomed out to the minimum zoom level and can't zoom any more.
+                                               if (this._miniMap.getZoom() > this._lastMiniMapZoom) {
+                                                       // This means the user is trying to zoom in by using the minimap, zoom the main map.
+                                                       toRet = this._mainMap.getZoom() + 1;
+                                                       // Also we cheat and zoom the minimap out again to keep it visually consistent.
+                                                       this._miniMap.setZoom(this._miniMap.getZoom() - 1);
+                                               } else {
+                                                       // Either the user is trying to zoom out past the mini map's min zoom or has just panned using it, we can't tell the difference.
+                                                       // Therefore, we ignore it!
+                                                       toRet = this._mainMap.getZoom();
+                                               }
                                        } else {
-                                               //Either the user is trying to zoom out past the mini map's min zoom or has just panned using it, we can't tell the difference.
-                                               //Therefore, we ignore it!
-                                               toRet = this._mainMap.getZoom();
+                                               // This is what happens in the majority of cases, and always if you configure the min levels + offset in a sane fashion.
+                                               toRet = proposedZoom;
                                        }
+                                       this._lastMiniMapZoom = this._miniMap.getZoom();
+                                       return toRet;
+                               }
+                       } else {
+                               if (fromMaintoMini) {
+                                       return this.options.zoomLevelFixed;
                                } else {
-                                       //This is what happens in the majority of cases, and always if you configure the min levels + offset in a sane fashion.
-                                       toRet = proposedZoom;
+                                       return this._mainMap.getZoom();
                                }
-                               this._lastMiniMapZoom = this._miniMap.getZoom();
-                               return toRet;
                        }
-               } else {
-                       if (fromMaintoMini)
-                               return this.options.zoomLevelFixed;
-                       else
-                               return this._mainMap.getZoom();
-               }
-       },
+               },
 
-       _decideMinimized: function () {
-               if (this._userToggledDisplay) {
-                       return this._minimized;
-               }
+               _decideMinimized: function () {
+                       if (this._userToggledDisplay) {
+                               return this._minimized;
+                       }
 
-               if (this.options.autoToggleDisplay) {
-                       if (this._mainMap.getBounds().contains(this._miniMap.getBounds())) {
-                               return true;
+                       if (this.options.autoToggleDisplay) {
+                               if (this._mainMap.getBounds().contains(this._miniMap.getBounds())) {
+                                       return true;
+                               }
+                               return false;
                        }
-                       return false;
+
+                       return this._minimized;
+               },
+
+               _isInteger: function (value) {
+                       return typeof value === 'number';
+               },
+
+               _isDefined: function (value) {
+                       return typeof value !== 'undefined';
                }
+       });
 
-               return this._minimized;
-       }
-});
+       L.Map.mergeOptions({
+               miniMapControl: false
+       });
 
-L.Map.mergeOptions({
-       miniMapControl: false
-});
+       L.Map.addInitHook(function () {
+               if (this.options.miniMapControl) {
+                       this.miniMapControl = (new MiniMap()).addTo(this);
+               }
+       });
 
-L.Map.addInitHook(function () {
-       if (this.options.miniMapControl) {
-               this.miniMapControl = (new L.Control.MiniMap()).addTo(this);
-       }
-});
+       return MiniMap;
 
-L.control.minimap = function (options) {
-       return new L.Control.MiniMap(options);
-};
+}, window));
index 9f4fbc9..d500d29 100755 (executable)
@@ -1,8 +1,8 @@
 //#include 'GPX.js'
 
-(function() {
+(function () {
 
-function d2h(d) {
+function d2h (d) {
        var hex = '0123456789ABCDEF';
        var r = '';
        d = Math.floor(d);
@@ -14,9 +14,9 @@ function d2h(d) {
        return r;
 }
 
-function gradient(color) {
+function gradient (color) {
        // First arc (0, PI) in HSV colorspace
-       function f2h(d) { return d2h(256 * d); }
+       function f2h (d) { return d2h(256 * d); }
        if (color < 0)
                return '#FF0000';
        else if (color < 1.0/3)
@@ -29,7 +29,7 @@ function gradient(color) {
                return '#00FFFF';
 }
 
-function gpx2time(s) {
+function gpx2time (s) {
        // 2011-09-24T12:07:53Z
        if (s.length !== 10 + 1 + 8 + 1)
                return new Date();
@@ -42,16 +42,16 @@ L.GPX.include({
                chunks: 200
        },
 
-       speedSplitEnable: function(options) {
+       speedSplitEnable: function (options) {
                L.Util.setOptions(this, options);
                return this.on('addline', this.speed_split, this);
        },
 
-       speedSplitDisable: function() {
+       speedSplitDisable: function () {
                return this.off('addline', this.speed_split, this);
        },
 
-       speed_split: function(e) {
+       speed_split: function (e) {
                var l = e.line.pop(), ll = l.getLatLngs();
                var chunk = Math.floor(ll.length / this.options.chunks);
                if (chunk < 3) chunk = 3;
index e2e7d6a..f582d5a 100755 (executable)
@@ -1,5 +1,5 @@
 L.GPX = L.FeatureGroup.extend({
-       initialize: function(gpx, options) {
+       initialize: function (gpx, options) {
                L.Util.setOptions(this, options);
                this._gpx = gpx;
                this._layers = {};
@@ -9,7 +9,7 @@ L.GPX = L.FeatureGroup.extend({
                }
        },
        
-       loadXML: function(url, cb, options, async) {
+       loadXML: function (url, cb, options, async) {
                if (async === undefined) async = this.options.async;
                if (options === undefined) options = this.options;
 
@@ -17,48 +17,48 @@ L.GPX = L.FeatureGroup.extend({
                req.open('GET', url, async);
                try {
                        req.overrideMimeType('text/xml'); // unsupported by IE
-               } catch(e) {}
-               req.onreadystatechange = function() {
+               } catch (e) {}
+               req.onreadystatechange = function () {
                        if (req.readyState !== 4) return;
-                       if(req.status === 200) cb(req.responseXML, options);
+                       if (req.status === 200) cb(req.responseXML, options);
                };
                req.send(null);
        },
 
-       _humanLen: function(l) {
+       _humanLen: function (l) {
                if (l < 2000)
                        return l.toFixed(0) + ' m';
                else
                        return (l/1000).toFixed(1) + ' km';
        },
        
-       _polylineLen: function(line)//line is a L.Polyline()
+       _polylineLen: function (line)//line is a L.Polyline()
        {
                var ll = line._latlngs;
                var d = 0, p = null;
                for (var i = 0; i < ll.length; i++)
                {
-                       if(i && p)
+                       if (i && p)
                                d += p.distanceTo(ll[i]);
                        p = ll[i];
                }
                return d;
        },
 
-       addGPX: function(url, options, async) {
+       addGPX: function (url, options, async) {
                var _this = this;
-               var cb = function(gpx, options) { _this._addGPX(gpx, options); };
+               var cb = function (gpx, options) { _this._addGPX(gpx, options); };
                this.loadXML(url, cb, options, async);
        },
 
-       _addGPX: function(gpx, options) {
+       _addGPX: function (gpx, options) {
                var layers = this.parseGPX(gpx, options);
                if (!layers) return;
                this.addLayer(layers);
                this.fire('loaded');
-       },      
+       },
 
-       parseGPX: function(xml, options) {
+       parseGPX: function (xml, options) {
                var j, i, el, layers = [];
                var named = false, tags = [['rte','rtept'], ['trkseg','trkpt']];
 
@@ -91,8 +91,8 @@ L.GPX = L.FeatureGroup.extend({
                return layer;
        },
 
-       parse_name: function(xml, layer) {
-               var i, el, txt='', name, descr='', len=0;
+       parse_name: function (xml, layer) {
+               var i, el, txt='', name, descr='', link, len=0;
                el = xml.getElementsByTagName('name');
                if (el.length)
                        name = el[0].childNodes[0].nodeValue;
@@ -101,18 +101,22 @@ L.GPX = L.FeatureGroup.extend({
                        for (var j = 0; j < el[i].childNodes.length; j++)
                                descr = descr + el[i].childNodes[j].nodeValue;
                }
+               el = xml.getElementsByTagName('link');
+               if (el.length)
+                       link = el[0].getAttribute('href');
 
-               if(layer instanceof L.Path)
+               if (layer instanceof L.Path)
                        len = this._polylineLen(layer);
 
                if (name) txt += '<h2>' + name + '</h2>' + descr;
                if (len) txt += '<p>' + this._humanLen(len) + '</p>';
-               
+               if (link) txt += '<p><a target="_blank" href="'+link+'">[...]</a></p>'; 
+
                if (layer && layer._popup === undefined) layer.bindPopup(txt);
                return txt;
        },
 
-       parse_trkseg: function(line, xml, options, tag) {
+       parse_trkseg: function (line, xml, options, tag) {
                var el = line.getElementsByTagName(tag);
                if (!el.length) return [];
                var coords = [];
@@ -132,10 +136,17 @@ L.GPX = L.FeatureGroup.extend({
                return l;
        },
 
-       parse_wpt: function(e, xml, options) {
+       parse_wpt: function (e, xml, options) {
                var m = new L.Marker(new L.LatLng(e.getAttribute('lat'),
                                                e.getAttribute('lon')), options);
-               this.fire('addpoint', {point:m});
+               var attributes = {};
+               for (var i = 0; i < e.childNodes.length; i++) {
+                       var ch = e.childNodes[i];
+                       if (ch.nodeName !== '#text') {
+                               attributes[ch.nodeName] = ch.textContent;
+                       }
+               }
+               this.fire('addpoint', {point:m, attributes:attributes});
                return m;
        }
 });
index c919618..418783b 100755 (executable)
@@ -23,42 +23,56 @@ L.Google = L.Class.extend({
        },
 
        // Possible types: SATELLITE, ROADMAP, HYBRID, TERRAIN
-       initialize: function(type, options) {
+       initialize: function (type, options) {
+               var _this = this;
+
+               this._ready = L.Google.isGoogleMapsReady();
+
                L.Util.setOptions(this, options);
 
-               this._ready = google.maps.Map !== undefined;
-               if (!this._ready) L.Google.asyncWait.push(this);
+               this._googleApiPromise = this._ready ? Promise.resolve(window.google) : L.Google.createGoogleApiPromise();
+
+               this._googleApiPromise
+               .then(function () {
+                       _this._ready = true;
+                       _this._initMapObject();
+                       _this._update();
+               });
 
                this._type = type || 'SATELLITE';
        },
 
-       onAdd: function(map, insertAtTheBottom) {
-               this._map = map;
-               this._insertAtTheBottom = insertAtTheBottom;
+       onAdd: function (map, insertAtTheBottom) {
+               var _this = this;
+               this._googleApiPromise
+               .then(function () {
+                       _this._map = map;
+                       _this._insertAtTheBottom = insertAtTheBottom;
 
-               // create a container div for tiles
-               this._initContainer();
-               this._initMapObject();
+                       // create a container div for tiles
+                       _this._initContainer();
+                       _this._initMapObject();
 
-               // set up events
-               map.on('viewreset', this._resetCallback, this);
+                       // set up events
+                       map.on('viewreset', _this._reset, _this);
 
-               this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this);
-               map.on('move', this._update, this);
+                       _this._limitedUpdate = L.Util.limitExecByInterval(_this._update, 150, _this);
+                       map.on('move', _this._update, _this);
 
-               map.on('zoomanim', this._handleZoomAnim, this);
+                       map.on('zoomanim', _this._handleZoomAnim, _this);
 
-               //20px instead of 1em to avoid a slight overlap with google's attribution
-               map._controlCorners.bottomright.style.marginBottom = '20px';
+                       //20px instead of 1em to avoid a slight overlap with google's attribution
+                       map._controlCorners.bottomright.style.marginBottom = '20px';
 
-               this._reset();
-               this._update();
+                       _this._reset();
+                       _this._update();
+               });
        },
 
-       onRemove: function(map) {
+       onRemove: function (map) {
                map._container.removeChild(this._container);
 
-               map.off('viewreset', this._resetCallback, this);
+               map.off('viewreset', this._reset, this);
 
                map.off('move', this._update, this);
 
@@ -67,23 +81,23 @@ L.Google = L.Class.extend({
                map._controlCorners.bottomright.style.marginBottom = '0em';
        },
 
-       getAttribution: function() {
+       getAttribution: function () {
                return this.options.attribution;
        },
 
-       setOpacity: function(opacity) {
+       setOpacity: function (opacity) {
                this.options.opacity = opacity;
                if (opacity < 1) {
                        L.DomUtil.setOpacity(this._container, opacity);
                }
        },
 
-       setElementSize: function(e, size) {
+       setElementSize: function (e, size) {
                e.style.width = size.x + 'px';
                e.style.height = size.y + 'px';
        },
 
-       _initContainer: function() {
+       _initContainer: function () {
                var tilePane = this._map._container,
                        first = tilePane.firstChild;
 
@@ -99,8 +113,8 @@ L.Google = L.Class.extend({
                this.setElementSize(this._container, this._map.getSize());
        },
 
-       _initMapObject: function() {
-               if (!this._ready) return;
+       _initMapObject: function () {
+               if (!this._ready || !this._container) return;
                this._google_center = new google.maps.LatLng(0, 0);
                var map = new google.maps.Map(this._container, {
                        center: this._google_center,
@@ -119,36 +133,32 @@ L.Google = L.Class.extend({
 
                var _this = this;
                this._reposition = google.maps.event.addListenerOnce(map, 'center_changed',
-                       function() { _this.onReposition(); });
+                       function () { _this.onReposition(); });
                this._google = map;
 
                google.maps.event.addListenerOnce(map, 'idle',
-                       function() { _this._checkZoomLevels(); });
+                       function () { _this._checkZoomLevels(); });
                google.maps.event.addListenerOnce(map, 'tilesloaded',
-                       function() { _this.fire('load'); });
+                       function () { _this.fire('load'); });
                //Reporting that map-object was initialized.
-               this.fire('MapObjectInitialized', { mapObject: map });
+               this.fire('MapObjectInitialized', {mapObject: map});
        },
 
-       _checkZoomLevels: function() {
+       _checkZoomLevels: function () {
                //setting the zoom level on the Google map may result in a different zoom level than the one requested
                //(it won't go beyond the level for which they have data).
                // verify and make sure the zoom levels on both Leaflet and Google maps are consistent
-               if (this._google.getZoom() !== this._map.getZoom()) {
+               if ((this._map.getZoom() !== undefined) && (this._google.getZoom() !== this._map.getZoom())) {
                        //zoom levels are out of sync. Set the leaflet zoom level to match the google one
-                       this._map.setZoom( this._google.getZoom() );
+                       this._map.setZoom(this._google.getZoom());
                }
        },
 
-       _resetCallback: function(e) {
-               this._reset(e.hard);
-       },
-
-       _reset: function(clearOldContainer) {
+       _reset: function () {
                this._initContainer();
        },
 
-       _update: function(e) {
+       _update: function () {
                if (!this._google) return;
                this._resize();
 
@@ -156,12 +166,13 @@ L.Google = L.Class.extend({
                var _center = new google.maps.LatLng(center.lat, center.lng);
 
                this._google.setCenter(_center);
-               this._google.setZoom(Math.round(this._map.getZoom()));
+               if (this._map.getZoom() !== undefined)
+                       this._google.setZoom(Math.round(this._map.getZoom()));
 
                this._checkZoomLevels();
        },
 
-       _resize: function() {
+       _resize: function () {
                var size = this._map.getSize();
                if (this._container.style.width === size.x &&
                                this._container.style.height === size.y)
@@ -180,22 +191,38 @@ L.Google = L.Class.extend({
        },
 
 
-       onReposition: function() {
+       onReposition: function () {
                if (!this._google) return;
                google.maps.event.trigger(this._google, 'resize');
        }
 });
 
-L.Google.asyncWait = [];
-L.Google.asyncInitialize = function() {
-       var i;
-       for (i = 0; i < L.Google.asyncWait.length; i++) {
-               var o = L.Google.asyncWait[i];
-               o._ready = true;
-               if (o._container) {
-                       o._initMapObject();
-                       o._update();
-               }
-       }
-       L.Google.asyncWait = [];
+L.Google.isGoogleMapsReady = function () {
+       return !!window.google && !!window.google.maps && !!window.google.maps.Map;
+};
+
+// backwards compat
+L.Google.asyncInitialize = L.Google.isGoogleMapsReady;
+
+L.Google.maxApiChecks = 10;
+
+L.Google.apiCheckIntervalMilliSecs = 500;
+
+L.Google.createGoogleApiPromise = function () {
+       var checkCounter = 0;
+       var intervalId = null;
+
+       return new Promise(function (resolve, reject) {
+               intervalId = setInterval(function () {
+                       if (checkCounter >= L.Google.maxApiChecks && !L.Google.isGoogleMapsReady()) {
+                               clearInterval(intervalId);
+                               return reject(new Error('window.google not found after max attempts'));
+                       }
+                       if (L.Google.isGoogleMapsReady()) {
+                               clearInterval(intervalId);
+                               return resolve(window.google);
+                       }
+                       checkCounter++;
+               }, L.Google.apiCheckIntervalMilliSecs);
+       });
 };
index acdc4e8..096c1c3 100755 (executable)
@@ -3,7 +3,7 @@ L.KML = L.FeatureGroup.extend({
                async: true
        },
 
-       initialize: function(kml, options) {
+       initialize: function (kml, options) {
                L.Util.setOptions(this, options);
                this._kml = kml;
                this._layers = {};
@@ -13,7 +13,7 @@ L.KML = L.FeatureGroup.extend({
                }
        },
 
-       loadXML: function(url, cb, options, async) {
+       loadXML: function (url, cb, options, async) {
                if (async === undefined) async = this.options.async;
                if (options === undefined) options = this.options;
 
@@ -36,6 +36,7 @@ L.KML = L.FeatureGroup.extend({
                        setTimeout(function () { xdr.send(); }, 0);
                } else {
                        req.open('GET', url, async);
+                       req.setRequestHeader('Accept', 'application/vnd.google-earth.kml+xml');
                        try {
                                req.overrideMimeType('text/xml'); // unsupported by IE
                        } catch (e) { }
@@ -47,13 +48,13 @@ L.KML = L.FeatureGroup.extend({
                }
        },
 
-       addKML: function(url, options, async) {
+       addKML: function (url, options, async) {
                var _this = this;
-               var cb = function(gpx, options) { _this._addKML(gpx, options); };
+               var cb = function (kml) { _this._addKML(kml); };
                this.loadXML(url, cb, options, async);
        },
 
-       _addKML: function(xml, options) {
+       _addKML: function (xml) {
                var layers = L.KML.parseKML(xml);
                if (!layers || !layers.length) return;
                for (var i = 0; i < layers.length; i++) {
@@ -106,7 +107,7 @@ L.Util.extend(L.KML, {
                return !e || e === folder;
        },
 
-       parseStyles: function(xml) {
+       parseStyles: function (xml) {
                var styles = {};
                var sl = xml.getElementsByTagName('Style');
                for (var i=0, len=sl.length; i<len; i++) {
@@ -122,9 +123,9 @@ L.Util.extend(L.KML, {
        parseStyle: function (xml) {
                var style = {}, poptions = {}, ioptions = {}, el, id;
 
-               var attributes = { color: true, width: true, Icon: true, href: true, hotSpot: true };
+               var attributes = {color: true, width: true, Icon: true, href: true, hotSpot: true};
 
-               function _parse(xml) {
+               function _parse (xml) {
                        var options = {};
                        for (var i = 0; i < xml.childNodes.length; i++) {
                                var e = xml.childNodes[i];
@@ -224,22 +225,14 @@ L.Util.extend(L.KML, {
                return new L.FeatureGroup(layers);
        },
 
-       parsePlacemark: function (place, xml, style) {
-               var h, i, j, k, el, il, options = {};
-
-               var multi = ['MultiGeometry', 'MultiTrack', 'gx:MultiTrack'];
-               for (h in multi) {
-                       el = place.getElementsByTagName(multi[h]);
-                       for (i = 0; i < el.length; i++) {
-                               return this.parsePlacemark(el[i], xml, style);
-                       }
-               }
+       parsePlacemark: function (place, xml, style, options) {
+               var h, i, j, k, el, il, opts = options || {};
 
                el = place.getElementsByTagName('styleUrl');
                for (i = 0; i < el.length; i++) {
                        var url = el[i].childNodes[0].nodeValue;
                        for (var a in style[url]) {
-                               options[a] = style[url][a];
+                               opts[a] = style[url][a];
                        }
                }
                
@@ -248,10 +241,18 @@ L.Util.extend(L.KML, {
                        var inlineStyle = this.parseStyle(place);
                        if (inlineStyle) {
                                for (k in inlineStyle) {
-                                       options[k] = inlineStyle[k];
+                                       opts[k] = inlineStyle[k];
                                }
                        }
                }
+
+               var multi = ['MultiGeometry', 'MultiTrack', 'gx:MultiTrack'];
+               for (h in multi) {
+                       el = place.getElementsByTagName(multi[h]);
+                       for (i = 0; i < el.length; i++) {
+                               return this.parsePlacemark(el[i], xml, style, opts);
+                       }
+               }
                
                var layers = [];
 
@@ -260,7 +261,7 @@ L.Util.extend(L.KML, {
                        var tag = parse[j];
                        el = place.getElementsByTagName(tag);
                        for (i = 0; i < el.length; i++) {
-                               var l = this['parse' + tag.replace(/gx:/, '')](el[i], xml, options);
+                               var l = this['parse' + tag.replace(/gx:/, '')](el[i], xml, opts);
                                if (l) { layers.push(l); }
                        }
                }
@@ -286,7 +287,7 @@ L.Util.extend(L.KML, {
                }
 
                if (name) {
-                       layer.on('add', function(e) {
+                       layer.on('add', function () {
                                layer.bindPopup('<h2>' + name + '</h2>' + descr);
                        });
                }
@@ -399,7 +400,7 @@ L.Util.extend(L.KML, {
                        ]
                );
                var attributes = {Icon: true, href: true, color: true};
-               function _parse(xml) {
+               function _parse (xml) {
                        var options = {}, ioptions = {};
                        for (var i = 0; i < xml.childNodes.length; i++) {
                                var e = xml.childNodes[i];
@@ -469,7 +470,7 @@ L.RotatedImageOverlay = L.ImageOverlay.extend({
         if (L.DomUtil.TRANSFORM) {
             // use the CSS transform rule if available
             this._image.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)';
-        } else if(L.Browser.ie) {
+        } else if (L.Browser.ie) {
             // fallback for IE6, IE7, IE8
             var rad = this.options.angle * (Math.PI / 180),
                 costheta = Math.cos(rad),
@@ -478,7 +479,7 @@ L.RotatedImageOverlay = L.ImageOverlay.extend({
                 costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')';                
         }
        },
-       getBounds: function() {
+       getBounds: function () {
                return this._bounds;
        }
 });
index 174d76b..ab2b9bc 100755 (executable)
@@ -7,7 +7,7 @@
 (function () {
        var _old__setPos = L.Marker.prototype._setPos;
        L.Marker.include({
-               _updateImg: function(i, a, s) {
+               _updateImg: function (i, a, s) {
                        a = L.point(s).divideBy(2)._subtract(L.point(a));
                        var transform = '';
                        transform += ' translate(' + -a.x + 'px, ' + -a.y + 'px)';
                        transform += ' translate(' + a.x + 'px, ' + a.y + 'px)';
                        i.style[L.DomUtil.TRANSFORM] += transform;
                },
+               
+               _getShortestEndDegree: function (startDegrees, endDegrees) {
+                       var turnAngle = Math.abs(endDegrees - startDegrees);
+                       var turnAnglePositive = (endDegrees - startDegrees) >= 0;
+                       if (turnAngle <= 180) return endDegrees;
+                       var result = startDegrees + (360 - turnAngle) * (turnAnglePositive ? -1 : 1);
+                       return result;
+               },
 
                setIconAngle: function (iconAngle) {
-                       this.options.iconAngle = iconAngle;
+                       // find shortest angle to turn over
+                       this.options.iconAngle = this._getShortestEndDegree(this.options.iconAngle || 0, iconAngle);
                        if (this._map)
                                this.update();
                },
@@ -31,7 +40,7 @@
                        _old__setPos.apply(this,[pos]);
 
                        if (this.options.iconAngle) {
-                               var defaultIcon = new L.Icon.Default;
+                               var defaultIcon = new L.Icon.Default();
                                var a = this.options.icon.options.iconAnchor || defaultIcon.options.iconAnchor;
                                var s = this.options.icon.options.iconSize || defaultIcon.options.iconSize;
                                var i;
diff --git a/www/plugins/gis/lib/leaflet/plugins/TOPOJSON.js b/www/plugins/gis/lib/leaflet/plugins/TOPOJSON.js
new file mode 100644 (file)
index 0000000..480aa73
--- /dev/null
@@ -0,0 +1,636 @@
+-/**
+- * Embed of the topojson library from Mike Bostock v1.6.26
+- * https://github.com/mbostock/topojson
+- *
+- */
+
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+  typeof define === 'function' && define.amd ? define(['exports'], factory) :
+  (factory((global.topojson = global.topojson || {})));
+}(this, function (exports) { 'use strict';
+
+  function noop() {}
+
+  function transformAbsolute(transform) {
+    if (!transform) return noop;
+    var x0,
+        y0,
+        kx = transform.scale[0],
+        ky = transform.scale[1],
+        dx = transform.translate[0],
+        dy = transform.translate[1];
+    return function(point, i) {
+      if (!i) x0 = y0 = 0;
+      point[0] = (x0 += point[0]) * kx + dx;
+      point[1] = (y0 += point[1]) * ky + dy;
+    };
+  }
+
+  function transformRelative(transform) {
+    if (!transform) return noop;
+    var x0,
+        y0,
+        kx = transform.scale[0],
+        ky = transform.scale[1],
+        dx = transform.translate[0],
+        dy = transform.translate[1];
+    return function(point, i) {
+      if (!i) x0 = y0 = 0;
+      var x1 = Math.round((point[0] - dx) / kx),
+          y1 = Math.round((point[1] - dy) / ky);
+      point[0] = x1 - x0;
+      point[1] = y1 - y0;
+      x0 = x1;
+      y0 = y1;
+    };
+  }
+
+  function reverse(array, n) {
+    var t, j = array.length, i = j - n;
+    while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
+  }
+
+  function bisect(a, x) {
+    var lo = 0, hi = a.length;
+    while (lo < hi) {
+      var mid = lo + hi >>> 1;
+      if (a[mid] < x) lo = mid + 1;
+      else hi = mid;
+    }
+    return lo;
+  }
+
+  function feature(topology, o) {
+    return o.type === "GeometryCollection" ? {
+      type: "FeatureCollection",
+      features: o.geometries.map(function(o) { return feature$1(topology, o); })
+    } : feature$1(topology, o);
+  }
+
+  function feature$1(topology, o) {
+    var f = {
+      type: "Feature",
+      id: o.id,
+      properties: o.properties || {},
+      geometry: object(topology, o)
+    };
+    if (o.id == null) delete f.id;
+    return f;
+  }
+
+  function object(topology, o) {
+    var absolute = transformAbsolute(topology.transform),
+        arcs = topology.arcs;
+
+    function arc(i, points) {
+      if (points.length) points.pop();
+      for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length, p; k < n; ++k) {
+        points.push(p = a[k].slice());
+        absolute(p, k);
+      }
+      if (i < 0) reverse(points, n);
+    }
+
+    function point(p) {
+      p = p.slice();
+      absolute(p, 0);
+      return p;
+    }
+
+    function line(arcs) {
+      var points = [];
+      for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);
+      if (points.length < 2) points.push(points[0].slice());
+      return points;
+    }
+
+    function ring(arcs) {
+      var points = line(arcs);
+      while (points.length < 4) points.push(points[0].slice());
+      return points;
+    }
+
+    function polygon(arcs) {
+      return arcs.map(ring);
+    }
+
+    function geometry(o) {
+      var t = o.type;
+      return t === "GeometryCollection" ? {type: t, geometries: o.geometries.map(geometry)}
+          : t in geometryType ? {type: t, coordinates: geometryType[t](o)}
+          : null;
+    }
+
+    var geometryType = {
+      Point: function(o) { return point(o.coordinates); },
+      MultiPoint: function(o) { return o.coordinates.map(point); },
+      LineString: function(o) { return line(o.arcs); },
+      MultiLineString: function(o) { return o.arcs.map(line); },
+      Polygon: function(o) { return polygon(o.arcs); },
+      MultiPolygon: function(o) { return o.arcs.map(polygon); }
+    };
+
+    return geometry(o);
+  }
+
+  function stitchArcs(topology, arcs) {
+    var stitchedArcs = {},
+        fragmentByStart = {},
+        fragmentByEnd = {},
+        fragments = [],
+        emptyIndex = -1;
+
+    // Stitch empty arcs first, since they may be subsumed by other arcs.
+    arcs.forEach(function(i, j) {
+      var arc = topology.arcs[i < 0 ? ~i : i], t;
+      if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {
+        t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;
+      }
+    });
+
+    arcs.forEach(function(i) {
+      var e = ends(i),
+          start = e[0],
+          end = e[1],
+          f, g;
+
+      if (f = fragmentByEnd[start]) {
+        delete fragmentByEnd[f.end];
+        f.push(i);
+        f.end = end;
+        if (g = fragmentByStart[end]) {
+          delete fragmentByStart[g.start];
+          var fg = g === f ? f : f.concat(g);
+          fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;
+        } else {
+          fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
+        }
+      } else if (f = fragmentByStart[end]) {
+        delete fragmentByStart[f.start];
+        f.unshift(i);
+        f.start = start;
+        if (g = fragmentByEnd[start]) {
+          delete fragmentByEnd[g.end];
+          var gf = g === f ? f : g.concat(f);
+          fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;
+        } else {
+          fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
+        }
+      } else {
+        f = [i];
+        fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;
+      }
+    });
+
+    function ends(i) {
+      var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;
+      if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });
+      else p1 = arc[arc.length - 1];
+      return i < 0 ? [p1, p0] : [p0, p1];
+    }
+
+    function flush(fragmentByEnd, fragmentByStart) {
+      for (var k in fragmentByEnd) {
+        var f = fragmentByEnd[k];
+        delete fragmentByStart[f.start];
+        delete f.start;
+        delete f.end;
+        f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });
+        fragments.push(f);
+      }
+    }
+
+    flush(fragmentByEnd, fragmentByStart);
+    flush(fragmentByStart, fragmentByEnd);
+    arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });
+
+    return fragments;
+  }
+
+  function mesh(topology) {
+    return object(topology, meshArcs.apply(this, arguments));
+  }
+
+  function meshArcs(topology, o, filter) {
+    var arcs = [];
+
+    function arc(i) {
+      var j = i < 0 ? ~i : i;
+      (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});
+    }
+
+    function line(arcs) {
+      arcs.forEach(arc);
+    }
+
+    function polygon(arcs) {
+      arcs.forEach(line);
+    }
+
+    function geometry(o) {
+      if (o.type === "GeometryCollection") o.geometries.forEach(geometry);
+      else if (o.type in geometryType) geom = o, geometryType[o.type](o.arcs);
+    }
+
+    if (arguments.length > 1) {
+      var geomsByArc = [],
+          geom;
+
+      var geometryType = {
+        LineString: line,
+        MultiLineString: polygon,
+        Polygon: polygon,
+        MultiPolygon: function(arcs) { arcs.forEach(polygon); }
+      };
+
+      geometry(o);
+
+      geomsByArc.forEach(arguments.length < 3
+          ? function(geoms) { arcs.push(geoms[0].i); }
+          : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });
+    } else {
+      for (var i = 0, n = topology.arcs.length; i < n; ++i) arcs.push(i);
+    }
+
+    return {type: "MultiLineString", arcs: stitchArcs(topology, arcs)};
+  }
+
+  function cartesianTriangleArea(triangle) {
+    var a = triangle[0], b = triangle[1], c = triangle[2];
+    return Math.abs((a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]));
+  }
+
+  function ring(ring) {
+    var i = -1,
+        n = ring.length,
+        a,
+        b = ring[n - 1],
+        area = 0;
+
+    while (++i < n) {
+      a = b;
+      b = ring[i];
+      area += a[0] * b[1] - a[1] * b[0];
+    }
+
+    return area / 2;
+  }
+
+  function merge(topology) {
+    return object(topology, mergeArcs.apply(this, arguments));
+  }
+
+  function mergeArcs(topology, objects) {
+    var polygonsByArc = {},
+        polygons = [],
+        components = [];
+
+    objects.forEach(function(o) {
+      if (o.type === "Polygon") register(o.arcs);
+      else if (o.type === "MultiPolygon") o.arcs.forEach(register);
+    });
+
+    function register(polygon) {
+      polygon.forEach(function(ring$$) {
+        ring$$.forEach(function(arc) {
+          (polygonsByArc[arc = arc < 0 ? ~arc : arc] || (polygonsByArc[arc] = [])).push(polygon);
+        });
+      });
+      polygons.push(polygon);
+    }
+
+    function area(ring$$) {
+      return Math.abs(ring(object(topology, {type: "Polygon", arcs: [ring$$]}).coordinates[0]));
+    }
+
+    polygons.forEach(function(polygon) {
+      if (!polygon._) {
+        var component = [],
+            neighbors = [polygon];
+        polygon._ = 1;
+        components.push(component);
+        while (polygon = neighbors.pop()) {
+          component.push(polygon);
+          polygon.forEach(function(ring$$) {
+            ring$$.forEach(function(arc) {
+              polygonsByArc[arc < 0 ? ~arc : arc].forEach(function(polygon) {
+                if (!polygon._) {
+                  polygon._ = 1;
+                  neighbors.push(polygon);
+                }
+              });
+            });
+          });
+        }
+      }
+    });
+
+    polygons.forEach(function(polygon) {
+      delete polygon._;
+    });
+
+    return {
+      type: "MultiPolygon",
+      arcs: components.map(function(polygons) {
+        var arcs = [], n;
+
+        // Extract the exterior (unique) arcs.
+        polygons.forEach(function(polygon) {
+          polygon.forEach(function(ring$$) {
+            ring$$.forEach(function(arc) {
+              if (polygonsByArc[arc < 0 ? ~arc : arc].length < 2) {
+                arcs.push(arc);
+              }
+            });
+          });
+        });
+
+        // Stitch the arcs into one or more rings.
+        arcs = stitchArcs(topology, arcs);
+
+        // If more than one ring is returned,
+        // at most one of these rings can be the exterior;
+        // choose the one with the greatest absolute area.
+        if ((n = arcs.length) > 1) {
+          for (var i = 1, k = area(arcs[0]), ki, t; i < n; ++i) {
+            if ((ki = area(arcs[i])) > k) {
+              t = arcs[0], arcs[0] = arcs[i], arcs[i] = t, k = ki;
+            }
+          }
+        }
+
+        return arcs;
+      })
+    };
+  }
+
+  function neighbors(objects) {
+    var indexesByArc = {}, // arc index -> array of object indexes
+        neighbors = objects.map(function() { return []; });
+
+    function line(arcs, i) {
+      arcs.forEach(function(a) {
+        if (a < 0) a = ~a;
+        var o = indexesByArc[a];
+        if (o) o.push(i);
+        else indexesByArc[a] = [i];
+      });
+    }
+
+    function polygon(arcs, i) {
+      arcs.forEach(function(arc) { line(arc, i); });
+    }
+
+    function geometry(o, i) {
+      if (o.type === "GeometryCollection") o.geometries.forEach(function(o) { geometry(o, i); });
+      else if (o.type in geometryType) geometryType[o.type](o.arcs, i);
+    }
+
+    var geometryType = {
+      LineString: line,
+      MultiLineString: polygon,
+      Polygon: polygon,
+      MultiPolygon: function(arcs, i) { arcs.forEach(function(arc) { polygon(arc, i); }); }
+    };
+
+    objects.forEach(geometry);
+
+    for (var i in indexesByArc) {
+      for (var indexes = indexesByArc[i], m = indexes.length, j = 0; j < m; ++j) {
+        for (var k = j + 1; k < m; ++k) {
+          var ij = indexes[j], ik = indexes[k], n;
+          if ((n = neighbors[ij])[i = bisect(n, ik)] !== ik) n.splice(i, 0, ik);
+          if ((n = neighbors[ik])[i = bisect(n, ij)] !== ij) n.splice(i, 0, ij);
+        }
+      }
+    }
+
+    return neighbors;
+  }
+
+  function compareArea(a, b) {
+    return a[1][2] - b[1][2];
+  }
+
+  function minAreaHeap() {
+    var heap = {},
+        array = [],
+        size = 0;
+
+    heap.push = function(object) {
+      up(array[object._ = size] = object, size++);
+      return size;
+    };
+
+    heap.pop = function() {
+      if (size <= 0) return;
+      var removed = array[0], object;
+      if (--size > 0) object = array[size], down(array[object._ = 0] = object, 0);
+      return removed;
+    };
+
+    heap.remove = function(removed) {
+      var i = removed._, object;
+      if (array[i] !== removed) return; // invalid request
+      if (i !== --size) object = array[size], (compareArea(object, removed) < 0 ? up : down)(array[object._ = i] = object, i);
+      return i;
+    };
+
+    function up(object, i) {
+      while (i > 0) {
+        var j = ((i + 1) >> 1) - 1,
+            parent = array[j];
+        if (compareArea(object, parent) >= 0) break;
+        array[parent._ = i] = parent;
+        array[object._ = i = j] = object;
+      }
+    }
+
+    function down(object, i) {
+      while (true) {
+        var r = (i + 1) << 1,
+            l = r - 1,
+            j = i,
+            child = array[j];
+        if (l < size && compareArea(array[l], child) < 0) child = array[j = l];
+        if (r < size && compareArea(array[r], child) < 0) child = array[j = r];
+        if (j === i) break;
+        array[child._ = i] = child;
+        array[object._ = i = j] = object;
+      }
+    }
+
+    return heap;
+  }
+
+  function presimplify(topology, triangleArea) {
+    var absolute = transformAbsolute(topology.transform),
+        relative = transformRelative(topology.transform),
+        heap = minAreaHeap();
+
+    if (!triangleArea) triangleArea = cartesianTriangleArea;
+
+    topology.arcs.forEach(function(arc) {
+      var triangles = [],
+          maxArea = 0,
+          triangle,
+          i,
+          n,
+          p;
+
+      // To store each point’s effective area, we create a new array rather than
+      // extending the passed-in point to workaround a Chrome/V8 bug (getting
+      // stuck in smi mode). For midpoints, the initial effective area of
+      // Infinity will be computed in the next step.
+      for (i = 0, n = arc.length; i < n; ++i) {
+        p = arc[i];
+        absolute(arc[i] = [p[0], p[1], Infinity], i);
+      }
+
+      for (i = 1, n = arc.length - 1; i < n; ++i) {
+        triangle = arc.slice(i - 1, i + 2);
+        triangle[1][2] = triangleArea(triangle);
+        triangles.push(triangle);
+        heap.push(triangle);
+      }
+
+      for (i = 0, n = triangles.length; i < n; ++i) {
+        triangle = triangles[i];
+        triangle.previous = triangles[i - 1];
+        triangle.next = triangles[i + 1];
+      }
+
+      while (triangle = heap.pop()) {
+        var previous = triangle.previous,
+            next = triangle.next;
+
+        // If the area of the current point is less than that of the previous point
+        // to be eliminated, use the latter's area instead. This ensures that the
+        // current point cannot be eliminated without eliminating previously-
+        // eliminated points.
+        if (triangle[1][2] < maxArea) triangle[1][2] = maxArea;
+        else maxArea = triangle[1][2];
+
+        if (previous) {
+          previous.next = next;
+          previous[2] = triangle[2];
+          update(previous);
+        }
+
+        if (next) {
+          next.previous = previous;
+          next[0] = triangle[0];
+          update(next);
+        }
+      }
+
+      arc.forEach(relative);
+    });
+
+    function update(triangle) {
+      heap.remove(triangle);
+      triangle[1][2] = triangleArea(triangle);
+      heap.push(triangle);
+    }
+
+    return topology;
+  }
+
+  var version = "1.6.26";
+
+  exports.version = version;
+  exports.mesh = mesh;
+  exports.meshArcs = meshArcs;
+  exports.merge = merge;
+  exports.mergeArcs = mergeArcs;
+  exports.feature = feature;
+  exports.neighbors = neighbors;
+  exports.presimplify = presimplify;
+
+}));
+
+L.TOPOJSON = L.FeatureGroup.extend({
+       options: {
+               async: true
+       },
+
+       initialize: function (data, options) {
+               L.Util.setOptions(this, options);
+               this._topojson = data;
+               this._layers = {};
+
+               if (data) {
+                       this.addTOPOJSON(data, options, this.options.async);
+               }
+       },
+
+       loadJSON: function (url, cb, options, async) {
+               if (async === undefined) async = this.options.async;
+               if (options === undefined) options = this.options;
+
+               var req = new window.XMLHttpRequest();
+               
+               // Check for IE8 and IE9 Fix Cors for those browsers
+               if (req.withCredentials === undefined && typeof window.XDomainRequest !== 'undefined') {
+                       var xdr = new window.XDomainRequest();
+                       xdr.open('GET', url, async);
+                       xdr.onprogress = function () { };
+                       xdr.ontimeout = function () { };
+                       xdr.onerror = function () { };
+                       xdr.onload = function () {
+                               if (xdr.responseText) {
+                                       //var xml = new window.ActiveXObject('Microsoft.XMLDOM');
+                                       //xml.loadJSON(xdr.responseText);
+                                       cb(xdr.responseText, options);
+                               }
+                       };
+                       setTimeout(function () { xdr.send(); }, 0);
+               } else {
+                       req.open('GET', url, async);
+                       try {
+                               req.overrideMimeType('application/json'); // unsupported by IE
+                       } catch (e) { }
+                       req.onreadystatechange = function () {
+                               if (req.readyState !== 4) return;
+                               if (req.status === 200) cb(req.response, options);
+                       };
+                       req.send(null);
+               }
+       },
+
+       addTOPOJSON: function (url, options, async) {
+               var _this = this,
+                       cb = function (data) { _this._addTOPOJSON(data); };
+               this.loadJSON(url, cb, options, async);
+       },
+
+       _addTOPOJSON: function (data) {
+               var layers = this.parseTOPOJSON(data);
+               if (!layers || !layers.length) return;
+               for (var i = 0; i < layers.length; i++) {
+                       this.fire('addlayer', {
+                               layer: layers[i]
+                       });
+                       this.addLayer(layers[i]);
+               }
+               this.fire('loaded');
+       },
+       _addData : function (l, d) {
+               if ('addData' in l) l.addData(d);
+               if ('setGeoJSON' in l) l.setGeoJSON(d);
+       },
+       parseTOPOJSON : function (data) {
+               var layers = [],
+                       o = typeof data === 'string' ? JSON.parse(data) : data;
+               for (var i in o.objects) {
+                       var layer = L.geoJson(),
+                               ft = topojson.feature(o, o.objects[i]);
+                       if (ft.features) this._addData(layer, ft.features);
+                       else _this._addData(layer, ft);
+                       layers.push(layer);
+               }
+               
+               return layers;
+       }
+});
\ No newline at end of file
index 7320d95..efc0dfb 100644 (file)
Binary files a/www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen-2x.png and b/www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen-2x.png differ
index fdb9a70..8ee2447 100755 (executable)
Binary files a/www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen.png and b/www/plugins/gis/lib/leaflet/plugins/images/icon-fullscreen.png differ
index 205e38b..7a55db4 100755 (executable)
Binary files a/www/plugins/gis/lib/leaflet/plugins/images/toggle.png and b/www/plugins/gis/lib/leaflet/plugins/images/toggle.png differ
diff --git a/www/plugins/gis/lib/leaflet/plugins/images/toggle.svg b/www/plugins/gis/lib/leaflet/plugins/images/toggle.svg
new file mode 100644 (file)
index 0000000..e829952
--- /dev/null
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   inkscape:version="0.48.2 r9819"
+   version="1.1"
+   id="svg2"
+   height="18"
+   width="18"
+   sodipodi:docname="toggle.svg"
+   inkscape:export-filename="C:\projects\Leaflet.MiniMap\src\images\toggle-2x.png"
+   inkscape:export-xdpi="160"
+   inkscape:export-ydpi="160">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="44.2911"
+     inkscape:cx="14.22384"
+     inkscape:cy="9.2849211"
+     inkscape:document-units="px"
+     inkscape:current-layer="svg2"
+     showgrid="false"
+     inkscape:window-width="1920"
+     inkscape:window-height="1138"
+     inkscape:window-x="1192"
+     inkscape:window-y="404"
+     inkscape:window-maximized="1" />
+  <defs
+     id="defs4">
+    <marker
+       style="overflow:visible"
+       id="DiamondMend"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="DiamondMend">
+      <path
+         transform="matrix(0.4,0,0,0.4,-2.6,0)"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         d="M 0,-7.0710768 -7.0710894,0 0,7.0710589 7.0710462,0 0,-7.0710768 z"
+         id="path4062"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="Tail"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="Tail">
+      <g
+         transform="scale(-1.2,-1.2)"
+         id="g3997">
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M -3.8048674,-3.9585227 0.54352094,0"
+           id="path3999"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M -1.2866832,-3.9585227 3.0617053,0"
+           id="path4001"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M 1.3053582,-3.9585227 5.6537466,0"
+           id="path4003"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M -3.8048674,4.1775838 0.54352094,0.21974226"
+           id="path4005"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M -1.2866832,4.1775838 3.0617053,0.21974226"
+           id="path4007"
+           inkscape:connector-curvature="0" />
+        <path
+           style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round;marker-start:none;marker-end:none"
+           d="M 1.3053582,4.1775838 5.6537466,0.21974226"
+           id="path4009"
+           inkscape:connector-curvature="0" />
+      </g>
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="DiamondLend"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="DiamondLend">
+      <path
+         transform="matrix(0.8,0,0,0.8,-5.6,0)"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         d="M 0,-7.0710768 -7.0710894,0 0,7.0710589 7.0710462,0 0,-7.0710768 z"
+         id="path4059"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="TriangleOutL"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="TriangleOutL">
+      <path
+         transform="scale(0.8,0.8)"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+         id="path4104"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="Arrow2Lend"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="Arrow2Lend">
+      <path
+         transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         id="path3982"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="TriangleInL"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="TriangleInL">
+      <path
+         transform="scale(-0.8,-0.8)"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+         id="path4095"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="Arrow1Lstart"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="Arrow1Lstart">
+      <path
+         transform="matrix(0.8,0,0,0.8,10,0)"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         id="path3961"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       style="overflow:visible"
+       id="Arrow2Lstart"
+       refX="0"
+       refY="0"
+       orient="auto"
+       inkscape:stockid="Arrow2Lstart">
+      <path
+         transform="matrix(1.1,0,0,1.1,1.1,0)"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         id="path3979"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <inkscape:path-effect
+       fuse_tolerance="0"
+       vertical_pattern="false"
+       prop_units="false"
+       tang_offset="0"
+       normal_offset="0"
+       spacing="0"
+       scale_y_rel="false"
+       prop_scale="1"
+       copytype="single_stretched"
+       pattern="M 0,5 10,10 10,0 z"
+       is_visible="true"
+       id="path-effect3006"
+       effect="skeletal" />
+  </defs>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Layer 1"
+     transform="translate(0,-1034.3622)" />
+  <path
+     id="path11659"
+     d="m 13.181013,13.146224 0,-5.8105616 -5.8105513,5.8105616 5.8105513,0 z"
+     style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.64300000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none"
+     inkscape:label="Triangle"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:2.48154879000000020;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="M 12.761963,12.727174 6.2529128,6.2181329"
+     id="path11689"
+     inkscape:connector-curvature="0" />
+</svg>
index 88c58fd..d9bdb14 100755 (executable)
@@ -1,16 +1,28 @@
 /* L.Control.FullScreen */
-.fullscreen-icon { background-image: url(images/icon-fullscreen.png); }
-.leaflet-retina .fullscreen-icon { background-image: url(images/icon-fullscreen-2x.png); background-size: 26px 26px; }
+.fullscreen-icon { background-image: url(icon-fullscreen.png); }
+.leaflet-retina .fullscreen-icon { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
+/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
 .leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
+.leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
+.leaflet-container:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
+.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
 .leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
 
 /* MiniMap Plugin */
-.leaflet-control-minimap { border: solid rgba(255, 255, 255, 1.0) 4px; box-shadow: 0 1px 5px rgba(0,0,0,0.65); border-radius: 3px; background: #f8f8f9; transition: all .2s; }
-.leaflet-control-minimap a { background-color: rgba(255, 255, 255, 1.0); background-repeat: no-repeat; z-index: 99999; transition: all .2s; border-radius: 3px 0px 0px 0px; }
-.leaflet-control-minimap a.minimized { -webkit-transform: rotate(180deg); transform: rotate(180deg); border-radius: 0px; }
-.leaflet-control-minimap-toggle-display { background-image: url("images/toggle.png"); height: 19px; width: 19px; position: absolute; bottom: 0; right: 0; }
-/* Old IE */
-.leaflet-oldie .leaflet-control-minimap { border: 1px solid #999 }
-.leaflet-oldie .leaflet-control-minimap a { background-color: #fff }
-.leaflet-oldie .leaflet-control-minimap a.minimized { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2) }
+.leaflet-control-minimap { border: solid rgba(255,255,255,1) 4px; box-shadow: 0 1px 5px rgba(0,0,0,0.65); border-radius: 3px; background: #f8f8f9; transition: all .6s; }
+.leaflet-control-minimap a { background-color: rgba(255,255,255,1); background-repeat: no-repeat; z-index: 99999; transition: all .6s; }
+.leaflet-control-minimap a.minimized-bottomright { -webkit-transform: rotate(180deg); transform: rotate(180deg); border-radius: 0px; }
+.leaflet-control-minimap a.minimized-topleft { -webkit-transform: rotate(0deg); transform: rotate(0deg); border-radius: 0px; }
+.leaflet-control-minimap a.minimized-bottomleft { -webkit-transform: rotate(270deg); transform: rotate(270deg); border-radius: 0px; }
+.leaflet-control-minimap a.minimized-topright { -webkit-transform: rotate(90deg); transform: rotate(90deg); border-radius: 0px; }
+.leaflet-control-minimap-toggle-display { background-image: url("images/toggle.svg"); background-size: cover; position: absolute; border-radius: 3px 0px 0px 0px; }
+.leaflet-oldie .leaflet-control-minimap-toggle-display { background-image: url("images/toggle.png"); }
+.leaflet-control-minimap-toggle-display-bottomright { bottom: 0; right: 0; }
+.leaflet-control-minimap-toggle-display-topleft { top: 0; left: 0; -webkit-transform: rotate(180deg); transform: rotate(180deg); }
+.leaflet-control-minimap-toggle-display-bottomleft { bottom: 0; left: 0; -webkit-transform: rotate(90deg); transform: rotate(90deg); }
+.leaflet-control-minimap-toggle-display-topright { top: 0; right: 0; -webkit-transform: rotate(270deg); transform: rotate(270deg); }
 
+/* Old IE */
+.leaflet-oldie .leaflet-control-minimap { border: 1px solid #999; }
+.leaflet-oldie .leaflet-control-minimap a { background-color: #fff; }
+.leaflet-oldie .leaflet-control-minimap a.minimized { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); }
index bc82990..22e2cbd 100644 (file)
@@ -48,8 +48,6 @@
                                        url: variant.url || provider.url,
                                        options: L.Util.extend({}, provider.options, variantOptions)
                                };
-                       } else if (typeof provider.url === 'function') {
-                               provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
                        }
 
                        var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
                                        }
                                },
                                France: {
-                                       url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
+                                       url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
                                        options: {
+                                               maxZoom: 20,
                                                attribution: '&copy; Openstreetmap France | {attribution.OpenStreetMap}'
                                        }
                                },
                                HOT: {
-                                       url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
+                                       url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
                                        options: {
                                                attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
                                        }
                OpenTopoMap: {
                        url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
                        options: {
-                               maxZoom: 16,
+                               maxZoom: 17,
                                attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
                        }
                },
                        }
                },
                Hydda: {
-                       url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
+                       url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
                        options: {
                                variant: 'full',
                                attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
                                RoadsAndLabels: 'roads_and_labels'
                        }
                },
-               MapQuestOpen: {
-                       /* Mapquest does support https, but with a different subdomain:
-                        * https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
-                        * which makes implementing protocol relativity impossible.
-                        */
-                       url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
-                       options: {
-                               type: 'map',
-                               ext: 'jpg',
-                               attribution:
-                                       'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
-                                       'Map data {attribution.OpenStreetMap}',
-                               subdomains: '1234'
-                       },
-                       variants: {
-                               OSM: {},
-                               Aerial: {
-                                       options: {
-                                               type: 'sat',
-                                               attribution:
-                                                       'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
-                                                       'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
-                                       }
-                               },
-                               HybridOverlay: {
-                                       options: {
-                                               type: 'hyb',
-                                               ext: 'png',
-                                               opacity: 0.9
-                                       }
-                               }
-                       }
-               },
                MapBox: {
                        url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
                        options: {
                                Terrain: {
                                        options: {
                                                variant: 'terrain',
-                                               minZoom: 4,
-                                               maxZoom: 18,
-                                               bounds: [[22, -132], [70, -56]]
+                                               minZoom: 0,
+                                               maxZoom: 18
                                        }
                                },
                                TerrainBackground: {
                                        options: {
                                                variant: 'terrain-background',
-                                               minZoom: 4,
-                                               maxZoom: 18,
-                                               bounds: [[22, -132], [70, -56]]
+                                               minZoom: 0,
+                                               maxZoom: 18
                                        }
                                },
                                TopOSMRelief: {
index 4043316..b7aad0e 100644 (file)
@@ -24,6 +24,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                // is the default behaviour for performance reasons.
                removeOutsideVisibleBounds: true,
 
+               // Set to false to disable all animations (zoom and spiderfy).
+               // If false, option animateAddingMarkers below has no effect.
+               // If L.DomUtil.TRANSITION is falsy, this option has no effect.
+               animate: true,
+
                //Whether to animate adding markers after adding the MarkerClusterGroup to the map
                // If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.
                animateAddingMarkers: false,
@@ -31,6 +36,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                //Increase to increase the distance away that spiderfied markers appear from the center
                spiderfyDistanceMultiplier: 1,
 
+               // Make it possible to specify a polyline options on a spider leg
+               spiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },
+
                // When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts
                chunkedLoading: false,
                chunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)
@@ -60,6 +68,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                this._currentShownBounds = null;
 
                this._queue = [];
+
+               // Hook the appropriate animation methods.
+               var animate = L.DomUtil.TRANSITION && this.options.animate;
+               L.extend(this, animate ? this._withAnimation : this._noAnimation);
+               // Remember which MarkerCluster class to instantiate (animated or not).
+               this._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;
        },
 
        addLayer: function (layer) {
@@ -96,6 +110,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
                this._addLayer(layer, this._maxZoom);
 
+               // Refresh bounds and weighted positions.
+               this._topClusterLevel._recalculateBounds();
+
                //Work out what is visible
                var visibleLayer = layer,
                        currentZoom = this._map.getZoom();
@@ -151,10 +168,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                //Remove the marker from clusters
                this._removeLayer(layer, true);
 
+               // Refresh bounds and weighted positions.
+               this._topClusterLevel._recalculateBounds();
+
                if (this._featureGroup.hasLayer(layer)) {
                        this._featureGroup.removeLayer(layer);
-                       if (layer.setOpacity) {
-                               layer.setOpacity(1);
+                       if (layer.clusterShow) {
+                               layer.clusterShow();
                        }
                }
 
@@ -213,7 +233,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                                        chunkProgress(offset, layersArray.length, (new Date()).getTime() - started);
                                }
 
+                               // Completed processing all markers.
                                if (offset === layersArray.length) {
+
+                                       // Refresh bounds and weighted positions.
+                                       this._topClusterLevel._recalculateBounds();
+
                                        //Update the icons of all those visible clusters that were affected
                                        this._featureGroup.eachLayer(function (c) {
                                                if (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {
@@ -261,10 +286,21 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                                m = layersArray[i];
                                this._arraySplice(this._needsClustering, m);
                                npg.removeLayer(m);
+                               if (this.hasLayer(m)) {
+                                       this._needsRemoving.push(m);
+                               }
                        }
                        return this;
                }
 
+               if (this._unspiderfy) {
+                       this._unspiderfy();
+                       for (i = 0, l = layersArray.length; i < l; i++) {
+                               m = layersArray[i];
+                               this._unspiderfyLayer(m);
+                       }
+               }
+
                for (i = 0, l = layersArray.length; i < l; i++) {
                        m = layersArray[i];
 
@@ -277,12 +313,15 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
                        if (fg.hasLayer(m)) {
                                fg.removeLayer(m);
-                               if (m.setOpacity) {
-                                       m.setOpacity(1);
+                               if (m.clusterShow) {
+                                       m.clusterShow();
                                }
                        }
                }
 
+               // Refresh bounds and weighted positions.
+               this._topClusterLevel._recalculateBounds();
+
                //Fix up the clusters and markers on the map
                this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
 
@@ -371,6 +410,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
        //Overrides LayerGroup.getLayer, WARNING: Really bad performance
        getLayer: function (id) {
                var result = null;
+               
+               id = parseInt(id, 10);
 
                this.eachLayer(function (l) {
                        if (L.stamp(l) === id) {
@@ -407,6 +448,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
        //Zoom down to show the given layer (spiderfying if necessary) then calls the callback
        zoomToShowLayer: function (layer, callback) {
+               
+               if (typeof callback !== 'function') {
+                       callback = function () {};
+               }
 
                var showMarker = function () {
                        if ((layer._icon || layer.__parent._icon) && !this._inZoomAnimation) {
@@ -416,12 +461,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                                if (layer._icon) {
                                        callback();
                                } else if (layer.__parent._icon) {
-                                       var afterSpiderfy = function () {
-                                               this.off('spiderfied', afterSpiderfy, this);
-                                               callback();
-                                       };
-
-                                       this.on('spiderfied', afterSpiderfy, this);
+                                       this.once('spiderfied', callback, this);
                                        layer.__parent.spiderfy();
                                }
                        }
@@ -468,6 +508,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                        this._generateInitialClusters();
                }
 
+               this._maxLat = map.options.crs.projection.MAX_LATITUDE;
+
                for (i = 0, l = this._needsRemoving.length; i < l; i++) {
                        layer = this._needsRemoving[i];
                        this._removeLayer(layer, true);
@@ -507,7 +549,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                        this._spiderfierOnRemove();
                }
 
-
+               delete this._maxLat;
 
                //Clean up all the layers we added to the map
                this._hideCoverage();
@@ -537,6 +579,23 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                }
        },
 
+       /**
+        * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.
+        * @param marker to be removed from _gridUnclustered.
+        * @param z integer bottom start zoom level (included)
+        * @private
+        */
+       _removeFromGridUnclustered: function (marker, z) {
+               var map = this._map,
+                   gridUnclustered = this._gridUnclustered;
+
+               for (; z >= 0; z--) {
+                       if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
+                               break;
+                       }
+               }
+       },
+
        //Internal function for removing a marker from everything.
        //dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
        _removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
@@ -547,11 +606,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
                //Remove the marker from distance clusters it might be in
                if (removeFromDistanceGrid) {
-                       for (var z = this._maxZoom; z >= 0; z--) {
-                               if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
-                                       break;
-                               }
-                       }
+                       this._removeFromGridUnclustered(marker, this._maxZoom);
                }
 
                //Work our way up the clusters removing them as we go if required
@@ -564,6 +619,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
                while (cluster) {
                        cluster._childCount--;
+                       cluster._boundsNeedUpdate = true;
 
                        if (cluster._zoom < 0) {
                                //Top level, do nothing
@@ -589,7 +645,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                                        }
                                }
                        } else {
-                               cluster._recalculateBounds();
                                if (!dontUpdateMap || !cluster._icon) {
                                        cluster._updateIcon();
                                }
@@ -659,18 +714,25 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
        },
 
        _zoomOrSpiderfy: function (e) {
-               var map = this._map;
-               if (map.getMaxZoom() === map.getZoom()) {
+               var cluster = e.layer,
+                   bottomCluster = cluster;
+
+               while (bottomCluster._childClusters.length === 1) {
+                       bottomCluster = bottomCluster._childClusters[0];
+               }
+
+               if (bottomCluster._zoom === this._maxZoom && bottomCluster._childCount === cluster._childCount) {
+                       // All child markers are contained in a single cluster from this._maxZoom to this cluster.
                        if (this.options.spiderfyOnMaxZoom) {
-                               e.layer.spiderfy();
+                               cluster.spiderfy();
                        }
                } else if (this.options.zoomToBoundsOnClick) {
-                       e.layer.zoomToBounds();
+                       cluster.zoomToBounds();
                }
 
                // Focus the map again for keyboard users.
                if (e.originalEvent && e.originalEvent.keyCode === 13) {
-                       map._container.focus();
+                       this._map._container.focus();
                }
        },
 
@@ -760,7 +822,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                        this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
                }
 
-               this._topClusterLevel = new L.MarkerCluster(this, -1);
+               // Instantiate the appropriate L.MarkerCluster class (animated or not).
+               this._topClusterLevel = new this._markerCluster(this, -1);
        },
 
        //Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
@@ -770,14 +833,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                    markerPoint, z;
 
                if (this.options.singleMarkerMode) {
-                       layer.options.icon = this.options.iconCreateFunction({
-                               getChildCount: function () {
-                                       return 1;
-                               },
-                               getAllChildMarkers: function () {
-                                       return [layer];
-                               }
-                       });
+                       this._overrideMarkerIcon(layer);
                }
 
                //Find the lowest zoom level to slot this one in
@@ -802,7 +858,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
                                //Create new cluster with these 2 in it
 
-                               var newCluster = new L.MarkerCluster(this, zoom, closest, layer);
+                               var newCluster = new this._markerCluster(this, zoom, closest, layer);
                                gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));
                                closest.__parent = newCluster;
                                layer.__parent = newCluster;
@@ -810,17 +866,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                                //First create any new intermediate parent clusters that don't exist
                                var lastParent = newCluster;
                                for (z = zoom - 1; z > parent._zoom; z--) {
-                                       lastParent = new L.MarkerCluster(this, z, lastParent);
+                                       lastParent = new this._markerCluster(this, z, lastParent);
                                        gridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));
                                }
                                parent._addChild(lastParent);
 
                                //Remove closest from this zoom level and any above that it is in, replace with newCluster
-                               for (z = zoom; z >= 0; z--) {
-                                       if (!gridUnclustered[z].removeObject(closest, this._map.project(closest.getLatLng(), z))) {
-                                               break;
-                                       }
-                               }
+                               this._removeFromGridUnclustered(closest, zoom);
 
                                return;
                        }
@@ -876,19 +928,37 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
        //Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)
        _getExpandedVisibleBounds: function () {
                if (!this.options.removeOutsideVisibleBounds) {
-                       return this._map.getBounds();
+                       return this._mapBoundsInfinite;
+               } else if (L.Browser.mobile) {
+                       return this._checkBoundsMaxLat(this._map.getBounds());
+               }
+
+               return this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.
+       },
+
+       /**
+        * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude
+        * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).
+        * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without
+        * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,
+        * making the user think that MCG "eats" them and never displays them again.
+        * @param bounds L.LatLngBounds
+        * @returns {L.LatLngBounds}
+        * @private
+        */
+       _checkBoundsMaxLat: function (bounds) {
+               var maxLat = this._maxLat;
+
+               if (maxLat !== undefined) {
+                       if (bounds.getNorth() >= maxLat) {
+                               bounds._northEast.lat = Infinity;
+                       }
+                       if (bounds.getSouth() <= -maxLat) {
+                               bounds._southWest.lat = -Infinity;
+                       }
                }
 
-               var map = this._map,
-                       bounds = map.getBounds(),
-                       sw = bounds._southWest,
-                       ne = bounds._northEast,
-                       latDiff = L.Browser.mobile ? 0 : Math.abs(sw.lat - ne.lat),
-                       lngDiff = L.Browser.mobile ? 0 : Math.abs(sw.lng - ne.lng);
-
-               return new L.LatLngBounds(
-                       new L.LatLng(sw.lat - latDiff, sw.lng - lngDiff, true),
-                       new L.LatLng(ne.lat + latDiff, ne.lng + lngDiff, true));
+               return bounds;
        },
 
        //Shared animation code
@@ -904,117 +974,167 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
                } else {
                        newCluster._updateIcon();
                }
+       },
+
+       /**
+        * Implements the singleMarkerMode option.
+        * @param layer Marker to re-style using the Clusters iconCreateFunction.
+        * @returns {L.Icon} The newly created icon.
+        * @private
+        */
+       _overrideMarkerIcon: function (layer) {
+               var icon = layer.options.icon = this.options.iconCreateFunction({
+                       getChildCount: function () {
+                               return 1;
+                       },
+                       getAllChildMarkers: function () {
+                               return [layer];
+                       }
+               });
+
+               return icon;
        }
 });
 
-L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
-
-       //Non Animated versions of everything
-       _animationStart: function () {
-               //Do nothing...
-       },
-       _animationZoomIn: function (previousZoomLevel, newZoomLevel) {
-               this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
-               this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
+// Constant bounds used in case option "removeOutsideVisibleBounds" is set to false.
+L.MarkerClusterGroup.include({
+       _mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))
+});
 
-               //We didn't actually animate, but we use this event to mean "clustering animations have finished"
-               this.fire('animationend');
-       },
-       _animationZoomOut: function (previousZoomLevel, newZoomLevel) {
-               this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
-               this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
+L.MarkerClusterGroup.include({
+       _noAnimation: {
+               //Non Animated versions of everything
+               _animationStart: function () {
+                       //Do nothing...
+               },
+               _animationZoomIn: function (previousZoomLevel, newZoomLevel) {
+                       this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
+                       this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
 
-               //We didn't actually animate, but we use this event to mean "clustering animations have finished"
-               this.fire('animationend');
-       },
-       _animationAddLayer: function (layer, newCluster) {
-               this._animationAddLayerNonAnimated(layer, newCluster);
-       }
-} : {
+                       //We didn't actually animate, but we use this event to mean "clustering animations have finished"
+                       this.fire('animationend');
+               },
+               _animationZoomOut: function (previousZoomLevel, newZoomLevel) {
+                       this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
+                       this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
 
-       //Animated versions here
-       _animationStart: function () {
-               this._map._mapPane.className += ' leaflet-cluster-anim';
-               this._inZoomAnimation++;
-       },
-       _animationEnd: function () {
-               if (this._map) {
-                       this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
+                       //We didn't actually animate, but we use this event to mean "clustering animations have finished"
+                       this.fire('animationend');
+               },
+               _animationAddLayer: function (layer, newCluster) {
+                       this._animationAddLayerNonAnimated(layer, newCluster);
                }
-               this._inZoomAnimation--;
-               this.fire('animationend');
        },
-       _animationZoomIn: function (previousZoomLevel, newZoomLevel) {
-               var bounds = this._getExpandedVisibleBounds(),
-                   fg = this._featureGroup,
-                   i;
-
-               //Add all children of current clusters to map and remove those clusters from map
-               this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
-                       var startPos = c._latlng,
-                               markers = c._markers,
-                               m;
+       _withAnimation: {
+               //Animated versions here
+               _animationStart: function () {
+                       this._map._mapPane.className += ' leaflet-cluster-anim';
+                       this._inZoomAnimation++;
+               },
+               _animationZoomIn: function (previousZoomLevel, newZoomLevel) {
+                       var bounds = this._getExpandedVisibleBounds(),
+                           fg     = this._featureGroup,
+                           i;
 
-                       if (!bounds.contains(startPos)) {
-                               startPos = null;
-                       }
+                       //Add all children of current clusters to map and remove those clusters from map
+                       this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
+                               var startPos = c._latlng,
+                                   markers  = c._markers,
+                                   m;
 
-                       if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
-                               fg.removeLayer(c);
-                               c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
-                       } else {
-                               //Fade out old cluster
-                               c.setOpacity(0);
-                               c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);
-                       }
+                               if (!bounds.contains(startPos)) {
+                                       startPos = null;
+                               }
 
-                       //Remove all markers that aren't visible any more
-                       //TODO: Do we actually need to do this on the higher levels too?
-                       for (i = markers.length - 1; i >= 0; i--) {
-                               m = markers[i];
-                               if (!bounds.contains(m._latlng)) {
-                                       fg.removeLayer(m);
+                               if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
+                                       fg.removeLayer(c);
+                                       c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
+                               } else {
+                                       //Fade out old cluster
+                                       c.clusterHide();
+                                       c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);
                                }
-                       }
 
-               });
+                               //Remove all markers that aren't visible any more
+                               //TODO: Do we actually need to do this on the higher levels too?
+                               for (i = markers.length - 1; i >= 0; i--) {
+                                       m = markers[i];
+                                       if (!bounds.contains(m._latlng)) {
+                                               fg.removeLayer(m);
+                                       }
+                               }
 
-               this._forceLayout();
+                       });
 
-               //Update opacities
-               this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);
-               //TODO Maybe? Update markers in _recursivelyBecomeVisible
-               fg.eachLayer(function (n) {
-                       if (!(n instanceof L.MarkerCluster) && n._icon) {
-                               n.setOpacity(1);
-                       }
-               });
+                       this._forceLayout();
 
-               //update the positions of the just added clusters/markers
-               this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {
-                       c._recursivelyRestoreChildPositions(newZoomLevel);
-               });
+                       //Update opacities
+                       this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);
+                       //TODO Maybe? Update markers in _recursivelyBecomeVisible
+                       fg.eachLayer(function (n) {
+                               if (!(n instanceof L.MarkerCluster) && n._icon) {
+                                       n.clusterShow();
+                               }
+                       });
 
-               //Remove the old clusters and close the zoom animation
-               this._enqueue(function () {
                        //update the positions of the just added clusters/markers
-                       this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
-                               fg.removeLayer(c);
-                               c.setOpacity(1);
+                       this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {
+                               c._recursivelyRestoreChildPositions(newZoomLevel);
                        });
 
-                       this._animationEnd();
-               });
-       },
+                       //Remove the old clusters and close the zoom animation
+                       this._enqueue(function () {
+                               //update the positions of the just added clusters/markers
+                               this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
+                                       fg.removeLayer(c);
+                                       c.clusterShow();
+                               });
+
+                               this._animationEnd();
+                       });
+               },
+
+               _animationZoomOut: function (previousZoomLevel, newZoomLevel) {
+                       this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);
+
+                       //Need to add markers for those that weren't on the map before but are now
+                       this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
+                       //Remove markers that were on the map before but won't be now
+                       this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds());
+               },
+               _animationAddLayer: function (layer, newCluster) {
+                       var me = this,
+                           fg = this._featureGroup;
+
+                       fg.addLayer(layer);
+                       if (newCluster !== layer) {
+                               if (newCluster._childCount > 2) { //Was already a cluster
 
-       _animationZoomOut: function (previousZoomLevel, newZoomLevel) {
-               this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);
+                                       newCluster._updateIcon();
+                                       this._forceLayout();
+                                       this._animationStart();
 
-               //Need to add markers for those that weren't on the map before but are now
-               this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
-               //Remove markers that were on the map before but won't be now
-               this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds());
+                                       layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
+                                       layer.clusterHide();
+
+                                       this._enqueue(function () {
+                                               fg.removeLayer(layer);
+                                               layer.clusterShow();
+
+                                               me._animationEnd();
+                                       });
+
+                               } else { //Just became a cluster
+                                       this._forceLayout();
+
+                                       me._animationStart();
+                                       me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._map.getZoom());
+                               }
+                       }
+               }
        },
+
+       // Private methods for animated versions.
        _animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
                var bounds = this._getExpandedVisibleBounds();
 
@@ -1036,8 +1156,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
                                var m = cluster._markers[0];
                                //If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it
                                m.setLatLng(m.getLatLng());
-                               if (m.setOpacity) {
-                                       m.setOpacity(1);
+                               if (m.clusterShow) {
+                                       m.clusterShow();
                                }
                        } else {
                                cluster._recursively(bounds, newZoomLevel, 0, function (c) {
@@ -1047,35 +1167,13 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
                        me._animationEnd();
                });
        },
-       _animationAddLayer: function (layer, newCluster) {
-               var me = this,
-                       fg = this._featureGroup;
-
-               fg.addLayer(layer);
-               if (newCluster !== layer) {
-                       if (newCluster._childCount > 2) { //Was already a cluster
-
-                               newCluster._updateIcon();
-                               this._forceLayout();
-                               this._animationStart();
-
-                               layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
-                               layer.setOpacity(0);
-
-                               this._enqueue(function () {
-                                       fg.removeLayer(layer);
-                                       layer.setOpacity(1);
 
-                                       me._animationEnd();
-                               });
-
-                       } else { //Just became a cluster
-                               this._forceLayout();
-
-                               me._animationStart();
-                               me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._map.getZoom());
-                       }
+       _animationEnd: function () {
+               if (this._map) {
+                       this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
                }
+               this._inZoomAnimation--;
+               this.fire('animationend');
        },
 
        //Force a browser layout of stuff in the map
@@ -1106,6 +1204,7 @@ L.MarkerCluster = L.Marker.extend({
                this._childClusters = [];
                this._childCount = 0;
                this._iconNeedsUpdate = true;
+               this._boundsNeedUpdate = true;
 
                this._bounds = new L.LatLngBounds();
 
@@ -1194,7 +1293,9 @@ L.MarkerCluster = L.Marker.extend({
        _addChild: function (new1, isNotificationFromChild) {
 
                this._iconNeedsUpdate = true;
-               this._expandBounds(new1);
+
+               this._boundsNeedUpdate = true;
+               this._setClusterCenter(new1);
 
                if (new1 instanceof L.MarkerCluster) {
                        if (!isNotificationFromChild) {
@@ -1214,34 +1315,85 @@ L.MarkerCluster = L.Marker.extend({
                }
        },
 
-       //Expand our bounds and tell our parent to
-       _expandBounds: function (marker) {
-               var addedCount,
-                   addedLatLng = marker._wLatLng || marker._latlng;
+       /**
+        * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.
+        * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.
+        * @private
+        */
+       _setClusterCenter: function (child) {
+               if (!this._cLatLng) {
+                       // when clustering, take position of the first point as the cluster center
+                       this._cLatLng = child._cLatLng || child._latlng;
+               }
+       },
+
+       /**
+        * Assigns impossible bounding values so that the next extend entirely determines the new bounds.
+        * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.
+        * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.
+        * @private
+        */
+       _resetBounds: function () {
+               var bounds = this._bounds;
 
-               if (marker instanceof L.MarkerCluster) {
-                       this._bounds.extend(marker._bounds);
-                       addedCount = marker._childCount;
-               } else {
-                       this._bounds.extend(addedLatLng);
-                       addedCount = 1;
+               if (bounds._southWest) {
+                       bounds._southWest.lat = Infinity;
+                       bounds._southWest.lng = Infinity;
                }
+               if (bounds._northEast) {
+                       bounds._northEast.lat = -Infinity;
+                       bounds._northEast.lng = -Infinity;
+               }
+       },
 
-               if (!this._cLatLng) {
-                       // when clustering, take position of the first point as the cluster center
-                       this._cLatLng = marker._cLatLng || addedLatLng;
+       _recalculateBounds: function () {
+               var markers = this._markers,
+                   childClusters = this._childClusters,
+                   latSum = 0,
+                   lngSum = 0,
+                   totalCount = this._childCount,
+                   i, child, childLatLng, childCount;
+
+               // Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.
+               if (totalCount === 0) {
+                       return;
                }
 
-               // when showing clusters, take weighted average of all points as cluster center
-               var totalCount = this._childCount + addedCount;
+               // Reset rather than creating a new object, for performance.
+               this._resetBounds();
 
-               //Calculate weighted latlng for display
-               if (!this._wLatLng) {
-                       this._latlng = this._wLatLng = new L.LatLng(addedLatLng.lat, addedLatLng.lng);
-               } else {
-                       this._wLatLng.lat = (addedLatLng.lat * addedCount + this._wLatLng.lat * this._childCount) / totalCount;
-                       this._wLatLng.lng = (addedLatLng.lng * addedCount + this._wLatLng.lng * this._childCount) / totalCount;
+               // Child markers.
+               for (i = 0; i < markers.length; i++) {
+                       childLatLng = markers[i]._latlng;
+
+                       this._bounds.extend(childLatLng);
+
+                       latSum += childLatLng.lat;
+                       lngSum += childLatLng.lng;
+               }
+
+               // Child clusters.
+               for (i = 0; i < childClusters.length; i++) {
+                       child = childClusters[i];
+
+                       // Re-compute child bounds and weighted position first if necessary.
+                       if (child._boundsNeedUpdate) {
+                               child._recalculateBounds();
+                       }
+
+                       this._bounds.extend(child._bounds);
+
+                       childLatLng = child._wLatLng;
+                       childCount = child._childCount;
+
+                       latSum += childLatLng.lat * childCount;
+                       lngSum += childLatLng.lng * childCount;
                }
+
+               this._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);
+
+               // Reset dirty flag.
+               this._boundsNeedUpdate = false;
        },
 
        //Set our markers position as given and add it to the map
@@ -1264,7 +1416,7 @@ L.MarkerCluster = L.Marker.extend({
                                        //Only do it if the icon is still on the map
                                        if (m._icon) {
                                                m._setPos(center);
-                                               m.setOpacity(0);
+                                               m.clusterHide();
                                        }
                                }
                        },
@@ -1275,7 +1427,7 @@ L.MarkerCluster = L.Marker.extend({
                                        cm = childClusters[j];
                                        if (cm._icon) {
                                                cm._setPos(center);
-                                               cm.setOpacity(0);
+                                               cm.clusterHide();
                                        }
                                }
                        }
@@ -1290,10 +1442,10 @@ L.MarkerCluster = L.Marker.extend({
                                //TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.
                                //As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate
                                if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {
-                                       c.setOpacity(1);
+                                       c.clusterShow();
                                        c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
                                } else {
-                                       c.setOpacity(0);
+                                       c.clusterHide();
                                }
 
                                c._addToMap();
@@ -1303,7 +1455,7 @@ L.MarkerCluster = L.Marker.extend({
 
        _recursivelyBecomeVisible: function (bounds, zoomLevel) {
                this._recursively(bounds, 0, zoomLevel, null, function (c) {
-                       c.setOpacity(1);
+                       c.clusterShow();
                });
        },
 
@@ -1326,8 +1478,8 @@ L.MarkerCluster = L.Marker.extend({
                                                nm._backupLatlng = nm.getLatLng();
 
                                                nm.setLatLng(startPos);
-                                               if (nm.setOpacity) {
-                                                       nm.setOpacity(0);
+                                               if (nm.clusterHide) {
+                                                       nm.clusterHide();
                                                }
                                        }
 
@@ -1379,8 +1531,8 @@ L.MarkerCluster = L.Marker.extend({
                                        m = c._markers[i];
                                        if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
                                                c._group._featureGroup.removeLayer(m);
-                                               if (m.setOpacity) {
-                                                       m.setOpacity(1);
+                                               if (m.clusterShow) {
+                                                       m.clusterShow();
                                                }
                                        }
                                }
@@ -1391,8 +1543,8 @@ L.MarkerCluster = L.Marker.extend({
                                        m = c._childClusters[i];
                                        if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
                                                c._group._featureGroup.removeLayer(m);
-                                               if (m.setOpacity) {
-                                                       m.setOpacity(1);
+                                               if (m.clusterShow) {
+                                                       m.clusterShow();
                                                }
                                        }
                                }
@@ -1409,7 +1561,7 @@ L.MarkerCluster = L.Marker.extend({
        _recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {
                var childClusters = this._childClusters,
                    zoom = this._zoom,
-                       i, c;
+                   i, c;
 
                if (zoomLevelToStart > zoom) { //Still going down to required depth, just recurse to child clusters
                        for (i = childClusters.length - 1; i >= 0; i--) {
@@ -1439,23 +1591,6 @@ L.MarkerCluster = L.Marker.extend({
                }
        },
 
-       _recalculateBounds: function () {
-               var markers = this._markers,
-                       childClusters = this._childClusters,
-                       i;
-
-               this._bounds = new L.LatLngBounds();
-               delete this._wLatLng;
-
-               for (i = markers.length - 1; i >= 0; i--) {
-                       this._expandBounds(markers[i]);
-               }
-               for (i = childClusters.length - 1; i >= 0; i--) {
-                       this._expandBounds(childClusters[i]);
-               }
-       },
-
-
        //Returns true if we are the parent of only one cluster and that cluster is the same as us
        _isSingleParent: function () {
                //Don't need to check this._markers as the rest won't work if there are any
@@ -1465,6 +1600,34 @@ L.MarkerCluster = L.Marker.extend({
 
 
 
+/*
+* Extends L.Marker to include two extra methods: clusterHide and clusterShow.
+* 
+* They work as setOpacity(0) and setOpacity(1) respectively, but
+* they will remember the marker's opacity when hiding and showing it again.
+* 
+*/
+
+
+L.Marker.include({
+       
+       clusterHide: function () {
+               this.options.opacityWhenUnclustered = this.options.opacity || 1;
+               return this.setOpacity(0);
+       },
+       
+       clusterShow: function () {
+               var ret = this.setOpacity(this.options.opacity || this.options.opacityWhenUnclustered);
+               delete this.options.opacityWhenUnclustered;
+               return ret;
+       }
+       
+});
+
+
+
+
+
 L.DistanceGrid = function (cellSize) {
        this._cellSize = cellSize;
        this._sqCellSize = cellSize * cellSize;
@@ -1692,20 +1855,40 @@ Retrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=1843
                getConvexHull: function (latLngs) {
                        // find first baseline
                        var maxLat = false, minLat = false,
+                               maxLng = false, minLng = false,
+                               maxLatPt = null, minLatPt = null,
+                               maxLngPt = null, minLngPt = null,
                                maxPt = null, minPt = null,
                                i;
 
                        for (i = latLngs.length - 1; i >= 0; i--) {
                                var pt = latLngs[i];
                                if (maxLat === false || pt.lat > maxLat) {
-                                       maxPt = pt;
+                                       maxLatPt = pt;
                                        maxLat = pt.lat;
                                }
                                if (minLat === false || pt.lat < minLat) {
-                                       minPt = pt;
+                                       minLatPt = pt;
                                        minLat = pt.lat;
                                }
+                               if (maxLng === false || pt.lng > maxLng) {
+                                       maxLngPt = pt;
+                                       maxLng = pt.lng;
+                               }
+                               if (minLng === false || pt.lng < minLng) {
+                                       minLngPt = pt;
+                                       minLng = pt.lng;
+                               }
+                       }
+                       
+                       if (minLat !== maxLat) {
+                               minPt = minLatPt;
+                               maxPt = maxLatPt;
+                       } else {
+                               minPt = minLngPt;
+                               maxPt = maxLngPt;
                        }
+
                        var ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),
                                                                this.buildConvexHull([maxPt, minPt], latLngs));
                        return ch;
@@ -1764,7 +1947,7 @@ L.MarkerCluster.include({
                if (childMarkers.length >= this._circleSpiralSwitchover) {
                        positions = this._generatePointsSpiral(childMarkers.length, center);
                } else {
-                       center.y += 10; //Otherwise circles look wrong
+                       center.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.
                        positions = this._generatePointsCircle(childMarkers.length, center);
                }
 
@@ -1799,19 +1982,21 @@ L.MarkerCluster.include({
        },
 
        _generatePointsSpiral: function (count, centerPt) {
-               var legLength = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthStart,
-                       separation = this._group.options.spiderfyDistanceMultiplier * this._spiralFootSeparation,
-                       lengthFactor = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthFactor,
+               var spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,
+                       legLength = spiderfyDistanceMultiplier * this._spiralLengthStart,
+                       separation = spiderfyDistanceMultiplier * this._spiralFootSeparation,
+                       lengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,
                        angle = 0,
                        res = [],
                        i;
 
                res.length = count;
 
+               // Higher index, closer position to cluster center.
                for (i = count - 1; i >= 0; i--) {
                        angle += separation / legLength + i * 0.0005;
                        res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
-                       legLength += this._2PI * lengthFactor / angle;
+                       legLength += lengthFactor / angle;
                }
                return res;
        },
@@ -1842,23 +2027,36 @@ L.MarkerCluster.include({
                                delete m._spiderLeg;
                        }
                }
-
+               
+               group.fire('unspiderfied', {
+                       cluster: this,
+                       markers: childMarkers
+               });
                group._spiderfied = null;
        }
 });
 
-L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
-       //Non Animated versions of everything
+//Non Animated versions of everything
+L.MarkerClusterNonAnimated = L.MarkerCluster.extend({
        _animationSpiderfy: function (childMarkers, positions) {
                var group = this._group,
                        map = group._map,
                        fg = group._featureGroup,
+                       legOptions = this._group.options.spiderLegPolylineOptions,
                        i, m, leg, newPos;
 
-               for (i = childMarkers.length - 1; i >= 0; i--) {
+               // Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.
+               // The reverse order trick no longer improves performance on modern browsers.
+               for (i = 0; i < childMarkers.length; i++) {
                        newPos = map.layerPointToLatLng(positions[i]);
                        m = childMarkers[i];
 
+                       // Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.
+                       leg = new L.Polyline([this._latlng, newPos], legOptions);
+                       map.addLayer(leg);
+                       m._spiderLeg = leg;
+
+                       // Now add the marker.
                        m._preSpiderfyLatlng = m._latlng;
                        m.setLatLng(newPos);
                        if (m.setZIndexOffset) {
@@ -1866,58 +2064,91 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                        }
 
                        fg.addLayer(m);
-
-
-                       leg = new L.Polyline([this._latlng, newPos], { weight: 1.5, color: '#222' });
-                       map.addLayer(leg);
-                       m._spiderLeg = leg;
                }
                this.setOpacity(0.3);
-               group.fire('spiderfied');
+               group.fire('spiderfied', {
+                       cluster: this,
+                       markers: childMarkers
+               });
        },
 
        _animationUnspiderfy: function () {
                this._noanimationUnspiderfy();
        }
-} : {
-       //Animated versions here
-       SVG_ANIMATION: (function () {
-               return document.createElementNS('http://www.w3.org/2000/svg', 'animate').toString().indexOf('SVGAnimate') > -1;
-       }()),
+});
+
+//Animated versions here
+L.MarkerCluster.include({
 
        _animationSpiderfy: function (childMarkers, positions) {
                var me = this,
                        group = this._group,
                        map = group._map,
                        fg = group._featureGroup,
-                       thisLayerPos = map.latLngToLayerPoint(this._latlng),
-                       i, m, leg, newPos;
+                       thisLayerLatLng = this._latlng,
+                       thisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),
+                       svg = L.Path.SVG,
+                       legOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.
+                       finalLegOpacity = legOptions.opacity,
+                       i, m, leg, legPath, legLength, newPos;
 
-               //Add markers to map hidden at our center point
-               for (i = childMarkers.length - 1; i >= 0; i--) {
+               if (finalLegOpacity === undefined) {
+                       finalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;
+               }
+
+               if (svg) {
+                       // If the initial opacity of the spider leg is not 0 then it appears before the animation starts.
+                       legOptions.opacity = 0;
+
+                       // Add the class for CSS transitions.
+                       legOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';
+               } else {
+                       // Make sure we have a defined opacity.
+                       legOptions.opacity = finalLegOpacity;
+               }
+
+               // Add markers and spider legs to map, hidden at our center point.
+               // Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.
+               // The reverse order trick no longer improves performance on modern browsers.
+               for (i = 0; i < childMarkers.length; i++) {
                        m = childMarkers[i];
 
-                       //If it is a marker, add it now and we'll animate it out
-                       if (m.setOpacity) {
-                               m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
-                               m.setOpacity(0);
-                       
-                               fg.addLayer(m);
+                       newPos = map.layerPointToLatLng(positions[i]);
+
+                       // Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.
+                       leg = new L.Polyline([thisLayerLatLng, newPos], legOptions);
+                       map.addLayer(leg);
+                       m._spiderLeg = leg;
 
+                       // Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/
+                       // In our case the transition property is declared in the CSS file.
+                       if (svg) {
+                               legPath = leg._path;
+                               legLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.
+                               legPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.
+                               legPath.style.strokeDashoffset = legLength;
+                       }
+
+                       // If it is a marker, add it now and we'll animate it out
+                       if (m.setZIndexOffset) {
+                               m.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING
+                       }
+                       if (m.clusterHide) {
+                               m.clusterHide();
+                       }
+
+                       // Vectors just get immediately added
+                       fg.addLayer(m);
+
+                       if (m._setPos) {
                                m._setPos(thisLayerPos);
-                       } else {
-                               //Vectors just get immediately added
-                               fg.addLayer(m);
                        }
                }
 
                group._forceLayout();
                group._animationStart();
 
-               var initialLegOpacity = L.Path.SVG ? 0 : 0.3,
-                       xmlns = L.Path.SVG_NS;
-
-
+               // Reveal markers and spider legs.
                for (i = childMarkers.length - 1; i >= 0; i--) {
                        newPos = map.layerPointToLatLng(positions[i]);
                        m = childMarkers[i];
@@ -1926,79 +2157,39 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                        m._preSpiderfyLatlng = m._latlng;
                        m.setLatLng(newPos);
                        
-                       if (m.setOpacity) {
-                               m.setOpacity(1);
+                       if (m.clusterShow) {
+                               m.clusterShow();
                        }
 
-
-                       //Add Legs.
-                       leg = new L.Polyline([me._latlng, newPos], { weight: 1.5, color: '#222', opacity: initialLegOpacity });
-                       map.addLayer(leg);
-                       m._spiderLeg = leg;
-
-                       //Following animations don't work for canvas
-                       if (!L.Path.SVG || !this.SVG_ANIMATION) {
-                               continue;
-                       }
-
-                       //How this works:
-                       //http://stackoverflow.com/questions/5924238/how-do-you-animate-an-svg-path-in-ios
-                       //http://dev.opera.com/articles/view/advanced-svg-animation-techniques/
-
-                       //Animate length
-                       var length = leg._path.getTotalLength();
-                       leg._path.setAttribute("stroke-dasharray", length + "," + length);
-
-                       var anim = document.createElementNS(xmlns, "animate");
-                       anim.setAttribute("attributeName", "stroke-dashoffset");
-                       anim.setAttribute("begin", "indefinite");
-                       anim.setAttribute("from", length);
-                       anim.setAttribute("to", 0);
-                       anim.setAttribute("dur", 0.25);
-                       leg._path.appendChild(anim);
-                       anim.beginElement();
-
-                       //Animate opacity
-                       anim = document.createElementNS(xmlns, "animate");
-                       anim.setAttribute("attributeName", "stroke-opacity");
-                       anim.setAttribute("attributeName", "stroke-opacity");
-                       anim.setAttribute("begin", "indefinite");
-                       anim.setAttribute("from", 0);
-                       anim.setAttribute("to", 0.5);
-                       anim.setAttribute("dur", 0.25);
-                       leg._path.appendChild(anim);
-                       anim.beginElement();
-               }
-               me.setOpacity(0.3);
-
-               //Set the opacity of the spiderLegs back to their correct value
-               // The animations above override this until they complete.
-               // If the initial opacity of the spiderlegs isn't 0 then they appear before the animation starts.
-               if (L.Path.SVG) {
-                       this._group._forceLayout();
-
-                       for (i = childMarkers.length - 1; i >= 0; i--) {
-                               m = childMarkers[i]._spiderLeg;
-
-                               m.options.opacity = 0.5;
-                               m._path.setAttribute('stroke-opacity', 0.5);
+                       // Animate leg (animation is actually delegated to CSS transition).
+                       if (svg) {
+                               leg = m._spiderLeg;
+                               legPath = leg._path;
+                               legPath.style.strokeDashoffset = 0;
+                               //legPath.style.strokeOpacity = finalLegOpacity;
+                               leg.setStyle({opacity: finalLegOpacity});
                        }
                }
+               this.setOpacity(0.3);
 
                setTimeout(function () {
                        group._animationEnd();
-                       group.fire('spiderfied');
+                       group.fire('spiderfied', {
+                               cluster: me,
+                               markers: childMarkers
+                       });
                }, 200);
        },
 
        _animationUnspiderfy: function (zoomDetails) {
-               var group = this._group,
+               var me = this,
+                       group = this._group,
                        map = group._map,
                        fg = group._featureGroup,
                        thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),
                        childMarkers = this.getAllChildMarkers(),
-                       svg = L.Path.SVG && this.SVG_ANIMATION,
-                       m, i, a;
+                       svg = L.Path.SVG,
+                       m, i, leg, legPath, legLength, nonAnimatable;
 
                group._animationStart();
 
@@ -2007,7 +2198,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                for (i = childMarkers.length - 1; i >= 0; i--) {
                        m = childMarkers[i];
 
-                       //Marker was added to us after we were spidified
+                       //Marker was added to us after we were spiderfied
                        if (!m._preSpiderfyLatlng) {
                                continue;
                        }
@@ -2015,28 +2206,28 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                        //Fix up the location to the real one
                        m.setLatLng(m._preSpiderfyLatlng);
                        delete m._preSpiderfyLatlng;
+
                        //Hack override the location to be our center
-                       if (m.setOpacity) {
+                       nonAnimatable = true;
+                       if (m._setPos) {
                                m._setPos(thisLayerPos);
-                               m.setOpacity(0);
-                       } else {
+                               nonAnimatable = false;
+                       }
+                       if (m.clusterHide) {
+                               m.clusterHide();
+                               nonAnimatable = false;
+                       }
+                       if (nonAnimatable) {
                                fg.removeLayer(m);
                        }
 
-                       //Animate the spider legs back in
+                       // Animate the spider leg back in (animation is actually delegated to CSS transition).
                        if (svg) {
-                               a = m._spiderLeg._path.childNodes[0];
-                               a.setAttribute('to', a.getAttribute('from'));
-                               a.setAttribute('from', 0);
-                               a.beginElement();
-
-                               a = m._spiderLeg._path.childNodes[1];
-                               a.setAttribute('from', 0.5);
-                               a.setAttribute('to', 0);
-                               a.setAttribute('stroke-opacity', 0);
-                               a.beginElement();
-
-                               m._spiderLeg._path.setAttribute('stroke-opacity', 0);
+                               leg = m._spiderLeg;
+                               legPath = leg._path;
+                               legLength = legPath.getTotalLength() + 0.1;
+                               legPath.style.strokeDashoffset = legLength;
+                               leg.setStyle({opacity: 0});
                        }
                }
 
@@ -2058,9 +2249,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                                        continue;
                                }
 
-
-                               if (m.setOpacity) {
-                                       m.setOpacity(1);
+                               if (m.clusterShow) {
+                                       m.clusterShow();
+                               }
+                               if (m.setZIndexOffset) {
                                        m.setZIndexOffset(0);
                                }
 
@@ -2072,6 +2264,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
                                delete m._spiderLeg;
                        }
                        group._animationEnd();
+                       group.fire('unspiderfied', {
+                               cluster: me,
+                               markers: childMarkers
+                       });
                }, 200);
        }
 });
@@ -2089,24 +2285,19 @@ L.MarkerClusterGroup.include({
                }
                //Browsers without zoomAnimation or a big zoom don't fire zoomstart
                this._map.on('zoomend', this._noanimationUnspiderfy, this);
-
-               if (L.Path.SVG && !L.Browser.touch) {
-                       this._map._initPathRoot();
-                       //Needs to happen in the pageload, not after, or animations don't work in webkit
-                       //  http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements
-                       //Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable
-               }
        },
 
        _spiderfierOnRemove: function () {
                this._map.off('click', this._unspiderfyWrapper, this);
                this._map.off('zoomstart', this._unspiderfyZoomStart, this);
                this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
+               this._map.off('zoomend', this._noanimationUnspiderfy, this);
 
-               this._unspiderfy(); //Ensure that markers are back where they should be
+               //Ensure that markers are back where they should be
+               // Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane
+               this._noanimationUnspiderfy();
        },
 
-
        //On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)
        //This means we can define the animation they do rather than Markers doing an animation to their actual location
        _unspiderfyZoomStart: function () {
@@ -2116,6 +2307,7 @@ L.MarkerClusterGroup.include({
 
                this._map.on('zoomanim', this._unspiderfyZoomAnim, this);
        },
+
        _unspiderfyZoomAnim: function (zoomDetails) {
                //Wait until the first zoomanim after the user has finished touch-zooming before running the animation
                if (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {
@@ -2126,7 +2318,6 @@ L.MarkerClusterGroup.include({
                this._unspiderfy(zoomDetails);
        },
 
-
        _unspiderfyWrapper: function () {
                /// <summary>_unspiderfy but passes no arguments</summary>
                this._unspiderfy();
@@ -2149,9 +2340,13 @@ L.MarkerClusterGroup.include({
                if (layer._spiderLeg) {
                        this._featureGroup.removeLayer(layer);
 
-                       layer.setOpacity(1);
+                       if (layer.clusterShow) {
+                               layer.clusterShow();
+                       }
                        //Position will be fixed up immediately in _animationUnspiderfy
-                       layer.setZIndexOffset(0);
+                       if (layer.setZIndexOffset) {
+                               layer.setZIndexOffset(0);
+                       }
 
                        this._map.removeLayer(layer._spiderLeg);
                        delete layer._spiderLeg;
@@ -2160,4 +2355,129 @@ L.MarkerClusterGroup.include({
 });
 
 
+/**
+ * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing
+ * markers' icon options and refreshing their icon and their parent clusters
+ * accordingly (case where their iconCreateFunction uses data of childMarkers
+ * to make up the cluster icon).
+ */
+
+
+L.MarkerClusterGroup.include({
+       /**
+        * Updates the icon of all clusters which are parents of the given marker(s).
+        * In singleMarkerMode, also updates the given marker(s) icon.
+        * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|
+        * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent
+        * clusters need to be updated. If not provided, retrieves all child markers of this.
+        * @returns {L.MarkerClusterGroup}
+        */
+       refreshClusters: function (layers) {
+               if (!layers) {
+                       layers = this._topClusterLevel.getAllChildMarkers();
+               } else if (layers instanceof L.MarkerClusterGroup) {
+                       layers = layers._topClusterLevel.getAllChildMarkers();
+               } else if (layers instanceof L.LayerGroup) {
+                       layers = layers._layers;
+               } else if (layers instanceof L.MarkerCluster) {
+                       layers = layers.getAllChildMarkers();
+               } else if (layers instanceof L.Marker) {
+                       layers = [layers];
+               } // else: must be an Array(L.Marker)|Map(L.Marker)
+               this._flagParentsIconsNeedUpdate(layers);
+               this._refreshClustersIcons();
+
+               // In case of singleMarkerMode, also re-draw the markers.
+               if (this.options.singleMarkerMode) {
+                       this._refreshSingleMarkerModeMarkers(layers);
+               }
+
+               return this;
+       },
+
+       /**
+        * Simply flags all parent clusters of the given markers as having a "dirty" icon.
+        * @param layers Array(L.Marker)|Map(L.Marker) list of markers.
+        * @private
+        */
+       _flagParentsIconsNeedUpdate: function (layers) {
+               var id, parent;
+
+               // Assumes layers is an Array or an Object whose prototype is non-enumerable.
+               for (id in layers) {
+                       // Flag parent clusters' icon as "dirty", all the way up.
+                       // Dumb process that flags multiple times upper parents, but still
+                       // much more efficient than trying to be smart and make short lists,
+                       // at least in the case of a hierarchy following a power law:
+                       // http://jsperf.com/flag-nodes-in-power-hierarchy/2
+                       parent = layers[id].__parent;
+                       while (parent) {
+                               parent._iconNeedsUpdate = true;
+                               parent = parent.__parent;
+                       }
+               }
+       },
+
+       /**
+        * Refreshes the icon of all "dirty" visible clusters.
+        * Non-visible "dirty" clusters will be updated when they are added to the map.
+        * @private
+        */
+       _refreshClustersIcons: function () {
+               this._featureGroup.eachLayer(function (c) {
+                       if (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {
+                               c._updateIcon();
+                       }
+               });
+       },
+
+       /**
+        * Re-draws the icon of the supplied markers.
+        * To be used in singleMarkerMode only.
+        * @param layers Array(L.Marker)|Map(L.Marker) list of markers.
+        * @private
+        */
+       _refreshSingleMarkerModeMarkers: function (layers) {
+               var id, layer;
+
+               for (id in layers) {
+                       layer = layers[id];
+
+                       // Make sure we do not override markers that do not belong to THIS group.
+                       if (this.hasLayer(layer)) {
+                               // Need to re-create the icon first, then re-draw the marker.
+                               layer.setIcon(this._overrideMarkerIcon(layer));
+                       }
+               }
+       }
+});
+
+L.Marker.include({
+       /**
+        * Updates the given options in the marker's icon and refreshes the marker.
+        * @param options map object of icon options.
+        * @param directlyRefreshClusters boolean (optional) true to trigger
+        * MCG.refreshClustersOf() right away with this single marker.
+        * @returns {L.Marker}
+        */
+       refreshIconOptions: function (options, directlyRefreshClusters) {
+               var icon = this.options.icon;
+
+               L.setOptions(icon, options);
+
+               this.setIcon(icon);
+
+               // Shortcut to refresh the associated MCG clusters right away.
+               // To be used when refreshing a single marker.
+               // Otherwise, better use MCG.refreshClusters() once at the end with
+               // the list of modified markers.
+               if (directlyRefreshClusters && this.__parent) {
+                       this.__parent._group.refreshClusters(this);
+               }
+
+               return this;
+       }
+});
+
+
 }(window, document));
\ No newline at end of file
index 789c8a3..2aae5fe 100755 (executable)
@@ -5,6 +5,14 @@
        transition: transform 0.3s ease-out, opacity 0.3s ease-in;
        }
 
+.leaflet-cluster-spider-leg {
+       /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
+       -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
+       -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
+       -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
+       transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
+}
+
 .marker-cluster-small {
        background-color: rgba(181, 226, 140, 0.6);
        }
index ee3d588..9f48f22 100644 (file)
@@ -12,7 +12,7 @@ Parametres possibles :
 - maxZoom = 13                     zoom maximum autorisé\r
 - minZoom = 13                     zoom minimum autorisé\r
 \r
-- default_layer = acetate                   nom de la couche affichée par défaut\r
+- default_layer = acetate                   nom de la couche affichée par défaut, "none" si on ne souhaite pas affiche de couche spécifique\r
 - affiche_layers = openmapsurfer/acetate    noms des couches proposées séparés par des /\r
 \r
 - sw_lat = lat - 10°               latitude du sud-ouest de la bounding box\r
@@ -39,15 +39,18 @@ Parametres possibles :
 \r
 - objets = gis                     type d'objets à afficher (fichier json/gis_xx qui génère la source de donnees)\r
 - limit|limite = 500               nombre max de marqueurs à afficher, 500 par defaut\r
+- langue = null                    langue des objets à récupérer (utile pour les multis notamment)\r
 - kml = 12                         kml à superposer à la carte (id_document ou url ou liste d'url)\r
 - gpx = 12                         gpx à superposer à la carte (id_document ou url ou liste d'url)\r
-- geojson = 12                     geojson à superposer à la carte (id_document ou url  ou liste d'url)\r
+- geojson = 12                     geojson à superposer à la carte (id_document ou url ou liste d'url)\r
+- topojson = 12                    topojson à superposer à la carte (id_document ou url ou liste d'url)\r
 - centrer_fichier = non            permet de ne pas centrer la carte automatiquement sur les fichiers kml/gpx surperposés\r
 - point = non                      si elle vaut "non" cette option n'affichera pas de points du tout (utile pour n'afficher qu'un kml par exemple)\r
 \r
 - media = non                      permet de passer le critère 'media' (pour les documents)\r
 - mots = #LISTE{1,4,7}             plugin critere {mots} http://contrib.spip.net/Critere-mots\r
 - path_styles=#ARRAY{color,#fff}   options de style des éléments de la couche GeoJSON (voir http://leafletjs.com/reference.html#path-options)\r
+- options=#ARRAY{option1,valeur1}  options ajoutées à la carte (qui peuvent être récupérées dans la fonction de callback par exemple par la suite)\r
 \r
 Uniquement si objets = point_libre :\r
 - icone = chemin/vers/image        image utilisée pour le marker\r
@@ -118,9 +121,10 @@ var jQgisloader;
                                        ne_lat: (#GET{ne_lat})][,\r
                                        sw_lon: (#GET{sw_lon})][,\r
                                        ne_lon: (#GET{ne_lon})],\r
-                                       affiche_points: [(#ENV{point,''}|=={non}|?{false,true})],\r
+                                       affiche_points: [(#ENV{point,''}|=={non}|?{false,true})][,\r
+                                       langue:'(#ENV{langue})'],\r
                                        json_points:{\r
-                                               url: '[(#URL_PAGE{gis_json}|url_absolue)]'[,\r
+                                               url: '[(#URL_PAGE{gis_json}|parametre_url{lang,#ENV{langue},&}|url_absolue)]'[,\r
                                                objets: '(#ENV{objets,#ENV{class}}|trim)'],\r
                                                limit: [(#ENV{limit,#ENV{limite,500}}|trim)],\r
                                                env: [(#ENV*{args,#ENV*}|gis_modele_url_json_env|json_encode)][,\r
@@ -136,14 +140,16 @@ var jQgisloader;
                                                maxClusterRadius: [(#ENV{maxClusterRadius,80})]\r
                                        },\r
                                        pathStyles: [(#ENV*{path_styles}|json_encode)],\r
-                                       autocenterandzoom: [(#ENV{autocenterandzoom,#ENV{centrer_auto}}|?{true,false})],\r
+                                       autocenterandzoom: [(#ENV{autocenterandzoom,#ENV{centrer_auto,non}}|=={non}|?{false,true})],\r
                                        openId: [(#ENV{id_a_ouvrir,false})],\r
                                        localize_visitor: [(#ENV{localize_visitor,#ENV{localiser_visiteur}}|?{true,false})],\r
                                        localize_visitor_zoom: [(#ENV{localize_visitor_zoom,#ENV{zoom,#CONFIG{gis/zoom,0}}})],\r
                                        centrer_fichier: [(#ENV{centrer_fichier,oui}|=={oui}|?{true,false})],\r
-                                       kml: [(#ENV{kml,''}|?{[(#ENV{kml}|is_array|?{#ENV{kml},#LISTE{#ENV{kml}}}|gis_kml_to_urls|json_encode)],false})],\r
-                                       gpx: [(#ENV{gpx,''}|?{[(#ENV{gpx}|is_array|?{#ENV{gpx},#LISTE{#ENV{gpx}}}|gis_kml_to_urls|json_encode)],false})],\r
-                                       geojson: [(#ENV{geojson,''}|?{[(#ENV{geojson}|is_array|?{#ENV{geojson},#LISTE{#ENV{geojson}}}|gis_kml_to_urls|json_encode)],false})]\r
+                                       kml: [(#ENV{kml,''}|?{[(#ENV{kml}|gis_param_to_array|gis_kml_to_urls|json_encode)],false})],\r
+                                       gpx: [(#ENV{gpx,''}|?{[(#ENV{gpx}|gis_param_to_array|gis_kml_to_urls|json_encode)],false})],\r
+                                       geojson: [(#ENV{geojson,''}|?{[(#ENV{geojson}|gis_param_to_array|gis_kml_to_urls|json_encode)],false})],\r
+                                       topojson: [(#ENV{topojson,''}|?{[(#ENV{topojson}|gis_param_to_array|gis_kml_to_urls|json_encode)],false})],\r
+                                       options: [(#ENV*{options,#ARRAY}|json_encode)]\r
                                });\r
                        });\r
                });\r
index 52f1193..ed83889 100755 (executable)
                map_preview = new L.Map(map_preview_container);\r
                \r
                map_preview.attributionControl.setPrefix('');\r
-               \r
-               var base_layer = [new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#REM|gis_layer_defaut)]/layer})];\r
-               map_preview.addLayer(base_layer);\r
+\r
+               var base_layer = [(#ENV{layer_defaut}|=={none}|?{"'none'",[new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#ENV{layer_defaut,[(#REM|gis_layer_defaut)]})]/layer})]})];\r
+               if(base_layer != 'none'){\r
+                       map_preview.addLayer(base_layer);\r
+               }\r
                \r
                map_preview.setView(new L.LatLng([(#LAT)],[(#LON)]),[(#ZOOM|sinon{#CONFIG{gis/zoom,0}})]);\r
 
index 2397680..10ea5a8 100644 (file)
@@ -1,8 +1,8 @@
 <paquet
        prefix="gis"
        categorie="divers"
-       version="4.32.5"
-       schema="2.0.8"
+       version="4.41.1"
+       schema="2.1.0"
        etat="stable"
        compatibilite="[3.0.0;3.1.*]"
        logo="images/gis.png"
@@ -21,8 +21,9 @@
        <credit lien="https://github.com/brunob/leaflet.fullscreen">Leaflet fullscreen</credit>
        <credit lien="https://github.com/Norkart/Leaflet-MiniMap">Leaflet minimap</credit>
        <credit lien="http://wiki.openstreetmap.org/wiki/Nominatim">Nominatim</credit>
+       <credit lien="https://photon.komoot.de/">Photon</credit>
        <credit lien="http://mattrich.deviantart.com/art/Picnic-101256405">Icône de mattrich sous licence CC BY-NC-SA</credit>
-       <copyright>2011-2015</copyright>
+       <copyright>2011-2016</copyright>
        <licence>GPL v3</licence>
 
        <traduire module="gis" reference="fr" gestionnaire="salvatore" />
index 74dbd33..ade5c65 100644 (file)
@@ -1,6 +1 @@
-[(#SET{titre, #VAL{gis:info_geolocalisation}|_T})]
-[(#BOITE_OUVRIR{#CHEMIN_IMAGE{gis-24.png}|balise_img{'',cadre-icone}|concat{#GET{titre}}, 'simple'})]
-<div id="editer_gis_[(#ENV{objet})]_[(#ENV{id_objet})]" class="ajax-action nom_action">
-       [(#INCLURE{fond=prive/inclure/gis_objet_formulaires,env,ajax})]
-</div>
-#BOITE_FERMER
\ No newline at end of file
+[(#INCLURE{fond=prive/inclure/gis_objet_formulaires,env,ajax})]
\ No newline at end of file
index 32332bb..b8618c4 100644 (file)
@@ -1,42 +1,3 @@
 <div class="ajax">
-#SET{gis_defaut,''}
-<BOUCLE_test(GIS){objet}{id_objet}{0,1}> </BOUCLE_test>
-#SET{gis_defaut,nouveau}
-#SET{gis_defaut,glop}
-<//B_test>
-
-#SET{bloc_gis, #ENV{bloc_gis,#GET{gis_defaut}|=={nouveau}|?{editer,lier}}}
-
-<div class="actions onglets_simple second clearfix">
-       <ul>
-       <li>
-       [(#GET{bloc_gis}|=={lier}|?{<strong>,<a href="[(#SELF|parametre_url{bloc_gis,lier}|parametre_url{id_gis,''})]" class="ajax">})]
-               <:gis:titre_bloc_points_lies:>
-       [(#GET{bloc_gis}|=={lier}|?{</strong>,</a>})]
-       </li>
-       <li>
-       [(#GET{bloc_gis}|=={rechercher}|?{<strong>,<a href="[(#SELF|parametre_url{bloc_gis,rechercher}|parametre_url{id_gis,''})]" class="ajax">})]
-               <:gis:titre_bloc_rechercher_point:>
-       [(#GET{bloc_gis}|=={rechercher}|?{</strong>,</a>})]
-       </li>
-       <li>
-       [(#GET{bloc_gis}|=={editer}|?{<strong>,<a href="[(#SELF|parametre_url{bloc_gis,editer}|parametre_url{id_gis,nouveau})]" class="ajax">})]
-               <:gis:titre_bloc_creer_point:>
-       [(#GET{bloc_gis}|=={editer}|?{</strong>,</a>})]
-       </li>
-       </ul>
-</div>
-
-[(#GET{bloc_gis}|=={editer}|oui)
-       #FORMULAIRE_EDITER_GIS{#ENV{id_gis,#GET{gis_defaut}},#ENV{objet},#ENV{id_objet},#SELF,'non',#ENV{options_formulaire_editer_gis}}
-]
-
-[(#GET{bloc_gis}|=={lier}|oui)
-       [(#INCLURE{fond=prive/objets/liste/gis_lies,sinon=<:gis:aucun_gis:>,env})]
-]
-
-<BOUCLE_gis(GIS){0,1}> </BOUCLE_gis>[(#GET{bloc_gis}|=={rechercher}|oui)
-<div class="ajax">
-       #FORMULAIRE_RECHERCHER_GIS{#ENV{objet},#ENV{id_objet},#SELF|parametre_url{bloc_gis,lier}}
-</div>]</B_gis>
-</div>
+       #FORMULAIRE_EDITER_LIENS{gis,#ENV{objet},#ENV{id_objet},oui}
+</div>
\ No newline at end of file
index 1770b5e..39538d8 100644 (file)
@@ -34,7 +34,7 @@ a mis a jour la valeur avec la page reelle]
                        <td class='picto'>[(#CHEMIN_IMAGE{gis-16.png}|balise_img)]</td>
                        <td class='titre principale'>[(#LOGO_GIS|image_reduire{20,20})]<a href="[(#ID_GIS|generer_url_entite{gis})]"
                                title="<:gis:texte_voir_gis:>">[(#TITRE|sinon{<:ecrire:info_sans_titre:>})]</a></td>
-                       <td class='action'><button type="submit" class="button" name="ajouter_lien[gis-#ID_GIS-#OBJET-#ID_OBJET]" value="+"><:gis:lien_ajouter_gis:> [(#CHEMIN_IMAGE{ajouter-12.png}|balise_img{'+'})]</button></td>
+                       <td class='action'><button type="submit" class="button link" name="ajouter_lien[gis-#ID_GIS-#OBJET-#ID_OBJET]" value="+"><:gis:lien_ajouter_gis:> [(#CHEMIN_IMAGE{ajouter-12.png}|balise_img{'+'})]</button></td>
                </tr>
        </BOUCLE_liste_gis>
        </tbody>
index 891b756..b301600 100644 (file)
@@ -1,3 +1,7 @@
 <?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
 include_spip('inc/filtres_ecrire');
-?>
\ No newline at end of file
index d4950cf..9065a2e 100644 (file)
                        <td class='titre principale'>[(#LOGO_GIS|image_reduire{20,20})]<a href="[(#ID_GIS|generer_url_entite{gis})]"
                                title="<:gis:texte_voir_gis:>">[(#TITRE|sinon{<:ecrire:info_sans_titre:>})]</a></td>
                        <td class='action'>
-                [(#BOUTON_ACTION{
-                    <:gis:info_supprimer_lien:>  [(#CHEMIN_IMAGE{supprimer-12.png}|balise_img{'X'})],
-                    #URL_ACTION_AUTEUR{editer_lien_gis,delier/#ID_GIS/#OBJET/#ID_OBJET,#SELF},
-                    ajax})]
+                               [(#ENV{editable}|oui)
+                               <button type="submit" class="button link delete" name="supprimer_lien\[gis-#ID_GIS-#ENV{objet}-#ENV{id_objet}\]" value="X"><:gis:info_supprimer_lien:> [(#CHEMIN_IMAGE{supprimer-12.png}|balise_img{'X'})]</button>]
                        </td>
                </tr>
        </BOUCLE_liste_gis>
index 891b756..b301600 100644 (file)
@@ -1,3 +1,7 @@
 <?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
 include_spip('inc/filtres_ecrire');
-?>
\ No newline at end of file
index 101a4a1..486e20a 100644 (file)
@@ -3,7 +3,7 @@
        [(#AUTORISER{modifier,gis,#ID_GIS})
        [(#URL_ECRIRE{gis_edit,id_gis=#ID_GIS}|icone_verticale{<:gis:texte_modifier_gis:>,gis,edit,right ajax preload})]
        ]
-       <h1>(#TITRE|sinon{<:info_sans_titre:>})[(#CHEMIN_IMAGE{gis-24.png}|balise_img{gis,cadre-icone})]</h1>
+       <h1 class="#EDIT{titre}">(#TITRE|sinon{<:info_sans_titre:>})[(#CHEMIN_IMAGE{gis-24.png}|balise_img{gis,cadre-icone})]</h1>
 ],simple fiche_objet})]
 
 [(#INCLURE{fond=modeles/carte_gis_preview,id_gis})]
index eb7ea22..271a73e 100644 (file)
@@ -8,5 +8,8 @@
 #SET{right,#ENV{ltr}|choixsiegal{left,right,left}}
 
 /* liste des points exec=gis_tous */
-
 .gis_tous .onglets_simple .formulaire_recherche { margin-bottom: 0; }
+
+/* saisie carte */
+.saisie_carte .leaflet-control-layers label { float: none; width: auto; margin-#GET{left}: 0; }
+.saisie_carte .leaflet-control.leaflet-draw .leaflet-draw-actions  { margin-#GET{left}: 0; margin-#GET{right}: 0; }
index b0e5a4c..399d41c 100644 (file)
Binary files a/www/plugins/gis/prive/themes/spip/images/gis-16.png and b/www/plugins/gis/prive/themes/spip/images/gis-16.png differ
index 6cb9f54..25d1e7e 100755 (executable)
Binary files a/www/plugins/gis/prive/themes/spip/images/gis-24.png and b/www/plugins/gis/prive/themes/spip/images/gis-24.png differ
index e84098a..19f1de2 100644 (file)
Binary files a/www/plugins/gis/prive/themes/spip/images/gis-new-16.png and b/www/plugins/gis/prive/themes/spip/images/gis-new-16.png differ
index 954486b..261cb01 100644 (file)
@@ -194,7 +194,7 @@ var geocoder;]
                        maj_inputs(form_map,e.latlng,'click');
                });
 
-               marker.on("dragend", function(e){
+               marker.on('dragend', function(e){
                        maj_inputs(form_map,e.target._latlng,'click');
                });
 
@@ -205,14 +205,14 @@ var geocoder;]
 
                [(#GET{geocoder}|oui)
                // geocoder si clic...
-               $('a##ENV{nom}_rechercher_geocodage').css("cursor","pointer").click(function(){
+               $('a##ENV{nom}_rechercher_geocodage').css("cursor","pointer").on('click',function(){
                        var address = $("#champ_#ENV{nom}_geocoder").val();
                        annuler_geocoder = 0;
                        geocoder.geocode(address);
                });
 
                // ne pas soumettre le formulaire si on presse Entree depuis le champ de recherche
-               $('#champ_#ENV{nom}_geocoder').keypress(function(e){
+               $('#champ_#ENV{nom}_geocoder').on('keypress', function(e){
                        if (e.which == 13) {
                                $('a##ENV{nom}_rechercher_geocodage').trigger("click");
                                return false;
@@ -242,6 +242,6 @@ var geocoder;]
 [(#GET{geocoder}|oui)
 <[(#VAL{li}|saisie_balise_structure_formulaire)] class="rechercher_adresse editer editer_[(#ENV{nom})]">
        <label for="champ_#ENV{nom}_geocoder"><:gis:label_rechercher_address:></label>
-       <input type="text" class="text" name="champ_#ENV{nom}_geocoder" id="champ_#ENV{nom}_geocoder" value="" />
+       <input type="text" class="text" name="champ_#ENV{nom}_geocoder" id="champ_#ENV{nom}_geocoder" placeholder="<:gis:placeholder_geocoder|attribut_html:>" value="" />
        <a id="#ENV{nom}_rechercher_geocodage"><:info_rechercher:></a>
 </[(#VAL{li}|saisie_balise_structure_formulaire)]>]
index fef9aed..8e0b7bc 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/gis/trunk
-Revision: 95041
-Dernier commit: 2016-02-09 10:02:40 +0100 
+Revision: 99295
+Dernier commit: 2016-08-31 06:04:04 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/gis/trunk</origine>
-<revision>95041</revision>
-<commit>2016-02-09 10:02:40 +0100 </commit>
+<revision>99295</revision>
+<commit>2016-08-31 06:04:04 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index b40ee7e..6db244c 100644 (file)
@@ -3,14 +3,15 @@
        // attention avant de lancer ce test !
        // le dossier du plugin ne doit pas être un lien symbolique dans /plugins
        // sous peine de générer un timeout...
-       
+
        $test = 'gis_connect_sql';
 
-       $remonte = "../";
-       while (!is_dir($remonte."ecrire"))
+       $remonte = '../';
+       while (!is_dir($remonte.'ecrire')) {
                $remonte = "../$remonte";
+       }
        require $remonte.'tests/test.inc';
-       find_in_path("./base/connect_sql.php",'',true);
+       find_in_path('./base/connect_sql.php', '', true);
 
 
        // Les tests
 
        // hop ! on y va
        $err = array();
-       foreach($essais as $f=>$essai)
-               $err = array_merge(tester_fun($f, $essai),$err);
-       
+       foreach ($essais as $f => $essai) {
+               $err = array_merge(tester_fun($f, $essai), $err);
+       }
+
        // si le tableau $err est pas vide ca va pas
        if ($err) {
                echo ('<dl>' . join('', $err) . '</dl>');
        } else {
-               echo "OK";
+               echo 'OK';
        }
-
-?>
\ No newline at end of file
index b93b43e..8c60ee9 100644 (file)
@@ -23,7 +23,7 @@ function action_editer_menu_dist($arg=null) {
        if ($id_menu > 0) $err = menu_set($id_menu);
 
        // S'il y a un fichier on tente d'importer son contenu
-       if ($_FILES['import']){
+       if (isset($_FILES['import']) AND $_FILES['import']) {
                $fichier = $_FILES['import']['tmp_name'];
                $yaml = '';
                lire_fichier($fichier, $yaml);
index 8219c83..80b074a 100644 (file)
@@ -42,6 +42,8 @@ function action_editer_menus_entree_dist($arg=null) {
  */
 function insert_menus_entree($id_menu) {
        // Envoyer aux plugins
+       $champs = array();
+       $champs['id_menu'] = $id_menu;
        $champs = pipeline('pre_insertion',
                array(
                        'args' => array(
diff --git a/www/plugins/menus_1/action/generer_menus.php b/www/plugins/menus_1/action/generer_menus.php
new file mode 100644 (file)
index 0000000..3a2ea8d
--- /dev/null
@@ -0,0 +1,29 @@
+<?php 
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function action_generer_menus_dist($arg=null) {
+       include_spip('menus_fonctions');
+       include_spip('action/editer_objet');
+       
+       if (is_null($arg)) {
+               $securiser_action = charger_fonction('securiser_action', 'inc');
+               $arg = $securiser_action();
+       }
+       
+       $identifiant = trim($arg);
+       $menus_utiles = menus_utiles();
+       
+       // S'il y a un identifiant précis on ne garde que celui-là
+       if ($identifiant) {
+               $menus_utiles = array_intersect_key($menus_utiles, array($identifiant => 'oui'));
+       }
+       
+       // Pour chaque menu qui reste, on le génère
+       foreach ($menus_utiles as $identifiant => $titre) {
+               objet_inserer('menu', 0, array('identifiant' => $identifiant, 'titre' => $titre));
+       }
+}
index eeaa285..1c78444 100644 (file)
@@ -40,6 +40,7 @@
 .formulaire_spip ul.menus_entrees .titre{
        font-weight:bold;
        line-height:29px;
+       min-height:2em; /* si jamais une entrée est vide/ne contient qu'un seul espace, permet de faire apparaître les boutons admin pour la supprimer */
 }
 .formulaire_spip ul.menus_entrees .infos{
        font-size:0.9em;
index 55e1a0c..ffaa984 100644 (file)
@@ -8,11 +8,11 @@
                        parametre : url d'action ]
                        #ACTION_FORMULAIRE{#ENV{action}}
 
-                       <ul>
+                       <ul class="editer-groupe">
                                <li class="fieldset">
                                        <fieldset>
                                                <h3 class="legend"><:menus:formulaire_partie_identification:></h3>
-                                               <ul>
+                                               <ul class="editer-groupe">
                                                        #SET{obli,'obligatoire'}
                                                        #SET{name,titre}
                                                        #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
                </div></form>
                ]
 </div>
+[(#REM) quand le formulaire n'est pas nouveau, on masque le bouton pour ne pas confuser avec les second formulaire en
+dessous qui permet d'editer les entrees]
+[(#ENV{nouveau}|non)
 <script type="text/javascript">
-       $(function(){
-               $('.formulaire_#ENV{form}'+' .boutons').hide();
-               $('.formulaire_#ENV{form}'+' input')
-                       .change(function(){$('.formulaire_#ENV{form}'+' .boutons').slideDown();})
-                       .keydown(function(){$('.formulaire_#ENV{form}'+' .boutons').slideDown();});
-       });
-</script>
\ No newline at end of file
+jQuery(function(){
+       jQuery('.formulaire_#ENV{form}'+' .boutons').hide();
+       jQuery('.formulaire_#ENV{form}'+' input')
+               .change(function(){jQuery('.formulaire_#ENV{form}'+' .boutons').slideDown();})
+               .keydown(function(){jQuery('.formulaire_#ENV{form}'+' .boutons').slideDown();});
+});
+</script>
+]
\ No newline at end of file
index 66e43b7..897d406 100644 (file)
@@ -61,6 +61,8 @@ function formulaires_editer_menu_charger($id_menu, $nouveau){
                        $contexte['_action'] = array('editer_menu', $id_menu);
                        // On sait toujours si on est sur un menu déjà créé ou pas
                        $contexte['_hidden'] .= '<input type="hidden" name="id_menu" value="'.$id_menu.'" />';
+                       // reinjecter nouveau si besoin, sinon la page de l'espace prive ne reaffiche pas le form
+                       $contexte['_hidden'] .= "<input type='hidden' name='nouveau' value='".($nouveau?'oui':'')."' />";
                }
        }
        else{
@@ -81,10 +83,10 @@ function formulaires_editer_menu_verifier($id_menu, $nouveau){
        $identifiant = _request('identifiant');
 
        // On vérifie que l'identifiant est bon
-       if (!$erreurs['identifiant'] and !preg_match('/^[\w]+$/', $identifiant))
+       if (empty($erreurs['identifiant']) and !preg_match('/^[\w-]+$/', $identifiant))
                $erreurs['identifiant'] = _T('menus:erreur_identifiant_forme');
        // On vérifie que l'identifiant n'est pas déjà utilisé
-       if (!$erreurs['identifiant']){
+       if (empty($erreurs['identifiant'])) {
                $deja = sql_getfetsel(
                        'id_menu',
                        'spip_menus',
index 5c5b3a1..806a7a9 100644 (file)
@@ -9,7 +9,7 @@
                parametre : url d'action ]
                #ACTION_FORMULAIRE{#ENV{action}}
 
-               <ul>
+               <ul class="editer-groupe">
                        <li class="fieldset">
                                <fieldset>
                                        <h3 class="legend"><:menus:formulaire_partie_construction:></h3>
@@ -25,7 +25,7 @@
 </div>
 
 <script type="text/javascript">
-       $(function(){
+       (function($){
                $('.entree .actions').hide();
                $('.entree .ligne')
                        .hover(
@@ -36,5 +36,5 @@
                                        $(this).find('.actions').hide();
                                }
                        );
-       });
-</script>
\ No newline at end of file
+       })(jQuery);
+</script>
index 474976c..bde8b15 100644 (file)
@@ -33,6 +33,17 @@ function formulaires_editer_menus_entree_charger($id_menu,$id_menus_entree='new'
        // On sait toujours si on est sur un menu déjà créé ou pas
        $valeurs['_hidden'] .= '<input type="hidden" name="id_menu" value="'.$id_menu.'" />';
 
+       // les valeurs retournées par _verifier
+       $valeurs['entrees'] = '';
+       $valeurs['donnees'] = '';
+       $valeurs['id_menus_entree'] = '';
+       $valeurs['type'] = '';
+       $valeurs['type_entree'] = '';
+       if( $type_entree = _request('type_entree') ) {
+               $valeurs['infos_' . $type_entree] = '';
+       }
+
+
        return $valeurs;
 }
 
@@ -45,20 +56,20 @@ function formulaires_editer_menus_entree_verifier($id_menu,$id_menus_entree='new
                // S'il n'y a pas encore de type d'entree de choisi
                if (!($type_entree = _request('type_entree'))){
                        include_spip('inc/config');
-                       $erreurs['id_menu_nouvelle_entree'] = $id_menu;
+                       set_request('id_menu_nouvelle_entree', $id_menu);
                        // On charge les différents types d'entrées disponibles
                        $masque = array_flip(lire_config('menus/entrees_masquees', array()));
-                       $erreurs['entrees'] = array_diff_key(menus_lister_disponibles(), $masque);
+                       set_request('entrees', array_diff_key(menus_lister_disponibles(), $masque));
                        if (_request('suivant'))
-                               $erreurs['type'] = _T('menus:erreur_type_menu');
+                               $erreur['type'] = _T('menus:erreur_type_menu');
                }
                // Si on a choisi un type d'entree
                else{
-                       $erreurs['id_menu_nouvelle_entree'] = $id_menu;
-                       $erreurs['type_entree'] = $type_entree;
+                       set_request('id_menu_nouvelle_entree', $id_menu);
+                       set_request('type_entree', $type_entree);
                        // On charge les infos du type choisi
                        $entrees = menus_lister_disponibles();
-                       $erreurs['infos_'.$type_entree] = $entrees[$type_entree];
+                       set_request('infos_'.$type_entree, $entrees[$type_entree]);
                }
        }
 
@@ -74,12 +85,12 @@ function formulaires_editer_menus_entree_verifier($id_menu,$id_menus_entree='new
                $type_entree = $entree['type_entree'];
                $parametres = unserialize($entree['parametres']);
 
-               $erreurs = array_merge($erreurs, $parametres);
-               $erreurs['id_menus_entree'] = $id_menus_entree;
-               $erreurs['type_entree'] = $type_entree;
+               set_request('donnees', $parametres);
+               set_request('id_menus_entree', $id_menus_entree);
+               set_request('type_entree', $type_entree);
                // On charge les infos du type choisi
                $entrees = menus_lister_disponibles();
-               $erreurs['infos_'.$type_entree] = $entrees[$type_entree];
+               set_request('infos_'.$type_entree, $entrees[$type_entree]);
        }
 
        // Si on valide une entree pour un menu ------------------------------------
@@ -94,11 +105,11 @@ function formulaires_editer_menus_entree_verifier($id_menu,$id_menus_entree='new
                        if ($parametre['obligatoire']){
                                if (!$parametres_envoyes[$nom]){
                                        if ($id_menu)
-                                               $erreurs['id_menu_nouvelle_entree'] = $id_menu;
+                                               set_request('id_menu_nouvelle_entree', $id_menu);
                                        if ($id_menus_entree)
-                                               $erreurs['id_menus_entree'] = $id_menus_entree;
-                                       $erreurs['type_entree'] = $type_entree;
-                                       $erreurs['infos_'.$type_entree] = $infos;
+                                               set_request('id_menus_entree', $id_menus_entree);
+                                       set_request('type_entree', $type_entree);
+                                       set_request('infos_'.$type_entree, $infos);
                                        $erreurs['parametres'][$nom] = _T('info_obligatoire');
                                }
                        }
@@ -115,6 +126,8 @@ function formulaires_editer_menus_entree_traiter($id_menu,$id_menus_entree='new'
 
        if (($id_menu = intval(_request('id_menu_nouvelle_entree')) or $id_menus_entree = intval(_request('id_menus_entree'))) and _request('enregistrer')){
                $res = formulaires_editer_objet_traiter('menus_entree', $id_menus_entree, 0, 0, '', '', '', '');
+               set_request('id_menu_nouvelle_entree', '');
+               set_request('id_menus_entree', '');
                if (!$res['id_menus_entree'])
                        $retours['message_erreur'] = _T('menus:erreur_mise_a_jour');
        }
@@ -244,6 +257,12 @@ function formulaires_editer_menus_entree_traiter($id_menu,$id_menus_entree='new'
                if ($ok and !$sous_menu) $retours['redirect'] = generer_url_ecrire('menus_tous');
        }
 
+       // Bouton annuler ---------------------------------------------------------
+       
+       if(_request('annuler')){
+               set_request('id_menus_entree', '');
+       }
+       
        $retours['editable'] = true;
 
        return $retours;
index c1a4008..c6969f3 100644 (file)
@@ -1,8 +1,8 @@
 #SET{rang_suivant,1}\r
-<ul id="menu-#ENV{id_menu}" class="menus_entrees">\r
+<ul id="menu-#ENV{id_menu}" class="editer-groupe menus_entrees">\r
        <BOUCLE_entrees(MENUS_ENTREES){id_menu}{par rang}>\r
        <li class="entree"[ style="background-repeat:no-repeat;background-position:5px 10px;background-image:url((#ENV{types_entrees}|table_valeur{#TYPE_ENTREE}|table_valeur{icone}|image_reduire{24}|extraire_attribut{src}))"]>\r
-               <BOUCLE_test_modifier(CONDITION){si #ENV{erreurs}|table_valeur{id_menus_entree}|=={#ID_MENUS_ENTREE}|non}>\r
+               <BOUCLE_test_modifier(CONDITION){si #ENV{id_menus_entree}|=={#ID_MENUS_ENTREE}|non}>\r
                <div class="ligne">\r
                        <div class="description arial2">\r
                                #SET{supprimer_seulement,non}\r
                                </BOUCLE_sous_menu_test>\r
                                [(#GET{supprimer_seulement}|=={non}|oui)\r
                                [(#ENV{types_entrees}|table_valeur{#TYPE_ENTREE}|table_valeur{refuser_sous_menu}|non)\r
-                               <button name="demander_sous_menu" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_ajouter_sous_menu:>">\r
+                               <button type="submit" name="demander_sous_menu" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_ajouter_sous_menu:>">\r
                                        [<img height="24" width="24" src="(#CHEMIN{images/menus-24.png})" alt="" />]\r
                                </button>\r
                                ]]\r
                                <//B_sous_menu_test>\r
                                [(#GET{supprimer_seulement}|=={non}|oui)\r
-                               <button name="modifier_entree" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_modifier_entree:>">\r
+                               <button type="submit" name="modifier_entree" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_modifier_entree:>">\r
                                        [<img height="24" width="24" src="(#CHEMIN{images/menus_action_modifier.png})" alt="" />]\r
                                </button>]\r
-                               <button name="supprimer_entree" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_supprimer_entree:>"\r
-                               onclick="return confirm('<:menus:confirmer_supprimer_entree:>')">\r
+                               <button type="submit" name="supprimer_entree" value="#ID_MENUS_ENTREE" title="<:menus:formulaire_supprimer_entree:>"\r
+                                       onclick="return confirm('<:menus:confirmer_supprimer_entree:>')"\r
+                               >\r
                                        [<img height="24" width="24" src="(#CHEMIN{images/menus_action_supprimer.png})" alt="" />]\r
                                </button>\r
                                [(#GET{supprimer_seulement}|=={non}|oui)\r
-                               <button name="deplacer_entree" value="#ID_MENUS_ENTREE-bas" title="<:menus:formulaire_deplacer_bas:>">\r
+                               <button type="submit" name="deplacer_entree" value="#ID_MENUS_ENTREE-bas" title="<:menus:formulaire_deplacer_bas:>">\r
                                        [<img height="24" width="24" src="(#CHEMIN{images/menus_action_bas.png})" alt="" />]\r
                                </button>]\r
                                [(#GET{supprimer_seulement}|=={non}|oui)\r
-                               <button name="deplacer_entree" value="#ID_MENUS_ENTREE-haut" title="<:menus:formulaire_deplacer_haut:>">\r
+                               <button type="submit" name="deplacer_entree" value="#ID_MENUS_ENTREE-haut" title="<:menus:formulaire_deplacer_haut:>">\r
                                        [<img height="24" width="24" src="(#CHEMIN{images/menus_action_haut.png})" alt="" />]\r
                                </button>]\r
                        </div>\r
        #SET{rang_suivant,(#RANG|plus{1})}\r
        </BOUCLE_entrees>\r
        <li class="editer_entree fieldset">\r
-               #SET{id_menu_nouvelle_entree, (#ENV{erreurs}|table_valeur{id_menu_nouvelle_entree})}\r
-               #SET{type_entree, (#ENV{erreurs}|table_valeur{type_entree})}\r
-\r
+               #SET{id_menu_nouvelle_entree, (#ENV{id_menu_nouvelle_entree})}\r
+               #SET{type_entree, (#ENV{type_entree})}\r
+               \r
                <BOUCLE_pas_demande_entree(CONDITION){si #GET{id_menu_nouvelle_entree}|=={#ENV{id_menu}}|non}>\r
                        <div class="boutons">\r
                        [(#ENV{sous_menu}|non)<span class="image_loading"></span>]\r
-                       [<button type="submit" class="submit link" name="supprimer_menu" value="#ENV{id_menu}">\r
+                       [<button type="submit" class="submit link" name="supprimer_menu" value="#ENV{id_menu}"\r
+                               onclick="return confirm('<:menus:confirmer_supprimer_sous_menu:>')"\r
+                       >\r
                                [<img src="(#CHEMIN{images/menus_action_supprimer.png})" alt="" />]\r
                                (#ENV{sous_menu}|?{<:menus:formulaire_supprimer_sous_menu:>,''})\r
                        </button>]\r
index 5e47a9f..d2ca01d 100644 (file)
@@ -1,9 +1,9 @@
 
-<ul>
-       <li class="editer pleine_largeur editer_type[(#ENV**{erreurs}|table_valeur{type}|oui)erreur]">
+<ul class="editer-groupe">
+       <li class="editer pleine_largeur editer_type[(#ENV{type}|oui)erreur]">
                <label><:menus:entree_choisir:></label>
-               [<span class='erreur_message'>(#ENV**{erreurs}|table_valeur{type})</span>]
-               <BOUCLE_types_entrees(POUR){tableau #ENV{erreurs}|table_valeur{entrees}}{par rang}>
+               [<span class='erreur_message'>(#ENV{type})</span>]
+               <BOUCLE_types_entrees(POUR){tableau #ENV{entrees}}{par rang}>
                <div class="choix menu_#CLE" id="choix_menu_#CLE" style="padding:3px;border-bottom:1px solid #eee;">
                        [(#VALEUR|table_valeur{icone}|image_reduire{24})]
                        <input type="radio" class="radio" name="type_entree" id="#CLE" value="#CLE" style="vertical-align:top;" />
index 5c20913..dcb25d4 100644 (file)
@@ -1,6 +1,6 @@
 
-#SET{type_entree, (#ENV{erreurs}|table_valeur{type_entree})}
-#SET{infos, (#ENV{erreurs}|table_valeur{infos_#GET{type_entree}})}
+#SET{type_entree, (#ENV{type_entree})}
+#SET{infos, (#ENV{infos_#GET{type_entree}})}
 <fieldset>
 <legend class="legend">
        [(#ENV{id_menus_entree}|non)
 </legend>
 <div class="explication">[(#GET{infos}|table_valeur{description})]</div>
 <B_parametres>
-<ul>
+<ul class="editer-groupe">
        <BOUCLE_parametres(POUR){tableau #GET{infos}|table_valeur{parametres}}>
        #SET{erreurs,(#ENV**{erreurs}|table_valeur{parametres}|table_valeur{#CLE})}
        <li class="editer editer_texte[ (#GET{erreurs}|oui)erreur]">
                <label for="#CLE">[(#VALEUR|table_valeur{label})] [(#VALEUR|table_valeur{obligatoire}|non)&#91;<:menus:formulaire_facultatif:>&#93;]</label>
                [<span class='erreur_message'>(#GET{erreurs})</span>]
-               <input type="text" class="text[ (#VALEUR|table_valeur{class})]" name="parametres[#CLE]" value="[(#ENV{parametres}|table_valeur{#CLE}|sinon{#ENV{erreurs}|table_valeur{#CLE}}|entites_html)]" />
+               <input type="text" class="text[ (#VALEUR|table_valeur{class})]" name="parametres[#CLE]" value="[(#ENV{parametres}|table_valeur{#CLE}|sinon{#ENV{donnees}|table_valeur{#CLE}}|attribut_html)]" />
        </li>
        </BOUCLE_parametres>
 </ul>
@@ -32,7 +32,7 @@
                <input type="hidden" name="id_menus_entree" value="#ENV{id_menus_entree}" />
        ]
        <input type="hidden" name="type_entree" value="#GET{type_entree}" />
-       <input type="submit" class="submit link" value="<:bouton_annuler:>" />
+       <input type="submit" class="submit link" name="annuler" value="<:bouton_annuler:>" />
        <input type="submit" class="submit" name="enregistrer" value="<:bouton_enregistrer:>" />
 </p>
 </fieldset>
diff --git a/www/plugins/menus_1/images/menus_rechercher.png b/www/plugins/menus_1/images/menus_rechercher.png
new file mode 100755 (executable)
index 0000000..276be77
Binary files /dev/null and b/www/plugins/menus_1/images/menus_rechercher.png differ
index ac7e6ad..16793b7 100644 (file)
@@ -88,8 +88,7 @@ function menus_charger_infos($type, $info=""){
                        if (count($xml['entree'])){
                                $xml = reset($xml['entree']);
                                $entree['nom'] = _T_ou_typo(spip_xml_aplatit($xml['nom']));
-                               $entree['rang'] = intval(trim(spip_xml_aplatit($xml['rang'])));
-                               $entree['rang'] = ($entree['rang'] ? $entree['rang'] : 1000);
+                               $entree['rang'] = intval(trim(spip_xml_aplatit(!empty($xml['rang']) ? $xml['rang'] : 1000)));
                                $entree['description'] = isset($xml['description']) ? _T_ou_typo(spip_xml_aplatit($xml['description'])) : '';
                                $entree['icone'] = isset($xml['icone']) ? find_in_path(reset($xml['icone'])) : '';
                                $entree['refuser_sous_menu'] = isset($xml['refuser_sous_menu']);
index 94ca237..5e043ac 100644 (file)
@@ -1,40 +1,46 @@
 <traduction module="menus" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/menus/trunk/lang/" reference="fr">
-       <langue code="ar" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ar" total="145" traduits="76" relire="0" modifs="0" nouveaux="69" pourcent="52.41">
+       <langue code="ar" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ar" total="150" traduits="76" relire="0" modifs="0" nouveaux="74" pourcent="50.67">
                <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
        </langue>
-       <langue code="ca" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ca" total="145" traduits="81" relire="0" modifs="2" nouveaux="62" pourcent="55.86">
+       <langue code="ca" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ca" total="150" traduits="81" relire="0" modifs="2" nouveaux="67" pourcent="54.00">
        </langue>
-       <langue code="de" url="http://trad.spip.net/tradlang_module/menus?lang_cible=de" total="145" traduits="139" relire="0" modifs="2" nouveaux="4" pourcent="95.86">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/menus?lang_cible=de" total="150" traduits="145" relire="0" modifs="0" nouveaux="5" pourcent="96.67">
                <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/menus?lang_cible=en" total="145" traduits="145" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/menus?lang_cible=en" total="150" traduits="145" relire="0" modifs="0" nouveaux="5" pourcent="96.67">
+               <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="kent1" lien="" />
                <traducteur nom="Mark" lien="http://trad.spip.net/auteur/mark" />
                <traducteur nom="RastaPopoulos" lien="" />
                <traducteur nom="Suske" lien="http://trad.spip.net/auteur/suske" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/menus?lang_cible=es" total="145" traduits="141" relire="0" modifs="2" nouveaux="2" pourcent="97.24">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/menus?lang_cible=es" total="150" traduits="145" relire="0" modifs="0" nouveaux="5" pourcent="96.67">
                <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" />
                <traducteur nom="tin" lien="http://trad.spip.net/auteur/tin" />
        </langue>
-       <langue code="fa" url="http://trad.spip.net/tradlang_module/menus?lang_cible=fa" total="145" traduits="136" relire="0" modifs="3" nouveaux="6" pourcent="93.79">
+       <langue code="fa" url="http://trad.spip.net/tradlang_module/menus?lang_cible=fa" total="150" traduits="135" relire="0" modifs="4" nouveaux="11" pourcent="90.00">
                <traducteur nom="Davood Hossein" lien="http://trad.spip.net/auteur/davood-hossein" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/menus?lang_cible=fr" total="145" traduits="145" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/menus?lang_cible=fr" total="150" traduits="150" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="it" url="http://trad.spip.net/tradlang_module/menus?lang_cible=it" total="145" traduits="81" relire="0" modifs="2" nouveaux="62" pourcent="55.86">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/menus?lang_cible=it" total="150" traduits="81" relire="0" modifs="2" nouveaux="67" pourcent="54.00">
        </langue>
-       <langue code="nl" url="http://trad.spip.net/tradlang_module/menus?lang_cible=nl" total="145" traduits="145" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/menus?lang_cible=nl" total="150" traduits="150" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="mpossoz" lien="http://trad.spip.net/auteur/mpossoz" />
                <traducteur nom="Suske" lien="http://trad.spip.net/auteur/suske" />
        </langue>
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ru" total="145" traduits="46" relire="0" modifs="1" nouveaux="98" pourcent="31.72">
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/menus?lang_cible=pt_br" total="150" traduits="150" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="placido" lien="http://trad.spip.net/auteur/placido" />
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/menus?lang_cible=ru" total="150" traduits="46" relire="0" modifs="1" nouveaux="103" pourcent="30.67">
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/menus?lang_cible=sk" total="145" traduits="141" relire="0" modifs="2" nouveaux="2" pourcent="97.24">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/menus?lang_cible=sk" total="150" traduits="145" relire="0" modifs="0" nouveaux="5" pourcent="96.67">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
index 331959b..da20aa6 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -97,5 +99,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => 'كل المقالات',
        'toutes_les_rubriques' => 'كل الأقسام'
 );
-
-?>
index ffc71c4..5e7a721 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=ca
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -100,5 +102,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nom_menu_rubriques_evenements' => 'Esdeveniments de les seccions',
        'nom_menu_secteurlangue' => 'Sectors de llengua'
 );
-
-?>
index e28ae80..5b945ae 100644 (file)
@@ -3,11 +3,15 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // C
+       'configurer_entrees_masquees_explication' => 'Wählen sie die Eingabefelder, die sie beim Anlegen eines Menus <strong>nicht</strong> anzeigen wollen.',
+       'configurer_titre' => 'Konfiguration der Eingabefelder des Plugins Menus',
        'confirmer_supprimer_entree' => 'Wollen sie diesen Eintrag wirklich löschen?',
 
        // D
@@ -36,7 +40,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_afficher_articles' => 'Artikel in das Menü einbeziehen? ("oui" eintragen wenn gewünscht)',
        'entree_afficher_item_suite' => 'Artikel in das Menü einbeziehen? ("oui" eintragen wenn gewünscht)',
        'entree_articles_max' => 'Wenn ja, Artikel nur anzeigen, wenn die Rubrik maximal xx Artikel enthält. (Obergrenze eintragen, leer lassen um alle anzuzeigen)',
-       'entree_articles_max_affiches' => 'Wenn ja, Anzahl der angezeigten Artikel auf xx begrenzen; weitere werden durch den Eintrag "... alle Artikel" ersetzt. (Obergrenze eintragen, leer lassen um alle anzuzeigen)', # MODIF
+       'entree_articles_max_affiches' => 'Mamximale Anzahl der angezeigte Artikel (mit der Möglchkeit "Alle Artikel" anzuzeigen)',
        'entree_aucun' => 'Keiner',
        'entree_bloc' => 'ZPIP Block',
        'entree_choisir' => 'Wählen sie die Art EIntrag, die sie hinzufügen wollen:',
@@ -59,7 +63,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_nombre_articles' => 'Maximale Anzahl Artikel (Standardwert 0)',
        'entree_page' => 'Name der Seite',
        'entree_parametres' => 'Parameterliste',
-       'entree_rubriques_max_affichees' => 'Wenn definiert, dann wird die Zahl der gelisteten Rubriken auf xx begrenzt und von einem Eintrag "... alle Rubriken" abgeschlossen. Obergrenze eintragen oder leer lassen, wenn alle angezeigt werden sollen.', # MODIF
+       'entree_rubriques_max_affichees' => 'Maximale Anzahl der angezeigten Rubriken (mit der Möglichkeit "alle Rubriken" anzuzeigen)',
        'entree_sousrub_cond' => 'Nur Unterrubriken der aktuellen Rubrik anzeigen ("oui" eintragen, falls nicht gewünscht leer lassen)',
        'entree_suivant_connexion' => 'Verhalten des Eintrags in Abhängigkeit vom Verbindungsstatus: Geben Sie "connecte" ein, wenn der Eintrag nur nach dem Einloggen angezeigt werden soll, "deconnecte" nur wenn der Nutzner nicht eingeloggt ist, "admin", wenn der Autor Administrator ist, oder lassen sie das Feld frei, um den Eintrag immer anzuzeigen.',
        'entree_suivant_connexion_connecte' => 'nur wenn verbunden',
@@ -72,6 +76,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_prive' => 'Titel für den Redaktionszugang',
        'entree_traduction_articles_rubriques' => 'Wenn möglich Artikel der Rubrik in der Sprache des Kontext anzeigen ("oui" eintragen wenn gewünscht)',
        'entree_traduction_objet' => 'Übersetzung von Artikeln in Abhängigkeit vom Sprachkontext auswählen (für diese EInstellung "trad" eintragen)',
+       'entree_tri' => 'Kriterium für die Sortierung von Rubriken ("titre" zur alphabetischen Sortierung, "num titre" zur Sortierung nach der Titelnummer, ein " !" voranstellen um die Reihenfolge umzudrehen)',
+       'entree_tri_articles' => 'Kriterium für die Sortierung von Artikeln ("titre" zur alphabetischen Sortierung, "num titre" zur Sortierung nach der Titelnummer, ein " !" voranstellen um die Reihenfolge umzudrehen)',
        'entree_type_objet' => 'Objekttyp',
        'entree_url' => 'Adresse',
        'entree_url_public' => 'Zieladresse nach der Anmeldung',
@@ -162,5 +168,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => '... alle Artikel',
        'toutes_les_rubriques' => '... alle Rubriken'
 );
-
-?>
index a2864d9..be464e8 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -73,7 +75,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_connecter' => 'The title for accessing the identification form',
        'entree_titre_prive' => 'The title for accessing the private zone',
        'entree_traduction_articles_rubriques' => 'If possible, show the articles of the section in the language of the context (put "trad" for this)',
-       'entree_traduction_objet' => 'For an article, select the translation depending on the context (insert "trad" to accomplish this)',
+       'entree_traduction_objet' => 'Select the translation depending on the context (insert "trad" to accomplish this)',
        'entree_tri' => 'Sort order for sections ("titre" to sort by title, "num titre" to sort by the title number, prefix with an " !"for a reversed sorting)',
        'entree_tri_articles' => 'Sort order for articles ("titre" to sort by title, "num titre" to sort by the title number, prefix with an " !"for a reversed sorting)',
        'entree_type_objet' => 'Object type',
@@ -166,5 +168,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => '... All articles',
        'toutes_les_rubriques' => '... All sections'
 );
-
-?>
index 8bbad6b..398ac97 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -38,7 +40,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_afficher_articles' => 'Incluir los artículos en en el menú ? (escribe "oui" para para que ocurra)',
        'entree_afficher_item_suite' => 'Incluir los artículos en el menu ? (escribe "oui" para esto)',
        'entree_articles_max' => 'Si es así, ¿ver los artículos sólo si la sección contiene como máximo xx artículos? (indicar el máximo número de artículos, o bien dejar en blanco para mostrar todos los artículos)',
-       'entree_articles_max_affiches' => 'Si es así, ¿limitar el número de artículos listados en xx máximo (seguidos de un ítem "... Todos los artículos", con un enlace a la sección padre)? (Indique el número máximo de artículos, dejar en blanco para mostrar todos los artículos)', # MODIF
+       'entree_articles_max_affiches' => 'Número máximo de artículos listados (seguidos de un enlace "... Todos los artículos", hacia la sección madre)',
        'entree_aucun' => 'Ninguno',
        'entree_bloc' => 'Bloquear Zpip',
        'entree_choisir' => 'Seleccione el tipo de entrada que desea añadir:',
@@ -61,7 +63,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_nombre_articles' => 'Número de artículos como máximo (0 por defecto)',
        'entree_page' => 'Nombre de la página',
        'entree_parametres' => 'Lista de parámetros',
-       'entree_rubriques_max_affichees' => 'Si es así, limitar el número de secciones listadas a xx máximo (seguido por una entrada "... Todos las secciones" con un enlace a la sección padre)? (Especifique el número máximo de secciones, dejar en blanco para mostrarlas todas)', # MODIF
+       'entree_rubriques_max_affichees' => 'Número máximo de secciones listadas (seguidas de un enlace "... Todas las secciones", hacia la sección madre)',
        'entree_sousrub_cond' => 'Mostrar sólo subcategorías de la sección actual (poner "oui", de lo contrario dejar en blanco)',
        'entree_suivant_connexion' => 'Restringir esta entrada según el estado de conexión (poner "connecte" para mostrar sólo si el visitante está conectado, "deconnecte" para el caso contrario, poner "admin" si el autor es administrador o dejar en blanco para mostrar siempre)',
        'entree_suivant_connexion_connecte' => 'sólo si conectado',
@@ -73,7 +75,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_connecter' => 'Título para acceder al formulario de identificación',
        'entree_titre_prive' => 'Título para acceder al espacio privado',
        'entree_traduction_articles_rubriques' => 'Siempre que sea posible, ver los artículos en la categoría en el idioma del contexto (poner "trad" para esto)',
-       'entree_traduction_objet' => 'En el caso de un artículo, seleccione la traducción en función del contexto (poner "trad" para esto)',
+       'entree_traduction_objet' => 'Elegir la traducción en función del contexto (poner "trad" para esto)',
+       'entree_tri' => 'Criterio de orden de las secciones ("titre" para ordenar por título, "num titre" para ordenar por número de título, si se prefija con un "!" se invierte el orden)',
+       'entree_tri_articles' => 'Criterio de orden de los artículos ("titre" para ordenar por título, "num titre" para ordenar por número de título, si se prefija con un "!" se invierte el orden)',
        'entree_type_objet' => 'Tipo de objeto',
        'entree_url' => 'Dirección',
        'entree_url_public' => 'Dirección de retorno luego de la conexión',
@@ -164,5 +168,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => '... Todos los artículos',
        'toutes_les_rubriques' => '... Todas las secciones'
 );
-
-?>
index a29eccf..2c40393 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -80,7 +82,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_connecter' => 'تيتر براي دستيابي به فرم شناسايي',
        'entree_titre_prive' => 'تيتر براي دسترسي به قسمت شخصي',
        'entree_traduction_articles_rubriques' => 'در صورت امكان، نمايش مقاله‌هاي اين بخش به زبان متن («ترجمه» (trad) را براي اينكار بگذاريد)',
-       'entree_traduction_objet' => 'در مور مقاله، ترجمه را در ارتباط با آن متن انتخاب كنيد (براي آن trad را بگذاريد)',
+       'entree_traduction_objet' => 'در مور مقاله، ترجمه را در ارتباط با آن متن انتخاب كنيد (براي آن trad را بگذاريد)', # MODIF
        'entree_type_objet' => 'نوع اوبژه',
        'entree_url' => 'نشاني (يو.آر.ال) سايت شما',
        'entree_url_public' => 'نشاني بازگشت بعد از اتصال ',
@@ -172,5 +174,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => '...تمام مقاله‌ها',
        'toutes_les_rubriques' => '...تمام بخش‌ها'
 );
-
-?>
index de6733b..fb41cbb 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/menus/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,6 +11,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'configurer_entrees_masquees_explication' => 'Cochez les entrées que vous souhaitez <strong>masquer</strong> lors de la création d’un menu.',
        'configurer_titre' => 'Configurer les entrées du plugin Menus',
        'confirmer_supprimer_entree' => 'Voulez-vous vraiment supprimer cette entrée ?',
+       'confirmer_supprimer_sous_menu' => 'Voulez-vous vraiment supprimer ce sous-menu ?',
 
        // D
        'description_menu_accueil' => 'Lien vers la page d’accueil du site.',
@@ -71,7 +74,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_connecter' => 'Titre pour l’accès au formulaire d’identification',
        'entree_titre_prive' => 'Titre pour accéder à l’espace privé',
        'entree_traduction_articles_rubriques' => 'Dans la mesure du possible, afficher les articles de la rubrique dans la langue du contexte (mettre "trad" pour cela)',
-       'entree_traduction_objet' => 'Dans le cas d’un article, choisir la traduction en fonction du contexte (mettre "trad" pour cela)',
+       'entree_traduction_objet' => 'Choisir la traduction en fonction du contexte (mettre "trad" pour cela)',
        'entree_tri' => 'Critère de tri des rubriques ("titre" pour trier par titre, "num titre" pour trier par numéro de titre, préfixer par un " !" pour inverser l’ordre)',
        'entree_tri_articles' => 'Critère de tri des articles ("titre" pour trier par titre, "num titre" pour trier par numéro de titre, préfixer par un " !" pour inverser l’ordre)',
        'entree_type_objet' => 'Type de l’objet',
@@ -162,7 +165,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // T
        'tous_les_articles' => '... Tous les articles',
-       'toutes_les_rubriques' => '... Toutes les rubriques'
-);
+       'toutes_les_rubriques' => '... Toutes les rubriques',
 
-?>
+       // U
+       'utiles_explication' => 'Les squelettes actuels du site peuvent utiliser les menus suivants.',
+       'utiles_generer_menu' => 'Créer le menu <strong>@titre@ (<em>@identifiant@</em>)</strong>',
+       'utiles_generer_menus' => 'Créer <strong>tous</strong> les menus utiles',
+       'utiles_titre' => 'Menus utiles'
+);
index 20f1c4f..5f62022 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -100,5 +102,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nom_menu_rubriques_evenements' => 'Eventi delle rubriche',
        'nom_menu_secteurlangue' => 'Settore di lingua'
 );
-
-?>
index 84b616a..7e1c34c 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,6 +13,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'configurer_entrees_masquees_explication' => 'Geef aan welke items je wilt <strong>verbergen</strong> bij het aanmaken van een menu.',
        'configurer_titre' => 'Configureer de items van plugin Menus',
        'confirmer_supprimer_entree' => 'Wil je deze regel inderdaad verwijderen?',
+       'confirmer_supprimer_sous_menu' => 'Wil je dit submenu echt verwijderen?',
 
        // D
        'description_menu_accueil' => 'Link naar de startpagina van de site.',
@@ -164,7 +167,11 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // T
        'tous_les_articles' => '... Alle artikelen',
-       'toutes_les_rubriques' => '... Alle rubrieken'
-);
+       'toutes_les_rubriques' => '... Alle rubrieken',
 
-?>
+       // U
+       'utiles_explication' => 'De huidige skeletten van de site mogen de volgende menu’s gebruiken.',
+       'utiles_generer_menu' => 'Het menu <strong>@titre@ (<em>@identifiant@</em>)</strong> maken',
+       'utiles_generer_menus' => 'Maak <strong>alle</strong> menu’s bruikbaar',
+       'utiles_titre' => 'Bruikbare menu’s'
+);
diff --git a/www/plugins/menus_1/lang/menus_pt_br.php b/www/plugins/menus_1/lang/menus_pt_br.php
new file mode 100644 (file)
index 0000000..84ed712
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'configurer_entrees_masquees_explication' => 'Selecione as entradas que você quer <strong> esconder</strong> na criação de um menu.',
+       'configurer_titre' => 'Configurar as entradas do plugin Menus',
+       'confirmer_supprimer_entree' => 'Deseja realmente excluir essa entrada ?',
+       'confirmer_supprimer_sous_menu' => 'Você quer realmente excluir este submenu?',
+
+       // D
+       'description_menu_accueil' => 'Link até a página inicial do site.',
+       'description_menu_articles_rubrique' => 'Exibi a liste das matérias duma seção.',
+       'description_menu_deconnecter' => 'Si o visitante esta conectado, inclui uma entrada para se desconectar.',
+       'description_menu_espace_prive' => 'Link permitindo de se conectar no site (si a gente não já) e depois de acessar a área privada, si autorizado.',
+       'description_menu_groupes_mots' => 'Exibi automaticamente um menu listando as palavras do grupo e as matérias vinculadas. O valor padrão exibi a lista dos grupos de palavras e as palavras vinculadas. Si existe um template groupes_mots.html, o link até o grupo será utilizado.',
+       'description_menu_lien' => 'Inclui qualquer link, interno (URL relativo) ou externo (http://...).',
+       'description_menu_mapage' => 'Si o visitante esta conectado, inclui um link até sua página pessoal.',
+       'description_menu_mots' => 'Exibi automaticamente um menu listando as matérias vinculadas no palavra-chave.',
+       'description_menu_objet' => 'Crie um link até um objeto de SPIP : matéria, seção ou outro. O valor padrão do nome da entrada é o título do objeto.',
+       'description_menu_page_speciale' => 'Inclui um link até uma  página template acessível através um endereço (URL) do tipo <code>spip.php?page=nom&param1=xx&param2=yyy...</code>. Essas páginas template são entregadas geralmente com cada plugin.',
+       'description_menu_page_speciale_zajax' => 'Inclui um link até um bloco duma página acessível através um endereço (URL) do tipo <code>spip.php?page=nom&param1=xx&param2=yyy...</code>. Precisa dum template de tipo Z e do plugin <a href="http://contrib.spip.net/MediaBox">Mediabox</a>.',
+       'description_menu_rubriques_articles' => 'Exibi uma lista de seções, e si você quiser, as subseções e matérias através vários níveis. O valor padrão exibi todas as seções desde a raiz, classificadas por título (numericamente e depois alfabeticamente). As matérias estão armazenadas sistematicamente depois as seções. ',
+       'description_menu_rubriques_completes' => 'Exibi uma lista de seções, e si você quiser, as subseções e matérias através vários níveis. O valor padrão exibi todas as seções desde a raiz, classificadas por título (numericamente e depois alfabeticamente).',
+       'description_menu_secteurlangue' => 'Essa entrada é dedicada pelos sites utilizando um setor por idioma. Ela exibi automaticamente um menu com as seções do setor correspondente a idioma da página, e, si você quiser, pode exibir as subseções no vários níveis. O valor padrão exibi todas as seções desde a raiz, classificadas por título (numericamente e depois alfabeticamente). ',
+       'description_menu_texte_libre' => 'Simplismente o texto que você deseja, ou um código de lingua SPIP (<: ... :>)',
+
+       // E
+       'editer_menus_editer' => 'Alterar esse menu',
+       'editer_menus_explication' => 'Crie et configure os menus do seu site.',
+       'editer_menus_exporter' => 'Exportar esse menu',
+       'editer_menus_nouveau' => 'Criar um novo menu',
+       'editer_menus_titre' => 'Menus do site',
+       'entree_afficher_articles' => 'Incluir as matérias no menu? (colocar "oui" para fazer isso)',
+       'entree_afficher_item_suite' => 'Incluir as matérias no menu? (colocar "oui" para fazer isso)',
+       'entree_articles_max' => 'Si sim, exibir as matérias somente si a seção tem no máximo xx matérias. (colocar a quantidade máxima de matérias, ou deixar vazio par exibir todas as matérias)',
+       'entree_articles_max_affiches' => 'Quantidade máxima de matérias exibidas ( seguidas dum link "... Todas as matérias" até a seção parente)',
+       'entree_aucun' => 'Nenhum',
+       'entree_bloc' => 'Bloco Zpip',
+       'entree_choisir' => 'Escolhe o tipo de entrada que você quer incluir:',
+       'entree_classe_parent' => 'Classe dos links dos elementos parentes. Essa classe será incluída nos li>a que têm ul/li dentro eles.  ',
+       'entree_connexion_objet' => 'Obrigar a estar conectado (colocar "session") ou desconectado (colocar "nosession") por ver o objeto',
+       'entree_contenu' => 'Conteúdo',
+       'entree_css' => 'Classes CSS da entrada (do container)',
+       'entree_css_lien' => 'Classes CSS do link',
+       'entree_id_groupe' => 'Número do grupo de palavras-chaves',
+       'entree_id_mot' => 'Numéro da palavra-chave',
+       'entree_id_objet' => 'Número',
+       'entree_id_rubrique' => 'Número da seção parente',
+       'entree_id_rubrique_ou_courante' => 'Número da seção parente ou em andamento,  si a seção parente é a seção em andament do contexto',
+       'entree_id_rubriques_exclues' => 'Números das seções para retirada, separadas com vírgulas',
+       'entree_id_secteur_exclus' => 'Números dos setores para retirada, separados com vírgulas',
+       'entree_infini' => 'Sem fim',
+       'entree_mapage' => 'Minha página pessoal',
+       'entree_masquer_articles_uniques' => 'Si "oui", e si uma seção tem só uma matéria, deveria esconder ? (colocar "oui" para fazer isso)',
+       'entree_niveau' => 'Nível dos subseções',
+       'entree_nombre_articles' => 'Quantidade máxima de matérias (valor padrão 0)',
+       'entree_page' => 'Nome da página',
+       'entree_parametres' => 'Lista dos parâmetros',
+       'entree_rubriques_max_affichees' => 'Quantidade máxima de seções exibidas ( seguidas dum link "... Todas as seções" até a seção parente)',
+       'entree_sousrub_cond' => 'Exibir somente os subseções da seção em andamento (colocar "oui", senão deixar vazio)',
+       'entree_suivant_connexion' => 'Restringir essa entrada em função da conexão (colocar "connecte" para exibir somente si o visitante esta desconectado, "deconnecte" no caso contrario, ou deixar vazio para sempre exibir)',
+       'entree_suivant_connexion_connecte' => 'somente si conectado',
+       'entree_suivant_connexion_deconnecte' => 'somente si conectado',
+       'entree_sur_n_articles' => '@n@ matérias exibidas',
+       'entree_sur_n_mots' => '@n@ palavra(s) exhibida(s)',
+       'entree_sur_n_niveaux' => 'Em @n@ nivel(s)',
+       'entree_titre' => 'Título',
+       'entree_titre_connecter' => 'Título para acessar o formulário de identificação',
+       'entree_titre_prive' => 'Título para acessar a área privada.',
+       'entree_traduction_articles_rubriques' => 'Si possível, exibir as matérias da seção no idioma do contexto (colocar "trad" para fazer isso)',
+       'entree_traduction_objet' => 'Escolher a tradução em função do contexto (colocar "trad" para isso)',
+       'entree_tri' => 'Critério de triagem das seções ("titre" para classificar por título, "num titre" para classificar por números de título (prefixar com " !" para inverter a ordem)',
+       'entree_tri_articles' => 'Critério de triagem das matérias ("titre" para classificar por título, "num titre" para classificar por números de título, prefixar com " !" para inverter a ordem)',
+       'entree_type_objet' => 'Tipo do objeto',
+       'entree_url' => 'Endereço',
+       'entree_url_public' => 'Endereço para voltar depois a conexão',
+       'erreur_aucun_type' => 'Nenhum tipo de entrada foi achado.',
+       'erreur_autorisation' => 'Você não esta autorizado para alterar os menus.',
+       'erreur_identifiant_deja' => 'Esse nome já é utilizado para um outro menu.',
+       'erreur_identifiant_forme' => 'O nome só pode conter letras, números e traços',
+       'erreur_menu_inexistant' => 'O menu pedido número @id@ não existe.',
+       'erreur_mise_a_jour' => 'Um erro ocorreu durante a atualização do banco de dados.',
+       'erreur_parametres' => 'Tem um erro nos parâmetros da página',
+       'erreur_type_menu' => 'Você deve escolher um tipo de menu',
+       'erreur_type_menu_inexistant' => 'Esse tipo de menu não é, ou não esta mais disponível.',
+
+       // F
+       'formulaire_ajouter_entree' => 'Incluir uma entrada',
+       'formulaire_ajouter_sous_menu' => 'Criar um submenu',
+       'formulaire_css' => 'Classes CSS',
+       'formulaire_css_explication' => 'Você pode incluir no menu eventuais classes CSS suplementares.',
+       'formulaire_deplacer_bas' => 'Mover para baixo',
+       'formulaire_deplacer_haut' => 'Mover para cima',
+       'formulaire_facultatif' => 'Facultativo',
+       'formulaire_identifiant' => 'Nome',
+       'formulaire_identifiant_explication' => 'Coloque uma palavra-chave única para utilizar seu menu facilmente.',
+       'formulaire_ieconfig_choisir_menus_a_importer' => 'Escolhe qual(s) menu(s) você deseja importar.',
+       'formulaire_ieconfig_importer' => 'Importar',
+       'formulaire_ieconfig_menu_meme_identifiant' => 'ATENÇÃO : um menu com esse identificador já existe no seu site !',
+       'formulaire_ieconfig_menus_a_exporter' => 'Menus pela exportação:',
+       'formulaire_ieconfig_ne_pas_importer' => 'Não importar',
+       'formulaire_ieconfig_remplacer' => 'Substituir o menu atual pelo menu importado',
+       'formulaire_ieconfig_renommer' => 'Renomear esse menu antes a importação',
+       'formulaire_importer' => 'Importar um menu',
+       'formulaire_importer_explication' => 'Si você exportou um menu para um arquivo, você pode importar ele agora.',
+       'formulaire_modifier_entree' => 'Alterar essa entrada ',
+       'formulaire_modifier_menu' => 'Altera o menu:',
+       'formulaire_nouveau' => 'Novo menu',
+       'formulaire_partie_construction' => 'Construção do menu',
+       'formulaire_partie_identification' => 'Identificação do menu',
+       'formulaire_supprimer_entree' => 'Excluir essa entrada',
+       'formulaire_supprimer_menu' => 'Excluir esse menu',
+       'formulaire_supprimer_sous_menu' => 'Excluir esse submenu',
+       'formulaire_titre' => 'Título',
+
+       // I
+       'info_afficher_articles' => 'As matérias serão inclusas no menu.',
+       'info_articles_max' => 'Somente si a seção contem no máximo @max@ matérias',
+       'info_articles_max_affiches' => 'Exibição limitada a @max@ matérias',
+       'info_classe_parent' => 'Classe dos elementos parentes:',
+       'info_connexion_obligatoire' => 'Conexão obrigatória',
+       'info_deconnexion_obligatoire' => 'Somente desconectado',
+       'info_masquer_articles_uniques' => 'Matérias únicas escondidas',
+       'info_numero_menu' => 'MENU NÚMERO:',
+       'info_page_speciale' => 'Link até a página «@page@»',
+       'info_page_speciale_zajax' => 'Modalbox da página «@page@» para o bloco  « @bloc@ &#187',
+       'info_rubrique_courante' => 'Seção em andamento',
+       'info_rubriques_exclues' => ' / exceto seção(s) @id_rubriques@',
+       'info_rubriques_max_affichees' => 'Exibição limitada a @max@ seções',
+       'info_secteur_exclus' => ' / exceto sector(es) @id_secteur@',
+       'info_sousrub_cond' => 'Somente as subseções da seção em andamento serão exibidas.',
+       'info_tous_groupes_mots' => 'Todos os grupos de palavras',
+       'info_traduction_recuperee' => 'O contexto decidirá a tradução escolhida',
+       'info_tri' => 'Triagem das seções:',
+       'info_tri_alpha' => '(alfabético)',
+       'info_tri_articles' => 'Triagem das matérias:',
+       'info_tri_num' => '(numérico)',
+
+       // N
+       'noisette_description' => 'Inserir um menu definido com o plugin Menus.',
+       'noisette_label_afficher_titre_menu' => 'Exibir o título do menu?',
+       'noisette_label_identifiant' => 'Menu a exibir:',
+       'noisette_nom_noisette' => 'Menu',
+       'nom_menu_accueil' => 'Página Inicial',
+       'nom_menu_articles_rubrique' => 'Matérias duma seção',
+       'nom_menu_deconnecter' => 'Sair',
+       'nom_menu_espace_prive' => 'Se conectar / link até a área privada',
+       'nom_menu_groupes_mots' => 'Palavras-chaves e Matérias dum Grupo de palavras',
+       'nom_menu_lien' => 'Qualquer link',
+       'nom_menu_mapage' => 'Minha página',
+       'nom_menu_mots' => 'Matérias duma palavra-chave',
+       'nom_menu_objet' => 'Matéria, seção, ou outro objeto SPIP',
+       'nom_menu_page_speciale' => 'Link até um template de página',
+       'nom_menu_page_speciale_zajax' => 'Um bloco duma página Zpip',
+       'nom_menu_rubriques_completes' => 'Lista ou arborescência de seções e de matérias (com muitas opções) ',
+       'nom_menu_rubriques_evenements' => 'Eventos das seções',
+       'nom_menu_secteurlangue' => 'Seções de idioma, situadas na raiz',
+       'nom_menu_texte_libre' => 'Qualquer texto',
+
+       // T
+       'tous_les_articles' => '... Todas as matérias',
+       'toutes_les_rubriques' => '... Todas as seções',
+
+       // U
+       'utiles_explication' => 'Os templates atuais do site podem usar os seguintes menus.',
+       'utiles_generer_menu' => 'Criar o menu <strong>@titre@ (<em>@identifiant@</em>)</strong>',
+       'utiles_generer_menus' => 'Criar <strong>todos</strong> os menus úteis',
+       'utiles_titre' => 'Menus úteis'
+);
index 622c52a..d289761 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -64,5 +66,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nom_menu_accueil' => 'Главная страница',
        'nom_menu_texte_libre' => 'Просто текст'
 );
-
-?>
index a683379..b7bf216 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/menus?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -38,7 +40,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_afficher_articles' => 'Zaradiť články do menu? (na to využite možnosť "áno")',
        'entree_afficher_item_suite' => 'Zaradiť články do menu? (použite na to možnosť "áno")',
        'entree_articles_max' => 'Ak áno, zobraziť články, len ak je v rubrike maximálne xx článkov? (zadajte maximálny počet článkov; ak chcete zobraziť všetky články, nechajte toto pole prázdne)',
-       'entree_articles_max_affiches' => 'Ak áno, obmedziť počet článkov v zozname na maximálne xx (za položkou "...Všetky články" s odkazom na nadradenú rubriku)? (zadajte maximálny počet článkov; ak chcete zobraziť všetky články, nechajte toto pole prázdne)', # MODIF
+       'entree_articles_max_affiches' => 'Maximálny počet zobrazených článkov (v nadradenej rubrike kliknite na odkaz "... Všetky články")',
        'entree_aucun' => 'Žiadny',
        'entree_bloc' => 'Blok Zpipu',
        'entree_choisir' => 'Vyberte typ položky, ktorú chcete pridať:',
@@ -61,7 +63,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_nombre_articles' => 'Maximálny počet článkov (predvolené 0)',
        'entree_page' => 'Názov stránky',
        'entree_parametres' => 'Zoznam parametrov',
-       'entree_rubriques_max_affichees' => 'Ak áno, obmedziť počet rubrík v zozname na maximálne xx (po položke "...Všetky rubriky" s odkazom na nadradenú rubriku)? (zadajte maximálny počet rubrík; ak chcete zobraziť všetky rubriky, nechajte toto pole prázdne)', # MODIF
+       'entree_rubriques_max_affichees' => 'Maximálny počet zobrazených rubrík (v nadradenej rubrike kliknite na odkaz "...Všetky rubriky")',
        'entree_sousrub_cond' => 'Zobrazovať len podrubriky aktuálnej rubriky (zadajte "oui" (áno), v opačnom prípade nevypĺňajte)',
        'entree_suivant_connexion' => 'Obmedziť toto pole podľa prihlásenia  (nastavte "prihlásený" ak chcete zobraziť len návštevníka, ktorý je online; možnosť "odhlásený" v opačnom prípade;  ak autor riadi nejakú rubriku, nastavte pole "administrátor"; ak ho chcete zobraziť v každom prípade, toto pole nevypĺňajte)',
        'entree_suivant_connexion_connecte' => 'len ak je online',
@@ -73,7 +75,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'entree_titre_connecter' => 'Nadpis pre prístup do prihlasovacieho formulára',
        'entree_titre_prive' => 'Nadpis pre prístup do súkromnej zóny',
        'entree_traduction_articles_rubriques' => 'Ak je to možné, zobraziť články rubriky v jazyku textu (na aktiváciu tejto možnosti zadajte "trad")',
-       'entree_traduction_objet' => 'Pri článku vyberajte preklad v závislosti od kontextu (na to, aby se to dosiahli, vložte "trad")',
+       'entree_traduction_objet' => 'Vyberte preklad v kontexte (zadajte "trad")',
+       'entree_tri' => 'Kritérium triedenia rubrík ("nadpis" na zoradenie podľa nadpisu "číslo nadpisu" na zoradenie podľa čísla nadpisu, na prehodenie poradia dajte na začiatok " !")',
+       'entree_tri_articles' => 'Kritérium triedenia článkov ("nadpis" na zoradenie podľa nadpisu "číslo nadpisu" na zoradenie podľa čísla nadpisu, na prehodenie poradia dajte na začiatok " !")',
        'entree_type_objet' => 'Typ objektu',
        'entree_url' => 'Internetová adresa',
        'entree_url_public' => 'Po prihlásení vypísať adresu',
@@ -164,5 +168,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'tous_les_articles' => '... Všetky články',
        'toutes_les_rubriques' => '... Všetky rubriky'
 );
-
-?>
index d03546f..688e764 100644 (file)
@@ -20,6 +20,9 @@
        <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=nl" total="4" traduits="4" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
        </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=pt_br" total="4" traduits="4" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
        <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=sk" total="4" traduits="4" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
index 9370c82..112d5d8 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -18,5 +20,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'إنشاء قوائم شخصية',
        'menus_titre' => 'القوائم'
 );
-
-?>
index ee7d750..78541e0 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -15,5 +17,3 @@ Mit dem Plugin {{Menüs}} können öffentliche Menüs im Redaktionsbereich über
        'menus_slogan' => 'Legen Sie eigene Menüs an',
        'menus_titre' => 'Menüs'
 );
-
-?>
index e5cde92..6018098 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -19,5 +21,3 @@ The purpose of the plugin {{Menus}} is to allow you to create easily menus using
        'menus_slogan' => 'Create your own custom menus.',
        'menus_titre' => 'Menus'
 );
-
-?>
index 42a00c4..fba7de2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -15,5 +17,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'Cree sus menús personalizados.',
        'menus_titre' => 'Menús'
 );
-
-?>
index c83d988..ae9bb8f 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/menus/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -17,5 +19,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'Créez vos menus personnalisés.',
        'menus_titre' => 'Menus'
 );
-
-?>
index de0d52e..ca2ad90 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'Crea i tuoi menù in redazione.',
        'menus_titre' => 'Menù'
 );
-
-?>
index 02b9a0f..c1b9e6b 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -16,5 +18,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'Maak persoonlijke menu’s.',
        'menus_titre' => 'Menus'
 );
-
-?>
diff --git a/www/plugins/menus_1/lang/paquet-menus_pt_br.php b/www/plugins/menus_1/lang/paquet-menus_pt_br.php
new file mode 100644 (file)
index 0000000..bbff2b9
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'menus_description' => 'Quando não se usa o plugin {{Menus}}, é necessário definir todos os seus menus nos templates, fazendo com que os administradores do site que não tenham acesso direto ao código e queiram mudar alguma coisa, sejam forçados a acionar a pessoa encarregada dos templates.
+
+Além disso, quando é necessário criar links estáticos (um link para uma matéria específica, ou para uma página de um site externo), é necessário codificá-los na mão, no template do menu.
+
+O objetivo do plugin {{Menus}} é facilitar a elaboração de menus através de uma interface amigável, diretamente na área privada.
+
+{{Atenção!}} Este plugin não lida com o modo como os menus serão exibidos. Ele permite criá-los facilmente e gerar o código HTML.',
+       'menus_nom' => 'Menus',
+       'menus_slogan' => 'Crie os seus menus personalizados.',
+       'menus_titre' => 'Menus'
+);
index 6a87678..33d4363 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-menus?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -19,5 +21,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'menus_slogan' => 'Vytvorte svoje vlastné ponuky menu.',
        'menus_titre' => 'Ponuky menu'
 );
-
-?>
index ab348b8..d155ff6 100644 (file)
@@ -1,4 +1,4 @@
-#SET{titre, #ENV*{titre}|typo}
+#SET{titre, #ENV*{titre}|_T_ou_typo}
 
 [(#ENV{appel_formulaire}|oui)
        <div class="titre">#GET{titre}</div>
index 9301da6..2e1cbfc 100644 (file)
@@ -9,6 +9,18 @@
 </BOUCLE_art_orig>
 </BOUCLE_si_art>
 
+<BOUCLE_test_tradrub(CONDITION){si #PLUGIN{tradrub}}>
+<BOUCLE_si_rub(CONDITION){si #ENV{type_objet}|=={rubrique}|et{#ENV{trad}|=={trad}}}>
+<BOUCLE_rub_orig(RUBRIQUES){id_rubrique=#ENV{id_objet}}{origine_traduction}>
+<BOUCLE_rub_lang(RUBRIQUES){traduction}{lang=#ENV{lang}}>
+#SET{id_objet,#ID_RUBRIQUE}
+</BOUCLE_rub_lang>
+#SET{id_objet,#ID_RUBRIQUE}
+<//B_rub_lang>
+</BOUCLE_rub_orig>
+</BOUCLE_si_rub>
+</BOUCLE_test_tradrub>
+
 [(#SET{titre, #ENV*{titre}|typo|sinon{#INFO_TITRE{#ENV{type_objet}, #GET{id_objet}}}|sinon{<:info_sans_titre:>}})]
 
 [(#ENV{trad}|=={trad}|et{#ENV{type_objet}|=={article}}|oui)#SET{info_trad,#VAL{menus:info_traduction_recuperee}|_T}]
@@ -32,5 +44,5 @@
 
 [(#ENV{appel_menu}|et{#GET{visible}|=={oui}}|oui)
        <li class="menu-entree item[ (#ENV{css})][ (#ENV{id_objet}|menus_exposer{#ENV{type_objet},#ENV*{env}})]">
-               <a href="#INFO_URL{#ENV{type_objet}, #GET{id_objet}}">#GET{titre}</a>
+               <a href="#INFO_URL{#ENV{type_objet}, #GET{id_objet}}"[ class="(#ENV{css_lien})"]>#GET{titre}</a>
 ]
index 2f716a6..677bc4f 100644 (file)
@@ -7,6 +7,7 @@
        <parametre nom="id_objet" label="menus:entree_id_objet" obligatoire="oui" />
        <parametre nom="titre" class="multilang" label="menus:entree_titre" />
        <parametre nom="css" label="menus:entree_css" />
+       <parametre nom="css_lien" label="menus:entree_css_lien" />
        <parametre nom="connexion" label="menus:entree_connexion_objet" />
        <parametre nom="trad" label="menus:entree_traduction_objet" />
 </entree>
index c592781..52cf26a 100644 (file)
@@ -20,6 +20,6 @@
        <div class="infos"><:menus:info_page_speciale{page=#ENV{nom}}:>[ ((#ENV{suivant_connexion}|?{[(#VAL{menus:entree_suivant_connexion_}|concat{#ENV{suivant_connexion}}|_T)]}))]</div>
 ]
 [(#ENV{appel_menu}|et{#GET{afficher_entree}})
-       <li class="menu-entree item[ (#ENV{css})][(#ENV{env/type-page}|=={#ENV{nom}}|ou{#ENV{env/type}|=={page}|et{#ENV{env/composition}|=={#ENV{nom}}}}) on active]">
+       <li class="menu-entree item[ (#ENV{nom})][ (#ENV{css})][(#ENV{env/type-page}|=={#ENV{nom}}|ou{#ENV{env/type}|=={page}|et{#ENV{env/composition}|=={#ENV{nom}}}}) on active]">
                <a href="#URL_PAGE{#ENV{nom}, #ENV{parametres}}">#GET{titre}</a>
 ]
diff --git a/www/plugins/menus_1/menus/recherche.html b/www/plugins/menus_1/menus/recherche.html
new file mode 100644 (file)
index 0000000..0d70173
--- /dev/null
@@ -0,0 +1,9 @@
+[(#ENV{appel_formulaire}|oui)
+       <div class="titre">Moteur de recherche</div>
+       <div class="infos">Formulaire de recherche SPIP</div>
+]
+
+[(#ENV{appel_menu}|oui)
+       <li class="menu-entree item[ (#ENV{css})]">
+               [(#FORMULAIRE_RECHERCHE)]
+]
diff --git a/www/plugins/menus_1/menus/recherche.xml b/www/plugins/menus_1/menus/recherche.xml
new file mode 100644 (file)
index 0000000..b3e291a
--- /dev/null
@@ -0,0 +1,7 @@
+<entree>
+       <nom>Moteur de recherche</nom>
+       <rang>30</rang>
+       <description>Ajoute le moteur de recherche de SPIP</description>
+       <icone>images/menus_rechercher.png</icone>
+       <parametre nom="css" label="menus:entree_css" />
+</entree>
\ No newline at end of file
index c6c5e7b..247a1ca 100644 (file)
@@ -45,4 +45,20 @@ function menus_critere_tri($tri,$quoi){
        // alpha : on renvoie toujours le meme critre que num si num demande
        // num titre => {par num titre}{par titre}
        return "$inverse$tri";
-}
\ No newline at end of file
+}
+
+/**
+ * Lister les menus utiles qui ne sont pas encore créés
+ **/ 
+function menus_utiles() {
+       if ($menus_utiles = pipeline('menus_utiles', array()) and is_array($menus_utiles)) {
+               foreach ($menus_utiles as $identifiant => $titre) {
+                       // Si le menu existe déjà, on le vire
+                       if (sql_getfetsel('id_menu', 'spip_menus', 'identifiant = '.sql_quote($identifiant))) {
+                               unset($menus_utiles[$identifiant]);
+                       }
+               }
+       }
+       
+       return $menus_utiles;
+}
index f94656f..d6bc84d 100644 (file)
@@ -2,8 +2,23 @@
 \r
 if (!defined("_ECRIRE_INC_VERSION")) return;\r
 \r
+/*\r
+ * function menus_ieconfig_metas\r
+ * Pipeline ieconfig pour l'import/export desmetas du plugin menu\r
+ * \r
+ * @param array $table\r
+ * @return array\r
+ * \r
+ */\r
+function menus_ieconfig_metas($table) {\r
+    $table['menus_meta']['titre'] = _T('paquet-menus:menus_titre');\r
+       $table['menus_meta']['icone'] = 'prive/themes/spip/images/menu-16.png';\r
+       $table['menus_meta']['metas_serialize'] = 'menus';\r
+       return $table;\r
+}\r
+\r
 /**\r
- * Pipeline ieconfig pour l'import/export de configuration\r
+ * Pipeline ieconfig pour l'import/export des menus\r
  *\r
  * @param array $flux\r
  * @return array\r
index a6d027b..bebb1af 100644 (file)
@@ -1,9 +1,9 @@
 <paquet\r
        prefix="menus"\r
        categorie="navigation"\r
-       version="1.5.3"\r
+       version="1.6.4"\r
        etat="stable"\r
-       compatibilite="[3.0.0;3.0.*]"\r
+       compatibilite="[3.0.0;3.1.*]"\r
        logo="prive/themes/spip/images/menu-32.png"\r
        documentation="http://contrib.spip.net/Menus-3139"\r
        schema="0.5.3"\r
        <pipeline nom="declarer_url_objets" inclure="menus_pipelines.php" />\r
        <pipeline nom="autoriser" inclure="inc/menus_autoriser.php" />\r
        <pipeline nom="ieconfig" inclure="menus_ieconfig.php" />\r
+       <pipeline nom="ieconfig_metas" inclure="menus_ieconfig.php" />\r
+       \r
+       <!-- Déclaration des pipelines du plugin -->\r
+       <pipeline nom="menus_utiles" action="" />\r
 \r
        <menu nom="menus_tous" titre="menus:editer_menus_titre" parent="menu_squelette" icone="images/menu-16.png" />\r
 \r
        <!-- pour _T_ou_typo -->\r
        <necessite nom="saisies" compatibilite="[1.14.0;]" />\r
-       \r
+\r
        <utilise nom="Z" />\r
        <utilise nom="Zpip" />\r
        <utilise nom="spipr" />\r
        <utilise nom="spipr_blog" />\r
        <utilise nom="spipr_dist" />\r
        <utilise nom="spipr_doc" />\r
-</paquet>
\ No newline at end of file
+</paquet>\r
index 32c51a6..ae9f965 100644 (file)
@@ -7,8 +7,8 @@
        <BOUCLE_menus_principaux(MENUS){par titre}>
        <li class="item">#SET{auth,#AUTORISER{modifier,menu,#ID_MENU}}
                [(#GET{auth}|oui)<a href="[(#URL_ECRIRE{menus_editer,id_menu=#ID_MENU})]">]#TITRE (#IDENTIFIANT)[(#GET{auth}|oui)</a>]
-               <p class='actions'>
-                       [(#AUTORISER{modifier,menu,#ID_MENU})   <span class='lien_modifier'>&#91;<a href='[(#URL_ECRIRE{menus_editer,id_menu=#ID_MENU})]'><:menus:editer_menus_editer:></a>&#93;</span>]
+               <p class="actions">
+                       [(#AUTORISER{modifier,menu,#ID_MENU})   <span class="lien_modifier">&#91;<a href="[(#URL_ECRIRE{menus_editer,id_menu=#ID_MENU})]"><:menus:editer_menus_editer:></a>&#93;</span>]
                </p>
        </li>
        </BOUCLE_menus_principaux>
 [(#URL_ECRIRE{menus_editer}|parametre_url{nouveau,oui}|icone_verticale{<:menus:editer_menus_nouveau:>,menus-24.png,new,right})]
 
 <div class="nettoyeur"></div>
+
+<B_menus_utiles>
+<h2><:menus:utiles_titre:></h2>
+<p class="explication"><:menus:utiles_explication:></p>
+<ul>
+       <BOUCLE_menus_utiles(DATA){source table,#VAL|menus_utiles}>
+       <li>
+               [(#BOUTON_ACTION{<:menus:utiles_generer_menu{titre=#VALEUR,identifiant=#CLE}:>, #URL_ACTION_AUTEUR{generer_menus, #CLE, #SELF}})]
+       </li>
+       </BOUCLE_menus_utiles>
+       [(#TOTAL_BOUCLE|>{1}|oui)
+       <li class="tous">
+               [(#BOUTON_ACTION{<:menus:utiles_generer_menus:>, #URL_ACTION_AUTEUR{generer_menus, #VAL, #SELF}})]
+       </li>
+       ]
+</ul>
+</B_menus_utiles>
+
+<div class="nettoyeur"></div>
index e4f9326..eaf7fc5 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/menus/trunk
-Revision: 84013
-Dernier commit: 2014-08-04 14:44:56 +0200 
+Revision: 99247
+Dernier commit: 2016-08-26 11:04:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/menus/trunk</origine>
-<revision>84013</revision>
-<commit>2014-08-04 14:44:56 +0200 </commit>
+<revision>99247</revision>
+<commit>2016-08-26 11:04:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
diff --git a/www/plugins/multilang/CHANGELOG.md b/www/plugins/multilang/CHANGELOG.md
new file mode 100644 (file)
index 0000000..12c90d2
--- /dev/null
@@ -0,0 +1,22 @@
+# Multilang
+
+Ce fichier sert de changelog, il liste les modifications lors du changement de version.
+
+## Version 1.2.x
+
+### Version 1.2.1
+
+* ```z-index``` en mode flottant suffisant pour passer au dessus de leaflet sur GIS
+
+### Version 1.2.0
+
+* nettoyage de code (PSR)
+* lors du switch de langue, appliquer la bonne direction sur les textarea et inputs impactés
+* correction du sélecteur par défaut car on n'a plus ```#champ_geocoder``` dans les dernières versions de GIS
+
+## Versions 1.1.x
+
+### Version 1.1.5
+
+* injecter un div si le formulaire est en div
+* ajout d'un changelog
\ No newline at end of file
index caf9a21..bb3253c 100644 (file)
@@ -26,7 +26,7 @@
                                                ]</BOUCLE_objets>\r
                                                [(#SAISIE{oui_non,multilang_public,\r
                                                        label=<:multilang:cfg_lbl_espace_public:>,\r
-                                                       defaut=off})]\r
+                                                       defaut=''})]\r
                                                [(#SAISIE{oui_non,multilang_crayons,\r
                                                        label=<:multilang:cfg_lbl_crayons:>,\r
                                                        explication=<:multilang:cfg_explication_crayons:>,\r
index 78bf5d1..d78ec0e 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function multilang_nommer_langues($langues=array()){
-       if(!is_array($langues) || count($langues) <= 1){
+function multilang_nommer_langues($langues = array()) {
+       if (!is_array($langues) || count($langues) <= 1) {
                return false;
        }
        sort($langues);
@@ -13,4 +15,3 @@ function multilang_nommer_langues($langues=array()){
        }
        return $langues;
 }
-?>
\ No newline at end of file
index 70bb7dc..f6748c2 100644 (file)
Binary files a/www/plugins/multilang/images/background.png and b/www/plugins/multilang/images/background.png differ
index fa5cabd..c06f9d5 100644 (file)
Binary files a/www/plugins/multilang/images/multi_forbidden.png and b/www/plugins/multilang/images/multi_forbidden.png differ
index 1dabe73..35f64b9 100644 (file)
Binary files a/www/plugins/multilang/images/multi_undefined.png and b/www/plugins/multilang/images/multi_undefined.png differ
index 78abc66..d8b0c7f 100644 (file)
Binary files a/www/plugins/multilang/images/multilang-16.png and b/www/plugins/multilang/images/multilang-16.png differ
index 11e6ed4..141333c 100644 (file)
Binary files a/www/plugins/multilang/images/multilang-24.png and b/www/plugins/multilang/images/multilang-24.png differ
index d7b88d0..182f05a 100644 (file)
Binary files a/www/plugins/multilang/images/multilang-32.png and b/www/plugins/multilang/images/multilang-32.png differ
index fc2db8e..fac5fb8 100644 (file)
Binary files a/www/plugins/multilang/images/multilang-48.png and b/www/plugins/multilang/images/multilang-48.png differ
index 72f0fb7..66caef0 100644 (file)
@@ -329,7 +329,7 @@ function multilang_init_field(el,lang,force) {
                        el.multi = true;\r
                        multilang_match_multi.lastIndex=0;\r
                        el.field_lang['full'] = el.value;\r
-                       while((langs=multilang_match_multi.exec(m[2]))!=null) {\r
+                       while((langs=multilang_match_multi.exec(m[2]))!=null && langs[0] != "") {\r
                                var text = langs[2].match(/^(\d+\.\s+)((?:.|\n|\s)*)/), value;\r
                                // Suppression du numero uniquement pour les titres\r
                                if(multilang_is_title(el) && text!=null) {\r
@@ -372,13 +372,19 @@ function multilang_init_field(el,lang,force) {
                if(el.name.match(/^content_[a-z0-9_]+_titre/)){\r
                        if($(el).parent().is('li'))\r
                                $(el).parent()\r
-                                       .before('<li class="editer_'+numid+'"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /></li>');\r
+                                       .before('<li class="editer editer_'+numid+'"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /></li>');\r
                        else\r
                                $(el)\r
-                                       .before('<div class="editer_titre_numero"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /><br /><br /></div>');\r
-               }else\r
+                                       .before('<div class="editer editer_'+numid+'"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /><br /><br /></div>');\r
+               }else{\r
+                       /* Le formalisme des formulaires peut etre en li ou en div (SPIP 3.1) mais on a toujours un conteneur .editer */\r
+                       var tag = 'div';\r
+                       if($(el).parent().is('li')) {\r
+                               tag = 'li';\r
+                       }\r
                        $(el).parent()\r
-                               .before('<li class="editer_'+numid+'"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /></li>');\r
+                               .before('<'+tag+' class="editer editer_'+numid+'"><label for="titre_numero">'+multilang_lang.numero+'</label><input id="'+numid+'" name="titre_numero" type="text" value="'+el.field_pre_lang+'" size="4" class="text nomulti" /></'+tag+'>');\r
+               }\r
                $('#'+numid).totreat = false;\r
        }\r
 }\r
@@ -483,7 +489,7 @@ function multilang_mark_empty_langs(container,target) {
 \r
 /**\r
  * Action au changement de la langue\r
- * Lorsque l'on clique sur une le menu de langue\r
+ * Lorsque l'on clique sur le menu de langue\r
  * On affiche pour le champ "el" son contenu dans la langue "lang"\r
  *\r
  * @param el Un champ du formulaire (input ou textarea)\r
@@ -502,7 +508,7 @@ function multilang_set_lang(el,lang) {
        el.value = (el.field_lang[lang] == undefined ? "" : el.field_lang[lang]);\r
 \r
        el.titre_el.html(el.value);\r
-\r
+       \r
        multilang_field_set_background(el,lang);\r
 }\r
 \r
@@ -518,33 +524,35 @@ function multilang_set_lang(el,lang) {
 function multilang_field_set_background(el,lang) {\r
        if(lang != 'full'){\r
                if(el.totreat){\r
-                       $(el).removeAttr('readonly').removeClass('multilang_readonly');\r
+                       $(el).removeAttr('readonly').removeClass('multilang_readonly').removeClass('multilang_ltr').removeClass('multilang_rtl');\r
                        if(typeof($(el).attr('class')) != 'undefined'){\r
                                $($(el).attr('class').split(' ')).each(function(){\r
                                        var m = this.match(/^multi_lang_*/);\r
-                                       if(m!=null)\r
-                                               $(el).removeClass(m.input).addClass('multi_lang_'+lang);\r
+                                       if(m!=null) {\r
+                                               $(el).removeClass(m.input).removeClass('multilang_ltr').removeClass('multilang_rtl').addClass('multi_lang_'+lang).addClass('multi_lang_'+multilang_dir_langs[lang]).attr('dir',multilang_dir_langs[lang]);\r
+                                       }\r
                                });\r
                        }\r
-                       $(el).addClass('multi_lang_'+(el.multi?lang:'no_multi'));\r
+                       $(el).addClass('multi_lang_'+(el.multi?lang:'no_multi')).addClass('multi_lang_'+multilang_dir_langs[lang]).attr('dir',multilang_dir_langs[lang]);\r
                }\r
                else{\r
                        if(typeof($(el).attr('class')) != 'undefined'){\r
                                $($(el).attr('class').split(' ')).each(function(){\r
                                        var m = this.match(/^multi_lang_*/);\r
                                        if(m!=null)\r
-                                               $(el).removeClass(m.input);\r
+                                               $(el).removeClass(m.input).removeClass('multilang_ltr').removeClass('multilang_rtl');\r
                                });\r
                        }\r
-                       $(el).css({"background":"url("+multilang_dir_plugin+"/images/multi_forbidden.png) no-repeat right top"});\r
+                       align = multilang_dir_langs[lang] ? (multilang_dir_langs[lang] == 'ltr' ? 'right' : 'left') : 'right';\r
+                       $(el).css({"background":"url("+multilang_dir_plugin+"/images/multi_forbidden.png) no-repeat "+align+" top"});\r
                }\r
        }else{\r
-               $(el).attr('readonly','readonly').addClass('multilang_readonly');\r
+               $(el).attr('readonly','readonly').addClass('multilang_readonly').attr('dir','');\r
                if(typeof($(el).attr('class')) != 'undefined'){\r
                        $($(el).attr('class').split(' ')).each(function(){\r
                                var m = this.match(/^multi_lang_*/);\r
                                if(m!=null)\r
-                                       $(el).removeClass(m.input);\r
+                                       $(el).removeClass(m.input).removeClass('multilang_ltr').removeClass('multilang_rtl');\r
                        });\r
                }\r
        }\r
index 19a330b..b00372c 100644 (file)
@@ -1,43 +1,51 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function generer_multilang_init(){
+function generer_multilang_init() {
        $data = '';
-       if(count($langues = explode(',',$GLOBALS["meta"]["langues_multilingue"])) > 1){
+       if (count($langues = explode(',', $GLOBALS['meta']['langues_multilingue'])) > 1) {
                include_spip('inc/config');
-               $config = lire_config('multilang',array());
+               $config = lire_config('multilang', array());
                $root = array();
-               if(isset($config['multilang_public']))
+               if (isset($config['multilang_public'])) {
                        unset($config['multilang_public']);
-               if(isset($config['multilang_crayons']))
+               }
+               if (isset($config['multilang_crayons'])) {
                        unset($config['multilang_crayons']);
-               if(isset($config['siteconfig']) && $config['siteconfig']){
+               }
+               if (isset($config['siteconfig']) && $config['siteconfig']) {
                        $root[] = 'div#configurer-accueil,div.formulaire_configurer_identite' ; // Config Site
                        unset($config['siteconfig']);
                }
-               
-               foreach($config as $conf => $val){
-                       if($val == 'on') {
-                               if($conf == 'document')
-                                       $root[] = 'div#portfolio_portfolio,div#portfolio_documents,div#liste_documents,div.formulaire_editer_document' ;
-                               else
+
+               foreach ($config as $conf => $val) {
+                       if ($val == 'on') {
+                               if ($conf == 'document') {
+                                       $root[] = 'div#portfolio_portfolio,div#portfolio_documents,div#liste_documents,div.formulaire_editer_document';
+                               } else {
                                        $root[] .= 'div.formulaire_editer_'.$conf;
+                               }
                                unset($config[$conf]);
                        }
                }
                // Appel de multilang_init_lang si
                // - document.ready
                // - onAjaxLoad (cas des docs et de la configuration du site)
-               if(is_array($langues_config = lire_config('multilang/langues_utilisees','aucune')) && count($langues_config) > 0){
-                       $langues = implode(',',array_intersect($langues,$langues_config));
-               }else{
-                       $langues = implode(',',$langues);
+               if (is_array($langues_config = lire_config('multilang/langues_utilisees', 'aucune')) && count($langues_config) > 0) {
+                       $langues = array_intersect($langues, $langues_config);
+               }
+               $langues_ltr = array();
+               foreach ($langues as $langue) {
+                       $langues_ltr[$langue] = lang_dir($langue);
                }
                $data = '
-       var multilang_avail_langs = "'.$langues.'".split(\',\'),
-       multilang_def_lang = "'.$GLOBALS["meta"]["langue_site"].'",
-       multilang_lang_courante = "'.$GLOBALS["spip_lang"].'",
+       var multilang_avail_langs = "'.implode(',', $langues).'".split(\',\'),
+       multilang_dir_langs = '.json_encode($langues_ltr).',
+       multilang_def_lang = "'.$GLOBALS['meta']['langue_site'].'",
+       multilang_lang_courante = "'.$GLOBALS['spip_lang'].'",
        multilang_dir_plugin = "'._DIR_PLUGIN_MULTILANG.'";
 
        // On trie les langues. Langue de l environnement en premier,
@@ -52,8 +60,8 @@ function generer_multilang_init(){
 
        jQuery(document).ready(function(){
                function multilang_init(){
-                       var root = "'.implode(",",$root).'";
-                       var fields_selector = "textarea:not(textarea#adresses_secondaires,textarea#repetitions),input:text:not(input#new_login,input#email,#titreparent,input.date,input.heure,input#largeur,input#hauteur,.ac_input,#url_syndic,#url_auto,#champ_geocoder,#champ_lat,#champ_lon,#champ_zoom,#places,*.nomulti),.multilang";
+                       var root = "'.implode(',', $root).'";
+                       var fields_selector = "textarea:not(textarea#adresses_secondaires,textarea#repetitions),input:text:not(input#new_login,input#email,#titreparent,input.date,input.heure,input#largeur,input#hauteur,.ac_input,#url_syndic,#url_auto,.rechercher_adresse input,#champ_geocoder,#champ_lat,#champ_lon,#champ_zoom,#places,*.nomulti),.multilang";
                        // on exclue aussi les form d upload (Pour les vignettes de docs, logos...)
                        var forms_selector = "form[class!=\'form_upload\'][class!=\'form_upload_icon\']";
                        // Les div qui ont un formulaire de classe multilang (pour accélérer la recherche dans le DOM,
@@ -61,20 +69,21 @@ function generer_multilang_init(){
                        var root_opt = "form:has(.multilang)";
                        var fields_selector_opt = ".multilang";
                        multilang_init_lang({fields:fields_selector,fields_opt:fields_selector_opt,root:root,root_opt:root_opt,forms:forms_selector});
-                       
+
                        if($(".menu_multilang").length > 0){
                                $(".menu_multilang").each(function(){
                                        var menu_lang = $(this);
                                        $(window).scroll(function() {
-                                               var offset = menu_lang.parents("form").offset();
-                                               var limite_multilang = offset.top;
-                                               var limite_bas = limite_multilang+menu_lang.parents("form").height()-menu_lang.parents("form").find(".boutons").height();
-                                               var pos_bas = menu_lang.offset().top+menu_lang.height();
+                                               var offset = menu_lang.parents("form").offset(),
+                                                       limite_multilang = offset.top;
+                                                       limite_bas = limite_multilang+menu_lang.parents("form").height()-menu_lang.parents("form").find(".boutons").height(),
+                                                       pos_bas = menu_lang.offset().top+menu_lang.height();
                                                if(($(window).scrollTop() >= limite_multilang) && (pos_bas <= limite_bas) && ($(window).scrollTop() < limite_bas)){
-                                                       if(!menu_lang.hasClass("menu_lang_flottant"))
+                                                       if(!menu_lang.hasClass("menu_lang_flottant")) {
                                                                menu_lang.addClass("menu_lang_flottant");
+                                                       }
                                                        var menu_lang_width = menu_lang.width();
-                                                       menu_lang.css({"position": "fixed", "top": 0, "width": menu_lang_width+"px","z-index":"999"});
+                                                       menu_lang.css({"position": "fixed", "top": 0, "width": menu_lang_width+"px","z-index":"1001"});
                                                }
                                                if(($(window).scrollTop() < limite_multilang)||(pos_bas > limite_bas) )
                                                        menu_lang.removeClass("menu_lang_flottant").css({"position": "static", "width": "auto"});
@@ -89,4 +98,3 @@ function generer_multilang_init(){
        }
        return $data;
 }
-?>
\ No newline at end of file
index d505a88..e6f1715 100644 (file)
@@ -1,4 +1,7 @@
 <traduction module="multilang" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/multilang/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/multilang?lang_cible=de" total="19" traduits="19" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/multilang?lang_cible=en" total="19" traduits="19" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        <langue code="nl" url="http://trad.spip.net/tradlang_module/multilang?lang_cible=nl" total="19" traduits="19" 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/multilang?lang_cible=ru" total="19" traduits="19" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
+       </langue>
        <langue code="sk" url="http://trad.spip.net/tradlang_module/multilang?lang_cible=sk" total="19" traduits="19" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
+       <langue code="uk" url="http://trad.spip.net/tradlang_module/multilang?lang_cible=uk" total="19" traduits="19" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
+       </langue>
 </traduction>
diff --git a/www/plugins/multilang/lang/multilang_de.php b/www/plugins/multilang/lang/multilang_de.php
new file mode 100644 (file)
index 0000000..44926e8
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_activer' => 'Multilang im Redaktionssystem aktivieren :',
+       'cfg_boite_multilang' => 'Konfiguration des  Plugins Multilang',
+       'cfg_descr_multilang' => 'Multilang : Plugin zur Verwaltung der multi-Tags',
+       'cfg_effacer' => 'neu starten',
+       'cfg_explication_crayons' => 'Setzt voraus, dass Multilang für den öffentlichen  Bereich der Website aktiviert ist.',
+       'cfg_langues' => 'Verwendete Sprachen',
+       'cfg_lbl_crayons' => 'Multilang für die Stifte verwenden',
+       'cfg_lbl_espace_public' => 'Multilan für den öffentlichen Bereich der Website verwenden',
+       'cfg_lbl_formstables' => 'für Formulare und Tabellen',
+       'cfg_lbl_siteconfig' => 'für die Website-Konfiguration',
+       'cfg_titre_multilang' => 'Multilang',
+       'champ_numero' => 'Nummer',
+       'configuration_multilang' => 'Multilang',
+
+       // E
+       'explication_langues_utilisees' => 'Wähelen Sie die Sprachen für das Menü von Multilang. Wenn Sei keine auswählen, werden alle verwendet.',
+
+       // L
+       'label_langues_utilisees' => 'Von Multilang verwendete Sprachen',
+       'lien_desactiver' => 'Alles',
+       'lien_multi_title' => 'Mehrsprachige Felder in « @lang@ » bearbeiten',
+       'lien_multi_title_sans' => 'Die Version « @lang@ » ist unvollständig. Klicken Sie zum Bearbeiten.',
+
+       // M
+       'message_champs_readonly' => 'Die mehrsprachigen Felder befinden sich im Nur-Lesen-Modus. Wählen Sie eine Sprache, um sie zu ändern.'
+);
index 171f89c..e5ca6e4 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -34,5 +36,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // M
        'message_champs_readonly' => 'The multilingual fields are in read only mode, choose a language to edit them'
 );
-
-?>
index a147e1a..8017083 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -34,5 +36,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // M
        'message_champs_readonly' => 'Los campos multilingües son sólo de lectura, elija un idioma para modificarlos'
 );
-
-?>
index 57c1f12..efbd738 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -35,5 +37,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'message_champs_readonly' => 'ميدان‌هاي چندزبانگي در حالت فقط خواندني هستند، يك زبان را براي ويرايش كردن آن‌ها انتخاب كنيد
 '
 );
-
-?>
index 76dafba..24c78cc 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/multilang/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // M
        'message_champs_readonly' => 'Les champs multilingues sont en lecture seule, choisissez une langue pour les modifier'
 );
-
-?>
index 82a0409..a135e22 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -34,5 +36,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // M
        'message_champs_readonly' => 'De meertalige velden kunnen alleen worden gelezen, kies een taal om ze aan te passen'
 );
-
-?>
diff --git a/www/plugins/multilang/lang/multilang_ru.php b/www/plugins/multilang/lang/multilang_ru.php
new file mode 100644 (file)
index 0000000..854957e
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_activer' => 'Включить MultiLang на странице редактирования:',
+       'cfg_boite_multilang' => 'Конфигурация плагина Multilang',
+       'cfg_descr_multilang' => 'Multilang: Плагин для управления тегами multi (многоязычности)',
+       'cfg_effacer' => 'Повторно инициализировать',
+       'cfg_explication_crayons' => 'Требуется, чтобы многоязычность была активирована в общедоступной области сайта.',
+       'cfg_langues' => 'Используемые языки',
+       'cfg_lbl_crayons' => 'Использовать multilang в crayons',
+       'cfg_lbl_espace_public' => 'Использовать многоязычие в общедоступной области сайта',
+       'cfg_lbl_formstables' => 'формы и таблицы',
+       'cfg_lbl_siteconfig' => 'конфигурации сайта',
+       'cfg_titre_multilang' => 'Multilang',
+       'champ_numero' => 'Номер',
+       'configuration_multilang' => 'Multilang',
+
+       // E
+       'explication_langues_utilisees' => 'Выберите языки для использования в меню MultiLang. Выберите «Нет», чтобы использовать их все. ',
+
+       // L
+       'label_langues_utilisees' => 'Языки, используемые с multilang',
+       'lien_desactiver' => 'Все',
+       'lien_multi_title' => 'Редактировать многоязычные поля в «@lang@»',
+       'lien_multi_title_sans' => 'Версия «@lang@» не полна. Нажмите, чтобы изменить.',
+
+       // M
+       'message_champs_readonly' => 'Многоязычные поля только для чтения, выберите язык, чтобы их изменить'
+);
index 1ff387e..4154450 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -34,5 +36,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // M
        'message_champs_readonly' => 'Viacjazyčné polia sú iba na čítanie, ak ich chcete upraviť, vyberte si jazyk'
 );
-
-?>
diff --git a/www/plugins/multilang/lang/multilang_uk.php b/www/plugins/multilang/lang/multilang_uk.php
new file mode 100644 (file)
index 0000000..c3712ca
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/multilang?lang_cible=uk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_activer' => 'Увімкнути MultiLang на сторінці редагування:',
+       'cfg_boite_multilang' => 'Конфігурація плагіна Multilang',
+       'cfg_descr_multilang' => 'Multilang: Плагін для управління тегами multi (багатомовності)',
+       'cfg_effacer' => 'Повторно ініціювати',
+       'cfg_explication_crayons' => 'Потрібно, щоб багатомовність була активована в загальнодоступній області сайту.',
+       'cfg_langues' => 'Мови, що використовуються',
+       'cfg_lbl_crayons' => 'Використовувати multilang у crayons',
+       'cfg_lbl_espace_public' => 'Використовувати багатомовність в загальнодоступній області сайту',
+       'cfg_lbl_formstables' => 'форми і таблиці',
+       'cfg_lbl_siteconfig' => 'конфігурації сайту',
+       'cfg_titre_multilang' => 'Multilang',
+       'champ_numero' => 'Номер',
+       'configuration_multilang' => 'Multilang',
+
+       // E
+       'explication_langues_utilisees' => 'Виберіть мову для використання в меню MultiLang. Виберіть «Ні», щоб використовувати усі.',
+
+       // L
+       'label_langues_utilisees' => 'Мови, що використовуються з multilang',
+       'lien_desactiver' => 'Усі',
+       'lien_multi_title' => 'Редагувати багатомовні поля в «@lang@»',
+       'lien_multi_title_sans' => 'Версія «@lang@» не є повною. Натисніть, щоб змінити.',
+
+       // M
+       'message_champs_readonly' => 'Багатомовні поля тільки для читання, виберіть мову, щоб їх змінити'
+);
index b1d08dc..c98440d 100644 (file)
@@ -1,4 +1,7 @@
 <traduction module="paquet-multilang" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/multilang/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=de" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=en" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
        <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=es" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
        <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=ru" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
        </langue>
        <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=sk" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
+       <langue code="uk" url="http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=uk" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
+       </langue>
 </traduction>
diff --git a/www/plugins/multilang/lang/paquet-multilang_de.php b/www/plugins/multilang/lang/paquet-multilang_de.php
new file mode 100644 (file)
index 0000000..4c94eb0
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'multilang_description' => 'Dieses Plugin fügt den Formularen der Website ein Sprachmenü im Format <code>[fr] [en] [it]</code> hinzu. Es können die für die Website aktivierten Sprachen ausgewählt werden.',
+       'multilang_slogan' => 'Anzeige der multi-Tags in Menüs einstellen'
+);
index b0b4075..43ec619 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'multilang_description' => 'This plugin adds a language menu like <code>[fr] [en] [it]</code> at the top of each form, depending on the language selected in the site configuration.',
        'multilang_slogan' => 'Control the display of the contents of multi tags with a language menu'
 );
-
-?>
index 80b8115..195cd59 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'multilang_description' => 'Este plugin añade un menú de idiomas del tipo <code>[fr] [en] [it]</code> encima de cada formulario, en función de los idiomas activados en la configuración del sitio.',
        'multilang_slogan' => 'Administrar la muestra del contenido de las etiquetas multi con un menu'
 );
-
-?>
index 494396a..db7bfc6 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/multilang/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'multilang_description' => 'Ce plugin rajoute un menu de langues du type <code>[fr] [en] [it]</code> au-dessus de chaque formulaire, en fonction des langues activées dans la configuration du site.',
        'multilang_slogan' => 'Gérer l’affichage du contenu des tags multi par un menu'
 );
-
-?>
index bc0ab62..617be9a 100644 (file)
@@ -3,12 +3,12 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // M
        'multilang_description' => 'Questo plugin aggiunge un menu di linguaggi di tipo <code>[fr] [it] [it]</code> nella parte superiore di ogni modulo, a seconda della lingua selezionata nella configurazione del sito.'
 );
-
-?>
index 0aa4618..7e1f11c 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'multilang_description' => 'Deze plugin voegt een taalkeuzemenu toe van het type <code>[fr] [en] [nl]</code> bovenaan ieder formulier en gebaseerd op de taalinstellingen van de site.',
        'multilang_slogan' => 'Regel de titels van de labels aan de hand van een menu'
 );
-
-?>
index 5fcec10..54f7818 100644 (file)
@@ -3,13 +3,13 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // M
-       'multilang_description' => 'Этот плагин добавляет языковое меню, в виде <code> [RU] [EN] [IT] </code> в верхней части каждой формы, в зависимости от языка, выбранного в настройках сайта.',
+       'multilang_description' => 'Этот плагин добавляет языковое меню вида <code>[ru] [en] [it]</code> в верхней части каждой формы, в зависимости от языка, выбранного в настройках сайта.',
        'multilang_slogan' => 'Управляет отображением содержимого нескольких тегов языкового меню'
 );
-
-?>
index 5b3da3c..bc4fdc4 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'multilang_description' => 'Tento zásuvný modul pridá jazykové menu <code>[fr] [en] [it]</code> do hornej časti každého formulára podľa aktivovaných jazykov v konfigurácii stránky.',
        'multilang_slogan' => 'Riadiť zobrazenie obsahu kombinovaných tagov podľa menu'
 );
-
-?>
diff --git a/www/plugins/multilang/lang/paquet-multilang_uk.php b/www/plugins/multilang/lang/paquet-multilang_uk.php
new file mode 100644 (file)
index 0000000..428f9bb
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-multilang?lang_cible=uk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'multilang_description' => 'Цей плагін додає мовне меню виду <code>[ru] [en] [uk]</code> у верхній частині кожної форми, відповідно до того, які мови вибрано в налаштуваннях сайту.',
+       'multilang_slogan' => 'Управляє відображенням контенту за допомогою декількох тегів мовного меню'
+);
index 818a87c..80714bb 100644 (file)
        background-position:98% 1px;\r
        background-repeat:no-repeat;\r
        background-image:url([(#VAL{Multi #VALEUR}|image_typo{taille=11,couleur=cccccc}|extraire_attribut{src}|url_absolue)]);\r
-}</BOUCLE_langues>\r
+}\r
+</BOUCLE_langues>\r
+\r
+.multi_lang_rtl {background-position:2% 1px;}\r
 \r
 .multi_lang_no_multi {\r
        background-position:98% 1px;\r
index 7d4660f..590270c 100644 (file)
@@ -1,56 +1,57 @@
-<?php\r
-/**\r
- * Fichier d'installation / upgrade et désinstallation du plugin Multilang\r
- */\r
-\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-/**\r
- * Fonction d'upgrade/maj\r
- * On crée une configuration par défaut\r
- *\r
- * @param string $nom_meta_base_version\r
- * @param string $version_cible\r
- */\r
-function multilang_upgrade($nom_meta_base_version,$version_cible){\r
-\r
-       $maj = array();\r
-       \r
-       $maj['create'] = array(\r
-               array('multilang_creer_config'),\r
-       );\r
-       include_spip('base/upgrade');\r
-       maj_plugin($nom_meta_base_version, $version_cible, $maj);\r
-\r
-}\r
-\r
-function multilang_creer_config(){\r
-       include_spip('inc/config');\r
-               $config = lire_config('multilang');\r
-       if (!is_array($config))\r
-               $config = array();\r
-       $config_defaut = array_merge(array(\r
-                       'siteconfig' => 'on',\r
-                       'article' => '',\r
-                       'breve' => '',\r
-                       'rubrique' => 'on',\r
-                       'auteur' => 'on',\r
-                       'document' => 'on',\r
-                       'motcle' => '',\r
-                       'site' => '',\r
-                       'evenement' => ''\r
-       ), $config);\r
-       ecrire_meta('multilang', serialize($config_defaut));\r
-}\r
-/**\r
- * Fonction de desinstallation\r
- * On efface uniquement la méta d'installation\r
- *\r
- * @param float $nom_meta_base_version\r
- */\r
-function multilang_vider_tables($nom_meta_base_version) {\r
-       effacer_meta('multilang');\r
-       effacer_meta($nom_meta_base_version);\r
-}\r
-\r
-?>
\ No newline at end of file
+<?php
+/**
+ * Fichier d'installation / upgrade et désinstallation du plugin Multilang
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Fonction d'upgrade/maj
+ * On crée une configuration par défaut
+ *
+ * @param string $nom_meta_base_version
+ * @param string $version_cible
+ */
+function multilang_upgrade($nom_meta_base_version, $version_cible) {
+
+       $maj = array();
+
+       $maj['create'] = array(
+               array('multilang_creer_config'),
+       );
+       include_spip('base/upgrade');
+       maj_plugin($nom_meta_base_version, $version_cible, $maj);
+
+}
+
+function multilang_creer_config() {
+       include_spip('inc/config');
+               $config = lire_config('multilang');
+       if (!is_array($config)) {
+               $config = array();
+       }
+       $config_defaut = array_merge(array(
+                       'siteconfig' => 'on',
+                       'article' => '',
+                       'breve' => '',
+                       'rubrique' => 'on',
+                       'auteur' => 'on',
+                       'document' => 'on',
+                       'motcle' => '',
+                       'site' => '',
+                       'evenement' => ''
+       ), $config);
+       ecrire_meta('multilang', serialize($config_defaut));
+}
+/**
+ * Fonction de desinstallation
+ * On efface uniquement la méta d'installation
+ *
+ * @param float $nom_meta_base_version
+ */
+function multilang_vider_tables($nom_meta_base_version) {
+       effacer_meta('multilang');
+       effacer_meta($nom_meta_base_version);
+}
index e4a253b..ef0fd9a 100644 (file)
-<?php\r
-\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-/**\r
- * Insertion dans le pipeline insert_head_css (SPIP)\r
- * si on a configuré multilang pour s'insérer dans l'espace public\r
- *\r
- * @param string $flux Le contenu du head CSS\r
- * @return string $flux Le contenu du head CSS modifié\r
- */\r
-function multilang_insert_head_css($flux){\r
-       if(!function_exists('lire_config'))\r
-               include_spip('inc/config');\r
-       \r
-       $multilang_public = lire_config('multilang/multilang_public','off');\r
-       if($multilang_public == 'on'){\r
-               static $done = false;\r
-               if (!$done) {\r
-                       $done = true;\r
-                       $flux .= '<link rel="stylesheet" href="'.url_absolue(generer_url_public('multilang.css')).'" type="text/css" media="all" />';\r
-               }\r
-       }\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * Insertion dans le pipeline insert_head_prive (SPIP)\r
- * Ajoute css et javascript dans le <head> privé\r
- *\r
- * @param string $flux \r
- *             Le contenu du head\r
- * @return string $flux \r
- *             Le contenu du head modifié\r
- */\r
-function multilang_insert_head_prive($flux){\r
-       if(!function_exists('lire_config'))\r
-               include_spip('inc/config');\r
-       $config = lire_config('multilang',array());\r
-\r
-       $flux .= multilang_inserer_head($config);\r
-\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * Insertion dans le pipeline insert_head (SPIP)\r
- * si on a configuré multilang pour s'insérer dans l'espace public\r
- *\r
- * @param string $flux \r
- *             Le contenu du head\r
- * @return string $flux \r
- *             Le contenu du head modifié\r
- */\r
-function multilang_insert_head($flux){\r
-       if(!function_exists('lire_config'))\r
-               include_spip('inc/config');\r
-       $config = lire_config('multilang',array());\r
-\r
-       if($config['multilang_public'] == 'on'){\r
-               $flux .= multilang_insert_head_css(''); // au cas ou il n'est pas implemente\r
-               $flux .= multilang_inserer_head($config);\r
-       }\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * La fonction de modification du $flux pour l'insertion dans le head qu'il\r
- * soit privé ou public\r
- *\r
- * @param array $config La configuration du plugin\r
- * @return string $data Le contenu textuel qui sera inséré dans le head\r
- */\r
-function multilang_inserer_head($config=array()){\r
-       /**\r
-        * N'activer multilang que si plus d'une langue dans le site\r
-        */\r
-       if(count($langues = explode(',',$GLOBALS["meta"]["langues_multilingue"])) > 1){\r
-               $data = '\r
-<script type="text/javascript" src="'.generer_url_public("multilang.js","lang=".$GLOBALS["spip_lang"]).'"></script>\r
-';\r
-       }\r
-       return $data;\r
-}\r
-\r
-/**\r
- * Insertion dans le pipeline formulaire_traiter (SPIP)\r
- * On purge le cache js à chaque changement de la config de langue\r
- * \r
- * @param $flux array\r
- *             Le contexte du pipeline\r
- * @return $flux array\r
- *             Le contexte du pipeline modifié\r
- */\r
-function multilang_formulaire_traiter($flux){\r
-       if($flux['args']['form'] == 'configurer_multilinguisme'){\r
-               include_spip('inc/invalideur');\r
-               $rep_js = _DIR_VAR.'cache-js/';\r
-               $rep_css = _DIR_VAR.'cache-css/';\r
-               purger_repertoire($rep_js);\r
-               purger_repertoire($rep_css);\r
-               suivre_invalideur('1');\r
-       }\r
-       return $flux;\r
-}\r
-\r
-/**\r
- * Insertion dans le pipeline affichage_final (SPIP)\r
- * \r
- * Sur la page crayons.js, on insère également notre javascript pour être utilisable\r
- * dans les crayons\r
- * \r
- * @param string $flux Le contenu de la page\r
- * @return string $flux Le contenu de la page modifiée \r
- */\r
-function multilang_affichage_final($flux){\r
-       if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'crayons.js' && (count($langues = explode(',',$GLOBALS["meta"]["langues_multilingue"])) > 1)){\r
-               if(!function_exists('lire_config'))\r
-                       include_spip('inc/config');\r
-               $config = lire_config('multilang',array());\r
-\r
-               /**\r
-                * On n'utilise multilang que si l'espace public est activé ainsi que les crayons\r
-                */\r
-               if(($config['multilang_public'] == 'on') && ($config['multilang_crayons'] == 'on')){\r
-                       unset($config['multilang_public']);\r
-                       unset($config['multilang_crayons']);\r
-                       $root = array();\r
-\r
-                       if(isset($config['siteconfig']) && $config['siteconfig']){\r
-                               $root[] = 'input[type=hidden][name*=name_][value|=meta-valeur]';\r
-                               unset($config['siteconfig']);\r
-                       }\r
-\r
-                       foreach($config as $conf => $val){\r
-                               if($conf == 'gis') // Les points gis sont traités bizarrement dans les crayons qui enlèvent purement et simplement leur 's'\r
-                                       $conf = 'gi';\r
-                               if($val == 'on') {\r
-                                       $root[] = 'input[type=hidden][name*=name_][value|='.$conf.']:not(input[value|='.$conf.'-logo]):not(input[value|='.$conf.'-vignette]):not(input[value|='.$conf.'-fichier])';\r
-                                       unset($config[$conf]);\r
-                               }\r
-                       }\r
-                       $texte = '\r
-                               var crayons_multilang_init = function(){\r
-                                       if(typeof(multilang_init_lang) == "function"){\r
-                                               var crayons_root = ".formulaire_spip:has('.implode(",",$root).')",\r
-                                                       fields_selector = "textarea,input:text:not(input.date,input.heure,*.nomulti)",\r
-                                                       forms_selector = "form[class!=\'form_upload\'][class!=\'form_upload_icon\']",\r
-                                                       root_opt = "form:has(.multilang)",\r
-                                                       fields_selector_opt = ".multilang";\r
-                                       multilang_init_lang({fields:fields_selector,fields_opt:fields_selector_opt,root:crayons_root,root_opt:root_opt,forms:forms_selector,init_done:false});\r
-                                       }\r
-                               }\r
-\r
-                               cQuery(document).ready(function(){\r
-                                       if(typeof onAjaxLoad == "function") onAjaxLoad(crayons_multilang_init);\r
-                                       crayons_multilang_init();\r
-                               });';\r
-                       $flux .= $texte;\r
-               }\r
-       }\r
-       return $flux;\r
-}\r
-?>
\ No newline at end of file
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Insertion dans le pipeline insert_head_css (SPIP)
+ * si on a configuré multilang pour s'insérer dans l'espace public
+ *
+ * @param string $flux Le contenu du head CSS
+ * @return string $flux Le contenu du head CSS modifié
+ */
+function multilang_insert_head_css($flux) {
+       if (!function_exists('lire_config')) {
+               include_spip('inc/config');
+       }
+
+       $multilang_public = lire_config('multilang/multilang_public', 'off');
+       if ($multilang_public == 'on') {
+               static $done = false;
+               if (!$done) {
+                       $done = true;
+                       $css = url_absolue(generer_url_public('multilang.css'));
+                       $flux .= '<link rel="stylesheet" href="'.$css.'" type="text/css" media="all" />';
+               }
+       }
+       return $flux;
+}
+
+/**
+ * Insertion dans le pipeline insert_head_prive (SPIP)
+ * Ajoute css et javascript dans le <head> privé
+ *
+ * @param string $flux
+ *             Le contenu du head
+ * @return string $flux
+ *             Le contenu du head modifié
+ */
+function multilang_insert_head_prive($flux) {
+       if (!function_exists('lire_config')) {
+               include_spip('inc/config');
+       }
+       $config = lire_config('multilang', array());
+
+       $flux .= multilang_inserer_head($config);
+
+       return $flux;
+}
+
+/**
+ * Insertion dans le pipeline insert_head (SPIP)
+ * si on a configuré multilang pour s'insérer dans l'espace public
+ *
+ * @param string $flux
+ *             Le contenu du head
+ * @return string $flux
+ *             Le contenu du head modifié
+ */
+function multilang_insert_head($flux) {
+       if (!function_exists('lire_config')) {
+               include_spip('inc/config');
+       }
+       $config = lire_config('multilang', array());
+
+       if (isset($config['multilang_public']) and ($config['multilang_public'] == 'on')) {
+               $flux .= multilang_insert_head_css(''); // au cas ou il n'est pas implemente
+               $flux .= multilang_inserer_head($config);
+       }
+       return $flux;
+}
+
+/**
+ * La fonction de modification du $flux pour l'insertion dans le head qu'il
+ * soit privé ou public
+ *
+ * @param array $config La configuration du plugin
+ * @return string $data Le contenu textuel qui sera inséré dans le head
+ */
+function multilang_inserer_head($config = array()) {
+       /**
+        * N'activer multilang que si plus d'une langue dans le site
+        */
+       if (count(explode(',', $GLOBALS['meta']['langues_multilingue'])) > 1) {
+               $data = '
+<script type="text/javascript" src="'.generer_url_public('multilang.js', 'lang='.$GLOBALS['spip_lang']).'"></script>
+';
+       }
+       return $data;
+}
+
+/**
+ * Insertion dans le pipeline formulaire_traiter (SPIP)
+ * On purge le cache js à chaque changement de la config de langue
+ *
+ * @param $flux array
+ *             Le contexte du pipeline
+ * @return $flux array
+ *             Le contexte du pipeline modifié
+ */
+function multilang_formulaire_traiter($flux) {
+       if ($flux['args']['form'] == 'configurer_multilinguisme') {
+               include_spip('inc/invalideur');
+               $rep_js = _DIR_VAR.'cache-js/';
+               $rep_css = _DIR_VAR.'cache-css/';
+               purger_repertoire($rep_js);
+               purger_repertoire($rep_css);
+               suivre_invalideur('1');
+       }
+       return $flux;
+}
+
+/**
+ * Insertion dans le pipeline affichage_final (SPIP)
+ *
+ * Sur la page crayons.js, on insère également notre javascript pour être utilisable
+ * dans les crayons
+ *
+ * @param string $flux Le contenu de la page
+ * @return string $flux Le contenu de la page modifiée
+ */
+function multilang_affichage_final($flux) {
+       if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'crayons.js'
+               and (count(explode(',', $GLOBALS['meta']['langues_multilingue'])) > 1)) {
+               if (!function_exists('lire_config')) {
+                       include_spip('inc/config');
+               }
+               $config = lire_config('multilang', array());
+
+               /**
+                * On n'utilise multilang que si l'espace public est activé ainsi que les crayons
+                */
+               if (($config['multilang_public'] == 'on') && ($config['multilang_crayons'] == 'on')) {
+                       unset($config['multilang_public']);
+                       unset($config['multilang_crayons']);
+                       $root = array();
+
+                       if (isset($config['siteconfig']) && $config['siteconfig']) {
+                               $root[] = 'input[type=hidden][name*=name_][value|=meta-valeur]';
+                               unset($config['siteconfig']);
+                       }
+
+                       foreach ($config as $conf => $val) {
+                               if ($conf == 'gis') {
+                                       // Les points gis sont traités bizarrement dans les crayons qui enlèvent
+                                       // purement et simplement leur 's'
+                                       $conf = 'gi';
+                               }
+                               if ($val == 'on') {
+                                       $root[] = 'input[type=hidden][name*=name_][value|='.$conf.']:not(input[value|='.$conf.'-logo]):not(input[value|='.$conf.'-vignette]):not(input[value|='.$conf.'-fichier])';
+                                       unset($config[$conf]);
+                               }
+                       }
+                       $texte = '
+                               var crayons_multilang_init = function(){
+                                       if(typeof(multilang_init_lang) == "function"){
+                                               var crayons_root = ".formulaire_spip:has('.implode(',', $root).')",
+                                                       fields_selector = "textarea,input:text:not(input.date,input.heure,*.nomulti)",
+                                                       forms_selector = "form[class!=\'form_upload\'][class!=\'form_upload_icon\']",
+                                                       root_opt = "form:has(.multilang)",
+                                                       fields_selector_opt = ".multilang";
+                                               multilang_init_lang({fields:fields_selector,fields_opt:fields_selector_opt,root:crayons_root,root_opt:root_opt,forms:forms_selector,init_done:false});
+                                       }
+                               }
+
+                               cQuery(document).ready(function(){
+                                       if(typeof onAjaxLoad == "function") onAjaxLoad(crayons_multilang_init);
+                                       crayons_multilang_init();
+                               });';
+                       $flux .= $texte;
+               }
+       }
+       return $flux;
+}
index bc90fe4..4543c52 100644 (file)
@@ -1,9 +1,9 @@
 <paquet
        prefix="multilang"
        categorie="edition"
-       version="1.1.0"
+       version="1.2.1"
        etat="stable"
-       compatibilite="[3.0.0;3.0.*]"
+       compatibilite="[3.0.0;3.1.*]"
        logo="images/multilang-32.png"
        schema="0.1"
        documentation="http://contrib.spip.net/?article3498"
@@ -26,6 +26,6 @@
        
        <menu nom="configurer_multilangue" titre="multilang:configuration_multilang" parent="menu_configuration" icone="images/multilang-16.png" />
        
-       <necessite nom="saisies" compatibilite="[1.1;[" />
-       <utilise nom="crayons" />
+       <necessite nom="saisies" compatibilite="[2.0.3;]" />
+       <utilise nom="crayons" compatibilite="[1.13.0;]" />
 </paquet>
\ No newline at end of file
index 6fe1d00..646b14f 100644 (file)
@@ -63,4 +63,6 @@
        background-position:98% 1px;
        background-repeat:no-repeat;
        background-image:url(#CHEMIN{images/multi_forbidden.png});
-}
\ No newline at end of file
+}
+
+.multi_lang_rtl {background-position:2% 1px;}
\ No newline at end of file
index 955defc..8561156 100644 (file)
Binary files a/www/plugins/multilang/prive/themes/spip/images/multilang-16.png and b/www/plugins/multilang/prive/themes/spip/images/multilang-16.png differ
index 11e6ed4..141333c 100644 (file)
Binary files a/www/plugins/multilang/prive/themes/spip/images/multilang-24.png and b/www/plugins/multilang/prive/themes/spip/images/multilang-24.png differ
index 80b89fa..3fda199 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/multilang/trunk
-Revision: 84640
-Dernier commit: 2014-09-15 05:40:48 +0200 
+Revision: 99302
+Dernier commit: 2016-08-31 11:04:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/multilang/trunk</origine>
-<revision>84640</revision>
-<commit>2014-09-15 05:40:48 +0200 </commit>
+<revision>99302</revision>
+<commit>2016-08-31 11:04:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 6941076..132b626 100644 (file)
 <?php
 
-$GLOBALS["ngrams"]['af'] = array("ie "," di","die","en ","ing","an "," en","van"," va","ng ","te ","n d","ver","er ","e v"," ge"," be","de "," ve","nde"," in"," te","le ","der","ers","et ","oor"," 'n","'n ","at ","eer","ste","ord","aar","sie"," wa","es ","e s","aan"," on","is ","in ","e o","rde","e b","asi","rin","ond","e w","el "," is","and","e e","eid","e d","om ","ke "," om","eri"," wo","e g","r d","ale","wat"," vo","id ","it ","rd "," aa","lik"," we","t d"," op","e t","ngs","se ","end","uit"," st"," le","ens","ter"," re","e a","ies","wor","g v","sta","n s"," na"," pr","n o"," me","al ","of "," vi","erd","lee","e k"," de","ite","erk","ik ","e r","e p","n v","e i","e n","een","eli","wer"," of"," da","tel","nie","ike","s e","taa","ge ","vir","hei","ir ","reg","ede","s v","ur ","pro","ele","ion","wet","e l"," mo","e m","daa","sio","s d"," he"," to","ent","ard","nge"," oo","eur","lle","ien","n b","eke","lin","raa"," ni","ont","bes","rdi","voo","ns ","n a","del","dig","nas"," sa"," gr","nis","kom"," ui","men","op ","ins","ona","ere","s o"," so","n g","ig ","moe"," ko","rs ","ges","nal","vol","e h","geb","rui","ang","ige","oet","ar ","wys","lig","as ","n w"," as","met","gs ","deu","t v","aal","erw","dit","ken","sse","kel"," hu","ewe","din","n t"," se","est","ika","n p","ntw","t i","eni"," ka","n e","doe","ali","eme","gro","nte"," ho","nsi","gen","ier","gew","n h","or "," ma","ind","ne ","ek ","aat","n '"," sk","ide"," ta","dat","ska","ger","soo","n k","s i"," af","tee","nd ","eel","hul","nee","woo","rik","d v","n m","re ","art","ebr","lan","kke","ron","aam","tre","str","kan","ree","lei","t o","gra","het","evo","tan","den","ist"," do","bru","toe","olg","rsk","uik","rwy","min","lge","g e","g o","nst","r v","gte","waa","we ","ans","esi","ese","voe","epa","gel"," hi","vin","nse","s w","s t","tei","eit","pre");
-$GLOBALS["ngrams"]['ar'] = array(" ال","الع","لعر","عرا","راق"," في","في ","ين ","ية ","ن ا","الم","ات ","من ","ي ا"," من","الأ","ة ا","اق "," وا","اء ","الإ"," أن","وال","ما "," عل","لى ","ت ا","ون ","هم ","اقي","ام ","ل ا","أن ","م ا","الت","لا ","الا","ان ","ها ","ال ","ة و","ا ا","رها","لام","يين"," ول","لأم","نا ","على","ن ي","الب","اد ","الق","د ا","ذا ","ه ا"," با","الد","ب ا","مري","لم "," إن"," لل","سلا","أمر","ريك","مة ","ى ا","ا ي"," عن"," هذ","ء ا","ر ا","كان","قتل","إسل","الح","وا "," إل","ا أ","بال","ن م","الس","رة ","لإس","ن و","هاب","ي و","ير "," كا","لة ","يات"," لا","انت","ن أ","يكي","الر","الو","ة ف","دة ","الج","قي ","وي ","الذ","الش","امي","اني","ذه ","عن ","لما","هذه","ول ","اف ","اوي","بري","ة ل"," أم"," لم"," ما","يد "," أي","إره","ع ا","عمل","ولا","إلى","ابي","ن ف","ختط","لك ","نه ","ني ","إن ","دين","ف ا","لذي","ي أ","ي ب"," وأ","ا ع","الخ","تل ","تي ","قد ","لدي"," كل"," مع","اب ","اخت","ار ","الن","علا","م و","مع ","س ا","كل ","لاء","ن ب","ن ت","ي م","عرب","م ب"," وق"," يق","ا ل","ا م","الف","تطا","داد","لمس","له ","هذا"," مح","ؤلا","بي ","ة م","ن ل","هؤل","كن ","لإر","لتي"," أو"," ان"," عم","ا ف","ة أ","طاف","عب ","ل م","ن ع","ور ","يا "," يس","ا ت","ة ب","راء","عال","قوا","قية","لعا","م ي","مي ","مية","نية","أي ","ابا","بغد","بل ","رب ","عما","غدا","مال","ملي","يس "," بأ"," بع"," بغ"," وم","بات","بية","ذلك","عة ","قاو","قيي","كي ","م م","ي ع"," عر"," قا","ا و","رى ","ق ا","وات","وم "," هؤ","ا ب","دام","دي ","رات","شعب","لان","لشع","لقو","ليا","ن ه","ي ت","ي ي"," وه"," يح","جرا","جما","حمد","دم ","كم ","لاو","لره","ماع","ن ق","نة ","هي "," بل"," به"," له"," وي","ا ك","اذا","اع ","ت م","تخا","خاب","ر م","لمت","مسل","ى أ","يست","يطا"," لأ"," لي","أمن","است","بعض","ة ت","ري ","صدا","ق و","قول","مد ","نتخ","نفس","نها","هنا","أعم","أنه","ائن","الآ","الك","حة ","د م","ر ع","ربي");
-$GLOBALS["ngrams"]['az'] = array("lər","in ","ın ","lar","da ","an ","ir ","də ","ki "," bi","ən ","əri","arı","ər ","dir","nda"," ki","rin","nın","əsi","ini"," ed"," qa"," tə"," ba"," ol","ası","ilə","rın"," ya","anı"," və","ndə","ni ","ara","ını","ınd"," bu","si ","ib ","aq ","dən","iya","nə ","rə ","n b","sın","və ","iri","lə ","nin","əli"," de"," mü","bir","n s","ri ","ək "," az"," sə","ar ","bil","zər","bu ","dan","edi","ind","man","un ","ərə"," ha","lan","yyə","iyy"," il"," ne","r k","ə b"," is","na ","nun","ır "," da"," hə","a b","inə","sin","yan","ərb"," də"," mə"," qə","dır","li ","ola","rba","azə","can","lı ","nla"," et"," gö","alı","ayc","bay","eft","ist","n i","nef","tlə","yca","yət","əcə"," la","ild","nı ","tin","ldi","lik","n h","n m","oyu","raq","ya ","əti"," ar","ada","edə","mas","sı ","ına","ə d","ələ","ayı","iyi","lma","mək","n d","ti ","yin","yun","ət ","azı","ft ","i t","lli","n a","ra "," cə"," gə"," ko"," nə"," oy","a d","ana","cək","eyi","ilm","irl","lay","liy","lub","n ə","ril","rlə","unu","ver","ün ","ə o","əni"," he"," ma"," on"," pa","ala","dey","i m","ima","lmə","mət","par","yə ","ətl"," al"," mi"," sa"," əl","adı","akı","and","ard","art","ayi","i a","i q","i y","ili","ill","isə","n o","n q","olu","rla","stə","sə ","tan","tel","yar","ədə"," me"," rə"," ve"," ye","a k","at ","baş","diy","ent","eti","həs","i i","ik ","la ","miş","n n","nu ","qar","ran","tər","xan","ə a","ə g","ə t"," dü","ama","b k","dil","era","etm","i b","kil","mil","n r","qla","r s","ras","siy","son","tim","yer","ə k"," gü"," so"," sö"," te"," xa","ai ","bar","cti","di ","eri","gör","gün","gəl","hbə","ihə","iki","isi","lin","mai","maq","n k","n t","n v","onu","qan","qəz","tə ","xal","yib","yih","zet","zır","ıb ","ə m","əze"," br"," in"," i̇r"," pr"," ta"," to"," üç","a o","ali","ani","anl","aql","azi","bri");
-$GLOBALS["ngrams"]['bg'] = array("на "," на","то "," пр"," за","та "," по","ите","те ","а п","а с"," от","за ","ата","ия "," в ","е н"," да","а н"," се"," ко","да ","от ","ани","пре","не ","ени","о н","ни ","се "," и ","но ","ане","ето","а в","ва ","ван","е п","а о","ото","ран","ат ","ред"," не","а д","и п"," до","про"," съ","ли ","при","ния","ски","тел","а и","по ","ри "," е "," ка","ира","кат","ние","нит","е з","и с","о с","ост","че "," ра","ист","о п"," из"," са","е д","ини","ки ","мин"," ми","а б","ава","е в","ие ","пол","ств","т н"," въ"," ст"," то","аза","е о","ов ","ст ","ът ","и н","ият","нат","ра "," бъ"," че","алн","е с","ен ","ест","и д","лен","нис","о о","ови"," об"," сл","а р","ато","кон","нос","ров","ще "," ре"," с "," сп","ват","еше","и в","иет","о в","ове","ста","а к","а т","дат","ент","ка ","лед","нет","ори","стр","стъ","ти ","тър"," те","а з","а м","ад ","ана","ено","и о","ина","ити","ма ","ска","сле","тво","тер","ция","ят "," бе"," де"," па","ате","вен","ви ","вит","и з","и и","нар","нов","ова","пов","рез","рит","са ","ята"," го"," ще","али","в п","гра","е и","еди","ели","или","каз","кит","лно","мен","оли","раз"," ве"," гр"," им"," ме"," пъ","ави","ако","ача","вин","во ","гов","дан","ди ","до ","ед ","ери","еро","жда","ито","ков","кол","лни","мер","нач","о з","ола","он ","она","пра","рав","рем","сия","сти","т п","тан","ха ","ше ","шен","ълг"," ба"," си","аро","бъл","в р","гар","е е","елн","еме","ико","има","ко ","кои","ла ","лга","о д","ози","оит","под","рес","рие","сто","т к","т м","т с","уст"," би"," дв"," дъ"," ма"," мо"," ни"," ос","ала","анс","ара","ати","аци","беш","вър","е р","едв","ема","жав","и к","иал","ица","иче","кия","лит","о б","ово","оди","ока","пос","род","сед","слу","т и","тов","ува","циа","чес","я з"," во"," ил"," ск"," тр"," це","ами","ари","бат","би ","бра","бъд");
-$GLOBALS["ngrams"]['br'] = array("ar "," a ","en ","an ","et "," ar","ez "," he"," ha"," an","n d"," ho"," da"," va"," eu","ur ","er "," pe"," de","nt "," ma","n e","var"," en"," be"," di"," ch"," e ","eur","ou ","uz ","it ","ho ","z a","he ","da ","a z","n a"," do","oue","ha ","n h"," ne","dou","t a"," ke"," ev","un ","ag ","t e","euz"," me"," ga"," : ","ant"," zo","ll ","ad ","ch ","oun","t h"," la","t d","r a","a d"," ve","r b","ed ","enn","hag"," re","ue ","zo ","a v","ra ","r p","ma "," go","r g","el ","cho","evi","a g","a r","hen","vez","deu","aou","c'h","eo ","z e","ent","z h","che","a b","vit","vel"," dr","eme","eve","r m","our","mp ","e a"," ra"," ka"," pa","omp","han","eun","den","ne ","r h","rou","a e","ist"," gu","d a","o d","uez","gan","az "," tr"," eo","e d","och","ell","e v","or ","va ","on "," br","r v","ro ","ket","ava","all","gou","o e","g a","re ","ude","e e","oud"," se"," ko","z d","eze","tra","lav","e h","kou","oul"," al","r e","lou","ken"," ze","iou","are","ud "," gr","u a","hou","ach","n t"," na","mar","r c","a l","ret","zou"," er","l a","mad","nn ","a c","ze ","oll","a h","r d","l e","ris","e g","per","eza","mez","a n","ech","oua","st ","ont","bed","at "," zi","t m","iz ","za ","bre","d e","o a","o k","hor","d h","rn ","a m","em ","ene"," c'","etr","e k","ara","in "," et","gue","t g","us "," em","e z","t k","cha","na ","ouz","as ","nte","ut "," ou"," ta"," le","ere","red"," ba"," sa","g e","rez","a k","nan"," sk","e m","rei"," te","t p","dre","ele","men","ran","o h","e c","e b","her","tro"," dh","ber","ste","o p","reu"," za","ui ","bar","hon","n n","out","spe","dis","alo","uel","a a","hol","ver","ezo","bez","hoa","i a","tre","ank","gal","kri","bet","ni ","dig","al ","a p","una","r s","env","net","ave","ten"," kr","rea","e p"," hi","tez","ta ","l d","u d","eud","r z","r r","ren");
-$GLOBALS["ngrams"]['ca'] = array(" de","es ","de ","la "," la","el ","que"," el"," co","ent","s d"," qu"," i ","en ","er "," a ","ls ","nt "," pe","e l","a d"," en","per","ci ","ar ","ue ","al "," se","est","at "," es","ts "," s "," pr","aci"," un","res","men","s e","del","s a","s p"," re","les"," l'","na ","a l"," ca"," d'","els","a p","ia ","ns ","con"," le","tat","a c","i d","a a","ra ","a e"," no","ant"," al","t d","s i"," di","ta ","re ","a s","com","s c","ita","ons","sta","ica"," po","r a"," in","pro","tre"," pa","ues","amb","ion","des","un "," ma","da ","s s","a i","an ","mb "," am","l d","e d","va ","pre","ter","e e","e c","a m","cia","una","i e","nci","tra"," te","ona","os ","t e","n e","l c","ca ","cio","l p"," tr","par","r l","t a","e p","aqu","nta"," so","ame","era","r e","e s","ada","n a","s q"," si"," ha","als","tes"," va"," m ","ici","nte","s l","s m","i a","or "," mo","ist","ect","lit","m s"," to","ir ","a t","esp","ran","str","om ","l s","st ","nts"," me","no ","r d","d'a","l'a","ats","ria","s t"," ta","sen","rs ","eix","tar","s n","n l","tal","e a","t p","art"," mi"," ll","tic","ten","ser"," aq","ina","ntr","a f","sti","ol ","a q","for","ura","ers","ari","int","act","l'e"," fi","r s","e t","tor","si ","ste","rec","a r"," fe","is ","em ","n d","car","bre"," fo"," vi"," an","ali","i p","ix ","ell","l m","pos","orm","l l","i l"," ac","fer","s r","ess","eu ","e m","ens","ara","eri","sa ","ssi","us ","ort","tot","ll ","por","ora"," ci","tan","ass","n c","ost","nes","rac","a u","ver","ont","ha "," ti","itz","gra","t c"," n ","a v","ren","cat","nal"," ri","qua","t l"," do","t s","rma","ual","i s","s f","n p","s v","te ","t i"," ba","cte","tam","man","l t","ial"," fa","ic "," ve","ble","a n","all","tza","ies"," s'","le ","omp","r c"," nc","rti","it ","rre","fic","any","on "," sa","r p","tur");
-$GLOBALS["ngrams"]['ceb'] = array("ng ","sa "," sa","ang","ga ","nga"," ka"," ng","an "," an"," na"," ma"," ni","a s","a n","on "," pa"," si","a k","a m"," ba","ong","a i","ila"," mg","mga","a p","iya","a a","ay ","ka ","ala","ing","g m","n s","g n","lan"," gi","na ","ni ","o s","g p","n n"," da","ag ","pag","g s","yan","ayo","o n","si "," mo","a b","g a","ail","g b","han","a d","asu","nag","ya ","man","ne ","pan","kon"," il"," la","aka","ako","ana","bas","ko ","od ","yo "," di"," ko"," ug","a u","g k","kan","la ","len","sur","ug "," ai","apa","aw ","d s","g d","g g","ile","nin"," iy"," su","ene","og ","ot ","aba","aha","as ","imo"," ki","a t","aga","ban","ero","nan","o k","ran","ron","sil","una","usa"," us","a g","ahi","ani","er ","ha ","i a","rer","yon"," pu","ini","nak","ro ","to ","ure"," ed"," og"," wa","ili","mo ","n a","nd ","o a"," ad"," du"," pr","aro","i s","ma ","n m","ulo","und"," ta","ara","asa","ato","awa","dmu","e n","edm","ina","mak","mun","niy","san","wa "," tu"," un","a l","bay","iga","ika","ita","kin","lis","may","os "," ar","ad ","ali","ama","ers","ipa","isa","mao","nim","t s","tin"," ak"," ap"," hi","abo","agp","ano","ata","g i","gan","gka","gpa","i m","iha","k s","law","or ","rs ","siy","tag"," al"," at"," ha"," hu"," im","a h","bu ","e s","gma","kas","lag","mon","nah","ngo","r s","ra ","sab","sam","sul","uba","uha"," lo"," re","ada","aki","aya","bah","ce ","d n","lab","pa ","pak","s n","s s","tan","taw","te ","uma","ura"," in"," lu","a c","abi","at ","awo","bat","dal","dla","ele","g t","g u","gay","go ","hab","hin","i e","i n","kab","kap","lay","lin","nil","pam","pas","pro","pul","ta ","ton","uga","ugm","unt"," co"," gu"," mi"," pi"," ti","a o","abu","adl","ado","agh","agk","ao ","art","bal","cit","di ","dto","dun","ent","g e","gon","gug","ia ","iba","ice","in ","inu","it ","kaa");
-$GLOBALS["ngrams"]['cs'] = array(" pr"," po","ní ","pro"," na","na "," př","ch "," je"," ne","že "," že"," se"," do"," ro"," st"," v "," ve","pře","se ","ho ","sta"," to"," vy"," za","ou "," a ","to "," by","la ","ce ","e v","ist","le ","pod","í p"," vl","e n","e s","je ","ké ","by ","em ","ých"," od","ova","řed","dy ","ení","kon","li ","ně ","str"," zá","ve "," ka"," sv","e p","it ","lád","oho","rov","roz","ter","vlá","ím "," ko","hod","nis","pří","ský"," mi"," ob"," so","a p","ali","bud","edn","ick","kte","ku ","o s","al ","ci ","e t","il ","ny ","né ","odl","ová","rot","sou","ání"," bu"," mo"," o ","ast","byl","de ","ek ","ost"," mí"," ta","es ","jed","ky ","las","m p","nes","ním","ran","rem","ros","ého"," de"," kt"," ni"," si"," vý","at ","jí ","ký ","mi ","pre","tak","tan","y v","řek"," ch"," li"," ná"," pa"," ře","da ","dle","dne","i p","i v","ly ","min","o n","o v","pol","tra","val","vní","ích","ý p","řej"," ce"," kd"," le","a s","a z","cen","e k","eds","ekl","emi","kl ","lat","lo ","mié","nov","pra","sku","ské","sti","tav","ti ","ty ","ván","vé ","y n","y s","í s","í v","ě p"," dn"," ně"," sp"," čs","a n","a t","ak ","dní","doh","e b","e m","ejn","ena","est","ini","m z","nal","nou","ná ","ovi","ové","ový","rsk","stá","tí ","tře","tů ","ude","za ","é p","ém ","í d"," ir"," zv","ale","aně","ave","cké","den","e z","ech","en ","erý","hla","i s","iér","lov","mu ","neb","nic","o b","o m","pad","pot","rav","rop","rý ","sed","si ","t p","tic","tu ","tě ","u p","u v","vá ","výš","zvý","ční","ří ","ům "," bl"," br"," ho"," ja"," re"," s "," z "," zd","a v","ani","ato","bla","bri","ečn","eře","h v","i n","ie ","ila","irs","ite","kov","nos","o o","o p","oce","ody","ohl","oli","ovo","pla","poč","prá","ra ","rit","rod","ry ","sd ","sko","ssd","tel","u s","vat","veř","vit","vla","y p","áln","čss","šen"," al");
-$GLOBALS["ngrams"]['cy'] = array("yn ","dd "," yn"," y ","ydd","eth","th "," i ","aet","d y","ch ","od ","ol ","edd"," ga"," gw","'r ","au ","ddi","ad "," cy"," gy"," ei"," o ","iad","yr ","an ","bod","wed"," bo"," dd","el ","n y"," am","di ","edi","on "," we"," ym"," ar"," rh","odd"," ca"," ma","ael","oed","dae","n a","dda","er ","h y","all","ei "," ll","am ","eu ","fod","fyd","l y","n g","wyn","d a","i g","mae","neu","os "," ne","d i","dod","dol","n c","r h","wyd","wyr","ai ","ar ","in ","rth"," fy"," he"," me"," yr","'n ","dia","est","h c","hai","i d","id ","r y","y b"," dy"," ha","ada","i b","n i","ote","rot","tes","y g","yd "," ad"," mr"," un","cyn","dau","ddy","edo","i c","i w","ith","lae","lla","nd ","oda","ryd","tho"," a "," dr","aid","ain","ddo","dyd","fyn","gyn","hol","io ","o a","wch","wyb","ybo","ych"," br"," by"," di"," fe"," na"," o'"," pe","art","byd","dro","gal","l e","lai","mr ","n n","r a","rhy","wn ","ynn"," on"," r ","cae","d g","d o","d w","gan","gwy","n d","n f","n o","ned","ni ","o'r","r d","ud ","wei","wrt"," an"," cw"," da"," ni"," pa"," pr"," wy","d e","dai","dim","eud","gwa","idd","im ","iri","lwy","n b","nol","r o","rwy"," ch"," er"," fo"," ge"," hy"," i'"," ro"," sa"," tr","bob","cwy","cyf","dio","dyn","eit","hel","hyn","ich","ll ","mdd","n r","ond","pro","r c","r g","red","rha","u a","u c","u y","y c","ymd","ymr","yw "," ac"," be"," bl"," co"," os","adw","ae ","af ","d p","efn","eic","en ","eol","es ","fer","gel","h g","hod","ied","ir ","laf","n h","na ","nyd","odo","ofy","rdd","rie","ros","stw","twy","yda","yng"," at"," de"," go"," id"," oe"," â ","'ch","ac ","ach","ae'","al ","bl ","d c","d l","dan","dde","ddw","dir","dla","ed ","ela","ell","ene","ewn","gyd","hau","hyw","i a","i f","iol","ion","l a","l i","lia","med","mon","n s","no ","obl","ola","ref","rn ","thi","un ");
-$GLOBALS["ngrams"]['da'] = array("er ","en "," de","et ","der","de ","for"," fo"," i ","at "," at","re ","det"," ha","nde","ere","ing","den"," me"," og","ger","ter"," er"," si","and"," af","or "," st"," ti"," en","og ","ar ","il ","r s","ige","til","ke ","r e","af ","kke"," ma"," på","om ","på ","ed ","ge ","end","nge","t s","e s","ler"," sk","els","ern","sig","ne ","lig","r d","ska"," vi","har"," be"," se","an ","ikk","lle","gen","n f","ste","t a","t d","rin"," ik","es ","ng ","ver","r b","sen","ede","men","r i"," he"," et","ig ","lan","med","nd ","rne"," da"," in","e t","mme","und"," om","e e","e m","her","le ","r f","t f","så ","te "," so","ele","t e"," ko","est","ske"," bl","e f","ekt","mar","bru","e a","el ","ers","ret","som","tte","ve "," la"," ud"," ve","age","e d","e h","lse","man","rug","sel","ser"," fi"," op"," pr","dt ","e i","n m","r m"," an"," re"," sa","ion","ner","res","t i","get","n s","one","orb","t h","vis","år "," fr","bil","e k","ens","ind","omm","t m"," hv"," je","dan","ent","fte","nin"," mi","e o","e p","n o","nte"," ku","ell","nas","ore","r h","r k","sta","sto","dag","eri","kun","lde","mer","r a","r v","rek","rer","t o","tor","tør"," få"," må"," to","boe","che","e v","i d","ive","kab","ns ","oel","se ","t v"," al"," bo"," un","ans","dre","ire","køb","ors","ove","ren","t b","ør "," ka","ald","bet","gt ","isk","kal","kom","lev","n d","n i","pri","r p","rbr","søg","tel"," så"," te"," va","al ","dir","eje","fis","gså","isc","jer","ker","ogs","sch","st ","t k","uge"," di","ag ","d a","g i","ill","l a","lsk","n a","on ","sam","str","tet","var"," mo","art","ash","att","e b","han","hav","kla","kon","n t","ned","r o","ra ","rre","ves","vil"," el"," kr"," ov","ann","e u","ess","fra","g a","g d","int","ngs","rde","tra"," år","akt","asi","em ","gel","gym","hol","kan","mna","n h","nsk","old");
-$GLOBALS["ngrams"]['de'] = array("en ","er "," de","der","ie "," di","die","sch","ein","che","ich","den","in ","te ","ch "," ei","ung","n d","nd "," be","ver","es "," zu","eit","gen","und"," un"," au"," in","cht","it ","ten"," da","ent"," ve","and"," ge","ine"," mi","r d","hen","ng ","nde"," vo","e d","ber","men","ei ","mit"," st","ter","ren","t d"," er","ere","n s","ste"," se","e s","ht ","des","ist","ne ","auf","e a","isc","on ","rte"," re"," we","ges","uch"," fü"," so","bei","e e","nen","r s","ach","für","ier","par","ür "," ha","as ","ert"," an"," pa"," sa"," sp"," wi","for","tag","zu ","das","rei","he ","hre","nte","sen","vor"," sc","ech","etz","hei","lan","n a","pd ","st ","sta","ese","lic"," ab"," si","gte"," wa","iti","kei","n e","nge","sei","tra","zen"," im"," la","art","im ","lle","n w","rde","rec","set","str","tei","tte"," ni","e p","ehe","ers","g d","nic","von"," al"," pr","an ","aus","erf","r e","tze","tür","uf ","ag ","als","ar ","chs","end","ge ","ige","ion","ls ","n m","ngs","nis","nt ","ord","s s","sse"," tü","ahl","e b","ede","em ","len","n i","orm","pro","rke","run","s d","wah","wer","ürk"," me","age","att","ell","est","hat","n b","oll","raf","s a","tsc"," es"," fo"," gr"," ja","abe","auc","ben","e n","ege","lie","n u","r v","re ","rit","sag"," am","agt","ahr","bra","de ","erd","her","ite","le ","n p","n v","or ","rbe","rt ","sic","wie","übe"," is"," üb","cha","chi","e f","e m","eri","ied","mme","ner","r a","sti","t a","t s","tis"," ko","arb","ds ","gan","n z","r f","r w","ran","se ","t i","wei","wir"," br"," np","am ","bes","d d","deu","e g","e k","efo","et ","eut","fen","hse","lte","n r","npd","r b","rhe","t w","tz "," fr"," ih"," ke"," ma","ame","ang","d s","eil","el ","era","erh","h d","i d","kan","n f","n l","nts","och","rag","rd ","spd","spr","tio"," ar"," en"," ka","ark","ass");
-$GLOBALS["ngrams"]['en'] = array(" th","the","he ","ed "," to"," in","er ","ing","ng "," an","nd "," of","and","to ","of "," co","at ","on ","in "," a ","d t"," he","e t","ion","es "," re","re ","hat"," sa"," st"," ha","her","tha","tio","or "," ''","en "," wh","e s","ent","n t","s a","as ","for","is ","t t"," be","ld ","e a","rs "," wa","ut ","ve ","ll ","al "," ma","e i"," fo","'s ","an ","est"," hi"," mo"," se"," pr","s t","ate","st ","ter","ere","ted","nt ","ver","d a"," wi","se ","e c","ect","ns "," on","ly ","tol","ey ","r t"," ca","ati","ts ","all"," no","his","s o","ers","con","e o","ear","f t","e w","was","ons","sta","'' ","sti","n a","sto","t h"," we","id ","th "," it","ce "," di","ave","d h","cou","pro","ad ","oll","ry ","d s","e m"," so","ill","cti","te ","tor","eve","g t","it "," ch"," de","hav","oul","ty ","uld","use"," al","are","ch ","me ","out","ove","wit","ys ","chi","t a","ith","oth"," ab"," te"," wo","s s","res","t w","tin","e b","e h","nce","t s","y t","e p","ele","hin","s i","nte"," li","le "," do","aid","hey","ne ","s w"," as"," fr"," tr","end","sai"," el"," ne"," su","'t ","ay ","hou","ive","lec","n't"," ye","but","d o","o t","y o"," ho"," me","be ","cal","e e","had","ple"," at"," bu"," la","d b","s h","say","t i"," ar","e f","ght","hil","igh","int","not","ren"," is"," pa"," sh","ays","com","n s","r a","rin","y a"," un","n c","om ","thi"," mi","by ","d i","e d","e n","t o"," by","e r","eri","old","ome","whe","yea"," gr","ar ","ity","mpl","oun","one","ow ","r s","s f","tat"," ba"," vo","bou","sam","tim","vot","abo","ant","ds ","ial","ine","man","men"," or"," po","amp","can","der","e l","les","ny ","ot ","rec","tes","tho","ica","ild","ir ","nde","ose","ous","pre","ste","era","per","r o","red","rie"," bo"," le","ali","ars","ore","ric","s m","str"," fa","ess","ie ","ist","lat","uri");
-$GLOBALS["ngrams"]['es'] = array(" de","de "," la","os ","la ","el ","es "," qu"," co","e l","as ","que"," el","ue ","en ","ent"," en"," se","nte","res","con","est"," es","s d"," lo"," pr","los"," y ","do ","ón ","ión"," un","ció","del","o d"," po","a d","aci","sta","te ","ado","pre","to ","par","a e","a l","ra ","al ","e e","se ","pro","ar ","ia ","o e"," re","ida","dad","tra","por","s p"," a ","a p","ara","cia"," pa","com","no "," di"," in","ien","n l","ad ","ant","e s","men","a c","on ","un ","las","nci"," tr","cio","ier","nto","tiv","n d","n e","or ","s c","enc","ern","io ","a s","ici","s e"," ma","dos","e a","e c","emp","ica","ivo","l p","n c","r e","ta ","ter","e d","esa","ez ","mpr","o a","s a"," ca"," su","ion"," cu"," ju","an ","da ","ene","ero","na ","rec","ro ","tar"," al"," an","bie","e p","er ","l c","n p","omp","ten"," em","ist","nes","nta","o c","so ","tes","era","l d","l m","les","ntr","o s","ore","rá ","s q","s y","sto","a a","a r","ari","des","e q","ivi","lic","lo ","n a","one","ora","per","pue","r l","re ","ren","una","ía ","ada","cas","ere","ide","min","n s","ndo","ran","rno"," ac"," ex"," go"," no","a t","aba","ble","ece","ect","l a","l g","lid","nsi","ons","rac","rio","str","uer","ust"," ha"," le"," mi"," mu"," ob"," pe"," pu"," so","a i","ale","ca ","cto","e i","e u","eso","fer","fic","gob","jo ","ma ","mpl","o p","obi","s m","sa ","sep","ste","sti","tad","tod","y s"," ci","and","ces","có ","dor","e m","eci","eco","esi","int","iza","l e","lar","mie","ner","orc","rci","ria","tic","tor"," as"," si","ce ","den","e r","e t","end","eri","esp","ial","ido","ina","inc","mit","o l","ome","pli","ras","s t","sid","sup","tab","uen","ues","ura","vo ","vor"," sa"," ti","abl","ali","aso","ast","cor","cti","cue","div","duc","ens","eti","imi","ini","lec","o q","oce","ort","ral","rma","roc","rod");
-$GLOBALS["ngrams"]['et'] = array("st "," ka","on ","ja "," va"," on"," ja"," ko","se ","ast","le ","es ","as ","is ","ud "," sa","da ","ga "," ta","aja","sta"," ku"," pe","a k","est","ist","ks ","ta ","al ","ava","id ","saa","mis","te ","val"," et","nud"," te","inn"," se"," tu","a v","alu","e k","ise","lu ","ma ","mes"," mi","et ","iku","lin","ad ","el ","ime","ne ","nna"," ha"," in"," ke"," võ","a s","a t","ab ","e s","esi"," la"," li","e v","eks","ema","las","les","rju","tle","tsi","tus","upa","use","ust","var"," lä","ali","arj","de ","ete","i t","iga","ilm","kui","li ","tul"," ei"," me"," sõ","aal","ata","dus","ei ","nik","pea","s k","s o","sal","sõn","ter","ul ","või"," el"," ne","a j","ate","end","i k","ita","kar","kor","l o","lt ","maa","oli","sti","vad","ään"," ju"," jä"," kü"," ma"," po"," üt","aas","aks","at ","ed ","eri","hoi","i s","ka ","la ","nni","oid","pai","rit","us ","ütl"," aa"," lo"," to"," ve","a e","ada","aid","ami","and","dla","e j","ega","gi ","gu ","i p","idl","ik ","ini","jup","kal","kas","kes","koh","s e","s p","sel","sse","ui "," pi"," si","aru","eda","eva","fil","i v","ida","ing","lää","me ","na ","nda","nim","ole","ots","ris","s l","sia","t p"," en"," mu"," ol"," põ"," su"," vä"," üh","a l","a p","aga","ale","aps","arv","e a","ela","ika","lle","loo","mal","pet","t k","tee","tis","vat","äne","õnn"," es"," fi"," vi","a i","a o","aab","aap","ala","alt","ama","anu","e p","e t","eal","eli","haa","hin","iva","kon","ku ","lik","lm ","min","n t","odu","oon","psa","ri ","si ","stu","t e","t s","ti ","ule","uur","vas","vee"," ki"," ni"," nä"," ra","aig","aka","all","atu","e e","eis","ers","i e","ii ","iis","il ","ima","its","kka","kuh","l k","lat","maj","ndu","ni ","nii","oma","ool","rso","ru ","rva","s t","sek","son","ste","t m","taj","tam","ude","uho","vai"," ag"," os"," pa"," re");
-$GLOBALS["ngrams"]['eu'] = array("en ","an ","eta","ta "," et","iza","n e","ko ","ide"," ba","a e","giz"," es"," gi","arr","bid","ren","rri","are","la ","sku"," be","asu","esk","sun","tas"," iz","ean","eko","ela","ik ","kub","n a","n i","tza","ubi","za ","zan"," er","a b","ask","era","n b","rre","ten","tze"," as"," ko","a a","a g","ald","ani","de ","dee","ea ","ek ","kat","kon","n d","ont","uan"," du"," na","ata","egi","est","k e","nik","ntu","ntz","ska","tua"," de"," di"," ez"," he","a d","a k","ak ","aki","ako","art","atu","azi","bat","ber","itz","kun","n h","o b","ria","rte","tat","une","zar"," al"," ar"," ha","aku","atz","bai","dar","dea","del","een","ema","err","iak","iar","in ","ina","kia","nar","naz","nea","o e","orr","ra ","ste","tek","zak","zek","zio"," da"," em"," hi"," ho"," ma"," oi","agu","ate","aur","bes","din","dir","dut","ert","ez ","ezi","har","her","hit","ia ","ien","ika","io ","ire","ite","k b","k g","kid","kor","lda","n o","nko","o a","oin","ori","rak","rea","rie","rik","rra","tan","tea","tu ","una","und","unt","urr","ute","z e","zko"," au"," eg"," gu"," ir"," ki"," or","a h","a j","abe","agi","ai ","ail","ait","ape","ari","dez","e e","ear","eek","erd","ere","eza","ezk","gir","git","hor","i e","ian","iek","ila","ink","int","ira","ita","itu","k n","kap","koa","kum","lan","lde","mai","man","men","n g","n u","na ","nta","o h","oa ","oro","pen","rdi","ri ","rta","sta","tel","tet","tik","tue","tzi","ume","un ","uzt","zea","zen","zia","zin"," az"," bi"," bu"," el"," ga"," jo"," mu"," ti"," un"," za"," zi","a n","a o","a s","a t","a z","aba","adi","ake","ala","and","ar ","aud","bak","bal","beg","beh","bul","dau","den","du ","dui","e b","e d","e h","e o","eak","eet","eha","elk","enb","ete","eti","gab","gin","go ","gus","gut","guz","hau","ibe","inb","ine","ioa","iru","iur","izi","izk","izo");
-$GLOBALS["ngrams"]['fa'] = array("ان ","ای ","ه ا"," اي"," در","به "," بر","در ","ران"," به","ی ا","از ","ين ","می "," از","ده ","ست ","است"," اس"," که","که ","اير","ند ","اين"," ها","يرا","ود "," را","های"," خو","ته ","را ","رای","رد ","ن ب","کرد"," و "," کر","ات ","برا","د ک","مان","ی د"," ان","خوا","شور"," با","ن ا"," سا","تمی","ری ","اتم","ا ا","واه"," ات"," عر","اق ","ر م","راق","عرا","ی ب"," تا"," تو","ار ","ر ا","ن م","ه ب","ور ","يد ","ی ک"," ام"," دا"," کن","اهد","هد "," آن"," می"," ني"," گف","د ا","گفت"," کش","ا ب","نی ","ها ","کشو"," رو","ت ک","نيو","ه م","وی ","ی ت"," شو","ال ","دار","مه ","ن ک","ه د","يه "," ما","امه","د ب","زار","ورا","گزا"," پي","آن ","انت","ت ا","فت ","ه ن","ی خ","اما","بات","ما ","ملل","نام","ير ","ی م","ی ه"," آم"," ای"," من","انس","اني","ت د","رده","ساز","ن د","نه ","ورد"," او"," بي"," سو"," شد","اده","اند","با ","ت ب","ر ب","ز ا","زما","سته","ن ر","ه س","وان","وز ","ی ر","ی س"," هس","ابا","ام ","اور","تخا","خاب","خود","د د","دن ","رها","روز","رگز","نتخ","ه ش","ه ه","هست","يت ","يم "," دو"," دي"," مو"," نو"," هم"," کا","اد ","اری","انی","بر ","بود","ت ه","ح ه","حال","رش ","عه ","لی ","وم ","ژان"," سل","آمر","اح ","توس","داد","دام","ر د","ره ","ريک","زی ","سلا","شود","لاح","مري","نند","ه ع","يما","يکا","پيم","گر "," آژ"," ال"," بو"," مق"," مل"," وی","آژا","ازم","ازی","بار","برن","ر آ","ز س","سعه","شته","مات","ن آ","ن پ","نس ","ه گ","وسع","يان","يوم","کا ","کام","کند"," خا"," سر","آور","ارد","اقد","ايم","ايی","برگ","ت ع","تن ","خت ","د و","ر خ","رک ","زير","فته","قدا","ل ت","مين","ن گ","ه آ","ه خ","ه ک","ورک","ويو","يور","يوي","يی ","ک ت","ی ش"," اق"," حا"," حق"," دس"," شک"," عم"," يک","ا ت","ا د","ارج","بين","ت م","ت و","تاي","دست","ر ح","ر س","رنا","ز ب","شکا","لل ","م ک","مز ","ندا","نوا","و ا","وره","ون ","وند","يمز"," آو"," اع"," فر"," مت"," نه"," هر"," وز"," گز");
-$GLOBALS["ngrams"]['fi'] = array("en ","in ","an ","on ","ist","ta ","ja ","n t","sa ","sta","aan","n p"," on","ssa","tta","tä "," ka"," pa","si "," ja","n k","lla","än ","een","n v","ksi","ett","nen","taa","ttä"," va","ill","itt"," jo"," ko","n s"," tu","ia "," su","a p","aa ","la ","lle","n m","le ","tte","na "," ta"," ve","at "," vi","utt"," sa","ise","sen"," ku"," nä"," pä","ste"," ol","a t","ais","maa","ti ","a o","oit","pää"," pi","a v","ala","ine","isi","tel","tti"," si","a k","all","iin","kin","stä","uom","vii"," ma"," se","enä"," mu","a s","est","iss","llä","lok","lä ","n j","n o","toi","ven","ytt"," li","ain","et ","ina","n a","n n","oll","plo","ten","ust","äll","ään"," to","den","men","oki","suo","sä ","tää","uks","vat"," al"," ke"," te","a e","lii","tai","tei","äis","ää "," pl","ell","i t","ide","ikk","ki ","nta","ova","yst","yt ","ä p","äyt"," ha"," pe"," tä","a n","aik","i p","i v","nyt","näy","pal","tee","un "," me","a m","ess","kau","pai","stu","ut ","voi"," et","a h","eis","hte","i o","iik","ita","jou","mis","nin","nut","sia","ssä","van"," ty"," yh","aks","ime","loi","me ","n e","n h","n l","oin","ome","ott","ouk","sit","sti","tet","tie","ukk","ä k"," ra"," ti","aja","asi","ent","iga","iig","ite","jan","kaa","kse","laa","lan","li ","näj","ole","tii","usi","äjä"," ov","a a","ant","ava","ei ","eri","kan","kku","lai","lis","läi","mat","ois","pel","sil","sty","taj","tav","ttu","työ","yös","ä o"," ai"," pu","a j","a l","aal","arv","ass","ien","imi","imm","itä","ka ","kes","kue","lee","lin","llo","one","ri ","t o","t p","tu ","val","vuo"," ei"," he"," hy"," my"," vo","ali","alo","ano","ast","att","auk","eli","ely","hti","ika","ken","kki","lys","min","myö","oht","oma","tus","umi","yks","ät ","ääl","ös "," ar"," eu"," hu"," na","aat","alk","alu","ans","arj","enn","han","kuu","n y","set","sim");
-$GLOBALS["ngrams"]['fr'] = array("es "," de","de "," le","ent","le ","nt ","la ","s d"," la","ion","on ","re "," pa","e l","e d"," l'","e p"," co"," pr","tio","ns "," en","ne ","que","r l","les","ur ","en ","ati","ue "," po"," d'","par"," a ","et ","it "," qu","men","ons","te "," et","t d"," re","des"," un","ie ","s l"," su","pou"," au"," à ","con","er "," no","ait","e c","se ","té ","du "," du"," dé","ce ","e e","is ","n d","s a"," so","e r","e s","our","res","ssi","eur"," se","eme","est","us ","sur","ant","iqu","s p","une","uss","l'a","pro","ter","tre","end","rs "," ce","e a","t p","un "," ma"," ru"," ré","ous","ris","rus","sse","ans","ar ","com","e m","ire","nce","nte","t l"," av"," mo"," te","il ","me ","ont","ten","a p","dan","pas","qui","s e","s s"," in","ist","lle","nou","pré","'un","air","d'a","ir ","n e","rop","ts "," da","a s","as ","au ","den","mai","mis","ori","out","rme","sio","tte","ux ","a d","ien","n a","ntr","omm","ort","ouv","s c","son","tes","ver","ère"," il"," m "," sa"," ve","a r","ais","ava","di ","n p","sti","ven"," mi","ain","enc","for","ité","lar","oir","rem","ren","rro","rés","sie","t a","tur"," pe"," to","d'u","ell","err","ers","ide","ine","iss","mes","por","ran","sit","st ","t r","uti","vai","é l","ési"," di"," n'"," ét","a c","ass","e t","in ","nde","pre","rat","s m","ste","tai","tch","ui ","uro","ès "," es"," fo"," tr","'ad","app","aux","e à","ett","iti","lit","nal","opé","r d","ra ","rai","ror","s r","tat","uté","à l"," af","anc","ara","art","bre","ché","dre","e f","ens","lem","n r","n t","ndr","nne","onn","pos","s t","tiq","ure"," tu","ale","and","ave","cla","cou","e n","emb","ins","jou","mme","rie","rès","sem","str","t i","ues","uni","uve","é d","ée "," ch"," do"," eu"," fa"," lo"," ne"," ra","arl","att","ec ","ica","l a","l'o","l'é","mmi","nta","orm","ou ","r u","rle");
-$GLOBALS["ngrams"]['ha'] = array(" da","da ","in ","an ","ya "," wa"," ya","na ","ar ","a d"," ma","wa ","a a","a k","a s"," ta","wan"," a "," ba"," ka","ta ","a y","n d"," ha"," na"," su"," sa","kin","sa ","ata"," ko","a t","su "," ga","ai "," sh","a m","uwa","iya","ma ","a w","asa","yan","ka ","ani","shi","a b","a h","a c","ama","ba ","nan","n a"," mu","ana"," yi","a g"," za","i d"," ku","aka","yi ","n k","ann","ke ","tar"," ci","iki","n s","ko "," ra","ki ","ne ","a z","mat","hak","nin","e d","nna","uma","nda","a n","ada","cik","ni ","rin","una","ara","kum","akk"," ce"," du","man","n y","nci","sar","aki","awa","ci ","kan","kar","ari","n m","and","hi ","n t","ga ","owa","ash","kam","dan","ewa","nsa","ali","ami"," ab"," do","anc","n r","aya","i n","sun","uka"," al"," ne","a'a","cew","cin","mas","tak","un ","aba","kow","a r","ra "," ja"," ƙa","en ","r d","sam","tsa"," ru","ce ","i a","abi","ida","mut","n g","n j","san","a ƙ","har","on ","i m","suk"," ak"," ji","yar","'ya","kwa","min"," 'y","ane","ban","ins","ruw","i k","n h"," ad","ake","n w","sha","utu"," ƴa","bay","tan","ƴan","bin","duk","e m","n n","oka","yin","ɗan"," fa","a i","kki","re ","za ","ala","asu","han","i y","mar","ran","ƙas","add","ars","gab","ira","mma","u d"," ts","abb","abu","aga","gar","n b"," ɗa","aci","aik","am ","dun","e s","i b","i w","kas","kok","wam"," am","amf","bba","din","fan","gwa","i s","wat","ano","are","dai","iri","ma'"," la","all","dam","ika","mi ","she","tum","uni"," an"," ai"," ke"," ki","dag","mai","mfa","no ","nsu","o d","sak","um "," bi"," gw"," kw","jam","yya","a j","fa ","uta"," hu","'a ","ans","aɗa","dda","hin","niy","r s","bat","dar","gan","i t","nta","oki","omi","sal","a l","kac","lla","wad","war","amm","dom","r m","ras","sai"," lo","ats","hal","kat","li ","lok","n c","nar","tin","afa","bub","i g","isa","mak");
-$GLOBALS["ngrams"]['haw'] = array(" ka","na "," o ","ka "," ma"," a "," la","a i","a m"," i ","la ","ana","ai ","ia ","a o","a k","a h","o k"," ke","a a","i k"," ho"," ia","ua "," na"," me","e k","e a","au ","ke ","ma ","mai","aku"," ak","ahi"," ha"," ko"," e ","a l"," no","me ","ku ","aka","kan","no ","i a","ho ","ou "," ai","i o","a p","o l","o a","ama","a n"," an","i m","han","i i","iho","kou","ne "," ih","o i","iki","ona","hoo","le ","e h"," he","ina"," wa","ea ","ako","u i","kah","oe ","i l","u a"," pa","hoi","e i","era","ko ","u m","kua","mak","oi ","kai","i n","a e","hin","ane"," ol","i h","mea","wah","lak","e m","o n","u l","ika","ki ","a w","mal","hi ","e n","u o","hik"," ku","e l","ele","ra ","ber","ine","abe","ain","ala","lo "," po","kon"," ab","ole","he ","pau","mah","va ","ela","kau","nak"," oe","kei","oia"," ie","ram"," oi","oa ","eho","hov","ieh","ova"," ua","una","ara","o s","awa","o o","nau","u n","wa ","wai","hel"," ae"," al","ae ","ta ","aik"," hi","ale","ila","lel","ali","eik","olo","onu"," lo","aua","e o","ola","hon","mam","nan"," au","aha","lau","nua","oho","oma"," ao","ii ","alu","ima","mau","ike","apa","elo","lii","poe","aia","noa"," in","o m","oka","'u ","aho","ei ","eka","ha ","lu ","nei","hol","ino","o e","ema","iwa","olu","ada","naa","pa ","u k","ewa","hua","lam","lua","o h","ook","u h"," li","ahu","amu","ui "," il"," mo"," se","eia","law"," hu"," ik","ail","e p","li ","lun","uli","io ","kik","noh","u e"," sa","aaw","awe","ena","hal","kol","lan"," le"," ne","a'u","ilo","kap","oko","sa "," pe","hop","loa","ope","pe "," ad"," pu","ahe","aol","ia'","lai","loh","na'","oom","aau","eri","kul","we ","ake","kek","laa","ri ","iku","kak","lim","nah","ner","nui","ono","a u","dam","kum","lok","mua","uma","wal","wi ","'i ","a'i","aan","alo","eta","mu ","ohe","u p","ula","uwa"," nu","amo");
-$GLOBALS["ngrams"]['hi'] = array("ें "," है","में"," मे","ने ","की ","के ","है "," के"," की"," को","ों ","को ","ा ह"," का","से ","ा क","े क","ं क","या "," कि"," से","का ","ी क"," ने"," और","और ","ना ","कि ","भी ","ी स"," जा"," पर","ार "," कर","ी ह"," हो","ही ","िया"," इस"," रह","र क","ुना","ता ","ान ","े स"," भी"," रा","े ह"," चु"," पा","पर ","चुन","नाव"," कह","प्र"," भा","राज","हैं","ा स","ै क","ैं ","नी ","ल क","ीं ","़ी ","था ","री ","ाव ","े ब"," प्","क्ष","पा ","ले "," दे","ला ","हा ","ाजप"," था"," नह","इस ","कर ","जपा","नही","भाज","यों","र स","हीं"," अम"," बा"," मा"," वि","रीक","िए ","े प","्या"," ही","ं म","कार","ा ज","े ल"," ता"," दि"," सा"," हम","ा न","ा म","ाक़","्ता"," एक"," सं"," स्","अमर","क़ी","ताज","मरी","स्थ","ा थ","ार्"," हु","इरा","एक ","न क","र म","राक","ी ज","ी न"," इर"," उन"," पह","कहा","ते ","े अ"," तो"," सु","ति ","ती ","तो ","मिल","िक ","ियो","्रे"," अप"," फ़"," लि"," लो"," सम","म क","र्ट","हो ","ा च","ाई ","ाने","िन ","्य "," उस"," क़"," सक"," सै","ं प","ं ह","गी ","त क","मान","र न","ष्ट","स क","स्त","ाँ ","ी ब","ी म","्री"," दो"," मि"," मु"," ले"," शा","ं स","ज़ा","त्र","थी ","लिए","सी ","़ा ","़ार","ांग","े द","े म","्व "," ना"," बन","ंग्","कां","गा ","ग्र","जा ","ज्य","दी ","न म","पार","भा ","रही","रे ","रेस","ली ","सभा","ा र","ाल ","ी अ","ीकी","े त","ेश "," अं"," तक"," या","ई ह","करन","तक ","देश","वर्","ाया","ी भ","ेस ","्ष "," गय"," जि"," थी"," बड"," यह"," वा","ंतर","अंत","क़ ","गया","टी ","निक","न्ह","पहल","बड़","मार","र प","रने","ाज़","ि इ","ी र","े ज","े व","्ट ","्टी"," अब"," लग"," वर"," सी","ं भ","उन्","क क","किय","देख","पूर","फ़्","यह ","यान","रिक","रिय","र्ड","लेक","सकत","हों","होग","ा अ","ा द","ा प","ाद ","ारा","ित ","ी त","ी प","ो क","ो द"," ते"," नि"," सर"," हा","ं द","अपन","जान","त म","थित","पनी","महल","र ह","लोग","व क","हना","हल ","हाँ","ाज्","ाना","िक्","िस्");
-$GLOBALS["ngrams"]['hr'] = array("je "," na"," pr"," po","na "," je"," za","ije","ne "," i ","ti ","da "," ko"," ne","li "," bi"," da"," u ","ma ","mo ","a n","ih ","za ","a s","ko ","i s","a p","koj","pro","ju ","se "," go","ost","to ","va "," do"," to","e n","i p"," od"," ra","no ","ako","ka ","ni "," ka"," se"," mo"," st","i n","ima","ja ","pri","vat","sta"," su","ati","e p","ta ","tsk","e i","nij"," tr","cij","jen","nos","o s"," iz","om ","tro","ili","iti","pos"," al","a i","a o","e s","ija","ini","pre","str","la ","og ","ovo"," sv","ekt","nje","o p","odi","rva"," ni","ali","min","rij","a t","a z","ats","iva","o t","od ","oje","ra "," hr","a m","a u","hrv","im ","ke ","o i","ovi","red","riv","te ","bi ","e o","god","i d","lek","umi","zvo","din","e u","ene","jed","ji ","lje","nog","su "," a "," el"," mi"," o ","a d","alu","ele","i u","izv","ktr","lum","o d","ori","rad","sto","a k","anj","ava","e k","men","nic","o j","oj ","ove","ski","tvr","una","vor"," di"," no"," s "," ta"," tv","i i","i o","kak","roš","sko","vod"," sa"," će","a b","adi","amo","eni","gov","iju","ku ","o n","ora","rav","ruj","smo","tav","tru","u p","ve "," in"," pl","aci","bit","de ","diš","ema","i m","ika","išt","jer","ki ","mog","nik","nov","nu ","oji","oli","pla","pod","st ","sti","tra","tre","vo "," sm"," št","dan","e z","i t","io ","ist","kon","lo ","stv","u s","uje","ust","će ","ći ","što"," dr"," im"," li","ada","aft","ani","ao ","ars","ata","e t","emo","i k","ine","jem","kov","lik","lji","mje","naf","ner","nih","nja","ogo","oiz","ome","pot","ran","ri ","roi","rtk","ska","ter","u i","u o","vi ","vrt"," me"," ug","ak ","ama","drž","e e","e g","e m","em ","eme","enj","ent","er ","ere","erg","eur","go ","i b","i z","jet","ksi","o u","oda","ona","pra","reb","rem","rop","tri","žav"," ci"," eu"," re"," te"," uv"," ve","aju","an ");
-$GLOBALS["ngrams"]['hu'] = array(" a "," az"," sz","az "," me","en "," el"," ho","ek ","gy ","tt ","ett","sze"," fe","és "," ki","tet"," be","et ","ter"," kö"," és","hog","meg","ogy","szt","te ","t a","zet","a m","nek","nt ","ség","szá","ak "," va","an ","eze","ra ","ta "," mi","int","köz"," is","esz","fel","min","nak","ors","zer"," te","a a","a k","is "," cs","ele","er ","men","si ","tek","ti "," ne","csa","ent","z e","a t","ala","ere","es ","lom","lte","mon","ond","rsz","sza","tte","zág","ány"," fo"," ma","ai ","ben","el ","ene","ik ","jel","tás","áll"," ha"," le"," ál","agy","alá","isz","y a","zte","ás "," al","e a","egy","ely","for","lat","lt ","n a","oga","on ","re ","st ","ság","t m","án ","ét ","ült"," je","gi ","k a","kül","lam","len","lás","más","s k","vez","áso","özö"," ta","a s","a v","asz","atá","ető","kez","let","mag","nem","szé","z m","át ","éte","ölt"," de"," gy"," ké"," mo"," vá"," ér","a b","a f","ami","at ","ato","att","bef","dta","gya","hat","i s","las","ndt","rt ","szo","t k","tár","tés","van","ásá","ól "," bé"," eg"," or"," pá"," pé"," ve","ban","eke","ekü","elő","erv","ete","fog","i a","kis","lád","nte","nye","nyi","ok ","omá","os ","rán","rás","sal","t e","vál","yar","ágo","ála","ége","ény","ött"," tá","adó","elh","fej","het","hoz","ill","jár","kés","llo","mi ","ny ","ont","ren","res","rin","s a","s e","ssz","zt "," ez"," ka"," ke"," ko"," re","a h","a n","den","dó ","efo","gad","gat","gye","hel","k e","ket","les","mán","nde","nis","ozz","t b","t i","t é","tat","tos","val","z o","zak","ád ","ály","ára","ési","ész"," ak"," am"," es"," há"," ny"," tö","aka","art","ató","azt","bbe","ber","ció","cso","em ","eti","eté","gal","i t","ini","ist","ja ","ker","ki ","kor","koz","l é","ljá","lye","n v","ni ","pál","ror","ról","rül","s c","s p","s s","s v","sok","t j","t t","tar","tel","vat");
-$GLOBALS["ngrams"]['id'] = array("an "," me","kan","ang","ng "," pe","men"," di"," ke"," da"," se","eng"," be","nga","nya"," te","ah ","ber","aka"," ya","dan","di ","yan","n p","per","a m","ita"," pa","da ","ata","ada","ya ","ta "," in","ala","eri","ia ","a d","n k","am ","ga ","at ","era","n d","ter"," ka","a p","ari","emb","n m","ri "," ba","aan","ak ","ra "," it","ara","ela","ni ","ali","ran","ar ","eru","lah","a b","asi","awa","eba","gan","n b"," ha","ini","mer"," la"," mi","and","ena","wan"," sa","aha","lam","n i","nda"," wa","a i","dua","g m","mi ","n a","rus","tel","yak"," an","dal","h d","i s","ing","min","ngg","tak","ami","beb","den","gat","ian","ih ","pad","rga","san","ua "," de","a t","arg","dar","elu","har","i k","i m","i p","ika","in ","iny","itu","mba","n t","ntu","pan","pen","sah","tan","tu ","a k","ban","edu","eka","g d","ka ","ker","nde","nta","ora","usa"," du"," ma","a s","ai ","ant","bas","end","i d","ira","kam","lan","n s","uli","al ","apa","ere","ert","lia","mem","rka","si ","tal","ung"," ak","a a","a w","ani","ask","ent","gar","haa","i i","isa","ked","mbe","ska","tor","uan","uk ","uka"," ad"," to","asa","aya","bag","dia","dun","erj","mas","na ","rek","rit","sih","us "," bi","a h","ama","dib","ers","g s","han","ik ","kem","ma ","n l","nit","r b","rja","sa "," ju"," or"," si"," ti","a y","aga","any","as ","cul","eme","emu","eny","epa","erb","erl","gi ","h m","i a","kel","li ","mel","nia","opa","rta","sia","tah","ula","un ","unt"," at"," bu"," pu"," ta","agi","alu","amb","bah","bis","er ","i t","ibe","ir ","ja ","k m","kar","lai","lal","lu ","mpa","ngk","nja","or ","pa ","pas","pem","rak","rik","seb","tam","tem","top","tuk","uni","war"," al"," ga"," ge"," ir"," ja"," mu"," na"," pr"," su"," un","ad ","adi","akt","ann","apo","bel","bul","der","ega","eke","ema","emp","ene","enj","esa");
-$GLOBALS["ngrams"]['is'] = array("að ","um "," að","ir ","ið ","ur "," ve"," í ","na "," á "," se"," er"," og","ar ","og ","ver"," mi","inn","nn "," fy","er ","fyr"," ek"," en"," ha"," he","ekk"," st","ki ","st ","ði "," ba"," me"," vi","ig ","rir","yri"," um","g f","leg","lei","ns ","ð s"," ei"," þa","in ","kki","r h","r s","egi","ein","ga ","ing","ra ","sta"," va"," þe","ann","en ","mil","sem","tjó","arð","di ","eit","haf","ill","ins","ist","llj","ndi","r a","r e","seg","un ","var"," bi"," el"," fo"," ge"," yf","and","aug","bau","big","ega","eld","erð","fir","foo","gin","itt","n s","ngi","num","od ","ood","sin","ta ","tt ","við","yfi","ð e","ð f"," hr"," sé"," þv","a e","a á","em ","gi ","i f","jar","jór","lja","m e","r á","rei","rst","rða","rði","rðu","stj","und","veg","ví ","ð v","það","því"," fj"," ko"," sl","eik","end","ert","ess","fjá","fur","gir","hús","jár","n e","ri ","tar","ð þ","ðar","ður","þes"," br"," hú"," kr"," le"," up","a s","egg","i s","irt","ja ","kið","len","með","mik","n b","nar","nir","nun","r f","r v","rið","rt ","sti","t v","ti ","una","upp","ða ","óna"," al"," fr"," gr","a v","all","an ","da ","eið","eð ","fa ","fra","g e","ger","gið","gt ","han","hef","hel","her","hra","i a","i e","i v","i þ","iki","jón","jör","ka ","kró","lík","m h","n a","nga","r l","ram","ru ","ráð","rón","svo","vin","í b","í h","ð h","ð k","ð m","örð"," af"," fa"," lí"," rá"," sk"," sv"," te","a b","a f","a h","a k","a u","afi","agn","arn","ast","ber","efu","enn","erb","erg","fi ","g a","gar","iðs","ker","kke","lan","ljó","llt","ma ","mið","n v","n í","nan","nda","ndu","nið","nna","nnu","nu ","r o","rbe","rgi","slö","sé ","t a","t h","til","tin","ugu","vil","ygg","á s","ð a","ð b","órn","ögn","öku"," at"," fi"," fé"," ka"," ma"," no"," sa"," si"," ti"," ák","a m","a t","a í","a þ","afa","afs","ald","arf");
-$GLOBALS["ngrams"]['it'] = array(" di","to ","la "," de","di ","no "," co","re ","ion","e d"," e ","le ","del","ne ","ti ","ell"," la"," un","ni ","i d","per"," pe","ent"," in","one","he ","ta ","zio","che","o d","a d","na ","ato","e s"," so","i s","lla","a p","li ","te "," al"," ch","er "," pa"," si","con","sta"," pr","a c"," se","el ","ia ","si ","e p"," da","e i","i p","ont","ano","i c","all","azi","nte","on ","nti","o s"," ri","i a","o a","un "," an","are","ari","e a","i e","ita","men","ri "," ca"," il"," no"," po","a s","ant","il ","in ","a l","ati","cia","e c","ro ","ann","est","gli","tà "," qu","e l","nta"," a ","com","o c","ra "," le"," ne","ali","ere","ist"," ma"," è ","io ","lle","me ","era","ica","ost","pro","tar","una"," pi","da ","tat"," mi","att","ca ","mo ","non","par","sti"," fa"," i "," re"," su","ess","ini","nto","o l","ssi","tto","a e","ame","col","ei ","ma ","o i","za "," st","a a","ale","anc","ani","i m","ian","o p","oni","sio","tan","tti"," lo","i r","oci","oli","ona","ono","tra"," l ","a r","eri","ett","lo ","nza","que","str","ter","tta"," ba"," li"," te","ass","e f","enz","for","nno","olo","ori","res","tor"," ci"," vo","a i","al ","chi","e n","lia","pre","ria","uni","ver"," sp","imo","l a","l c","ran","sen","soc","tic"," fi"," mo","a n","ce ","dei","ggi","gio","iti","l s","lit","ll ","mon","ola","pac","sim","tit","utt","vol"," ar"," fo"," ha"," sa","acc","e r","ire","man","ntr","rat","sco","tro","tut","va "," do"," gi"," me"," sc"," tu"," ve"," vi","a m","ber","can","cit","i l","ier","ità","lli","min","n p","nat","nda","o e","o f","o u","ore","oro","ort","sto","ten","tiv","van","art","cco","ci ","cos","dal","e v","i i","ila","ino","l p","n c","nit","ole","ome","po ","rio","sa "," ce"," es"," tr","a b","and","ata","der","ens","ers","gi ","ial","ina","itt","izi","lan","lor","mil");
-$GLOBALS["ngrams"]['kk'] = array("ан ","ен ","ың "," қа"," ба","ай ","нда","ын "," са"," ал","ді ","ары","ды ","ып "," мұ"," бі","асы","да ","най"," жа","мұн","ста","ған","н б","ұна"," бо","ның","ін ","лар","сын"," де","аға","тан"," кө","бір","ер ","мен","аза","ынд","ыны"," ме","анд","ері","бол","дың","қаз","аты","сы ","тын","ғы "," ке","ар ","зақ","ық ","ала","алы","аны","ара","ағы","ген","тар","тер","тыр","айд","ард","де ","ға "," қо","бар","ің ","қан"," бе"," қы","ақс","гер","дан","дар","лық","лға","ына","ір ","ірі","ғас"," та","а б","гі ","еді","еле","йды","н к","н т","ола","рын","іп ","қст","қта","ң б"," ай"," ол"," со","айт","дағ","иге","лер","лып","н а","ік ","ақт","бағ","кен","н қ","ны ","рге","рға","ыр "," ар","алғ","аса","бас","бер","ге ","еті","на ","нде","не ","ниг","рды","ры ","сай"," ау"," кү"," ни"," от"," өз","ауд","еп ","иял","лты","н ж","н о","осы","оты","рып","рі ","тке","ты ","ы б","ы ж","ылы","ысы","і с","қар"," бұ"," да"," же"," тұ"," құ","ады","айл","ап ","ата","ені","йла","н м","н с","нды","нді","р м","тай","тін","ы т","ыс ","інд"," би","а ж","ауы","деп","дің","еке","ери","йын","кел","лды","ма ","нан","оны","п ж","п о","р б","рия","рла","уда","шыл","ы а","ықт","і а","і б","із ","ілі","ң қ"," ас"," ек"," жо"," мә"," ос"," ре"," се","алд","дал","дег","дей","е б","ет ","жас","й б","лау","лда","мет","нын","сар","сі ","ті ","ыры","ыта","ісі","ң а","өте"," ат"," ел"," жү"," ма"," то"," шы","а а","алт","ама","арл","аст","бұл","дай","дық","ек ","ель","есі","зді","көт","лем","ль ","н е","п а","р а","рес","са ","та ","тте","тұр","шы ","ы д","ы қ","ыз ","қыт"," ко"," не"," ой"," ор"," сұ"," тү","аль","аре","атт","дір","ев ","егі","еда","екі","елд","ерг","ерд","ияд","кер","кет","лыс","ліс","мед","мпи","н д","ні ","нін","п т","пек","рел","рта","ріл","рін","сен","тал","шіл","ы к","ы м","ыст");
-$GLOBALS["ngrams"]['ky'] = array("ын ","ан "," жа","ен ","да "," та","ар ","ин "," ка","ары"," ал"," ба"," би","лар"," бо"," кы","ала","н к"," са","нда","ган","тар"," де","анд","н б"," ке","ард","мен","н т","ара","нын"," да"," ме","кыр"," че","н а","ры "," ко","ген","дар","кен","кта","уу ","ене","ери"," ша","алы","ат ","на "," кө"," эм","аты","дан","деп","дын","еп ","нен","рын"," бе","кан","луу","ргы","тан","шай","ырг","үн "," ар"," ма","агы","акт","аны","гы ","гыз","ды ","рда","ай ","бир","бол","ер ","н с","нды","ун ","ча ","ынд","а к","ага","айл","ана","ап ","га ","лге","нча","п к","рды","туу","ыны"," ан"," өз","ама","ата","дин","йт ","лга","лоо","оо ","ри ","тин","ыз ","ып ","өрү"," па"," эк","а б","алг","асы","ашт","биз","кел","кте","тал"," не"," су","акы","ент","инд","ир ","кал","н д","нде","ого","онд","оюн","р б","р м","ран","сал","ста","сы ","ура","ыгы"," аш"," ми"," сы"," ту","ал ","арт","бор","елг","ени","ет ","жат","йло","кар","н м","огу","п а","п ж","р э","сын","ык ","юнч"," бу"," ур","а а","ак ","алд","алу","бар","бер","бою","ге ","дон","еги","ект","ефт","из ","кат","лды","н ч","н э","н ө","ндо","неф","он ","сат","тор","ты ","уда","ул ","ула","ууд","ы б","ы ж","ы к","ыл ","ына","эке","ясы"," ат"," до"," жы"," со"," чы","аас","айт","аст","баа","баш","гар","гын","дө ","е б","ек ","жыл","и б","ик ","ияс","кыз","лда","лык","мда","н ж","нди","ни ","нин","орд","рдо","сто","та ","тер","тти","тур","тын","уп ","ушу","фти","ыкт","үп ","өн "," ай"," бү"," ич"," иш"," мо"," пр"," ре"," өк"," өт","а д","а у","а э","айм","амд","атт","бек","бул","гол","дег","еге","ейт","еле","енд","жак","и к","ини","ири","йма","кто","лик","мак","мес","н у","н ш","нтт","ол ","оло","пар","рак","рүү","сыр","ти ","тик","тта","төр","у ж","у с","шка","ы м","ызы","ылд","эме","үрү","өлү","өтө"," же"," тү"," эл"," өн","а ж","ады");
-$GLOBALS["ngrams"]['la'] = array("um ","us ","ut ","et ","is "," et"," in"," qu","tur"," pr","est","tio"," au","am ","em ","aut"," di","ent","in ","dic","t e"," es","ur ","ati","ion","st "," ut","ae ","qua"," de","nt "," su"," si","itu","unt","rum","ia ","es ","ter"," re","nti","rae","s e","qui","io ","pro","it ","per","ita","one","ici","ius"," co","t d","bus","pra","m e"," no","edi","tia","ue ","ibu"," se"," ad","er "," fi","ili","que","t i","de ","oru"," te","ali"," pe","aed","cit","m d","t s","tat","tem","tis","t p","sti","te ","cum","ere","ium"," ex","rat","ta ","con","cti","oni","ra ","s i"," cu"," sa","eni","nis","nte","eri","omi","re ","s a","min","os ","ti ","uer"," ma"," ue","m s","nem","t m"," mo"," po"," ui","gen","ict","m i","ris","s s","t a","uae"," do","m a","t c"," ge","as ","e i","e p","ne "," ca","ine","quo","s p"," al","e e","ntu","ro ","tri","tus","uit","atu","ini","iqu","m p","ost","res","ura"," ac"," fu","a e","ant","nes","nim","sun","tra","e a","s d"," pa"," uo","ecu"," om"," tu","ad ","cut","omn","s q"," ei","ex ","icu","tor","uid"," ip"," me","e s","era","eru","iam","ide","ips"," iu","a s","do ","e d","eiu","ica","im ","m c","m u","tiu"," ho","cat","ist","nat","on ","pti","reg","rit","s t","sic","spe"," en"," sp","dis","eli","liq","lis","men","mus","num","pos","sio"," an"," gr","abi","acc","ect","ri ","uan"," le","ecc","ete","gra","non","se ","uen","uis"," fa"," tr","ate","e c","fil","na ","ni ","pul","s f","ui ","at ","cce","dam","i e","ina","leg","nos","ori","pec","rop","sta","uia","ene","iue","iui","siu","t t","t u","tib","tit"," da"," ne","a d","and","ege","equ","hom","imu","lor","m m","mni","ndo","ner","o e","r e","sit","tum","utu","a p","bis","bit","cer","cta","dom","fut","i s","ign","int","mod","ndu","nit","rib","rti","tas","und"," ab","err","ers","ite","iti","m t","o p");
-$GLOBALS["ngrams"]['lt'] = array("as "," pa"," ka","ai ","us ","os ","is "," ne"," ir","ir ","ti "," pr","aus","ini","s p","pas","ių "," ta"," vi","iau"," ko"," su","kai","o p","usi"," sa","vo ","tai","ali","tų ","io ","jo ","s k","sta","iai"," bu"," nu","ius","mo "," po","ien","s s","tas"," me","uvo","kad"," iš"," la","to ","ais","ie ","kur","uri"," ku","ijo","čia","au ","met","je "," va","ad "," ap","and"," gr"," ti","kal","asi","i p","iči","s i","s v","ink","o n","ės ","buv","s a"," ga","aip","avi","mas","pri","tik"," re","etu","jos"," da","ent","oli","par","ant","ara","tar","ama","gal","imo","išk","o s"," at"," be"," į ","min","tin"," tu","s n"," jo","dar","ip ","rei"," te","dži","kas","nin","tei","vie"," li"," se","cij","gar","lai","art","lau","ras","no ","o k","tą "," ar","ėjo","vič","iga","pra","vis"," na","men","oki","raš","s t","iet","ika","int","kom","tam","aug","avo","rie","s b"," st","eim","ko ","nus","pol","ria","sau","api","me ","ne ","sik"," ši","i n","ia ","ici","oja","sak","sti","ui ","ame","lie","o t","pie","čiu"," di"," pe","gri","ios","lia","lin","s d","s g","ta ","uot"," ja"," už","aut","i s","ino","mą ","oje","rav","dėl","nti","o a","toj","ėl "," to"," vy","ar ","ina","lic","o v","sei","su "," mi"," pi","din","iš ","lan","si ","tus"," ba","asa","ata","kla","omi","tat"," an"," ji","als","ena","jų ","nuo","per","rig","s m","val","yta","čio"," ra","i k","lik","net","nė ","tis","tuo","yti","ęs ","ų s","ada","ari","do ","eik","eis","ist","lst","ma ","nes","sav","sio","tau"," ki","aik","aud","ies","ori","s r","ska"," ge","ast","eig","et ","iam","isa","mis","nam","ome","žia","aba","aul","ikr","ką ","nta","ra ","tur"," ma","die","ei ","i t","nas","rin","sto","tie","tuv","vos","ų p"," dė","are","ats","enė","ili","ima","kar","ms ","nia","r p","rod","s l"," o ","e p","es ","ide","ik ","ja ");
-$GLOBALS["ngrams"]['lv'] = array("as "," la"," pa"," ne","es "," un","un "," ka"," va","ar ","s p"," ar"," vi","is ","ai "," no","ja ","ija","iem","em ","tu ","tie","vie","lat","aks","ien","kst","ies","s a","rak","atv","tvi"," ja"," pi","ka "," ir","ir ","ta "," sa","ts "," kā","ās "," ti","ot ","s n"," ie"," ta","arī","par","pie"," pr","kā "," at"," ra","am ","inā","tā "," iz","jas","lai"," na","aut","ieš","s s"," ap"," ko"," st","iek","iet","jau","us ","rī ","tik","ība","na "," ga","cij","s i"," uz","jum","s v","ms ","var"," ku"," ma","jā ","sta","s u"," tā","die","kai","kas","ska"," ci"," da","kur","lie","tas","a p","est","stā","šan","nes","nie","s d","s m","val"," di"," es"," re","no ","to ","umu","vai","ši "," vē","kum","nu ","rie","s t","ām ","ad ","et ","mu ","s l"," be","aud","tur","vij","viņ","āju","bas","gad","i n","ika","os ","a v","not","oti","sts","aik","u a","ā a","āk "," to","ied","stu","ti ","u p","vēl","āci"," šo","gi ","ko ","pro","s r","tāj","u s","u v","vis","aun","ks ","str","zin","a a","adī","da ","dar","ena","ici","kra","nas","stī","šu "," mē","a n","eci","i s","ie ","iņa","ju ","las","r t","ums","šie","bu ","cit","i a","ina","ma ","pus","ra "," au"," se"," sl","a s","ais","eši","iec","iku","pār","s b","s k","sot","ādā"," in"," li"," tr","ana","eso","ikr","man","ne ","u k"," tu","an ","av ","bet","būt","im ","isk","līd","nav","ras","ri ","s g","sti","īdz"," ai","arb","cin","das","ent","gal","i p","lik","mā ","nek","pat","rēt","si ","tra","uši","vei"," br"," pu"," sk","als","ama","edz","eka","ešu","ieg","jis","kam","lst","nāk","oli","pre","pēc","rot","tās","usi","ēl ","ēs "," bi"," de"," me"," pā","a i","aid","ajā","ikt","kat","lic","lod","mi ","ni ","pri","rād","rīg","sim","trā","u l","uto","uz ","ēc ","ītā"," ce"," jā"," sv","a t","aga","aiz","atu","ba ","cie","du ","dzi","dzī");
-$GLOBALS["ngrams"]['mk'] = array("на "," на","та ","ата","ија"," пр","то ","ја "," за","а н"," и ","а с","те ","ите"," ко","от "," де"," по","а д","во ","за "," во"," од"," се"," не","се "," до","а в","ка ","ање","а п","о п","ува","циј","а о","ици","ето","о н","ани","ни "," вл","дек","ека","њет","ќе "," е ","а з","а и","ат ","вла","го ","е н","од ","пре"," го"," да"," ма"," ре"," ќе","али","и д","и н","иот","нат","ово"," па"," ра"," со","ове","пра","што","ње ","а е","да ","дат","дон","е в","е д","е з","е с","кон","нит","но ","они","ото","пар","при","ста","т н"," шт","а к","аци","ва ","вањ","е п","ени","ла ","лад","мак","нес","нос","про","рен","јат"," ин"," ме"," то","а г","а м","а р","аке","ако","вор","гов","едо","ена","и и","ира","кед","не ","ниц","ниј","ост","ра ","рат","ред","ска","тен"," ка"," сп"," ја","а т","аде","арт","е г","е и","кат","лас","нио","о с","ри "," ба"," би","ава","ате","вни","д н","ден","дов","држ","дув","е о","ен ","ере","ери","и п","и с","ина","кој","нци","о м","о о","одн","пор","ски","спо","ств","сти","тво","ти "," об"," ов","а б","алн","ара","бар","е к","ед ","ент","еѓу","и о","ии ","меѓ","о д","оја","пот","раз","раш","спр","сто","т д","ци "," бе"," гр"," др"," из"," ст","аа ","бид","вед","гла","еко","енд","есе","етс","зац","и т","иза","инс","ист","ки ","ков","кол","ку ","лиц","о з","о и","ова","олк","оре","ори","под","рањ","реф","ржа","ров","рти","со ","тор","фер","цен","цит"," а "," вр"," гл"," дп"," мо"," ни"," но"," оп"," от","а ќ","або","ада","аса","аша","ба ","бот","ваа","ват","вот","ги ","гра","де ","дин","дум","евр","еду","ено","ера","ес ","ење","же ","зак","и в","ила","иту","коа","кои","лан","лку","лож","мот","нду","нст","о в","оа ","оал","обр","ов ","ови","овн","ои ","ор ","орм","ој ","рет","сед","ст ","тер","тиј","тоа","фор","ции","ѓу "," ал"," ве"," вм"," ги"," ду");
-$GLOBALS["ngrams"]['mn'] = array("ын "," ба","йн ","бай","ийн","уул"," ул","улс","ан "," ха","ний","н х","гаа","сын","ий ","лсы"," бо","й б","эн ","ах ","бол","ол ","н б","оло"," хэ","онг","гол","гуу","нго","ыг ","жил"," мо","лаг","лла","мон"," тє"," ху","айд","ны ","он ","сан","хий"," аж"," ор","л у","н т","улг","айг","длы","йг "," за","дэс","н а","ндэ","ула","ээ ","ага","ийг","vй ","аа ","й а","лын","н з"," аю"," зє","аар","ад ","ар ","гvй","зєв","ажи","ал ","аюу","г х","лгv","лж ","сни","эсн","юул","йдл","лыг","нхи","ууд","хам"," нэ"," са","гий","лах","лєл","рєн","єгч"," та","илл","лий","лэх","рий","эх "," ер"," эр","влє","ерє","ийл","лон","лєг","євл","єнх"," хо","ари","их ","хан","эр ","єн ","vvл","ж б","тэй","х х","эрх"," vн"," нь","vнд","алт","йлє","нь ","тєр"," га"," су","аан","даа","илц","йгу","л а","лаа","н н","руу","эй "," то","н с","рил","єри","ааг","гч ","лээ","н о","рэг","суу","эрэ","їїл"," yн"," бу"," дэ"," ол"," ту"," ши","yнд","аши","г т","иг ","йл ","хар","шин","эг ","єр "," их"," хє"," хї","ам ","анг","ин ","йга","лса","н v","н е","нал","нд ","хуу","цаа","эд ","ээр","єл ","vйл","ада","айн","ала","амт","гах","д х","дал","зар","л б","лан","н д","сэн","улл","х б","хэр"," бv"," да"," зо","vрэ","аад","гээ","лэн","н и","н э","нга","нэ ","тал","тын","хур","эл "," на"," ни"," он","vлэ","аг ","аж ","ай ","ата","бар","г б","гад","гїй","й х","лт ","н м","на ","оро","уль","чин","эж ","энэ","ээд","їй ","їлэ"," би"," тэ"," эн","аны","дий","дээ","лал","лга","лд ","лог","ль ","н у","н ї","р б","рал","сон","тай","удл","элт","эрг","єлє"," vй"," в "," гэ"," хv","ара","бvр","д н","д о","л х","лс ","лты","н г","нэг","огт","олы","оёр","р т","рээ","тав","тог","уур","хоё","хэл","хээ","элэ","ёр "," ав"," ас"," аш"," ду"," со"," чи"," эв"," єр","аал","алд","амж","анд","асу","вэр","г у","двэ","жvv","лца","лэл");
-$GLOBALS["ngrams"]['nb'] = array("er ","en ","et "," de","det"," i ","for","il "," fo"," me","ing","om "," ha"," og","ter"," er"," ti"," st","og ","til","ne "," vi","re "," en"," se","te ","or ","de ","kke","ke ","ar ","ng ","r s","ene"," so","e s","der","an ","som","ste","at ","ed ","r i"," av"," in","men"," at"," ko"," på","har"," si","ere","på ","nde","and","els","ett","tte","lig","t s","den","t i","ikk","med","n s","rt ","ser","ska","t e","ker","sen","av ","ler","r a","ten","e f","r e","r t","ede","ig "," re","han","lle","ner"," bl"," fr","le "," ve","e t","lan","mme","nge"," be"," ik"," om"," å ","ell","sel","sta","ver"," et"," sk","nte","one","ore","r d","ske"," an"," la","del","gen","nin","r f","r v","se "," po","ir ","jon","mer","nen","omm","sjo"," fl"," sa","ern","kom","r m","r o","ren","vil","ale","es ","n a","t f"," le","bli","e e","e i","e v","het","ye "," ir","al ","e o","ide","iti","lit","nne","ran","t o","tal","tat","tt "," ka","ans","asj","ge ","inn","kon","lse","pet","t d","vi "," ut","ent","eri","oli","r p","ret","ris","sto","str","t a"," ga","all","ape","g s","ill","ira","kap","nn ","opp","r h","rin"," br"," op","e m","ert","ger","ion","kal","lsk","nes"," gj"," mi"," pr","ang","e h","e r","elt","enn","i s","ist","jen","kan","lt ","nal","res","tor","ass","dre","e b","e p","mel","n t","nse","ort","per","reg","sje","t p","t v"," hv"," nå"," va","ann","ato","e a","est","ise","isk","oil","ord","pol","ra ","rak","sse","toi"," gr","ak ","eg ","ele","g a","ige","igh","m e","n f","n v","ndr","nsk","rer","t m","und","var","år "," he"," no"," ny","end","ete","fly","g i","ghe","ier","ind","int","lin","n d","n p","rne","sak","sie","t b","tid"," al"," pa"," tr","ag ","dig","e d","e k","ess","hol","i d","lag","led","n e","n i","n o","pri","r b","st "," fe"," li"," ry","air","ake","d s","eas","egi");
-$GLOBALS["ngrams"]['ne'] = array("को ","का ","मा ","हरु"," ने","नेप","पाल","ेपा"," सम","ले "," प्","प्र","कार","ा स","एको"," भए"," छ "," भा","्रम"," गर","रुक"," र ","भार","ारत"," का"," वि","भएक","ाली","ली ","ा प","ीहर","ार्","ो छ","ना ","रु ","ालक","्या"," बा","एका","ने ","न्त","ा ब","ाको","ार ","ा भ","ाहर","्रो","क्ष","न् ","ारी"," नि","ा न","ी स"," डु","क्र","जना","यो ","ा छ","ेवा","्ता"," रा","त्य","न्द","हुन","ा क","ामा","ी न","्दा"," से","छन्","म्ब","रोत","सेव","स्त","स्र","ेका","्त "," बी"," हु","क्त","त्र","रत ","र्न","र्य","ा र","ाका","ुको"," एक"," सं"," सु","बीब","बीस","लको","स्य","ीबी","ीसी","ेको","ो स","्यक"," छन"," जन"," बि"," मु"," स्","गर्","ताह","न्ध","बार","मन्","मस्","रुल","लाई","ा व","ाई ","ाल ","िका"," त्"," मा"," यस"," रु","ताक","बन्","र ब","रण ","रुप","रेक","ष्ट","सम्","सी ","ाएक","ुका","ुक्"," अध"," अन"," तथ"," थि"," दे"," पर"," बै","तथा","ता ","दा ","द्द","नी ","बाट","यक्","री ","रीह","र्म","लका","समस","ा अ","ा ए","ाट ","िय ","ो प","ो म","्न ","्ने","्षा"," पा"," यो"," हा","अधि","डुव","त भ","त स","था ","धिक","पमा","बैठ","मुद","या ","युक","र न","रति","वान","सार","ा आ","ा ज","ा ह","ुद्","ुपम","ुले","ुवा","ैठक","ो ब","्तर","्य ","्यस"," क्"," मन"," रह","चार","तिय","दै ","निर","नु ","पर्","रक्","र्द","समा","सुर","ाउन","ान ","ानम","ारण","ाले","ि ब","ियो","ुन्","ुरक","्त्","्बन","्रा","्ष "," आर"," जल"," बे"," या"," सा","आएक","एक ","कर्","जलस","णका","त र","द्र","धान","धि ","नका","नमा","नि ","ममा","रम ","रहे","राज","लस्","ला ","वार","सका","हिल","हेक","ा त","ारे","िन्","िस्","े स","ो न","ो र","ोत ","्धि","्मी","्रस"," दु"," पन"," बत"," बन"," भन","ंयु","आरम","खि ","ण्ड","तका","ताल","दी ","देख","निय","पनि","प्त","बता","मी ","म्भ","र स","रम्","लमा","विश","षाक","संय","ा ड","ा म","ानक","ालम","ि भ","ित ","ी प","ी र","ु भ","ुने","े ग","ेखि","ेर ","ो भ","ो व","ो ह","्भ ","्र "," ता"," नम"," ना");
-$GLOBALS["ngrams"]['nl'] = array("en ","de "," de","et ","an "," he","er "," va","n d","van","een","het"," ge","oor"," ee","der"," en","ij ","aar","gen","te ","ver"," in"," me","aan","den"," we","at ","in "," da"," te","eer","nde","ter","ste","n v"," vo"," zi","ing","n h","voo","is "," op","tie"," aa","ede","erd","ers"," be","eme","ten","ken","n e"," ni"," ve","ent","ijn","jn ","mee","iet","n w","ng ","nie"," is","cht","dat","ere","ie ","ijk","n b","rde","ar ","e b","e a","met","t d","el ","ond","t h"," al","e w","op ","ren"," di"," on","al ","and","bij","zij"," bi"," hi"," wi","or ","r d","t v"," wa","e h","lle","rt ","ang","hij","men","n a","n z","rs "," om","e o","e v","end","est","n t","par"," pa"," pr"," ze","e g","e p","n p","ord","oud","raa","sch","t e","ege","ich","ien","aat","ek ","len","n m","nge","nt ","ove","rd ","wer"," ma"," mi","daa","e k","lij","mer","n g","n o","om ","sen","t b","wij"," ho","e m","ele","gem","heb","pen","ude"," bo"," ja","die","e e","eli","erk","le ","pro","rij"," er"," za","e d","ens","ind","ke ","n k","nd ","nen","nte","r h","s d","s e","t z"," b "," co"," ik"," ko"," ov","eke","hou","ik ","iti","lan","ns ","t g","t m"," do"," le"," zo","ams","e z","g v","it ","je ","ls ","maa","n i","nke","rke","uit"," ha"," ka"," mo"," re"," st"," to","age","als","ark","art","ben","e r","e s","ert","eze","ht ","ijd","lem","r v","rte","t p","zeg","zic","aak","aal","ag ","ale","bbe","ch ","e t","ebb","erz","ft ","ge ","led","mst","n n","oek","r i","t o","t w","tel","tte","uur","we ","zit"," af"," li"," ui","ak ","all","aut","doo","e i","ene","erg","ete","ges","hee","jaa","jke","kee","kel","kom","lee","moe","n s","ort","rec","s o","s v","teg","tij","ven","waa","wel"," an"," au"," bu"," gr"," pl"," ti","'' ","ade","dag","e l","ech","eel","eft","ger","gt ","ig ","itt","j d","ppe","rda");
-$GLOBALS["ngrams"]['nr'] = array("oku","la ","nga","a n"," ng","na ","ama","a i","ko "," uk","ele","lo ","ela","ang","a u","a k","uku","aba"," ku","wa ","enz","lel","ho ","ni ","ngo","ath","pha","eth","kha","ana","isa","nge"," na","o n","tho","e n","the","ha ","esi","nye","kwe","tjh"," kw","ise"," um","a a"," ne","le ","hla","a e","lan","ben","ndl"," no","imi","und","ung","thi","nzi","ye ","isi","uth","o e","ebe","het","kut","and","sa ","elo","fun","eko","seb","ban","ulu","aka","eli","wen","e i"," am","eni","ba ","we ","nel"," we","kuf","lwa","i n"," is","zi "," lo","kwa","lok","elw","gok","ona","lek","hi ","li ","gan","bon"," ii","ing","ka ","o i","akh","ane","thu","ula","kel","mth"," im","ga "," le","nda","fan","nok","i k","end","si ","o w","aph","hat","e u","ala","kub","lun","ikh","o l","ezi","a l","o u","sis","nam","emi"," ab","hul","kus"," wo","sek","azi","kho","iin","i u","asi","lol","ini","uph","uhl","khu","no ","o y","ako","a b","i e","o k","i l"," be","mal"," ye","i i","nde","iph","mel","eke","tha","kun","ngi","e k","eng","o s"," yo","so ","ma ","mkh","jha","isw","lwe"," ez","di ","a w","e a","kul","uny","ume","za ","any","ahl","kuh","een"," si","ili","itj","zok","ihl"," es","ke ","hlo","hak","phe","lul","dle","luk","da ","eka","amb"," se","zis","mbi","hon","dla","aku","jen","zin"," ba","ham","i a"," bo","o a","ali","use","ile","sik","han","wok","okh","hlu","nya","sit","ani","kuz","o o","ufa","swa","ind","zak","nis","lis","gab","mi "," em"," ko","ano"," el","hwa","ufu","a y","wo "," in","lim","tlo","kat","wak","kan","thw","o z","ith","ndi","yok","yo ","mit","mis","abo","eku","hab","iny","nan","eze","khe","alo","lu ","man","he ","ezo","kup","ubu"," zo","gam","hel","wan","omb","amk","nza","ola","hum","kuk","du "," la","kom","i y","obu","i b","odu","okw","gap"," ka","be "," il","alu","atj","e b");
-$GLOBALS["ngrams"]['nso'] = array("go "," go"," le"," a ","le "," di","a g","ya ","lo "," ya","a m","ka "," ka","la "," t ","o y","a t","a k","ba ","et ","wa "," mo"," e ","a b"," se"," ba"," ma"," bo","e g","t a"," o ","a l","o t","na ","o l","a d","elo","di ","a s","o g","o k","ele","o a","ng ","t e","o b","mo ","e t","e m","ego","eo ","e l","ngw","se ","e b","kgo","ela"," wa"," ga","e k","ago","o m"," kg","ga ","dit","olo","t h","e d","o d"," ye","ane","lel","we "," tl","thu","ona"," th","t w","hut","ana","tla","wan","aba","ola"," me","gwa","re ","ong","t o","lao","e s","o s","a y","alo","set","a p","i a","eng","a a","o e","tho"," ke","gwe"," ha","hlo","edi"," la","ao "," ts","aka","hla","ala","swa"," we"," bj","o o","gor","aga","hab","gob","let","ke ","dik","sa "," i ","oba"," hl","the","dir","a n","ith","bja","ye ","no "," sa","mol","lwa","ti ","man","ole","e e","tse","o w","ore","to ","at ","eth","e y","kan","tsh","gon","net","ano","kar","ge ","ho ","lok"," sw"," na","i b","dip","i o","oka"," ge"," om","ko ","emo","pel","nt ","e a","mel","leg","tlh","me ","ete","phe","a e","o n","o i","wal","oko","nya","bol","odi","weg","te ","e n","ta ","any","yeo","kga","pol","ang","ri ","it ","uto"," mm","iti","are","o f","ha ","gat","oth","ika","o h"," it","she","ath","ale","iri","pha","ahl"," te","ohl","tha"," re","bon","lha"," ph","din"," pe","ro ","mi ","omi","i t"," fa","aro","ase","i l","ne ","lal","ogo","kol"," wo","t i","omo"," be","mog","mok","len","ile","lwe","ma ","uta","nse","amo","a o"," fe","okg","ja ","pan","nag","ekg","i i","apa","get","lon","ra ","aem"," yo","atl","tlo","kel","tel"," kh"," po","e o","a w","ent","i e","bo ","gan","het","mal","a f","otl","uti","oga","sen","kwa","mae","eka","mme","kge","jal","a r","ing","lek","sep","lag","ofe","wag","g y","rol","epe","eko","bok","o p","adi","log");
-$GLOBALS["ngrams"]['pl'] = array("ie ","nie","em "," ni"," po"," pr","dzi"," na","że ","rze","na ","łem","wie"," w "," że","go "," by","prz","owa","ię "," do"," si","owi"," pa"," za","ch ","ego","ał ","się","ej ","wał","ym ","ani","ałe","to "," i "," to"," te","e p"," je"," z ","czy","był","pan","sta","kie"," ja","do "," ch"," cz"," wi","iał","a p","pow"," mi","li ","eni","zie"," ta"," wa","ło ","ać ","dy ","ak ","e w"," a "," od"," st","nia","rzy","ied"," kt","odz","cie","cze","ia ","iel","któ","o p","tór","ści"," sp"," wy","jak","tak","zy "," mo","ałę","pro","ski","tem","łęs"," tr","e m","jes","my "," ro","edz","eli","iej"," rz","a n","ale","an ","e s","est","le ","o s","i p","ki "," co","ada","czn","e t","e z","ent","ny ","pre","rzą","y s"," ko"," o ","ach","am ","e n","o t","oli","pod","zia"," go"," ka","by ","ieg","ier","noś","roz","spo","ych","ząd"," mn","acz","adz","bie","cho","mni","o n","ost","pra","ze ","ła "," so","a m","cza","iem","ić ","obi","ył ","yło"," mu"," mó","a t","acj","ci ","e b","ich","kan","mi ","mie","ośc","row","zen","zyd"," al"," re","a w","den","edy","ił ","ko ","o w","rac","śmy"," ma"," ra"," sz"," ty","e j","isk","ji ","ka ","m s","no ","o z","rez","wa ","ów ","łow","ść "," ob","ech","ecz","ezy","i w","ja ","kon","mów","ne ","ni ","now","nym","pol","pot","yde"," dl"," sy","a s","aki","ali","dla","icz","ku ","ocz","st ","str","szy","trz","wia","y p","za "," wt","chc","esz","iec","im ","la ","o m","sa ","wać","y n","zac","zec"," gd","a z","ard","co ","dar","e r","ien","m n","m w","mia","moż","raw","rdz","tan","ted","teg","wił","wte","y z","zna","zło","a r","awi","bar","cji","czą","dow","eż ","gdy","iek","je ","o d","tał","wal","wsz","zed","ówi","ęsa"," ba"," lu"," wo","aln","arn","ba ","dzo","e c","hod","igi","lig","m p","myś","o c","oni","rel","sku","ste","y w","yst","z w");
-$GLOBALS["ngrams"]['ps'] = array(" د ","اؤ "," اؤ","نو ","ې د","ره "," په","نه ","چې "," چې","په ","ه د","ته ","و ا","ونو","و د"," او","انو","ونه","ه ک"," دا","ه ا","دې ","ښې "," کې","ان ","لو ","هم ","و م","کښې","ه م","ى ا"," نو"," ته"," کښ","رون","کې ","ده ","له ","به ","رو "," هم","ه و","وى ","او ","تون","دا "," کو"," کړ","قام"," تر","ران","ه پ","ې و","ې پ"," به"," خو","تو ","د د","د ا","ه ت","و پ","يا "," خپ"," دو"," را"," مش"," پر","ارو","رې ","م د","مشر"," شو"," ور","ار ","دى "," اد"," دى"," مو","د پ","لي ","و ک"," مق"," يو","ؤ د","خپل","سره","ه چ","ور "," تا"," دې"," رو"," سر"," مل"," کا","ؤ ا","اره","برو","مه ","ه ب","و ت","پښت"," با"," دغ"," قب"," له"," وا"," پا"," پښ","د م","د ه","لې ","مات","مو ","ه ه","وي ","ې ب","ې ک"," ده"," قا","ال ","اما","د ن","قبر","ه ن","پار"," اث"," بي"," لا"," لر","اثا","د خ","دار","ريخ","شرا","مقا","نۍ ","ه ر","ه ل","ولو","يو ","کوم"," دد"," لو"," مح"," مر"," وو","اتو","اري","الو","اند","خان","د ت","سې ","لى ","نور","و ل","ي چ","ړي ","ښتو","ې ل"," جو"," سي","ام ","بان","تار","تر ","ثار","خو ","دو ","ر ک","ل د","مون","ندې","و ن","ول ","وه ","ى و","ي د","ې ا","ې ت","ې ي"," حک"," خب"," نه"," پو","ا د","تې ","جوړ","حکم","حکو","خبر","دان","ر د","غه ","قاف","محک","وال","ومت","ويل","ى د","ى م","يره","پر ","کول","ې ه"," تي"," خا"," وک"," يا"," ځا","ؤ ق","انۍ","بى ","غو ","ه خ","و ب","ودا","يدو","ړې ","کال"," بر"," قد"," مي"," وي"," کر","ؤ م","ات ","ايي","تى ","تيا","تير","خوا","دغو","دم ","ديم","ر و","قدي","م خ","مان","مې ","نيو","نږ ","ه ي","و س","و چ","وان","ورو","ونږ","پور","ړه ","ړو ","ۍ د","ې ن"," اه"," زي"," سو"," شي"," هر"," هغ"," ښا","اتل","اق ","اني","بري","بې ","ت ا","د ب","د س","ر م","رى ","عرا","لان","مى ","نى ","و خ","وئ ","ورک","ورې","ون ","وکړ","ى چ","يمه","يې ","ښتن","که ","کړي","ې خ","ے ش"," تح"," تو"," در"," دپ"," صو"," عر"," ول"," يؤ"," پۀ"," څو","ا ا");
-$GLOBALS["ngrams"]['pt'] = array("de "," de","os ","as ","que"," co","ão ","o d"," qu","ue "," a ","do ","ent"," se","a d","s d","e a","es "," pr","ra ","da "," es"," pa","to "," o ","em ","con","o p"," do","est","nte","ção"," da"," re","ma ","par"," te","ara","ida"," e ","ade","is "," um"," po","a a","a p","dad","no ","te "," no","açã","pro","al ","com","e d","s a"," as","a c","er ","men","s e","ais","nto","res","a s","ado","ist","s p","tem","e c","e s","ia ","o s","o a","o c","e p","sta","ta ","tra","ura"," di"," pe","ar ","e e","ser","uma","mos","se "," ca","o e"," na","a e","des","ont","por"," in"," ma","ect","o q","ria","s c","ste","ver","cia","dos","ica","str"," ao"," em","das","e t","ito","iza","pre","tos"," nã","ada","não","ess","eve","or ","ran","s n","s t","tur"," ac"," fa","a r","ens","eri","na ","sso"," si"," é ","bra","esp","mo ","nos","ro ","um ","a n","ao ","ico","liz","min","o n","ons","pri","ten","tic","ões"," tr","a m","aga","e n","ili","ime","m a","nci","nha","nta","spe","tiv","am ","ano","arc","ass","cer","e o","ece","emo","ga ","o m","rag","so ","são"," au"," os"," sa","ali","ca ","ema","emp","ici","ido","inh","iss","l d","la ","lic","m c","mai","onc","pec","ram","s q"," ci"," en"," fo","a o","ame","car","co ","der","eir","ho ","io ","om ","ora","r a","sen","ter"," br"," ex","a u","cul","dev","e u","ha ","mpr","nce","oca","ove","rio","s o","sa ","sem","tes","uni","ven","zaç","çõe"," ad"," al"," an"," mi"," mo"," ve"," à ","a i","a q","ala","amo","bli","cen","col","cos","cto","e m","e v","ede","gás","ias","ita","iva","ndo","o t","ore","r d","ral","rea","s f","sid","tro","vel","vid","ás "," ap"," ar"," ce"," ou"," pú"," so"," vi","a f","act","arr","bil","cam","e f","e i","el ","for","lem","lid","lo ","m d","mar","nde","o o","omo","ort","per","púb","r u","rei","rem","ros","rre","ssi");
-$GLOBALS["ngrams"]['pt_BR'] = array("eq ","ent"," en","q e","q i","g e","g i","ng "," id","ida","nte","te "," es"," in","ade","ag ","dad","de ","ia ","ing"," br"," sa","est","inq","lin","mo ","nq ","o a","seq"," co"," li"," ni"," o ","a a","a c","ado","asi","bra","dor","iq ","nta","o b","or ","q n","ras","sil","str","ta ","tre","us "," a "," ag"," an"," ca"," e "," eq"," g "," i "," ir"," nc"," q "," se"," ve","ant","ar ","cia","con","e a","eir","el ","ig ","ili","imo","io ","ir ","nci","o t","ro ","vel"," ap"," bo"," de"," fr"," tr","a b","a e","a g","a v","apo","as ","bus","ca ","cet","cin","des","e b","e s","eta","fre","i a","ibu","il ","iro","la ","liq","nib","nti","o c","o q","os ","ra ","re ","req","s a","s s","san","sim","tar","to ","ult"," ba"," ci"," el"," em"," fi"," gr"," gu"," ia"," mu"," pe"," po"," re"," ri"," si"," su"," te"," vi","a o","a s","abe","alc","and","ara","arg","ari","ben","boc","car","co ","do ","e f","e g","e l","e o","em ","emo","en ","es ","esp","exe","fic","g n","g s","gra","gua","ias","ica","idi","ila","ile","inh","l b","l e","lei","loq","mos","mul","nad","nio","nt ","nto","o g","o r","oce","ont","oq ","pos","q v","r b","r e","r i","r s","rad","ran","rem","rg ","ria","rio","s e","s p","sta","sti","tig","til","tra","ua ","ue ","va ","xeq"," ' "," ab"," ad"," ae"," al"," am"," aq"," ar"," b "," bi"," bl"," bu"," cc"," ch"," di"," et"," ex"," fa"," ic"," il"," im"," is"," it"," ll"," m "," me"," na"," ne"," ng"," nu"," ob"," ou"," pi"," qu"," ss"," st"," ti"," ub"," un"," v "," x ","' c","a d","a f","a i","a n","a p","a t","abr","aci","ad ","ada","adr","aer","afe","alv","amb","amp","an ","ana","ang","anh","ani","ano","anq","apa","aq ","ati","ato","azi","b n","ban","bar","big","bil","biq","bli","blu","bon","bre","bri","bse","buc","c f","c i","cad","caf","cag","cal","can","cc ");
-$GLOBALS["ngrams"]['pt_PT'] = array("equ","ent","que","qui","gui","uen"," li","ngu","qu ","uid"," co"," ve","de ","gue","ida","nte","o a","a a","ade","dad","el ","ing","mo ","nqu","nta","seq","u n","vel"," de"," o "," se","a c","ado","ar ","est","ia ","inq","io ","iqu","lin","o c","o p","ort","por","ta ","te "," ag"," eq"," nc"," pi"," po"," sa","a d","a e","ant","as ","ca ","cia","des","do ","gu ","imo","l p","nci","ro ","rtu","str","tug","u s","ues","ui "," a "," an"," ap"," ba"," bi"," ca"," fr"," gu"," in"," pe"," qu","agu","apa","con","dor","e f","e g","eir","fre","ho ","i a","ica","igu","iro","liq","nti","o b","o l","o s","or ","r o","ra ","req","s c","sim","tar","to ","ue ","uin","ult"," ci"," en"," ho"," mu"," ni"," re"," s "," si"," su","a s","a v","abe","ag ","al ","and","anh","apo","ata","ban","ben","bic","boi","cap","car","cin","co ","com","cto","dei","e b","e o","e s","eca","en ","er ","es ","exe","fic","for","gal","gra","ias","ich","ico","idi","ili","ir ","ira","isb","la ","lis","mbo","mul","na ","nho","nio","nt ","o q","o r","o t","oc ","oio","omb","oo ","os ","par","pe ","r b","r e","r s","ran","re ","rec","s a","s s","san","sbo","so ","sta","tan","tra","tre","u v","uga","ugu","xeq"," ab"," ad"," al"," am"," aq"," ar"," au"," b "," bo"," c "," ch"," ct"," cu"," el"," es"," ex"," fa"," fi"," ga"," gr"," id"," ir"," ne"," ng"," nu"," ob"," oo"," pa"," ps"," pt"," r "," ra"," ri"," ss"," st"," ta"," te"," tr"," ub"," un"," vi"," vo","a f","a i","a l","a m","a o","a r","ach","aci","act","ad ","afa","age","agr","alf","alh","am ","amb","ami","ana","ang","anq","aqu","ara","arb","arc","arg","ari","arr","asa","ati","aut","azi","b n","bar","bat","ber","big","bil","biq","bli","boa","boe","bor","bse","c i","c l","c p","cad","cam","cas","ch ","cha","che","chi","cio","coc","coi","cou","ctr","cue","cul");
-$GLOBALS["ngrams"]['ro'] = array(" de"," în","de "," a ","ul "," co","în ","re ","e d","ea "," di"," pr","le ","şi ","are","at ","con","ui "," şi","i d","ii "," cu","e a","lui","ern","te ","cu "," la","a c","că ","din","e c","or ","ulu","ne ","ter","la ","să ","tat","tre"," ac"," să","est","st ","tă "," ca"," ma"," pe","cur","ist","mân","a d","i c","nat"," ce","i a","ia ","in ","scu"," mi","ato","aţi","ie "," re"," se","a a","int","ntr","tru","uri","ă a"," fo"," pa","ate","ini","tul","ent","min","pre","pro","a p","e p","e s","ei ","nă ","par","rna","rul","tor"," in"," ro"," tr"," un","al ","ale","art","ce ","e e","e î","fos","ita","nte","omâ","ost","rom","ru ","str","ver"," ex"," na","a f","lor","nis","rea","rit"," al"," eu"," no","ace","cer","ile","nal","pri","ri ","sta","ste","ţie"," au"," da"," ju"," po","ar ","au ","ele","ere","eri","ina","n a","n c","res","se ","t a","tea"," că"," do"," fi","a s","ată","com","e ş","eur","guv","i s","ice","ili","na ","rec","rep","ril","rne","rti","uro","uve","ă p"," ar"," o "," su"," vi","dec","dre","oar","ons","pe ","rii"," ad"," ge","a m","a r","ain","ali","car","cat","ecu","ene","ept","ext","ilo","iu ","n p","ori","sec","u p","une","ă c","şti","ţia"," ch"," gu","ai ","ani","cea","e f","isc","l a","lic","liu","mar","nic","nt ","nul","ris","t c","t p","tic","tid","u a","ucr"," as"," dr"," fa"," nu"," pu"," to","cra","dis","enţ","esc","gen","it ","ivi","l d","n d","nd ","nu ","ond","pen","ral","riv","rte","sti","t d","ta ","to ","uni","xte","ând","îns","ă s"," bl"," st"," uc","a b","a i","a l","air","ast","bla","bri","che","duc","dul","e m","eas","edi","esp","i l","i p","ica","ică","ir ","iun","jud","lai","lul","mai","men","ni ","pus","put","ra ","rai","rop","sil","ti ","tra","u s","ua ","ude","urs","ân ","înt","ţă "," lu"," mo"," s "," sa"," sc","a u","an ","atu");
-$GLOBALS["ngrams"]['ru'] = array(" на"," пр","то "," не","ли "," по","но "," в ","на ","ть ","не "," и "," ко","ом ","про"," то","их "," ка","ать","ото"," за","ие ","ова","тел","тор"," де","ой ","сти"," от","ах ","ми ","стр"," бе"," во"," ра","ая ","ват","ей ","ет ","же ","иче","ия ","ов ","сто"," об","вер","го ","и в","и п","и с","ии ","ист","о в","ост","тра"," те","ели","ере","кот","льн","ник","нти","о с","рор","ств","чес"," бо"," ве"," да"," ин"," но"," с "," со"," сп"," ст"," чт","али","ами","вид","дет","е н","ель","еск","ест","зал","и н","ива","кон","ого","одн","ожн","оль","ори","ров","ско","ся ","тер","что"," мо"," са"," эт","ант","все","ерр","есл","иде","ина","ино","иро","ите","ка ","ко ","кол","ком","ла ","ния","о т","оло","ран","ред","сь ","тив","тич","ых "," ви"," вс"," го"," ма"," сл","ако","ани","аст","без","дел","е д","е п","ем ","жно","и д","ика","каз","как","ки ","нос","о н","опа","при","рро","ски","ти ","тов","ые "," вы"," до"," ме"," ни"," од"," ро"," св"," чи","а н","ает","аза","ате","бес","в п","ва ","е в","е м","е с","ез ","ени","за ","зна","ини","кам","ках","кто","лов","мер","мож","нал","ниц","ны ","ным","ора","оро","от ","пор","рав","рес","рис","рос","ска","т н","том","чит","шко"," бы"," о "," тр"," уж"," чу"," шк","а б","а в","а р","аби","ала","ало","аль","анн","ати","бин","вес","вно","во ","вши","дал","дат","дно","е з","его","еле","енн","ент","ете","и о","или","ись","ит ","ици","ков","лен","льк","мен","мы ","нет","ни ","нны","ног","ной","ном","о п","обн","ове","овн","оры","пер","по ","пра","пре","раз","роп","ры ","се ","сли","сов","тре","тся","уро","цел","чно","ь в","ько","ьно","это","ют ","я н"," ан"," ес"," же"," из"," кт"," ми"," мы"," пе"," се"," це","а м","а п","а т","авш","аже","ак ","ал ","але","ане","ачи","ают","бна","бол","бы ","в и","в с","ван","гра","даж","ден","е к");
-$GLOBALS["ngrams"]['sk'] = array(" pr"," po"," ne"," a ","ch "," na"," je","ní ","je "," do","na ","ova"," v ","to ","ho ","ou "," to","ick","ter","že "," st"," za","ost","ých"," se","pro"," te","e s"," že","a p"," kt","pre"," by"," o ","se ","kon"," př","a s","né ","ně ","sti","ako","ist","mu ","ame","ent","ky ","la ","pod"," ve"," ob","om ","vat"," ko","sta","em ","le ","a v","by ","e p","ko ","eri","kte","sa ","ého","e v","mer","tel"," ak"," sv"," zá","hla","las","lo "," ta","a n","ej ","li ","ne "," sa","ak ","ani","ate","ia ","sou"," so","ení","ie "," re","ce ","e n","ori","tic"," vy","a t","ké ","nos","o s","str","ti ","uje"," sp","lov","o p","oli","ová"," ná","ale","den","e o","ku ","val"," am"," ro"," si","nie","pol","tra"," al","ali","o v","tor"," mo"," ni","ci ","o n","ím "," le"," pa"," s ","al ","ati","ero","ove","rov","ván","ích"," ja"," z ","cké","e z"," od","byl","de ","dob","nep","pra","ric","spo","tak"," vš","a a","e t","lit","me ","nej","no ","nýc","o t","a j","e a","en ","est","jí ","mi ","slo","stá","u v","for","nou","pos","pře","si ","tom"," vl","a z","ly ","orm","ris","za ","zák"," k ","at ","cký","dno","dos","dy ","jak","kov","ny ","res","ror","sto","van"," op","da ","do ","e j","hod","len","ný ","o z","poz","pri","ran","u s"," ab","aj ","ast","it ","kto","o o","oby","odo","u p","va ","ání","í p","ým "," in"," mi","ať ","dov","ka ","nsk","áln"," an"," bu"," sl"," tr","e m","ech","edn","i n","kýc","níc","ov ","pří","í a"," aj"," bo","a d","ide","o a","o d","och","pov","svo","é s"," kd"," vo"," vý","bud","ich","il ","ili","ni ","ním","od ","osl","ouh","rav","roz","st ","stv","tu ","u a","vál","y s","í s","í v"," hl"," li"," me","a m","e b","h s","i p","i s","iti","lád","nem","nov","opo","uhl","eno","ens","men","nes","obo","te ","ved","vlá","y n"," ma"," mu"," vá","bez","byv","cho");
-$GLOBALS["ngrams"]['sl'] = array("je "," pr"," po"," je"," v "," za"," na","pre","da "," da","ki ","ti ","ja ","ne "," in","in ","li ","no ","na ","ni "," bi","jo "," ne","nje","e p","i p","pri","o p","red"," do","anj","em ","ih "," bo"," ki"," iz"," se"," so","al "," de","e v","i s","ko ","bil","ira","ove"," br"," ob","e b","i n","ova","se ","za ","la "," ja","ati","so ","ter"," ta","a s","del","e d"," dr"," od","a n","ar ","jal","ji ","rit"," ka"," ko"," pa","a b","ani","e s","er ","ili","lov","o v","tov"," ir"," ni"," vo","a j","bi ","bri","iti","let","o n","tan","še "," le"," te","eni","eri","ita","kat","por","pro","ali","ke ","oli","ov ","pra","ri ","uar","ve "," to","a i","a v","ako","arj","ate","di ","do ","ga ","le ","lo ","mer","o s","oda","oro","pod"," ma"," mo"," si","a p","bod","e n","ega","ju ","ka ","lje","rav","ta ","a o","e t","e z","i d","i v","ila","lit","nih","odo","sti","to ","var","ved","vol"," la"," no"," vs","a d","agu","aja","dej","dnj","eda","gov","gua","jag","jem","kon","ku ","nij","omo","oči","pov","rak","rja","sta","tev","a t","aj ","ed ","eja","ent","ev ","i i","i o","ijo","ist","ost","ske","str"," ra"," s "," tr"," še","arn","bo ","drž","i j","ilo","izv","jen","lja","nsk","o d","o i","om ","ora","ovo","raz","rža","tak","va ","ven","žav"," me"," če","ame","avi","e i","e o","eka","gre","i t","ija","il ","ite","kra","lju","mor","nik","o t","obi","odn","ran","re ","sto","stv","udi","v i","van"," am"," sp"," st"," tu"," ve"," že","ajo","ale","apo","dal","dru","e j","edn","ejo","elo","est","etj","eva","iji","ik ","im ","itv","mob","nap","nek","pol","pos","rat","ski","tič","tom","ton","tra","tud","tve","v b","vil","vse","čit"," av"," gr","a z","ans","ast","avt","dan","e m","eds","for","i z","kot","mi ","nim","o b","o o","od ","odl","oiz","ot ","par","pot","rje","roi","tem","val");
-$GLOBALS["ngrams"]['so'] = array("ka ","ay ","da "," ay","aal","oo ","aan"," ka","an ","in "," in","ada","maa","aba"," so","ali","bad","add","soo"," na","aha","ku ","ta "," wa","yo ","a s","oma","yaa"," ba"," ku"," la"," oo","iya","sha","a a","dda","nab","nta"," da"," ma","nka","uu ","y i","aya","ha ","raa"," dh"," qa","a k","ala","baa","doo","had","liy","oom"," ha"," sh","a d","a i","a n","aar","ee ","ey ","y k","ya "," ee"," iy","aa ","aaq","gaa","lam"," bu","a b","a m","ad ","aga","ama","iyo","la ","a c","a l","een","int","she","wax","yee"," si"," uu","a h","aas","alk","dha","gu ","hee","ii ","ira","mad","o a","o k","qay"," ah"," ca"," wu","ank","ash","axa","eed","en ","ga ","haa","n a","n s","naa","nay","o d","taa","u b","uxu","wux","xuu"," ci"," do"," ho"," ta","a g","a u","ana","ayo","dhi","iin","lag","lin","lka","o i","san","u s","una","uun"," ga"," xa"," xu","aab","abt","aq ","aqa","ara","arl","caa","cir","eeg","eel","isa","kal","lah","ney","qaa","rla","sad","sii","u d","wad"," ad"," ar"," di"," jo"," ra"," sa"," u "," yi","a j","a q","aad","aat","aay","ah ","ale","amk","ari","as ","aye","bus","dal","ddu","dii","du ","duu","ed ","ege","gey","hay","hii","ida","ine","joo","laa","lay","mar","mee","n b","n d","n m","no ","o b","o l","oog","oon","rga","sh ","sid","u q","unk","ush","xa ","y d"," bi"," gu"," is"," ke"," lo"," me"," mu"," qo"," ug","a e","a o","a w","adi","ado","agu","al ","ant","ark","asa","awi","bta","bul","d a","dag","dan","do ","e s","gal","gay","guu","h e","hal","iga","ihi","iri","iye","ken","lad","lid","lsh","mag","mun","n h","n i","na ","o n","o w","ood","oor","ora","qab","qor","rab","rit","rta","s o","sab","ska","to ","u a","u h","u u","ud ","ugu","uls","uud","waa","xus","y b","y q","y s","yad","yay","yih"," aa"," bo"," br"," go"," ji"," mi"," of"," ti"," um"," wi"," xo","a x");
-$GLOBALS["ngrams"]['sq'] = array("të "," të","në ","për"," pë"," e ","sht"," në"," sh","se ","et ","ë s","ë t"," se","he ","jë ","ër ","dhe"," pa","ë n","ë p"," që"," dh","një","ë m"," nj","ësh","in "," me","që "," po","e n","e t","ish","më ","së ","me ","htë"," ka"," si","e k","e p"," i ","anë","ar "," nu","und","ve "," ës","e s"," më","nuk","par","uar","uk ","jo ","rë ","ta ","ë f","en ","it ","min","het","n e","ri ","shq","ë d"," do"," nd","sh ","ën ","atë","hqi","ist","ë q"," gj"," ng"," th","a n","do ","end","imi","ndi","r t","rat","ë b","ëri"," mu","art","ash","qip"," ko","e m","edh","eri","je ","ka ","nga","si ","te ","ë k","ësi"," ma"," ti","eve","hje","ira","mun","on ","po ","re "," pr","im ","lit","o t","ur ","ë e","ë v","ët "," ku"," së","e d","es ","ga ","iti","jet","ndë","oli","shi","tje"," bë"," z ","gje","kan","shk","ënd","ës "," de"," kj"," ru"," vi","ara","gov","kjo","or ","r p","rto","rug","tet","ugo","ali","arr","at ","d t","ht ","i p","ipë","izi","jnë","n n","ohe","shu","shë","t e","tik","a e","arë","etë","hum","nd ","ndr","osh","ova","rim","tos","va "," fa"," fi","a s","hen","i n","mar","ndo","por","ris","sa ","sis","tës","umë","viz","zit"," di"," mb","aj ","ana","ata","dër","e a","esh","ime","jes","lar","n s","nte","pol","r n","ran","res","rrë","tar","ë a","ë i"," at"," jo"," kë"," re","a k","ai ","akt","hë ","hën","i i","i m","ia ","men","nis","shm","str","t k","t n","t s","ë g","ërk","ëve"," ai"," ci"," ed"," ja"," kr"," qe"," ta"," ve","a p","cil","el ","erë","gji","hte","i t","jen","jit","k d","mën","n t","nyr","ori","pas","ra ","rie","rës","tor","uaj","yre","ëm ","ëny"," ar"," du"," ga"," je","dës","e e","e z","ha ","hme","ika","ini","ite","ith","koh","kra","ku ","lim","lis","qën","rën","s s","t d","t t","tir","tën","ver","ë j"," ba"," in"," tr"," zg","a a","a m","a t","abr");
-$GLOBALS["ngrams"]['sr'] = array(" на"," је"," по","је "," и "," не"," пр","га "," св","ог ","а с","их ","на ","кој","ога"," у ","а п","не ","ни ","ти "," да","ом "," ве"," ср","и с","ско"," об","а н","да ","е н","но ","ног","о ј","ој "," за","ва ","е с","и п","ма ","ник","обр","ова"," ко","а и","диј","е п","ка ","ко ","ког","ост","све","ств","сти","тра","еди","има","пок","пра","раз","те "," бо"," ви"," са","аво","бра","гос","е и","ели","ени","за ","ики","ио ","пре","рав","рад","у с","ју ","ња "," би"," до"," ст","аст","бој","ебо","и н","им ","ку ","лан","неб","ово","ого","осл","ојш","пед","стр","час"," го"," кр"," мо"," чл","а м","а о","ако","ача","вел","вет","вог","еда","ист","ити","ије","око","сло","срб","чла"," бе"," ос"," от"," ре"," се","а в","ан ","бог","бро","вен","гра","е о","ика","ија","ких","ком","ли ","ну ","ота","ојн","под","рбс","ред","рој","са ","сни","тач","тва","ја ","ји "," ка"," ов"," тр","а ј","ави","аз ","ано","био","вик","во ","гов","дни","е ч","его","и о","ива","иво","ик ","ине","ини","ипе","кип","лик","ло ","наш","нос","о т","од ","оди","она","оји","поч","про","ра ","рис","род","рст","се ","спо","ста","тић","у д","у н","у о","чин","ша ","јед","јни","ће "," м "," ме"," ни"," он"," па"," сл"," те","а у","ава","аве","авн","ана","ао ","ати","аци","ају","ања","бск","вор","вос","вск","дин","е у","едн","ези","ека","ено","ето","ења","жив","и г","и и","и к","и т","ику","ичк","ки ","крс","ла ","лав","лит","ме ","мен","нац","о н","о п","о у","одн","оли","орн","осн","осп","оче","пск","реч","рпс","сво","ски","сла","срп","су ","та ","тав","тве","у б","јез","ћи "," ен"," жи"," им"," му"," од"," су"," та"," хр"," ча"," шт"," ње","а д","а з","а к","а т","аду","ало","ани","асо","ван","вач","вањ","вед","ви ","вно","вот","вој","ву ","доб","дру","дсе","ду ","е б","е д","е м","ем ","ема","ент","енц");
-$GLOBALS["ngrams"]['ss'] = array(" ku"," le","la ","eku","a k","nga"," ng","a n","nge","a l","lo "," ne","eti","kwe","ndz","e n","o l"," lo","ela","ema","ent","si "," kw","tsi","i l","wa ","lel","kut","e k","und","ni ","elo","fun","esi"," si","ele","tin","tfo"," ti","le ","kha","tse","e l","pha","ung","i k"," em","ti ","sa "," um","isa","eli","ndl","ing","set","we ","ise","na ","ang","etf","khe","and","o n"," we","nti","nye","tfu","ben","a e","uts","let","dza","imi","sek","ko ","lok","eni","ye ","ba ","nkh","ebe","alo","o k","lan","ga ","aba","seb"," ye","he ","lwa","kel"," te"," la","kus","wem","ati","ikh","nek","ala","kuf","i n","oku","ats","mts","hla","wen","a t"," na","gek","uhl","kub","ngu","ka ","aka","fut","kan","kwa"," li","kuc","onk","ban","ana","ulu"," se"," im","akh","ume","a i","les","tim","ula","ini","lwe","za ","fo ","hul"," no","han","li ","iph","a s","tis","khu","ta ","dzi","be ","emi","ma ","end","o t","eke","a u"," ka","ane","lek","mel","elw","kun","sis","lon","utf","any","kho","kul","hlo"," ba","ufu","aph","lun","e s","hal","ind","isw","o s","use","ekw","me ","ndv","eng","uph","hat","ne ","so ","lul","nom","te ","lol","awu","nel","lu ","ha ","wat","men","ete"," lw","nem","ako","zin","kuh","sha","bha","gab"," in","ale","mis","tem","e e","o e","e t","wek","dze","ome","wel"," lu","emb","nis"," ek","tsa","u l","o y","dle","ute","len","swa","phe","mkh","ntf","uke","sit","iny","e i","wo ","ani","phi","wet","sin","nhl","mal","mba","mfu","fu ","lab","sik","taw","no ","hle","e u","eki","ase","ali","ulw","ve ","eka","zel","nta","bon","tek","bo ","sig","ama","ile","ule","tfw","mph","uma","kup","emt","asi","dlu","ish","umt","gen","o w","ike","iga","hak","abe","net","gan","kis","nde","ngi","ukh","bek","mo ","phu","sel","elu","i t","ant","dvo","a y","vo ","hum","lis","dla","gam","ive","jen","ket");
-$GLOBALS["ngrams"]['st'] = array("ng ","ho "," le","le "," ho"," ts","a m","sa ","la "," ka","a h"," di","ya ","ka "," ya","a t","eng","ets"," ba"," mo","a l"," se","lo "," bo","wa ","tsa","a b","na ","ba "," e "," a ","a k"," ma","ang","tse","se ","o t","a d","a s","ha ","so ","o l","e h","o y","e t","tla","tsh","olo","e l","e m","o b","o e","seb","ebe","ela","thu","ele","e k","ana","e b"," th"," ha","tso","o a","o k"," wa","kgo","tsw","tho","o h","ong"," la","hut","dit","ane"," me","a e"," tl","ola","edi","elo","di ","ona"," ke","wan"," o ","a p","apa","tjh","hlo"," sa","she","let","aba","lok","lao","eo ","a a","o s","man","to "," hl","a n","isa","e d","swe","set","pa "," na","o m","g l","het"," kg","got","aha","eth","re ","e e","jha","phe","lan","otl","g k","lek","its","ekg","sen","ao ","dis","g m","oth","e a","ith","hla","e s","ke ","mol","pel","g h","hab","bet","san","ats","mo ","lwa","we ","ala","len","nts","dip","kap","iso"," mm","uto","alo","e n","si ","ta ","o w","emo","swa","tsi","oke","bed","the"," ph","a y","wen","ken","ena","hwa","ne ","ore","atl","ano","hel","mot","bo ","g t","i b","kga","hor","ngo","nan","no ","o n","tlh","shw","kel","pha","etj","bon","ell","g s","gol","tha","ale","dik","kol","bak"," nt","ika","o d"," te","ohl","g y"," lo","ti ","his","ile","g b","oko"," et","han","a o","mat","oho","odi","lel","mel","din","kar","o o","uo ","mon","hah","te ","me "," it","o f","nen","heb","ing","bol","bel","hle","puo","lal","tlo","hal","oph","eba","hat","heo","aro","bat","ko ","ban","leh","o i","ole","tle"," fe","kge","pan","ake","g e","aka","eko"," pe","rik","e y","mme","ama","lha","eha"," fa","ebo","moh","mae","ete","aem","ots","ahi","o p","uta","okg","ntl","pal","get","i l","e f","oka","sep","lat","ahl","bot","ese","lah","lon","akg","a f"," pu","ase","g a","mor","kan","nah","boh","e p");
-$GLOBALS["ngrams"]['sv'] = array("en "," de","et ","er ","tt ","om ","för","ar ","de ","att"," fö","ing"," in"," at"," i ","det","ch ","an ","gen"," an","t s","som","te "," oc","ter"," ha","lle","och"," sk"," so","ra ","r a"," me","var","nde","är "," ko","on ","ans","int","n s","na "," en"," fr"," på"," st"," va","and","nte","på ","ska","ta "," vi","der","äll","örs"," om","da ","kri","ka ","nst"," ho","as ","stä","r d","t f","upp"," be","nge","r s","tal","täl","ör "," av","ger","ill","ng ","e s","ekt","ade","era","ers","har","ll ","lld","rin","rna","säk","und","inn","lig","ns "," ma"," pr"," up","age","av ","iva","kti","lda","orn","son","ts ","tta","äkr"," sj"," ti","avt","ber","els","eta","kol","men","n d","t k","vta","år ","juk","man","n f","nin","r i","rsä","sju","sso"," är","a s","ach","ag ","bac","den","ett","fte","hor","nba","oll","rnb","ste","til"," ef"," si","a a","e h","ed ","eft","ga ","ig ","it ","ler","med","n i","nd ","så ","tiv"," bl"," et"," fi"," sä","at ","des","e a","gar","get","lan","lss","ost","r b","r e","re ","ret","sta","t i"," ge"," he"," re","a f","all","bos","ets","lek","let","ner","nna","nne","r f","rit","s s","sen","sto","tor","vav","ygg"," ka"," så"," tr"," ut","ad ","al ","are","e o","gon","kom","n a","n h","nga","r h","ren","t d","tag","tar","tre","ätt"," få"," hä"," se","a d","a i","a p","ale","ann","ara","byg","gt ","han","igt","kan","la ","n o","nom","nsk","omm","r k","r p","r v","s f","s k","t a","t p","ver"," bo"," br"," ku"," nå","a b","a e","del","ens","es ","fin","ige","m s","n p","någ","or ","r o","rbe","rs ","rt ","s a","s n","skr","t o","ten","tio","ven"," al"," ja"," p "," r "," sa","a h","bet","cke","dra","e f","e i","eda","eno","erä","ess","ion","jag","m f","ne ","nns","pro","r t","rar","riv","rät","t e","t t","ust","vad","öre"," ar"," by"," kr"," mi","arb");
-$GLOBALS["ngrams"]['sw'] = array(" wa","wa ","a k","a m"," ku"," ya","a w","ya ","ni "," ma","ka ","a u","na ","za ","ia "," na","ika","ma ","ali","a n"," am","ili","kwa"," kw","ini"," ha","ame","ana","i n"," za","a h","ema","i m","i y","kuw","la ","o w","a y","ata","sem"," la","ati","chi","i w","uwa","aki","li ","eka","ira"," nc","a s","iki","kat","nch"," ka"," ki","a b","aji","amb","ra ","ri ","rik","ada","mat","mba","mes","yo ","zi ","da ","hi ","i k","ja ","kut","tek","wan"," bi","a a","aka","ao ","asi","cha","ese","eza","ke ","moj","oja"," hi","a z","end","ha ","ji ","mu ","shi","wat"," bw","ake","ara","bw ","i h","imb","tik","wak","wal"," hu"," mi"," mk"," ni"," ra"," um","a l","ate","esh","ina","ish","kim","o k"," ir","a i","ala","ani","aq ","azi","hin","i a","idi","ima","ita","rai","raq","sha"," ms"," se","afr","ama","ano","ea ","ele","fri","go ","i i","ifa","iwa","iyo","kus","lia","lio","maj","mku","no ","tan","uli","uta","wen"," al","a j","aad","aid","ari","awa","ba ","fa ","nde","nge","nya","o y","u w","ua ","umo","waz","ye "," ut"," vi","a d","a t","aif","di ","ere","ing","kin","nda","o n","oa ","tai","toa","usa","uto","was","yak","zo "," ji"," mw","a p","aia","amu","ang","bik","bo ","del","e w","ene","eng","ich","iri","iti","ito","ki ","kir","ko ","kuu","mar","mbo","mil","ngi","ngo","o l","ong","si ","ta ","tak","u y","umu","usi","uu ","wam"," af"," ba"," li"," si"," zi","a v","ami","atu","awi","eri","fan","fur","ger","i z","isi","izo","lea","mbi","mwa","nye","o h","o m","oni","rez","saa","ser","sin","tat","tis","tu ","uin","uki","ur ","wi ","yar"," da"," en"," mp"," ny"," ta"," ul"," we","a c","a f","ais","apo","ayo","bar","dhi","e a","eke","eny","eon","hai","han","hiy","hur","i s","imw","kal","kwe","lak","lam","mak","msa","ne ","ngu","ru ","sal","swa","te ","ti ","uku","uma","una","uru");
-$GLOBALS["ngrams"]['tl'] = array("ng ","ang"," na"," sa","an ","nan","sa ","na "," ma"," ca","ay ","n g"," an","ong"," ga","at "," pa","ala"," si","a n","ga ","g n","g m","ito","g c","man","san","g s","ing","to ","ila","ina"," di"," ta","aga","iya","aca","g t"," at","aya","ama","lan","a a","qui","a c","a s","nag"," ba","g i","tan","'t "," cu","aua","g p"," ni","os ","'y ","a m"," n ","la "," la","o n","yan"," ay","usa","cay","on ","ya "," it","al ","apa","ata","t n","uan","aha","asa","pag"," gu","g l","di ","mag","aba","g a","ara","a p","in ","ana","it ","si ","cus","g b","uin","a t","as ","n n","hin"," hi","a't","ali"," bu","gan","uma","a d","agc","aqu","g d"," tu","aon","ari","cas","i n","niy","pin","a i","gca","siy","a'y","yao","ag ","ca ","han","ili","pan","sin","ual","n s","nam"," lu","can","dit","gui","y n","gal","hat","nal"," is","bag","fra"," fr"," su","a l"," co","ani"," bi"," da","alo","isa","ita","may","o s","sil","una"," in"," pi","l n","nil","o a","pat","sac","t s"," ua","agu","ail","bin","dal","g h","ndi","oon","ua "," ha","ind","ran","s n","tin","ulo","eng","g f","ini","lah","lo ","rai","rin","ton","g u","inu","lon","o'y","t a"," ar","a b","ad ","bay","cal","gya","ile","mat","n a","pau","ra ","tay","y m","ant","ban","i m","nas","nay","no ","sti"," ti","ags","g g","ta ","uit","uno"," ib"," ya","a u","abi","ati","cap","ig ","is ","la'"," do"," pu","api","ayo","gos","gul","lal","tag","til","tun","y c","y s","yon","ano","bur","iba","isi","lam","nac","nat","ni ","nto","od ","pa ","rgo","urg"," m ","adr","ast","cag","gay","gsi","i p","ino","len","lin","m g","mar","nah","to'"," de","a h","cat","cau","con","iqu","lac","mab","min","og ","par","sal"," za","ao ","doo","ipi","nod","nte","uha","ula"," re","ill","lit","mac","nit","o't","or ","ora","sum","y p"," al"," mi"," um","aco","ada","agd","cab");
-$GLOBALS["ngrams"]['tlh'] = array("tlh","e' ","gh ","i' "," 'e","u' "," vi","atl","a' "," gh","ej "," ho"," ch"," mu"," tl","nga","mey","wi'","be'","an ","ch ","gan","chu","lh ","ing","'e'","hin","jat","lhi"," da"," ja","o' ","ugh","aq ","cha"," po","ey "," 'a"," je","'ej"," pa","ng ","ad "," qa","oh ","eh ","ah ","gha","je "," lu","hol","aw'"," ji","ong","pu'","aj ","vad","w' ","' j","ha'","is ","tah","' '","ang","h '","pon","am ","law","mo'","qu'","hbe","ol ","vam","agh","mu'","ahv","bej","ogh","uch","' v","ach","hug"," lo"," qu","cho","hva","ij "," la","lu'","vis"," ne"," pu"," so"," ta"," va","'ac","di'","hu'","lah","moh"," 'o","' m","daq","hah","n h","neh","u'm","ay'","gho","h v","meh","oy "," ma"," nu","'me","el "," ba"," be"," de"," ng","' t","h d","hvi","oq "," wa","' l","'wi","hme","li'","uq "," bo","bog","del","h p","h t","ich","vil"," qe"," wi","ahb","ban","eng","haq","hoh","ov ","viq"," ha"," ti","' n","' p","'a'","hwi","igh","lo'","y' "," du"," no"," yu","'mo","'va","daj","das","egh","hom","muc","om ","otl","us "," bi"," tu","' h","chm","h q","hov","nis","qar","uj ","' q","'ch","h m","hmo","jih","par","wij"," hu","' d","'a ","etl","h g","h j","h l","lod","maq","och","wa'","yuq"," di"," le"," pe"," ya","'di","che","ech","ih ","ija","in ","j '","j m","lhw","pa'"," 'i"," mi"," qi"," ro"," ru","'be","anp","ghi","ghu","h b","hay","hch","iq ","npu","od ","paq","qay","rda","soh"," do"," me"," qo"," sa","' c","' g","' s","'lu","aml","ard","as ","d p","gme","h n","hta","i'v","j j","jij","len","ngm","qan","qme","vaj","wiv"," mo"," ni","'la","'pu","'qu","ar ","arm","dwi","g p","ghd","h c","ham","hla","hqu","ilo","iqa","iqi","j p","j t","j v","lad","lho","mar","mug","pus","q s","q t","rgh","rma","sov","ta'","tin","tu'","u'd","vet","yli","yu'"," to","'oh","aqq","art","at ","ayl","ayt","et ","haj","har");
-$GLOBALS["ngrams"]['tn'] = array(" di"," le","go ","le "," go","ng "," ts","ya "," ya","sa ","tlh"," mo"," bo","a m","lo ","tsa"," e ","o t","a b","wa "," ka","a k","a t","ka ","a g","eng","olo","o y","la "," a ","a d","ets","mo ","se "," tl"," ba","tsh"," ma","ba ","a l","tse","so ","na ","elo"," se","ele","e d","o l","lho","e t","di ","e g"," kg","dit","kgo","o k","ang","lha","e m","e e","we ","ane","o m","e k","e l","ong","set","wan","ela","tso","tla","o d","e b","ola","ngw","gwe","o b","aba","atl","a p"," o ","a a","o a","otl","a s","o e","dir","thu","ga "," ga","shw","ots","aka","hab","hwa","aga","o g","gan","tsw","ana","mol"," ke","hut"," me","ona","lel","its","lao","kga","dik","got"," fa","let"," wa","ose","no ","t h","swe","edi","ats","a n","e s","oko","oth","kwa","kar"," th","a e","ala","tir","o n","dip","isa","gat","ti ","ano","bot"," nn"," ha","len","alo","any","aro","iti","iri","o s","sen","net","ke ","ho ","mai","ika","eka","to ","ith","re ","g m","hat","bo ","g l","et ","emo","ama","iso","rol","fa ","iwa","kan","she","si ","ao ","g k","wen","lol","o o","bos","itl","a y","the","lwa","e n"," la","ore"," mm","ko ","tha","e a","eo ","lhe","bol","ha "," po","isi","i b","lan"," na","i t","ale","ne ","gon","ris","ira","bon"," sa","g y","g g","pha","oga","mel","ro ","gol","o w"," kw","i l"," ti","tlo","log","por"," ja","a f"," ne","hok","lot"," pu","e y","uto","g t","hom","okg"," ko","o f","ame","gor","ta "," pe","nts"," kh","tho","gel","adi","are","ete","ase","mon","heo","oro","omo","nen","nel","ile","nng","ntl","abo","ogo","ara","nse","ego","hel","uo ","mog","san","ula","rag","kol","te ","etl","bat"," te","puo","amo","ofe","lat","ati","ole","rab","tsi","iro","man","ael","ega","lwe","ra ","din","tle","sek","ing","yo ","a o"," re","aot","uso","o r","ere","jwa","aem","lam","lek"," jw","gwa","mok");
-$GLOBALS["ngrams"]['tr'] = array("lar","en ","ler","an ","in "," bi"," ya","eri","de "," ka","ir ","arı"," ba"," de"," ha","ın ","ara","bir"," ve"," sa","ile","le ","nde","da "," bu","ana","ini","ını","er ","ve "," yı","lma","yıl"," ol","ar ","n b","nda","aya","li ","ası"," ge","ind","n k","esi","lan","nla","ak ","anı","eni","ni ","nı ","rın","san"," ko"," ye","maz","baş","ili","rin","alı","az ","hal","ınd"," da"," gü","ele","ılm","ığı","eki","gün","i b","içi","den","kar","si "," il","e y","na ","yor","ek ","n s"," iç","bu ","e b","im ","ki ","len","ri ","sın"," so","ün "," ta","nin","iği","tan","yan"," si","nat","nın","kan","rı ","çin","ğı ","eli","n a","ır "," an","ine","n y","ola"," ar","al ","e s","lik","n d","sin"," al"," dü","anl","ne ","ya ","ım ","ına"," be","ada","ala","ama","ilm","or ","sı ","yen"," me","atı","di ","eti","ken","la ","lı ","oru"," gö"," in","and","e d","men","un ","öne","a d","at ","e a","e g","yar"," ku","ayı","dan","edi","iri","ünü","ği ","ılı","eme","eği","i k","i y","ıla"," ça","a y","alk","dı ","ede","el ","ndı","ra ","üne"," sü","dır","e k","ere","ik ","imi","işi","mas","n h","sür","yle"," ad"," fi"," gi"," se","a k","arl","aşı","iyo","kla","lığ","nem","ney","rme","ste","tı ","unl","ver"," sı"," te"," to","a s","aşk","ekl","end","kal","liğ","min","tır","ulu","unu","yap","ye ","ı i","şka","ştı"," bü"," ke"," ki","ard","art","aşa","n i","ndi","ti ","top","ı b"," va"," ön","aki","cak","ey ","fil","isi","kle","kur","man","nce","nle","nun","rak","ık "," en"," yo","a g","lis","mak","n g","tir","yas"," iş"," yö","ale","bil","bul","et ","i d","iye","kil","ma ","n e","n t","nu ","olu","rla","te ","yön","çık"," ay"," mü"," ço"," çı","a a","a b","ata","der","gel","i g","i i","ill","ist","ldı","lu ","mek","mle","n ç","onu","opl","ran","rat","rdı","rke","siy","son","ta ","tçı","tın");
-$GLOBALS["ngrams"]['ts'] = array(" ku","ku ","na ","ka ","wa ","a n"," sw","a m","ya ","a k"," ti","swi","hi ","la "," ya"," le"," hi","a t","a v"," va","ni "," na","ndz"," ma","a h"," xi","a s","i n","ele","i k","ana","a l","nga","lo ","va ","le ","aka","ela","irh","eka"," vu","iwa","a x"," ka","yi "," wa","isa","sa ","ko ","ta ","ga ","wu ","wi ","tir"," ek"," mi"," ni","o y","elo","awu","isi","swa","i t","hla","a e"," ta"," ng"," la","a y","ri ","eri"," ri","rhi","eke","umb","u t","ndl"," yi","lan","i v","esw","mbe","i l","a r","e k","ang","les","ula","ti ","yon","o w","ona","law","xa ","nel","yo ","lel","iko"," lo","amb"," a ","i y"," xa","ane","wan","i s","ond","fan","end","i h","o l","u k","mbi","n'w","ke ","dyo"," fa","lam","nhl","o s","ong","no "," ko","u n"," ha","ho ","oko","u h","i m","o n"," yo","ngu","o k","u y","ati","u l","van","ulu","and","mba","kum","u v","wo ","be ","ha ","riw","dza","si "," en","o h"," hl","o t","eyi"," nt","ila","lok","dzi","nge"," mu","ala","to ","a w"," by","arh","aku","tsa","wak","rho","'wa"," nd","min","lav","tim","ley","tik","dle","tin","mat","ler","let","sel","his","mel","lu ","ika","a a","ngo","eng","o x"," nk","amu","siw","ani","eni","ma "," nh","mi ","swo","eti","tan","mo ","ham","iwe"," kh","han","lek","nti","ung","hak","dzo","ete"," ts","ava","hu ","fum","kar","vul"," wu","kul","und","i x","nhu","yis","xik","bis","xi ","e y","ra ","hle"," hu","wek","ano","yen","a d","sis","olo","pfu","i w","nyi","e n","so ","ki ","fun","iso","tsh","kon","nku","hel","i b","e h","ari","imi","i e","ind","vum","nts","ime","kom","mfu","ise"," mf","hin","dla","vut","gan","i r","ban","bya","mil","int","ats"," dy","u s","e x","ile","kel","kwa"," no","i f","asi","za ","uri","o m","rha","e l","in'","eta","von","i a","kho"," wo","iki"," ra","u e","o e","zo ","yin","ink","any","ket");
-$GLOBALS["ngrams"]['uk'] = array(" на"," за","ння","ня ","на "," пр","ого","го ","ськ"," по"," у ","від","ере"," мі"," не","их ","ть ","пер"," ві","ів "," пе"," що","льн","ми ","ні ","не ","ти ","ати","енн","міс","пра","ува","ник","про","рав","івн"," та","буд","влі","рів"," ко"," рі","аль","но ","ому","що "," ви","му ","рев","ся ","інн"," до"," уп","авл","анн","ком","ли ","лін","ног","упр"," бу"," з "," ро","за ","и н","нов","оро","ост","ста","ті ","ють"," мо"," ні"," як","бор","ва ","ван","ень","и п","нь ","ові","рон","сті","та ","у в","ько","іст"," в "," ре","до ","е п","заб","ий ","нсь","о в","о п","при","і п"," ку"," пі"," сп","а п","або","анс","аці","ват","вни","и в","ими","ка ","нен","ніч","она","ої ","пов","ьки","ьно","ізн","ічн"," ав"," ма"," ор"," су"," чи"," ін","а з","ам ","ає ","вне","вто","дом","ент","жит","зни","им ","итл","ла ","них","ниц","ова","ови","ом ","пор","тьс","у р","ься","ідо","іль","ісь"," ва"," ді"," жи"," че"," і ","а в","а н","али","вез","вно","еве","езе","зен","ицт","ки ","ких","кон","ку ","лас","ля ","мож","нач","ним","ної","о б","ову","оди","ою ","ро ","рок","сно","спо","так","тва","ту ","у п","цтв","ьни","я з","і м","ії "," вс"," гр"," де"," но"," па"," се"," ук"," їх","а о","авт","аст","ают","вар","ден","ди ","ду ","зна","и з","ико","ися","ити","ког","мен","ном","ну ","о н","о с","обу","ово","пла","ран","рив","роб","ска","тан","тим","тис","то ","тра","удо","чин","чни","і в","ію "," а "," во"," да"," кв"," ме"," об"," ск"," ти"," фі"," є ","а р","а с","а у","ак ","ані","арт","асн","в у","вик","віз","дов","дпо","дів","еві","енс","же ","и м","и с","ика","ичн","кі ","ків","між","нан","нос","о у","обл","одн","ок ","оло","отр","рен","рим","роз","сь ","сі ","тла","тів","у з","уго","уді","чи ","ше ","я н","я у","ідп","ій ","іна","ія "," ка"," ни"," ос"," си"," то"," тр"," уг");
-$GLOBALS["ngrams"]['ur'] = array("یں "," کی","کے "," کے","نے "," کہ","ے ک","کی ","میں"," می","ہے ","وں ","کہ "," ہے","ان ","ہیں","ور "," کو","یا "," ان"," نے","سے "," سے"," کر","ستا"," او","اور","تان","ر ک","ی ک"," اس","ے ا"," پا"," ہو"," پر","رف "," کا","ا ک","ی ا"," ہی","در ","کو "," ای","ں ک"," مش"," مل","ات ","صدر","اکس","شرف","مشر","پاک","کست","ی م"," دی"," صد"," یہ","ا ہ","ن ک","وال","یہ ","ے و"," بھ"," دو","اس ","ر ا","نہی","کا ","ے س","ئی ","ہ ا","یت ","ے ہ","ت ک"," سا","لے ","ہا ","ے ب"," وا","ار ","نی ","کہا","ی ہ","ے م"," سی"," لی","انہ","انی","ر م","ر پ","ریت","ن م","ھا ","یر "," جا"," جن","ئے ","پر ","ں ن","ہ ک","ی و","ے د"," تو"," تھ"," گی","ایک","ل ک","نا ","کر ","ں م","یک "," با","ا ت","دی ","ن س","کیا","یوں","ے ج","ال ","تو ","ں ا","ے پ"," چا","ام ","بھی","تی ","تے ","دوس","س ک","ملک","ن ا","ہور","یے "," مو"," وک","ائی","ارت","الے","بھا","ردی","ری ","وہ ","ویز","ں د","ھی ","ی س"," رہ"," من"," نہ"," ور"," وہ"," ہن","ا ا","است","ت ا","ت پ","د ک","ز م","ند ","ورد","وکل","گی ","گیا","ہ پ","یز ","ے ت"," اع"," اپ"," جس"," جم"," جو"," سر","اپن","اکث","تھا","ثری","دیا","ر د","رت ","روی","سی ","ملا","ندو","وست","پرو","چاہ","کثر","کلا","ہ ہ","ہند","ہو ","ے ل"," اک"," دا"," سن"," وز"," پی","ا چ","اء ","اتھ","اقا","اہ ","تھ ","دو ","ر ب","روا","رے ","سات","ف ک","قات","لا ","لاء","م م","م ک","من ","نوں","و ا","کرن","ں ہ","ھار","ہوئ","ہی ","یش "," ام"," لا"," مس"," پو"," پہ","انے","ت م","ت ہ","ج ک","دون","زیر","س س","ش ک","ف ن","ل ہ","لاق","لی ","وری","وزی","ونو","کھن","گا ","ں س","ں گ","ھنے","ھے ","ہ ب","ہ ج","ہر ","ی آ","ی پ"," حا"," وف"," گا","ا ج","ا گ","اد ","ادی","اعظ","اہت","جس ","جمہ","جو ","ر س","ر ہ","رنے","س م","سا ","سند","سنگ","ظم ","عظم","ل م","لیے","مل ","موہ","مہو","نگھ","و ص","ورٹ","وہن","کن ","گھ ","گے ","ں ج","ں و","ں ی","ہ د","ہن ","ہوں","ے ح","ے گ","ے ی"," اگ"," بع"," رو"," شا");
-$GLOBALS["ngrams"]['uz'] = array("ан ","ган","лар","га ","нг ","инг","нин","да ","ни ","ида","ари","ига","ини","ар ","ди "," би","ани"," бо","дан","лга"," ҳа"," ва"," са","ги ","ила","н б","и б"," кў"," та","ир "," ма","ага","ала","бир","ри ","тга","лан","лик","а к","аги","ати","та ","ади","даг","рга"," йи"," ми"," па"," бў"," қа"," қи","а б","илл","ли ","аси","и т","ик ","или","лла","ард","вчи","ва ","иб ","ири","лиг","нга","ран"," ке"," ўз","а с","ахт","бўл","иги","кўр","рда","рни","са "," бе"," бу"," да"," жа","а т","ази","ери","и а","илг","йил","ман","пах","рид","ти ","увч","хта"," не"," со"," уч","айт","лли","тла"," ай"," фр"," эт"," ҳо","а қ","али","аро","бер","бил","бор","ими","ист","он ","рин","тер","тил","ун ","фра","қил"," ба"," ол","анс","ефт","зир","кат","мил","неф","саг","чи ","ўра"," на"," те"," эн","а э","ам ","арн","ат ","иш ","ма ","нла","рли","чил","шга"," иш"," му"," ўқ","ара","ваз","и у","иқ ","моқ","рим","учу","чун","ши ","энг","қув","ҳам"," сў"," ши","бар","бек","дам","и ҳ","иши","лад","оли","олл","ори","оқд","р б","ра ","рла","уни","фт ","ўлг","ўқу"," де"," ка"," қў","а ў","аба","амм","атл","б к","бош","збе","и в","им ","ин ","ишл","лаб","лей","мин","н д","нда","оқ ","р м","рил","сид","тал","тан","тид","тон","ўзб"," ам"," ки","а ҳ","анг","анд","арт","аёт","дир","ент","и д","и м","и о","и э","иро","йти","нсу","оди","ор ","си ","тиш","тоб","эти","қар","қда"," бл"," ге"," до"," ду"," но"," пр"," ра"," фо"," қо","а м","а о","айд","ало","ама","бле","г н","дол","ейр","ек ","ерг","жар","зид","и к","и ф","ий ","ило","лди","либ","лин","ми ","мма","н в","н к","н ў","н ҳ","ози","ора","оси","рас","риш","рка","роқ","сто","тин","хат","шир"," ав"," рў"," ту"," ўт","а п","авт","ада","аза","анл","б б","бой","бу ","вто","г э","гин","дар","ден","дун","иде","ион","ирл","ишг","йха","кел","кўп","лио");
-$GLOBALS["ngrams"]['ve'] = array("ha "," vh","a m","na "," u ","a n","tsh","wa ","a u"," na","nga","vha"," ts"," dz"," kh","dza","a v","ya "," ya","a t","ho ","la "," zw"," mu","edz","vhu","ga ","shi","za ","a k"," ng","kha"," ma","hum","ne "," nd","o n","lo ","dzi","shu"," ha","a d","o y","nda","ele","zwi","aho","ang","no "," a ","ela","a z","hu ","sha","i n"," wa","ana","hi ","kan","o d","ano","a h","zwa"," th"," mi","gan","a l","sa ","han","di ","u t","and","ndi","yo ","the","do ","ri ","vho","ni ","ka ","uri","si ","o t","mbe","o w","ane","we ","zo ","i t","e n","i h","she","ush","o k","zi ","da ","a a","thu"," la","a p","zan"," i ","a s","lwa","ula","i d","aka"," do","mis","hed","ita","li "," hu","iwa"," lu","i v","he "," ka","elo","so ","amb","avh"," sh","o v","i k","lel","u v","dzo","u s"," fh","mo ","nwe","o l","umi","wah","isi","hel","a i","vel","adz","tan","i m","ath","thi","wi "," ur","hat","ine","le ","vhe","any","a y","hon","isa","ala","o a","alu","udi","umb"," bv","ash"," te"," li","lus","nya","has","led","swa","hus","o i","umo","one","nde","tha"," it","kho","ngo","mus","hak","e y","ea ","ivh","o m","u n","hin","tho","mut","ayo","fhi"," sa","tel","hul","hun","ulo","ith","ma "," yo","lan","e v"," ph","go ","i a","o u","hud"," pf","uka","zhi","uvh","dzw","ing","elw","ila","wo ","mbo","u d","ite","isw","asi","e k","ndu","fhe","o h","mel","u b","ika","bo ","gud","dzh","kon","ifh"," ta","e d","uth"," ho","i z","wan","ulu","mad","inw","oth","ani","dis","wit","ou ","bve","ets","u i","adi","e m","fha","nah","dal","win"," si","sho"," in","yam","lay","eka","a f","i u","end","i y","alo","i l","uso","mul","ta ","del","u k"," mb","pha"," di","dad","ali","o s","pfu","khw","e a"," ko"," ne","hen","mas","ume","ini","ish","udz","ira","oni","luk","nel","iso","mba","dzu","hom","i s","zwo","ngu","ara","unz");
-$GLOBALS["ngrams"]['xh'] = array("la "," ku","lo ","nga","a k"," ng","oku"," kw"," uk","a n","uku","ye ","a i","yo ","ela","ele","a u","nye","we ","wa ","ama","e n","ise","aba","ba ","ho ","enz","o n","ngo","kub","nge","ath","fun","o e","lel","ung","uba","ko ","elo","ezi","o k","the","kwa","na ","kwe","ang","e i","le ","ka ","esi","o y"," na","e k","eth","pha"," in","kun","nzi","and","ni ","ban"," ye"," no","lwa","lun"," ok","any","zi ","li "," ne","ulu","a e","eli","gok","o l","ebe","und","isa","seb","ndo"," ez","tho","o i","do ","ben","ing","kwi","ndl","uny","ala","a a","eyo","e u","kan"," ab","thi","i k","i n","o u","o z","elw","sa ","sek","ayo","het","o o","eka"," um","hi ","bo ","so ","isi","wen","lwe","aph","a l","ya ","eko","ana"," yo","kuf","ini","imi","ali","ha ","awu","wan","ent","uth","tha","za ","ula","kho"," ii","ane","e a","iso","uph"," le","ile","zin","nts"," si","eng","nok","ong","hla","zwe"," el","oka","eki","lis","azi"," lo","tsh"," am","ufu","ant","isw","o a","ngu","o s"," ba","int","eni","une","wul","hul","sel","i e","use","lan","ke ","nis","emi"," li"," is","iph"," im","a o","aka","mfu"," zi","ink","mal","ley","man","nya","nek","akh","ume"," ko","alo","tu ","i u","ntu","izw","kel","izi","i i","si ","gan","ase","ind","i a","ndi","nel","alu","sis","ubo","kut","mth","kus","lek","mis","nde"," zo"," we","ani","ga ","iko","siz","no ","phu","e e","hon","ond","ne ","ith","kul","gam","gen","pho"," iz","phe","hat","khu","iin","han","zo ","lu ","ulo","nda","qo ","zik","hel","o m"," lw","zis","dle","uhl","men","olo","mel","del","nza","oko","okw","olu","kuk","nte","swa","law","enk"," ya","i y","gaq","sha","aqo","e l","ikh","nkq","ule"," ka","onk","thu","wo ","bon","kup","qub","a y","kqu","dla"," es","he ","ano","lum","be ","iga"," ze","o w","aku","mga","nke","te "," ol","ze ","kum","emf","esh");
-$GLOBALS["ngrams"]['zu'] = array("oku","la ","nga"," ng","a n"," ku","a k","thi"," uk","ezi","e n","uku","le ","lo ","hi ","wa "," no","a u","ela","we ","a i","ni ","ele","zin","uth","ama","elo","pha","ing","aba","ath","and","enz","eth","esi","ma ","lel"," um"," ka","the","ung","nge","ngo","tho","nye","kwe","eni","izi","ye "," kw","ndl","ho ","a e","na ","zi ","het","kan","e u","e i","und","ise","isi","nda","kha","ba ","i k","nom","fun"," ez"," iz","ke ","ben","o e","isa","zwe","kel","ka ","aka","nzi","o n","e k","oma","kwa"," ne","any","ang","hla","i u","mth","kub","o k","ana","ane","ikh","ebe","kut","ha "," is","azi","ulu","seb","ala","onk","ban","i e","azw","wen"," ab","han","a a","i n","imi","lan","hat","lwa"," na","ini","akh","li ","ngu","nke","nok","ume","eke","elw","yo ","aph","kus"," es"," ok","iph"," im","mel","i i"," lo"," in"," am","kho","za ","gok","sek","lun","kun","lwe","sha","sik","kuf","hak","a y","thu","sa ","o u","khu","ayo","hul","e a","ali","eng","lu ","ne "," ko","eli","uba","dle","e e","ith"," yo","a l","nel","mis"," si","kul","a o","sis","lok","gen","o z","i a","emi","uma","eka","alo","man","isw","tha","o i","lon","so ","uph","uhl","ntu","zim","mal","ind","wez"," ba","o o"," yi"," we","ula","phe","o y","ile","o l","wo ","wel","ga ","tu ","hle","okw","fan"," le","kaz","ase","ani","nde","bo ","ngi","ule"," em","men","iny","amb","mbi","gan","ifu","o s","ant","hel","ika","ona","i l","fut"," fu","ze ","u a","nhl","nin"," zo","end","sig","u k","gab","ufa","ish","ush","kuz","no ","gam","kuh"," ye","nya","nez","zis","dlu","kat","dla","tsh"," se","ike","kuq","gu ","osi","swa","lul"," zi","ima","e l","kup","mo ","nza","asi","ko ","kum","lek","she","umt","uny","yok","wan","wam","ame","ong","lis","mkh","ahl","ale","use","o a","alu","gap","si ","hlo","nje","omt","o w","okh","he ","kom","i s");
-
-function createNGrams($string, $ng_number=300, $ng_max_chars=4) {
+$GLOBALS["ngrams"]['af'] = array("ie ", " di", "die", "en ", "ing", "an ", " en", "van", " va", "ng ", "te ", "n d", "ver", "er ", "e v", " ge", " be", "de ", " ve", "nde", " in", " te", "le ", "der", "ers", "et ", "oor", " 'n", "'n ", "at ", "eer", "ste", "ord", "aar", "sie", " wa", "es ", "e s", "aan", " on", "is ", "in ", "e o", "rde", "e b", "asi", "rin", "ond", "e w", "el ", " is", "and", "e e", "eid", "e d", "om ", "ke ", " om", "eri", " wo", "e g", "r d", "ale", "wat", " vo", "id ", "it ", "rd ", " aa", "lik", " we", "t d", " op", "e t", "ngs", "se ", "end", "uit", " st", " le", "ens", "ter", " re", "e a", "ies", "wor", "g v", "sta", "n s", " na", " pr", "n o", " me", "al ", "of ", " vi", "erd", "lee", "e k", " de", "ite", "erk", "ik ", "e r", "e p", "n v", "e i", "e n", "een", "eli", "wer", " of", " da", "tel", "nie", "ike", "s e", "taa", "ge ", "vir", "hei", "ir ", "reg", "ede", "s v", "ur ", "pro", "ele", "ion", "wet", "e l", " mo", "e m", "daa", "sio", "s d", " he", " to", "ent", "ard", "nge", " oo", "eur", "lle", "ien", "n b", "eke", "lin", "raa", " ni", "ont", "bes", "rdi", "voo", "ns ", "n a", "del", "dig", "nas", " sa", " gr", "nis", "kom", " ui", "men", "op ", "ins", "ona", "ere", "s o", " so", "n g", "ig ", "moe", " ko", "rs ", "ges", "nal", "vol", "e h", "geb", "rui", "ang", "ige", "oet", "ar ", "wys", "lig", "as ", "n w", " as", "met", "gs ", "deu", "t v", "aal", "erw", "dit", "ken", "sse", "kel", " hu", "ewe", "din", "n t", " se", "est", "ika", "n p", "ntw", "t i", "eni", " ka", "n e", "doe", "ali", "eme", "gro", "nte", " ho", "nsi", "gen", "ier", "gew", "n h", "or ", " ma", "ind", "ne ", "ek ", "aat", "n '", " sk", "ide", " ta", "dat", "ska", "ger", "soo", "n k", "s i", " af", "tee", "nd ", "eel", "hul", "nee", "woo", "rik", "d v", "n m", "re ", "art", "ebr", "lan", "kke", "ron", "aam", "tre", "str", "kan", "ree", "lei", "t o", "gra", "het", "evo", "tan", "den", "ist", " do", "bru", "toe", "olg", "rsk", "uik", "rwy", "min", "lge", "g e", "g o", "nst", "r v", "gte", "waa", "we ", "ans", "esi", "ese", "voe", "epa", "gel", " hi", "vin", "nse", "s w", "s t", "tei", "eit", "pre");
+$GLOBALS["ngrams"]['ar'] = array(" ال", "الع", "لعر", "عرا", "راق", " في", "في ", "ين ", "ية ", "ن ا", "الم", "ات ", "من ", "ي ا", " من", "الأ", "ة ا", "اق ", " وا", "اء ", "الإ", " أن", "وال", "ما ", " عل", "لى ", "ت ا", "ون ", "هم ", "اقي", "ام ", "ل ا", "أن ", "م ا", "الت", "لا ", "الا", "ان ", "ها ", "ال ", "ة و", "ا ا", "رها", "لام", "يين", " ول", "لأم", "نا ", "على", "ن ي", "الب", "اد ", "الق", "د ا", "ذا ", "ه ا", " با", "الد", "ب ا", "مري", "لم ", " إن", " لل", "سلا", "أمر", "ريك", "مة ", "ى ا", "ا ي", " عن", " هذ", "ء ا", "ر ا", "كان", "قتل", "إسل", "الح", "وا ", " إل", "ا أ", "بال", "ن م", "الس", "رة ", "لإس", "ن و", "هاب", "ي و", "ير ", " كا", "لة ", "يات", " لا", "انت", "ن أ", "يكي", "الر", "الو", "ة ف", "دة ", "الج", "قي ", "وي ", "الذ", "الش", "امي", "اني", "ذه ", "عن ", "لما", "هذه", "ول ", "اف ", "اوي", "بري", "ة ل", " أم", " لم", " ما", "يد ", " أي", "إره", "ع ا", "عمل", "ولا", "إلى", "ابي", "ن ف", "ختط", "لك ", "نه ", "ني ", "إن ", "دين", "ف ا", "لذي", "ي أ", "ي ب", " وأ", "ا ع", "الخ", "تل ", "تي ", "قد ", "لدي", " كل", " مع", "اب ", "اخت", "ار ", "الن", "علا", "م و", "مع ", "س ا", "كل ", "لاء", "ن ب", "ن ت", "ي م", "عرب", "م ب", " وق", " يق", "ا ل", "ا م", "الف", "تطا", "داد", "لمس", "له ", "هذا", " مح", "ؤلا", "بي ", "ة م", "ن ل", "هؤل", "كن ", "لإر", "لتي", " أو", " ان", " عم", "ا ف", "ة أ", "طاف", "عب ", "ل م", "ن ع", "ور ", "يا ", " يس", "ا ت", "ة ب", "راء", "عال", "قوا", "قية", "لعا", "م ي", "مي ", "مية", "نية", "أي ", "ابا", "بغد", "بل ", "رب ", "عما", "غدا", "مال", "ملي", "يس ", " بأ", " بع", " بغ", " وم", "بات", "بية", "ذلك", "عة ", "قاو", "قيي", "كي ", "م م", "ي ع", " عر", " قا", "ا و", "رى ", "ق ا", "وات", "وم ", " هؤ", "ا ب", "دام", "دي ", "رات", "شعب", "لان", "لشع", "لقو", "ليا", "ن ه", "ي ت", "ي ي", " وه", " يح", "جرا", "جما", "حمد", "دم ", "كم ", "لاو", "لره", "ماع", "ن ق", "نة ", "هي ", " بل", " به", " له", " وي", "ا ك", "اذا", "اع ", "ت م", "تخا", "خاب", "ر م", "لمت", "مسل", "ى أ", "يست", "يطا", " لأ", " لي", "أمن", "است", "بعض", "ة ت", "ري ", "صدا", "ق و", "قول", "مد ", "نتخ", "نفس", "نها", "هنا", "أعم", "أنه", "ائن", "الآ", "الك", "حة ", "د م", "ر ع", "ربي");
+$GLOBALS["ngrams"]['az'] = array("lər", "in ", "ın ", "lar", "da ", "an ", "ir ", "də ", "ki ", " bi", "ən ", "əri", "arı", "ər ", "dir", "nda", " ki", "rin", "nın", "əsi", "ini", " ed", " qa", " tə", " ba", " ol", "ası", "ilə", "rın", " ya", "anı", " və", "ndə", "ni ", "ara", "ını", "ınd", " bu", "si ", "ib ", "aq ", "dən", "iya", "nə ", "rə ", "n b", "sın", "və ", "iri", "lə ", "nin", "əli", " de", " mü", "bir", "n s", "ri ", "ək ", " az", " sə", "ar ", "bil", "zər", "bu ", "dan", "edi", "ind", "man", "un ", "ərə", " ha", "lan", "yyə", "iyy", " il", " ne", "r k", "ə b", " is", "na ", "nun", "ır ", " da", " hə", "a b", "inə", "sin", "yan", "ərb", " də", " mə", " qə", "dır", "li ", "ola", "rba", "azə", "can", "lı ", "nla", " et", " gö", "alı", "ayc", "bay", "eft", "ist", "n i", "nef", "tlə", "yca", "yət", "əcə", " la", "ild", "nı ", "tin", "ldi", "lik", "n h", "n m", "oyu", "raq", "ya ", "əti", " ar", "ada", "edə", "mas", "sı ", "ına", "ə d", "ələ", "ayı", "iyi", "lma", "mək", "n d", "ti ", "yin", "yun", "ət ", "azı", "ft ", "i t", "lli", "n a", "ra ", " cə", " gə", " ko", " nə", " oy", "a d", "ana", "cək", "eyi", "ilm", "irl", "lay", "liy", "lub", "n ə", "ril", "rlə", "unu", "ver", "ün ", "ə o", "əni", " he", " ma", " on", " pa", "ala", "dey", "i m", "ima", "lmə", "mət", "par", "yə ", "ətl", " al", " mi", " sa", " əl", "adı", "akı", "and", "ard", "art", "ayi", "i a", "i q", "i y", "ili", "ill", "isə", "n o", "n q", "olu", "rla", "stə", "sə ", "tan", "tel", "yar", "ədə", " me", " rə", " ve", " ye", "a k", "at ", "baş", "diy", "ent", "eti", "həs", "i i", "ik ", "la ", "miş", "n n", "nu ", "qar", "ran", "tər", "xan", "ə a", "ə g", "ə t", " dü", "ama", "b k", "dil", "era", "etm", "i b", "kil", "mil", "n r", "qla", "r s", "ras", "siy", "son", "tim", "yer", "ə k", " gü", " so", " sö", " te", " xa", "ai ", "bar", "cti", "di ", "eri", "gör", "gün", "gəl", "hbə", "ihə", "iki", "isi", "lin", "mai", "maq", "n k", "n t", "n v", "onu", "qan", "qəz", "tə ", "xal", "yib", "yih", "zet", "zır", "ıb ", "ə m", "əze", " br", " in", " i̇r", " pr", " ta", " to", " üç", "a o", "ali", "ani", "anl", "aql", "azi", "bri");
+$GLOBALS["ngrams"]['bg'] = array("на ", " на", "то ", " пр", " за", "та ", " по", "ите", "те ", "а п", "а с", " от", "за ", "ата", "ия ", " в ", "е н", " да", "а н", " се", " ко", "да ", "от ", "ани", "пре", "не ", "ени", "о н", "ни ", "се ", " и ", "но ", "ане", "ето", "а в", "ва ", "ван", "е п", "а о", "ото", "ран", "ат ", "ред", " не", "а д", "и п", " до", "про", " съ", "ли ", "при", "ния", "ски", "тел", "а и", "по ", "ри ", " е ", " ка", "ира", "кат", "ние", "нит", "е з", "и с", "о с", "ост", "че ", " ра", "ист", "о п", " из", " са", "е д", "ини", "ки ", "мин", " ми", "а б", "ава", "е в", "ие ", "пол", "ств", "т н", " въ", " ст", " то", "аза", "е о", "ов ", "ст ", "ът ", "и н", "ият", "нат", "ра ", " бъ", " че", "алн", "е с", "ен ", "ест", "и д", "лен", "нис", "о о", "ови", " об", " сл", "а р", "ато", "кон", "нос", "ров", "ще ", " ре", " с ", " сп", "ват", "еше", "и в", "иет", "о в", "ове", "ста", "а к", "а т", "дат", "ент", "ка ", "лед", "нет", "ори", "стр", "стъ", "ти ", "тър", " те", "а з", "а м", "ад ", "ана", "ено", "и о", "ина", "ити", "ма ", "ска", "сле", "тво", "тер", "ция", "ят ", " бе", " де", " па", "ате", "вен", "ви ", "вит", "и з", "и и", "нар", "нов", "ова", "пов", "рез", "рит", "са ", "ята", " го", " ще", "али", "в п", "гра", "е и", "еди", "ели", "или", "каз", "кит", "лно", "мен", "оли", "раз", " ве", " гр", " им", " ме", " пъ", "ави", "ако", "ача", "вин", "во ", "гов", "дан", "ди ", "до ", "ед ", "ери", "еро", "жда", "ито", "ков", "кол", "лни", "мер", "нач", "о з", "ола", "он ", "она", "пра", "рав", "рем", "сия", "сти", "т п", "тан", "ха ", "ше ", "шен", "ълг", " ба", " си", "аро", "бъл", "в р", "гар", "е е", "елн", "еме", "ико", "има", "ко ", "кои", "ла ", "лга", "о д", "ози", "оит", "под", "рес", "рие", "сто", "т к", "т м", "т с", "уст", " би", " дв", " дъ", " ма", " мо", " ни", " ос", "ала", "анс", "ара", "ати", "аци", "беш", "вър", "е р", "едв", "ема", "жав", "и к", "иал", "ица", "иче", "кия", "лит", "о б", "ово", "оди", "ока", "пос", "род", "сед", "слу", "т и", "тов", "ува", "циа", "чес", "я з", " во", " ил", " ск", " тр", " це", "ами", "ари", "бат", "би ", "бра", "бъд");
+$GLOBALS["ngrams"]['br'] = array("ar ", " a ", "en ", "an ", "et ", " ar", "ez ", " he", " ha", " an", "n d", " ho", " da", " va", " eu", "ur ", "er ", " pe", " de", "nt ", " ma", "n e", "var", " en", " be", " di", " ch", " e ", "eur", "ou ", "uz ", "it ", "ho ", "z a", "he ", "da ", "a z", "n a", " do", "oue", "ha ", "n h", " ne", "dou", "t a", " ke", " ev", "un ", "ag ", "t e", "euz", " me", " ga", " : ", "ant", " zo", "ll ", "ad ", "ch ", "oun", "t h", " la", "t d", "r a", "a d", " ve", "r b", "ed ", "enn", "hag", " re", "ue ", "zo ", "a v", "ra ", "r p", "ma ", " go", "r g", "el ", "cho", "evi", "a g", "a r", "hen", "vez", "deu", "aou", "c'h", "eo ", "z e", "ent", "z h", "che", "a b", "vit", "vel", " dr", "eme", "eve", "r m", "our", "mp ", "e a", " ra", " ka", " pa", "omp", "han", "eun", "den", "ne ", "r h", "rou", "a e", "ist", " gu", "d a", "o d", "uez", "gan", "az ", " tr", " eo", "e d", "och", "ell", "e v", "or ", "va ", "on ", " br", "r v", "ro ", "ket", "ava", "all", "gou", "o e", "g a", "re ", "ude", "e e", "oud", " se", " ko", "z d", "eze", "tra", "lav", "e h", "kou", "oul", " al", "r e", "lou", "ken", " ze", "iou", "are", "ud ", " gr", "u a", "hou", "ach", "n t", " na", "mar", "r c", "a l", "ret", "zou", " er", "l a", "mad", "nn ", "a c", "ze ", "oll", "a h", "r d", "l e", "ris", "e g", "per", "eza", "mez", "a n", "ech", "oua", "st ", "ont", "bed", "at ", " zi", "t m", "iz ", "za ", "bre", "d e", "o a", "o k", "hor", "d h", "rn ", "a m", "em ", "ene", " c'", "etr", "e k", "ara", "in ", " et", "gue", "t g", "us ", " em", "e z", "t k", "cha", "na ", "ouz", "as ", "nte", "ut ", " ou", " ta", " le", "ere", "red", " ba", " sa", "g e", "rez", "a k", "nan", " sk", "e m", "rei", " te", "t p", "dre", "ele", "men", "ran", "o h", "e c", "e b", "her", "tro", " dh", "ber", "ste", "o p", "reu", " za", "ui ", "bar", "hon", "n n", "out", "spe", "dis", "alo", "uel", "a a", "hol", "ver", "ezo", "bez", "hoa", "i a", "tre", "ank", "gal", "kri", "bet", "ni ", "dig", "al ", "a p", "una", "r s", "env", "net", "ave", "ten", " kr", "rea", "e p", " hi", "tez", "ta ", "l d", "u d", "eud", "r z", "r r", "ren");
+$GLOBALS["ngrams"]['ca'] = array(" de", "es ", "de ", "la ", " la", "el ", "que", " el", " co", "ent", "s d", " qu", " i ", "en ", "er ", " a ", "ls ", "nt ", " pe", "e l", "a d", " en", "per", "ci ", "ar ", "ue ", "al ", " se", "est", "at ", " es", "ts ", " s ", " pr", "aci", " un", "res", "men", "s e", "del", "s a", "s p", " re", "les", " l'", "na ", "a l", " ca", " d'", "els", "a p", "ia ", "ns ", "con", " le", "tat", "a c", "i d", "a a", "ra ", "a e", " no", "ant", " al", "t d", "s i", " di", "ta ", "re ", "a s", "com", "s c", "ita", "ons", "sta", "ica", " po", "r a", " in", "pro", "tre", " pa", "ues", "amb", "ion", "des", "un ", " ma", "da ", "s s", "a i", "an ", "mb ", " am", "l d", "e d", "va ", "pre", "ter", "e e", "e c", "a m", "cia", "una", "i e", "nci", "tra", " te", "ona", "os ", "t e", "n e", "l c", "ca ", "cio", "l p", " tr", "par", "r l", "t a", "e p", "aqu", "nta", " so", "ame", "era", "r e", "e s", "ada", "n a", "s q", " si", " ha", "als", "tes", " va", " m ", "ici", "nte", "s l", "s m", "i a", "or ", " mo", "ist", "ect", "lit", "m s", " to", "ir ", "a t", "esp", "ran", "str", "om ", "l s", "st ", "nts", " me", "no ", "r d", "d'a", "l'a", "ats", "ria", "s t", " ta", "sen", "rs ", "eix", "tar", "s n", "n l", "tal", "e a", "t p", "art", " mi", " ll", "tic", "ten", "ser", " aq", "ina", "ntr", "a f", "sti", "ol ", "a q", "for", "ura", "ers", "ari", "int", "act", "l'e", " fi", "r s", "e t", "tor", "si ", "ste", "rec", "a r", " fe", "is ", "em ", "n d", "car", "bre", " fo", " vi", " an", "ali", "i p", "ix ", "ell", "l m", "pos", "orm", "l l", "i l", " ac", "fer", "s r", "ess", "eu ", "e m", "ens", "ara", "eri", "sa ", "ssi", "us ", "ort", "tot", "ll ", "por", "ora", " ci", "tan", "ass", "n c", "ost", "nes", "rac", "a u", "ver", "ont", "ha ", " ti", "itz", "gra", "t c", " n ", "a v", "ren", "cat", "nal", " ri", "qua", "t l", " do", "t s", "rma", "ual", "i s", "s f", "n p", "s v", "te ", "t i", " ba", "cte", "tam", "man", "l t", "ial", " fa", "ic ", " ve", "ble", "a n", "all", "tza", "ies", " s'", "le ", "omp", "r c", " nc", "rti", "it ", "rre", "fic", "any", "on ", " sa", "r p", "tur");
+$GLOBALS["ngrams"]['ceb'] = array("ng ", "sa ", " sa", "ang", "ga ", "nga", " ka", " ng", "an ", " an", " na", " ma", " ni", "a s", "a n", "on ", " pa", " si", "a k", "a m", " ba", "ong", "a i", "ila", " mg", "mga", "a p", "iya", "a a", "ay ", "ka ", "ala", "ing", "g m", "n s", "g n", "lan", " gi", "na ", "ni ", "o s", "g p", "n n", " da", "ag ", "pag", "g s", "yan", "ayo", "o n", "si ", " mo", "a b", "g a", "ail", "g b", "han", "a d", "asu", "nag", "ya ", "man", "ne ", "pan", "kon", " il", " la", "aka", "ako", "ana", "bas", "ko ", "od ", "yo ", " di", " ko", " ug", "a u", "g k", "kan", "la ", "len", "sur", "ug ", " ai", "apa", "aw ", "d s", "g d", "g g", "ile", "nin", " iy", " su", "ene", "og ", "ot ", "aba", "aha", "as ", "imo", " ki", "a t", "aga", "ban", "ero", "nan", "o k", "ran", "ron", "sil", "una", "usa", " us", "a g", "ahi", "ani", "er ", "ha ", "i a", "rer", "yon", " pu", "ini", "nak", "ro ", "to ", "ure", " ed", " og", " wa", "ili", "mo ", "n a", "nd ", "o a", " ad", " du", " pr", "aro", "i s", "ma ", "n m", "ulo", "und", " ta", "ara", "asa", "ato", "awa", "dmu", "e n", "edm", "ina", "mak", "mun", "niy", "san", "wa ", " tu", " un", "a l", "bay", "iga", "ika", "ita", "kin", "lis", "may", "os ", " ar", "ad ", "ali", "ama", "ers", "ipa", "isa", "mao", "nim", "t s", "tin", " ak", " ap", " hi", "abo", "agp", "ano", "ata", "g i", "gan", "gka", "gpa", "i m", "iha", "k s", "law", "or ", "rs ", "siy", "tag", " al", " at", " ha", " hu", " im", "a h", "bu ", "e s", "gma", "kas", "lag", "mon", "nah", "ngo", "r s", "ra ", "sab", "sam", "sul", "uba", "uha", " lo", " re", "ada", "aki", "aya", "bah", "ce ", "d n", "lab", "pa ", "pak", "s n", "s s", "tan", "taw", "te ", "uma", "ura", " in", " lu", "a c", "abi", "at ", "awo", "bat", "dal", "dla", "ele", "g t", "g u", "gay", "go ", "hab", "hin", "i e", "i n", "kab", "kap", "lay", "lin", "nil", "pam", "pas", "pro", "pul", "ta ", "ton", "uga", "ugm", "unt", " co", " gu", " mi", " pi", " ti", "a o", "abu", "adl", "ado", "agh", "agk", "ao ", "art", "bal", "cit", "di ", "dto", "dun", "ent", "g e", "gon", "gug", "ia ", "iba", "ice", "in ", "inu", "it ", "kaa");
+$GLOBALS["ngrams"]['cs'] = array(" pr", " po", "ní ", "pro", " na", "na ", " př", "ch ", " je", " ne", "že ", " že", " se", " do", " ro", " st", " v ", " ve", "pře", "se ", "ho ", "sta", " to", " vy", " za", "ou ", " a ", "to ", " by", "la ", "ce ", "e v", "ist", "le ", "pod", "í p", " vl", "e n", "e s", "je ", "ké ", "by ", "em ", "ých", " od", "ova", "řed", "dy ", "ení", "kon", "li ", "ně ", "str", " zá", "ve ", " ka", " sv", "e p", "it ", "lád", "oho", "rov", "roz", "ter", "vlá", "ím ", " ko", "hod", "nis", "pří", "ský", " mi", " ob", " so", "a p", "ali", "bud", "edn", "ick", "kte", "ku ", "o s", "al ", "ci ", "e t", "il ", "ny ", "né ", "odl", "ová", "rot", "sou", "ání", " bu", " mo", " o ", "ast", "byl", "de ", "ek ", "ost", " mí", " ta", "es ", "jed", "ky ", "las", "m p", "nes", "ním", "ran", "rem", "ros", "ého", " de", " kt", " ni", " si", " vý", "at ", "jí ", "ký ", "mi ", "pre", "tak", "tan", "y v", "řek", " ch", " li", " ná", " pa", " ře", "da ", "dle", "dne", "i p", "i v", "ly ", "min", "o n", "o v", "pol", "tra", "val", "vní", "ích", "ý p", "řej", " ce", " kd", " le", "a s", "a z", "cen", "e k", "eds", "ekl", "emi", "kl ", "lat", "lo ", "mié", "nov", "pra", "sku", "ské", "sti", "tav", "ti ", "ty ", "ván", "vé ", "y n", "y s", "í s", "í v", "ě p", " dn", " ně", " sp", " čs", "a n", "a t", "ak ", "dní", "doh", "e b", "e m", "ejn", "ena", "est", "ini", "m z", "nal", "nou", "ná ", "ovi", "ové", "ový", "rsk", "stá", "tí ", "tře", "tů ", "ude", "za ", "é p", "ém ", "í d", " ir", " zv", "ale", "aně", "ave", "cké", "den", "e z", "ech", "en ", "erý", "hla", "i s", "iér", "lov", "mu ", "neb", "nic", "o b", "o m", "pad", "pot", "rav", "rop", "rý ", "sed", "si ", "t p", "tic", "tu ", "tě ", "u p", "u v", "vá ", "výš", "zvý", "ční", "ří ", "ům ", " bl", " br", " ho", " ja", " re", " s ", " z ", " zd", "a v", "ani", "ato", "bla", "bri", "ečn", "eře", "h v", "i n", "ie ", "ila", "irs", "ite", "kov", "nos", "o o", "o p", "oce", "ody", "ohl", "oli", "ovo", "pla", "poč", "prá", "ra ", "rit", "rod", "ry ", "sd ", "sko", "ssd", "tel", "u s", "vat", "veř", "vit", "vla", "y p", "áln", "čss", "šen", " al");
+$GLOBALS["ngrams"]['cy'] = array("yn ", "dd ", " yn", " y ", "ydd", "eth", "th ", " i ", "aet", "d y", "ch ", "od ", "ol ", "edd", " ga", " gw", "'r ", "au ", "ddi", "ad ", " cy", " gy", " ei", " o ", "iad", "yr ", "an ", "bod", "wed", " bo", " dd", "el ", "n y", " am", "di ", "edi", "on ", " we", " ym", " ar", " rh", "odd", " ca", " ma", "ael", "oed", "dae", "n a", "dda", "er ", "h y", "all", "ei ", " ll", "am ", "eu ", "fod", "fyd", "l y", "n g", "wyn", "d a", "i g", "mae", "neu", "os ", " ne", "d i", "dod", "dol", "n c", "r h", "wyd", "wyr", "ai ", "ar ", "in ", "rth", " fy", " he", " me", " yr", "'n ", "dia", "est", "h c", "hai", "i d", "id ", "r y", "y b", " dy", " ha", "ada", "i b", "n i", "ote", "rot", "tes", "y g", "yd ", " ad", " mr", " un", "cyn", "dau", "ddy", "edo", "i c", "i w", "ith", "lae", "lla", "nd ", "oda", "ryd", "tho", " a ", " dr", "aid", "ain", "ddo", "dyd", "fyn", "gyn", "hol", "io ", "o a", "wch", "wyb", "ybo", "ych", " br", " by", " di", " fe", " na", " o'", " pe", "art", "byd", "dro", "gal", "l e", "lai", "mr ", "n n", "r a", "rhy", "wn ", "ynn", " on", " r ", "cae", "d g", "d o", "d w", "gan", "gwy", "n d", "n f", "n o", "ned", "ni ", "o'r", "r d", "ud ", "wei", "wrt", " an", " cw", " da", " ni", " pa", " pr", " wy", "d e", "dai", "dim", "eud", "gwa", "idd", "im ", "iri", "lwy", "n b", "nol", "r o", "rwy", " ch", " er", " fo", " ge", " hy", " i'", " ro", " sa", " tr", "bob", "cwy", "cyf", "dio", "dyn", "eit", "hel", "hyn", "ich", "ll ", "mdd", "n r", "ond", "pro", "r c", "r g", "red", "rha", "u a", "u c", "u y", "y c", "ymd", "ymr", "yw ", " ac", " be", " bl", " co", " os", "adw", "ae ", "af ", "d p", "efn", "eic", "en ", "eol", "es ", "fer", "gel", "h g", "hod", "ied", "ir ", "laf", "n h", "na ", "nyd", "odo", "ofy", "rdd", "rie", "ros", "stw", "twy", "yda", "yng", " at", " de", " go", " id", " oe", " â ", "'ch", "ac ", "ach", "ae'", "al ", "bl ", "d c", "d l", "dan", "dde", "ddw", "dir", "dla", "ed ", "ela", "ell", "ene", "ewn", "gyd", "hau", "hyw", "i a", "i f", "iol", "ion", "l a", "l i", "lia", "med", "mon", "n s", "no ", "obl", "ola", "ref", "rn ", "thi", "un ");
+$GLOBALS["ngrams"]['da'] = array("er ", "en ", " de", "et ", "der", "de ", "for", " fo", " i ", "at ", " at", "re ", "det", " ha", "nde", "ere", "ing", "den", " me", " og", "ger", "ter", " er", " si", "and", " af", "or ", " st", " ti", " en", "og ", "ar ", "il ", "r s", "ige", "til", "ke ", "r e", "af ", "kke", " ma", " på", "om ", "på ", "ed ", "ge ", "end", "nge", "t s", "e s", "ler", " sk", "els", "ern", "sig", "ne ", "lig", "r d", "ska", " vi", "har", " be", " se", "an ", "ikk", "lle", "gen", "n f", "ste", "t a", "t d", "rin", " ik", "es ", "ng ", "ver", "r b", "sen", "ede", "men", "r i", " he", " et", "ig ", "lan", "med", "nd ", "rne", " da", " in", "e t", "mme", "und", " om", "e e", "e m", "her", "le ", "r f", "t f", "så ", "te ", " so", "ele", "t e", " ko", "est", "ske", " bl", "e f", "ekt", "mar", "bru", "e a", "el ", "ers", "ret", "som", "tte", "ve ", " la", " ud", " ve", "age", "e d", "e h", "lse", "man", "rug", "sel", "ser", " fi", " op", " pr", "dt ", "e i", "n m", "r m", " an", " re", " sa", "ion", "ner", "res", "t i", "get", "n s", "one", "orb", "t h", "vis", "år ", " fr", "bil", "e k", "ens", "ind", "omm", "t m", " hv", " je", "dan", "ent", "fte", "nin", " mi", "e o", "e p", "n o", "nte", " ku", "ell", "nas", "ore", "r h", "r k", "sta", "sto", "dag", "eri", "kun", "lde", "mer", "r a", "r v", "rek", "rer", "t o", "tor", "tør", " få", " må", " to", "boe", "che", "e v", "i d", "ive", "kab", "ns ", "oel", "se ", "t v", " al", " bo", " un", "ans", "dre", "ire", "køb", "ors", "ove", "ren", "t b", "ør ", " ka", "ald", "bet", "gt ", "isk", "kal", "kom", "lev", "n d", "n i", "pri", "r p", "rbr", "søg", "tel", " så", " te", " va", "al ", "dir", "eje", "fis", "gså", "isc", "jer", "ker", "ogs", "sch", "st ", "t k", "uge", " di", "ag ", "d a", "g i", "ill", "l a", "lsk", "n a", "on ", "sam", "str", "tet", "var", " mo", "art", "ash", "att", "e b", "han", "hav", "kla", "kon", "n t", "ned", "r o", "ra ", "rre", "ves", "vil", " el", " kr", " ov", "ann", "e u", "ess", "fra", "g a", "g d", "int", "ngs", "rde", "tra", " år", "akt", "asi", "em ", "gel", "gym", "hol", "kan", "mna", "n h", "nsk", "old");
+$GLOBALS["ngrams"]['de'] = array("en ", "er ", " de", "der", "ie ", " di", "die", "sch", "ein", "che", "ich", "den", "in ", "te ", "ch ", " ei", "ung", "n d", "nd ", " be", "ver", "es ", " zu", "eit", "gen", "und", " un", " au", " in", "cht", "it ", "ten", " da", "ent", " ve", "and", " ge", "ine", " mi", "r d", "hen", "ng ", "nde", " vo", "e d", "ber", "men", "ei ", "mit", " st", "ter", "ren", "t d", " er", "ere", "n s", "ste", " se", "e s", "ht ", "des", "ist", "ne ", "auf", "e a", "isc", "on ", "rte", " re", " we", "ges", "uch", " fü", " so", "bei", "e e", "nen", "r s", "ach", "für", "ier", "par", "ür ", " ha", "as ", "ert", " an", " pa", " sa", " sp", " wi", "for", "tag", "zu ", "das", "rei", "he ", "hre", "nte", "sen", "vor", " sc", "ech", "etz", "hei", "lan", "n a", "pd ", "st ", "sta", "ese", "lic", " ab", " si", "gte", " wa", "iti", "kei", "n e", "nge", "sei", "tra", "zen", " im", " la", "art", "im ", "lle", "n w", "rde", "rec", "set", "str", "tei", "tte", " ni", "e p", "ehe", "ers", "g d", "nic", "von", " al", " pr", "an ", "aus", "erf", "r e", "tze", "tür", "uf ", "ag ", "als", "ar ", "chs", "end", "ge ", "ige", "ion", "ls ", "n m", "ngs", "nis", "nt ", "ord", "s s", "sse", " tü", "ahl", "e b", "ede", "em ", "len", "n i", "orm", "pro", "rke", "run", "s d", "wah", "wer", "ürk", " me", "age", "att", "ell", "est", "hat", "n b", "oll", "raf", "s a", "tsc", " es", " fo", " gr", " ja", "abe", "auc", "ben", "e n", "ege", "lie", "n u", "r v", "re ", "rit", "sag", " am", "agt", "ahr", "bra", "de ", "erd", "her", "ite", "le ", "n p", "n v", "or ", "rbe", "rt ", "sic", "wie", "übe", " is", " üb", "cha", "chi", "e f", "e m", "eri", "ied", "mme", "ner", "r a", "sti", "t a", "t s", "tis", " ko", "arb", "ds ", "gan", "n z", "r f", "r w", "ran", "se ", "t i", "wei", "wir", " br", " np", "am ", "bes", "d d", "deu", "e g", "e k", "efo", "et ", "eut", "fen", "hse", "lte", "n r", "npd", "r b", "rhe", "t w", "tz ", " fr", " ih", " ke", " ma", "ame", "ang", "d s", "eil", "el ", "era", "erh", "h d", "i d", "kan", "n f", "n l", "nts", "och", "rag", "rd ", "spd", "spr", "tio", " ar", " en", " ka", "ark", "ass");
+$GLOBALS["ngrams"]['en'] = array(" th", "the", "he ", "ed ", " to", " in", "er ", "ing", "ng ", " an", "nd ", " of", "and", "to ", "of ", " co", "at ", "on ", "in ", " a ", "d t", " he", "e t", "ion", "es ", " re", "re ", "hat", " sa", " st", " ha", "her", "tha", "tio", "or ", " ''", "en ", " wh", "e s", "ent", "n t", "s a", "as ", "for", "is ", "t t", " be", "ld ", "e a", "rs ", " wa", "ut ", "ve ", "ll ", "al ", " ma", "e i", " fo", "'s ", "an ", "est", " hi", " mo", " se", " pr", "s t", "ate", "st ", "ter", "ere", "ted", "nt ", "ver", "d a", " wi", "se ", "e c", "ect", "ns ", " on", "ly ", "tol", "ey ", "r t", " ca", "ati", "ts ", "all", " no", "his", "s o", "ers", "con", "e o", "ear", "f t", "e w", "was", "ons", "sta", "'' ", "sti", "n a", "sto", "t h", " we", "id ", "th ", " it", "ce ", " di", "ave", "d h", "cou", "pro", "ad ", "oll", "ry ", "d s", "e m", " so", "ill", "cti", "te ", "tor", "eve", "g t", "it ", " ch", " de", "hav", "oul", "ty ", "uld", "use", " al", "are", "ch ", "me ", "out", "ove", "wit", "ys ", "chi", "t a", "ith", "oth", " ab", " te", " wo", "s s", "res", "t w", "tin", "e b", "e h", "nce", "t s", "y t", "e p", "ele", "hin", "s i", "nte", " li", "le ", " do", "aid", "hey", "ne ", "s w", " as", " fr", " tr", "end", "sai", " el", " ne", " su", "'t ", "ay ", "hou", "ive", "lec", "n't", " ye", "but", "d o", "o t", "y o", " ho", " me", "be ", "cal", "e e", "had", "ple", " at", " bu", " la", "d b", "s h", "say", "t i", " ar", "e f", "ght", "hil", "igh", "int", "not", "ren", " is", " pa", " sh", "ays", "com", "n s", "r a", "rin", "y a", " un", "n c", "om ", "thi", " mi", "by ", "d i", "e d", "e n", "t o", " by", "e r", "eri", "old", "ome", "whe", "yea", " gr", "ar ", "ity", "mpl", "oun", "one", "ow ", "r s", "s f", "tat", " ba", " vo", "bou", "sam", "tim", "vot", "abo", "ant", "ds ", "ial", "ine", "man", "men", " or", " po", "amp", "can", "der", "e l", "les", "ny ", "ot ", "rec", "tes", "tho", "ica", "ild", "ir ", "nde", "ose", "ous", "pre", "ste", "era", "per", "r o", "red", "rie", " bo", " le", "ali", "ars", "ore", "ric", "s m", "str", " fa", "ess", "ie ", "ist", "lat", "uri");
+$GLOBALS["ngrams"]['es'] = array(" de", "de ", " la", "os ", "la ", "el ", "es ", " qu", " co", "e l", "as ", "que", " el", "ue ", "en ", "ent", " en", " se", "nte", "res", "con", "est", " es", "s d", " lo", " pr", "los", " y ", "do ", "ón ", "ión", " un", "ció", "del", "o d", " po", "a d", "aci", "sta", "te ", "ado", "pre", "to ", "par", "a e", "a l", "ra ", "al ", "e e", "se ", "pro", "ar ", "ia ", "o e", " re", "ida", "dad", "tra", "por", "s p", " a ", "a p", "ara", "cia", " pa", "com", "no ", " di", " in", "ien", "n l", "ad ", "ant", "e s", "men", "a c", "on ", "un ", "las", "nci", " tr", "cio", "ier", "nto", "tiv", "n d", "n e", "or ", "s c", "enc", "ern", "io ", "a s", "ici", "s e", " ma", "dos", "e a", "e c", "emp", "ica", "ivo", "l p", "n c", "r e", "ta ", "ter", "e d", "esa", "ez ", "mpr", "o a", "s a", " ca", " su", "ion", " cu", " ju", "an ", "da ", "ene", "ero", "na ", "rec", "ro ", "tar", " al", " an", "bie", "e p", "er ", "l c", "n p", "omp", "ten", " em", "ist", "nes", "nta", "o c", "so ", "tes", "era", "l d", "l m", "les", "ntr", "o s", "ore", "rá ", "s q", "s y", "sto", "a a", "a r", "ari", "des", "e q", "ivi", "lic", "lo ", "n a", "one", "ora", "per", "pue", "r l", "re ", "ren", "una", "ía ", "ada", "cas", "ere", "ide", "min", "n s", "ndo", "ran", "rno", " ac", " ex", " go", " no", "a t", "aba", "ble", "ece", "ect", "l a", "l g", "lid", "nsi", "ons", "rac", "rio", "str", "uer", "ust", " ha", " le", " mi", " mu", " ob", " pe", " pu", " so", "a i", "ale", "ca ", "cto", "e i", "e u", "eso", "fer", "fic", "gob", "jo ", "ma ", "mpl", "o p", "obi", "s m", "sa ", "sep", "ste", "sti", "tad", "tod", "y s", " ci", "and", "ces", "có ", "dor", "e m", "eci", "eco", "esi", "int", "iza", "l e", "lar", "mie", "ner", "orc", "rci", "ria", "tic", "tor", " as", " si", "ce ", "den", "e r", "e t", "end", "eri", "esp", "ial", "ido", "ina", "inc", "mit", "o l", "ome", "pli", "ras", "s t", "sid", "sup", "tab", "uen", "ues", "ura", "vo ", "vor", " sa", " ti", "abl", "ali", "aso", "ast", "cor", "cti", "cue", "div", "duc", "ens", "eti", "imi", "ini", "lec", "o q", "oce", "ort", "ral", "rma", "roc", "rod");
+$GLOBALS["ngrams"]['et'] = array("st ", " ka", "on ", "ja ", " va", " on", " ja", " ko", "se ", "ast", "le ", "es ", "as ", "is ", "ud ", " sa", "da ", "ga ", " ta", "aja", "sta", " ku", " pe", "a k", "est", "ist", "ks ", "ta ", "al ", "ava", "id ", "saa", "mis", "te ", "val", " et", "nud", " te", "inn", " se", " tu", "a v", "alu", "e k", "ise", "lu ", "ma ", "mes", " mi", "et ", "iku", "lin", "ad ", "el ", "ime", "ne ", "nna", " ha", " in", " ke", " võ", "a s", "a t", "ab ", "e s", "esi", " la", " li", "e v", "eks", "ema", "las", "les", "rju", "tle", "tsi", "tus", "upa", "use", "ust", "var", " lä", "ali", "arj", "de ", "ete", "i t", "iga", "ilm", "kui", "li ", "tul", " ei", " me", " sõ", "aal", "ata", "dus", "ei ", "nik", "pea", "s k", "s o", "sal", "sõn", "ter", "ul ", "või", " el", " ne", "a j", "ate", "end", "i k", "ita", "kar", "kor", "l o", "lt ", "maa", "oli", "sti", "vad", "ään", " ju", " jä", " kü", " ma", " po", " üt", "aas", "aks", "at ", "ed ", "eri", "hoi", "i s", "ka ", "la ", "nni", "oid", "pai", "rit", "us ", "ütl", " aa", " lo", " to", " ve", "a e", "ada", "aid", "ami", "and", "dla", "e j", "ega", "gi ", "gu ", "i p", "idl", "ik ", "ini", "jup", "kal", "kas", "kes", "koh", "s e", "s p", "sel", "sse", "ui ", " pi", " si", "aru", "eda", "eva", "fil", "i v", "ida", "ing", "lää", "me ", "na ", "nda", "nim", "ole", "ots", "ris", "s l", "sia", "t p", " en", " mu", " ol", " põ", " su", " vä", " üh", "a l", "a p", "aga", "ale", "aps", "arv", "e a", "ela", "ika", "lle", "loo", "mal", "pet", "t k", "tee", "tis", "vat", "äne", "õnn", " es", " fi", " vi", "a i", "a o", "aab", "aap", "ala", "alt", "ama", "anu", "e p", "e t", "eal", "eli", "haa", "hin", "iva", "kon", "ku ", "lik", "lm ", "min", "n t", "odu", "oon", "psa", "ri ", "si ", "stu", "t e", "t s", "ti ", "ule", "uur", "vas", "vee", " ki", " ni", " nä", " ra", "aig", "aka", "all", "atu", "e e", "eis", "ers", "i e", "ii ", "iis", "il ", "ima", "its", "kka", "kuh", "l k", "lat", "maj", "ndu", "ni ", "nii", "oma", "ool", "rso", "ru ", "rva", "s t", "sek", "son", "ste", "t m", "taj", "tam", "ude", "uho", "vai", " ag", " os", " pa", " re");
+$GLOBALS["ngrams"]['eu'] = array("en ", "an ", "eta", "ta ", " et", "iza", "n e", "ko ", "ide", " ba", "a e", "giz", " es", " gi", "arr", "bid", "ren", "rri", "are", "la ", "sku", " be", "asu", "esk", "sun", "tas", " iz", "ean", "eko", "ela", "ik ", "kub", "n a", "n i", "tza", "ubi", "za ", "zan", " er", "a b", "ask", "era", "n b", "rre", "ten", "tze", " as", " ko", "a a", "a g", "ald", "ani", "de ", "dee", "ea ", "ek ", "kat", "kon", "n d", "ont", "uan", " du", " na", "ata", "egi", "est", "k e", "nik", "ntu", "ntz", "ska", "tua", " de", " di", " ez", " he", "a d", "a k", "ak ", "aki", "ako", "art", "atu", "azi", "bat", "ber", "itz", "kun", "n h", "o b", "ria", "rte", "tat", "une", "zar", " al", " ar", " ha", "aku", "atz", "bai", "dar", "dea", "del", "een", "ema", "err", "iak", "iar", "in ", "ina", "kia", "nar", "naz", "nea", "o e", "orr", "ra ", "ste", "tek", "zak", "zek", "zio", " da", " em", " hi", " ho", " ma", " oi", "agu", "ate", "aur", "bes", "din", "dir", "dut", "ert", "ez ", "ezi", "har", "her", "hit", "ia ", "ien", "ika", "io ", "ire", "ite", "k b", "k g", "kid", "kor", "lda", "n o", "nko", "o a", "oin", "ori", "rak", "rea", "rie", "rik", "rra", "tan", "tea", "tu ", "una", "und", "unt", "urr", "ute", "z e", "zko", " au", " eg", " gu", " ir", " ki", " or", "a h", "a j", "abe", "agi", "ai ", "ail", "ait", "ape", "ari", "dez", "e e", "ear", "eek", "erd", "ere", "eza", "ezk", "gir", "git", "hor", "i e", "ian", "iek", "ila", "ink", "int", "ira", "ita", "itu", "k n", "kap", "koa", "kum", "lan", "lde", "mai", "man", "men", "n g", "n u", "na ", "nta", "o h", "oa ", "oro", "pen", "rdi", "ri ", "rta", "sta", "tel", "tet", "tik", "tue", "tzi", "ume", "un ", "uzt", "zea", "zen", "zia", "zin", " az", " bi", " bu", " el", " ga", " jo", " mu", " ti", " un", " za", " zi", "a n", "a o", "a s", "a t", "a z", "aba", "adi", "ake", "ala", "and", "ar ", "aud", "bak", "bal", "beg", "beh", "bul", "dau", "den", "du ", "dui", "e b", "e d", "e h", "e o", "eak", "eet", "eha", "elk", "enb", "ete", "eti", "gab", "gin", "go ", "gus", "gut", "guz", "hau", "ibe", "inb", "ine", "ioa", "iru", "iur", "izi", "izk", "izo");
+$GLOBALS["ngrams"]['fa'] = array("ان ", "ای ", "ه ا", " اي", " در", "به ", " بر", "در ", "ران", " به", "ی ا", "از ", "ين ", "می ", " از", "ده ", "ست ", "است", " اس", " که", "که ", "اير", "ند ", "اين", " ها", "يرا", "ود ", " را", "های", " خو", "ته ", "را ", "رای", "رد ", "ن ب", "کرد", " و ", " کر", "ات ", "برا", "د ک", "مان", "ی د", " ان", "خوا", "شور", " با", "ن ا", " سا", "تمی", "ری ", "اتم", "ا ا", "واه", " ات", " عر", "اق ", "ر م", "راق", "عرا", "ی ب", " تا", " تو", "ار ", "ر ا", "ن م", "ه ب", "ور ", "يد ", "ی ک", " ام", " دا", " کن", "اهد", "هد ", " آن", " می", " ني", " گف", "د ا", "گفت", " کش", "ا ب", "نی ", "ها ", "کشو", " رو", "ت ک", "نيو", "ه م", "وی ", "ی ت", " شو", "ال ", "دار", "مه ", "ن ک", "ه د", "يه ", " ما", "امه", "د ب", "زار", "ورا", "گزا", " پي", "آن ", "انت", "ت ا", "فت ", "ه ن", "ی خ", "اما", "بات", "ما ", "ملل", "نام", "ير ", "ی م", "ی ه", " آم", " ای", " من", "انس", "اني", "ت د", "رده", "ساز", "ن د", "نه ", "ورد", " او", " بي", " سو", " شد", "اده", "اند", "با ", "ت ب", "ر ب", "ز ا", "زما", "سته", "ن ر", "ه س", "وان", "وز ", "ی ر", "ی س", " هس", "ابا", "ام ", "اور", "تخا", "خاب", "خود", "د د", "دن ", "رها", "روز", "رگز", "نتخ", "ه ش", "ه ه", "هست", "يت ", "يم ", " دو", " دي", " مو", " نو", " هم", " کا", "اد ", "اری", "انی", "بر ", "بود", "ت ه", "ح ه", "حال", "رش ", "عه ", "لی ", "وم ", "ژان", " سل", "آمر", "اح ", "توس", "داد", "دام", "ر د", "ره ", "ريک", "زی ", "سلا", "شود", "لاح", "مري", "نند", "ه ع", "يما", "يکا", "پيم", "گر ", " آژ", " ال", " بو", " مق", " مل", " وی", "آژا", "ازم", "ازی", "بار", "برن", "ر آ", "ز س", "سعه", "شته", "مات", "ن آ", "ن پ", "نس ", "ه گ", "وسع", "يان", "يوم", "کا ", "کام", "کند", " خا", " سر", "آور", "ارد", "اقد", "ايم", "ايی", "برگ", "ت ع", "تن ", "خت ", "د و", "ر خ", "رک ", "زير", "فته", "قدا", "ل ت", "مين", "ن گ", "ه آ", "ه خ", "ه ک", "ورک", "ويو", "يور", "يوي", "يی ", "ک ت", "ی ش", " اق", " حا", " حق", " دس", " شک", " عم", " يک", "ا ت", "ا د", "ارج", "بين", "ت م", "ت و", "تاي", "دست", "ر ح", "ر س", "رنا", "ز ب", "شکا", "لل ", "م ک", "مز ", "ندا", "نوا", "و ا", "وره", "ون ", "وند", "يمز", " آو", " اع", " فر", " مت", " نه", " هر", " وز", " گز");
+$GLOBALS["ngrams"]['fi'] = array("en ", "in ", "an ", "on ", "ist", "ta ", "ja ", "n t", "sa ", "sta", "aan", "n p", " on", "ssa", "tta", "tä ", " ka", " pa", "si ", " ja", "n k", "lla", "än ", "een", "n v", "ksi", "ett", "nen", "taa", "ttä", " va", "ill", "itt", " jo", " ko", "n s", " tu", "ia ", " su", "a p", "aa ", "la ", "lle", "n m", "le ", "tte", "na ", " ta", " ve", "at ", " vi", "utt", " sa", "ise", "sen", " ku", " nä", " pä", "ste", " ol", "a t", "ais", "maa", "ti ", "a o", "oit", "pää", " pi", "a v", "ala", "ine", "isi", "tel", "tti", " si", "a k", "all", "iin", "kin", "stä", "uom", "vii", " ma", " se", "enä", " mu", "a s", "est", "iss", "llä", "lok", "lä ", "n j", "n o", "toi", "ven", "ytt", " li", "ain", "et ", "ina", "n a", "n n", "oll", "plo", "ten", "ust", "äll", "ään", " to", "den", "men", "oki", "suo", "sä ", "tää", "uks", "vat", " al", " ke", " te", "a e", "lii", "tai", "tei", "äis", "ää ", " pl", "ell", "i t", "ide", "ikk", "ki ", "nta", "ova", "yst", "yt ", "ä p", "äyt", " ha", " pe", " tä", "a n", "aik", "i p", "i v", "nyt", "näy", "pal", "tee", "un ", " me", "a m", "ess", "kau", "pai", "stu", "ut ", "voi", " et", "a h", "eis", "hte", "i o", "iik", "ita", "jou", "mis", "nin", "nut", "sia", "ssä", "van", " ty", " yh", "aks", "ime", "loi", "me ", "n e", "n h", "n l", "oin", "ome", "ott", "ouk", "sit", "sti", "tet", "tie", "ukk", "ä k", " ra", " ti", "aja", "asi", "ent", "iga", "iig", "ite", "jan", "kaa", "kse", "laa", "lan", "li ", "näj", "ole", "tii", "usi", "äjä", " ov", "a a", "ant", "ava", "ei ", "eri", "kan", "kku", "lai", "lis", "läi", "mat", "ois", "pel", "sil", "sty", "taj", "tav", "ttu", "työ", "yös", "ä o", " ai", " pu", "a j", "a l", "aal", "arv", "ass", "ien", "imi", "imm", "itä", "ka ", "kes", "kue", "lee", "lin", "llo", "one", "ri ", "t o", "t p", "tu ", "val", "vuo", " ei", " he", " hy", " my", " vo", "ali", "alo", "ano", "ast", "att", "auk", "eli", "ely", "hti", "ika", "ken", "kki", "lys", "min", "myö", "oht", "oma", "tus", "umi", "yks", "ät ", "ääl", "ös ", " ar", " eu", " hu", " na", "aat", "alk", "alu", "ans", "arj", "enn", "han", "kuu", "n y", "set", "sim");
+$GLOBALS["ngrams"]['fr'] = array("es ", " de", "de ", " le", "ent", "le ", "nt ", "la ", "s d", " la", "ion", "on ", "re ", " pa", "e l", "e d", " l'", "e p", " co", " pr", "tio", "ns ", " en", "ne ", "que", "r l", "les", "ur ", "en ", "ati", "ue ", " po", " d'", "par", " a ", "et ", "it ", " qu", "men", "ons", "te ", " et", "t d", " re", "des", " un", "ie ", "s l", " su", "pou", " au", " à ", "con", "er ", " no", "ait", "e c", "se ", "té ", "du ", " du", " dé", "ce ", "e e", "is ", "n d", "s a", " so", "e r", "e s", "our", "res", "ssi", "eur", " se", "eme", "est", "us ", "sur", "ant", "iqu", "s p", "une", "uss", "l'a", "pro", "ter", "tre", "end", "rs ", " ce", "e a", "t p", "un ", " ma", " ru", " ré", "ous", "ris", "rus", "sse", "ans", "ar ", "com", "e m", "ire", "nce", "nte", "t l", " av", " mo", " te", "il ", "me ", "ont", "ten", "a p", "dan", "pas", "qui", "s e", "s s", " in", "ist", "lle", "nou", "pré", "'un", "air", "d'a", "ir ", "n e", "rop", "ts ", " da", "a s", "as ", "au ", "den", "mai", "mis", "ori", "out", "rme", "sio", "tte", "ux ", "a d", "ien", "n a", "ntr", "omm", "ort", "ouv", "s c", "son", "tes", "ver", "ère", " il", " m ", " sa", " ve", "a r", "ais", "ava", "di ", "n p", "sti", "ven", " mi", "ain", "enc", "for", "ité", "lar", "oir", "rem", "ren", "rro", "rés", "sie", "t a", "tur", " pe", " to", "d'u", "ell", "err", "ers", "ide", "ine", "iss", "mes", "por", "ran", "sit", "st ", "t r", "uti", "vai", "é l", "ési", " di", " n'", " ét", "a c", "ass", "e t", "in ", "nde", "pre", "rat", "s m", "ste", "tai", "tch", "ui ", "uro", "ès ", " es", " fo", " tr", "'ad", "app", "aux", "e à", "ett", "iti", "lit", "nal", "opé", "r d", "ra ", "rai", "ror", "s r", "tat", "uté", "à l", " af", "anc", "ara", "art", "bre", "ché", "dre", "e f", "ens", "lem", "n r", "n t", "ndr", "nne", "onn", "pos", "s t", "tiq", "ure", " tu", "ale", "and", "ave", "cla", "cou", "e n", "emb", "ins", "jou", "mme", "rie", "rès", "sem", "str", "t i", "ues", "uni", "uve", "é d", "ée ", " ch", " do", " eu", " fa", " lo", " ne", " ra", "arl", "att", "ec ", "ica", "l a", "l'o", "l'é", "mmi", "nta", "orm", "ou ", "r u", "rle");
+$GLOBALS["ngrams"]['ha'] = array(" da", "da ", "in ", "an ", "ya ", " wa", " ya", "na ", "ar ", "a d", " ma", "wa ", "a a", "a k", "a s", " ta", "wan", " a ", " ba", " ka", "ta ", "a y", "n d", " ha", " na", " su", " sa", "kin", "sa ", "ata", " ko", "a t", "su ", " ga", "ai ", " sh", "a m", "uwa", "iya", "ma ", "a w", "asa", "yan", "ka ", "ani", "shi", "a b", "a h", "a c", "ama", "ba ", "nan", "n a", " mu", "ana", " yi", "a g", " za", "i d", " ku", "aka", "yi ", "n k", "ann", "ke ", "tar", " ci", "iki", "n s", "ko ", " ra", "ki ", "ne ", "a z", "mat", "hak", "nin", "e d", "nna", "uma", "nda", "a n", "ada", "cik", "ni ", "rin", "una", "ara", "kum", "akk", " ce", " du", "man", "n y", "nci", "sar", "aki", "awa", "ci ", "kan", "kar", "ari", "n m", "and", "hi ", "n t", "ga ", "owa", "ash", "kam", "dan", "ewa", "nsa", "ali", "ami", " ab", " do", "anc", "n r", "aya", "i n", "sun", "uka", " al", " ne", "a'a", "cew", "cin", "mas", "tak", "un ", "aba", "kow", "a r", "ra ", " ja", " ƙa", "en ", "r d", "sam", "tsa", " ru", "ce ", "i a", "abi", "ida", "mut", "n g", "n j", "san", "a ƙ", "har", "on ", "i m", "suk", " ak", " ji", "yar", "'ya", "kwa", "min", " 'y", "ane", "ban", "ins", "ruw", "i k", "n h", " ad", "ake", "n w", "sha", "utu", " ƴa", "bay", "tan", "ƴan", "bin", "duk", "e m", "n n", "oka", "yin", "ɗan", " fa", "a i", "kki", "re ", "za ", "ala", "asu", "han", "i y", "mar", "ran", "ƙas", "add", "ars", "gab", "ira", "mma", "u d", " ts", "abb", "abu", "aga", "gar", "n b", " ɗa", "aci", "aik", "am ", "dun", "e s", "i b", "i w", "kas", "kok", "wam", " am", "amf", "bba", "din", "fan", "gwa", "i s", "wat", "ano", "are", "dai", "iri", "ma'", " la", "all", "dam", "ika", "mi ", "she", "tum", "uni", " an", " ai", " ke", " ki", "dag", "mai", "mfa", "no ", "nsu", "o d", "sak", "um ", " bi", " gw", " kw", "jam", "yya", "a j", "fa ", "uta", " hu", "'a ", "ans", "aɗa", "dda", "hin", "niy", "r s", "bat", "dar", "gan", "i t", "nta", "oki", "omi", "sal", "a l", "kac", "lla", "wad", "war", "amm", "dom", "r m", "ras", "sai", " lo", "ats", "hal", "kat", "li ", "lok", "n c", "nar", "tin", "afa", "bub", "i g", "isa", "mak");
+$GLOBALS["ngrams"]['haw'] = array(" ka", "na ", " o ", "ka ", " ma", " a ", " la", "a i", "a m", " i ", "la ", "ana", "ai ", "ia ", "a o", "a k", "a h", "o k", " ke", "a a", "i k", " ho", " ia", "ua ", " na", " me", "e k", "e a", "au ", "ke ", "ma ", "mai", "aku", " ak", "ahi", " ha", " ko", " e ", "a l", " no", "me ", "ku ", "aka", "kan", "no ", "i a", "ho ", "ou ", " ai", "i o", "a p", "o l", "o a", "ama", "a n", " an", "i m", "han", "i i", "iho", "kou", "ne ", " ih", "o i", "iki", "ona", "hoo", "le ", "e h", " he", "ina", " wa", "ea ", "ako", "u i", "kah", "oe ", "i l", "u a", " pa", "hoi", "e i", "era", "ko ", "u m", "kua", "mak", "oi ", "kai", "i n", "a e", "hin", "ane", " ol", "i h", "mea", "wah", "lak", "e m", "o n", "u l", "ika", "ki ", "a w", "mal", "hi ", "e n", "u o", "hik", " ku", "e l", "ele", "ra ", "ber", "ine", "abe", "ain", "ala", "lo ", " po", "kon", " ab", "ole", "he ", "pau", "mah", "va ", "ela", "kau", "nak", " oe", "kei", "oia", " ie", "ram", " oi", "oa ", "eho", "hov", "ieh", "ova", " ua", "una", "ara", "o s", "awa", "o o", "nau", "u n", "wa ", "wai", "hel", " ae", " al", "ae ", "ta ", "aik", " hi", "ale", "ila", "lel", "ali", "eik", "olo", "onu", " lo", "aua", "e o", "ola", "hon", "mam", "nan", " au", "aha", "lau", "nua", "oho", "oma", " ao", "ii ", "alu", "ima", "mau", "ike", "apa", "elo", "lii", "poe", "aia", "noa", " in", "o m", "oka", "'u ", "aho", "ei ", "eka", "ha ", "lu ", "nei", "hol", "ino", "o e", "ema", "iwa", "olu", "ada", "naa", "pa ", "u k", "ewa", "hua", "lam", "lua", "o h", "ook", "u h", " li", "ahu", "amu", "ui ", " il", " mo", " se", "eia", "law", " hu", " ik", "ail", "e p", "li ", "lun", "uli", "io ", "kik", "noh", "u e", " sa", "aaw", "awe", "ena", "hal", "kol", "lan", " le", " ne", "a'u", "ilo", "kap", "oko", "sa ", " pe", "hop", "loa", "ope", "pe ", " ad", " pu", "ahe", "aol", "ia'", "lai", "loh", "na'", "oom", "aau", "eri", "kul", "we ", "ake", "kek", "laa", "ri ", "iku", "kak", "lim", "nah", "ner", "nui", "ono", "a u", "dam", "kum", "lok", "mua", "uma", "wal", "wi ", "'i ", "a'i", "aan", "alo", "eta", "mu ", "ohe", "u p", "ula", "uwa", " nu", "amo");
+$GLOBALS["ngrams"]['hi'] = array("ें ", " है", "में", " मे", "ने ", "की ", "के ", "है ", " के", " की", " को", "ों ", "को ", "ा ह", " का", "से ", "ा क", "े क", "ं क", "या ", " कि", " से", "का ", "ी क", " ने", " और", "और ", "ना ", "कि ", "भी ", "ी स", " जा", " पर", "ार ", " कर", "ी ह", " हो", "ही ", "िया", " इस", " रह", "र क", "ुना", "ता ", "ान ", "े स", " भी", " रा", "े ह", " चु", " पा", "पर ", "चुन", "नाव", " कह", "प्र", " भा", "राज", "हैं", "ा स", "ै क", "ैं ", "नी ", "ल क", "ीं ", "़ी ", "था ", "री ", "ाव ", "े ब", " प्", "क्ष", "पा ", "ले ", " दे", "ला ", "हा ", "ाजप", " था", " नह", "इस ", "कर ", "जपा", "नही", "भाज", "यों", "र स", "हीं", " अम", " बा", " मा", " वि", "रीक", "िए ", "े प", "्या", " ही", "ं म", "कार", "ा ज", "े ल", " ता", " दि", " सा", " हम", "ा न", "ा म", "ाक़", "्ता", " एक", " सं", " स्", "अमर", "क़ी", "ताज", "मरी", "स्थ", "ा थ", "ार्", " हु", "इरा", "एक ", "न क", "र म", "राक", "ी ज", "ी न", " इर", " उन", " पह", "कहा", "ते ", "े अ", " तो", " सु", "ति ", "ती ", "तो ", "मिल", "िक ", "ियो", "्रे", " अप", " फ़", " लि", " लो", " सम", "म क", "र्ट", "हो ", "ा च", "ाई ", "ाने", "िन ", "्य ", " उस", " क़", " सक", " सै", "ं प", "ं ह", "गी ", "त क", "मान", "र न", "ष्ट", "स क", "स्त", "ाँ ", "ी ब", "ी म", "्री", " दो", " मि", " मु", " ले", " शा", "ं स", "ज़ा", "त्र", "थी ", "लिए", "सी ", "़ा ", "़ार", "ांग", "े द", "े म", "्व ", " ना", " बन", "ंग्", "कां", "गा ", "ग्र", "जा ", "ज्य", "दी ", "न म", "पार", "भा ", "रही", "रे ", "रेस", "ली ", "सभा", "ा र", "ाल ", "ी अ", "ीकी", "े त", "ेश ", " अं", " तक", " या", "ई ह", "करन", "तक ", "देश", "वर्", "ाया", "ी भ", "ेस ", "्ष ", " गय", " जि", " थी", " बड", " यह", " वा", "ंतर", "अंत", "क़ ", "गया", "टी ", "निक", "न्ह", "पहल", "बड़", "मार", "र प", "रने", "ाज़", "ि इ", "ी र", "े ज", "े व", "्ट ", "्टी", " अब", " लग", " वर", " सी", "ं भ", "उन्", "क क", "किय", "देख", "पूर", "फ़्", "यह ", "यान", "रिक", "रिय", "र्ड", "लेक", "सकत", "हों", "होग", "ा अ", "ा द", "ा प", "ाद ", "ारा", "ित ", "ी त", "ी प", "ो क", "ो द", " ते", " नि", " सर", " हा", "ं द", "अपन", "जान", "त म", "थित", "पनी", "महल", "र ह", "लोग", "व क", "हना", "हल ", "हाँ", "ाज्", "ाना", "िक्", "िस्");
+$GLOBALS["ngrams"]['hr'] = array("je ", " na", " pr", " po", "na ", " je", " za", "ije", "ne ", " i ", "ti ", "da ", " ko", " ne", "li ", " bi", " da", " u ", "ma ", "mo ", "a n", "ih ", "za ", "a s", "ko ", "i s", "a p", "koj", "pro", "ju ", "se ", " go", "ost", "to ", "va ", " do", " to", "e n", "i p", " od", " ra", "no ", "ako", "ka ", "ni ", " ka", " se", " mo", " st", "i n", "ima", "ja ", "pri", "vat", "sta", " su", "ati", "e p", "ta ", "tsk", "e i", "nij", " tr", "cij", "jen", "nos", "o s", " iz", "om ", "tro", "ili", "iti", "pos", " al", "a i", "a o", "e s", "ija", "ini", "pre", "str", "la ", "og ", "ovo", " sv", "ekt", "nje", "o p", "odi", "rva", " ni", "ali", "min", "rij", "a t", "a z", "ats", "iva", "o t", "od ", "oje", "ra ", " hr", "a m", "a u", "hrv", "im ", "ke ", "o i", "ovi", "red", "riv", "te ", "bi ", "e o", "god", "i d", "lek", "umi", "zvo", "din", "e u", "ene", "jed", "ji ", "lje", "nog", "su ", " a ", " el", " mi", " o ", "a d", "alu", "ele", "i u", "izv", "ktr", "lum", "o d", "ori", "rad", "sto", "a k", "anj", "ava", "e k", "men", "nic", "o j", "oj ", "ove", "ski", "tvr", "una", "vor", " di", " no", " s ", " ta", " tv", "i i", "i o", "kak", "roš", "sko", "vod", " sa", " će", "a b", "adi", "amo", "eni", "gov", "iju", "ku ", "o n", "ora", "rav", "ruj", "smo", "tav", "tru", "u p", "ve ", " in", " pl", "aci", "bit", "de ", "diš", "ema", "i m", "ika", "išt", "jer", "ki ", "mog", "nik", "nov", "nu ", "oji", "oli", "pla", "pod", "st ", "sti", "tra", "tre", "vo ", " sm", " št", "dan", "e z", "i t", "io ", "ist", "kon", "lo ", "stv", "u s", "uje", "ust", "će ", "ći ", "što", " dr", " im", " li", "ada", "aft", "ani", "ao ", "ars", "ata", "e t", "emo", "i k", "ine", "jem", "kov", "lik", "lji", "mje", "naf", "ner", "nih", "nja", "ogo", "oiz", "ome", "pot", "ran", "ri ", "roi", "rtk", "ska", "ter", "u i", "u o", "vi ", "vrt", " me", " ug", "ak ", "ama", "drž", "e e", "e g", "e m", "em ", "eme", "enj", "ent", "er ", "ere", "erg", "eur", "go ", "i b", "i z", "jet", "ksi", "o u", "oda", "ona", "pra", "reb", "rem", "rop", "tri", "žav", " ci", " eu", " re", " te", " uv", " ve", "aju", "an ");
+$GLOBALS["ngrams"]['hu'] = array(" a ", " az", " sz", "az ", " me", "en ", " el", " ho", "ek ", "gy ", "tt ", "ett", "sze", " fe", "és ", " ki", "tet", " be", "et ", "ter", " kö", " és", "hog", "meg", "ogy", "szt", "te ", "t a", "zet", "a m", "nek", "nt ", "ség", "szá", "ak ", " va", "an ", "eze", "ra ", "ta ", " mi", "int", "köz", " is", "esz", "fel", "min", "nak", "ors", "zer", " te", "a a", "a k", "is ", " cs", "ele", "er ", "men", "si ", "tek", "ti ", " ne", "csa", "ent", "z e", "a t", "ala", "ere", "es ", "lom", "lte", "mon", "ond", "rsz", "sza", "tte", "zág", "ány", " fo", " ma", "ai ", "ben", "el ", "ene", "ik ", "jel", "tás", "áll", " ha", " le", " ál", "agy", "alá", "isz", "y a", "zte", "ás ", " al", "e a", "egy", "ely", "for", "lat", "lt ", "n a", "oga", "on ", "re ", "st ", "ság", "t m", "án ", "ét ", "ült", " je", "gi ", "k a", "kül", "lam", "len", "lás", "más", "s k", "vez", "áso", "özö", " ta", "a s", "a v", "asz", "atá", "ető", "kez", "let", "mag", "nem", "szé", "z m", "át ", "éte", "ölt", " de", " gy", " ké", " mo", " vá", " ér", "a b", "a f", "ami", "at ", "ato", "att", "bef", "dta", "gya", "hat", "i s", "las", "ndt", "rt ", "szo", "t k", "tár", "tés", "van", "ásá", "ól ", " bé", " eg", " or", " pá", " pé", " ve", "ban", "eke", "ekü", "elő", "erv", "ete", "fog", "i a", "kis", "lád", "nte", "nye", "nyi", "ok ", "omá", "os ", "rán", "rás", "sal", "t e", "vál", "yar", "ágo", "ála", "ége", "ény", "ött", " tá", "adó", "elh", "fej", "het", "hoz", "ill", "jár", "kés", "llo", "mi ", "ny ", "ont", "ren", "res", "rin", "s a", "s e", "ssz", "zt ", " ez", " ka", " ke", " ko", " re", "a h", "a n", "den", "dó ", "efo", "gad", "gat", "gye", "hel", "k e", "ket", "les", "mán", "nde", "nis", "ozz", "t b", "t i", "t é", "tat", "tos", "val", "z o", "zak", "ád ", "ály", "ára", "ési", "ész", " ak", " am", " es", " há", " ny", " tö", "aka", "art", "ató", "azt", "bbe", "ber", "ció", "cso", "em ", "eti", "eté", "gal", "i t", "ini", "ist", "ja ", "ker", "ki ", "kor", "koz", "l é", "ljá", "lye", "n v", "ni ", "pál", "ror", "ról", "rül", "s c", "s p", "s s", "s v", "sok", "t j", "t t", "tar", "tel", "vat");
+$GLOBALS["ngrams"]['id'] = array("an ", " me", "kan", "ang", "ng ", " pe", "men", " di", " ke", " da", " se", "eng", " be", "nga", "nya", " te", "ah ", "ber", "aka", " ya", "dan", "di ", "yan", "n p", "per", "a m", "ita", " pa", "da ", "ata", "ada", "ya ", "ta ", " in", "ala", "eri", "ia ", "a d", "n k", "am ", "ga ", "at ", "era", "n d", "ter", " ka", "a p", "ari", "emb", "n m", "ri ", " ba", "aan", "ak ", "ra ", " it", "ara", "ela", "ni ", "ali", "ran", "ar ", "eru", "lah", "a b", "asi", "awa", "eba", "gan", "n b", " ha", "ini", "mer", " la", " mi", "and", "ena", "wan", " sa", "aha", "lam", "n i", "nda", " wa", "a i", "dua", "g m", "mi ", "n a", "rus", "tel", "yak", " an", "dal", "h d", "i s", "ing", "min", "ngg", "tak", "ami", "beb", "den", "gat", "ian", "ih ", "pad", "rga", "san", "ua ", " de", "a t", "arg", "dar", "elu", "har", "i k", "i m", "i p", "ika", "in ", "iny", "itu", "mba", "n t", "ntu", "pan", "pen", "sah", "tan", "tu ", "a k", "ban", "edu", "eka", "g d", "ka ", "ker", "nde", "nta", "ora", "usa", " du", " ma", "a s", "ai ", "ant", "bas", "end", "i d", "ira", "kam", "lan", "n s", "uli", "al ", "apa", "ere", "ert", "lia", "mem", "rka", "si ", "tal", "ung", " ak", "a a", "a w", "ani", "ask", "ent", "gar", "haa", "i i", "isa", "ked", "mbe", "ska", "tor", "uan", "uk ", "uka", " ad", " to", "asa", "aya", "bag", "dia", "dun", "erj", "mas", "na ", "rek", "rit", "sih", "us ", " bi", "a h", "ama", "dib", "ers", "g s", "han", "ik ", "kem", "ma ", "n l", "nit", "r b", "rja", "sa ", " ju", " or", " si", " ti", "a y", "aga", "any", "as ", "cul", "eme", "emu", "eny", "epa", "erb", "erl", "gi ", "h m", "i a", "kel", "li ", "mel", "nia", "opa", "rta", "sia", "tah", "ula", "un ", "unt", " at", " bu", " pu", " ta", "agi", "alu", "amb", "bah", "bis", "er ", "i t", "ibe", "ir ", "ja ", "k m", "kar", "lai", "lal", "lu ", "mpa", "ngk", "nja", "or ", "pa ", "pas", "pem", "rak", "rik", "seb", "tam", "tem", "top", "tuk", "uni", "war", " al", " ga", " ge", " ir", " ja", " mu", " na", " pr", " su", " un", "ad ", "adi", "akt", "ann", "apo", "bel", "bul", "der", "ega", "eke", "ema", "emp", "ene", "enj", "esa");
+$GLOBALS["ngrams"]['is'] = array("að ", "um ", " að", "ir ", "ið ", "ur ", " ve", " í ", "na ", " á ", " se", " er", " og", "ar ", "og ", "ver", " mi", "inn", "nn ", " fy", "er ", "fyr", " ek", " en", " ha", " he", "ekk", " st", "ki ", "st ", "ði ", " ba", " me", " vi", "ig ", "rir", "yri", " um", "g f", "leg", "lei", "ns ", "ð s", " ei", " þa", "in ", "kki", "r h", "r s", "egi", "ein", "ga ", "ing", "ra ", "sta", " va", " þe", "ann", "en ", "mil", "sem", "tjó", "arð", "di ", "eit", "haf", "ill", "ins", "ist", "llj", "ndi", "r a", "r e", "seg", "un ", "var", " bi", " el", " fo", " ge", " yf", "and", "aug", "bau", "big", "ega", "eld", "erð", "fir", "foo", "gin", "itt", "n s", "ngi", "num", "od ", "ood", "sin", "ta ", "tt ", "við", "yfi", "ð e", "ð f", " hr", " sé", " þv", "a e", "a á", "em ", "gi ", "i f", "jar", "jór", "lja", "m e", "r á", "rei", "rst", "rða", "rði", "rðu", "stj", "und", "veg", "ví ", "ð v", "það", "því", " fj", " ko", " sl", "eik", "end", "ert", "ess", "fjá", "fur", "gir", "hús", "jár", "n e", "ri ", "tar", "ð þ", "ðar", "ður", "þes", " br", " hú", " kr", " le", " up", "a s", "egg", "i s", "irt", "ja ", "kið", "len", "með", "mik", "n b", "nar", "nir", "nun", "r f", "r v", "rið", "rt ", "sti", "t v", "ti ", "una", "upp", "ða ", "óna", " al", " fr", " gr", "a v", "all", "an ", "da ", "eið", "eð ", "fa ", "fra", "g e", "ger", "gið", "gt ", "han", "hef", "hel", "her", "hra", "i a", "i e", "i v", "i þ", "iki", "jón", "jör", "ka ", "kró", "lík", "m h", "n a", "nga", "r l", "ram", "ru ", "ráð", "rón", "svo", "vin", "í b", "í h", "ð h", "ð k", "ð m", "örð", " af", " fa", " lí", " rá", " sk", " sv", " te", "a b", "a f", "a h", "a k", "a u", "afi", "agn", "arn", "ast", "ber", "efu", "enn", "erb", "erg", "fi ", "g a", "gar", "iðs", "ker", "kke", "lan", "ljó", "llt", "ma ", "mið", "n v", "n í", "nan", "nda", "ndu", "nið", "nna", "nnu", "nu ", "r o", "rbe", "rgi", "slö", "sé ", "t a", "t h", "til", "tin", "ugu", "vil", "ygg", "á s", "ð a", "ð b", "órn", "ögn", "öku", " at", " fi", " fé", " ka", " ma", " no", " sa", " si", " ti", " ák", "a m", "a t", "a í", "a þ", "afa", "afs", "ald", "arf");
+$GLOBALS["ngrams"]['it'] = array(" di", "to ", "la ", " de", "di ", "no ", " co", "re ", "ion", "e d", " e ", "le ", "del", "ne ", "ti ", "ell", " la", " un", "ni ", "i d", "per", " pe", "ent", " in", "one", "he ", "ta ", "zio", "che", "o d", "a d", "na ", "ato", "e s", " so", "i s", "lla", "a p", "li ", "te ", " al", " ch", "er ", " pa", " si", "con", "sta", " pr", "a c", " se", "el ", "ia ", "si ", "e p", " da", "e i", "i p", "ont", "ano", "i c", "all", "azi", "nte", "on ", "nti", "o s", " ri", "i a", "o a", "un ", " an", "are", "ari", "e a", "i e", "ita", "men", "ri ", " ca", " il", " no", " po", "a s", "ant", "il ", "in ", "a l", "ati", "cia", "e c", "ro ", "ann", "est", "gli", "tà ", " qu", "e l", "nta", " a ", "com", "o c", "ra ", " le", " ne", "ali", "ere", "ist", " ma", " è ", "io ", "lle", "me ", "era", "ica", "ost", "pro", "tar", "una", " pi", "da ", "tat", " mi", "att", "ca ", "mo ", "non", "par", "sti", " fa", " i ", " re", " su", "ess", "ini", "nto", "o l", "ssi", "tto", "a e", "ame", "col", "ei ", "ma ", "o i", "za ", " st", "a a", "ale", "anc", "ani", "i m", "ian", "o p", "oni", "sio", "tan", "tti", " lo", "i r", "oci", "oli", "ona", "ono", "tra", " l ", "a r", "eri", "ett", "lo ", "nza", "que", "str", "ter", "tta", " ba", " li", " te", "ass", "e f", "enz", "for", "nno", "olo", "ori", "res", "tor", " ci", " vo", "a i", "al ", "chi", "e n", "lia", "pre", "ria", "uni", "ver", " sp", "imo", "l a", "l c", "ran", "sen", "soc", "tic", " fi", " mo", "a n", "ce ", "dei", "ggi", "gio", "iti", "l s", "lit", "ll ", "mon", "ola", "pac", "sim", "tit", "utt", "vol", " ar", " fo", " ha", " sa", "acc", "e r", "ire", "man", "ntr", "rat", "sco", "tro", "tut", "va ", " do", " gi", " me", " sc", " tu", " ve", " vi", "a m", "ber", "can", "cit", "i l", "ier", "ità", "lli", "min", "n p", "nat", "nda", "o e", "o f", "o u", "ore", "oro", "ort", "sto", "ten", "tiv", "van", "art", "cco", "ci ", "cos", "dal", "e v", "i i", "ila", "ino", "l p", "n c", "nit", "ole", "ome", "po ", "rio", "sa ", " ce", " es", " tr", "a b", "and", "ata", "der", "ens", "ers", "gi ", "ial", "ina", "itt", "izi", "lan", "lor", "mil");
+$GLOBALS["ngrams"]['kk'] = array("ан ", "ен ", "ың ", " қа", " ба", "ай ", "нда", "ын ", " са", " ал", "ді ", "ары", "ды ", "ып ", " мұ", " бі", "асы", "да ", "най", " жа", "мұн", "ста", "ған", "н б", "ұна", " бо", "ның", "ін ", "лар", "сын", " де", "аға", "тан", " кө", "бір", "ер ", "мен", "аза", "ынд", "ыны", " ме", "анд", "ері", "бол", "дың", "қаз", "аты", "сы ", "тын", "ғы ", " ке", "ар ", "зақ", "ық ", "ала", "алы", "аны", "ара", "ағы", "ген", "тар", "тер", "тыр", "айд", "ард", "де ", "ға ", " қо", "бар", "ің ", "қан", " бе", " қы", "ақс", "гер", "дан", "дар", "лық", "лға", "ына", "ір ", "ірі", "ғас", " та", "а б", "гі ", "еді", "еле", "йды", "н к", "н т", "ола", "рын", "іп ", "қст", "қта", "ң б", " ай", " ол", " со", "айт", "дағ", "иге", "лер", "лып", "н а", "ік ", "ақт", "бағ", "кен", "н қ", "ны ", "рге", "рға", "ыр ", " ар", "алғ", "аса", "бас", "бер", "ге ", "еті", "на ", "нде", "не ", "ниг", "рды", "ры ", "сай", " ау", " кү", " ни", " от", " өз", "ауд", "еп ", "иял", "лты", "н ж", "н о", "осы", "оты", "рып", "рі ", "тке", "ты ", "ы б", "ы ж", "ылы", "ысы", "і с", "қар", " бұ", " да", " же", " тұ", " құ", "ады", "айл", "ап ", "ата", "ені", "йла", "н м", "н с", "нды", "нді", "р м", "тай", "тін", "ы т", "ыс ", "інд", " би", "а ж", "ауы", "деп", "дің", "еке", "ери", "йын", "кел", "лды", "ма ", "нан", "оны", "п ж", "п о", "р б", "рия", "рла", "уда", "шыл", "ы а", "ықт", "і а", "і б", "із ", "ілі", "ң қ", " ас", " ек", " жо", " мә", " ос", " ре", " се", "алд", "дал", "дег", "дей", "е б", "ет ", "жас", "й б", "лау", "лда", "мет", "нын", "сар", "сі ", "ті ", "ыры", "ыта", "ісі", "ң а", "өте", " ат", " ел", " жү", " ма", " то", " шы", "а а", "алт", "ама", "арл", "аст", "бұл", "дай", "дық", "ек ", "ель", "есі", "зді", "көт", "лем", "ль ", "н е", "п а", "р а", "рес", "са ", "та ", "тте", "тұр", "шы ", "ы д", "ы қ", "ыз ", "қыт", " ко", " не", " ой", " ор", " сұ", " тү", "аль", "аре", "атт", "дір", "ев ", "егі", "еда", "екі", "елд", "ерг", "ерд", "ияд", "кер", "кет", "лыс", "ліс", "мед", "мпи", "н д", "ні ", "нін", "п т", "пек", "рел", "рта", "ріл", "рін", "сен", "тал", "шіл", "ы к", "ы м", "ыст");
+$GLOBALS["ngrams"]['ky'] = array("ын ", "ан ", " жа", "ен ", "да ", " та", "ар ", "ин ", " ка", "ары", " ал", " ба", " би", "лар", " бо", " кы", "ала", "н к", " са", "нда", "ган", "тар", " де", "анд", "н б", " ке", "ард", "мен", "н т", "ара", "нын", " да", " ме", "кыр", " че", "н а", "ры ", " ко", "ген", "дар", "кен", "кта", "уу ", "ене", "ери", " ша", "алы", "ат ", "на ", " кө", " эм", "аты", "дан", "деп", "дын", "еп ", "нен", "рын", " бе", "кан", "луу", "ргы", "тан", "шай", "ырг", "үн ", " ар", " ма", "агы", "акт", "аны", "гы ", "гыз", "ды ", "рда", "ай ", "бир", "бол", "ер ", "н с", "нды", "ун ", "ча ", "ынд", "а к", "ага", "айл", "ана", "ап ", "га ", "лге", "нча", "п к", "рды", "туу", "ыны", " ан", " өз", "ама", "ата", "дин", "йт ", "лга", "лоо", "оо ", "ри ", "тин", "ыз ", "ып ", "өрү", " па", " эк", "а б", "алг", "асы", "ашт", "биз", "кел", "кте", "тал", " не", " су", "акы", "ент", "инд", "ир ", "кал", "н д", "нде", "ого", "онд", "оюн", "р б", "р м", "ран", "сал", "ста", "сы ", "ура", "ыгы", " аш", " ми", " сы", " ту", "ал ", "арт", "бор", "елг", "ени", "ет ", "жат", "йло", "кар", "н м", "огу", "п а", "п ж", "р э", "сын", "ык ", "юнч", " бу", " ур", "а а", "ак ", "алд", "алу", "бар", "бер", "бою", "ге ", "дон", "еги", "ект", "ефт", "из ", "кат", "лды", "н ч", "н э", "н ө", "ндо", "неф", "он ", "сат", "тор", "ты ", "уда", "ул ", "ула", "ууд", "ы б", "ы ж", "ы к", "ыл ", "ына", "эке", "ясы", " ат", " до", " жы", " со", " чы", "аас", "айт", "аст", "баа", "баш", "гар", "гын", "дө ", "е б", "ек ", "жыл", "и б", "ик ", "ияс", "кыз", "лда", "лык", "мда", "н ж", "нди", "ни ", "нин", "орд", "рдо", "сто", "та ", "тер", "тти", "тур", "тын", "уп ", "ушу", "фти", "ыкт", "үп ", "өн ", " ай", " бү", " ич", " иш", " мо", " пр", " ре", " өк", " өт", "а д", "а у", "а э", "айм", "амд", "атт", "бек", "бул", "гол", "дег", "еге", "ейт", "еле", "енд", "жак", "и к", "ини", "ири", "йма", "кто", "лик", "мак", "мес", "н у", "н ш", "нтт", "ол ", "оло", "пар", "рак", "рүү", "сыр", "ти ", "тик", "тта", "төр", "у ж", "у с", "шка", "ы м", "ызы", "ылд", "эме", "үрү", "өлү", "өтө", " же", " тү", " эл", " өн", "а ж", "ады");
+$GLOBALS["ngrams"]['la'] = array("um ", "us ", "ut ", "et ", "is ", " et", " in", " qu", "tur", " pr", "est", "tio", " au", "am ", "em ", "aut", " di", "ent", "in ", "dic", "t e", " es", "ur ", "ati", "ion", "st ", " ut", "ae ", "qua", " de", "nt ", " su", " si", "itu", "unt", "rum", "ia ", "es ", "ter", " re", "nti", "rae", "s e", "qui", "io ", "pro", "it ", "per", "ita", "one", "ici", "ius", " co", "t d", "bus", "pra", "m e", " no", "edi", "tia", "ue ", "ibu", " se", " ad", "er ", " fi", "ili", "que", "t i", "de ", "oru", " te", "ali", " pe", "aed", "cit", "m d", "t s", "tat", "tem", "tis", "t p", "sti", "te ", "cum", "ere", "ium", " ex", "rat", "ta ", "con", "cti", "oni", "ra ", "s i", " cu", " sa", "eni", "nis", "nte", "eri", "omi", "re ", "s a", "min", "os ", "ti ", "uer", " ma", " ue", "m s", "nem", "t m", " mo", " po", " ui", "gen", "ict", "m i", "ris", "s s", "t a", "uae", " do", "m a", "t c", " ge", "as ", "e i", "e p", "ne ", " ca", "ine", "quo", "s p", " al", "e e", "ntu", "ro ", "tri", "tus", "uit", "atu", "ini", "iqu", "m p", "ost", "res", "ura", " ac", " fu", "a e", "ant", "nes", "nim", "sun", "tra", "e a", "s d", " pa", " uo", "ecu", " om", " tu", "ad ", "cut", "omn", "s q", " ei", "ex ", "icu", "tor", "uid", " ip", " me", "e s", "era", "eru", "iam", "ide", "ips", " iu", "a s", "do ", "e d", "eiu", "ica", "im ", "m c", "m u", "tiu", " ho", "cat", "ist", "nat", "on ", "pti", "reg", "rit", "s t", "sic", "spe", " en", " sp", "dis", "eli", "liq", "lis", "men", "mus", "num", "pos", "sio", " an", " gr", "abi", "acc", "ect", "ri ", "uan", " le", "ecc", "ete", "gra", "non", "se ", "uen", "uis", " fa", " tr", "ate", "e c", "fil", "na ", "ni ", "pul", "s f", "ui ", "at ", "cce", "dam", "i e", "ina", "leg", "nos", "ori", "pec", "rop", "sta", "uia", "ene", "iue", "iui", "siu", "t t", "t u", "tib", "tit", " da", " ne", "a d", "and", "ege", "equ", "hom", "imu", "lor", "m m", "mni", "ndo", "ner", "o e", "r e", "sit", "tum", "utu", "a p", "bis", "bit", "cer", "cta", "dom", "fut", "i s", "ign", "int", "mod", "ndu", "nit", "rib", "rti", "tas", "und", " ab", "err", "ers", "ite", "iti", "m t", "o p");
+$GLOBALS["ngrams"]['lt'] = array("as ", " pa", " ka", "ai ", "us ", "os ", "is ", " ne", " ir", "ir ", "ti ", " pr", "aus", "ini", "s p", "pas", "ių ", " ta", " vi", "iau", " ko", " su", "kai", "o p", "usi", " sa", "vo ", "tai", "ali", "tų ", "io ", "jo ", "s k", "sta", "iai", " bu", " nu", "ius", "mo ", " po", "ien", "s s", "tas", " me", "uvo", "kad", " iš", " la", "to ", "ais", "ie ", "kur", "uri", " ku", "ijo", "čia", "au ", "met", "je ", " va", "ad ", " ap", "and", " gr", " ti", "kal", "asi", "i p", "iči", "s i", "s v", "ink", "o n", "ės ", "buv", "s a", " ga", "aip", "avi", "mas", "pri", "tik", " re", "etu", "jos", " da", "ent", "oli", "par", "ant", "ara", "tar", "ama", "gal", "imo", "išk", "o s", " at", " be", " į ", "min", "tin", " tu", "s n", " jo", "dar", "ip ", "rei", " te", "dži", "kas", "nin", "tei", "vie", " li", " se", "cij", "gar", "lai", "art", "lau", "ras", "no ", "o k", "tą ", " ar", "ėjo", "vič", "iga", "pra", "vis", " na", "men", "oki", "raš", "s t", "iet", "ika", "int", "kom", "tam", "aug", "avo", "rie", "s b", " st", "eim", "ko ", "nus", "pol", "ria", "sau", "api", "me ", "ne ", "sik", " ši", "i n", "ia ", "ici", "oja", "sak", "sti", "ui ", "ame", "lie", "o t", "pie", "čiu", " di", " pe", "gri", "ios", "lia", "lin", "s d", "s g", "ta ", "uot", " ja", " už", "aut", "i s", "ino", "mą ", "oje", "rav", "dėl", "nti", "o a", "toj", "ėl ", " to", " vy", "ar ", "ina", "lic", "o v", "sei", "su ", " mi", " pi", "din", "iš ", "lan", "si ", "tus", " ba", "asa", "ata", "kla", "omi", "tat", " an", " ji", "als", "ena", "jų ", "nuo", "per", "rig", "s m", "val", "yta", "čio", " ra", "i k", "lik", "net", "nė ", "tis", "tuo", "yti", "ęs ", "ų s", "ada", "ari", "do ", "eik", "eis", "ist", "lst", "ma ", "nes", "sav", "sio", "tau", " ki", "aik", "aud", "ies", "ori", "s r", "ska", " ge", "ast", "eig", "et ", "iam", "isa", "mis", "nam", "ome", "žia", "aba", "aul", "ikr", "ką ", "nta", "ra ", "tur", " ma", "die", "ei ", "i t", "nas", "rin", "sto", "tie", "tuv", "vos", "ų p", " dė", "are", "ats", "enė", "ili", "ima", "kar", "ms ", "nia", "r p", "rod", "s l", " o ", "e p", "es ", "ide", "ik ", "ja ");
+$GLOBALS["ngrams"]['lv'] = array("as ", " la", " pa", " ne", "es ", " un", "un ", " ka", " va", "ar ", "s p", " ar", " vi", "is ", "ai ", " no", "ja ", "ija", "iem", "em ", "tu ", "tie", "vie", "lat", "aks", "ien", "kst", "ies", "s a", "rak", "atv", "tvi", " ja", " pi", "ka ", " ir", "ir ", "ta ", " sa", "ts ", " kā", "ās ", " ti", "ot ", "s n", " ie", " ta", "arī", "par", "pie", " pr", "kā ", " at", " ra", "am ", "inā", "tā ", " iz", "jas", "lai", " na", "aut", "ieš", "s s", " ap", " ko", " st", "iek", "iet", "jau", "us ", "rī ", "tik", "ība", "na ", " ga", "cij", "s i", " uz", "jum", "s v", "ms ", "var", " ku", " ma", "jā ", "sta", "s u", " tā", "die", "kai", "kas", "ska", " ci", " da", "kur", "lie", "tas", "a p", "est", "stā", "šan", "nes", "nie", "s d", "s m", "val", " di", " es", " re", "no ", "to ", "umu", "vai", "ši ", " vē", "kum", "nu ", "rie", "s t", "ām ", "ad ", "et ", "mu ", "s l", " be", "aud", "tur", "vij", "viņ", "āju", "bas", "gad", "i n", "ika", "os ", "a v", "not", "oti", "sts", "aik", "u a", "ā a", "āk ", " to", "ied", "stu", "ti ", "u p", "vēl", "āci", " šo", "gi ", "ko ", "pro", "s r", "tāj", "u s", "u v", "vis", "aun", "ks ", "str", "zin", "a a", "adī", "da ", "dar", "ena", "ici", "kra", "nas", "stī", "šu ", " mē", "a n", "eci", "i s", "ie ", "iņa", "ju ", "las", "r t", "ums", "šie", "bu ", "cit", "i a", "ina", "ma ", "pus", "ra ", " au", " se", " sl", "a s", "ais", "eši", "iec", "iku", "pār", "s b", "s k", "sot", "ādā", " in", " li", " tr", "ana", "eso", "ikr", "man", "ne ", "u k", " tu", "an ", "av ", "bet", "būt", "im ", "isk", "līd", "nav", "ras", "ri ", "s g", "sti", "īdz", " ai", "arb", "cin", "das", "ent", "gal", "i p", "lik", "mā ", "nek", "pat", "rēt", "si ", "tra", "uši", "vei", " br", " pu", " sk", "als", "ama", "edz", "eka", "ešu", "ieg", "jis", "kam", "lst", "nāk", "oli", "pre", "pēc", "rot", "tās", "usi", "ēl ", "ēs ", " bi", " de", " me", " pā", "a i", "aid", "ajā", "ikt", "kat", "lic", "lod", "mi ", "ni ", "pri", "rād", "rīg", "sim", "trā", "u l", "uto", "uz ", "ēc ", "ītā", " ce", " jā", " sv", "a t", "aga", "aiz", "atu", "ba ", "cie", "du ", "dzi", "dzī");
+$GLOBALS["ngrams"]['mk'] = array("на ", " на", "та ", "ата", "ија", " пр", "то ", "ја ", " за", "а н", " и ", "а с", "те ", "ите", " ко", "от ", " де", " по", "а д", "во ", "за ", " во", " од", " се", " не", "се ", " до", "а в", "ка ", "ање", "а п", "о п", "ува", "циј", "а о", "ици", "ето", "о н", "ани", "ни ", " вл", "дек", "ека", "њет", "ќе ", " е ", "а з", "а и", "ат ", "вла", "го ", "е н", "од ", "пре", " го", " да", " ма", " ре", " ќе", "али", "и д", "и н", "иот", "нат", "ово", " па", " ра", " со", "ове", "пра", "што", "ње ", "а е", "да ", "дат", "дон", "е в", "е д", "е з", "е с", "кон", "нит", "но ", "они", "ото", "пар", "при", "ста", "т н", " шт", "а к", "аци", "ва ", "вањ", "е п", "ени", "ла ", "лад", "мак", "нес", "нос", "про", "рен", "јат", " ин", " ме", " то", "а г", "а м", "а р", "аке", "ако", "вор", "гов", "едо", "ена", "и и", "ира", "кед", "не ", "ниц", "ниј", "ост", "ра ", "рат", "ред", "ска", "тен", " ка", " сп", " ја", "а т", "аде", "арт", "е г", "е и", "кат", "лас", "нио", "о с", "ри ", " ба", " би", "ава", "ате", "вни", "д н", "ден", "дов", "држ", "дув", "е о", "ен ", "ере", "ери", "и п", "и с", "ина", "кој", "нци", "о м", "о о", "одн", "пор", "ски", "спо", "ств", "сти", "тво", "ти ", " об", " ов", "а б", "алн", "ара", "бар", "е к", "ед ", "ент", "еѓу", "и о", "ии ", "меѓ", "о д", "оја", "пот", "раз", "раш", "спр", "сто", "т д", "ци ", " бе", " гр", " др", " из", " ст", "аа ", "бид", "вед", "гла", "еко", "енд", "есе", "етс", "зац", "и т", "иза", "инс", "ист", "ки ", "ков", "кол", "ку ", "лиц", "о з", "о и", "ова", "олк", "оре", "ори", "под", "рањ", "реф", "ржа", "ров", "рти", "со ", "тор", "фер", "цен", "цит", " а ", " вр", " гл", " дп", " мо", " ни", " но", " оп", " от", "а ќ", "або", "ада", "аса", "аша", "ба ", "бот", "ваа", "ват", "вот", "ги ", "гра", "де ", "дин", "дум", "евр", "еду", "ено", "ера", "ес ", "ење", "же ", "зак", "и в", "ила", "иту", "коа", "кои", "лан", "лку", "лож", "мот", "нду", "нст", "о в", "оа ", "оал", "обр", "ов ", "ови", "овн", "ои ", "ор ", "орм", "ој ", "рет", "сед", "ст ", "тер", "тиј", "тоа", "фор", "ции", "ѓу ", " ал", " ве", " вм", " ги", " ду");
+$GLOBALS["ngrams"]['mn'] = array("ын ", " ба", "йн ", "бай", "ийн", "уул", " ул", "улс", "ан ", " ха", "ний", "н х", "гаа", "сын", "ий ", "лсы", " бо", "й б", "эн ", "ах ", "бол", "ол ", "н б", "оло", " хэ", "онг", "гол", "гуу", "нго", "ыг ", "жил", " мо", "лаг", "лла", "мон", " тє", " ху", "айд", "ны ", "он ", "сан", "хий", " аж", " ор", "л у", "н т", "улг", "айг", "длы", "йг ", " за", "дэс", "н а", "ндэ", "ула", "ээ ", "ага", "ийг", "vй ", "аа ", "й а", "лын", "н з", " аю", " зє", "аар", "ад ", "ар ", "гvй", "зєв", "ажи", "ал ", "аюу", "г х", "лгv", "лж ", "сни", "эсн", "юул", "йдл", "лыг", "нхи", "ууд", "хам", " нэ", " са", "гий", "лах", "лєл", "рєн", "єгч", " та", "илл", "лий", "лэх", "рий", "эх ", " ер", " эр", "влє", "ерє", "ийл", "лон", "лєг", "євл", "єнх", " хо", "ари", "их ", "хан", "эр ", "єн ", "vvл", "ж б", "тэй", "х х", "эрх", " vн", " нь", "vнд", "алт", "йлє", "нь ", "тєр", " га", " су", "аан", "даа", "илц", "йгу", "л а", "лаа", "н н", "руу", "эй ", " то", "н с", "рил", "єри", "ааг", "гч ", "лээ", "н о", "рэг", "суу", "эрэ", "їїл", " yн", " бу", " дэ", " ол", " ту", " ши", "yнд", "аши", "г т", "иг ", "йл ", "хар", "шин", "эг ", "єр ", " их", " хє", " хї", "ам ", "анг", "ин ", "йга", "лса", "н v", "н е", "нал", "нд ", "хуу", "цаа", "эд ", "ээр", "єл ", "vйл", "ада", "айн", "ала", "амт", "гах", "д х", "дал", "зар", "л б", "лан", "н д", "сэн", "улл", "х б", "хэр", " бv", " да", " зо", "vрэ", "аад", "гээ", "лэн", "н и", "н э", "нга", "нэ ", "тал", "тын", "хур", "эл ", " на", " ни", " он", "vлэ", "аг ", "аж ", "ай ", "ата", "бар", "г б", "гад", "гїй", "й х", "лт ", "н м", "на ", "оро", "уль", "чин", "эж ", "энэ", "ээд", "їй ", "їлэ", " би", " тэ", " эн", "аны", "дий", "дээ", "лал", "лга", "лд ", "лог", "ль ", "н у", "н ї", "р б", "рал", "сон", "тай", "удл", "элт", "эрг", "єлє", " vй", " в ", " гэ", " хv", "ара", "бvр", "д н", "д о", "л х", "лс ", "лты", "н г", "нэг", "огт", "олы", "оёр", "р т", "рээ", "тав", "тог", "уур", "хоё", "хэл", "хээ", "элэ", "ёр ", " ав", " ас", " аш", " ду", " со", " чи", " эв", " єр", "аал", "алд", "амж", "анд", "асу", "вэр", "г у", "двэ", "жvv", "лца", "лэл");
+$GLOBALS["ngrams"]['nb'] = array("er ", "en ", "et ", " de", "det", " i ", "for", "il ", " fo", " me", "ing", "om ", " ha", " og", "ter", " er", " ti", " st", "og ", "til", "ne ", " vi", "re ", " en", " se", "te ", "or ", "de ", "kke", "ke ", "ar ", "ng ", "r s", "ene", " so", "e s", "der", "an ", "som", "ste", "at ", "ed ", "r i", " av", " in", "men", " at", " ko", " på", "har", " si", "ere", "på ", "nde", "and", "els", "ett", "tte", "lig", "t s", "den", "t i", "ikk", "med", "n s", "rt ", "ser", "ska", "t e", "ker", "sen", "av ", "ler", "r a", "ten", "e f", "r e", "r t", "ede", "ig ", " re", "han", "lle", "ner", " bl", " fr", "le ", " ve", "e t", "lan", "mme", "nge", " be", " ik", " om", " å ", "ell", "sel", "sta", "ver", " et", " sk", "nte", "one", "ore", "r d", "ske", " an", " la", "del", "gen", "nin", "r f", "r v", "se ", " po", "ir ", "jon", "mer", "nen", "omm", "sjo", " fl", " sa", "ern", "kom", "r m", "r o", "ren", "vil", "ale", "es ", "n a", "t f", " le", "bli", "e e", "e i", "e v", "het", "ye ", " ir", "al ", "e o", "ide", "iti", "lit", "nne", "ran", "t o", "tal", "tat", "tt ", " ka", "ans", "asj", "ge ", "inn", "kon", "lse", "pet", "t d", "vi ", " ut", "ent", "eri", "oli", "r p", "ret", "ris", "sto", "str", "t a", " ga", "all", "ape", "g s", "ill", "ira", "kap", "nn ", "opp", "r h", "rin", " br", " op", "e m", "ert", "ger", "ion", "kal", "lsk", "nes", " gj", " mi", " pr", "ang", "e h", "e r", "elt", "enn", "i s", "ist", "jen", "kan", "lt ", "nal", "res", "tor", "ass", "dre", "e b", "e p", "mel", "n t", "nse", "ort", "per", "reg", "sje", "t p", "t v", " hv", " nå", " va", "ann", "ato", "e a", "est", "ise", "isk", "oil", "ord", "pol", "ra ", "rak", "sse", "toi", " gr", "ak ", "eg ", "ele", "g a", "ige", "igh", "m e", "n f", "n v", "ndr", "nsk", "rer", "t m", "und", "var", "år ", " he", " no", " ny", "end", "ete", "fly", "g i", "ghe", "ier", "ind", "int", "lin", "n d", "n p", "rne", "sak", "sie", "t b", "tid", " al", " pa", " tr", "ag ", "dig", "e d", "e k", "ess", "hol", "i d", "lag", "led", "n e", "n i", "n o", "pri", "r b", "st ", " fe", " li", " ry", "air", "ake", "d s", "eas", "egi");
+$GLOBALS["ngrams"]['ne'] = array("को ", "का ", "मा ", "हरु", " ने", "नेप", "पाल", "ेपा", " सम", "ले ", " प्", "प्र", "कार", "ा स", "एको", " भए", " छ ", " भा", "्रम", " गर", "रुक", " र ", "भार", "ारत", " का", " वि", "भएक", "ाली", "ली ", "ा प", "ीहर", "ार्", "ो छ", "ना ", "रु ", "ालक", "्या", " बा", "एका", "ने ", "न्त", "ा ब", "ाको", "ार ", "ा भ", "ाहर", "्रो", "क्ष", "न् ", "ारी", " नि", "ा न", "ी स", " डु", "क्र", "जना", "यो ", "ा छ", "ेवा", "्ता", " रा", "त्य", "न्द", "हुन", "ा क", "ामा", "ी न", "्दा", " से", "छन्", "म्ब", "रोत", "सेव", "स्त", "स्र", "ेका", "्त ", " बी", " हु", "क्त", "त्र", "रत ", "र्न", "र्य", "ा र", "ाका", "ुको", " एक", " सं", " सु", "बीब", "बीस", "लको", "स्य", "ीबी", "ीसी", "ेको", "ो स", "्यक", " छन", " जन", " बि", " मु", " स्", "गर्", "ताह", "न्ध", "बार", "मन्", "मस्", "रुल", "लाई", "ा व", "ाई ", "ाल ", "िका", " त्", " मा", " यस", " रु", "ताक", "बन्", "र ब", "रण ", "रुप", "रेक", "ष्ट", "सम्", "सी ", "ाएक", "ुका", "ुक्", " अध", " अन", " तथ", " थि", " दे", " पर", " बै", "तथा", "ता ", "दा ", "द्द", "नी ", "बाट", "यक्", "री ", "रीह", "र्म", "लका", "समस", "ा अ", "ा ए", "ाट ", "िय ", "ो प", "ो म", "्न ", "्ने", "्षा", " पा", " यो", " हा", "अधि", "डुव", "त भ", "त स", "था ", "धिक", "पमा", "बैठ", "मुद", "या ", "युक", "र न", "रति", "वान", "सार", "ा आ", "ा ज", "ा ह", "ुद्", "ुपम", "ुले", "ुवा", "ैठक", "ो ब", "्तर", "्य ", "्यस", " क्", " मन", " रह", "चार", "तिय", "दै ", "निर", "नु ", "पर्", "रक्", "र्द", "समा", "सुर", "ाउन", "ान ", "ानम", "ारण", "ाले", "ि ब", "ियो", "ुन्", "ुरक", "्त्", "्बन", "्रा", "्ष ", " आर", " जल", " बे", " या", " सा", "आएक", "एक ", "कर्", "जलस", "णका", "त र", "द्र", "धान", "धि ", "नका", "नमा", "नि ", "ममा", "रम ", "रहे", "राज", "लस्", "ला ", "वार", "सका", "हिल", "हेक", "ा त", "ारे", "िन्", "िस्", "े स", "ो न", "ो र", "ोत ", "्धि", "्मी", "्रस", " दु", " पन", " बत", " बन", " भन", "ंयु", "आरम", "खि ", "ण्ड", "तका", "ताल", "दी ", "देख", "निय", "पनि", "प्त", "बता", "मी ", "म्भ", "र स", "रम्", "लमा", "विश", "षाक", "संय", "ा ड", "ा म", "ानक", "ालम", "ि भ", "ित ", "ी प", "ी र", "ु भ", "ुने", "े ग", "ेखि", "ेर ", "ो भ", "ो व", "ो ह", "्भ ", "्र ", " ता", " नम", " ना");
+$GLOBALS["ngrams"]['nl'] = array("en ", "de ", " de", "et ", "an ", " he", "er ", " va", "n d", "van", "een", "het", " ge", "oor", " ee", "der", " en", "ij ", "aar", "gen", "te ", "ver", " in", " me", "aan", "den", " we", "at ", "in ", " da", " te", "eer", "nde", "ter", "ste", "n v", " vo", " zi", "ing", "n h", "voo", "is ", " op", "tie", " aa", "ede", "erd", "ers", " be", "eme", "ten", "ken", "n e", " ni", " ve", "ent", "ijn", "jn ", "mee", "iet", "n w", "ng ", "nie", " is", "cht", "dat", "ere", "ie ", "ijk", "n b", "rde", "ar ", "e b", "e a", "met", "t d", "el ", "ond", "t h", " al", "e w", "op ", "ren", " di", " on", "al ", "and", "bij", "zij", " bi", " hi", " wi", "or ", "r d", "t v", " wa", "e h", "lle", "rt ", "ang", "hij", "men", "n a", "n z", "rs ", " om", "e o", "e v", "end", "est", "n t", "par", " pa", " pr", " ze", "e g", "e p", "n p", "ord", "oud", "raa", "sch", "t e", "ege", "ich", "ien", "aat", "ek ", "len", "n m", "nge", "nt ", "ove", "rd ", "wer", " ma", " mi", "daa", "e k", "lij", "mer", "n g", "n o", "om ", "sen", "t b", "wij", " ho", "e m", "ele", "gem", "heb", "pen", "ude", " bo", " ja", "die", "e e", "eli", "erk", "le ", "pro", "rij", " er", " za", "e d", "ens", "ind", "ke ", "n k", "nd ", "nen", "nte", "r h", "s d", "s e", "t z", " b ", " co", " ik", " ko", " ov", "eke", "hou", "ik ", "iti", "lan", "ns ", "t g", "t m", " do", " le", " zo", "ams", "e z", "g v", "it ", "je ", "ls ", "maa", "n i", "nke", "rke", "uit", " ha", " ka", " mo", " re", " st", " to", "age", "als", "ark", "art", "ben", "e r", "e s", "ert", "eze", "ht ", "ijd", "lem", "r v", "rte", "t p", "zeg", "zic", "aak", "aal", "ag ", "ale", "bbe", "ch ", "e t", "ebb", "erz", "ft ", "ge ", "led", "mst", "n n", "oek", "r i", "t o", "t w", "tel", "tte", "uur", "we ", "zit", " af", " li", " ui", "ak ", "all", "aut", "doo", "e i", "ene", "erg", "ete", "ges", "hee", "jaa", "jke", "kee", "kel", "kom", "lee", "moe", "n s", "ort", "rec", "s o", "s v", "teg", "tij", "ven", "waa", "wel", " an", " au", " bu", " gr", " pl", " ti", "'' ", "ade", "dag", "e l", "ech", "eel", "eft", "ger", "gt ", "ig ", "itt", "j d", "ppe", "rda");
+$GLOBALS["ngrams"]['nr'] = array("oku", "la ", "nga", "a n", " ng", "na ", "ama", "a i", "ko ", " uk", "ele", "lo ", "ela", "ang", "a u", "a k", "uku", "aba", " ku", "wa ", "enz", "lel", "ho ", "ni ", "ngo", "ath", "pha", "eth", "kha", "ana", "isa", "nge", " na", "o n", "tho", "e n", "the", "ha ", "esi", "nye", "kwe", "tjh", " kw", "ise", " um", "a a", " ne", "le ", "hla", "a e", "lan", "ben", "ndl", " no", "imi", "und", "ung", "thi", "nzi", "ye ", "isi", "uth", "o e", "ebe", "het", "kut", "and", "sa ", "elo", "fun", "eko", "seb", "ban", "ulu", "aka", "eli", "wen", "e i", " am", "eni", "ba ", "we ", "nel", " we", "kuf", "lwa", "i n", " is", "zi ", " lo", "kwa", "lok", "elw", "gok", "ona", "lek", "hi ", "li ", "gan", "bon", " ii", "ing", "ka ", "o i", "akh", "ane", "thu", "ula", "kel", "mth", " im", "ga ", " le", "nda", "fan", "nok", "i k", "end", "si ", "o w", "aph", "hat", "e u", "ala", "kub", "lun", "ikh", "o l", "ezi", "a l", "o u", "sis", "nam", "emi", " ab", "hul", "kus", " wo", "sek", "azi", "kho", "iin", "i u", "asi", "lol", "ini", "uph", "uhl", "khu", "no ", "o y", "ako", "a b", "i e", "o k", "i l", " be", "mal", " ye", "i i", "nde", "iph", "mel", "eke", "tha", "kun", "ngi", "e k", "eng", "o s", " yo", "so ", "ma ", "mkh", "jha", "isw", "lwe", " ez", "di ", "a w", "e a", "kul", "uny", "ume", "za ", "any", "ahl", "kuh", "een", " si", "ili", "itj", "zok", "ihl", " es", "ke ", "hlo", "hak", "phe", "lul", "dle", "luk", "da ", "eka", "amb", " se", "zis", "mbi", "hon", "dla", "aku", "jen", "zin", " ba", "ham", "i a", " bo", "o a", "ali", "use", "ile", "sik", "han", "wok", "okh", "hlu", "nya", "sit", "ani", "kuz", "o o", "ufa", "swa", "ind", "zak", "nis", "lis", "gab", "mi ", " em", " ko", "ano", " el", "hwa", "ufu", "a y", "wo ", " in", "lim", "tlo", "kat", "wak", "kan", "thw", "o z", "ith", "ndi", "yok", "yo ", "mit", "mis", "abo", "eku", "hab", "iny", "nan", "eze", "khe", "alo", "lu ", "man", "he ", "ezo", "kup", "ubu", " zo", "gam", "hel", "wan", "omb", "amk", "nza", "ola", "hum", "kuk", "du ", " la", "kom", "i y", "obu", "i b", "odu", "okw", "gap", " ka", "be ", " il", "alu", "atj", "e b");
+$GLOBALS["ngrams"]['nso'] = array("go ", " go", " le", " a ", "le ", " di", "a g", "ya ", "lo ", " ya", "a m", "ka ", " ka", "la ", " t ", "o y", "a t", "a k", "ba ", "et ", "wa ", " mo", " e ", "a b", " se", " ba", " ma", " bo", "e g", "t a", " o ", "a l", "o t", "na ", "o l", "a d", "elo", "di ", "a s", "o g", "o k", "ele", "o a", "ng ", "t e", "o b", "mo ", "e t", "e m", "ego", "eo ", "e l", "ngw", "se ", "e b", "kgo", "ela", " wa", " ga", "e k", "ago", "o m", " kg", "ga ", "dit", "olo", "t h", "e d", "o d", " ye", "ane", "lel", "we ", " tl", "thu", "ona", " th", "t w", "hut", "ana", "tla", "wan", "aba", "ola", " me", "gwa", "re ", "ong", "t o", "lao", "e s", "o s", "a y", "alo", "set", "a p", "i a", "eng", "a a", "o e", "tho", " ke", "gwe", " ha", "hlo", "edi", " la", "ao ", " ts", "aka", "hla", "ala", "swa", " we", " bj", "o o", "gor", "aga", "hab", "gob", "let", "ke ", "dik", "sa ", " i ", "oba", " hl", "the", "dir", "a n", "ith", "bja", "ye ", "no ", " sa", "mol", "lwa", "ti ", "man", "ole", "e e", "tse", "o w", "ore", "to ", "at ", "eth", "e y", "kan", "tsh", "gon", "net", "ano", "kar", "ge ", "ho ", "lok", " sw", " na", "i b", "dip", "i o", "oka", " ge", " om", "ko ", "emo", "pel", "nt ", "e a", "mel", "leg", "tlh", "me ", "ete", "phe", "a e", "o n", "o i", "wal", "oko", "nya", "bol", "odi", "weg", "te ", "e n", "ta ", "any", "yeo", "kga", "pol", "ang", "ri ", "it ", "uto", " mm", "iti", "are", "o f", "ha ", "gat", "oth", "ika", "o h", " it", "she", "ath", "ale", "iri", "pha", "ahl", " te", "ohl", "tha", " re", "bon", "lha", " ph", "din", " pe", "ro ", "mi ", "omi", "i t", " fa", "aro", "ase", "i l", "ne ", "lal", "ogo", "kol", " wo", "t i", "omo", " be", "mog", "mok", "len", "ile", "lwe", "ma ", "uta", "nse", "amo", "a o", " fe", "okg", "ja ", "pan", "nag", "ekg", "i i", "apa", "get", "lon", "ra ", "aem", " yo", "atl", "tlo", "kel", "tel", " kh", " po", "e o", "a w", "ent", "i e", "bo ", "gan", "het", "mal", "a f", "otl", "uti", "oga", "sen", "kwa", "mae", "eka", "mme", "kge", "jal", "a r", "ing", "lek", "sep", "lag", "ofe", "wag", "g y", "rol", "epe", "eko", "bok", "o p", "adi", "log");
+$GLOBALS["ngrams"]['pl'] = array("ie ", "nie", "em ", " ni", " po", " pr", "dzi", " na", "że ", "rze", "na ", "łem", "wie", " w ", " że", "go ", " by", "prz", "owa", "ię ", " do", " si", "owi", " pa", " za", "ch ", "ego", "ał ", "się", "ej ", "wał", "ym ", "ani", "ałe", "to ", " i ", " to", " te", "e p", " je", " z ", "czy", "był", "pan", "sta", "kie", " ja", "do ", " ch", " cz", " wi", "iał", "a p", "pow", " mi", "li ", "eni", "zie", " ta", " wa", "ło ", "ać ", "dy ", "ak ", "e w", " a ", " od", " st", "nia", "rzy", "ied", " kt", "odz", "cie", "cze", "ia ", "iel", "któ", "o p", "tór", "ści", " sp", " wy", "jak", "tak", "zy ", " mo", "ałę", "pro", "ski", "tem", "łęs", " tr", "e m", "jes", "my ", " ro", "edz", "eli", "iej", " rz", "a n", "ale", "an ", "e s", "est", "le ", "o s", "i p", "ki ", " co", "ada", "czn", "e t", "e z", "ent", "ny ", "pre", "rzą", "y s", " ko", " o ", "ach", "am ", "e n", "o t", "oli", "pod", "zia", " go", " ka", "by ", "ieg", "ier", "noś", "roz", "spo", "ych", "ząd", " mn", "acz", "adz", "bie", "cho", "mni", "o n", "ost", "pra", "ze ", "ła ", " so", "a m", "cza", "iem", "ić ", "obi", "ył ", "yło", " mu", " mó", "a t", "acj", "ci ", "e b", "ich", "kan", "mi ", "mie", "ośc", "row", "zen", "zyd", " al", " re", "a w", "den", "edy", "ił ", "ko ", "o w", "rac", "śmy", " ma", " ra", " sz", " ty", "e j", "isk", "ji ", "ka ", "m s", "no ", "o z", "rez", "wa ", "ów ", "łow", "ść ", " ob", "ech", "ecz", "ezy", "i w", "ja ", "kon", "mów", "ne ", "ni ", "now", "nym", "pol", "pot", "yde", " dl", " sy", "a s", "aki", "ali", "dla", "icz", "ku ", "ocz", "st ", "str", "szy", "trz", "wia", "y p", "za ", " wt", "chc", "esz", "iec", "im ", "la ", "o m", "sa ", "wać", "y n", "zac", "zec", " gd", "a z", "ard", "co ", "dar", "e r", "ien", "m n", "m w", "mia", "moż", "raw", "rdz", "tan", "ted", "teg", "wił", "wte", "y z", "zna", "zło", "a r", "awi", "bar", "cji", "czą", "dow", "eż ", "gdy", "iek", "je ", "o d", "tał", "wal", "wsz", "zed", "ówi", "ęsa", " ba", " lu", " wo", "aln", "arn", "ba ", "dzo", "e c", "hod", "igi", "lig", "m p", "myś", "o c", "oni", "rel", "sku", "ste", "y w", "yst", "z w");
+$GLOBALS["ngrams"]['ps'] = array(" د ", "اؤ ", " اؤ", "نو ", "ې د", "ره ", " په", "نه ", "چې ", " چې", "په ", "ه د", "ته ", "و ا", "ونو", "و د", " او", "انو", "ونه", "ه ک", " دا", "ه ا", "دې ", "ښې ", " کې", "ان ", "لو ", "هم ", "و م", "کښې", "ه م", "ى ا", " نو", " ته", " کښ", "رون", "کې ", "ده ", "له ", "به ", "رو ", " هم", "ه و", "وى ", "او ", "تون", "دا ", " کو", " کړ", "قام", " تر", "ران", "ه پ", "ې و", "ې پ", " به", " خو", "تو ", "د د", "د ا", "ه ت", "و پ", "يا ", " خپ", " دو", " را", " مش", " پر", "ارو", "رې ", "م د", "مشر", " شو", " ور", "ار ", "دى ", " اد", " دى", " مو", "د پ", "لي ", "و ک", " مق", " يو", "ؤ د", "خپل", "سره", "ه چ", "ور ", " تا", " دې", " رو", " سر", " مل", " کا", "ؤ ا", "اره", "برو", "مه ", "ه ب", "و ت", "پښت", " با", " دغ", " قب", " له", " وا", " پا", " پښ", "د م", "د ه", "لې ", "مات", "مو ", "ه ه", "وي ", "ې ب", "ې ک", " ده", " قا", "ال ", "اما", "د ن", "قبر", "ه ن", "پار", " اث", " بي", " لا", " لر", "اثا", "د خ", "دار", "ريخ", "شرا", "مقا", "نۍ ", "ه ر", "ه ل", "ولو", "يو ", "کوم", " دد", " لو", " مح", " مر", " وو", "اتو", "اري", "الو", "اند", "خان", "د ت", "سې ", "لى ", "نور", "و ل", "ي چ", "ړي ", "ښتو", "ې ل", " جو", " سي", "ام ", "بان", "تار", "تر ", "ثار", "خو ", "دو ", "ر ک", "ل د", "مون", "ندې", "و ن", "ول ", "وه ", "ى و", "ي د", "ې ا", "ې ت", "ې ي", " حک", " خب", " نه", " پو", "ا د", "تې ", "جوړ", "حکم", "حکو", "خبر", "دان", "ر د", "غه ", "قاف", "محک", "وال", "ومت", "ويل", "ى د", "ى م", "يره", "پر ", "کول", "ې ه", " تي", " خا", " وک", " يا", " ځا", "ؤ ق", "انۍ", "بى ", "غو ", "ه خ", "و ب", "ودا", "يدو", "ړې ", "کال", " بر", " قد", " مي", " وي", " کر", "ؤ م", "ات ", "ايي", "تى ", "تيا", "تير", "خوا", "دغو", "دم ", "ديم", "ر و", "قدي", "م خ", "مان", "مې ", "نيو", "نږ ", "ه ي", "و س", "و چ", "وان", "ورو", "ونږ", "پور", "ړه ", "ړو ", "ۍ د", "ې ن", " اه", " زي", " سو", " شي", " هر", " هغ", " ښا", "اتل", "اق ", "اني", "بري", "بې ", "ت ا", "د ب", "د س", "ر م", "رى ", "عرا", "لان", "مى ", "نى ", "و خ", "وئ ", "ورک", "ورې", "ون ", "وکړ", "ى چ", "يمه", "يې ", "ښتن", "که ", "کړي", "ې خ", "ے ش", " تح", " تو", " در", " دپ", " صو", " عر", " ول", " يؤ", " پۀ", " څو", "ا ا");
+$GLOBALS["ngrams"]['pt'] = array("de ", " de", "os ", "as ", "que", " co", "ão ", "o d", " qu", "ue ", " a ", "do ", "ent", " se", "a d", "s d", "e a", "es ", " pr", "ra ", "da ", " es", " pa", "to ", " o ", "em ", "con", "o p", " do", "est", "nte", "ção", " da", " re", "ma ", "par", " te", "ara", "ida", " e ", "ade", "is ", " um", " po", "a a", "a p", "dad", "no ", "te ", " no", "açã", "pro", "al ", "com", "e d", "s a", " as", "a c", "er ", "men", "s e", "ais", "nto", "res", "a s", "ado", "ist", "s p", "tem", "e c", "e s", "ia ", "o s", "o a", "o c", "e p", "sta", "ta ", "tra", "ura", " di", " pe", "ar ", "e e", "ser", "uma", "mos", "se ", " ca", "o e", " na", "a e", "des", "ont", "por", " in", " ma", "ect", "o q", "ria", "s c", "ste", "ver", "cia", "dos", "ica", "str", " ao", " em", "das", "e t", "ito", "iza", "pre", "tos", " nã", "ada", "não", "ess", "eve", "or ", "ran", "s n", "s t", "tur", " ac", " fa", "a r", "ens", "eri", "na ", "sso", " si", " é ", "bra", "esp", "mo ", "nos", "ro ", "um ", "a n", "ao ", "ico", "liz", "min", "o n", "ons", "pri", "ten", "tic", "ões", " tr", "a m", "aga", "e n", "ili", "ime", "m a", "nci", "nha", "nta", "spe", "tiv", "am ", "ano", "arc", "ass", "cer", "e o", "ece", "emo", "ga ", "o m", "rag", "so ", "são", " au", " os", " sa", "ali", "ca ", "ema", "emp", "ici", "ido", "inh", "iss", "l d", "la ", "lic", "m c", "mai", "onc", "pec", "ram", "s q", " ci", " en", " fo", "a o", "ame", "car", "co ", "der", "eir", "ho ", "io ", "om ", "ora", "r a", "sen", "ter", " br", " ex", "a u", "cul", "dev", "e u", "ha ", "mpr", "nce", "oca", "ove", "rio", "s o", "sa ", "sem", "tes", "uni", "ven", "zaç", "çõe", " ad", " al", " an", " mi", " mo", " ve", " à ", "a i", "a q", "ala", "amo", "bli", "cen", "col", "cos", "cto", "e m", "e v", "ede", "gás", "ias", "ita", "iva", "ndo", "o t", "ore", "r d", "ral", "rea", "s f", "sid", "tro", "vel", "vid", "ás ", " ap", " ar", " ce", " ou", " pú", " so", " vi", "a f", "act", "arr", "bil", "cam", "e f", "e i", "el ", "for", "lem", "lid", "lo ", "m d", "mar", "nde", "o o", "omo", "ort", "per", "púb", "r u", "rei", "rem", "ros", "rre", "ssi");
+$GLOBALS["ngrams"]['pt_BR'] = array("eq ", "ent", " en", "q e", "q i", "g e", "g i", "ng ", " id", "ida", "nte", "te ", " es", " in", "ade", "ag ", "dad", "de ", "ia ", "ing", " br", " sa", "est", "inq", "lin", "mo ", "nq ", "o a", "seq", " co", " li", " ni", " o ", "a a", "a c", "ado", "asi", "bra", "dor", "iq ", "nta", "o b", "or ", "q n", "ras", "sil", "str", "ta ", "tre", "us ", " a ", " ag", " an", " ca", " e ", " eq", " g ", " i ", " ir", " nc", " q ", " se", " ve", "ant", "ar ", "cia", "con", "e a", "eir", "el ", "ig ", "ili", "imo", "io ", "ir ", "nci", "o t", "ro ", "vel", " ap", " bo", " de", " fr", " tr", "a b", "a e", "a g", "a v", "apo", "as ", "bus", "ca ", "cet", "cin", "des", "e b", "e s", "eta", "fre", "i a", "ibu", "il ", "iro", "la ", "liq", "nib", "nti", "o c", "o q", "os ", "ra ", "re ", "req", "s a", "s s", "san", "sim", "tar", "to ", "ult", " ba", " ci", " el", " em", " fi", " gr", " gu", " ia", " mu", " pe", " po", " re", " ri", " si", " su", " te", " vi", "a o", "a s", "abe", "alc", "and", "ara", "arg", "ari", "ben", "boc", "car", "co ", "do ", "e f", "e g", "e l", "e o", "em ", "emo", "en ", "es ", "esp", "exe", "fic", "g n", "g s", "gra", "gua", "ias", "ica", "idi", "ila", "ile", "inh", "l b", "l e", "lei", "loq", "mos", "mul", "nad", "nio", "nt ", "nto", "o g", "o r", "oce", "ont", "oq ", "pos", "q v", "r b", "r e", "r i", "r s", "rad", "ran", "rem", "rg ", "ria", "rio", "s e", "s p", "sta", "sti", "tig", "til", "tra", "ua ", "ue ", "va ", "xeq", " ' ", " ab", " ad", " ae", " al", " am", " aq", " ar", " b ", " bi", " bl", " bu", " cc", " ch", " di", " et", " ex", " fa", " ic", " il", " im", " is", " it", " ll", " m ", " me", " na", " ne", " ng", " nu", " ob", " ou", " pi", " qu", " ss", " st", " ti", " ub", " un", " v ", " x ", "' c", "a d", "a f", "a i", "a n", "a p", "a t", "abr", "aci", "ad ", "ada", "adr", "aer", "afe", "alv", "amb", "amp", "an ", "ana", "ang", "anh", "ani", "ano", "anq", "apa", "aq ", "ati", "ato", "azi", "b n", "ban", "bar", "big", "bil", "biq", "bli", "blu", "bon", "bre", "bri", "bse", "buc", "c f", "c i", "cad", "caf", "cag", "cal", "can", "cc ");
+$GLOBALS["ngrams"]['pt_PT'] = array("equ", "ent", "que", "qui", "gui", "uen", " li", "ngu", "qu ", "uid", " co", " ve", "de ", "gue", "ida", "nte", "o a", "a a", "ade", "dad", "el ", "ing", "mo ", "nqu", "nta", "seq", "u n", "vel", " de", " o ", " se", "a c", "ado", "ar ", "est", "ia ", "inq", "io ", "iqu", "lin", "o c", "o p", "ort", "por", "ta ", "te ", " ag", " eq", " nc", " pi", " po", " sa", "a d", "a e", "ant", "as ", "ca ", "cia", "des", "do ", "gu ", "imo", "l p", "nci", "ro ", "rtu", "str", "tug", "u s", "ues", "ui ", " a ", " an", " ap", " ba", " bi", " ca", " fr", " gu", " in", " pe", " qu", "agu", "apa", "con", "dor", "e f", "e g", "eir", "fre", "ho ", "i a", "ica", "igu", "iro", "liq", "nti", "o b", "o l", "o s", "or ", "r o", "ra ", "req", "s c", "sim", "tar", "to ", "ue ", "uin", "ult", " ci", " en", " ho", " mu", " ni", " re", " s ", " si", " su", "a s", "a v", "abe", "ag ", "al ", "and", "anh", "apo", "ata", "ban", "ben", "bic", "boi", "cap", "car", "cin", "co ", "com", "cto", "dei", "e b", "e o", "e s", "eca", "en ", "er ", "es ", "exe", "fic", "for", "gal", "gra", "ias", "ich", "ico", "idi", "ili", "ir ", "ira", "isb", "la ", "lis", "mbo", "mul", "na ", "nho", "nio", "nt ", "o q", "o r", "o t", "oc ", "oio", "omb", "oo ", "os ", "par", "pe ", "r b", "r e", "r s", "ran", "re ", "rec", "s a", "s s", "san", "sbo", "so ", "sta", "tan", "tra", "tre", "u v", "uga", "ugu", "xeq", " ab", " ad", " al", " am", " aq", " ar", " au", " b ", " bo", " c ", " ch", " ct", " cu", " el", " es", " ex", " fa", " fi", " ga", " gr", " id", " ir", " ne", " ng", " nu", " ob", " oo", " pa", " ps", " pt", " r ", " ra", " ri", " ss", " st", " ta", " te", " tr", " ub", " un", " vi", " vo", "a f", "a i", "a l", "a m", "a o", "a r", "ach", "aci", "act", "ad ", "afa", "age", "agr", "alf", "alh", "am ", "amb", "ami", "ana", "ang", "anq", "aqu", "ara", "arb", "arc", "arg", "ari", "arr", "asa", "ati", "aut", "azi", "b n", "bar", "bat", "ber", "big", "bil", "biq", "bli", "boa", "boe", "bor", "bse", "c i", "c l", "c p", "cad", "cam", "cas", "ch ", "cha", "che", "chi", "cio", "coc", "coi", "cou", "ctr", "cue", "cul");
+$GLOBALS["ngrams"]['ro'] = array(" de", " în", "de ", " a ", "ul ", " co", "în ", "re ", "e d", "ea ", " di", " pr", "le ", "şi ", "are", "at ", "con", "ui ", " şi", "i d", "ii ", " cu", "e a", "lui", "ern", "te ", "cu ", " la", "a c", "că ", "din", "e c", "or ", "ulu", "ne ", "ter", "la ", "să ", "tat", "tre", " ac", " să", "est", "st ", "tă ", " ca", " ma", " pe", "cur", "ist", "mân", "a d", "i c", "nat", " ce", "i a", "ia ", "in ", "scu", " mi", "ato", "aţi", "ie ", " re", " se", "a a", "int", "ntr", "tru", "uri", "ă a", " fo", " pa", "ate", "ini", "tul", "ent", "min", "pre", "pro", "a p", "e p", "e s", "ei ", "nă ", "par", "rna", "rul", "tor", " in", " ro", " tr", " un", "al ", "ale", "art", "ce ", "e e", "e î", "fos", "ita", "nte", "omâ", "ost", "rom", "ru ", "str", "ver", " ex", " na", "a f", "lor", "nis", "rea", "rit", " al", " eu", " no", "ace", "cer", "ile", "nal", "pri", "ri ", "sta", "ste", "ţie", " au", " da", " ju", " po", "ar ", "au ", "ele", "ere", "eri", "ina", "n a", "n c", "res", "se ", "t a", "tea", " că", " do", " fi", "a s", "ată", "com", "e ş", "eur", "guv", "i s", "ice", "ili", "na ", "rec", "rep", "ril", "rne", "rti", "uro", "uve", "ă p", " ar", " o ", " su", " vi", "dec", "dre", "oar", "ons", "pe ", "rii", " ad", " ge", "a m", "a r", "ain", "ali", "car", "cat", "ecu", "ene", "ept", "ext", "ilo", "iu ", "n p", "ori", "sec", "u p", "une", "ă c", "şti", "ţia", " ch", " gu", "ai ", "ani", "cea", "e f", "isc", "l a", "lic", "liu", "mar", "nic", "nt ", "nul", "ris", "t c", "t p", "tic", "tid", "u a", "ucr", " as", " dr", " fa", " nu", " pu", " to", "cra", "dis", "enţ", "esc", "gen", "it ", "ivi", "l d", "n d", "nd ", "nu ", "ond", "pen", "ral", "riv", "rte", "sti", "t d", "ta ", "to ", "uni", "xte", "ând", "îns", "ă s", " bl", " st", " uc", "a b", "a i", "a l", "air", "ast", "bla", "bri", "che", "duc", "dul", "e m", "eas", "edi", "esp", "i l", "i p", "ica", "ică", "ir ", "iun", "jud", "lai", "lul", "mai", "men", "ni ", "pus", "put", "ra ", "rai", "rop", "sil", "ti ", "tra", "u s", "ua ", "ude", "urs", "ân ", "înt", "ţă ", " lu", " mo", " s ", " sa", " sc", "a u", "an ", "atu");
+$GLOBALS["ngrams"]['ru'] = array(" на", " пр", "то ", " не", "ли ", " по", "но ", " в ", "на ", "ть ", "не ", " и ", " ко", "ом ", "про", " то", "их ", " ка", "ать", "ото", " за", "ие ", "ова", "тел", "тор", " де", "ой ", "сти", " от", "ах ", "ми ", "стр", " бе", " во", " ра", "ая ", "ват", "ей ", "ет ", "же ", "иче", "ия ", "ов ", "сто", " об", "вер", "го ", "и в", "и п", "и с", "ии ", "ист", "о в", "ост", "тра", " те", "ели", "ере", "кот", "льн", "ник", "нти", "о с", "рор", "ств", "чес", " бо", " ве", " да", " ин", " но", " с ", " со", " сп", " ст", " чт", "али", "ами", "вид", "дет", "е н", "ель", "еск", "ест", "зал", "и н", "ива", "кон", "ого", "одн", "ожн", "оль", "ори", "ров", "ско", "ся ", "тер", "что", " мо", " са", " эт", "ант", "все", "ерр", "есл", "иде", "ина", "ино", "иро", "ите", "ка ", "ко ", "кол", "ком", "ла ", "ния", "о т", "оло", "ран", "ред", "сь ", "тив", "тич", "ых ", " ви", " вс", " го", " ма", " сл", "ако", "ани", "аст", "без", "дел", "е д", "е п", "ем ", "жно", "и д", "ика", "каз", "как", "ки ", "нос", "о н", "опа", "при", "рро", "ски", "ти ", "тов", "ые ", " вы", " до", " ме", " ни", " од", " ро", " св", " чи", "а н", "ает", "аза", "ате", "бес", "в п", "ва ", "е в", "е м", "е с", "ез ", "ени", "за ", "зна", "ини", "кам", "ках", "кто", "лов", "мер", "мож", "нал", "ниц", "ны ", "ным", "ора", "оро", "от ", "пор", "рав", "рес", "рис", "рос", "ска", "т н", "том", "чит", "шко", " бы", " о ", " тр", " уж", " чу", " шк", "а б", "а в", "а р", "аби", "ала", "ало", "аль", "анн", "ати", "бин", "вес", "вно", "во ", "вши", "дал", "дат", "дно", "е з", "его", "еле", "енн", "ент", "ете", "и о", "или", "ись", "ит ", "ици", "ков", "лен", "льк", "мен", "мы ", "нет", "ни ", "нны", "ног", "ной", "ном", "о п", "обн", "ове", "овн", "оры", "пер", "по ", "пра", "пре", "раз", "роп", "ры ", "се ", "сли", "сов", "тре", "тся", "уро", "цел", "чно", "ь в", "ько", "ьно", "это", "ют ", "я н", " ан", " ес", " же", " из", " кт", " ми", " мы", " пе", " се", " це", "а м", "а п", "а т", "авш", "аже", "ак ", "ал ", "але", "ане", "ачи", "ают", "бна", "бол", "бы ", "в и", "в с", "ван", "гра", "даж", "ден", "е к");
+$GLOBALS["ngrams"]['sk'] = array(" pr", " po", " ne", " a ", "ch ", " na", " je", "ní ", "je ", " do", "na ", "ova", " v ", "to ", "ho ", "ou ", " to", "ick", "ter", "že ", " st", " za", "ost", "ých", " se", "pro", " te", "e s", " že", "a p", " kt", "pre", " by", " o ", "se ", "kon", " př", "a s", "né ", "ně ", "sti", "ako", "ist", "mu ", "ame", "ent", "ky ", "la ", "pod", " ve", " ob", "om ", "vat", " ko", "sta", "em ", "le ", "a v", "by ", "e p", "ko ", "eri", "kte", "sa ", "ého", "e v", "mer", "tel", " ak", " sv", " zá", "hla", "las", "lo ", " ta", "a n", "ej ", "li ", "ne ", " sa", "ak ", "ani", "ate", "ia ", "sou", " so", "ení", "ie ", " re", "ce ", "e n", "ori", "tic", " vy", "a t", "ké ", "nos", "o s", "str", "ti ", "uje", " sp", "lov", "o p", "oli", "ová", " ná", "ale", "den", "e o", "ku ", "val", " am", " ro", " si", "nie", "pol", "tra", " al", "ali", "o v", "tor", " mo", " ni", "ci ", "o n", "ím ", " le", " pa", " s ", "al ", "ati", "ero", "ove", "rov", "ván", "ích", " ja", " z ", "cké", "e z", " od", "byl", "de ", "dob", "nep", "pra", "ric", "spo", "tak", " vš", "a a", "e t", "lit", "me ", "nej", "no ", "nýc", "o t", "a j", "e a", "en ", "est", "jí ", "mi ", "slo", "stá", "u v", "for", "nou", "pos", "pře", "si ", "tom", " vl", "a z", "ly ", "orm", "ris", "za ", "zák", " k ", "at ", "cký", "dno", "dos", "dy ", "jak", "kov", "ny ", "res", "ror", "sto", "van", " op", "da ", "do ", "e j", "hod", "len", "ný ", "o z", "poz", "pri", "ran", "u s", " ab", "aj ", "ast", "it ", "kto", "o o", "oby", "odo", "u p", "va ", "ání", "í p", "ým ", " in", " mi", "ať ", "dov", "ka ", "nsk", "áln", " an", " bu", " sl", " tr", "e m", "ech", "edn", "i n", "kýc", "níc", "ov ", "pří", "í a", " aj", " bo", "a d", "ide", "o a", "o d", "och", "pov", "svo", "é s", " kd", " vo", " vý", "bud", "ich", "il ", "ili", "ni ", "ním", "od ", "osl", "ouh", "rav", "roz", "st ", "stv", "tu ", "u a", "vál", "y s", "í s", "í v", " hl", " li", " me", "a m", "e b", "h s", "i p", "i s", "iti", "lád", "nem", "nov", "opo", "uhl", "eno", "ens", "men", "nes", "obo", "te ", "ved", "vlá", "y n", " ma", " mu", " vá", "bez", "byv", "cho");
+$GLOBALS["ngrams"]['sl'] = array("je ", " pr", " po", " je", " v ", " za", " na", "pre", "da ", " da", "ki ", "ti ", "ja ", "ne ", " in", "in ", "li ", "no ", "na ", "ni ", " bi", "jo ", " ne", "nje", "e p", "i p", "pri", "o p", "red", " do", "anj", "em ", "ih ", " bo", " ki", " iz", " se", " so", "al ", " de", "e v", "i s", "ko ", "bil", "ira", "ove", " br", " ob", "e b", "i n", "ova", "se ", "za ", "la ", " ja", "ati", "so ", "ter", " ta", "a s", "del", "e d", " dr", " od", "a n", "ar ", "jal", "ji ", "rit", " ka", " ko", " pa", "a b", "ani", "e s", "er ", "ili", "lov", "o v", "tov", " ir", " ni", " vo", "a j", "bi ", "bri", "iti", "let", "o n", "tan", "še ", " le", " te", "eni", "eri", "ita", "kat", "por", "pro", "ali", "ke ", "oli", "ov ", "pra", "ri ", "uar", "ve ", " to", "a i", "a v", "ako", "arj", "ate", "di ", "do ", "ga ", "le ", "lo ", "mer", "o s", "oda", "oro", "pod", " ma", " mo", " si", "a p", "bod", "e n", "ega", "ju ", "ka ", "lje", "rav", "ta ", "a o", "e t", "e z", "i d", "i v", "ila", "lit", "nih", "odo", "sti", "to ", "var", "ved", "vol", " la", " no", " vs", "a d", "agu", "aja", "dej", "dnj", "eda", "gov", "gua", "jag", "jem", "kon", "ku ", "nij", "omo", "oči", "pov", "rak", "rja", "sta", "tev", "a t", "aj ", "ed ", "eja", "ent", "ev ", "i i", "i o", "ijo", "ist", "ost", "ske", "str", " ra", " s ", " tr", " še", "arn", "bo ", "drž", "i j", "ilo", "izv", "jen", "lja", "nsk", "o d", "o i", "om ", "ora", "ovo", "raz", "rža", "tak", "va ", "ven", "žav", " me", " če", "ame", "avi", "e i", "e o", "eka", "gre", "i t", "ija", "il ", "ite", "kra", "lju", "mor", "nik", "o t", "obi", "odn", "ran", "re ", "sto", "stv", "udi", "v i", "van", " am", " sp", " st", " tu", " ve", " že", "ajo", "ale", "apo", "dal", "dru", "e j", "edn", "ejo", "elo", "est", "etj", "eva", "iji", "ik ", "im ", "itv", "mob", "nap", "nek", "pol", "pos", "rat", "ski", "tič", "tom", "ton", "tra", "tud", "tve", "v b", "vil", "vse", "čit", " av", " gr", "a z", "ans", "ast", "avt", "dan", "e m", "eds", "for", "i z", "kot", "mi ", "nim", "o b", "o o", "od ", "odl", "oiz", "ot ", "par", "pot", "rje", "roi", "tem", "val");
+$GLOBALS["ngrams"]['so'] = array("ka ", "ay ", "da ", " ay", "aal", "oo ", "aan", " ka", "an ", "in ", " in", "ada", "maa", "aba", " so", "ali", "bad", "add", "soo", " na", "aha", "ku ", "ta ", " wa", "yo ", "a s", "oma", "yaa", " ba", " ku", " la", " oo", "iya", "sha", "a a", "dda", "nab", "nta", " da", " ma", "nka", "uu ", "y i", "aya", "ha ", "raa", " dh", " qa", "a k", "ala", "baa", "doo", "had", "liy", "oom", " ha", " sh", "a d", "a i", "a n", "aar", "ee ", "ey ", "y k", "ya ", " ee", " iy", "aa ", "aaq", "gaa", "lam", " bu", "a b", "a m", "ad ", "aga", "ama", "iyo", "la ", "a c", "a l", "een", "int", "she", "wax", "yee", " si", " uu", "a h", "aas", "alk", "dha", "gu ", "hee", "ii ", "ira", "mad", "o a", "o k", "qay", " ah", " ca", " wu", "ank", "ash", "axa", "eed", "en ", "ga ", "haa", "n a", "n s", "naa", "nay", "o d", "taa", "u b", "uxu", "wux", "xuu", " ci", " do", " ho", " ta", "a g", "a u", "ana", "ayo", "dhi", "iin", "lag", "lin", "lka", "o i", "san", "u s", "una", "uun", " ga", " xa", " xu", "aab", "abt", "aq ", "aqa", "ara", "arl", "caa", "cir", "eeg", "eel", "isa", "kal", "lah", "ney", "qaa", "rla", "sad", "sii", "u d", "wad", " ad", " ar", " di", " jo", " ra", " sa", " u ", " yi", "a j", "a q", "aad", "aat", "aay", "ah ", "ale", "amk", "ari", "as ", "aye", "bus", "dal", "ddu", "dii", "du ", "duu", "ed ", "ege", "gey", "hay", "hii", "ida", "ine", "joo", "laa", "lay", "mar", "mee", "n b", "n d", "n m", "no ", "o b", "o l", "oog", "oon", "rga", "sh ", "sid", "u q", "unk", "ush", "xa ", "y d", " bi", " gu", " is", " ke", " lo", " me", " mu", " qo", " ug", "a e", "a o", "a w", "adi", "ado", "agu", "al ", "ant", "ark", "asa", "awi", "bta", "bul", "d a", "dag", "dan", "do ", "e s", "gal", "gay", "guu", "h e", "hal", "iga", "ihi", "iri", "iye", "ken", "lad", "lid", "lsh", "mag", "mun", "n h", "n i", "na ", "o n", "o w", "ood", "oor", "ora", "qab", "qor", "rab", "rit", "rta", "s o", "sab", "ska", "to ", "u a", "u h", "u u", "ud ", "ugu", "uls", "uud", "waa", "xus", "y b", "y q", "y s", "yad", "yay", "yih", " aa", " bo", " br", " go", " ji", " mi", " of", " ti", " um", " wi", " xo", "a x");
+$GLOBALS["ngrams"]['sq'] = array("të ", " të", "në ", "për", " pë", " e ", "sht", " në", " sh", "se ", "et ", "ë s", "ë t", " se", "he ", "jë ", "ër ", "dhe", " pa", "ë n", "ë p", " që", " dh", "një", "ë m", " nj", "ësh", "in ", " me", "që ", " po", "e n", "e t", "ish", "më ", "së ", "me ", "htë", " ka", " si", "e k", "e p", " i ", "anë", "ar ", " nu", "und", "ve ", " ës", "e s", " më", "nuk", "par", "uar", "uk ", "jo ", "rë ", "ta ", "ë f", "en ", "it ", "min", "het", "n e", "ri ", "shq", "ë d", " do", " nd", "sh ", "ën ", "atë", "hqi", "ist", "ë q", " gj", " ng", " th", "a n", "do ", "end", "imi", "ndi", "r t", "rat", "ë b", "ëri", " mu", "art", "ash", "qip", " ko", "e m", "edh", "eri", "je ", "ka ", "nga", "si ", "te ", "ë k", "ësi", " ma", " ti", "eve", "hje", "ira", "mun", "on ", "po ", "re ", " pr", "im ", "lit", "o t", "ur ", "ë e", "ë v", "ët ", " ku", " së", "e d", "es ", "ga ", "iti", "jet", "ndë", "oli", "shi", "tje", " bë", " z ", "gje", "kan", "shk", "ënd", "ës ", " de", " kj", " ru", " vi", "ara", "gov", "kjo", "or ", "r p", "rto", "rug", "tet", "ugo", "ali", "arr", "at ", "d t", "ht ", "i p", "ipë", "izi", "jnë", "n n", "ohe", "shu", "shë", "t e", "tik", "a e", "arë", "etë", "hum", "nd ", "ndr", "osh", "ova", "rim", "tos", "va ", " fa", " fi", "a s", "hen", "i n", "mar", "ndo", "por", "ris", "sa ", "sis", "tës", "umë", "viz", "zit", " di", " mb", "aj ", "ana", "ata", "dër", "e a", "esh", "ime", "jes", "lar", "n s", "nte", "pol", "r n", "ran", "res", "rrë", "tar", "ë a", "ë i", " at", " jo", " kë", " re", "a k", "ai ", "akt", "hë ", "hën", "i i", "i m", "ia ", "men", "nis", "shm", "str", "t k", "t n", "t s", "ë g", "ërk", "ëve", " ai", " ci", " ed", " ja", " kr", " qe", " ta", " ve", "a p", "cil", "el ", "erë", "gji", "hte", "i t", "jen", "jit", "k d", "mën", "n t", "nyr", "ori", "pas", "ra ", "rie", "rës", "tor", "uaj", "yre", "ëm ", "ëny", " ar", " du", " ga", " je", "dës", "e e", "e z", "ha ", "hme", "ika", "ini", "ite", "ith", "koh", "kra", "ku ", "lim", "lis", "qën", "rën", "s s", "t d", "t t", "tir", "tën", "ver", "ë j", " ba", " in", " tr", " zg", "a a", "a m", "a t", "abr");
+$GLOBALS["ngrams"]['sr'] = array(" на", " је", " по", "је ", " и ", " не", " пр", "га ", " св", "ог ", "а с", "их ", "на ", "кој", "ога", " у ", "а п", "не ", "ни ", "ти ", " да", "ом ", " ве", " ср", "и с", "ско", " об", "а н", "да ", "е н", "но ", "ног", "о ј", "ој ", " за", "ва ", "е с", "и п", "ма ", "ник", "обр", "ова", " ко", "а и", "диј", "е п", "ка ", "ко ", "ког", "ост", "све", "ств", "сти", "тра", "еди", "има", "пок", "пра", "раз", "те ", " бо", " ви", " са", "аво", "бра", "гос", "е и", "ели", "ени", "за ", "ики", "ио ", "пре", "рав", "рад", "у с", "ју ", "ња ", " би", " до", " ст", "аст", "бој", "ебо", "и н", "им ", "ку ", "лан", "неб", "ово", "ого", "осл", "ојш", "пед", "стр", "час", " го", " кр", " мо", " чл", "а м", "а о", "ако", "ача", "вел", "вет", "вог", "еда", "ист", "ити", "ије", "око", "сло", "срб", "чла", " бе", " ос", " от", " ре", " се", "а в", "ан ", "бог", "бро", "вен", "гра", "е о", "ика", "ија", "ких", "ком", "ли ", "ну ", "ота", "ојн", "под", "рбс", "ред", "рој", "са ", "сни", "тач", "тва", "ја ", "ји ", " ка", " ов", " тр", "а ј", "ави", "аз ", "ано", "био", "вик", "во ", "гов", "дни", "е ч", "его", "и о", "ива", "иво", "ик ", "ине", "ини", "ипе", "кип", "лик", "ло ", "наш", "нос", "о т", "од ", "оди", "она", "оји", "поч", "про", "ра ", "рис", "род", "рст", "се ", "спо", "ста", "тић", "у д", "у н", "у о", "чин", "ша ", "јед", "јни", "ће ", " м ", " ме", " ни", " он", " па", " сл", " те", "а у", "ава", "аве", "авн", "ана", "ао ", "ати", "аци", "ају", "ања", "бск", "вор", "вос", "вск", "дин", "е у", "едн", "ези", "ека", "ено", "ето", "ења", "жив", "и г", "и и", "и к", "и т", "ику", "ичк", "ки ", "крс", "ла ", "лав", "лит", "ме ", "мен", "нац", "о н", "о п", "о у", "одн", "оли", "орн", "осн", "осп", "оче", "пск", "реч", "рпс", "сво", "ски", "сла", "срп", "су ", "та ", "тав", "тве", "у б", "јез", "ћи ", " ен", " жи", " им", " му", " од", " су", " та", " хр", " ча", " шт", " ње", "а д", "а з", "а к", "а т", "аду", "ало", "ани", "асо", "ван", "вач", "вањ", "вед", "ви ", "вно", "вот", "вој", "ву ", "доб", "дру", "дсе", "ду ", "е б", "е д", "е м", "ем ", "ема", "ент", "енц");
+$GLOBALS["ngrams"]['ss'] = array(" ku", " le", "la ", "eku", "a k", "nga", " ng", "a n", "nge", "a l", "lo ", " ne", "eti", "kwe", "ndz", "e n", "o l", " lo", "ela", "ema", "ent", "si ", " kw", "tsi", "i l", "wa ", "lel", "kut", "e k", "und", "ni ", "elo", "fun", "esi", " si", "ele", "tin", "tfo", " ti", "le ", "kha", "tse", "e l", "pha", "ung", "i k", " em", "ti ", "sa ", " um", "isa", "eli", "ndl", "ing", "set", "we ", "ise", "na ", "ang", "etf", "khe", "and", "o n", " we", "nti", "nye", "tfu", "ben", "a e", "uts", "let", "dza", "imi", "sek", "ko ", "lok", "eni", "ye ", "ba ", "nkh", "ebe", "alo", "o k", "lan", "ga ", "aba", "seb", " ye", "he ", "lwa", "kel", " te", " la", "kus", "wem", "ati", "ikh", "nek", "ala", "kuf", "i n", "oku", "ats", "mts", "hla", "wen", "a t", " na", "gek", "uhl", "kub", "ngu", "ka ", "aka", "fut", "kan", "kwa", " li", "kuc", "onk", "ban", "ana", "ulu", " se", " im", "akh", "ume", "a i", "les", "tim", "ula", "ini", "lwe", "za ", "fo ", "hul", " no", "han", "li ", "iph", "a s", "tis", "khu", "ta ", "dzi", "be ", "emi", "ma ", "end", "o t", "eke", "a u", " ka", "ane", "lek", "mel", "elw", "kun", "sis", "lon", "utf", "any", "kho", "kul", "hlo", " ba", "ufu", "aph", "lun", "e s", "hal", "ind", "isw", "o s", "use", "ekw", "me ", "ndv", "eng", "uph", "hat", "ne ", "so ", "lul", "nom", "te ", "lol", "awu", "nel", "lu ", "ha ", "wat", "men", "ete", " lw", "nem", "ako", "zin", "kuh", "sha", "bha", "gab", " in", "ale", "mis", "tem", "e e", "o e", "e t", "wek", "dze", "ome", "wel", " lu", "emb", "nis", " ek", "tsa", "u l", "o y", "dle", "ute", "len", "swa", "phe", "mkh", "ntf", "uke", "sit", "iny", "e i", "wo ", "ani", "phi", "wet", "sin", "nhl", "mal", "mba", "mfu", "fu ", "lab", "sik", "taw", "no ", "hle", "e u", "eki", "ase", "ali", "ulw", "ve ", "eka", "zel", "nta", "bon", "tek", "bo ", "sig", "ama", "ile", "ule", "tfw", "mph", "uma", "kup", "emt", "asi", "dlu", "ish", "umt", "gen", "o w", "ike", "iga", "hak", "abe", "net", "gan", "kis", "nde", "ngi", "ukh", "bek", "mo ", "phu", "sel", "elu", "i t", "ant", "dvo", "a y", "vo ", "hum", "lis", "dla", "gam", "ive", "jen", "ket");
+$GLOBALS["ngrams"]['st'] = array("ng ", "ho ", " le", "le ", " ho", " ts", "a m", "sa ", "la ", " ka", "a h", " di", "ya ", "ka ", " ya", "a t", "eng", "ets", " ba", " mo", "a l", " se", "lo ", " bo", "wa ", "tsa", "a b", "na ", "ba ", " e ", " a ", "a k", " ma", "ang", "tse", "se ", "o t", "a d", "a s", "ha ", "so ", "o l", "e h", "o y", "e t", "tla", "tsh", "olo", "e l", "e m", "o b", "o e", "seb", "ebe", "ela", "thu", "ele", "e k", "ana", "e b", " th", " ha", "tso", "o a", "o k", " wa", "kgo", "tsw", "tho", "o h", "ong", " la", "hut", "dit", "ane", " me", "a e", " tl", "ola", "edi", "elo", "di ", "ona", " ke", "wan", " o ", "a p", "apa", "tjh", "hlo", " sa", "she", "let", "aba", "lok", "lao", "eo ", "a a", "o s", "man", "to ", " hl", "a n", "isa", "e d", "swe", "set", "pa ", " na", "o m", "g l", "het", " kg", "got", "aha", "eth", "re ", "e e", "jha", "phe", "lan", "otl", "g k", "lek", "its", "ekg", "sen", "ao ", "dis", "g m", "oth", "e a", "ith", "hla", "e s", "ke ", "mol", "pel", "g h", "hab", "bet", "san", "ats", "mo ", "lwa", "we ", "ala", "len", "nts", "dip", "kap", "iso", " mm", "uto", "alo", "e n", "si ", "ta ", "o w", "emo", "swa", "tsi", "oke", "bed", "the", " ph", "a y", "wen", "ken", "ena", "hwa", "ne ", "ore", "atl", "ano", "hel", "mot", "bo ", "g t", "i b", "kga", "hor", "ngo", "nan", "no ", "o n", "tlh", "shw", "kel", "pha", "etj", "bon", "ell", "g s", "gol", "tha", "ale", "dik", "kol", "bak", " nt", "ika", "o d", " te", "ohl", "g y", " lo", "ti ", "his", "ile", "g b", "oko", " et", "han", "a o", "mat", "oho", "odi", "lel", "mel", "din", "kar", "o o", "uo ", "mon", "hah", "te ", "me ", " it", "o f", "nen", "heb", "ing", "bol", "bel", "hle", "puo", "lal", "tlo", "hal", "oph", "eba", "hat", "heo", "aro", "bat", "ko ", "ban", "leh", "o i", "ole", "tle", " fe", "kge", "pan", "ake", "g e", "aka", "eko", " pe", "rik", "e y", "mme", "ama", "lha", "eha", " fa", "ebo", "moh", "mae", "ete", "aem", "ots", "ahi", "o p", "uta", "okg", "ntl", "pal", "get", "i l", "e f", "oka", "sep", "lat", "ahl", "bot", "ese", "lah", "lon", "akg", "a f", " pu", "ase", "g a", "mor", "kan", "nah", "boh", "e p");
+$GLOBALS["ngrams"]['sv'] = array("en ", " de", "et ", "er ", "tt ", "om ", "för", "ar ", "de ", "att", " fö", "ing", " in", " at", " i ", "det", "ch ", "an ", "gen", " an", "t s", "som", "te ", " oc", "ter", " ha", "lle", "och", " sk", " so", "ra ", "r a", " me", "var", "nde", "är ", " ko", "on ", "ans", "int", "n s", "na ", " en", " fr", " på", " st", " va", "and", "nte", "på ", "ska", "ta ", " vi", "der", "äll", "örs", " om", "da ", "kri", "ka ", "nst", " ho", "as ", "stä", "r d", "t f", "upp", " be", "nge", "r s", "tal", "täl", "ör ", " av", "ger", "ill", "ng ", "e s", "ekt", "ade", "era", "ers", "har", "ll ", "lld", "rin", "rna", "säk", "und", "inn", "lig", "ns ", " ma", " pr", " up", "age", "av ", "iva", "kti", "lda", "orn", "son", "ts ", "tta", "äkr", " sj", " ti", "avt", "ber", "els", "eta", "kol", "men", "n d", "t k", "vta", "år ", "juk", "man", "n f", "nin", "r i", "rsä", "sju", "sso", " är", "a s", "ach", "ag ", "bac", "den", "ett", "fte", "hor", "nba", "oll", "rnb", "ste", "til", " ef", " si", "a a", "e h", "ed ", "eft", "ga ", "ig ", "it ", "ler", "med", "n i", "nd ", "så ", "tiv", " bl", " et", " fi", " sä", "at ", "des", "e a", "gar", "get", "lan", "lss", "ost", "r b", "r e", "re ", "ret", "sta", "t i", " ge", " he", " re", "a f", "all", "bos", "ets", "lek", "let", "ner", "nna", "nne", "r f", "rit", "s s", "sen", "sto", "tor", "vav", "ygg", " ka", " så", " tr", " ut", "ad ", "al ", "are", "e o", "gon", "kom", "n a", "n h", "nga", "r h", "ren", "t d", "tag", "tar", "tre", "ätt", " få", " hä", " se", "a d", "a i", "a p", "ale", "ann", "ara", "byg", "gt ", "han", "igt", "kan", "la ", "n o", "nom", "nsk", "omm", "r k", "r p", "r v", "s f", "s k", "t a", "t p", "ver", " bo", " br", " ku", " nå", "a b", "a e", "del", "ens", "es ", "fin", "ige", "m s", "n p", "någ", "or ", "r o", "rbe", "rs ", "rt ", "s a", "s n", "skr", "t o", "ten", "tio", "ven", " al", " ja", " p ", " r ", " sa", "a h", "bet", "cke", "dra", "e f", "e i", "eda", "eno", "erä", "ess", "ion", "jag", "m f", "ne ", "nns", "pro", "r t", "rar", "riv", "rät", "t e", "t t", "ust", "vad", "öre", " ar", " by", " kr", " mi", "arb");
+$GLOBALS["ngrams"]['sw'] = array(" wa", "wa ", "a k", "a m", " ku", " ya", "a w", "ya ", "ni ", " ma", "ka ", "a u", "na ", "za ", "ia ", " na", "ika", "ma ", "ali", "a n", " am", "ili", "kwa", " kw", "ini", " ha", "ame", "ana", "i n", " za", "a h", "ema", "i m", "i y", "kuw", "la ", "o w", "a y", "ata", "sem", " la", "ati", "chi", "i w", "uwa", "aki", "li ", "eka", "ira", " nc", "a s", "iki", "kat", "nch", " ka", " ki", "a b", "aji", "amb", "ra ", "ri ", "rik", "ada", "mat", "mba", "mes", "yo ", "zi ", "da ", "hi ", "i k", "ja ", "kut", "tek", "wan", " bi", "a a", "aka", "ao ", "asi", "cha", "ese", "eza", "ke ", "moj", "oja", " hi", "a z", "end", "ha ", "ji ", "mu ", "shi", "wat", " bw", "ake", "ara", "bw ", "i h", "imb", "tik", "wak", "wal", " hu", " mi", " mk", " ni", " ra", " um", "a l", "ate", "esh", "ina", "ish", "kim", "o k", " ir", "a i", "ala", "ani", "aq ", "azi", "hin", "i a", "idi", "ima", "ita", "rai", "raq", "sha", " ms", " se", "afr", "ama", "ano", "ea ", "ele", "fri", "go ", "i i", "ifa", "iwa", "iyo", "kus", "lia", "lio", "maj", "mku", "no ", "tan", "uli", "uta", "wen", " al", "a j", "aad", "aid", "ari", "awa", "ba ", "fa ", "nde", "nge", "nya", "o y", "u w", "ua ", "umo", "waz", "ye ", " ut", " vi", "a d", "a t", "aif", "di ", "ere", "ing", "kin", "nda", "o n", "oa ", "tai", "toa", "usa", "uto", "was", "yak", "zo ", " ji", " mw", "a p", "aia", "amu", "ang", "bik", "bo ", "del", "e w", "ene", "eng", "ich", "iri", "iti", "ito", "ki ", "kir", "ko ", "kuu", "mar", "mbo", "mil", "ngi", "ngo", "o l", "ong", "si ", "ta ", "tak", "u y", "umu", "usi", "uu ", "wam", " af", " ba", " li", " si", " zi", "a v", "ami", "atu", "awi", "eri", "fan", "fur", "ger", "i z", "isi", "izo", "lea", "mbi", "mwa", "nye", "o h", "o m", "oni", "rez", "saa", "ser", "sin", "tat", "tis", "tu ", "uin", "uki", "ur ", "wi ", "yar", " da", " en", " mp", " ny", " ta", " ul", " we", "a c", "a f", "ais", "apo", "ayo", "bar", "dhi", "e a", "eke", "eny", "eon", "hai", "han", "hiy", "hur", "i s", "imw", "kal", "kwe", "lak", "lam", "mak", "msa", "ne ", "ngu", "ru ", "sal", "swa", "te ", "ti ", "uku", "uma", "una", "uru");
+$GLOBALS["ngrams"]['tl'] = array("ng ", "ang", " na", " sa", "an ", "nan", "sa ", "na ", " ma", " ca", "ay ", "n g", " an", "ong", " ga", "at ", " pa", "ala", " si", "a n", "ga ", "g n", "g m", "ito", "g c", "man", "san", "g s", "ing", "to ", "ila", "ina", " di", " ta", "aga", "iya", "aca", "g t", " at", "aya", "ama", "lan", "a a", "qui", "a c", "a s", "nag", " ba", "g i", "tan", "'t ", " cu", "aua", "g p", " ni", "os ", "'y ", "a m", " n ", "la ", " la", "o n", "yan", " ay", "usa", "cay", "on ", "ya ", " it", "al ", "apa", "ata", "t n", "uan", "aha", "asa", "pag", " gu", "g l", "di ", "mag", "aba", "g a", "ara", "a p", "in ", "ana", "it ", "si ", "cus", "g b", "uin", "a t", "as ", "n n", "hin", " hi", "a't", "ali", " bu", "gan", "uma", "a d", "agc", "aqu", "g d", " tu", "aon", "ari", "cas", "i n", "niy", "pin", "a i", "gca", "siy", "a'y", "yao", "ag ", "ca ", "han", "ili", "pan", "sin", "ual", "n s", "nam", " lu", "can", "dit", "gui", "y n", "gal", "hat", "nal", " is", "bag", "fra", " fr", " su", "a l", " co", "ani", " bi", " da", "alo", "isa", "ita", "may", "o s", "sil", "una", " in", " pi", "l n", "nil", "o a", "pat", "sac", "t s", " ua", "agu", "ail", "bin", "dal", "g h", "ndi", "oon", "ua ", " ha", "ind", "ran", "s n", "tin", "ulo", "eng", "g f", "ini", "lah", "lo ", "rai", "rin", "ton", "g u", "inu", "lon", "o'y", "t a", " ar", "a b", "ad ", "bay", "cal", "gya", "ile", "mat", "n a", "pau", "ra ", "tay", "y m", "ant", "ban", "i m", "nas", "nay", "no ", "sti", " ti", "ags", "g g", "ta ", "uit", "uno", " ib", " ya", "a u", "abi", "ati", "cap", "ig ", "is ", "la'", " do", " pu", "api", "ayo", "gos", "gul", "lal", "tag", "til", "tun", "y c", "y s", "yon", "ano", "bur", "iba", "isi", "lam", "nac", "nat", "ni ", "nto", "od ", "pa ", "rgo", "urg", " m ", "adr", "ast", "cag", "gay", "gsi", "i p", "ino", "len", "lin", "m g", "mar", "nah", "to'", " de", "a h", "cat", "cau", "con", "iqu", "lac", "mab", "min", "og ", "par", "sal", " za", "ao ", "doo", "ipi", "nod", "nte", "uha", "ula", " re", "ill", "lit", "mac", "nit", "o't", "or ", "ora", "sum", "y p", " al", " mi", " um", "aco", "ada", "agd", "cab");
+$GLOBALS["ngrams"]['tlh'] = array("tlh", "e' ", "gh ", "i' ", " 'e", "u' ", " vi", "atl", "a' ", " gh", "ej ", " ho", " ch", " mu", " tl", "nga", "mey", "wi'", "be'", "an ", "ch ", "gan", "chu", "lh ", "ing", "'e'", "hin", "jat", "lhi", " da", " ja", "o' ", "ugh", "aq ", "cha", " po", "ey ", " 'a", " je", "'ej", " pa", "ng ", "ad ", " qa", "oh ", "eh ", "ah ", "gha", "je ", " lu", "hol", "aw'", " ji", "ong", "pu'", "aj ", "vad", "w' ", "' j", "ha'", "is ", "tah", "' '", "ang", "h '", "pon", "am ", "law", "mo'", "qu'", "hbe", "ol ", "vam", "agh", "mu'", "ahv", "bej", "ogh", "uch", "' v", "ach", "hug", " lo", " qu", "cho", "hva", "ij ", " la", "lu'", "vis", " ne", " pu", " so", " ta", " va", "'ac", "di'", "hu'", "lah", "moh", " 'o", "' m", "daq", "hah", "n h", "neh", "u'm", "ay'", "gho", "h v", "meh", "oy ", " ma", " nu", "'me", "el ", " ba", " be", " de", " ng", "' t", "h d", "hvi", "oq ", " wa", "' l", "'wi", "hme", "li'", "uq ", " bo", "bog", "del", "h p", "h t", "ich", "vil", " qe", " wi", "ahb", "ban", "eng", "haq", "hoh", "ov ", "viq", " ha", " ti", "' n", "' p", "'a'", "hwi", "igh", "lo'", "y' ", " du", " no", " yu", "'mo", "'va", "daj", "das", "egh", "hom", "muc", "om ", "otl", "us ", " bi", " tu", "' h", "chm", "h q", "hov", "nis", "qar", "uj ", "' q", "'ch", "h m", "hmo", "jih", "par", "wij", " hu", "' d", "'a ", "etl", "h g", "h j", "h l", "lod", "maq", "och", "wa'", "yuq", " di", " le", " pe", " ya", "'di", "che", "ech", "ih ", "ija", "in ", "j '", "j m", "lhw", "pa'", " 'i", " mi", " qi", " ro", " ru", "'be", "anp", "ghi", "ghu", "h b", "hay", "hch", "iq ", "npu", "od ", "paq", "qay", "rda", "soh", " do", " me", " qo", " sa", "' c", "' g", "' s", "'lu", "aml", "ard", "as ", "d p", "gme", "h n", "hta", "i'v", "j j", "jij", "len", "ngm", "qan", "qme", "vaj", "wiv", " mo", " ni", "'la", "'pu", "'qu", "ar ", "arm", "dwi", "g p", "ghd", "h c", "ham", "hla", "hqu", "ilo", "iqa", "iqi", "j p", "j t", "j v", "lad", "lho", "mar", "mug", "pus", "q s", "q t", "rgh", "rma", "sov", "ta'", "tin", "tu'", "u'd", "vet", "yli", "yu'", " to", "'oh", "aqq", "art", "at ", "ayl", "ayt", "et ", "haj", "har");
+$GLOBALS["ngrams"]['tn'] = array(" di", " le", "go ", "le ", " go", "ng ", " ts", "ya ", " ya", "sa ", "tlh", " mo", " bo", "a m", "lo ", "tsa", " e ", "o t", "a b", "wa ", " ka", "a k", "a t", "ka ", "a g", "eng", "olo", "o y", "la ", " a ", "a d", "ets", "mo ", "se ", " tl", " ba", "tsh", " ma", "ba ", "a l", "tse", "so ", "na ", "elo", " se", "ele", "e d", "o l", "lho", "e t", "di ", "e g", " kg", "dit", "kgo", "o k", "ang", "lha", "e m", "e e", "we ", "ane", "o m", "e k", "e l", "ong", "set", "wan", "ela", "tso", "tla", "o d", "e b", "ola", "ngw", "gwe", "o b", "aba", "atl", "a p", " o ", "a a", "o a", "otl", "a s", "o e", "dir", "thu", "ga ", " ga", "shw", "ots", "aka", "hab", "hwa", "aga", "o g", "gan", "tsw", "ana", "mol", " ke", "hut", " me", "ona", "lel", "its", "lao", "kga", "dik", "got", " fa", "let", " wa", "ose", "no ", "t h", "swe", "edi", "ats", "a n", "e s", "oko", "oth", "kwa", "kar", " th", "a e", "ala", "tir", "o n", "dip", "isa", "gat", "ti ", "ano", "bot", " nn", " ha", "len", "alo", "any", "aro", "iti", "iri", "o s", "sen", "net", "ke ", "ho ", "mai", "ika", "eka", "to ", "ith", "re ", "g m", "hat", "bo ", "g l", "et ", "emo", "ama", "iso", "rol", "fa ", "iwa", "kan", "she", "si ", "ao ", "g k", "wen", "lol", "o o", "bos", "itl", "a y", "the", "lwa", "e n", " la", "ore", " mm", "ko ", "tha", "e a", "eo ", "lhe", "bol", "ha ", " po", "isi", "i b", "lan", " na", "i t", "ale", "ne ", "gon", "ris", "ira", "bon", " sa", "g y", "g g", "pha", "oga", "mel", "ro ", "gol", "o w", " kw", "i l", " ti", "tlo", "log", "por", " ja", "a f", " ne", "hok", "lot", " pu", "e y", "uto", "g t", "hom", "okg", " ko", "o f", "ame", "gor", "ta ", " pe", "nts", " kh", "tho", "gel", "adi", "are", "ete", "ase", "mon", "heo", "oro", "omo", "nen", "nel", "ile", "nng", "ntl", "abo", "ogo", "ara", "nse", "ego", "hel", "uo ", "mog", "san", "ula", "rag", "kol", "te ", "etl", "bat", " te", "puo", "amo", "ofe", "lat", "ati", "ole", "rab", "tsi", "iro", "man", "ael", "ega", "lwe", "ra ", "din", "tle", "sek", "ing", "yo ", "a o", " re", "aot", "uso", "o r", "ere", "jwa", "aem", "lam", "lek", " jw", "gwa", "mok");
+$GLOBALS["ngrams"]['tr'] = array("lar", "en ", "ler", "an ", "in ", " bi", " ya", "eri", "de ", " ka", "ir ", "arı", " ba", " de", " ha", "ın ", "ara", "bir", " ve", " sa", "ile", "le ", "nde", "da ", " bu", "ana", "ini", "ını", "er ", "ve ", " yı", "lma", "yıl", " ol", "ar ", "n b", "nda", "aya", "li ", "ası", " ge", "ind", "n k", "esi", "lan", "nla", "ak ", "anı", "eni", "ni ", "nı ", "rın", "san", " ko", " ye", "maz", "baş", "ili", "rin", "alı", "az ", "hal", "ınd", " da", " gü", "ele", "ılm", "ığı", "eki", "gün", "i b", "içi", "den", "kar", "si ", " il", "e y", "na ", "yor", "ek ", "n s", " iç", "bu ", "e b", "im ", "ki ", "len", "ri ", "sın", " so", "ün ", " ta", "nin", "iği", "tan", "yan", " si", "nat", "nın", "kan", "rı ", "çin", "ğı ", "eli", "n a", "ır ", " an", "ine", "n y", "ola", " ar", "al ", "e s", "lik", "n d", "sin", " al", " dü", "anl", "ne ", "ya ", "ım ", "ına", " be", "ada", "ala", "ama", "ilm", "or ", "sı ", "yen", " me", "atı", "di ", "eti", "ken", "la ", "lı ", "oru", " gö", " in", "and", "e d", "men", "un ", "öne", "a d", "at ", "e a", "e g", "yar", " ku", "ayı", "dan", "edi", "iri", "ünü", "ği ", "ılı", "eme", "eği", "i k", "i y", "ıla", " ça", "a y", "alk", "dı ", "ede", "el ", "ndı", "ra ", "üne", " sü", "dır", "e k", "ere", "ik ", "imi", "işi", "mas", "n h", "sür", "yle", " ad", " fi", " gi", " se", "a k", "arl", "aşı", "iyo", "kla", "lığ", "nem", "ney", "rme", "ste", "tı ", "unl", "ver", " sı", " te", " to", "a s", "aşk", "ekl", "end", "kal", "liğ", "min", "tır", "ulu", "unu", "yap", "ye ", "ı i", "şka", "ştı", " bü", " ke", " ki", "ard", "art", "aşa", "n i", "ndi", "ti ", "top", "ı b", " va", " ön", "aki", "cak", "ey ", "fil", "isi", "kle", "kur", "man", "nce", "nle", "nun", "rak", "ık ", " en", " yo", "a g", "lis", "mak", "n g", "tir", "yas", " iş", " yö", "ale", "bil", "bul", "et ", "i d", "iye", "kil", "ma ", "n e", "n t", "nu ", "olu", "rla", "te ", "yön", "çık", " ay", " mü", " ço", " çı", "a a", "a b", "ata", "der", "gel", "i g", "i i", "ill", "ist", "ldı", "lu ", "mek", "mle", "n ç", "onu", "opl", "ran", "rat", "rdı", "rke", "siy", "son", "ta ", "tçı", "tın");
+$GLOBALS["ngrams"]['ts'] = array(" ku", "ku ", "na ", "ka ", "wa ", "a n", " sw", "a m", "ya ", "a k", " ti", "swi", "hi ", "la ", " ya", " le", " hi", "a t", "a v", " va", "ni ", " na", "ndz", " ma", "a h", " xi", "a s", "i n", "ele", "i k", "ana", "a l", "nga", "lo ", "va ", "le ", "aka", "ela", "irh", "eka", " vu", "iwa", "a x", " ka", "yi ", " wa", "isa", "sa ", "ko ", "ta ", "ga ", "wu ", "wi ", "tir", " ek", " mi", " ni", "o y", "elo", "awu", "isi", "swa", "i t", "hla", "a e", " ta", " ng", " la", "a y", "ri ", "eri", " ri", "rhi", "eke", "umb", "u t", "ndl", " yi", "lan", "i v", "esw", "mbe", "i l", "a r", "e k", "ang", "les", "ula", "ti ", "yon", "o w", "ona", "law", "xa ", "nel", "yo ", "lel", "iko", " lo", "amb", " a ", "i y", " xa", "ane", "wan", "i s", "ond", "fan", "end", "i h", "o l", "u k", "mbi", "n'w", "ke ", "dyo", " fa", "lam", "nhl", "o s", "ong", "no ", " ko", "u n", " ha", "ho ", "oko", "u h", "i m", "o n", " yo", "ngu", "o k", "u y", "ati", "u l", "van", "ulu", "and", "mba", "kum", "u v", "wo ", "be ", "ha ", "riw", "dza", "si ", " en", "o h", " hl", "o t", "eyi", " nt", "ila", "lok", "dzi", "nge", " mu", "ala", "to ", "a w", " by", "arh", "aku", "tsa", "wak", "rho", "'wa", " nd", "min", "lav", "tim", "ley", "tik", "dle", "tin", "mat", "ler", "let", "sel", "his", "mel", "lu ", "ika", "a a", "ngo", "eng", "o x", " nk", "amu", "siw", "ani", "eni", "ma ", " nh", "mi ", "swo", "eti", "tan", "mo ", "ham", "iwe", " kh", "han", "lek", "nti", "ung", "hak", "dzo", "ete", " ts", "ava", "hu ", "fum", "kar", "vul", " wu", "kul", "und", "i x", "nhu", "yis", "xik", "bis", "xi ", "e y", "ra ", "hle", " hu", "wek", "ano", "yen", "a d", "sis", "olo", "pfu", "i w", "nyi", "e n", "so ", "ki ", "fun", "iso", "tsh", "kon", "nku", "hel", "i b", "e h", "ari", "imi", "i e", "ind", "vum", "nts", "ime", "kom", "mfu", "ise", " mf", "hin", "dla", "vut", "gan", "i r", "ban", "bya", "mil", "int", "ats", " dy", "u s", "e x", "ile", "kel", "kwa", " no", "i f", "asi", "za ", "uri", "o m", "rha", "e l", "in'", "eta", "von", "i a", "kho", " wo", "iki", " ra", "u e", "o e", "zo ", "yin", "ink", "any", "ket");
+$GLOBALS["ngrams"]['uk'] = array(" на", " за", "ння", "ня ", "на ", " пр", "ого", "го ", "ськ", " по", " у ", "від", "ере", " мі", " не", "их ", "ть ", "пер", " ві", "ів ", " пе", " що", "льн", "ми ", "ні ", "не ", "ти ", "ати", "енн", "міс", "пра", "ува", "ник", "про", "рав", "івн", " та", "буд", "влі", "рів", " ко", " рі", "аль", "но ", "ому", "що ", " ви", "му ", "рев", "ся ", "інн", " до", " уп", "авл", "анн", "ком", "ли ", "лін", "ног", "упр", " бу", " з ", " ро", "за ", "и н", "нов", "оро", "ост", "ста", "ті ", "ють", " мо", " ні", " як", "бор", "ва ", "ван", "ень", "и п", "нь ", "ові", "рон", "сті", "та ", "у в", "ько", "іст", " в ", " ре", "до ", "е п", "заб", "ий ", "нсь", "о в", "о п", "при", "і п", " ку", " пі", " сп", "а п", "або", "анс", "аці", "ват", "вни", "и в", "ими", "ка ", "нен", "ніч", "она", "ої ", "пов", "ьки", "ьно", "ізн", "ічн", " ав", " ма", " ор", " су", " чи", " ін", "а з", "ам ", "ає ", "вне", "вто", "дом", "ент", "жит", "зни", "им ", "итл", "ла ", "них", "ниц", "ова", "ови", "ом ", "пор", "тьс", "у р", "ься", "ідо", "іль", "ісь", " ва", " ді", " жи", " че", " і ", "а в", "а н", "али", "вез", "вно", "еве", "езе", "зен", "ицт", "ки ", "ких", "кон", "ку ", "лас", "ля ", "мож", "нач", "ним", "ної", "о б", "ову", "оди", "ою ", "ро ", "рок", "сно", "спо", "так", "тва", "ту ", "у п", "цтв", "ьни", "я з", "і м", "ії ", " вс", " гр", " де", " но", " па", " се", " ук", " їх", "а о", "авт", "аст", "ают", "вар", "ден", "ди ", "ду ", "зна", "и з", "ико", "ися", "ити", "ког", "мен", "ном", "ну ", "о н", "о с", "обу", "ово", "пла", "ран", "рив", "роб", "ска", "тан", "тим", "тис", "то ", "тра", "удо", "чин", "чни", "і в", "ію ", " а ", " во", " да", " кв", " ме", " об", " ск", " ти", " фі", " є ", "а р", "а с", "а у", "ак ", "ані", "арт", "асн", "в у", "вик", "віз", "дов", "дпо", "дів", "еві", "енс", "же ", "и м", "и с", "ика", "ичн", "кі ", "ків", "між", "нан", "нос", "о у", "обл", "одн", "ок ", "оло", "отр", "рен", "рим", "роз", "сь ", "сі ", "тла", "тів", "у з", "уго", "уді", "чи ", "ше ", "я н", "я у", "ідп", "ій ", "іна", "ія ", " ка", " ни", " ос", " си", " то", " тр", " уг");
+$GLOBALS["ngrams"]['ur'] = array("یں ", " کی", "کے ", " کے", "نے ", " کہ", "ے ک", "کی ", "میں", " می", "ہے ", "وں ", "کہ ", " ہے", "ان ", "ہیں", "ور ", " کو", "یا ", " ان", " نے", "سے ", " سے", " کر", "ستا", " او", "اور", "تان", "ر ک", "ی ک", " اس", "ے ا", " پا", " ہو", " پر", "رف ", " کا", "ا ک", "ی ا", " ہی", "در ", "کو ", " ای", "ں ک", " مش", " مل", "ات ", "صدر", "اکس", "شرف", "مشر", "پاک", "کست", "ی م", " دی", " صد", " یہ", "ا ہ", "ن ک", "وال", "یہ ", "ے و", " بھ", " دو", "اس ", "ر ا", "نہی", "کا ", "ے س", "ئی ", "ہ ا", "یت ", "ے ہ", "ت ک", " سا", "لے ", "ہا ", "ے ب", " وا", "ار ", "نی ", "کہا", "ی ہ", "ے م", " سی", " لی", "انہ", "انی", "ر م", "ر پ", "ریت", "ن م", "ھا ", "یر ", " جا", " جن", "ئے ", "پر ", "ں ن", "ہ ک", "ی و", "ے د", " تو", " تھ", " گی", "ایک", "ل ک", "نا ", "کر ", "ں م", "یک ", " با", "ا ت", "دی ", "ن س", "کیا", "یوں", "ے ج", "ال ", "تو ", "ں ا", "ے پ", " چا", "ام ", "بھی", "تی ", "تے ", "دوس", "س ک", "ملک", "ن ا", "ہور", "یے ", " مو", " وک", "ائی", "ارت", "الے", "بھا", "ردی", "ری ", "وہ ", "ویز", "ں د", "ھی ", "ی س", " رہ", " من", " نہ", " ور", " وہ", " ہن", "ا ا", "است", "ت ا", "ت پ", "د ک", "ز م", "ند ", "ورد", "وکل", "گی ", "گیا", "ہ پ", "یز ", "ے ت", " اع", " اپ", " جس", " جم", " جو", " سر", "اپن", "اکث", "تھا", "ثری", "دیا", "ر د", "رت ", "روی", "سی ", "ملا", "ندو", "وست", "پرو", "چاہ", "کثر", "کلا", "ہ ہ", "ہند", "ہو ", "ے ل", " اک", " دا", " سن", " وز", " پی", "ا چ", "اء ", "اتھ", "اقا", "اہ ", "تھ ", "دو ", "ر ب", "روا", "رے ", "سات", "ف ک", "قات", "لا ", "لاء", "م م", "م ک", "من ", "نوں", "و ا", "کرن", "ں ہ", "ھار", "ہوئ", "ہی ", "یش ", " ام", " لا", " مس", " پو", " پہ", "انے", "ت م", "ت ہ", "ج ک", "دون", "زیر", "س س", "ش ک", "ف ن", "ل ہ", "لاق", "لی ", "وری", "وزی", "ونو", "کھن", "گا ", "ں س", "ں گ", "ھنے", "ھے ", "ہ ب", "ہ ج", "ہر ", "ی آ", "ی پ", " حا", " وف", " گا", "ا ج", "ا گ", "اد ", "ادی", "اعظ", "اہت", "جس ", "جمہ", "جو ", "ر س", "ر ہ", "رنے", "س م", "سا ", "سند", "سنگ", "ظم ", "عظم", "ل م", "لیے", "مل ", "موہ", "مہو", "نگھ", "و ص", "ورٹ", "وہن", "کن ", "گھ ", "گے ", "ں ج", "ں و", "ں ی", "ہ د", "ہن ", "ہوں", "ے ح", "ے گ", "ے ی", " اگ", " بع", " رو", " شا");
+$GLOBALS["ngrams"]['uz'] = array("ан ", "ган", "лар", "га ", "нг ", "инг", "нин", "да ", "ни ", "ида", "ари", "ига", "ини", "ар ", "ди ", " би", "ани", " бо", "дан", "лга", " ҳа", " ва", " са", "ги ", "ила", "н б", "и б", " кў", " та", "ир ", " ма", "ага", "ала", "бир", "ри ", "тга", "лан", "лик", "а к", "аги", "ати", "та ", "ади", "даг", "рга", " йи", " ми", " па", " бў", " қа", " қи", "а б", "илл", "ли ", "аси", "и т", "ик ", "или", "лла", "ард", "вчи", "ва ", "иб ", "ири", "лиг", "нга", "ран", " ке", " ўз", "а с", "ахт", "бўл", "иги", "кўр", "рда", "рни", "са ", " бе", " бу", " да", " жа", "а т", "ази", "ери", "и а", "илг", "йил", "ман", "пах", "рид", "ти ", "увч", "хта", " не", " со", " уч", "айт", "лли", "тла", " ай", " фр", " эт", " ҳо", "а қ", "али", "аро", "бер", "бил", "бор", "ими", "ист", "он ", "рин", "тер", "тил", "ун ", "фра", "қил", " ба", " ол", "анс", "ефт", "зир", "кат", "мил", "неф", "саг", "чи ", "ўра", " на", " те", " эн", "а э", "ам ", "арн", "ат ", "иш ", "ма ", "нла", "рли", "чил", "шга", " иш", " му", " ўқ", "ара", "ваз", "и у", "иқ ", "моқ", "рим", "учу", "чун", "ши ", "энг", "қув", "ҳам", " сў", " ши", "бар", "бек", "дам", "и ҳ", "иши", "лад", "оли", "олл", "ори", "оқд", "р б", "ра ", "рла", "уни", "фт ", "ўлг", "ўқу", " де", " ка", " қў", "а ў", "аба", "амм", "атл", "б к", "бош", "збе", "и в", "им ", "ин ", "ишл", "лаб", "лей", "мин", "н д", "нда", "оқ ", "р м", "рил", "сид", "тал", "тан", "тид", "тон", "ўзб", " ам", " ки", "а ҳ", "анг", "анд", "арт", "аёт", "дир", "ент", "и д", "и м", "и о", "и э", "иро", "йти", "нсу", "оди", "ор ", "си ", "тиш", "тоб", "эти", "қар", "қда", " бл", " ге", " до", " ду", " но", " пр", " ра", " фо", " қо", "а м", "а о", "айд", "ало", "ама", "бле", "г н", "дол", "ейр", "ек ", "ерг", "жар", "зид", "и к", "и ф", "ий ", "ило", "лди", "либ", "лин", "ми ", "мма", "н в", "н к", "н ў", "н ҳ", "ози", "ора", "оси", "рас", "риш", "рка", "роқ", "сто", "тин", "хат", "шир", " ав", " рў", " ту", " ўт", "а п", "авт", "ада", "аза", "анл", "б б", "бой", "бу ", "вто", "г э", "гин", "дар", "ден", "дун", "иде", "ион", "ирл", "ишг", "йха", "кел", "кўп", "лио");
+$GLOBALS["ngrams"]['ve'] = array("ha ", " vh", "a m", "na ", " u ", "a n", "tsh", "wa ", "a u", " na", "nga", "vha", " ts", " dz", " kh", "dza", "a v", "ya ", " ya", "a t", "ho ", "la ", " zw", " mu", "edz", "vhu", "ga ", "shi", "za ", "a k", " ng", "kha", " ma", "hum", "ne ", " nd", "o n", "lo ", "dzi", "shu", " ha", "a d", "o y", "nda", "ele", "zwi", "aho", "ang", "no ", " a ", "ela", "a z", "hu ", "sha", "i n", " wa", "ana", "hi ", "kan", "o d", "ano", "a h", "zwa", " th", " mi", "gan", "a l", "sa ", "han", "di ", "u t", "and", "ndi", "yo ", "the", "do ", "ri ", "vho", "ni ", "ka ", "uri", "si ", "o t", "mbe", "o w", "ane", "we ", "zo ", "i t", "e n", "i h", "she", "ush", "o k", "zi ", "da ", "a a", "thu", " la", "a p", "zan", " i ", "a s", "lwa", "ula", "i d", "aka", " do", "mis", "hed", "ita", "li ", " hu", "iwa", " lu", "i v", "he ", " ka", "elo", "so ", "amb", "avh", " sh", "o v", "i k", "lel", "u v", "dzo", "u s", " fh", "mo ", "nwe", "o l", "umi", "wah", "isi", "hel", "a i", "vel", "adz", "tan", "i m", "ath", "thi", "wi ", " ur", "hat", "ine", "le ", "vhe", "any", "a y", "hon", "isa", "ala", "o a", "alu", "udi", "umb", " bv", "ash", " te", " li", "lus", "nya", "has", "led", "swa", "hus", "o i", "umo", "one", "nde", "tha", " it", "kho", "ngo", "mus", "hak", "e y", "ea ", "ivh", "o m", "u n", "hin", "tho", "mut", "ayo", "fhi", " sa", "tel", "hul", "hun", "ulo", "ith", "ma ", " yo", "lan", "e v", " ph", "go ", "i a", "o u", "hud", " pf", "uka", "zhi", "uvh", "dzw", "ing", "elw", "ila", "wo ", "mbo", "u d", "ite", "isw", "asi", "e k", "ndu", "fhe", "o h", "mel", "u b", "ika", "bo ", "gud", "dzh", "kon", "ifh", " ta", "e d", "uth", " ho", "i z", "wan", "ulu", "mad", "inw", "oth", "ani", "dis", "wit", "ou ", "bve", "ets", "u i", "adi", "e m", "fha", "nah", "dal", "win", " si", "sho", " in", "yam", "lay", "eka", "a f", "i u", "end", "i y", "alo", "i l", "uso", "mul", "ta ", "del", "u k", " mb", "pha", " di", "dad", "ali", "o s", "pfu", "khw", "e a", " ko", " ne", "hen", "mas", "ume", "ini", "ish", "udz", "ira", "oni", "luk", "nel", "iso", "mba", "dzu", "hom", "i s", "zwo", "ngu", "ara", "unz");
+$GLOBALS["ngrams"]['xh'] = array("la ", " ku", "lo ", "nga", "a k", " ng", "oku", " kw", " uk", "a n", "uku", "ye ", "a i", "yo ", "ela", "ele", "a u", "nye", "we ", "wa ", "ama", "e n", "ise", "aba", "ba ", "ho ", "enz", "o n", "ngo", "kub", "nge", "ath", "fun", "o e", "lel", "ung", "uba", "ko ", "elo", "ezi", "o k", "the", "kwa", "na ", "kwe", "ang", "e i", "le ", "ka ", "esi", "o y", " na", "e k", "eth", "pha", " in", "kun", "nzi", "and", "ni ", "ban", " ye", " no", "lwa", "lun", " ok", "any", "zi ", "li ", " ne", "ulu", "a e", "eli", "gok", "o l", "ebe", "und", "isa", "seb", "ndo", " ez", "tho", "o i", "do ", "ben", "ing", "kwi", "ndl", "uny", "ala", "a a", "eyo", "e u", "kan", " ab", "thi", "i k", "i n", "o u", "o z", "elw", "sa ", "sek", "ayo", "het", "o o", "eka", " um", "hi ", "bo ", "so ", "isi", "wen", "lwe", "aph", "a l", "ya ", "eko", "ana", " yo", "kuf", "ini", "imi", "ali", "ha ", "awu", "wan", "ent", "uth", "tha", "za ", "ula", "kho", " ii", "ane", "e a", "iso", "uph", " le", "ile", "zin", "nts", " si", "eng", "nok", "ong", "hla", "zwe", " el", "oka", "eki", "lis", "azi", " lo", "tsh", " am", "ufu", "ant", "isw", "o a", "ngu", "o s", " ba", "int", "eni", "une", "wul", "hul", "sel", "i e", "use", "lan", "ke ", "nis", "emi", " li", " is", "iph", " im", "a o", "aka", "mfu", " zi", "ink", "mal", "ley", "man", "nya", "nek", "akh", "ume", " ko", "alo", "tu ", "i u", "ntu", "izw", "kel", "izi", "i i", "si ", "gan", "ase", "ind", "i a", "ndi", "nel", "alu", "sis", "ubo", "kut", "mth", "kus", "lek", "mis", "nde", " zo", " we", "ani", "ga ", "iko", "siz", "no ", "phu", "e e", "hon", "ond", "ne ", "ith", "kul", "gam", "gen", "pho", " iz", "phe", "hat", "khu", "iin", "han", "zo ", "lu ", "ulo", "nda", "qo ", "zik", "hel", "o m", " lw", "zis", "dle", "uhl", "men", "olo", "mel", "del", "nza", "oko", "okw", "olu", "kuk", "nte", "swa", "law", "enk", " ya", "i y", "gaq", "sha", "aqo", "e l", "ikh", "nkq", "ule", " ka", "onk", "thu", "wo ", "bon", "kup", "qub", "a y", "kqu", "dla", " es", "he ", "ano", "lum", "be ", "iga", " ze", "o w", "aku", "mga", "nke", "te ", " ol", "ze ", "kum", "emf", "esh");
+$GLOBALS["ngrams"]['zu'] = array("oku", "la ", "nga", " ng", "a n", " ku", "a k", "thi", " uk", "ezi", "e n", "uku", "le ", "lo ", "hi ", "wa ", " no", "a u", "ela", "we ", "a i", "ni ", "ele", "zin", "uth", "ama", "elo", "pha", "ing", "aba", "ath", "and", "enz", "eth", "esi", "ma ", "lel", " um", " ka", "the", "ung", "nge", "ngo", "tho", "nye", "kwe", "eni", "izi", "ye ", " kw", "ndl", "ho ", "a e", "na ", "zi ", "het", "kan", "e u", "e i", "und", "ise", "isi", "nda", "kha", "ba ", "i k", "nom", "fun", " ez", " iz", "ke ", "ben", "o e", "isa", "zwe", "kel", "ka ", "aka", "nzi", "o n", "e k", "oma", "kwa", " ne", "any", "ang", "hla", "i u", "mth", "kub", "o k", "ana", "ane", "ikh", "ebe", "kut", "ha ", " is", "azi", "ulu", "seb", "ala", "onk", "ban", "i e", "azw", "wen", " ab", "han", "a a", "i n", "imi", "lan", "hat", "lwa", " na", "ini", "akh", "li ", "ngu", "nke", "nok", "ume", "eke", "elw", "yo ", "aph", "kus", " es", " ok", "iph", " im", "mel", "i i", " lo", " in", " am", "kho", "za ", "gok", "sek", "lun", "kun", "lwe", "sha", "sik", "kuf", "hak", "a y", "thu", "sa ", "o u", "khu", "ayo", "hul", "e a", "ali", "eng", "lu ", "ne ", " ko", "eli", "uba", "dle", "e e", "ith", " yo", "a l", "nel", "mis", " si", "kul", "a o", "sis", "lok", "gen", "o z", "i a", "emi", "uma", "eka", "alo", "man", "isw", "tha", "o i", "lon", "so ", "uph", "uhl", "ntu", "zim", "mal", "ind", "wez", " ba", "o o", " yi", " we", "ula", "phe", "o y", "ile", "o l", "wo ", "wel", "ga ", "tu ", "hle", "okw", "fan", " le", "kaz", "ase", "ani", "nde", "bo ", "ngi", "ule", " em", "men", "iny", "amb", "mbi", "gan", "ifu", "o s", "ant", "hel", "ika", "ona", "i l", "fut", " fu", "ze ", "u a", "nhl", "nin", " zo", "end", "sig", "u k", "gab", "ufa", "ish", "ush", "kuz", "no ", "gam", "kuh", " ye", "nya", "nez", "zis", "dlu", "kat", "dla", "tsh", " se", "ike", "kuq", "gu ", "osi", "swa", "lul", " zi", "ima", "e l", "kup", "mo ", "nza", "asi", "ko ", "kum", "lek", "she", "umt", "uny", "yok", "wan", "wam", "ame", "ong", "lis", "mkh", "ahl", "ale", "use", "o a", "alu", "gap", "si ", "hlo", "nje", "omt", "o w", "okh", "he ", "kom", "i s");
+
+/**
+ * Lister les ngrams contenus dans un texte
+ * @param string $string
+ * @param int $ng_number
+ * @param int $ng_max_chars
+ * @return array
+ */
+function createNGrams($string, $ng_number = 300, $ng_max_chars = 4){
 
        // Attention: $string n'est pas un mot, mais le texte complet
        // On va le couper pour éviter les timeout, 
        // mais il faut qu'il reste suffisamment long pour que la détection reste qualitative
        // Au passage: on fait les calculs en multibyte.
        $string = mb_substr($string, 0, 5000, "utf-8");
-       
+
        // Attention: il faut traiter les chaines en utf-8 !!!
-    //iterate over each word, each character, all possible n-grams
-       $word = " ". $string . " ";
+       //iterate over each word, each character, all possible n-grams
+       $word = " " . $string . " ";
        $length = mb_strlen($word, "utf-8");
-       for ($pos=0; $pos < $length; $pos++){ //start position within word
+       for ($pos = 0; $pos<$length; $pos++){ //start position within word
                $chars = 3;
-               if (($pos + $chars) < $length) { //if not beyond end of word
-                        $array_ngram[] = mb_substr($word, $pos, $chars, "utf-8");
-                }
-        }
-    //count-> value(frequency, int)... key(ngram, string)
-    $ng_frequency = array_count_values($array_ngram);
-    //sort array by value(frequency) desc
-    arsort($ng_frequency);
-    //use only top frequent ngrams
-    $most_frequent = array_slice($ng_frequency, 0, $ng_number);
-    foreach ($most_frequent as $ng => $number_frequencey){
-        $sub_ng[] = $ng;
-    }
-    
-    return $sub_ng;
+               if (($pos+$chars)<$length){ //if not beyond end of word
+                       $array_ngram[] = mb_substr($word, $pos, $chars, "utf-8");
+               }
+       }
+       //count-> value(frequency, int)... key(ngram, string)
+       $ng_frequency = array_count_values($array_ngram);
+       //sort array by value(frequency) desc
+       arsort($ng_frequency);
+       //use only top frequent ngrams
+       $most_frequent = array_slice($ng_frequency, 0, $ng_number);
+       $sub_ng = array();
+       foreach ($most_frequent as $ng => $number_frequencey){
+               $sub_ng[] = $ng;
+       }
+
+       return $sub_ng;
 }
-function compareNGrams($sub_ng, $lm_ng, $max_delta = 140000) {
-    foreach ($lm_ng as $lm_basename => $language) {
-        $delta = 0;
-        //compare each ngram of input text to current lm-array
-        foreach ($sub_ng as $key => $existing_ngram){
-            //match
-            if(in_array($existing_ngram, $language)) {
-                $delta += abs($key - array_search($existing_ngram, $language));
-            //no match
-            } else {
-                $delta += 400;
-            }
-            //abort: this language already differs too much
-            if ($delta > $max_delta) {
-                break;
-             }
-        } // End comparison with current language
-        //include only non-aborted languages in result array
-        if ($delta < ($max_delta - 400)) {
-            $result[$lm_basename] = $delta;
-        }
-    } //End comparison all languages
-    if(!isset($result)) {
-      $result = '';
-    } else {
-        asort($result);
-    }
-    return $result;
+
+
+/**
+ * Trouver la langue la/les langues plausibles en fonction des ngrams trouves dans le texte et des ngrams possibles
+ * @param array $sub_ng
+ *   jeu de Ngrams trouves dans le texte
+ * @param array $lm_ng
+ *   jeu de Ngrams possibles
+ * @param int $max_delta
+ * @return string
+ */
+function compareNGrams($sub_ng, $lm_ng, $max_delta = 140000){
+       foreach ($lm_ng as $lm_basename => $language){
+               $delta = 0;
+               //compare each ngram of input text to current lm-array
+               foreach ($sub_ng as $key => $existing_ngram){
+                       //match
+                       if (in_array($existing_ngram, $language)){
+                               $delta += abs($key-array_search($existing_ngram, $language));
+                               //no match
+                       } else {
+                               $delta += 400;
+                       }
+                       //abort: this language already differs too much
+                       if ($delta>$max_delta){
+                               break;
+                       }
+               } // End comparison with current language
+               //include only non-aborted languages in result array
+               if ($delta<($max_delta-400)){
+                       $result[$lm_basename] = $delta;
+               }
+       } //End comparison all languages
+       if (!isset($result)){
+               $result = '';
+       } else {
+               asort($result);
+       }
+       return $result;
 }
 
+/**
+ * Retourne la proportion de texte qui n'est pas dans la plage utf cherchee
+ * @param string $texte
+ * @param string $plage
+ * @return float
+ */
+function tester_plage_utf($texte, $plage){
 
-function tester_plage_utf($texte, $plage) {
-       
        $total = mb_strlen($texte, "UTF-8");
-       
+
        $test = mb_strlen(
-                               preg_replace("/".$plage."/ui", "", $texte),
-                               "UTF-8"
-                       );
+               preg_replace("/" . $plage . "/ui", "", $texte),
+               "UTF-8"
+       );
 //     echo "<h4>".($test / $total)."<h4> ";
-       return ($test / $total);
-       
+       return ($test/$total);
 }
 
-function detecter_plages_utf($texte) {
+/**
+ * Reduire le jeu de langue possibles en fonction des plages utf8 utilisees dans le texte
+ * @param string $texte
+ * @return array|bool|string
+ */
+function detecter_plages_utf($texte){
 
-       if (tester_plage_utf($texte, "[\x{0041}-\x{024F}\x{1E00}-\x{1EFF}]") < 0.5) { 
+       if (tester_plage_utf($texte, "[\x{0041}-\x{024F}\x{1E00}-\x{1EFF}]")<0.5){
                // Latin
-               return array("fr", "en", "de", "it", "es", 'af','br','ca','ceb',"da","fi","nl","nr","pt","pt_BR","pt_PT","sk","ha","haw","hr","pl","cs","az","cy","et","ro","eu","hu","id","is","la","lt","lv","nb","nso","sl","so","sq","ss","st","sv","sw","tl","tlh","tn","tr","ts","ve","xh","zu");
-       } else if (tester_plage_utf($texte, "[\x{0400}-\x{0523}]") < 0.5) { 
+               return array("fr", "en", "de", "it", "es", 'af', 'br', 'ca', 'ceb', "da", "fi", "nl", "nr", "pt", "pt_BR", "pt_PT", "sk", "ha", "haw", "hr", "pl", "cs", "az", "cy", "et", "ro", "eu", "hu", "id", "is", "la", "lt", "lv", "nb", "nso", "sl", "so", "sq", "ss", "st", "sv", "sw", "tl", "tlh", "tn", "tr", "ts", "ve", "xh", "zu");
+       } else if (tester_plage_utf($texte, "[\x{0400}-\x{0523}]")<0.5){
                // Cyrillique
-               return array("ru","bg","kk","uk", "ky","mn", "uz","mk","sr");
-       } else  if (tester_plage_utf($texte, "[\x{0370}-\x{03ff}\x{1F00}-\x{1FFE}]") < 0.5) { 
+               return array("ru", "bg", "kk", "uk", "ky", "mn", "uz", "mk", "sr");
+       } else if (tester_plage_utf($texte, "[\x{0370}-\x{03ff}\x{1F00}-\x{1FFE}]")<0.5){
                // Grec/Copte
                return "el";
-       } else  if (tester_plage_utf($texte, "[\x{0530}-\x{058A}]") < 0.5) { 
+       } else if (tester_plage_utf($texte, "[\x{0530}-\x{058A}]")<0.5){
                // Armenien
                return "hy";
-       } else  if (tester_plage_utf($texte, "[\x{0590}-\x{05F4}]") < 0.5) { 
+       } else if (tester_plage_utf($texte, "[\x{0590}-\x{05F4}]")<0.5){
                // Hebreux
                return "he";
-       } else  if (tester_plage_utf($texte, "[\x{0600}-\x{077F}]") < 0.5) { 
+       } else if (tester_plage_utf($texte, "[\x{0600}-\x{077F}]")<0.5){
                // Arabe-farsi-pachtoune-urdu
-               return array("ar","fa", "ps","ur");
-       } else  if (tester_plage_utf($texte, "[\x{3040}-\x{30FF}]") < 0.7) { 
+               return array("ar", "fa", "ps", "ur");
+       } else if (tester_plage_utf($texte, "[\x{3040}-\x{30FF}]")<0.7){
                // Japonais (hiragana / katakana)
                return "ja";
-       } else  if (tester_plage_utf($texte, "[\x{4E00}-\x{9FBB}\x{4E00}–\x{9FBF}]") < 0.7) { 
+       } else if (tester_plage_utf($texte, "[\x{4E00}-\x{9FBB}\x{4E00}–\x{9FBF}]")<0.7){
                // Chinois
                return "zh";
-       } else  if (tester_plage_utf($texte, "[\x{0E00}-\x{0E5B}]") < 0.5) { 
+       } else if (tester_plage_utf($texte, "[\x{0E00}-\x{0E5B}]")<0.5){
                // Thai
                return "th";
-       } else  if (tester_plage_utf($texte, "[\x{1100}-\x{11F8}\x{3130}-\x{318E}\x{AC00}-\x{D7A3}]") < 0.5) { 
+       } else if (tester_plage_utf($texte, "[\x{1100}-\x{11F8}\x{3130}-\x{318E}\x{AC00}-\x{D7A3}]")<0.5){
                // Hangul  - Koreen
                return "ko";
        }
-       
+
        return false;
 }
 
 
-// Detecter langue
-
-// Premiere passe: detecter dans quel alphabet le texte est écrit
-// ce qui permet de limiter le nombre de réponse 
-// (par exemple: des caractères «arabes» ne peuvent être que de l'arabe, du farsi, du pachtourne ou du urdu)
-// Deuxieme passe: faire un test classique sur les trigrams (uniquement sur les langues possibles de la première passe)
-
-function _detecter_langue($texte) {
+/**
+ * Detecter langue
+ *
+ * Premiere passe: detecter dans quel alphabet le texte est écrit
+ * ce qui permet de limiter le nombre de réponse
+ * (par exemple: des caractères «arabes» ne peuvent être que de l'arabe, du farsi, du pachtourne ou du urdu)
+ * Deuxieme passe: faire un test classique sur les trigrams (uniquement sur les langues possibles de la première passe)
+ *
+ * @param string $texte
+ * @return bool|string
+ */
+function _detecter_langue($texte){
        $texte = strip_tags($texte);
        $texte = str_replace("’", "'", $texte);
        $texte = str_replace("\"", " ", $texte);
-       
-       // Si texte trop court, impossible de détecter la langue
-       if (mb_strlen($texte, "utf-8") < 6 ) return false; 
+
+       // Si les fonctions mb_ ne sont pas disponibles
+       // ou si texte trop court, impossible de détecter la langue
+       if ( !function_exists('mb_strlen')
+         OR !function_exists('mb_substr')
+         OR mb_strlen($texte, "utf-8")<6 ){
+               return false;
+       }
 
        $possibles = detecter_plages_utf($texte);
-       
-       if (!$possibles) return;
-       else if (!is_array($possibles)) {
+
+       if (!$possibles){
+               return false;
+       } else if (!is_array($possibles)){
                return $possibles;
        } else {
                $ngrams = array();
-               foreach($possibles as $lang) {
-                       $ngrams["$lang"] = $GLOBALS["ngrams"]["$lang"];
+               foreach ($possibles as $lang){
+                       $ngrams[$lang] = $GLOBALS["ngrams"][$lang];
                }
        }
-       
-    $sub_ng = createNGrams($texte);
 
-    $result_array = compareNGrams($sub_ng, $ngrams, 140000);
-       
+       $sub_ng = createNGrams($texte);
+       $result_array = compareNGrams($sub_ng, $ngrams, 140000);
+
 //     print_r($result_array);
-       
-       $resultat = false;
-       if ($result_array) {
-               foreach($result_array as $lang => $val) {
-                       if (!$resultat) $resultat = $lang;
+
+       $lang = false;
+       if (is_array($result_array) AND count($result_array)){
+               while (!$lang AND $r = each($result_array)){
+                       list($lang, $val) = $r;
                }
        }
-       return $resultat;
+       return $lang;
 }
 
-
-
-
 ?>
\ No newline at end of file
index 4b60164..2e1db14 100644 (file)
@@ -2,6 +2,9 @@
        <langue code="ar" url="http://trad.spip.net/tradlang_module/nospam?lang_cible=ar" total="10" traduits="5" relire="0" modifs="0" nouveaux="5" pourcent="50.00">
                <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
        </langue>
+       <langue code="de" url="http://trad.spip.net/tradlang_module/nospam?lang_cible=de" total="10" traduits="10" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/nospam?lang_cible=en" total="10" traduits="10" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
index 2797ba1..fd2c42e 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -16,5 +18,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // F
        'forum_saisie_texte_info' => 'لتنسيق رسالتك، لا تدعم هذه الاستمارة الا اختصارات SPIP مثل <code>[-&gt;url] {{أسود}} {مائل}&lt;quote&gt; &lt;رموز برمجية&gt;</code> &lt;إطار&gt;</cadre> وعلامات HTML كـ<code>&lt;q&gt; &lt;del&gt; &lt;ins&gt;</code>. لإنشاء فقرات، يكفي ترك أسطر فارغة.'
 );
-
-?>
diff --git a/www/plugins/nospam/lang/nospam_de.php b/www/plugins/nospam/lang/nospam_de.php
new file mode 100644 (file)
index 0000000..340e97d
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // E
+       'erreur_attributs_html_interdits' => 'Bilder sowie die HTML-Attribute <tt>class</tt> und <tt>style</tt> sind verboten.',
+       'erreur_blacklist' => 'Sie wurden auf die Schwarze Liste gesetzt und können keine Beiträge posten..',
+       'erreur_jeton' => 'Ihr Beitrag konnte nicht verarbeitet werden. Bitte posten Sie ihn erneut!',
+       'erreur_spam' => 'Ihr Beitrag kann nicht vrarbeitet werden!',
+       'erreur_spam_doublon' => 'Es existiert bereits ein identischer Beitrag !',
+       'erreur_spam_ip' => 'Zuviele Kommentare sind nicht gut für die Qualität!',
+       'erreur_url_deja_spammee' => 'Dieser Beitrag enthält zuviele Links, die wie SPAM aussehen. Bitte entfernen.',
+
+       // F
+       'forum_saisie_texte_info' => 'Zur Formatierung Ihres Beitrag stehen Ihnen nur folgende SPIP-Tags zur Verfügung: <code>[-&gt;url] {{gras}} {italique} &lt;quote&gt; &lt;code&gt;</code> &lt;cadre&gt;</cadre> sowie als HTML <code>&lt;q&gt; &lt;del&gt; &lt;ins&gt;</code>.',
+
+       // I
+       'info_ip_suspecte' => 'Ihre IP-Adresse setht unter SPAM-Verdacht. Bitte bestätign Sie Ihre guten Absichten.',
+
+       // L
+       'label_message_licite' => 'Dies ist kein mißbräuchlicher Beitrag.'
+);
index eebc224..9ededa3 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'This is not an abusive post'
 );
-
-?>
index e17e8dd..cf75729 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'Éste no es un mensaje abusivo'
 );
-
-?>
index a6bb5fc..6a4b366 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -16,5 +18,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // F
        'forum_saisie_texte_info' => 'اين فرم ميان‌ برهاي اسپيپ  <code>[-&gt;url] {{gras}} {italique} &lt;quote&gt; &lt;code&gt;</code>و  كد اچ.تي.ام.ال را <code>&lt;q&gt; &lt;del&gt; &lt;ins&gt;</code> مي‌پذيرد . براي ساختن پارگراف فقط يك سطر خالي بگذاريد. '
 );
-
-?>
index 8e40ff3..fc0bfc9 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/nospam/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -23,5 +25,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'Ceci n’est pas un message abusif'
 );
-
-?>
index b211884..4e59a9f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'Ceci n’est pas un message abusif'
 );
-
-?>
index 8634ec1..055782f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'Dit is geen verkeerd bericht'
 );
-
-?>
index 5078065..fb47606 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/nospam?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -25,5 +27,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // L
        'label_message_licite' => 'Toto nie je nevhodná správa'
 );
-
-?>
index dcac9ad..7c71a03 100644 (file)
@@ -3,12 +3,12 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // N
        'nospam_description' => 'توقف المتطفل! فلتر البريد المزعج في الرسائل ، دون ازعاج لمستخدم صادق.'
 );
-
-?>
index b671bd8..b6f1e23 100644 (file)
@@ -3,12 +3,12 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // N
        'nospam_description' => 'SPAM stoppen! Ein Filter ohne Nebenwirkungen für ehrliche Nutzer.'
 );
-
-?>
index d2740f5..0042754 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Stop spam! Filter spam in messages, without nuisance to honest users.',
        'nospam_slogan' => 'Reduce the risk of spams in the forums'
 );
-
-?>
index 38d98f2..cc1fd85 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Detenga el spam! Filtro de spam en los mensajes, sin molestias a los usuarios honestos.',
        'nospam_slogan' => 'Limitar el riesgo de spams en los foros'
 );
-
-?>
index 26587ef..0300ac7 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/nospam/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Halte au spam ! Filtrez les spams dans les messages, sans nuisance pour les utilisateurs honnêtes.',
        'nospam_slogan' => 'Limiter le risque de spams dans les forums'
 );
-
-?>
index df0949e..6e3e4ec 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Halte au spam ! Filtre les spams dans les messages, sans nuisance pour les utilisateurs honnêtes.',
        'nospam_slogan' => 'Limiter le risque de spams dans les forums'
 );
-
-?>
index 5ff1571..0c9a80e 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Stop SPAM! Filter berichten zonder oprechte gebruikers ermee lastig te vallen.',
        'nospam_slogan' => 'Beperk het risico van SPAM in forums'
 );
-
-?>
index d290e9d..2db3ef0 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-nospam?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'nospam_description' => 'Zastavte spam! Filtrujte spam v príspevkoch bez toho, aby ste si pohnevali čestných používateľov.',
        'nospam_slogan' => 'Obmedzí nebezpečenstvo spamov v diskusných fórach'
 );
-
-?>
index 853b4d3..9aae6d8 100644 (file)
@@ -81,9 +81,60 @@ function nospam_verifier_formulaire_forum_dist($flux){
                }
 
 
-               if (isset($flux['data']['texte']))
+               // si il y a une erreur, pas de previsu, on reste bloque a la premiere etape
+               if (isset($flux['data']['texte'])){
                        unset($flux['data']['previsu']);
+               }
+               // sinon, si on est au moment du post final (confirmation apres previsu => pas de previsu ni d'erreur)
+               // on calcule la "popuparlite de post"
+               elseif(!count($flux['data'])) {
+                       $now = $_SERVER['REQUEST_TIME'];
+                       // calculer la "popularite" des POST forums et forums avec liens
+                       if (!isset($GLOBALS['meta']['nospam_pop_forum_post'])) $GLOBALS['meta']['nospam_pop_forum_post'] = 0;
+                       if (!isset($GLOBALS['meta']['nospam_pop_forum_postwlink'])) $GLOBALS['meta']['nospam_pop_forum_postwlink'] = 0;
+                       if (!isset($GLOBALS['meta']['nospam_pop_date'])) $GLOBALS['meta']['nospam_pop_date'] = date('Y-m-d H:i:s',$now);
+
+                       $duree = max($now-strtotime($GLOBALS['meta']['nospam_pop_date']),1);
+                       list($a,$b) = nospam_popularite_constantes($duree);
+                       spip_log("Pop forum : $duree, $a, $b","nospam");
+                       // decrementer
+                       if ($duree>1800){
+                               $GLOBALS['meta']['nospam_pop_date'] = date('Y-m-d H:i:s',$now);
+                               $GLOBALS['meta']['nospam_pop_forum_post'] = round(floatval($GLOBALS['meta']['nospam_pop_forum_post'])*$a,2);
+                               $GLOBALS['meta']['nospam_pop_forum_postwlink'] = round(floatval($GLOBALS['meta']['nospam_pop_forum_postwlink'])*$a,2);
+                               spip_log("Pop Decremente : ".$GLOBALS['meta']['nospam_pop_forum_post'].", ".$GLOBALS['meta']['nospam_pop_forum_postwlink'],"nospam");
+                       }
+                       // incrementer
+                       $GLOBALS['meta']['nospam_pop_forum_post']=round(floatval($GLOBALS['meta']['nospam_pop_forum_post'])+$b,2);
+                       if (isset($infos['liens']) AND count($infos['liens'])){
+                               $GLOBALS['meta']['nospam_pop_forum_postwlink']=round(floatval($GLOBALS['meta']['nospam_pop_forum_postwlink'])+$b,2);
+                       }
+                       ecrire_meta("nospam_pop_forum_post",$GLOBALS['meta']['nospam_pop_forum_post']);
+                       ecrire_meta("nospam_pop_forum_postwlink",$GLOBALS['meta']['nospam_pop_forum_postwlink']);
+                       ecrire_meta("nospam_pop_date",$GLOBALS['meta']['nospam_pop_date']);
+                       spip_log("Pop Incremente : ".$GLOBALS['meta']['nospam_pop_forum_post'].", ".$GLOBALS['meta']['nospam_pop_forum_postwlink'],"nospam");
+               }
        }
 
        return $flux;
-}
\ No newline at end of file
+}
+
+//
+// Popularite, modele logarithmique
+//
+function nospam_popularite_constantes($duree){
+       // duree de demi-vie d'une visite dans le calcul de la popularite (en jours)
+       $demivie = 0.5;
+       // periode de reference en jours
+       $periode = 1;
+       // $a est le coefficient d'amortissement depuis la derniere mesure
+       $a = pow(2, - $duree / ($demivie * 24 * 3600));
+       // $b est la constante multiplicative permettant d'avoir
+       // une visite par jour (periode de reference) = un point de popularite
+       // (en regime stationnaire)
+       // or, magie des maths, ca vaut log(2) * duree journee/demi-vie
+       // si la demi-vie n'est pas trop proche de la seconde ;)
+       $b = log(2) * $periode / $demivie;
+
+       return array($a,$b);
+}
index 611acaa..47bd62e 100644 (file)
@@ -19,7 +19,7 @@ if (!defined('_SPAM_ENCRYPT_NAME')) define('_SPAM_ENCRYPT_NAME',false);
 function nospam_lister_formulaires() {
        if (!isset($GLOBALS['formulaires_no_spam']))
                $GLOBALS['formulaires_no_spam'] = array();
-       $formulaires = array_merge($GLOBALS['formulaires_no_spam'], array('forum', 'ecrire_auteur', 'signature'));
+       $formulaires = array_merge($GLOBALS['formulaires_no_spam'], array('inscription','forum', 'ecrire_auteur', 'signature', 'recommander','newsletter_subscribe','newsletter_unsubscribe'));
        return pipeline('nospam_lister_formulaires', $formulaires);
 }
 
@@ -67,16 +67,17 @@ function nospam_inserer_nobot(&$texte){
        if ((false === strpos($texte, 'name="email_nobot"'))
                AND (false !== $pos = strpos($texte, '</form>'))
        ) {
-               // essayer de s'inserer au hasard entre 2 li du form
-               if (preg_match_all(",<li\b[^>]*class=['\"]editer[^>]*,ims",$texte,$m)
-                 AND $p = strpos($texte,$m[0][rand(0,count($m[0])-1)])){
-                       $nobot = recuperer_fond("inclure/nobot", array('email_nobot' => '','div'=>'li'));
+               // essayer de s'inserer au hasard entre 2 div/li du form
+               if (preg_match_all(",<(div|li)\b[^>]*class=['\"]editer[^>]*,ims",$texte,$m)
+                       AND $i = rand(0,count($m[0])-1)
+                 AND $p = strpos($texte,$m[0][$i])){
+                       $nobot = recuperer_fond("inclure/nobot", array('email_nobot' => '','div'=>$m[1][$i]));
                        $texte = substr_replace($texte, $nobot, $p, 0);
                }
-               // et sinon a la fin
+               // et sinon a la fin juste avant la(les) balise(s) </form>
                else {
                        $nobot = recuperer_fond("inclure/nobot", array('email_nobot' => ''));
-                       $texte = substr_replace($texte, $nobot, $pos, 0);
+                       $texte = str_replace('</form>', $nobot . '</form>', $texte);
                }
        }
        if (_SPAM_ENCRYPT_NAME){
@@ -170,9 +171,13 @@ function nospam_formulaire_charger($flux) {
        ) {
                include_spip("inc/nospam");
                $jeton = creer_jeton($form);
+               if (!isset($flux['data']['_hidden'])) {
+                       $flux['data']['_hidden'] = "";
+               }
                $flux['data']['_hidden'] .= "<input type='hidden' name='_jeton' value='$jeton' />";
 
                if (_SPAM_ENCRYPT_NAME){
+                       $flux['data']['_hidden'] .= "<input type='hidden' name='_encrypt' value='1' />";
                        // recuperer les autosave encryptes si possible
                        if (is_array($flux['data'])
                          AND isset($flux['data']['_autosave_id'])
@@ -221,7 +226,7 @@ function nospam_formulaire_verifier($flux) {
                // si oui on les decrypte puis on relance la verif complete
                // attention, du coup verifier() est appele 2 fois dans ce cas (peut poser probleme ?)
                // donc on repasse ici une deuxieme fois, et il ne faut pas relancer le decryptage
-               if (_SPAM_ENCRYPT_NAME AND !$deja){
+               if (_request('_encrypt') AND !$deja){
                        $deja = true;
                        $re_verifier = false;
                        foreach($_POST as $k=>$v){
@@ -244,8 +249,14 @@ function nospam_formulaire_verifier($flux) {
                                return $flux;
                        }
                }
+               // si l'encrypt a ete active depuis l'affichage initial de ce form, on rebalance l'erreur technique
+               // pour reforcer un POST
+               if (_SPAM_ENCRYPT_NAME AND !_request('_encrypt')){
+                       spip_log('SPAM_ENCRYPT_NAME active mais _encrypt manquant','nospam');
+                       $flux['data']['message_erreur'] = _T('nospam:erreur_jeton');
+               }
                // le jeton prend en compte l'heure et l'ip de l'internaute
-               if (_request('nobot') // trop facile !
+               elseif (_request('nobot') // trop facile !
                        OR _request('email_nobot')
                        OR (!verifier_jeton($jeton, $form))
                ) {
@@ -571,4 +582,4 @@ function nospam_check_ip_status($ip){
        }
        return "ok";
 }
-?>
\ No newline at end of file
+?>
index 5b4d1db..ff231c6 100644 (file)
@@ -1,9 +1,9 @@
 <paquet
        prefix="nospam"
        categorie="performance"
-       version="1.5.6"
+       version="1.5.15"
        etat="stable"
-       compatibilite="[2.0.0;3.0.*]"
+       compatibilite="[2.0.0;3.1.*]"
        logo="images/nospam-32.png"
        documentation="http://contrib.spip.net/NoSPAM,1165"
 >      
@@ -22,4 +22,4 @@
        <pipeline nom="formulaire_charger" inclure="nospam_pipelines.php" />
        <pipeline nom="formulaire_verifier" inclure="nospam_pipelines.php" />
        <pipeline nom="nospam_lister_formulaires" action="" />
-</paquet>
\ No newline at end of file
+</paquet>
index 3fe3164..a085e00 100644 (file)
@@ -9,7 +9,7 @@
        <auteur>Cedric Morin pour [Yterium->htpp://www.yterium.net], Superyms (Traduction)</auteur>
        <icon>images/nospam-32.png</icon>
        <licence>(c) 2008 GPL</licence>
-       <version>1.5.6</version>
+       <version>1.5.15</version>
        <etat>stable</etat>
        <description><multi>
        [fr]Halte au spam ! Filtrez les spams dans les messages, sans nuisance pour les utilisateurs honn&#234;tes.
@@ -41,5 +41,5 @@
                <action></action>
        </pipeline>
        <categorie>performance</categorie>
-       <necessite id="SPIP" version="[2.0.0;3.0.99]" />
-</plugin>
\ No newline at end of file
+       <necessite id="SPIP" version="[2.0.0;3.1.99]" />
+</plugin>
index 5902ddc..8e6a8ba 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/nospam
-Revision: 84645
-Dernier commit: 2014-09-15 05:41:28 +0200 
+Revision: 99164
+Dernier commit: 2016-08-14 14:04:02 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/nospam</origine>
-<revision>84645</revision>
-<commit>2014-09-15 05:41:28 +0200 </commit>
+<revision>99164</revision>
+<commit>2016-08-14 14:04:02 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index ae648a3..30b8f7e 100644 (file)
@@ -178,5 +178,5 @@ function notifications_where_abo($email, $id_auteur=null){
        if ($id_auteur)
                $where[] = "(notification_email=".sql_quote('')." AND email_auteur=".sql_quote('')." AND id_auteur=".intval($id_auteur).")";
 
-       return implode(" OR ",$where);
+       return "(".implode(" OR ",$where).")";
 }
\ No newline at end of file
index 1e60df5..d44b229 100644 (file)
                                                                <label for="prevenir_auteurs_articles"><:notifications:article_prive_auteurs:></label>
                                                        </div>
                                                </li>
+                                               <li class="editer editer_prevenir_auteurs_articles_refus">
+                                                       <div class="choix">
+                                                               <input type="checkbox" name="prevenir_auteurs_articles_refus"[(#ENV{prevenir_auteurs_articles_refus}|=={on}|oui)checked="checked"] id="prevenir_auteurs_articles_refus" class="checkbox" />
+                                                               <label for="prevenir_auteurs_articles_refus"><:notifications:article_prive_auteurs_refus:></label>
+                                                       </div>
+                                               </li>
+                                               <li class="editer editer_pas_prevenir_publieur">
+                                                       <div class="choix">
+                                                               <input type="checkbox" name="pas_prevenir_publieur"[(#ENV{pas_prevenir_publieur}|=={on}|oui)checked="checked"] id="pas_prevenir_publieur" class="checkbox" />
+                                                               <label for="pas_prevenir_publieur"><:notifications:article_prive_publieur:></label>
+                                                       </div>
+                                               </li>
                                                <li class="editer editer_prevenir_admins_restreints">
                                                        <div class="choix">
                                                                <input type="checkbox" name="prevenir_admins_restreints"[(#ENV{prevenir_admins_restreints}|=={on}|oui)checked="checked"] id="prevenir_admins_restreints" class="checkbox" />
@@ -51,7 +63,7 @@
                                                <li class="editer editer_forum_article">
                                                        <div class="choix">
                                                                <input type="checkbox" name="forum_article"[(#ENV{forum_article}|=={on}|oui)checked="checked"] id="forum_article" class="checkbox" />
-                                                               <label for="thread_forum"><:notifications:forums_public_article:></label>
+                                                               <label for="forum_article"><:notifications:forums_public_article:></label>
                                                        </div>
                                                </li>
                                                <li class="editer editer_moderateurs_forum">
                                                        <input type="text" name="moderateurs_forum" value="[(#ENV{moderateurs_forum}|entites_html)]" id="moderateurs_forum" class="text" />
                                                        <p class="explication"><:notifications:forums_public_a_noter:></p>
                                                </li>
+                                               <li class="editer editer_forums_admins_restreints">
+                                                       <div class="choix">
+                                                               <input type="checkbox" name="forums_admins_restreints"[(#ENV{forums_admins_restreints}|=={on}|oui)checked="checked"] id="forums_admins_restreints" class="checkbox" />
+                                                               <label for="forums_admins_restreints"><:notifications:forums_admins_restreints:></label>
+                                                       </div>
+                                               </li>
+                                               <li class='editer editer_forums_limiter_rubriques'>
+                                                       <label for="limiter_rubriques"><:notifications:forums_limiter_rubriques_label:></label>
+                                                       <p class="explication"><:notifications:forums_limiter_rubriques_explication:></p>
+                                                       <input type="text" name="forums_limiter_rubriques" value="[(#ENV{forums_limiter_rubriques}|entites_html)]" id="forums_limiter_rubriques" class="text" />
+                                               </li>
+                                               <li class="editer editer_forums_public_liste">
+                                                       <div class="choix">
+                                                       <label for="forums_public_liste"><:notifications:forums_public_liste:></label>
+                                                       <input type="text" name="forums_liste" value="[(#ENV{forums_liste}|entites_html)]" id="forums_liste" class="text" />
+                                                       </div>
+                                               </li>
                                        </ul>
                                </fieldset>
                        </li>
                </p>
        </div>
        </form>
-</div>
\ No newline at end of file
+</div>
index 6f620d7..462f387 100644 (file)
@@ -1,22 +1,27 @@
 <traduction module="notifications" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/notifications/trunk/lang/" reference="fr">
-       <langue code="en" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=en" total="82" traduits="82" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=de" total="92" traduits="92" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=en" total="92" traduits="92" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="b_b" lien="http://trad.spip.net/auteur/b_b" />
                <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+               <traducteur nom="jack31" lien="http://trad.spip.net/auteur/jack31" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=es" total="82" traduits="82" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=es" total="92" traduits="79" relire="0" modifs="5" nouveaux="8" pourcent="85.87">
                <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
                <traducteur nom="severo" lien="http://trad.spip.net/auteur/severo" />
        </langue>
-       <langue code="fa" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=fa" total="82" traduits="55" relire="0" modifs="4" nouveaux="23" pourcent="67.07">
+       <langue code="fa" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=fa" total="92" traduits="52" relire="0" modifs="7" nouveaux="33" pourcent="56.52">
                <traducteur nom="Davood Hossein" lien="http://trad.spip.net/auteur/davood-hossein" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=fr" total="82" traduits="82" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=fr" total="92" traduits="92" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="nl" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=nl" total="82" traduits="82" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=nl" total="92" traduits="92" 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/notifications?lang_cible=sk" total="82" traduits="82" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/notifications?lang_cible=sk" total="92" traduits="79" relire="0" modifs="5" nouveaux="8" pourcent="85.87">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
diff --git a/www/plugins/notifications2/lang/notifications_de.php b/www/plugins/notifications2/lang/notifications_de.php
new file mode 100644 (file)
index 0000000..63dbd2b
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // 0
+       '0' => '--------------',
+
+       // A
+       'alt_logo_conf' => 'Logo des Plugins Benachrichtigungen',
+       'article_prive' => 'Artikel veröffentlichen',
+       'article_prive_admins_restreints' => '<strong>Rubrikadmins</strong> : Rubrikadmins erhalten eine Nachricht wenn Artikel in den von ihnen verwalteten Rubriken vorgeschlagen werden. Die Einstellung für Haupt-Admins werden im <a href="?exec=configurer_interactions#suivi_edito_non">SPIP-eigenen Konfigurationsmodul</a> gemacht.',
+       'article_prive_auteurs' => '<strong>Autoren</strong> : Autoren werden benachrichtigt, wenn ihre Artikel vorgeschlagen oder gelöscht werden.',
+       'article_prive_auteurs_refus' => '<strong>Autoren</strong> : Autoren werden benachrichtigt, wenn ihre Artikel abgelehnt werden.',
+       'article_prive_publieur' => 'Autor nicht benachrichtigen, wenn er seinen Artikel selber veröffentlicht.',
+       'article_propose_detail' => 'Der Artikel "@titre@" wurde zur Veröffentlichung vorgeschlagen.',
+       'article_propose_sujet' => '[@nom_site_spip@] vorgeschlagen : @titre@',
+       'article_propose_titre' => 'Artikel vorgeschlagen
+       ---------------',
+       'article_propose_url' => 'Bitte lesen und kommentieren Sie den Artikel in seinem internen Forum.
+Sie finden ihn unter folgender Adresse:',
+       'article_publie_detail' => 'Der Artikel "@titre@" wurde von @connect_nom@ veröffentlicht.',
+       'article_publie_sujet' => '[@nom_site_spip@] VERÖFFENTLICHT : @titre@',
+       'article_publie_titre' => 'Artikel veröffentlicht
+       --------------',
+       'article_refuse_detail' => 'Der Artikel "@titre@" wurde von @connect_nom@ abgelehnt.',
+       'article_refuse_sujet' => '[@nom_site_spip@] ABGELEHNT : @titre@',
+       'article_refuse_titre' => 'Artikel abgelehnt',
+       'article_valide_date' => 'Dieser Artikel wird mit möglichen Änderungen veröffentlicht.',
+       'article_valide_detail' => 'Der Artikel "@titre@" wurde von @connect_nom@ bestätigt.',
+       'article_valide_sujet' => '[@nom_site_spip@] BESTÄTIGT : @titre@',
+       'article_valide_titre' => 'Artikel bestätigt
+       --------------',
+       'article_valide_url' => 'Bis dahin ist er unter dieser Adresse zu lesen :',
+
+       // B
+       'bouton_changer_pass' => 'Mein Passwort ändern',
+       'bouton_finir_inscription' => 'Mein Abonnement beenden',
+       'breve_propose_detail' => 'Die Meldung "@titre@" wurde zur Veröffentlichung vorgeschlagen.
+       depuis',
+       'breve_propose_sujet' => '[@nom_site_spip@] vorgeschlagen : @titre@',
+       'breve_propose_titre' => 'Meldung vorgeschlagen
+       ---------------',
+       'breve_propose_url' => 'Bitte lesen und kommentieren Sie die Meldung in ihrem internen Forum.
+Sie hat folgende Adresse :',
+       'breve_publie_detail' => 'Die Meldung "@titre@" wurde von @connect_nom@ veröffentlicht.',
+       'breve_publie_sujet' => '[@nom_site_spip@] VERÖFFENTLICHT : @titre@',
+       'breve_publie_titre' => 'Meldung veröffentlicht
+       --------------',
+
+       // E
+       'evenement_notification' => 'Folgende Ereignisse können Benachrichtigungen per Mail auslösen.',
+
+       // F
+       'form_forum_confirmer_email' => 'Bitte bestätigen Sie Ihre E-Mail-Adresse indem Sie auf die Schaltfläche klicken : ',
+       'forum_prives_auteur' => '<strong>AutAutorenurs</strong> : Autoren werden über neue Beiträge in den öffentlichen und privaten Foren ihrer Artikel benachrichtigt.',
+       'forum_prives_moderateur' => 'Geben Sie die Mailadresse des Moderators der privaten Foren an (mehrere Angaben mit Komma trennen).',
+       'forum_prives_thread' => '<strong>Diskussionsstrang</strong> (Thread) : Teilnehmer des selben Diskussionsstrangs werden über neue Beiträge informiert (privat).',
+       'forums_admins_restreints' => '<strong>Admins</strong> : Rubrikadmins erhalten Benachrichtigungen, wenn neue Nachrichten in dieser Haupt-Rubrik veröffentlicht werden.',
+       'forums_limiter_rubriques_explication' => 'Bitte geben Sie hier die ID jeder Rubrik ein, für die Sie Benachrichtigungen aktivieren wollen. Trennen Sie die Ziffern mit einem Komma : "11,26"',
+       'forums_limiter_rubriques_label' => 'Auf diese Rubriken beschränken :',
+       'forums_prives' => 'Private Foren',
+       'forums_public' => 'Öffentliche Foren',
+       'forums_public_a_noter' => 'Anmerkung : In vorab moderierten Foren werden nur die Autoren benachrichtigt, die berechtigt sind, Beiträge freizuschalten. Die anderen Empfänger erhalten eine Nachricht, wenn ein Beitrag freigeschaltet wird.',
+       'forums_public_article' => '<strong>Antwort auf Artikel</strong> : Verfasser, die öffentlich auf Artikel reagiert haben, erhalten Benachrichtigungen über Neuigkeiten im öffentlichen Forum des Artikels (geeignet für Foren ohne « Thread-Anzeige »). Über gelöschte und als SPAM markierte Beiträge wird nicht informiert,',
+       'forums_public_auteurs' => '<strong>Autoren</strong> : Autoren werden über neue Beiträge in den öffentlichen Foren ihrer Artikel benachrichtigt.',
+       'forums_public_liste' => '<strong>Zusatzadresse : </strong>Mailadresse/n (mehrere mit Komma trennen) welche über im öffentlichen Bereich veröffentlichte Beiträge informiert werden. Besonders geeignet für unmoderierte Foren.',
+       'forums_public_moderateur' => 'Geben Sie hier die Adresse des Moderators der öffentlichen Foren an (mehrere mit Komma trennen).',
+       'forums_public_thread' => '<strong>Diskussionsstrang</strong> (Thread): Teilnehmer eines Diskussionsstrangs erhalten Benachrichtigungen aus öffentlichen Foren. Gelöschte und als SPAM markierte Beiträge werden nicht berücksichtigt',
+
+       // I
+       'info_lien_publier_commentaire' => 'Beitrag veröffentlichen',
+       'info_lien_signaler_spam_commentaire' => 'Als SPAM markieren',
+       'info_lien_supprimer_commentaire' => 'Beitrag löschen',
+       'info_moderation_confirmee_off' => 'Beitrag #@id_forum@ wurde gelöscht.',
+       'info_moderation_confirmee_publie' => 'Beitrag #@id_forum@ wurde veröffentlicht.',
+       'info_moderation_confirmee_spam' => 'Beitrag #@id_forum@ wurde als SPAM markiert.',
+       'info_moderation_deja_faite' => 'Status des Beitrags #@id_forum@ wurde  auf "@statut@" gesetzt.',
+       'info_moderation_interdite' => 'Sie sind nicht berechtigt, diesen Beitrag zu moderieren.',
+       'info_moderation_lien_titre' => 'Diesen Beitrag mit dem Redaktionssystem  moderieren.',
+       'info_moderation_url_perimee' => 'Dieser Modrationslink ist nicht mehr gültig.',
+       'info_nouveau_commentaire' => 'Neuer Beitrag',
+       'inscription' => 'Anmeldung der Redakteure',
+       'inscription_admins' => 'Administratoren',
+       'inscription_explication' => 'Welche Autoren sollen über neu angemeldete Redakteure benachrichtigt werden ?',
+       'inscription_label' => 'Status',
+       'inscription_statut_aucun' => 'Kein',
+       'inscription_statut_webmestres' => 'Webmaster',
+
+       // L
+       'lien_documentation' => '<a href="http://contrib.spip.net/Notifications" class="spip_out">siehe Dokumentation</a>',
+       'limiter_rubriques_explication' => 'Geben Sie hier die IDs der Rubriken an, für die Benachrichtigungen aktiviert werden. Trennen Sie mehrer Angaben mit Komma : "11,26"',
+       'limiter_rubriques_label' => 'Auf diese Rubriken beschränken :',
+
+       // M
+       'message_a_valider' => 'Nachricht bestätigen : ',
+       'message_spam_a_confirmer' => 'SPAM bestätigen : ',
+       'message_voir_configuration' => 'Konfiguration der Benachrichtigungen anzeigen',
+       'messagerie_interne' => 'Internes Nachrichtensystem',
+       'messagerie_interne_signaler' => '<strong>Über neue private Nachrichten informieren</strong> : Aktivieren Sie diese Option, damit Redakteure per Mail über ungelesene Nachrichten im Redaktionssystem benachrichtigt werden. Das System wartet 20 Minuten bis zum Versand der Mail, damit im Redaktionssystem eingelogte Redakteure nicht mit sinnlosen Mails belästigt werden.',
+       'moderateur' => '<strong>Moderator</strong>',
+
+       // N
+       'notifications' => 'Benachrichtigungen',
+
+       // P
+       'pass_mail_passcookie_1' => 'Zur Neuanmeldung bei @nom_site_spip@, klicken Sie bitte auf die Schaltfläche : ',
+       'pass_mail_passcookie_2' => 'Sie können dann ein neues Passwort eingeben, und sich wieder einloggen.',
+
+       // S
+       'signature_petition' => 'Petition/Unterschriften',
+       'signature_petition_moderateur' => 'Geben Sie hier die Mailadresse des Moderators für Petitionen ein (mehrere Adressen mit Komma trennen).',
+       'suivi_texte_acces_page' => 'Meine Abonnements und Diskussionen ändern',
+       'suivis_perso' => 'Personalisierte Benachrichtigungen',
+       'suivis_perso_activer_option' => 'Wenn Sie diese Option aktivieren, wird jeder Besucher, der sich mit diesem Benachrichtigungslink anmeldet, in der Tabelle <code>spip_auteurs</code> als  <code>6visiteur</code> eingetragen. Er kann dann alle von ihm signierten Forumsbeiträge sehen, seine Einstellungen zu Benachrichtigungen ändern u.s.w.',
+       'suivis_perso_non' => 'Keine Benachrichtigungen',
+       'suivis_perso_oui' => 'Benachrichtigungen aktiviert',
+       'suivis_perso_url_suivis' => 'In jede Email einen <strong>personalisierten Benachrichtigungs-URL</strong> einfügen. Unter diesem URL können Benutzer ihre individuellen Einstellungen für Benachrichtigungen wählen.',
+       'suivis_public_article_thread' => 'TODO : jeden Artikel/Thread mit eigener Checkbox versehen',
+       'suivis_public_changer_email' => 'TODO : Email ändern',
+       'suivis_public_description' => 'Hier können Sie (nach Fertigstellung der Funktionen...) alle Ihre Forenbeiträge einsehen, einen RSS-Stream der Beiträge dazu abonnieren, Ihre Benachrichtigungseinstellungen ändern, u.s.w.',
+       'suivis_public_notif_desactiver' => 'TODO : Checkbox zum Abbestellen der Benachrichtigungen',
+       'suivis_public_vos_forums' => 'Ihre Foren',
+       'suivis_public_vos_forums_date' => 'Ihre Foren nach Datum',
+       'suivis_public_votre_page' => 'Die ist Ihre persönliche Seite zu Benachrichtigungen',
+
+       // T
+       'titre_moderation' => 'Moderation'
+);
index f0b77c3..c441b27 100644 (file)
@@ -3,15 +3,24 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // 0
+       '0' => '--------------',
+
        // A
        'alt_logo_conf' => 'Notifications plugin logo',
        'article_prive' => 'Articles publishing',
-       'article_prive_admins_restreints' => '<strong>Administrators</strong>: Administrators get notified when article(s) is(are) proposed in their section',
+       'article_prive_admins_restreints' => '<strong>Restricted Administrators</strong>: Restricted Administrators get notified when article(s) is(are) proposed in their section.
+For General Administrators see
+ <a href="?exec=configurer_interactions#suivi_edito_non">default tool of SPIP</a>.',
        'article_prive_auteurs' => '<strong>Authors</strong>: Authors get notified when their article(s) is(are) proposed, published or deleted.',
+       'article_prive_auteurs_refus' => '<strong>Authors</strong> : authors receive notifications when the publications of their(s) article(s) is rejected.',
+       'article_prive_publieur' => 'If one of the authors is the one publishing the article he will not be notified.',
        'article_propose_detail' => 'The article "@titre@" is submitted for publication.',
        'article_propose_sujet' => '[@nom_site_spip@] Submitted: @titre@',
        'article_propose_titre' => 'Article submitted
@@ -22,6 +31,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'article_publie_sujet' => '[@nom_site_spip@] PUBLISHED: @titre@',
        'article_publie_titre' => 'Article published
        --------------',
+       'article_refuse_detail' => 'The article "@titre@" has been rejected by @connect_nom@.',
+       'article_refuse_sujet' => '[@nom_site_spip@] REJECTED: @titre@',
+       'article_refuse_titre' => 'Article rejected',
        'article_valide_date' => 'Without change, this article will be published',
        'article_valide_detail' => 'The article "@titre@" is validated by @connect_nom@.',
        'article_valide_sujet' => '[@nom_site_spip@] VALIDATED: @titre@',
@@ -51,13 +63,18 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'forum_prives_auteur' => '<strong>Authors</strong>: Authors get notified when comments are posted to their article(s) or comment(s) on the private area.',
        'forum_prives_moderateur' => 'Please indicate the moderator’s email address for private forums, (comma-separated in case of multiple addresses).',
        'forum_prives_thread' => '<strong>Forum thread</strong>: Posters to the same thread get notified when a new comment is posted to the (private) thread.',
+       'forums_admins_restreints' => '<strong>Administrators</strong> : 
+Restricted administrators get notified when new posts are published in the sector.',
+       'forums_limiter_rubriques_explication' => 'Specify the identifiers of each section where you want to activate the notifications, separated with a comma. example: "11,26"',
+       'forums_limiter_rubriques_label' => 'Limit to these sections:',
        'forums_prives' => 'Forums in private area',
        'forums_public' => 'Public forums',
        'forums_public_a_noter' => 'Note: if forums are awaiting validation from moderators before publication, only authors with rights to validate forums get notified when the comment is posted ; other recipients get notified only when moderators validate the comment.',
-       'forums_public_article' => '<strong>Reply to an article</strong>: persons who have publicly replied to an article will receive forum notifications for that article (useful for «flat»  forums).',
+       'forums_public_article' => '<strong>Reply to an article</strong>: persons who have publicly replied to an article will receive forum notifications for that article (useful for «flat»  forums). Posts tagged as deleted or spam will be excluded.',
        'forums_public_auteurs' => '<strong>Authors</strong>: Authors get notified when new comments are posted to their article(s) on the public area.',
+       'forums_public_liste' => '<strong>additional adress: </strong> an email adress which will receive the posts publicly published  (or several separated by commas), useful for example for non-moderated forums.',
        'forums_public_moderateur' => 'Please indicate the moderator’s email address for public forums, (comma-separated in case of multiple addresses).',
-       'forums_public_thread' => '<strong>Forum thread</strong>: Posters to the same thread get notified when a new comment is posted to the (public) thread.',
+       'forums_public_thread' => '<strong>Forum thread</strong>: Posters to the same thread get notified when a new comment is posted to the (public) thread. Posts tagged as deleted or spam are excluded.',
 
        // I
        'info_lien_publier_commentaire' => 'Publish this comment online',
@@ -118,5 +135,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // T
        'titre_moderation' => 'Moderation'
 );
-
-?>
index ce27a42..bd9cf14 100644 (file)
@@ -3,18 +3,20 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // A
        'alt_logo_conf' => 'Logo del plugin Notificaciones',
        'article_prive' => 'Publicación de artículos',
-       'article_prive_admins_restreints' => '<strong>Administradores</strong>: Los administradores -limitados- reciben notificaciones cuando llegan propuestas de artículos a su sección',
-       'article_prive_auteurs' => '<strong>Autores</strong>: los autores reciben notificaciones cuando su(s) artículo(s) son propuestos, publicados o eliminados',
+       'article_prive_admins_restreints' => '<strong>Administradores</strong>: Los administradores -limitados- reciben notificaciones cuando llegan propuestas de artículos a su sección', # MODIF
+       'article_prive_auteurs' => '<strong>Autores</strong>: los autores reciben notificaciones cuando su(s) artículo(s) son propuestos, publicados o eliminados', # MODIF
        'article_propose_detail' => 'El artículo "@titre@" ha sido propuesto para publicación
        desde',
-       'article_propose_sujet' => '[@nom_site_spip@] Propone: @titre@',
+       'article_propose_sujet' => '[@nom_site_spip@] Propone: @titre@', # MODIF
        'article_propose_titre' => 'Artículo propuesto
        ---------------',
        'article_propose_url' => 'Le invitamos a consultarlo y a dar su opinión en el foro asociado. El mismo está disponible en la dirección:',
@@ -51,13 +53,15 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'forum_prives_auteur' => '<strong>Autores</strong>: los autores reciben notificaciones de los foros derivados de sus artículos o de sus mensajes en el sitio privado. ',
        'forum_prives_moderateur' => 'Indique a continuación el correo electrónico del moderador de los foros privados (si son varios, separe con comas).',
        'forum_prives_thread' => '<strong>Hilo de discusión</strong>: los participantes de un mismo hilo de discusión reciben notificaciones de los foros (privados).',
+       'forums_limiter_rubriques_explication' => 'Especifique aquí los identificadores de cada sección donde quiere activar las notificaciones, separados por una coma. Por ej. "11,26"',
+       'forums_limiter_rubriques_label' => 'Limitar a estas secciones:',
        'forums_prives' => 'Foros privados',
        'forums_public' => 'Foros públicos',
        'forums_public_a_noter' => 'Nota: en el caso de los foros moderados a priori, sólo aquellos autores que tienen derecho de aprobar los foros son notificados cuando se crea un foro; los otros destinatarios son notificados cuando el mensaje ha sido aprobado por el moderador.',
-       'forums_public_article' => '<strong>Respuesta al artículo</strong>: las personas que hayan respondido públicamente al artículos reciben notificaciones de los foros (públicos) del artículo (útil para los foros «planos»).',
+       'forums_public_article' => '<strong>Respuesta al artículo</strong>: las personas que hayan respondido públicamente al artículos reciben notificaciones de los foros (públicos) del artículo (útil para los foros «planos»).', # MODIF
        'forums_public_auteurs' => '<strong>Autores</strong>: los autores reciben notificaciones de aquellos foros derivados de sus artículos en en el sitio públicos.',
        'forums_public_moderateur' => 'Indique a continuación el correo electrónico del moderador de los foros públicos (si son varios, separe con comas).',
-       'forums_public_thread' => '<strong>Hilo de discusión</strong>: los participantes de un mismo hilo de discusión reciben notificaciones de los foros (públicos).',
+       'forums_public_thread' => '<strong>Hilo de discusión</strong>: los participantes de un mismo hilo de discusión reciben notificaciones de los foros (públicos).', # MODIF
 
        // I
        'info_lien_publier_commentaire' => 'Publicar este comentario',
@@ -118,5 +122,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // T
        'titre_moderation' => 'Moderación'
 );
-
-?>
index 9579d52..cc0e4b1 100644 (file)
@@ -3,17 +3,19 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // A
        'alt_logo_conf' => 'لوگوي پلاگين اطلاعيه‌ها',
        'article_prive' => 'نشر مقاله‌ها',
-       'article_prive_admins_restreints' => '<strong>ادمين‌ها </strong> : ادمين‌ها وقتي مقاله‌ها داخل بخش‌ آن‌ها پيشنهاد شود با خبر خواهند شد',
+       'article_prive_admins_restreints' => '<strong>ادمين‌ها </strong> : ادمين‌ها وقتي مقاله‌ها داخل بخش‌ آن‌ها پيشنهاد شود با خبر خواهند شد', # MODIF
        'article_prive_auteurs' => '<strong>نويسندگان</strong> :نويسندگان هنگام نشر مقاله‌ (ها) با خبر مي‌شوند', # MODIF
        'article_propose_detail' => 'مقاله "@titre@" براي نشر پيشنهاد شده',
-       'article_propose_sujet' => '[@nom_site_spip@] پيشنهاد شده: @titre@',
+       'article_propose_sujet' => '[@nom_site_spip@] پيشنهاد شده: @titre@', # MODIF
        'article_propose_titre' => 'مقاله پيشنهادي
        ---------------',
        'article_propose_url' => 'دعوت مي‌شويد كه در فرم پيوست مشورت و نظر خود را اعلام كنيد. اين فرم در اين شناني در دسترس است: ',
@@ -52,7 +54,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 ',
        'forums_public_auteurs' => '<strong>نويسندگان</strong>: نويسندگان اطلاعيه‌هايي در سخنگاه‌هاي پست شده روي مقاله‌هايشان در سايت همگاني دريافت مي‌كنند.',
        'forums_public_moderateur' => 'در زير نشاني ايميل گرداننده‌ (يا گردانندگان - جدا شده با ويرگول) سخنگاههاي عمومي  را قيد كنند.', # MODIF
-       'forums_public_thread' => '<strong>خط گفتگو</strong>: شركت‌كنندگان در همان خط گفتگو اطلاعيه‌هايي از سخنگاه‌ها (همگاني) دريافت مي‌كنند.',
+       'forums_public_thread' => '<strong>خط گفتگو</strong>: شركت‌كنندگان در همان خط گفتگو اطلاعيه‌هايي از سخنگاه‌ها (همگاني) دريافت مي‌كنند.', # MODIF
 
        // I
        'inscription' => 'ثبت سردبيران',
@@ -92,5 +94,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'suivis_public_vos_forums_date' => 'سخنگاه‌هاي شما، به ترتيب تاريخ',
        'suivis_public_votre_page' => 'اين صفحه‌ي شخصي شما براي پيگيري سايت است'
 );
-
-?>
index dfce2ed..9447e22 100644 (file)
@@ -1,18 +1,25 @@
 <?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_/notifications/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // 0
+       '0' => '--------------',
+
        // A
        'alt_logo_conf' => 'Logo du plugin Notifications',
        'article_prive' => 'Publication d’articles',
-       'article_prive_admins_restreints' => '<strong>Administrateurs</strong> : Les administrateurs restreints reçoivent les notifications lors de proposition d’articles dans leur rubrique',
-       'article_prive_auteurs' => '<strong>Auteurs</strong> : les auteurs reçoivent les notifications lors de la proposition,publication ou suppression de leur(s) article(s)',
+       'article_prive_admins_restreints' => '<strong>Administrateurs restreints</strong> : Les administrateurs restreints reçoivent les notifications lors de proposition d’articles dans leur rubrique. Pour les administrateurs généralistes, voir <a href="?exec=configurer_interactions#suivi_edito_non">l’outil par défaut de SPIP</a>.',
+       'article_prive_auteurs' => '<strong>Auteurs</strong> : les auteurs reçoivent les notifications lors de la proposition, publication ou suppression de leur(s) article(s).',
+       'article_prive_auteurs_refus' => '<strong>Auteurs</strong> : les auteurs reçoivent les notifications lors du refus de publications de leur(s) article(s).',
+       'article_prive_publieur' => 'Si l’un des auteurs est celui qui publie l’article, ne pas le prévenir.',
        'article_propose_detail' => 'L’article "@titre@" est proposé à la publication
        depuis',
-       'article_propose_sujet' => '[@nom_site_spip@] Propose : @titre@',
+       'article_propose_sujet' => '[@nom_site_spip@] Proposé : @titre@',
        'article_propose_titre' => 'Article proposé
        ---------------',
        'article_propose_url' => 'Vous êtes invité à venir le consulter et à donner votre opinion
@@ -21,6 +28,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'article_publie_sujet' => '[@nom_site_spip@] PUBLIE : @titre@',
        'article_publie_titre' => 'Article publié
        --------------',
+       'article_refuse_detail' => 'L’article "@titre@" vient d’être refusé par @connect_nom@.',
+       'article_refuse_sujet' => '[@nom_site_spip@] REFUSE : @titre@',
+       'article_refuse_titre' => 'Article refusé',
        'article_valide_date' => 'Sous réserve de changement, cet article sera publié',
        'article_valide_detail' => 'L’article "@titre@" a été validé par @connect_nom@.',
        'article_valide_sujet' => '[@nom_site_spip@] VALIDE : @titre@',
@@ -51,13 +61,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'forum_prives_auteur' => '<strong>Auteurs</strong> : les auteurs reçoivent les notifications des forums postés sous leurs articles ou leurs messages dans le site privé.',
        'forum_prives_moderateur' => 'Indiquez ci-dessous l’adresse email du modérateur des forums privés (ou plusieurs, séparées par des virgules).',
        'forum_prives_thread' => '<strong>Fil de discussion</strong> : les participants au même fil de discussion reçoivent les notifications des forums (privés).',
+       'forums_admins_restreints' => '<strong>Administrateurs</strong> : les administrateurs  restreints reçoivent les notifications lors de nouveaux messages publiés sur la branche.',
+       'forums_limiter_rubriques_explication' => 'Renseignez ici les identifiants de chaque rubrique où vous voulez déclencher les notifications, séparé par une virgule. ex : "11,26"',
+       'forums_limiter_rubriques_label' => 'Limiter à ces rubriques :',
        'forums_prives' => 'Forums privés',
        'forums_public' => 'Forums publics',
        'forums_public_a_noter' => 'À noter : dans le cas des forums modérés à priori, seuls les auteurs ayant le droit de valider les forums sont notifiés lors de l’envoi du forum ; les autres destinataires sont notifiés lors de la validation du message par le modérateur.',
-       'forums_public_article' => '<strong>Réponse à l’article</strong> : les personnes ayant répondu publiquement à l’article recoivent les notifications des forums (publics) de l’article (utile pour les forums « à plat »).',
+       'forums_public_article' => '<strong>Réponse à l’article</strong> : les personnes ayant répondu publiquement à l’article recoivent les notifications des forums (publics) de l’article (utile pour les forums « à plat »). Sont exclus les messages supprimés ou marqués comme SPAM.',
        'forums_public_auteurs' => '<strong>Auteurs</strong> : les auteurs reçoivent les notifications des forums postés sous leurs articles dans le site public.',
+       'forums_public_liste' => '<strong>Adresse supplémentaire : </strong>une adresse email qui recevra les messages publiés en public (ou plusieurs séparées par des virgules), utile par exemple pour les forums non modérés.',
        'forums_public_moderateur' => 'Indiquez ci-dessous l’adresse email du modérateur des forums publics (ou plusieurs, séparées par des virgules).',
-       'forums_public_thread' => '<strong>Fil de discussion</strong> : les participants au même fil de discussion reçoivent les notifications des forums (publics).',
+       'forums_public_thread' => '<strong>Fil de discussion</strong> : les participants au même fil de discussion reçoivent les notifications des forums (publics). Sont exclus les messages supprimés ou marqués comme SPAM.',
 
        // I
        'info_lien_publier_commentaire' => 'Publier ce commentaire',
@@ -118,5 +132,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // T
        'titre_moderation' => 'Modération'
 );
-
-?>
index 5c00156..5de07a3 100644 (file)
@@ -3,15 +3,22 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
+       // 0
+       '0' => '--------------',
+
        // A
        'alt_logo_conf' => 'Logo van plugin Notifications',
        'article_prive' => 'Publicatie van artikelen',
-       'article_prive_admins_restreints' => '<strong>Beheerders</strong>: Beperkte beheerders ontvangen notificaties bij voorstellen voor publicatie in hun rubriek',
-       'article_prive_auteurs' => '<strong>Auteurs</strong>: Auteurs ontvangen notificaties bij het voorstellen, publiceren of verwijderen van hun artikel(en)',
+       'article_prive_admins_restreints' => '<strong>Beperkte beheerders</strong>: Beperkte beheerders ontvangen notificaties bij voorstellen voor publicatie in hun rubriek. Voor algehele beheerders kijk je bij <a href="?exec=configurer_interactions#suivi_edito_non">  de standaard tool van SPIP</a>.',
+       'article_prive_auteurs' => '<strong>Auteurs</strong>: Auteurs ontvangen notificaties bij het voorstellen, publiceren of verwijderen van hun artikel(en).',
+       'article_prive_auteurs_refus' => '<strong>Auteurs</strong>: auteurs ontvangen bericht bij weigering van hun artikel(en).',
+       'article_prive_publieur' => 'Als een van de auteurs degene is die het artikel publiceert wordt geen bericht gestuurd.',
        'article_propose_detail' => 'Artikel "@titre@" is ter publicatie voorgesteld sinds',
        'article_propose_sujet' => '[@nom_site_spip@] Stelt voor: @titre@',
        'article_propose_titre' => 'Voorgesteld artikel
@@ -22,6 +29,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'article_publie_sujet' => '[@nom_site_spip@] GEPUBLICEERD: @titre@',
        'article_publie_titre' => 'Gepubliceerd artikel
        --------------------',
+       'article_refuse_detail' => 'Artikel "@titre@" wordt geweigerd door @connect_nom@.',
+       'article_refuse_sujet' => '[@nom_site_spip@] GEWEIGERD: @titre@',
+       'article_refuse_titre' => 'Geweigerd artikel',
        'article_valide_date' => 'Onder voorbehoud van wijzigingen zal dit artikel worden gepubliceerd',
        'article_valide_detail' => 'Artikel "@titre@" werd gevalideerd door @connect_nom@.',
        'article_valide_sujet' => '[@nom_site_spip@] GEVALIDEERD: @titre@',
@@ -51,13 +61,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'forum_prives_auteur' => '<strong>Auteurs</strong>: Auteurs ontvangen notificaties uit een forum dat onder hun artikel is geplaatst of van hun berichten in de privé-omgeving.',
        'forum_prives_moderateur' => 'Geef hieronder het e-mailadres van de moderator van de forums in het privé-gedeelte (of meerdere, gescheiden door een komma).',
        'forum_prives_thread' => '<strong>Draad van de discussie</strong>: deelnemers aan dezelfde discussie in het privé-forum ontvangen notificaties.',
+       'forums_admins_restreints' => '<strong>Beheerders</strong>: beperkte beheerders ontvangen berichten wanneer nieuwe berichten aan de root worden gepubliceerd.',
+       'forums_limiter_rubriques_explication' => 'Vermeld hier de identificatie van iedere rubriek waarvoor de notificaties moeten worden geactiveerd, gescheiden door een komma. bv: "11,26"',
+       'forums_limiter_rubriques_label' => 'Uitsluitend deze rubrieken:',
        'forums_prives' => 'Privé forums',
        'forums_public' => 'Publieke forums',
        'forums_public_a_noter' => 'Let op: bij een gemodeeerd forum ontvangen alleen de auteurs die mogen goedkeuren een noticifatie bij een nieuw bericht; anderen ontvangen pas een bericht na goedkeuring.',
-       'forums_public_article' => '<strong>Reactie op een artikel</strong>: personen die via de publieke site op een artikel reageren, ontvangen een notificatie (zinvol bij een "plat" forum).',
+       'forums_public_article' => '<strong>Reactie op een artikel</strong>: personen die via de publieke site op een artikel reageren, ontvangen een notificatie (zinvol bij een "plat" forum). Uitgezonderd zijn verwijderde of als SPAM aangeduide berichten.',
        'forums_public_auteurs' => '<strong>Auteurs</strong>: auteurs ontvangen notificaties van publieke forumberichten onder hun artikel.',
+       'forums_public_liste' => '<strong>Extra adres: </strong>een mailadres (of meerdere door een komma gescheiden) dat berichten over geplaatste publieke berichten ontvangt, wat bijvoorbeeld nuttig kan zijn voor een niet gemodereerd forum.',
        'forums_public_moderateur' => 'Geef hieronder het e-mailadres van de moderator van de publieke forums (of meerdere, gescheiden door een komma).',
-       'forums_public_thread' => '<strong>Draad van een discussie</strong>: deelnemers aan dezelfde publieke discussie ontvangen notificaties.',
+       'forums_public_thread' => '<strong>Draad van een discussie</strong>: deelnemers aan dezelfde publieke discussie ontvangen forumnotificaties. Uitgezonderd zijn verwijderde of als SPAM aangeduide berichten.',
 
        // I
        'info_lien_publier_commentaire' => 'Dit commentaar plaatsen',
@@ -118,5 +132,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // T
        'titre_moderation' => 'Opvolgen'
 );
-
-?>
index 1cd01e2..5ee66ad 100644 (file)
@@ -3,18 +3,20 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/notifications?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // A
        'alt_logo_conf' => 'Logo zásuvného modulu Oznamy',
        'article_prive' => 'Publikovanie článkov',
-       'article_prive_admins_restreints' => '<strong>Administrátori:</strong> administrátori s obmedzeniami dostávajú oznamy pri odoslaní článkov do ich rubriky',
-       'article_prive_auteurs' => '<strong>Autori:</strong> autori dostávajú oznamy pri odoslaní svojich článkov na schválenie, pri ich publikovaní alebo odstránení',
+       'article_prive_admins_restreints' => '<strong>Administrátori:</strong> administrátori s obmedzeniami dostávajú oznamy pri odoslaní článkov do ich rubriky', # MODIF
+       'article_prive_auteurs' => '<strong>Autori:</strong> autori dostávajú oznamy pri odoslaní svojich článkov na schválenie, pri ich publikovaní alebo odstránení', # MODIF
        'article_propose_detail' => 'Článok "@titre@" bol odoslaný na publikovanie
        z(o)',
-       'article_propose_sujet' => '[@nom_site_spip@] Odoslaný: @titre@',
+       'article_propose_sujet' => '[@nom_site_spip@] Odoslaný: @titre@', # MODIF
        'article_propose_titre' => 'Článok bol odoslaný
        ---------------',
        'article_propose_url' => 'Pozvali vás, aby ste si prečítali tento článok a svoj názor naň napísali do diskusného fóra, ktoré je k nemu pripojené. Článok nájdete na adrese:',
@@ -51,13 +53,15 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'forum_prives_auteur' => '<strong>Autori:</strong> autori dostávajú oznamy odoslané z diskusných fór pod ich článkami alebo správami v súkromnej zóne.',
        'forum_prives_moderateur' => 'Zadajte e-mailovú adresu moderátora súkromných diskusných fór (alebo viac adries, oddeľte ich čiarkami).',
        'forum_prives_thread' => '<strong>Téma:</strong> diskutujúci v rovnakom vlánke dostávajú oznami z (verejných) diskusných fór.',
+       'forums_limiter_rubriques_explication' => 'Sem zadajte identifikačné číslo každej rubriky, pre ktorú chcete spúšťať oznamy, oddeľte ich čiarkami. Napr. "11,26"',
+       'forums_limiter_rubriques_label' => 'Obmedziť na tieto rubriky:',
        'forums_prives' => 'Súkromné diskusné fóra',
        'forums_public' => 'Verejné diskusné fóra',
        'forums_public_a_noter' => 'Poznámka: v prípade, že sa príspevky do diskusných fór kontrolujú pred ich zverejnením, o odoslaní príspevkov sú informovaní iba autori, ktorí majú právo schvaľovať príspevky; ostatní sú informovaní, až keď príspevky schvália títo moderátori.',
-       'forums_public_article' => '<strong>Reakcia na článok:</strong> ľudia, ktorí verejne reagovali na článok, dostanú oznamy z–(verejných) diskusných  fór článku (je to užitočné pre jednoduché diskusné fóra).',
+       'forums_public_article' => '<strong>Reakcia na článok:</strong> ľudia, ktorí verejne reagovali na článok, dostanú oznamy z–(verejných) diskusných  fór článku (je to užitočné pre jednoduché diskusné fóra).', # MODIF
        'forums_public_auteurs' => '<strong>Autori:</strong> autori dostávajú oznamy odoslané z diskusných fór pod ich článkami na verejne prístupnej stránke.',
        'forums_public_moderateur' => 'Zadajte e-mailovú adresu moderátora verejných diskusných fór (alebo viac adries, oddeľte ich čiarkami).',
-       'forums_public_thread' => '<strong>Téma:</strong> diskutujúci v rovnakom vlákne dostávajú oznamy z (verejných) diskusných fór.',
+       'forums_public_thread' => '<strong>Téma:</strong> diskutujúci v rovnakom vlákne dostávajú oznamy z (verejných) diskusných fór.', # MODIF
 
        // I
        'info_lien_publier_commentaire' => 'Publikovať tento komentár',
@@ -118,5 +122,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // T
        'titre_moderation' => 'Kontrola'
 );
-
-?>
index ce0ff78..1cb70c3 100644 (file)
@@ -1,4 +1,7 @@
 <traduction module="paquet-notifications" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/notifications/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=de" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=en" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
diff --git a/www/plugins/notifications2/lang/paquet-notifications_de.php b/www/plugins/notifications2/lang/paquet-notifications_de.php
new file mode 100644 (file)
index 0000000..10d16ea
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // N
+       'notifications_description' => 'Aktiviert Mail-Benachrichtigungen über bestimmte Ereignisse speziell in Foren und dem internen Nachrichtensystem. Autoren können über die Veröffentlichung ihrer Artikel informiert werden.',
+       'notifications_slogan' => 'Benachrichtigungsmails senden'
+);
index 1123b68..b445b7f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'notifications_description' => 'Sends mail notifications for certain actions : forums posts and answers notified to users, private messages notified to redactors or articles publication notified to their authors.',
        'notifications_slogan' => 'Report changes by mail '
 );
-
-?>
index be7e54e..ec0a86e 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'notifications_description' => 'Activa las notificaciones por correo electrónico de ciertas acciones, incluyendo las referidas a foros y mensajería del espacio privado. Permite igualmente el envío de un correo electrónico a los autores cuando sus artículos son publicados.',
        'notifications_slogan' => 'Advertir por correo electrónico de las modificaciones'
 );
-
-?>
index fa79a73..9b8b1ed 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 ',
        'notifications_slogan' => 'خبردهي از اصلاحات با ايميل'
 );
-
-?>
index f222b32..2d99e7d 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/notifications/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'notifications_description' => 'Active les notifications par email de certaines actions, notamment des forums et de la messagerie de l’espace privé, permet également l’envoi d’un mail aux auteurs lors de la publication de leurs articles.',
        'notifications_slogan' => 'Signaler par mail des modifications'
 );
-
-?>
index f31c7cd..bf818b1 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'notifications_description' => 'Notificatie per email wanneer bepaalde handelingen worden verricht, zoals in het forum of het privé berichtensysteem. Ook kan een email naar auteurs worden gestuurd bij publicatie van hun artikelen.',
        'notifications_slogan' => 'Berichten per email over aanpassingen'
 );
-
-?>
index d4b7d46..df79da7 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-notifications?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'notifications_description' => 'Aktivuje oznamy e-mailom pri určitých akciách, vrátane diskusných fór a odkazovača v súkromnej zóne, ako aj odoslania e-mailov autorom pri publikovaní ich článkov.',
        'notifications_slogan' => 'Oznámiť zmeny e-mailom'
 );
-
-?>
diff --git a/www/plugins/notifications2/notifications/article_refuse.html b/www/plugins/notifications2/notifications/article_refuse.html
new file mode 100644 (file)
index 0000000..4cb7936
--- /dev/null
@@ -0,0 +1,25 @@
+[(#REM)
+
+  Squelette
+  (c) 2009 SPIP
+  Distribue sous licence GPL
+
+]
+<BOUCLE_art(ARTICLES){id_article}{statut?}{tout}>
+#SET{auteurs,#LESAUTEURS}
+<title>[(#VAL{notifications:article_refuse_sujet}|_T{#ARRAY{nom_site_spip,#NOM_SITE_SPIP,titre,#TITRE}}|nettoyer_titre_email)]</title>
+
+<body>
+<div class="header">
+<h1><:notifications:article_refuse_titre|trim|trim{-}:></h1>
+<p>
+[(#SET{titre,[<a href="[(#URL_ARTICLE|url_absolue)]"><strong>(#TITRE)</strong></a>]})]
+[(#VAL{notifications:article_refuse_detail}|_T{#ARRAY{titre,#GET{titre},connect_nom,#SESSION{nom}}})]
+</p>
+<hr />
+</div>
+
+<INCLURE{fond=notifications/inc-article,id_article} />
+</body>
+</BOUCLE_art>
+#FILTRE{facteur_email_wrap_to_html}
index 40af3e5..878718e 100644 (file)
@@ -13,7 +13,7 @@ Mail HTML simplifie mis en forme complete par le filtre |facteur_email_wrap_to_h
                [<p><strong><:forum:titre_cadre_forum_interne:></strong></p>(#STATUT|=={privrac}|oui)]
                [<p><strong><:forum:titre_cadre_forum_administrateur:></strong></p>(#STATUT|=={priadm}|oui)]
                [
-               (#ENV{par_auteur})
+               (#ENV{indiquer_email_auteur,oui}|=={non}|?{#ENV{par_auteur}|replace{'&lt;.+&gt; ','','U'},#ENV{par_auteur}})
                <br />]
                [<a href="(#ENV{url_site})">[(#NOM_SITE|sinon{#ENV{url_site}})]</a>]
                <hr/>
index c7a1a47..994f880 100644 (file)
@@ -62,6 +62,48 @@ function notifications_forumvalide_dist($quoi, $id_forum, $options) {
                        }
                }
        }
+\r
+\r
+// Prevenir les admins restreints de la rubrique et des parentes  lors de messages de forum d'article ou de rubrique\r
+// c'est ici because dans notifications_pipelines la fonction de dédoublonnage le fait sauter (?)\r
+\r
+if ($GLOBALS['notifications']['forums_admins_restreints']) {\r
+         if ($t['objet']=='rubrique'){\r
+         $id_rubrique = $t['id_objet'];\r
+         }\r
+         if ($t['objet']=='article'){\r
+         include_spip('base/abstract_sql');\r
+         $t = sql_fetsel("id_rubrique", "spip_articles", "id_article=" . intval($t['id_objet']));\r
+         $id_rubrique = $t['id_rubrique'];\r
+         }\r
+         if ($GLOBALS['notifications']['forums_limiter_rubriques']){\r
+             $limites = $GLOBALS['notifications']['forums_limiter_rubriques'];\r
+             $forums_limiter_rubriques = explode(",",$limites);\r
+     } else {\r
+             $forums_limiter_rubriques = array($id_rubrique);\r
+         }\r
+         if (in_array($id_rubrique,$forums_limiter_rubriques)){\r
+             while ($id_rubrique){\r
+                 $hierarchie[] = $id_rubrique;\r
+                 $res = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_rubrique));\r
+                 if (!$res){ // rubrique inexistante\r
+                     $id_rubrique = 0;\r
+                     break;\r
+                 }\r
+                 $id_parent = $res['id_parent'];\r
+                 $id_rubrique = $id_parent;\r
+             }\r
+             //les admins de la rub et de ses parents\r
+             $result = sql_select(\r
+                 "auteurs.email,auteurs.id_auteur,lien.id_objet as id_rubrique",\r
+                 "spip_auteurs AS auteurs JOIN spip_auteurs_liens AS lien ON auteurs.id_auteur=lien.id_auteur ",\r
+                 "lien.objet='rubrique' AND ".sql_in('lien.id_objet',sql_quote($hierarchie))." AND auteurs.statut='0minirezo'");\r
+         while ($qui = sql_fetch($result)) {\r
+                     $tous[] = $qui['email'];\r
+             }\r
+         }\r
+     }\r
+/////////////////////////////\r
 
        $options['forum'] = $t;
        $destinataires = pipeline('notifications_destinataires',
@@ -80,10 +122,38 @@ function notifications_forumvalide_dist($quoi, $id_forum, $options) {
        //
        $email_notification_forum = charger_fonction('email_notification_forum','inc');
        foreach ($destinataires as $email) {
-               $contexte = array('notification_email'=>$email);
+               $contexte = array('notification_email'=>$email,'indiquer_email_auteur'=>'non');
                $texte = $email_notification_forum($t, $email, $contexte);
                notifications_envoyer_mails_texte_ou_html($email, $texte);
-       }
+       }\r
+\r
+// une liste d'adresses renseignées dans config possiblement liste de diffusion\r
+       if ($GLOBALS['notifications']['forums_liste']){\r
+\r
+       //construction du mail  pour envoyer_mail\r
+       $titre="$t[titre]";\r
+       $sujet=""._T('forum:info_1_message_forum')." '$titre'";\r
+       $charset = lire_meta('charset');\r
+\r
+       if ($GLOBALS['meta']['facteur_adresse_envoi'] == 'oui' 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' AND $GLOBALS['meta']['facteur_adresse_envoi_nom'])\r
+               $from_nom = $GLOBALS['meta']['facteur_adresse_envoi_nom'];\r
+\r
+       foreach (explode(',', $GLOBALS['notifications']['forums_liste']) as $to_email) {\r
+               $email_notification_forum = charger_fonction('email_notification_forum','inc');\r
+               $body = $email_notification_forum($t, $to_email);\r
+               include_spip('classes/facteur');\r
+               $body = Facteur::html2text($body);\r
+               $envoyer_mail = charger_fonction('envoyer_mail','inc/');\r
+               $envoyer_mail($to_email, $sujet, $body, $from_email, $headers);\r
+               }\r
+       } \r
+///////////////////////////\r
+
 
 }
 
index bd4b7c3..183ee9b 100644 (file)
@@ -32,6 +32,10 @@ function notifications_instituerarticle_dist($quoi, $id_article, $options) {
        if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie')
                $modele = "notifications/article_propose";
 
+       if ($options['statut'] == 'refuse' AND in_array($options['statut_ancien'],array('prop','publie'))) {
+               $modele = "notifications/article_refuse";
+       }
+
        if ($modele){
                $destinataires = array();
                if ($GLOBALS['meta']["suivi_edito"] == "oui")
index 4b7f75f..31fa600 100644 (file)
@@ -39,6 +39,7 @@ function notifications_go($x){
 function notifications_post_edition($x){
        #spip_log($x,'notifications');
        if (isset($x['args']['table'])
+               AND isset($GLOBALS['notifications_post_edition'][$x['args']['table']])
                AND $quoi = $GLOBALS['notifications_post_edition'][$x['args']['table']]
        ){
                // repasser par l'entree principale
@@ -60,7 +61,7 @@ function notifications_notifications_destinataires($flux){
        $quoi = $flux['args']['quoi'];
        $options = $flux['args']['options'];
 
-       // proposition d'article prevenir les admins restreints
+       // proposition d'article prevenir les admins restreints pour le passage de proposé à publié
        if ($quoi=='instituerarticle' AND $GLOBALS['notifications']['prevenir_admins_restreints']
                AND $options['statut']=='prop' AND $options['statut_ancien']!='publie' // ligne a commenter si vous voulez prevenir de la publication
        ){
@@ -104,6 +105,50 @@ function notifications_notifications_destinataires($flux){
 
        }
 
+       // notification d'article pour le passage de proposé à refusé
+       if ($quoi=='instituerarticle' AND $GLOBALS['notifications']['prevenir_auteurs_articles_refus'] 
+               AND $options['statut']=='refuse' AND in_array($options['statut_ancien'], array('prop','publie')) // ligne a commenter si vous voulez prevenir de la publication
+       ){
+
+               $id_article = $flux['args']['id'];
+               include_spip('base/abstract_sql');
+               $t = sql_fetsel("id_rubrique", "spip_articles", "id_article=" . intval($id_article));
+               $id_rubrique = $t['id_rubrique'];
+               if ($GLOBALS['notifications']['limiter_rubriques']){
+                       $limites = $GLOBALS['notifications']['limiter_rubriques'];
+                       $limiter_rubriques = explode(",",$limites);
+               } else {
+                       $limiter_rubriques = array($id_rubrique);
+               }
+
+               if (in_array($id_rubrique,$limiter_rubriques))
+               {
+                       while ($id_rubrique){
+                               $hierarchie[] = $id_rubrique;
+                               $res = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_rubrique));
+                               if (!$res){ // rubrique inexistante
+                                       $id_rubrique = 0;
+                                       break;
+                               }
+                               $id_parent = $res['id_parent'];
+                               $id_rubrique = $id_parent;
+                       }
+                       spip_log("Refuse article > admin restreint de " . join(',', $hierarchie), 'notifications');
+
+                       //les admins de la rub et de ses parents 
+                       $result_email = sql_select(
+                               "auteurs.email,auteurs.id_auteur,lien.id_objet as id_rubrique",
+                               "spip_auteurs AS auteurs JOIN spip_auteurs_liens AS lien ON auteurs.id_auteur=lien.id_auteur ",
+                               "lien.objet='rubrique' AND ".sql_in('lien.id_objet',sql_quote($hierarchie))." AND auteurs.statut='0minirezo'");
+
+                       while ($qui = sql_fetch($result_email)){
+                               spip_log($options['statut'] . " article > admin restreint " . $qui['id_auteur'] . " de la rubrique" . $qui['id_rubrique'] . " prevenu", 'notifications');
+                               $flux['data'][] = $qui['email'];
+                       }
+               }
+
+       }
+
        // publication d'article : prevenir les auteurs
        if ($quoi=='instituerarticle'
                AND $GLOBALS['notifications']['prevenir_auteurs_articles']
@@ -126,7 +171,7 @@ function notifications_notifications_destinataires($flux){
 
                        // Qui va-t-on prevenir en plus ?
                        $result_email = sql_select(
-                               "auteurs.email",
+                               array('auteurs.email', 'auteurs.id_auteur'),
                                "spip_auteurs AS auteurs JOIN spip_auteurs_liens AS lien ON auteurs.id_auteur=lien.id_auteur",
                                "lien.id_objet=".intval($id_article)." AND lien.objet='article'");
 
@@ -137,10 +182,16 @@ function notifications_notifications_destinataires($flux){
                }
 
        }
-
+       //publication d'article : ne pas prévenir l'auteur s'il est le validateur
+       if ($quoi == "instituerarticle" and $GLOBALS['notifications']['pas_prevenir_publieur']){
+               $publieur_email=$GLOBALS["visiteur_session"]["email"];
+               if(($key = array_search($publieur_email,$flux['data'])) !== false){
+                       unset($flux['data'][$key]);
+               }       
+       }
        // forum valide ou prive : prevenir les autres contributeurs du thread ou ceux qui ont déjà répondu à l'article
        if (($quoi=='forumprive' AND $GLOBALS['notifications']['thread_forum_prive'])
-               OR ($quoi=='forumvalide' AND ($GLOBALS['notifications']['thread_forum'] or $GLOBALS['notifications']['forum']))
+               OR ($quoi=='forumvalide' AND ($GLOBALS['notifications']['thread_forum'] OR $GLOBALS['notifications']['forum'] OR $GLOBALS['notifications']['forum_article']))
        ){
 
                $id_forum = $flux['args']['id'];
@@ -150,14 +201,15 @@ function notifications_notifications_destinataires($flux){
             
                        // Tous les participants a ce *thread*, abonnes
                        // on prend les emails parmi notification_email (prioritaire si rempli) email_auteur ou email de l'auteur qd id_auteur connu
+                       // note : on exclut les forums refusé ou marqué comme spam
                        $s = sql_select("F.email_auteur, F.notification_email, A.email",
                                "spip_forum AS F LEFT JOIN spip_auteurs AS A ON F.id_auteur=A.id_auteur",
-                               "notification=1 AND id_thread=" . intval($t['id_thread']) . " AND (email_auteur != '' OR notification_email != '' OR A.email IS NOT NULL )");
+                               "notification=1 AND id_thread=" . intval($t['id_thread']) . " AND (email_auteur != '' OR notification_email != '' OR A.email IS NOT NULL) AND F.statut NOT IN ('off','spam')") ;
             // Eventuellement tout ceux qui ont répondu à cet article
             if ($GLOBALS['notifications']['forum_article']){
                 $s = sql_select("F.email_auteur, F.notification_email, A.email",
                                "spip_forum AS F LEFT JOIN spip_auteurs AS A ON F.id_auteur=A.id_auteur",
-                               "notification=1 AND objet=".sql_quote($t['objet'])." AND id_objet=" . intval($t['id_objet']) . " AND (email_auteur != '' OR notification_email != '' OR A.email IS NOT NULL )");                
+                               "notification=1 AND objet=".sql_quote($t['objet'])." AND id_objet=" . intval($t['id_objet']) . " AND (email_auteur != '' OR notification_email != '' OR A.email IS NOT NULL) AND F.statut NOT IN ('off','spam')");                
                 }
                        while ($r = sql_fetch($s)){
                                if ($r['notification_email'])
@@ -168,19 +220,6 @@ function notifications_notifications_destinataires($flux){
                                        $flux['data'][] = $r['email'];
                        }
 
-                       /*
-                       // 3. Tous les auteurs des messages qui precedent (desactive egalement)
-                       // (possibilite exclusive de la possibilite precedente)
-                       // TODO: est-ce utile, par rapport au thread ?
-                       else if (defined('_SUIVI_FORUMS_REPONSES')
-                       AND _SUIVI_FORUMS_REPONSES) {
-                               $id_parent = $id_forum;
-                               while ($r = spip_fetch_array(spip_query("SELECT email_auteur, id_parent FROM spip_forum WHERE id_forum=$id_parent AND statut='publie'"))) {
-                                       $tous[] = $r['email_auteur'];
-                                       $id_parent = $r['id_parent'];
-                               }
-                       }
-                       */
                }
        }
 
index bc159c8..bf4a1ab 100644 (file)
@@ -1,9 +1,9 @@
 <paquet
        prefix="notifications"
        categorie="communication"
-       version="3.2.0"
+       version="3.5.4"
        etat="stable"
-       compatibilite="[3.0.0;3.0.*]"
+       compatibilite="[3.0.0;3.1.*]"
        logo="notifications-32.png"
        documentation="http://contrib.spip.net/Notifications"
        schema="0.1.3"
@@ -23,7 +23,7 @@
 
        <pipeline nom="notifications" inclure="notifications_pipelines.php" action="go" />
 
-       <utilise nom="forum" />
-       <necessite nom="facteur" compatibilite="[2.4.2;]"/>
+       <utilise nom="forum" compatibilite="[1.8.12;]"/>
+       <necessite nom="facteur" compatibilite="[3.0.19;]"/>
 
-</paquet>
\ No newline at end of file
+</paquet>
index 9e6e7d9..8b1839a 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/notifications/trunk
-Revision: 84941
-Dernier commit: 2014-10-01 13:00:23 +0200 
+Revision: 99183
+Dernier commit: 2016-08-17 12:19:01 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/notifications/trunk</origine>
-<revision>84941</revision>
-<commit>2014-10-01 13:00:23 +0200 </commit>
+<revision>99183</revision>
+<commit>2016-08-17 12:19:01 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 893a865..4d6485b 100644 (file)
@@ -10,7 +10,7 @@
  * @subpackage odt2spip
  * @category import
  *
- * @version $Id: odt2spip_importe.php 81585 2014-03-22 17:15:03Z root $
+ * @version $Id: odt2spip_importe.php 81585 2014-03-22 17:08:08Z cy_altern@yahoo.fr $
  *
  */
 if (!defined("_ECRIRE_INC_VERSION")) return;
index 228a7d3..00c4abd 100644 (file)
@@ -1,10 +1,10 @@
 <paquet
        prefix="odt2spip"
        categorie="edition"
-       version="2.1.2"
+       version="2.1.3"
        schema="201406091738"
        etat="test"
-       compatibilite="[3.0.0;3.0.*]"
+       compatibilite="[3.0.0;3.1.*]"
        logo="odt2spip-64.png"
        documentation="http://contrib.spip.net/3001"
 >      
index b8c2832..cb57ed3 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/odt2spip/trunk
-Revision: 84608
-Dernier commit: 2014-09-14 20:53:11 +0200 
+Revision: 92767
+Dernier commit: 2015-11-09 09:50:10 +0100 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/odt2spip/trunk</origine>
-<revision>84608</revision>
-<commit>2014-09-14 20:53:11 +0200 </commit>
+<revision>92767</revision>
+<commit>2015-11-09 09:50:10 +0100 </commit>
 </svn_revision>
\ No newline at end of file
diff --git a/www/plugins/redirhttps.bak/images/redirhttps-128.png b/www/plugins/redirhttps.bak/images/redirhttps-128.png
new file mode 100644 (file)
index 0000000..34ac983
Binary files /dev/null and b/www/plugins/redirhttps.bak/images/redirhttps-128.png differ
diff --git a/www/plugins/redirhttps.bak/lang/paquet-redirhttps.xml b/www/plugins/redirhttps.bak/lang/paquet-redirhttps.xml
new file mode 100644 (file)
index 0000000..b2c0649
--- /dev/null
@@ -0,0 +1,10 @@
+<traduction module="paquet-redirhttps" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/redirhttps/lang/" reference="fr">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=en">
+               <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
+       </langue>
+       <langue code="es" />
+       <langue code="fr" />
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=sk">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/redirhttps.bak/lang/paquet-redirhttps_en.php b/www/plugins/redirhttps.bak/lang/paquet-redirhttps_en.php
new file mode 100644 (file)
index 0000000..f599062
--- /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-redirhttps?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // R
+       'redirhttps_description' => 'Redirect to HTTPS when the content requires it (private area, login, public pages with user logged in)',
+       'redirhttps_nom' => 'HTTPS redirections',
+       'redirhttps_slogan' => 'Secure access to certain pages of the site'
+);
+
+?>
diff --git a/www/plugins/redirhttps.bak/lang/paquet-redirhttps_es.php b/www/plugins/redirhttps.bak/lang/paquet-redirhttps_es.php
new file mode 100644 (file)
index 0000000..27ec800
--- /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-redirhttps?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // R
+       'redirhttps_description' => 'Redirección hacía HTTPS cuando el contendio le necesita (espacio privado, login, páginas públicas con el usuario conectado)',
+       'redirhttps_nom' => 'Redireciones HTTPS',
+       'redirhttps_slogan' => 'Sécuriser l\'accès à certaines pages du site' # NEW
+);
+
+?>
diff --git a/www/plugins/redirhttps.bak/lang/paquet-redirhttps_fr.php b/www/plugins/redirhttps.bak/lang/paquet-redirhttps_fr.php
new file mode 100644 (file)
index 0000000..95734c6
--- /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_/redirhttps/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // R
+       'redirhttps_description' => 'Redirection vers HTTPS quand le contenu le nécessite (espace privé, login, pages publiques avec utilisateur connecté)',
+       'redirhttps_nom' => 'Redirections HTTPS',
+       'redirhttps_slogan' => 'Sécuriser l\'accès à certaines pages du site'
+);
+
+?>
diff --git a/www/plugins/redirhttps.bak/lang/paquet-redirhttps_sk.php b/www/plugins/redirhttps.bak/lang/paquet-redirhttps_sk.php
new file mode 100644 (file)
index 0000000..722b7b0
--- /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-redirhttps?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // R
+       'redirhttps_description' => 'Presmerovanie na HTTPS, ak si to vyžaduje obsah (súkromná zóna, prihlásenie, používateľ prihlásený cez verejne prístupné stránky)',
+       'redirhttps_nom' => 'Presmerovania HTTPS',
+       'redirhttps_slogan' => 'Zabezpečiť prístup na určité stránky'
+);
+
+?>
diff --git a/www/plugins/redirhttps.bak/lang/redirhttps.xml b/www/plugins/redirhttps.bak/lang/redirhttps.xml
new file mode 100644 (file)
index 0000000..afd3348
--- /dev/null
@@ -0,0 +1,2 @@
+<traduction module="redirhttps" gestionnaire="salvatore" url="" source="svn://zone.spip.org/spip-zone/_plugins_/redirhttps/lang/" reference="fr">
+</traduction>
diff --git a/www/plugins/redirhttps.bak/paquet.xml b/www/plugins/redirhttps.bak/paquet.xml
new file mode 100644 (file)
index 0000000..c5301e5
--- /dev/null
@@ -0,0 +1,19 @@
+<paquet
+       prefix="redirhttps"
+       categorie="performance"
+       version="0.1.0"
+       etat="test"
+       compatibilite="[2.1.11;["
+       logo="images/redirhttps-128.png"
+       documentation="http://www.spip-contrib.net/Rediriger-en-HTTPS-quand-l-utilisateur-est-connecte"
+>      
+
+       <nom>Redirections HTTPS</nom>
+       <!-- Sécuriser l'accès à certaines pages du site -->
+
+       <auteur>Severo</auteur>
+       <credit lien="http://www.iconfinder.com/icondetails/25388/128/high_security_thick_icon">Oliver Scholtz</credit>
+       <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
+
+       <traduire gestionnaire="salvatore" module="redirhttps" reference="fr" />
+</paquet>
diff --git a/www/plugins/redirhttps.bak/plugin.xml b/www/plugins/redirhttps.bak/plugin.xml
new file mode 100755 (executable)
index 0000000..d593135
--- /dev/null
@@ -0,0 +1,22 @@
+<plugin>\r
+       <nom><multi>[fr]Redirections HTTPS[es]Redireciones HTTPS</multi></nom>\r
+       <auteur>Severo</auteur>\r
+       <licence>GNU/GPL</licence>\r
+       <version>0.1.0</version>\r
+       <etat>test</etat>\r
+       <prefix>redirhttps</prefix>\r
+       <categorie>performance</categorie>\r
+       <slogan>S&#233;curiser l'acc&#232;s &#224; certaines pages du site</slogan>\r
+       <description>\r
+               <multi>\r
+                       [fr]Redirection vers HTTPS quand le contenu le n&#233;cessite (espace priv&#233;, login, pages publiques avec utilisateur connect&#233;)\r
+                       [es]Redirecci&#243;n hac&#237;a HTTPS cuando el contendio le necesita (espacio privado, login, p&#225;ginas p&#250;blicas con el usuario conectado)\r
+               </multi>\r
+       </description>\r
+       <lien>http://www.spip-contrib.net/Rediriger-en-HTTPS-quand-l-utilisateur-est-connecte</lien>\r
+       <icon>images/redirhttps-128.png</icon> <!-- http://www.iconfinder.com/icondetails/25388/128/high_security_thick_icon -->\r
+\r
+       <options>redirhttps_options.php</options>\r
+\r
+       <necessite id="SPIP" version="[2.1.11;3.0.99]" />\r
+</plugin>\r
diff --git a/www/plugins/redirhttps.bak/redirhttps_options.php b/www/plugins/redirhttps.bak/redirhttps_options.php
new file mode 100755 (executable)
index 0000000..6315b2d
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+// Le traffic HTTP est redirige en HTTPS quand l'utilisateur est connecte ou pour la page de login
+// a noter: il faut avoir applique le patch: http://core.spip.org/projects/spip/repository/revisions/17941
+//    -> dans le core depuis la version 2.1.11
+if (
+        (
+               ($_COOKIE['spip_session']) OR
+               (strpos($_SERVER['REQUEST_URI'], '/spip.php?page=login')===0)
+       ) AND
+        (!$_SERVER['HTTPS']) AND
+        ($_SERVER['REQUEST_METHOD'] == 'GET')
+        ) {
+        include_spip('inc/headers');
+        redirige_par_entete('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+}
+?>
diff --git a/www/plugins/redirhttps.bak/svn.revision b/www/plugins/redirhttps.bak/svn.revision
new file mode 100644 (file)
index 0000000..d1b8b23
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/redirhttps
+Revision: 69253
+Dernier commit: 2013-01-24 03:41:22 +0100 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/redirhttps</origine>
+<revision>69253</revision>
+<commit>2013-01-24 03:41:22 +0100 </commit>
+</svn_revision>
\ No newline at end of file
diff --git a/www/plugins/redirhttps/images/redirhttps-128.png b/www/plugins/redirhttps/images/redirhttps-128.png
deleted file mode 100644 (file)
index 34ac983..0000000
Binary files a/www/plugins/redirhttps/images/redirhttps-128.png and /dev/null differ
diff --git a/www/plugins/redirhttps/lang/paquet-redirhttps.xml b/www/plugins/redirhttps/lang/paquet-redirhttps.xml
deleted file mode 100644 (file)
index b2c0649..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<traduction module="paquet-redirhttps" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/redirhttps/lang/" reference="fr">
-       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=en">
-               <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
-       </langue>
-       <langue code="es" />
-       <langue code="fr" />
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=sk">
-               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
-       </langue>
-</traduction>
diff --git a/www/plugins/redirhttps/lang/paquet-redirhttps_en.php b/www/plugins/redirhttps/lang/paquet-redirhttps_en.php
deleted file mode 100644 (file)
index f599062..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=en
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // R
-       'redirhttps_description' => 'Redirect to HTTPS when the content requires it (private area, login, public pages with user logged in)',
-       'redirhttps_nom' => 'HTTPS redirections',
-       'redirhttps_slogan' => 'Secure access to certain pages of the site'
-);
-
-?>
diff --git a/www/plugins/redirhttps/lang/paquet-redirhttps_es.php b/www/plugins/redirhttps/lang/paquet-redirhttps_es.php
deleted file mode 100644 (file)
index 27ec800..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=es
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // R
-       'redirhttps_description' => 'Redirección hacía HTTPS cuando el contendio le necesita (espacio privado, login, páginas públicas con el usuario conectado)',
-       'redirhttps_nom' => 'Redireciones HTTPS',
-       'redirhttps_slogan' => 'Sécuriser l\'accès à certaines pages du site' # NEW
-);
-
-?>
diff --git a/www/plugins/redirhttps/lang/paquet-redirhttps_fr.php b/www/plugins/redirhttps/lang/paquet-redirhttps_fr.php
deleted file mode 100644 (file)
index 95734c6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?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_/redirhttps/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // R
-       'redirhttps_description' => 'Redirection vers HTTPS quand le contenu le nécessite (espace privé, login, pages publiques avec utilisateur connecté)',
-       'redirhttps_nom' => 'Redirections HTTPS',
-       'redirhttps_slogan' => 'Sécuriser l\'accès à certaines pages du site'
-);
-
-?>
diff --git a/www/plugins/redirhttps/lang/paquet-redirhttps_sk.php b/www/plugins/redirhttps/lang/paquet-redirhttps_sk.php
deleted file mode 100644 (file)
index 722b7b0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-redirhttps?lang_cible=sk
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // R
-       'redirhttps_description' => 'Presmerovanie na HTTPS, ak si to vyžaduje obsah (súkromná zóna, prihlásenie, používateľ prihlásený cez verejne prístupné stránky)',
-       'redirhttps_nom' => 'Presmerovania HTTPS',
-       'redirhttps_slogan' => 'Zabezpečiť prístup na určité stránky'
-);
-
-?>
diff --git a/www/plugins/redirhttps/lang/redirhttps.xml b/www/plugins/redirhttps/lang/redirhttps.xml
deleted file mode 100644 (file)
index afd3348..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<traduction module="redirhttps" gestionnaire="salvatore" url="" source="svn://zone.spip.org/spip-zone/_plugins_/redirhttps/lang/" reference="fr">
-</traduction>
diff --git a/www/plugins/redirhttps/paquet.xml b/www/plugins/redirhttps/paquet.xml
deleted file mode 100644 (file)
index c5301e5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<paquet
-       prefix="redirhttps"
-       categorie="performance"
-       version="0.1.0"
-       etat="test"
-       compatibilite="[2.1.11;["
-       logo="images/redirhttps-128.png"
-       documentation="http://www.spip-contrib.net/Rediriger-en-HTTPS-quand-l-utilisateur-est-connecte"
->      
-
-       <nom>Redirections HTTPS</nom>
-       <!-- Sécuriser l'accès à certaines pages du site -->
-
-       <auteur>Severo</auteur>
-       <credit lien="http://www.iconfinder.com/icondetails/25388/128/high_security_thick_icon">Oliver Scholtz</credit>
-       <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
-
-       <traduire gestionnaire="salvatore" module="redirhttps" reference="fr" />
-</paquet>
diff --git a/www/plugins/redirhttps/plugin.xml b/www/plugins/redirhttps/plugin.xml
deleted file mode 100755 (executable)
index d593135..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<plugin>\r
-       <nom><multi>[fr]Redirections HTTPS[es]Redireciones HTTPS</multi></nom>\r
-       <auteur>Severo</auteur>\r
-       <licence>GNU/GPL</licence>\r
-       <version>0.1.0</version>\r
-       <etat>test</etat>\r
-       <prefix>redirhttps</prefix>\r
-       <categorie>performance</categorie>\r
-       <slogan>S&#233;curiser l'acc&#232;s &#224; certaines pages du site</slogan>\r
-       <description>\r
-               <multi>\r
-                       [fr]Redirection vers HTTPS quand le contenu le n&#233;cessite (espace priv&#233;, login, pages publiques avec utilisateur connect&#233;)\r
-                       [es]Redirecci&#243;n hac&#237;a HTTPS cuando el contendio le necesita (espacio privado, login, p&#225;ginas p&#250;blicas con el usuario conectado)\r
-               </multi>\r
-       </description>\r
-       <lien>http://www.spip-contrib.net/Rediriger-en-HTTPS-quand-l-utilisateur-est-connecte</lien>\r
-       <icon>images/redirhttps-128.png</icon> <!-- http://www.iconfinder.com/icondetails/25388/128/high_security_thick_icon -->\r
-\r
-       <options>redirhttps_options.php</options>\r
-\r
-       <necessite id="SPIP" version="[2.1.11;3.0.99]" />\r
-</plugin>\r
diff --git a/www/plugins/redirhttps/redirhttps_options.php b/www/plugins/redirhttps/redirhttps_options.php
deleted file mode 100755 (executable)
index 6315b2d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// Le traffic HTTP est redirige en HTTPS quand l'utilisateur est connecte ou pour la page de login
-// a noter: il faut avoir applique le patch: http://core.spip.org/projects/spip/repository/revisions/17941
-//    -> dans le core depuis la version 2.1.11
-if (
-        (
-               ($_COOKIE['spip_session']) OR
-               (strpos($_SERVER['REQUEST_URI'], '/spip.php?page=login')===0)
-       ) AND
-        (!$_SERVER['HTTPS']) AND
-        ($_SERVER['REQUEST_METHOD'] == 'GET')
-        ) {
-        include_spip('inc/headers');
-        redirige_par_entete('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
-}
-?>
diff --git a/www/plugins/redirhttps/svn.revision b/www/plugins/redirhttps/svn.revision
deleted file mode 100644 (file)
index d1b8b23..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<svn_revision>
-<text_version>
-Origine: file:///home/svn/repository/spip-zone/_plugins_/redirhttps
-Revision: 69253
-Dernier commit: 2013-01-24 03:41:22 +0100 
-</text_version>
-<origine>file:///home/svn/repository/spip-zone/_plugins_/redirhttps</origine>
-<revision>69253</revision>
-<commit>2013-01-24 03:41:22 +0100 </commit>
-</svn_revision>
\ No newline at end of file
index c74ba2b..155c352 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
 /**
  * Ajouter la table spip_articles_syndic
  * @param array $tables_auxiliaires
 function rssarticle_declarer_tables_auxiliaires($tables_auxiliaires){
 
        $spip_rssarticle = array(
-                       "id_article"  => "bigint(21) NOT NULL",
-                       "id_syndic"     => "bigint(21) NOT NULL");
-         
+                       "id_article"  => "bigint(21) NOT NULL",
+                       "id_syndic"     => "bigint(21) NOT NULL");
+
        $spip_rssarticle_key = array(
                        "INDEX"         => "id_article");
        
        $tables_auxiliaires['spip_articles_syndic'] = array(
-                       'field' => &$spip_rssarticle,
-                       'key' => &$spip_rssarticle_key);
-               
+                       'field' => &$spip_rssarticle,
+                       'key' => &$spip_rssarticle_key);
+
        return $tables_auxiliaires;
 }
 
@@ -27,20 +29,16 @@ function rssarticle_declarer_tables_auxiliaires($tables_auxiliaires){
  * @return array
  */
 function rssarticle_declarer_tables_interfaces($interface){
-       
+
        $interface['table_des_tables']['articles_syndic']='articles_syndic';
-       
+
        // permet au compilateur de determiner explicitement les jointures possibles
-       // lorsqu\92une boucle sur une table demande un champ inconnu
+       // lorsqu'une boucle sur une table demande un champ inconnu
        $interface['tables_jointures']['spip_articles'][] = 'articles_syndic';
 
        return $interface;
 }
 
-
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
 /**
  * Ajouter des champs a la table syndic
  * @param array $tables_principales
@@ -49,7 +47,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
 function rssarticle_declarer_tables_principales($tables_principales){
        // Extension de la table syndic
        $tables_principales['spip_syndic']['field']['rssarticle'] = "varchar(3) DEFAULT 'non' NOT NULL"; 
-               
+
        return $tables_principales;
 }
 
index 12d5536..c2d8259 100644 (file)
@@ -1,44 +1,44 @@
 <?php\r
-/*    plugin rss en article\r
-*\r
-*     page cachée pour les gens préssés ne pouvant pas attendre le genie\r
-*     permet de relancer manuellement la recopie  du flux en article\r
-*/\r
+/**\r
+ * Plugin rss en article\r
+ *\r
+ * page cachée pour les gens préssés ne pouvant pas attendre le genie\r
+ * permet de relancer manuellement la recopie  du flux en article\r
+ */\r
 \r
 \r
 if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
 include_spip("inc/presentation");\r
 \r
-function exec_rss_article_dist()\r
-{\r
-  // si pas autorise : message d'erreur  ... admin ... a affiner\r
-  if (!autoriser('editer', 'article')) {\r
-        include_spip('inc/minipres');\r
-        echo minipres();\r
-        exit;\r
-  }\r
-  \r
-  include_spip("genie/rssarticle_copie");\r
-    \r
+function exec_rss_article_dist(){\r
+       // si pas autorise : message d'erreur   ... admin ... a affiner\r
+       if (!autoriser('editer', 'article')) {\r
+               include_spip('inc/minipres');\r
+               echo minipres();\r
+               exit;\r
+       }\r
+\r
+       include_spip("genie/rssarticle_copie");\r
+\r
        //\r
        // affichages\r
        // \r
 \r
        $commencer_page = charger_fonction('commencer_page', 'inc');\r
        echo $commencer_page(_T('rssarticle:activer_recopie_intro'), 'editer', 'editer');\r
-  // titre\r
-  echo "<br /><br /><br />\n"; // outch ! aie aie aie ! au secours !\r
-  echo gros_titre(_T('rssarticle:activer_recopie_intro'),'', false);\r
+       // titre\r
+       echo "<br /><br /><br />\n"; // outch ! aie aie aie ! au secours !\r
+       echo gros_titre(_T('rssarticle:activer_recopie_intro'),'', false);\r
 \r
        // colonne gauche\r
        echo debut_gauche('', true);\r
-  echo debut_droite('', true);\r
+       echo debut_droite('', true);\r
        \r
        // centre de la page    \r
        genie_rssarticle_copie_dist("manuel");\r
-  echo '<div><small>'.date('Y/m/d H:i:s').'</small><br />'._T('rssarticle:maj_manuelle').'</div>';\r
-  echo '<div style="margin:2em 0;"><a href="?exec=rss_article" style="border:1px solid;padding:0.5em;background:#fff;">'._T('rssarticle:maj_recharge').'</a></div>';\r
-  \r
+       echo '<div><small>'.date('Y/m/d H:i:s').'</small><br />'._T('rssarticle:maj_manuelle').'</div>';\r
+       echo '<div style="margin:2em 0;"><a href="?exec=rss_article" style="border:1px solid;padding:0.5em;background:#fff;">'._T('rssarticle:maj_recharge').'</a></div>';\r
 \r
        // pied\r
        echo fin_gauche() . fin_page();\r
index 7bd3197..f04338f 100644 (file)
@@ -9,66 +9,60 @@
                #ACTION_FORMULAIRE{#ENV{action}}\r
 \r
                <ul>\r
-            <li class="editer">\r
-              <h3 class="legend"><:rssarticle:statut_article_importe:></h3>\r
-                        <ul>\r
-                            <select name="import_statut">\r
-                                <option value="prop"[(#ENV{import_statut}|=={prop}|?{' selected="selected"'})]><:sites:info_statut_site_3:></option>\r
-                                <option value="publie"[(#ENV{import_statut}|=={publie}|?{' selected="selected"'})]><:sites:info_statut_site_2:></option>\r
-                            </select>\r
-                        </ul>\r
-                \r
-            </li>\r
-            <li class="editer">\r
-                    <h3 class="legend"><:rssarticle:mode:></h3>\r
-                        <ul>\r
-                            <div class="choix">\r
-                                <input class="radio" type="radio" name="mode" value="auto" [(#ENV{mode}|=={auto}?{checked='checked',''})] id="mode_auto"/>\r
-                                <label for="mode_auto"><:rssarticle:mode_auto:></label>\r
-                            </div>\r
-                            <div class="choix">\r
-                                <input type="radio" name="mode" value="manuel" [(#ENV{mode}|=={manuel}?{checked='checked',''})] id="mode_manuel"/>\r
-                                <label for="mode_manuel"><:rssarticle:mode_manuel:></label>\r
-                            </div>\r
-                        </ul>                \r
-            </li>\r
-            <li class="editer">\r
-                    <h3 class="legend"><:rssarticle:cron_interval:></h3>\r
-                    <input type="text" name="cron_interval_value" value="[(#ENV{cron_interval_value}|!={''}|?{#ENV{cron_interval_value},600})]" size="6" class="fondl" id="cron_interval_value"/>\r
-                    <label for="cron_interval_value"><:rssarticle:cron_interval_timer:></label>\r
-                \r
-            </li>\r
-            <li class="editer">\r
-                    <h3 class="legend"><:rssarticle:suivi_syndic:></h3>\r
-                    <ul>\r
-                        <li class="editer_email_alerte">\r
-                            <input type="checkbox" name="email_alerte"[ checked="(#ENV{email_alerte}|!={''}|?{'checked'})"] class="fondl" id="email_alerte"/>\r
-                            <label for="email_alerte"><:rssarticle:email_alerte:></label>\r
-                        </li>\r
-                        <li class="editer_email_suivi">\r
-                            <input type="text" name="email_suivi" value="[(#ENV{email_suivi})]" size="20" class="fondl" id="email_suivi"/>\r
-                            <label for="email_suivi"><:rssarticle:email_alerte_email:></label>\r
-                        </li>\r
-                    </ul>              \r
-            </li>\r
-            <li class="editer">\r
-                 <h3 class="legend"><:rssarticle:copie_logo:></h3>\r
-                 <input type="checkbox" name="copie_logo"[ checked="(#ENV{copie_logo}|!={''}|?{'checked'})"] class="fondl" id="copie_logo" />\r
-                 <label for="copie_logo"><:rssarticle:copie_logo:></label>\r
-                \r
-            </li>\r
-            <li class="editer">\r
-                 <h3 class="legend"><:rssarticle:html2spip:></h3>\r
-                 <input type="checkbox" name="html2spip"[ checked="(#ENV{html2spip}|!={''}|?{'checked'})"] id="html2spip" />\r
-                 <label for="html2spip"><:rssarticle:html2spip:></label>\r
-                \r
-            </li>\r
+                       <li class="editer">\r
+                               <h3 class="legend"><:rssarticle:statut_article_importe:></h3>\r
+                               <ul>\r
+                                       <select name="import_statut">\r
+                                               <option value="prop"[(#ENV{import_statut}|=={prop}|?{' selected="selected"'})]><:sites:info_statut_site_3:></option>\r
+                                               <option value="publie"[(#ENV{import_statut}|=={publie}|?{' selected="selected"'})]><:sites:info_statut_site_2:></option>\r
+                                       </select>\r
+                               </ul>\r
+                       </li>\r
+                       <li class="editer">\r
+                               <h3 class="legend"><:rssarticle:mode:></h3>\r
+                               <ul>\r
+                                       <div class="choix">\r
+                                               <input class="radio" type="radio" name="mode" value="auto" [(#ENV{mode}|=={auto}?{checked='checked',''})] id="mode_auto"/>\r
+                                               <label for="mode_auto"><:rssarticle:mode_auto:></label>\r
+                                       </div>\r
+                                       <div class="choix">\r
+                                               <input type="radio" name="mode" value="manuel" [(#ENV{mode}|=={manuel}?{checked='checked',''})] id="mode_manuel"/>\r
+                                               <label for="mode_manuel"><:rssarticle:mode_manuel:></label>\r
+                                       </div>\r
+                               </ul>\r
+                       </li>\r
+                       <li class="editer">\r
+                               <h3 class="legend"><:rssarticle:cron_interval:></h3>\r
+                               <input type="text" name="cron_interval_value" value="[(#ENV{cron_interval_value}|!={''}|?{#ENV{cron_interval_value},600})]" size="6" class="fondl" id="cron_interval_value"/>\r
+                               <label for="cron_interval_value"><:rssarticle:cron_interval_timer:></label>\r
+                       </li>\r
+                       <li class="editer editer_email_alerte">\r
+                               <h3 class="legend"><:rssarticle:suivi_syndic:></h3>\r
+                               <ul>\r
+                                       <li class="editer_email_alerte">\r
+                                               <input type="checkbox" name="email_alerte"[ checked="(#ENV{email_alerte}|!={''}|?{'checked'})"] class="fondl" id="email_alerte"/>\r
+                                               <label for="email_alerte"><:rssarticle:email_alerte:></label>\r
+                                       </li>\r
+                                       <li class="editer_email_suivi">\r
+                                               <input type="text" name="email_suivi" value="[(#ENV{email_suivi})]" size="20" class="fondl" id="email_suivi"/>\r
+                                               <label for="email_suivi"><:rssarticle:email_alerte_email:></label>\r
+                                       </li>\r
+                               </ul>\r
+                       </li>\r
+                       <li class="editer editer_copie_logo">\r
+                               <h3 class="legend"><:rssarticle:copie_logo:></h3>\r
+                               <input type="checkbox" name="copie_logo"[ checked="(#ENV{copie_logo}|!={''}|?{'checked'})"] class="fondl" id="copie_logo" />\r
+                               <label for="copie_logo"><:rssarticle:copie_logo:></label>\r
+                       </li>\r
+                       <li class="editer editer_html2spip">\r
+                               <h3 class="legend"><:rssarticle:html2spip:></h3>\r
+                               <input type="checkbox" name="html2spip"[ checked="(#ENV{html2spip}|!={''}|?{'checked'})"] id="html2spip" />\r
+                               <label for="html2spip"><:rssarticle:html2spip:></label>\r
+                       </li>\r
                </ul>\r
 \r
-         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]\r
-         <!--extra-->\r
-         <p class='boutons'><span class='image_loading'>&nbsp;</span>\r
-                       <input type='submit' class='submit' value='<:bouton_enregistrer:>' /></p>\r
-       </div></form>\r
-       ]\r
+               [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]\r
+               <!--extra-->\r
+               <p class='boutons'><span class='image_loading'>&nbsp;</span><input type='submit' class='submit' value='<:bouton_enregistrer:>' /></p>\r
+       </div></form>]\r
 </div>
\ No newline at end of file
index d523609..a4f1405 100644 (file)
@@ -1,22 +1,20 @@
-
-<div class="formulaire_spip formulaire_editer formulaire_#FORM formulaire_#FORM-#ENV{id_syndic,nouveau}">      
-  
-  [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+<div class="formulaire_spip formulaire_editer formulaire_#FORM formulaire_#FORM-#ENV{id_syndic,nouveau}">
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
        [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
        
-  <form method='post' action='#ENV{action}' enctype='multipart/form-data'><div>
+       <form method='post' action='#ENV{action}' enctype='multipart/form-data'><div>
                #ACTION_FORMULAIRE{#ENV{action}}
                <ul>
                        #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}#SET{obli,'obligatoire'}
-                  <li class="editer_rssarticle[ (#ENV**{erreurs}|table_valeur{rssarticle}|oui)erreur]">
-                    <div class="choix" style="margin-left:-130px">
-                      [(#CHEMIN_IMAGE{rssarticle-32.png}|balise_img{RSS})]
-                      <input type='checkbox' class="checkbox" name='rssarticle' value='oui' id='rssarticle'[ (#ENV{rssarticle}|=={oui}|?{'checked="checked"'})] />                                                     
-                      <label for="rssarticle"><:rssarticle:activer_recopie:></label>
-                    </div>
-                        [<span class='rssarticle'>(#ENV*{erreurs}|table_valeur{rssarticle})</span>]
-                  </li>
+                       <li class="editer_rssarticle[ (#ENV**{erreurs}|table_valeur{rssarticle}|oui)erreur]">
+                               <div class="choix">
+                                       [(#CHEMIN_IMAGE{rssarticle-32.png}|balise_img{RSS})]
+                                       <input type='checkbox' class="checkbox" name='rssarticle' value='oui' id='rssarticle'[(#ENV{rssarticle}|=={oui}|oui)checked="checked"] />
+                                       <label for="rssarticle"><:rssarticle:activer_recopie:></label>
+                               </div>
+                               [<span class='rssarticle'>(#ENV*{erreurs}|table_valeur{rssarticle})</span>]
+                       </li>
                </ul>
-         [(#ENV{editable}|oui) <p class='boutons'><input type='submit' name="save" class='submit' value='<:bouton_enregistrer:>' /></p>]
+               [(#ENV{editable}|oui) <p class='boutons'><input type='submit' name="save" class='submit' value='<:bouton_enregistrer:>' /></p>]
        </div></form>
 </div>
\ No newline at end of file
index 1c7fcf2..00bf672 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
 include_spip('inc/autoriser');
 
 /**
-* CVT: charger
-*
-*/
+ * CVT: charger
+ *
+ */
 function formulaires_editer_rssarticle_charger_dist($id_syndic='new', $retour=''){
 
        $rssarticle = sql_getfetsel('rssarticle','spip_syndic','id_syndic='.intval($id_syndic));
@@ -20,42 +22,37 @@ function formulaires_editer_rssarticle_charger_dist($id_syndic='new', $retour=''
 }
 
 /**
-* CVT: verifer
-*
-*/
+ * CVT: verifer
+ *
+ */
 function formulaires_editer_rssarticle_verifier_dist($id_syndic='new', $retour=''){
        $erreurs = array();
        return $erreurs;
 }
 
 /**
-* CVT: traiter
-*
-*/
+ * CVT: traiter
+ *
+ */
 function formulaires_editer_rssarticle_traiter_dist($id_syndic='new', $retour=''){
-       
-  $message = array('editable'=>true, 'message_ok'=>'');
-  
-  if (_request('rssarticle')=='oui') {
-       sql_updateq('spip_syndic',array(
-        'rssarticle'=> 'oui',
-        'resume'=>'non',
-        'oubli'=>'oui'
-       ),'id_syndic='.intval($id_syndic)); 
-       
-       // on force le site en mode oubli et pas resume 
-       // on rensynchronise la syndic pour passer les anciens articles (qui etaient ss doute en mode resume) en mode complet HTML
-       //sql_delete("spip_syndic_articles", "id_syndic=".sql_quote($id_syndic)); // alternative ;)
-       include_spip('genie/syndic');        
-            $t = syndic_a_jour($id_syndic); 
-  } else {
-       sql_updateq('spip_syndic',array('rssarticle'=> 'non'),'id_syndic='.intval($id_syndic)); 
-  }
-       
-  $message = _T("rssarticle:site_maj");
+       if (_request('rssarticle')=='oui') {
+               sql_updateq('spip_syndic',array(
+                       'rssarticle'=> 'oui',
+                       'resume'=>'non',
+                       'oubli'=>'oui'
+               ),'id_syndic='.intval($id_syndic));
+               
+               // on force le site en mode oubli et pas resume 
+               // on rensynchronise la syndic pour passer les anciens articles (qui etaient ss doute en mode resume) en mode complet HTML
+               // sql_delete("spip_syndic_articles", "id_syndic=".sql_quote($id_syndic)); // alternative ;)
+               include_spip('genie/syndic');
+               $t = syndic_a_jour($id_syndic);
+       } else {
+               sql_updateq('spip_syndic',array('rssarticle'=> 'non'),'id_syndic='.intval($id_syndic)); 
+       }
+       $message = array('editable'=>true, 'message_ok'=>_T("rssarticle:site_maj"));
 
        return $message;
-       
 }
 
 ?>
\ No newline at end of file
index 5f5a1e8..10d6576 100644 (file)
@@ -15,167 +15,178 @@ include_spip('inc/chercher_logo');
 include_spip('inc/rubriques');\r
 include_spip('inc/config');\r
 \r
-function genie_rssarticle_copie_dist($t){  \r
+function genie_rssarticle_copie_dist($t){\r
 \r
-  // configuration (ou valeurs par defaut)    \r
-  if (lire_config('rssarticle/import_statut')=="publie")       $import_statut="publie"; else  $import_statut="prop";     \r
-  if (lire_config('rssarticle/mode')=="auto")       $mode_auto=true; else  $mode_auto=false;  \r
-  if (lire_config('rssarticle/email_alerte')=="on") $email_alerte=true; else  $email_alerte=false;\r
-  if (lire_config('rssarticle/copie_logo')=="on")   $copie_logo=true; else  $copie_logo=false; \r
-  if (lire_config('rssarticle/html2spip')=="on")   $html2spip=true; else  $html2spip=false; \r
-  $email_suivi = lire_config('rssarticle/email_suivi'); \r
-  \r
-  // autres valeurs\r
-  $accepter_forum =    substr($GLOBALS['meta']['forums_publics'],0,3);\r
-  \r
-  // principe de pile:\r
-  // on boucle sur les derniers articles syndiques pour les retirer ensuite\r
-  // bourrin voir les requetes avec jointure du Miroir ou du site Rezo \r
-  $log = "";\r
-  $log_c = 0;\r
-  \r
-  // boucle sur les sites publies \r
-  if ($mode_auto) $u = sql_select("id_syndic,id_rubrique,id_secteur","spip_syndic","statut='publie'");   // tous \r
-          else    $u = sql_select("id_syndic,id_rubrique,id_secteur","spip_syndic","statut='publie' AND rssarticle='oui'");\r
-  \r
-  while ($b = sql_fetch($u)) {\r
-       $id_syndic = (int) $b['id_syndic'];\r
-       $id_rubrique = (int) $b['id_rubrique'];\r
-       $id_secteur = (int) $b['id_secteur'];\r
-  \r
-       // sur chaque site copie les derniers syndication\r
-       $s = sql_select("*", "spip_syndic_articles", "statut='publie' AND id_syndic='$id_syndic'","","maj DESC","10");  // par flot de 10 articles / site pour limiter la charge\r
-       while ($a = sql_fetch($s)) {\r
-                       $titre =  $a['titre'];\r
-                       $url =  $a['url'];\r
-          $id_syndic_article = $a['id_syndic_article']; \r
-                    \r
-          // article avec mm titre existe ? (test doublons sur l'url plutot que sr le titre)\r
-               if (!$row = sql_fetsel("id_article","spip_articles","url_site=".sql_quote($url))) {        \r
-            \r
-            $texte = $a['descriptif'];\r
-            //traitement pour syntaxe SPIP\r
-            if($html2spip)\r
-                  $texte = html2spip($texte);\r
-            $lang  = $a['lang'];\r
-            $url   = $a['url'];\r
-            $tags =  $a['tags'];\r
-            $lsDate = $a['date'];\r
-            \r
-          \r
-            if ($lang=="")     \r
-                $lang = $GLOBALS['spip_lang'];  \r
-                \r
-            // cas particulier: \r
-            // site multilingue avec la configuration: 1 lang par rubrique  \r
-            // on force l'article a avoir la langue de la rubrique ds lequel il est importee(pour omaidi)            \r
-            if ($GLOBALS['meta']['multi_rubriques']=='oui') {\r
-                  $s_lang = sql_select("lang", "spip_rubriques", "id_rubrique=$id_rubrique");\r
-                  while ($a_lang = sql_fetch($s_lang)) \r
-                      $lang = $a_lang['lang'];                   \r
-            }\r
-            \r
-            //$lsDate = date('Y-m-d H:i:s');            \r
-            // creation de l'article\r
-            $id_article = sql_insertq( 'spip_articles', array(\r
-                                'titre'=>$titre, 'id_rubrique'=>$id_rubrique,\r
-                                'texte'=>$texte, 'statut'=>$import_statut, 'id_secteur'=>$id_secteur,\r
-                                'date'=> $lsDate, 'accepter_forum'=>$accepter_forum, 'lang'=>$lang, 'url_site'=>$url));\r
-                                \r
-            // lier article et site\r
-            sql_insertq( 'spip_articles_syndic', array('id_article'=>$id_article, 'id_syndic'=>$id_syndic));\r
-                                \r
-            // gestion auteur            \r
-            $auteurs= explode(", ",$a['lesauteurs']);            \r
-            foreach ($auteurs as $k => $auteur) {                       \r
-                 if ($current_id_auteur = rssarticle_get_id_auteur($auteur))\r
-                      sql_insertq( 'spip_auteurs_liens', array('id_auteur'=>$current_id_auteur, 'id_objet'=>$id_article, 'objet'=>'article'));                \r
-            }\r
-            \r
-            // tags a convertir en documents distants \r
-            $doc_distants = extraire_enclosures($tags);\r
-                       foreach ($doc_distants as $k=>$doc_distant) {\r
-                $infos = recuperer_infos_distantes($doc_distant);\r
-                if ($infos['extension']) {\r
-                    $ext    = $infos['extension'];\r
-                    $taille = $infos['tailles']; \r
-                    $row = sql_fetsel("inclus", "spip_types_documents", "extension=" . sql_quote($ext) . " AND upload='oui'");  // extension autorisee ?\r
-                    if ($row) {\r
-                          $id_document = sql_insertq( 'spip_documents', array(\r
-                                'extension'=>$ext, \r
-                                'date'=> $lsDate,\r
-                                'fichier'=> $doc_distant,\r
-                                'taille'=> $taille,\r
-                                'mode' => 'document',\r
-                                'distant' => 'oui'));\r
-                          \r
-                         sql_insertq( 'spip_documents_liens', array(\r
-                                'id_document' =>$id_document, \r
-                                'id_objet'=> $id_article,\r
-                                'objet'=> 'article',\r
-                                'vu'=> 'non'));                                        \r
-                    }\r
-                }\r
-                \r
-            }\r
-            \r
-            // logo\r
-            if ($copie_logo) {             \r
-               if ($logo_site = inc_chercher_logo_dist($id_syndic,"id_syndic")) {\r
-                  $logo_article = "arton$id_article.".$logo_site[3];\r
-                  @copy($logo_site[0],_DIR_LOGOS."$logo_article");\r
-               }                 \r
-            }\r
-                                                                       \r
-                       $log_c++;\r
-                       $log .= "\n - $titre";  \r
-            \r
-             // on "depublie" l'article syndique qui vient d'etre copie\r
-            sql_update("spip_syndic_articles", array('statut' => '"refuse"'), "id_syndic_article=$id_syndic_article");\r
+       // configuration (ou valeurs par defaut)\r
+       if (lire_config('rssarticle/import_statut')=="publie")\r
+               $import_statut="publie";\r
+       else\r
+               $import_statut="prop";\r
+       if (lire_config('rssarticle/mode')=="auto")\r
+               $mode_auto=true;\r
+       else\r
+               $mode_auto=false;\r
+       if (lire_config('rssarticle/email_alerte')=="on")\r
+               $email_alerte=true;\r
+       else\r
+               $email_alerte=false;\r
+       if (lire_config('rssarticle/copie_logo')=="on")\r
+               $copie_logo=true;\r
+       else\r
+               $copie_logo=false; \r
+       if (lire_config('rssarticle/html2spip')=="on")\r
+               $html2spip=true;\r
+       else\r
+               $html2spip=false; \r
+       $email_suivi = lire_config('rssarticle/email_suivi');\r
+\r
+       // autres valeurs\r
+       $accepter_forum =       substr($GLOBALS['meta']['forums_publics'],0,3);\r
+\r
+       // principe de pile:\r
+       // on boucle sur les derniers articles syndiques pour les retirer ensuite\r
+       // bourrin voir les requetes avec jointure du Miroir ou du site Rezo \r
+       $log = "";\r
+       $log_c = 0;\r
+       \r
+       // boucle sur les sites publies\r
+       if ($mode_auto) \r
+               $u = sql_select("id_syndic,id_rubrique,id_secteur","spip_syndic","statut='publie'");     // tous \r
+       else\r
+               $u = sql_select("id_syndic,id_rubrique,id_secteur","spip_syndic","statut='publie' AND rssarticle='oui'");\r
+       \r
+       while ($b = sql_fetch($u)) {\r
+               $id_syndic = (int) $b['id_syndic'];\r
+               $id_rubrique = (int) $b['id_rubrique'];\r
+               $id_secteur = (int) $b['id_secteur'];\r
+\r
+               // sur chaque site copie les derniers syndication\r
+               $s = sql_select("*", "spip_syndic_articles", "statut='publie' AND id_syndic='$id_syndic'","","maj DESC","10");  // par flot de 10 articles / site pour limiter la charge\r
+               while ($a = sql_fetch($s)) {\r
+                       $titre =        $a['titre'];\r
+                       $url =  $a['url'];\r
+                       $id_syndic_article = $a['id_syndic_article']; \r
+\r
+                       // article avec mm titre existe ? (test doublons sur l'url plutot que sr le titre)\r
+                       if (!$id_article = sql_getfetsel("id_article","spip_articles","url_site=".sql_quote($url))) {\r
+                               $texte = $a['descriptif'];\r
+                               //traitement pour syntaxe SPIP\r
+                               if($html2spip)\r
+                                                       $texte = html2spip($texte);\r
+                               $lang   = $a['lang'];\r
+                               $url     = $a['url'];\r
+                               $tags = $a['tags'];\r
+                               $lsdate = $a['date'];\r
+\r
+                               if ($lang=="")  \r
+                                       $lang = $GLOBALS['spip_lang'];\r
+\r
+                               // cas particulier: \r
+                               // site multilingue avec la configuration: 1 lang par rubrique  \r
+                               // on force l'article a avoir la langue de la rubrique ds lequel il est importee(pour omaidi)\r
+                               if ($GLOBALS['meta']['multi_rubriques']=='oui') {\r
+                                       $s_lang = sql_select("lang", "spip_rubriques", "id_rubrique=$id_rubrique");\r
+                                       while ($a_lang = sql_fetch($s_lang)) \r
+                                               $lang = $a_lang['lang'];\r
+                               }\r
+                               \r
+                               //$lsdate = date('Y-m-d H:i:s');\r
+                               // creation de l'article\r
+                               $id_article = sql_insertq( 'spip_articles', array(\r
+                                                                                                               'titre'=>$titre, 'id_rubrique'=>$id_rubrique,\r
+                                                                                                               'texte'=>$texte, 'statut'=>$import_statut, 'id_secteur'=>$id_secteur,\r
+                                                                                                               'date'=> $lsdate, 'accepter_forum'=>$accepter_forum, 'lang'=>$lang, 'url_site'=>$url));\r
+                                                                                                               \r
+                               // lier article et site\r
+                               sql_insertq( 'spip_articles_syndic', array('id_article'=>$id_article, 'id_syndic'=>$id_syndic));\r
+\r
+                               // gestion auteur\r
+                               $auteurs= explode(", ",$a['lesauteurs']);\r
+                               foreach ($auteurs as $k => $auteur) {\r
+                                                if ($current_id_auteur = rssarticle_get_id_auteur($auteur))\r
+                                                                       sql_insertq( 'spip_auteurs_liens', array('id_auteur'=>$current_id_auteur, 'id_objet'=>$id_article, 'objet'=>'article'));\r
+                               }\r
+                               \r
+                               // tags a convertir en documents distants \r
+                               $doc_distants = extraire_enclosures($tags);\r
+                               foreach ($doc_distants as $k=>$doc_distant) {\r
+                                       $infos = recuperer_infos_distantes($doc_distant);\r
+                                       if ($infos['extension']) {\r
+                                               $ext            = $infos['extension'];\r
+                                               $taille = $infos['tailles']; \r
+                                               $inclus = sql_getfetsel("inclus", "spip_types_documents", "extension=" . sql_quote($ext) . " AND upload='oui'");        // extension autorisee ?\r
+                                               if ($inclus) {\r
+                                                       $id_document = sql_insertq( 'spip_documents', array(\r
+                                                                               'extension'=>$ext, \r
+                                                                               'date'=> $lsdate,\r
+                                                                               'fichier'=> $doc_distant,\r
+                                                                               'taille'=> $taille,\r
+                                                                               'mode' => 'document',\r
+                                                                               'distant' => 'oui'));\r
+                                                                       \r
+                                                       sql_insertq( 'spip_documents_liens', array(\r
+                                                                                       'id_document' =>$id_document,\r
+                                                                                       'id_objet'=> $id_article,\r
+                                                                                       'objet'=> 'article',\r
+                                                                                       'vu'=> 'non'));\r
+                                               }\r
+                                       }\r
+                               }\r
+                               \r
+                               // logo\r
+                               if ($copie_logo) {\r
+                                       if ($logo_site = inc_chercher_logo_dist($id_syndic,"id_syndic")) {\r
+                                               $logo_article = "arton$id_article.".$logo_site[3];\r
+                                               @copy($logo_site[0],_DIR_LOGOS."$logo_article");\r
+                                       }\r
+                               }\r
+\r
+                               $log_c++;\r
+                               $log .= "\n - $titre";\r
+\r
+                               // on "depublie" l'article syndique qui vient d'etre copie\r
+                               sql_update("spip_syndic_articles", array('statut' => '"refuse"'), "id_syndic_article=".intval($id_syndic_article));\r
+\r
+                               // Mise à jour des dates de rubriques après création d'un article dedans\r
+                               if ($id_article) {\r
+                                       if (function_exists('calculer_rubriques'))\r
+                                               calculer_rubriques();\r
+                                       if (function_exists('calculer_langues_rubriques'))\r
+                                               calculer_langues_rubriques();\r
+                                       if (function_exists('propager_les_secteurs'))\r
+                                               propager_les_secteurs();\r
+                               }\r
+                       }       // test doublons\r
+               }\r
+       } // FIN PILE\r
 \r
-            // Mise à jour des dates de rubriques après création d'un article dedans\r
-           if ($id_article) {\r
-               if (function_exists('calculer_rubriques'))\r
-                   calculer_rubriques();\r
-               if (function_exists('calculer_langues_rubriques'))\r
-                   calculer_langues_rubriques();\r
-               if (function_exists('propager_les_secteurs'))\r
-                   propager_les_secteurs();\r
-           }\r
-                  \r
-          }  // test doublons\r
-       }  \r
-  } // FIN PILE\r
-    \r
-       \r
        // log et alerte email\r
-  $log .= "\n\n---------\nPlugin Copie RSS en Articles: $log_c articles copies\n";\r
-  spip_log($log);\r
-  $log .= $GLOBALS['meta']['adresse_site']."/ecrire/?exec=accueil";\r
-       \r
-  if ($email_alerte && $email_suivi !="" && $log_c > 0)                 \r
-                  envoyer_mail($email_suivi,"Copie RSS en Articles", $log);\r
-              \r
+       $log .= "\n\n---------\nPlugin Copie RSS en Articles: $log_c articles copies\n";\r
+       spip_log($log);\r
+       $log .= $GLOBALS['meta']['adresse_site']."/ecrire/?exec=accueil";\r
+\r
+       if ($email_alerte && $email_suivi !="" && $log_c > 0)\r
+               envoyer_mail($email_suivi,"Copie RSS en Articles", $log);\r
        // maintenance generale\r
-  // mode auto: on efface les syndic_articles de plus de 2 mois pour soulager le systeme (cf genie/syndic) \r
-  // attention: on efface sur l'ensemble des sites syndiques ss tenir compte de l'option               \r
+       // mode auto: on efface les syndic_articles de plus de 2 mois pour soulager le systeme (cf genie/syndic) \r
+       // attention: on efface sur l'ensemble des sites syndiques ss tenir compte de l'option          \r
        if ($mode_auto) sql_delete('spip_syndic_articles', "maj < DATE_SUB(NOW(), INTERVAL 2 MONTH) AND date < DATE_SUB(NOW(), INTERVAL 2 MONTH)");\r
\r
+\r
        return 1;\r
 }\r
 \r
 \r
 //\r
 // recupere id d'un auteur selon son nom sinon le creer\r
-function rssarticle_get_id_auteur($nom) {  \r
-   if (trim($nom)=="") \r
-        return false;\r
-   \r
-   if ($row = sql_fetsel(array("id_auteur"),"spip_auteurs","nom=".sql_quote($nom)))  \r
-        return $row['id_auteur']\r
+function rssarticle_get_id_auteur($nom) {\r
+       if (trim($nom)=="") \r
+               return false;\r
+\r
+       if ($id_auteur = sql_getfetsel("id_auteur","spip_auteurs","nom=".sql_quote($nom)))\r
+               return $id_auteur\r
 \r
-    // auteur inconnu, on le cree ... \r
-    return sql_insertq('spip_auteurs',array('nom'=>$nom,'statut'=>'1comite'));\r
+       // auteur inconnu, on le cree ... \r
+       return sql_insertq('spip_auteurs',array('nom'=>$nom,'statut'=>'1comite'));\r
 }\r
 \r
 //\r
@@ -196,7 +207,7 @@ function extraire_enclosures($tags) {
  * \r
  * Nettoyer l'utf-8 et ses accents \r
  *\r
-**/\r
+ */\r
 function clean_utf8($t) {\r
        if (!preg_match('!\S!u', $t))\r
                $t = preg_replace_callback(',&#x([0-9a-f]+);,i', 'utf8_do', utf8_encode(utf8_decode($t)));\r
@@ -234,7 +245,6 @@ function html2spip($lapage){
        // images (cf ressource)\r
        $lapage = preg_replace(",<img[ \t\n\r][^<>]*src=[^<>]*(http[^<>'\"]*)[^<>]*>,uims","[img]\\1[//img]", $lapage);\r
 \r
-               \r
        // intertitres\r
        $lapage = preg_replace(",<(h[1-3])( [^>]*)?".">(.+)</\\1>,Uims", "\r{{{ \\3 }}}\r", $lapage);\r
        // tableaux\r
index 726711c..9969231 100644 (file)
@@ -1,37 +1,37 @@
 <?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// This is a SPIP language file        --      Ceci est un fichier langue de SPIP
 if (!defined("_ECRIRE_INC_VERSION")) return;
 
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
-  // A
-  'article_origine' => '&#1607;&#1584;&#1575; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1605;&#1606;&#1602;&#1608;&#1604; &#1593;&#1606; &#1605;&#1608;&#1602;&#1593;',
-  'activer_recopie_intro' => '&#1578;&#1583;&#1601;&#1602; RSS &#1575;&#1604;&#1609; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;',
-  'activer_recopie' => '&#1606;&#1587;&#1582; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578; &#1575;&#1604;&#1606;&#1575;&#1578;&#1581;&#1577; &#1593;&#1606; &#1578;&#1583;&#1601;&#1602; RSS &#1575;&#1604;&#1609; &#1605;&#1602;&#1575;&#1604;&#1575;&#1578; SPIP',
+       // A
+       'article_origine' => '&#1607;&#1584;&#1575; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1605;&#1606;&#1602;&#1608;&#1604; &#1593;&#1606; &#1605;&#1608;&#1602;&#1593;',
+       'activer_recopie_intro' => '&#1578;&#1583;&#1601;&#1602; RSS &#1575;&#1604;&#1609; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;',
+       'activer_recopie' => '&#1606;&#1587;&#1582; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578; &#1575;&#1604;&#1606;&#1575;&#1578;&#1581;&#1577; &#1593;&#1606; &#1578;&#1583;&#1601;&#1602; RSS &#1575;&#1604;&#1609; &#1605;&#1602;&#1575;&#1604;&#1575;&#1578; SPIP',
 
-  // C
-  'citer_source' => '&#1603;&#1585; &#1575;&#1604;&#1605;&#1589;&#1583;&#1585;',
-  'citer_source_oui' => '&#1584;&#1603;&#1585; &#1593;&#1606;&#1608;&#1575;&#1606; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1575;&#1604;&#1605;&#1589;&#1583;&#1585; &#1601;&#1610; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1575;&#1604;&#1605;&#1587;&#1578;&#1608;&#1585;&#1583;',
-  'copie_logo' => '&#1606;&#1587;&#1582; &#1588;&#1593;&#1575;&#1585; &#1575;&#1604;&#1605;&#1608;&#1602;&#1593; &#1608;&#1580;&#1593;&#1604;&#1607; &#1587;&#1593;&#1575;&#1585; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;',
+       // C
+       'citer_source' => '&#1603;&#1585; &#1575;&#1604;&#1605;&#1589;&#1583;&#1585;',
+       'citer_source_oui' => '&#1584;&#1603;&#1585; &#1593;&#1606;&#1608;&#1575;&#1606; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1575;&#1604;&#1605;&#1589;&#1583;&#1585; &#1601;&#1610; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604; &#1575;&#1604;&#1605;&#1587;&#1578;&#1608;&#1585;&#1583;',
+       'copie_logo' => '&#1606;&#1587;&#1582; &#1588;&#1593;&#1575;&#1585; &#1575;&#1604;&#1605;&#1608;&#1602;&#1593; &#1608;&#1580;&#1593;&#1604;&#1607; &#1587;&#1593;&#1575;&#1585; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;',
 
-  // S
-  'statut_article_importe' => '&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578; &#1575;&#1604;&#1605;&#1587;&#1578;&#1608;&#1585;&#1583;&#1577;',
-  'suivi_syndic' => '&#1605;&#1578;&#1575;&#1576;&#1593;&#1577; &#1575;&#1604;&#1578;&#1585;&#1582;&#1610;&#1589;',
+       // S
+       'statut_article_importe' => '&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578; &#1575;&#1604;&#1605;&#1587;&#1578;&#1608;&#1585;&#1583;&#1577;',
+       'suivi_syndic' => '&#1605;&#1578;&#1575;&#1576;&#1593;&#1577; &#1575;&#1604;&#1578;&#1585;&#1582;&#1610;&#1589;',
 
-  // E
-  'email_alerte' => '&#1573;&#1606;&#1584;&#1575;&#1585; &#1576;&#1575;&#1604;&#1576;&#1585;&#1610;&#1583; &#1575;&#1604;&#1573;&#1604;&#1603;&#1578;&#1585;&#1608;&#1606;&#1610; &#1593;&#1606;&#1583; &#1603;&#1604; &#1578;&#1585;&#1582;&#1610;&#1589; &#1601;&#1610; &#1605;&#1602;&#1575;&#1604;&#1567;',
-  'email_alerte_email' => '&#1601;&#1610; &#1581;&#1575;&#1604; &#1575;&#1604;&#1605;&#1608;&#1575;&#1601;&#1602;&#1577;&#1548; &#1593;&#1604;&#1609; &#1571;&#1610; &#1593;&#1606;&#1608;&#1575;&#1606; &#1610;&#1578;&#1605; &#1573;&#1585;&#1587;&#1575;&#1604; &#1575;&#1604;&#1573;&#1606;&#1584;&#1575;&#1585;&#1567;',
+       // E
+       'email_alerte' => '&#1573;&#1606;&#1584;&#1575;&#1585; &#1576;&#1575;&#1604;&#1576;&#1585;&#1610;&#1583; &#1575;&#1604;&#1573;&#1604;&#1603;&#1578;&#1585;&#1608;&#1606;&#1610; &#1593;&#1606;&#1583; &#1603;&#1604; &#1578;&#1585;&#1582;&#1610;&#1589; &#1601;&#1610; &#1605;&#1602;&#1575;&#1604;&#1567;',
+       'email_alerte_email' => '&#1601;&#1610; &#1581;&#1575;&#1604; &#1575;&#1604;&#1605;&#1608;&#1575;&#1601;&#1602;&#1577;&#1548; &#1593;&#1604;&#1609; &#1571;&#1610; &#1593;&#1606;&#1608;&#1575;&#1606; &#1610;&#1578;&#1605; &#1573;&#1585;&#1587;&#1575;&#1604; &#1575;&#1604;&#1573;&#1606;&#1584;&#1575;&#1585;&#1567;',
 
-  // I
-  'install_rssarticle' => '&#1573;&#1606;&#1588;&#1575;&#1569; &#1580;&#1583;&#1608;&#1604; spip_articles_syndic',
+       // I
+       'install_rssarticle' => '&#1573;&#1606;&#1588;&#1575;&#1569; &#1580;&#1583;&#1608;&#1604; spip_articles_syndic',
 
-  // M
-  'mode' => '&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1578;&#1588;&#1594;&#1610;&#1604;',
-  'mode_auto' => '&#1575;&#1604;&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1570;&#1604;&#1610;&#1577;: &#1606;&#1587;&#1582; &#1603;&#1604; &#1575;&#1604;&#1605;&#1608;&#1575;&#1602;&#1593; &#1575;&#1604;&#1605;&#1576;&#1608;&#1576;&#1577; &#1603;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;',
-  'mode_manuel' => '&#1575;&#1604;&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1610;&#1583;&#1608;&#1610;&#1577;: &#1578;&#1581;&#1583;&#1583; &#1610;&#1583;&#1608;&#1610;&#1575;&#1611; &#1575;&#1604;&#1605;&#1608;&#1575;&#1602;&#1593; &#1575;&#1604;&#1605;&#1576;&#1608;&#1576;&#1577; &#1575;&#1604;&#1578;&#1610; &#1578;&#1585;&#1610;&#1583; &#1606;&#1587;&#1582;&#1607;&#1575; &#1603;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;'
+       // M
+       'mode' => '&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1578;&#1588;&#1594;&#1610;&#1604;',
+       'mode_auto' => '&#1575;&#1604;&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1570;&#1604;&#1610;&#1577;: &#1606;&#1587;&#1582; &#1603;&#1604; &#1575;&#1604;&#1605;&#1608;&#1575;&#1602;&#1593; &#1575;&#1604;&#1605;&#1576;&#1608;&#1576;&#1577; &#1603;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;',
+       'mode_manuel' => '&#1575;&#1604;&#1608;&#1590;&#1593;&#1610;&#1577; &#1575;&#1604;&#1610;&#1583;&#1608;&#1610;&#1577;: &#1578;&#1581;&#1583;&#1583; &#1610;&#1583;&#1608;&#1610;&#1575;&#1611; &#1575;&#1604;&#1605;&#1608;&#1575;&#1602;&#1593; &#1575;&#1604;&#1605;&#1576;&#1608;&#1576;&#1577; &#1575;&#1604;&#1578;&#1610; &#1578;&#1585;&#1610;&#1583; &#1606;&#1587;&#1582;&#1607;&#1575; &#1603;&#1605;&#1602;&#1575;&#1604;&#1575;&#1578;'
 
 );
-
+       
 
 ?>
index c8686b1..7b6b3d1 100644 (file)
@@ -1,48 +1,47 @@
 <?php\r
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP\r
+// This is a SPIP language file        --      Ceci est un fichier langue de SPIP\r
 if (!defined("_ECRIRE_INC_VERSION")) return;\r
 \r
 \r
 $GLOBALS[$GLOBALS['idx_lang']] = array(\r
+       \r
+       // A\r
+       'article_origine' => 'Cet article est repris du site', \r
+       'activer_recopie_intro' => 'Flux RSS en Articles',\r
+       'activer_recopie' => 'Copier les articles issus de ce flux RSS en articles SPIP',\r
 \r
-  // A\r
-  'article_origine' => 'Cet article est repris du site', \r
-  'activer_recopie_intro' => 'Flux RSS en Articles',\r
-  'activer_recopie' => 'Copier les articles issus de ce flux RSS en articles SPIP',\r
+       // C\r
+       'citer_source' => 'Citer la source',\r
+       'citer_source_oui' => 'Citer l\'URL de l\'article d\'origine dans l\'article import&eacute;',\r
+       'configuration_rssarticle' => 'Flux RSS en articles',\r
+       'copie_logo' => 'Recopier le logo du site comme logo d\'article',\r
+       'cron_interval' => 'Fréquence de la copie des flux RSS en articles',\r
+       'cron_interval_timer' => 'Intervalle en seconde ',\r
+       \r
+       //R\r
+       'html2spip' => 'Passer le HTML en syntaxe SPIP. Utilisez le plugin "ressource" pour afficher ensuite les images.',\r
 \r
-  // C\r
-  'citer_source' => 'Citer la source',\r
-  'citer_source_oui' => 'Citer l\'URL de l\'article d\'origine dans l\'article import&eacute;',\r
-  'configuration_rssarticle' => 'Flux RSS en articles',\r
-  'copie_logo' => 'Recopier le logo du site comme logo d\'article',\r
-  'cron_interval' => 'Fréquence de la copie des flux RSS en articles',\r
-  'cron_interval_timer' => 'Intervalle en seconde ',\r
-  \r
-  //R\r
-  'html2spip' => 'Passer le HTML en syntaxe SPIP. Utilisez le plugin "ressource" pour afficher ensuite les images.',\r
-\r
-  // S\r
-  'statut_article_importe' => 'Statut des articles import&eacute;s',\r
-  'suivi_syndic' => 'Suivi de la syndication',\r
-  'site_maj' => 'Option enregistrée',\r
-  \r
-  // E\r
-  'email_alerte' => 'Pr&eacute;venir par email &agrave; chaque nouvelle syndication en articles ?',\r
-  'email_alerte_email' => 'Si oui, sur quel email ? ',\r
-  \r
-  // I\r
-  'install_rssarticle' => 'Cr&eacute;ation de la table spip_articles_syndic',\r
-  \r
-  // M\r
-  'maj_manuelle' => 'La copie manuelle des derniers flux RSS en articles a été effectuée',\r
-  'maj_recharge' => 'Relancer la copie manuelle',\r
-  'mode' => 'Mode de fonctionnement',\r
-  'mode_auto' => 'Mode automatique: tous les sites r&eacute;f&eacute;renc&eacute;s sont recopi&eacute;s en articles',\r
-  'mode_manuel' => 'Mode manuel: vous selectionnez manuellement les sites r&eacute;f&eacute;renc&eacute;s qui doivent être recopi&eacute;s en articles',\r
-  \r
-  // T\r
-  'titre_page_configurer_rssarticle' => 'Copie RSS en articles'\r
-  \r
+       // S\r
+       'statut_article_importe' => 'Statut des articles import&eacute;s',\r
+       'suivi_syndic' => 'Suivi de la syndication',\r
+       'site_maj' => 'Option enregistrée',\r
+       \r
+       // E\r
+       'email_alerte' => 'Pr&eacute;venir par email &agrave; chaque nouvelle syndication en articles ?',\r
+       'email_alerte_email' => 'Si oui, sur quel email ? ',\r
+       \r
+       // I\r
+       'install_rssarticle' => 'Cr&eacute;ation de la table spip_articles_syndic',\r
+       \r
+       // M\r
+       'maj_manuelle' => 'La copie manuelle des derniers flux RSS en articles a été effectuée',\r
+       'maj_recharge' => 'Relancer la copie manuelle',\r
+       'mode' => 'Mode de fonctionnement',\r
+       'mode_auto' => 'Mode automatique: tous les sites r&eacute;f&eacute;renc&eacute;s sont recopi&eacute;s en articles',\r
+       'mode_manuel' => 'Mode manuel: vous selectionnez manuellement les sites r&eacute;f&eacute;renc&eacute;s qui doivent être recopi&eacute;s en articles',\r
+       \r
+       // T\r
+       'titre_page_configurer_rssarticle' => 'Copie RSS en articles'\r
 );\r
 \r
 \r
index f7dc1f6..5224eeb 100644 (file)
@@ -1,21 +1,21 @@
 <paquet\r
        prefix="rssarticle"\r
        categorie="edition"\r
-       version="1.1.2"\r
+       version="1.1.4"\r
        etat="stable"\r
-       compatibilite="[3.0.2;3.0.*]"\r
+       compatibilite="[3.0.2;3.1.*]"\r
        logo="prive/themes/spip/images/rssarticle-64.png"\r
        documentation="http://contrib.spip.net/Flux-RSS-en-articles"\r
        schema="1.0.0" \r
 >\r
        <nom>Flux RSS en articles</nom>\r
        <auteur lien='http://www.erational.org'>erational</auteur>\r
-  <auteur>LudoRA</auteur>\r
+       <auteur>LudoRA</auteur>\r
        <licence>GNU/GPL v3</licence>\r
-        <pipeline nom="declarer_tables_principales" inclure="base/rssarticle.php"/>\r
-        <pipeline nom="declarer_tables_interfaces" inclure="base/rssarticle.php"/>\r
-        <pipeline nom="declarer_tables_auxiliaires" inclure="base/rssarticle.php"/>\r
-        <pipeline nom="taches_generales_cron" inclure="rssarticle_pipelines.php"/>\r
-        <pipeline nom="affiche_milieu" inclure="rssarticle_pipelines.php"/>\r
+       <pipeline nom="declarer_tables_principales" inclure="base/rssarticle.php"/>\r
+       <pipeline nom="declarer_tables_interfaces" inclure="base/rssarticle.php"/>\r
+       <pipeline nom="declarer_tables_auxiliaires" inclure="base/rssarticle.php"/>\r
+       <pipeline nom="taches_generales_cron" inclure="rssarticle_pipelines.php"/>\r
+       <pipeline nom="affiche_milieu" inclure="rssarticle_pipelines.php"/>\r
        <menu nom="configurer_rssarticle" titre="rssarticle:configuration_rssarticle" parent="menu_configuration" icone="images/rssarticle-16.png" />\r
 </paquet>\r
index 6de5685..45278ce 100644 (file)
@@ -1,3 +1,3 @@
 <div class="ajax">
-  #FORMULAIRE_EDITER_RSSARTICLE{#ID_SYNDIC}
+       #FORMULAIRE_EDITER_RSSARTICLE{#ID_SYNDIC}
 </div>
\ No newline at end of file
index edf8166..ff38077 100644 (file)
Binary files a/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-128.png and b/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-128.png differ
index ce22674..7e3d9e7 100644 (file)
Binary files a/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-16.png and b/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-16.png differ
index 391ac79..37b5d4f 100644 (file)
Binary files a/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-32.png and b/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-32.png differ
index edf8166..95d02ea 100644 (file)
Binary files a/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-64.png and b/www/plugins/rss_article_3_0/prive/themes/spip/images/rssarticle-64.png differ
index 5548c82..fbdd1c0 100644 (file)
@@ -1,48 +1,47 @@
 <?php
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
 $GLOBALS['rssarticle_base_version'] = 0.3;
-    
-function rssarticle_upgrade(){
 
-               $version_base = $GLOBALS['rssarticle_base_version'];
-               $current_version = 0.0;
-               if ((!isset($GLOBALS['meta']['rssarticle_base_version']) )
-                               || (($current_version = $GLOBALS['meta']['rssarticle_base_version'])!=$version_base)){
-                       include_spip('base/rssarticle');
-                       if ($current_version==0.0){
-                               include_spip('base/create');
-                               include_spip('base/abstract_sql');
-                               creer_base();   
-                               maj_tables('spip_syndic');
-        echo "<p>"._T('rssarticle:install_rssarticle')."</p>"; 
-                         ecrire_meta('rssarticle_base_version',$current_version=$version_base,'non');                          
-                       }
-                       
-                       if (version_compare($current_version,"0.3","<")){
-                         include_spip('base/create');
-                         maj_tables('spip_syndic');
-                         echo "<p>"._T('rssarticle:mise_a_jour_v03')."</p>"; 
-                         ecrire_meta('rssarticle_base_version',$current_version="0.3",'non');
-                 }
+function rssarticle_upgrade(){
+       $version_base = $GLOBALS['rssarticle_base_version'];
+       $current_version = 0.0;
+       if ((!isset($GLOBALS['meta']['rssarticle_base_version']) )
+                       || (($current_version = $GLOBALS['meta']['rssarticle_base_version'])!=$version_base)){
+               include_spip('base/rssarticle');
+               if ($current_version==0.0){
+                       include_spip('base/create');
+                       include_spip('base/abstract_sql');
+                       creer_base();   
+                       maj_tables('spip_syndic');
+                       echo "<p>"._T('rssarticle:install_rssarticle')."</p>"; 
+                       ecrire_meta('rssarticle_base_version',$current_version=$version_base,'non');
+               }
                
-                       ecrire_metas();
+               if (version_compare($current_version,"0.3","<")){
+                       include_spip('base/create');
+                       maj_tables('spip_syndic');
+                       echo "<p>"._T('rssarticle:mise_a_jour_v03')."</p>"; 
+                       ecrire_meta('rssarticle_base_version',$current_version="0.3",'non');
                }
+               ecrire_metas();
+       }
 }
 
-
-       
 function rssarticle_install($action){
-               $version_base = $GLOBALS['rssarticle_base_version'];
-               switch ($action){
-                       case 'test':
-                               return (isset($GLOBALS['meta']['rssarticle_base_version']) AND ($GLOBALS['meta']['rssarticle_base_version']>=$version_base));
-                               break;
-                       case 'install':
-                               rssarticle_upgrade();
-                               break;
-                       case 'uninstall':
-                               rssarticle_vider_tables();                                                              
-                               break;
-               }
+       $version_base = $GLOBALS['rssarticle_base_version'];
+       switch ($action){
+               case 'test':
+                       return (isset($GLOBALS['meta']['rssarticle_base_version']) AND ($GLOBALS['meta']['rssarticle_base_version']>=$version_base));
+                       break;
+               case 'install':
+                       rssarticle_upgrade();
+                       break;
+               case 'uninstall':
+                       rssarticle_vider_tables();
+                       break;
+       }
 }
 
 /**
@@ -52,9 +51,9 @@ function rssarticle_install($action){
  */
        
 function rssarticle_vider_tables() {
-    sql_alter("TABLE spip_syndic DROP rssarticle");
-               spip_query("DROP TABLE spip_articles_syndic");
-               effacer_meta('rssarticle_base_version');
-               ecrire_metas();
+       sql_alter("TABLE spip_syndic DROP rssarticle");
+       spip_query("DROP TABLE spip_articles_syndic");
+       effacer_meta('rssarticle_base_version');
+       ecrire_metas();
 }
 ?>
index 491da0c..ed9d148 100644 (file)
@@ -1,21 +1,20 @@
 <?php\r
 /**\r
- * genie / cron\r
+ * Pipelines utilisés par le plugin RSS en articles\r
  *\r
  */\r
-function rssarticle_taches_generales_cron($taches_generales){\r
-  $delai =  60*10; // valeur defaut: ts les 10 min \r
-  \r
-  // si cfg dispo, on charge les valeurs\r
-  if (function_exists(lire_config))  {\r
-        if (lire_config('rssarticle/cron_interval_value')!="") {    // verifier si champs CFG a ete renseigne sur ce plugin (retro-compat)       \r
-            $delai = intval(lire_config('rssarticle/cron_interval_value')); \r
-            if ($delai<10)    \r
-                      $delai=10;        // securite pour les valeurs absurdes             \r
-        }      \r
-  } \r
+\r
+if (!defined("_ECRIRE_INC_VERSION")) return;\r
+\r
+function rssarticle_taches_generales_cron($taches_generales){ \r
+       // si cfg dispo, on charge les valeurs\r
+       if (!function_exists('lire_config'))\r
+               include_spip('inc/config');\r
+       $delai = intval(lire_config('rssarticle/cron_interval_value',600));\r
+       if ($delai<10)\r
+               $delai=10;              // securite pour les valeurs absurdes\r
        $taches_generales['rssarticle_copie'] = $delai;\r
-  \r
+\r
        return $taches_generales;\r
 }\r
 \r
@@ -24,28 +23,25 @@ function rssarticle_taches_generales_cron($taches_generales){
  * Affiche un formulaire d'édition de la licence de l'article\r
  *\r
  * @param array $flux Le contexte du pipeline\r
+ * @return array $flux Le contexte du pipeline modifié\r
  */\r
 function rssarticle_affiche_milieu($flux) {\r
-    if ($flux['args']['exec'] == 'site'){\r
-        include_spip('inc/config');\r
-        if (lire_config('rssarticle/mode')=="auto") $mode_auto=true; else  $mode_auto=false;\r
-        \r
-        if (!$mode_auto) {\r
-            $contexte['id_syndic'] = $flux["args"]["id_syndic"];\r
-            //$out = debut_cadre_relief(_DIR_PLUGIN_RSSARTICLE."prive/themes/spip/images/rssarticle-32.png", true, '',_T("rssarticle:activer_recopie_intro"));\r
-            $out .= "\n<div id='bloc_rssarticle'>";\r
-            $out .= "\n". recuperer_fond('prive/contenu/rssarticle',$contexte,array('ajax'=>false));\r
-            $out .= "\n</div>";\r
-            //$out .= "\n". fin_cadre_relief(true);\r
-            if ($p=strpos($flux['data'],'<!--affiche_milieu-->'))\r
-                $flux['data'] = substr_replace($flux['data'],$out,$p,0);\r
-                \r
-               \r
-        }\r
-    }\r
-    return $flux;\r
+       if ($flux['args']['exec'] == 'site'){\r
+               include_spip('inc/config');\r
+               if (lire_config('rssarticle/mode') == "auto")\r
+                       $mode_auto=true;\r
+               else\r
+                       $mode_auto=false;\r
+               \r
+               if (!$mode_auto) {\r
+                       $out .= "\n<div id='bloc_rssarticle'>";\r
+                       $out .= "\n". recuperer_fond('prive/contenu/rssarticle',array('id_syndic' => $flux["args"]["id_syndic"]),array('ajax'=>false));\r
+                       $out .= "\n</div>";\r
+                       if ($p=strpos($flux['data'],'<!--affiche_milieu-->'))\r
+                               $flux['data'] = substr_replace($flux['data'],$out,$p,0);\r
+               }\r
+       }\r
+       return $flux;\r
 }\r
 \r
-\r
-\r
-?>\r
+?>
\ No newline at end of file
index dbd1b87..96a99b7 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/rss_article/trunk
-Revision: 83421
-Dernier commit: 2014-06-23 09:03:15 +0200 
+Revision: 94788
+Dernier commit: 2016-01-28 13:23:37 +0100 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/rss_article/trunk</origine>
-<revision>83421</revision>
-<commit>2014-06-23 09:03:15 +0200 </commit>
+<revision>94788</revision>
+<commit>2016-01-28 13:23:37 +0100 </commit>
 </svn_revision>
\ No newline at end of file
index 5bee2b1..eeea9ee 100644 (file)
@@ -5,8 +5,10 @@
  *
  * @package SPIP\Saisies\Action
  */
-if (!defined("_ECRIRE_INC_VERSION")) return;
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Action de déplacement de saisies dans le constructeur de formulaires
@@ -24,19 +26,19 @@ function action_deplacer_saisie_dist() {
        $formulaire_actuel = session_get($session);
 
        if (!$formulaire_actuel) {
-               return "";
+               return '';
        }
 
        include_spip('inc/saisies');
-       
+
        $saisies_actuelles = saisies_lister_par_identifiant($formulaire_actuel);
        if (!isset($saisies_actuelles[$identifiant])) {
-               return "";
+               return '';
        }
 
        // tester @id et [@id] (fieldset)
-       if ($ou and !isset($saisies_actuelles[$ou]) and !isset($saisies_actuelles[ substr($ou,1,-1) ])) {
-               return "";
+       if ($ou and !isset($saisies_actuelles[$ou]) and !isset($saisies_actuelles[ substr($ou, 1, -1) ])) {
+               return '';
        }
 
        // on deplace ou c'est demande...
@@ -45,4 +47,3 @@ function action_deplacer_saisie_dist() {
        // On sauve tout ca
        $formulaire_actuel = session_set($session, $formulaire_actuel);
 }
-
index f362eed..75dabf4 100644 (file)
@@ -6,7 +6,9 @@
  */
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Compile la balise `#CONFIGURER_SAISIE`
@@ -14,11 +16,11 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @uses Pile::recuperer_et_supprimer_argument_balise()
  * @uses Pile::creer_et_ajouter_argument_balise()
  * @see balise_INCLURE_dist()
- *  
+ *
  * @param Champ $p
  * @return Champ
 **/
-function balise_CONFIGURER_SAISIE_dist($p){
+function balise_CONFIGURER_SAISIE_dist($p) {
 
        // On recupere le premier argument : le nom de la saisie
        $saisie = Pile::recuperer_et_supprimer_argument_balise(1, $p);
@@ -40,5 +42,3 @@ function balise_CONFIGURER_SAISIE_dist($p){
        }
 
 }
-
-
index 6a37f12..cf8242d 100644 (file)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 
 /**
  * Gestion de la balise `#GENERER_SAISIES`
@@ -7,7 +7,9 @@
  */
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Compile la balise `#GENERER_SAISIES` qui retourne le code HTML des saisies de formulaire,
@@ -24,13 +26,13 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @uses Pile::recuperer_et_supprimer_argument_balise()
  * @uses Pile::creer_et_ajouter_argument_balise()
  * @see balise_INCLURE_dist()
- * 
+ *
  * @param Champ $p
  *     Pile au niveau de la balise
  * @return Champ
  *     Pile complété du code à générer
 **/
-function balise_GENERER_SAISIES_dist($p){
+function balise_GENERER_SAISIES_dist($p) {
 
        // On recupere le premier (et seul) argument : le tableau decrivant ce qu'on veut generer
        $config = Pile::recuperer_et_supprimer_argument_balise(1, $p);
@@ -52,4 +54,3 @@ function balise_GENERER_SAISIES_dist($p){
        }
 
 }
-
index 9149b8c..86d8b97 100644 (file)
@@ -6,7 +6,9 @@
  * @package SPIP\Saisies\Balises
 **/
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 // pour ne pas interferer avec d'eventuelles futures fonctions du core
 // on met le tout dans une classe ; les fonctions sont autonomes.
@@ -20,11 +22,11 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  *     transmettent des arguments supplémentaires automatiquement, à des balises
  *     déjà existantes.
  *     Voir un exemple d'utilisation dans `balise_SAISIE_dist()`.
- * 
+ *
  * @note
  *     Les arguments sont stockés sont dans l'entree 0 de la propriété `param`
  *     dans l'objet Champ (représenté par `$p`), donc dans `$p->param[0]`.
- * 
+ *
  *     `param[0][0]` vaut toujours '' (ou presque ?)
  *
  * @see balise_SAISIE_dist() Pour un exemple d'utilisation
@@ -34,7 +36,7 @@ class Pile {
 
        /**
         * Récupère un argument de balise
-        * 
+        *
         * @param int $pos
         * @param Champ $p
         * @return mixed|null Élément de l'AST représentant l'argument s'il existe
@@ -62,7 +64,7 @@ class Pile {
                }
                if (!isset($p->param[0][$pos])) {
                        return null;
-               }       
+               }
                if ($pos == 0) {
                        array_shift($p->param[0]);
                } else {
@@ -79,7 +81,7 @@ class Pile {
         *
         * @uses Pile::recuperer_argument_balise()
         * @uses Pile::supprimer_argument_balise()
-        * 
+        *
         * @param int $pos
         * @param Champ $p
         * @return mixed|null Élément de l'AST représentant l'argument s'il existe
@@ -95,7 +97,7 @@ class Pile {
         * Ajoute un argument de balise
         *
         * Empile l'argument à la suite des arguments déjà existants pour la balise
-        * 
+        *
         * @param mixed $element Élément de l'AST représentant l'argument à ajouter
         * @param Champ $p
         * @return Champ
@@ -122,11 +124,11 @@ class Pile {
         *     ```
         *     $nom = Pile::creer_argument_balise(nom);           // {nom}
         *     $nom = Pile::creer_argument_balise(nom, 'coucou'); // {nom=coucou}
-        *     
+        *
         *     $balise = Pile::creer_balise('BALISE');
         *     $nom = Pile::creer_argument_balise(nom, $balise);  // {nom=#BALISE}
         *     ```
-        * 
+        *
         * @param string $nom
         *     Nom de l'argument
         * @param string|object $valeur
@@ -138,26 +140,24 @@ class Pile {
                $s = new Texte;
                $s->texte = $nom;
                $s->ligne=0;
-               
+
                // si #BALISE cree avec Pile::creer_balise(), le mettre en array, comme les autres
                if (is_object($valeur)) {
                        $valeur = array($valeur);
                }
-               
+
                $res = null;
-               
+
                // {nom}
                if (is_null($valeur)) {
                        $res = array($s);
-               } 
-               // {nom=coucou}
-               elseif (is_string($valeur)) {
+               } elseif (is_string($valeur)) {
+                       // {nom=coucou}
                        $s->texte .= "=$valeur";
                        $res = array($s);
-               }
-               // {nom=#BALISE}
-               elseif (is_array($valeur)) {
-                       $s->texte .= "="; // /!\ sans cette toute petite chose, ça ne fait pas d'egalite :)
+               } elseif (is_array($valeur)) {
+                       // {nom=#BALISE}
+                       $s->texte .= '='; // /!\ sans cette toute petite chose, ça ne fait pas d'egalite :)
                        $res = array_merge(array($s), $valeur);
                }
 
@@ -170,7 +170,7 @@ class Pile {
         *
         * @uses Pile::creer_argument_balise()
         * @uses Pile::ajouter_argument_balise()
-        * 
+        *
         * @param Champ $p
         * @param string $nom
         *     Nom de l'argument
@@ -179,7 +179,7 @@ class Pile {
         * @return Champ
        **/
        static function creer_et_ajouter_argument_balise($p, $nom, $valeur = null) {
-               $new = Pile::creer_argument_balise($nom, $valeur); 
+               $new = Pile::creer_argument_balise($nom, $valeur);
                return Pile::ajouter_argument_balise($new, $p);
        }
 
@@ -191,10 +191,10 @@ class Pile {
         * @example
         *     ```
         *     // Crée : #ENV*{titre}
-        *     $titre = Pile::recuperer_argument_balise(1, $p); // $titre, 1er argument de la balise actuelle 
+        *     $titre = Pile::recuperer_argument_balise(1, $p); // $titre, 1er argument de la balise actuelle
         *     $env = Pile::creer_balise('ENV', array('param' => array($titre), 'etoile' => '*'));
         *     ```
-        * 
+        *
         * @param string $nom
         *     Nom de la balise
         * @param array $opt
@@ -205,8 +205,8 @@ class Pile {
                include_spip('public/interfaces');
                $b = new Champ;
                $b->nom_champ = strtoupper($nom);
-               foreach ($opt as $o=>$val) {
-                       if (property_exists($b,$o)) {
+               foreach ($opt as $o => $val) {
+                       if (property_exists($b, $o)) {
                                if ($o == 'param') {
                                        array_unshift($val, '');
                                        $b->$o = array($val);
@@ -229,7 +229,7 @@ class Pile {
  * La balise `#SAISIE` est un raccourci pour une écriture plus compliquée de la balise `#INCLURE`.
  * La balise calcule une série de paramètre récupérer et à transmettre à `#INCLURE`,
  * en fonction des valeurs des 2 premiers paramètres transmis.
- * 
+ *
  * Les autres arguments sont transmis tels quels à la balise `#INCLURE`.
  *
  * Ainsi `#SAISIE{input,nom,label=Nom,...}` exécutera l'équivalent de
@@ -270,5 +270,3 @@ function balise_SAISIE_dist($p) {
                return balise_INCLURE_dist($p);
        }
 }
-
-
index 8ed9f94..f203003 100644 (file)
@@ -8,23 +8,25 @@
 
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Compile la balise `#VOIR_SAISIE` qui retourne le code HTML de la vue d'une saisie indiquée
  *
  * Cette balise incluera le squelette `saisies-vues/_base.html` et lui-même `saisies-vues/{type}.html`
- * 
+ *
  * @syntaxe `#VOIR_SAISIE{type,nom[,option=valeur,...]}`
  * @uses Pile::recuperer_et_supprimer_argument_balise()
  * @uses Pile::creer_et_ajouter_argument_balise()
  * @uses Pile::creer_balise()
  * @see balise_INCLURE_dist()
- * 
+ *
  * @param Champ $p
  * @return Champ
  */
-function balise_VOIR_SAISIE_dist ($p) {
+function balise_VOIR_SAISIE_dist($p) {
 
        // on recupere les parametres sans les traduire en code d'execution php
        $type_saisie = Pile::recuperer_et_supprimer_argument_balise(1, $p);
@@ -42,7 +44,7 @@ function balise_VOIR_SAISIE_dist ($p) {
 
        // on appelle la balise #INCLURE
        // avec les arguments ajoutes
-       if(function_exists('balise_INCLURE')) {
+       if (function_exists('balise_INCLURE')) {
                return balise_INCLURE($p);
        } else {
                return balise_INCLURE_dist($p);
index 482c418..ed8fd93 100644 (file)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 /**
  * Déclaration de la balise `#VOIR_SAISIES`
  *
@@ -6,7 +6,9 @@
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Compile la balise `#VOIR_SAISIES` qui retourne le code HTML des vues de formulaire,
@@ -18,18 +20,18 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * Cette balise est un raccourcis :
  * - `#VOIR_SAISIES{#TABLEAU_DE_SAISIES}` est équivalent à
  * - `#INCLURE{fond=inclure/voir_saisies,env,saisies=#TABLEAU_DE_SAISIES}`
- * 
+ *
  * @syntaxe `#VOIR_SAISIE{#TABLEAU_DE_SAISIES}`
  * @uses Pile::recuperer_et_supprimer_argument_balise()
  * @uses Pile::creer_et_ajouter_argument_balise()
  * @see balise_INCLURE_dist()
- * 
+ *
  * @param Champ $p
  *     Pile au niveau de la balise
  * @return Champ
  *     Pile complété du code à générer
 **/
-function balise_VOIR_SAISIES_dist($p){
+function balise_VOIR_SAISIES_dist($p) {
 
        // On recupere les arguments : les tableaux decrivant ce qu'on veut generer + les reponses
        $saisies = Pile::recuperer_et_supprimer_argument_balise(1, $p);
@@ -46,7 +48,7 @@ function balise_VOIR_SAISIES_dist($p){
        $p = Pile::creer_et_ajouter_argument_balise($p, 'valeurs', $valeurs);
 
        // On redirige vers la balise INCLURE
-       if(function_exists('balise_INCLURE')) {
+       if (function_exists('balise_INCLURE')) {
                return balise_INCLURE($p);
        } else {
                return balise_INCLURE_dist($p);
index 388ca47..85773be 100644 (file)
@@ -84,7 +84,8 @@
                                        .attr('id', 'formulaire_configurer-contenu-'+i)
                                        .addClass('formulaire_configurer-contenu');
                                // On récupère le titre (en le cachant au passage)
-                               var titre = $(this).find('[(#GLOBALS{debut_intertitre,<h3>}|replace{"<(\S*).*>",$1,i})]').eq(0).hide().text();
+                               var titre = $(this).find('[(#VAL{"{{{ titre }}}"}|propre|replace{"<(\S*).*>",$1,i})]').eq(0).hide().text();
+
                                // On crée un onglet
                                var $onglet = $('<li><a href="#formulaire_configurer-contenu-'+i+'">'+titre+'</a></li>');
                                $onglet
index 21b934e..f389534 100644 (file)
@@ -1,68 +1,70 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function formulaires_construire_formulaire_charger($identifiant, $formulaire_initial=array(), $options=array()){
+function formulaires_construire_formulaire_charger($identifiant, $formulaire_initial = array(), $options = array()) {
        include_spip('inc/saisies');
        $contexte = array();
-       
+
        // On ajoute un préfixe devant l'identifiant, pour être sûr
        $identifiant = 'constructeur_formulaire_'.$identifiant;
        $contexte['_identifiant_session'] = $identifiant;
-       
-       // On vérifie ce qui a été passé en paramètre 
-       if (!is_array($formulaire_initial)) $formulaire_initial = array();
-       
+
+       // On vérifie ce qui a été passé en paramètre
+       if (!is_array($formulaire_initial)) {
+               $formulaire_initial = array();
+       }
+
        // On initialise la session si elle est vide
-       if (is_null($formulaire_actuel = session_get($identifiant))){
+       if (is_null($formulaire_actuel = session_get($identifiant))) {
                session_set($identifiant, $formulaire_initial);
                $formulaire_actuel = $formulaire_initial;
        }
-       
+
        // Si le formulaire actuel est différent du formulaire initial on agite un drapeau pour le dire
-       if ($formulaire_actuel != $formulaire_initial){
+       if ($formulaire_actuel != $formulaire_initial) {
                $contexte['formulaire_modifie'] = true;
        }
        $contexte['_message_attention'] = _T('saisies:construire_attention_modifie');
-       
+
        // On passe ça pour l'affichage
        $contexte['_contenu'] = $formulaire_actuel;
 
        // On passe ça pour la récup plus facile des champs
        $contexte['_saisies_par_nom'] = saisies_lister_par_nom($formulaire_actuel);
        // Pour déclarer les champs modifiables à CVT
-       foreach(array_keys($contexte['_saisies_par_nom']) as $nom){
+       foreach (array_keys($contexte['_saisies_par_nom']) as $nom) {
                $contexte["saisie_modifiee_$nom"] = array();
        }
-       
+
        // La liste des saisies
        $saisies_disponibles = saisies_lister_disponibles();
        $contexte['_saisies_disponibles'] = $saisies_disponibles;
-       
+
        // La liste des groupes de saisies
-       $saisies_groupes_disponibles = saisies_groupes_lister_disponibles("saisies/groupes");
+       $saisies_groupes_disponibles = saisies_groupes_lister_disponibles('saisies/groupes');
        $contexte['_saisies_groupes_disponibles'] = $saisies_groupes_disponibles;
-       
+
        $contexte['fond_generer'] = 'formulaires/inc-generer_saisies_configurables';
-       
+
        // On cherche jquery UI pour savoir si on pourra glisser-déplacer
        // SPIP 3.1 - jquery_ui
-       if (find_in_path('javascript/ui/sortable.js') and find_in_path('javascript/ui/draggable.js')){
+       if (find_in_path('javascript/ui/sortable.js') and find_in_path('javascript/ui/draggable.js')) {
                $contexte['_chemin_ui'] = 'javascript/ui/';
-       }
-       // SPIP 3 - jquery_ui
-       elseif (find_in_path('javascript/ui/jquery.ui.sortable.js') and find_in_path('javascript/ui/jquery.ui.draggable.js')){
+       } elseif (find_in_path('javascript/ui/jquery.ui.sortable.js') and find_in_path('javascript/ui/jquery.ui.draggable.js')) {
+               // SPIP 3 - jquery_ui
                $contexte['_chemin_ui'] = 'javascript/ui/jquery.ui.';
-       }
-       else{
+       } else {
                $contexte['_chemin_ui'] = false;
        }
 
        return $contexte;
 }
 
-function formulaires_construire_formulaire_verifier($identifiant, $formulaire_initial=array(), $options=array()){
+function formulaires_construire_formulaire_verifier($identifiant, $formulaire_initial = array(), $options = array()) {
        include_spip('inc/saisies');
        $erreurs = array();
        // l'une ou l'autre sera presente
@@ -70,7 +72,7 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
 
        // Pas d'erreur si l'on ne demande rien
        if (!($nom_ou_id = $configurer_saisie  = _request('configurer_saisie')
-       OR    $nom_ou_id = $enregistrer_saisie = _request('enregistrer_saisie'))) {
+               or $nom_ou_id = $enregistrer_saisie = _request('enregistrer_saisie'))) {
                return $erreurs;
        }
 
@@ -93,16 +95,16 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
        if (!in_array($nom_ou_id, $noms_autorises)) {
                return $erreurs;
        }
-       
+
        // La liste des saisies
        $saisies_disponibles = saisies_lister_disponibles();
-       
+
        $saisie = $saisies_actuelles[$nom_ou_id];
        $formulaire_config = $saisies_disponibles[$saisie['saisie']]['options'];
        array_walk_recursive($formulaire_config, 'formidable_transformer_nom', "saisie_modifiee_${nom}[options][@valeur@]");
        $formulaire_config = saisie_identifier(array('saisies'=>$formulaire_config));
        $formulaire_config = $formulaire_config['saisies'];
-       
+
        // Si la saisie possede un identifiant, on l'ajoute
        // au formulaire de configuration pour ne pas le perdre en route
        if (isset($saisie['identifiant']) and $saisie['identifiant']) {
@@ -117,11 +119,10 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
                        )
                );
        }
-       
+
        // S'il y a l'option adéquat, on ajoute le champ pour modifier le nom
        if (isset($options['modifier_nom']) and $options['modifier_nom']
-         and $chemin_nom = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][description]", true))
-       {
+               and $chemin_nom = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][description]", true)) {
                $chemin_nom[] = 'saisies';
                $chemin_nom[] = '0';
 
@@ -151,12 +152,12 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
        $verif_options = array();
 
        // S'il y a un groupe "validation" alors on va construire le formulaire des vérifications
-       if ($chemin_validation = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][validation]", true)){
+       if ($chemin_validation = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][validation]", true)) {
                include_spip('inc/verifier');
                $liste_verifications = verifier_lister_disponibles();
                $chemin_validation[] = 'saisies';
                $chemin_validation[] = 1000000; // à la fin
-               
+
                // On construit la saisie à insérer et les fieldset des options
                $saisie_liste_verif = array(
                        'saisie' => 'selection',
@@ -169,10 +170,10 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
                        )
                );
 
-               foreach ($liste_verifications as $type_verif => $verif){
+               foreach ($liste_verifications as $type_verif => $verif) {
                        $saisie_liste_verif['options']['datas'][$type_verif] = $verif['titre'];
                        // Si le type de vérif a des options, on ajoute un fieldset
-                       if (isset($verif['options']) and $verif['options'] and is_array($verif['options'])){
+                       if (isset($verif['options']) and $verif['options'] and is_array($verif['options'])) {
                                $groupe = array(
                                        'saisie' => 'fieldset',
                                        'options' => array(
@@ -188,34 +189,47 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
                }
                $verif_options = array_merge(array($saisie_liste_verif), $verif_options);
        }
-       
-       
-       if ($enregistrer_saisie){
+
+
+       // Permettre d'intégrer des saisies et fieldset au formulaire de configuration.
+       // Si des vérifications sont à faire, elles seront prises en compte
+       // lors des tests de vérifications à l'enregistrement.
+       $formulaire_config = pipeline('saisies_construire_formulaire_config', array(
+               'data' => $formulaire_config,
+               'args' => array(
+                       'identifiant' => $identifiant,
+                       'action' => $enregistrer_saisie ? 'enregistrer' : 'configurer',
+                       'options' => $options,
+                       'nom' => $nom,
+                       'saisie' => $saisie,
+               ),
+       ));
+
+       if ($enregistrer_saisie) {
                // La saisie modifié
                $saisie_modifiee = _request("saisie_modifiee_${nom}");
                // On cherche les erreurs de la configuration
                $vraies_erreurs = saisies_verifier($formulaire_config);
                // Si on autorise à modifier le nom ET qu'il doit être unique : on vérifie
                if (isset($options['modifier_nom']) and $options['modifier_nom']
-                 and isset($options['nom_unique']) and $options['nom_unique'])
-               {
+                       and isset($options['nom_unique']) and $options['nom_unique']) {
                        $nom_modifie = $saisie_modifiee['options']['nom'];
-                       if ($nom_modifie != $enregistrer_saisie and saisies_chercher($formulaire_actuel, $nom_modifie))
+                       if ($nom_modifie != $enregistrer_saisie and saisies_chercher($formulaire_actuel, $nom_modifie)) {
                                $vraies_erreurs["saisie_modifiee_${nom}[options][nom]"] = _T('saisies:erreur_option_nom_unique');
+                       }
                }
                // On regarde s'il a été demandé un type de vérif
                if (isset($saisie_modifiee['verifier']['type'])
-                 and (($type_verif = $saisie_modifiee['verifier']['type']) != '')
-                 and $verif_options[$type_verif])
-               {
+                       and (($type_verif = $saisie_modifiee['verifier']['type']) != '')
+                       and $verif_options[$type_verif]) {
                        // On ne vérifie que les options du type demandé
                        $vraies_erreurs = array_merge($vraies_erreurs, saisies_verifier($verif_options[$type_verif]['saisies']));
                }
        }
 
        // On insère chaque saisie des options de verification
-       if ($verif_options){
-               foreach ($verif_options as $saisie_verif){
+       if ($verif_options) {
+               foreach ($verif_options as $saisie_verif) {
                        $formulaire_config = saisies_inserer($formulaire_config, $saisie_verif, $chemin_validation);
                }
        }
@@ -225,6 +239,7 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
        if ($enregistrer_saisie) {
                if ($vraies_erreurs) {
                        $erreurs = array_merge($erreurs, $vraies_erreurs);
+                       $erreurs['message_erreur'] = singulier_ou_pluriel(count($vraies_erreurs), 'avis_1_erreur_saisie', 'avis_nb_erreurs_saisie');
                } else {
                        $erreurs = array();
                }
@@ -235,23 +250,23 @@ function formulaires_construire_formulaire_verifier($identifiant, $formulaire_in
        return $erreurs;
 }
 
-function formulaires_construire_formulaire_traiter($identifiant, $formulaire_initial=array(), $options=array()){
+function formulaires_construire_formulaire_traiter($identifiant, $formulaire_initial = array(), $options = array()) {
        include_spip('inc/saisies');
        $retours = array();
        $saisies_disponibles = saisies_lister_disponibles();
-       
+
        // On ajoute un préfixe devant l'identifiant
        $identifiant = 'constructeur_formulaire_'.$identifiant;
        // On récupère le formulaire à son état actuel
        $formulaire_actuel = session_get($identifiant);
-       
+
        // Si on demande à ajouter un groupe
-       if ($ajouter_saisie = _request('ajouter_groupe_saisie'))
+       if ($ajouter_saisie = _request('ajouter_groupe_saisie')) {
                $formulaire_actuel = saisies_groupe_inserer($formulaire_actuel, $ajouter_saisie);
        }
-       
+
        // Si on demande à ajouter une saisie
-       if ($ajouter_saisie = _request('ajouter_saisie')){
+       if ($ajouter_saisie = _request('ajouter_saisie')) {
                $nom = saisies_generer_nom($formulaire_actuel, $ajouter_saisie);
                $saisie = array(
                        'saisie' => $ajouter_saisie,
@@ -260,49 +275,40 @@ function formulaires_construire_formulaire_traiter($identifiant, $formulaire_ini
                        )
                );
                // S'il y a des valeurs par défaut pour ce type de saisie, on les ajoute
-               if (($defaut = $saisies_disponibles[$ajouter_saisie]['defaut']) and is_array($defaut)){
+               if (($defaut = $saisies_disponibles[$ajouter_saisie]['defaut']) and is_array($defaut)) {
                        $defaut = _T_ou_typo($defaut, 'multi');
 
-                       //Compatibilite PHP<5.3.0 
+                       //Compatibilite PHP<5.3.0
                        //source : http://www.php.net/manual/en/function.array-replace-recursive.php#92574
-                       if (!function_exists('array_replace_recursive'))
-                       {
-                               function array_replace_recursive($array, $array1)
-                               {
-                                       function recurse($array, $array1)
-                                       {
-                                               foreach ($array1 as $key => $value)
-                                               {
+                       if (!function_exists('array_replace_recursive')) {
+                               function array_replace_recursive($array, $array1) {
+                                       function recurse($array, $array1) {
+                                               foreach ($array1 as $key => $value) {
                                                        // create new key in $array, if it is empty or not an array
-                                                       if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
-                                                       {
+                                                       if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) {
                                                                $array[$key] = array();
                                                        }
                                                        // overwrite the value in the base array
-                                                       if (is_array($value))
-                                                       {
+                                                       if (is_array($value)) {
                                                                $value = recurse($array[$key], $value);
                                                        }
                                                        $array[$key] = $value;
                                                }
                                                return $array;
                                        }
+
                                        // handle the arguments, merge one by one
                                        $args = func_get_args();
                                        $array = $args[0];
-                                       if (!is_array($array))
-                                       {
+                                       if (!is_array($array)) {
                                                return $array;
                                        }
-                                       for ($i = 1; $i < count($args); $i++)
-                                       {
-                                               if (is_array($args[$i]))
-                                               {
+                                       for ($i = 1; $i < count($args); $i++) {
+                                               if (is_array($args[$i])) {
                                                        $array = recurse($array, $args[$i]);
                                                }
                                        }
-                               return $array;
+                                       return $array;
                                }
                        }
                        $saisie = array_replace_recursive($saisie, $defaut);
@@ -312,38 +318,37 @@ function formulaires_construire_formulaire_traiter($identifiant, $formulaire_ini
 
        // Si on demande à dupliquer une saisie
        if ($dupliquer_saisie = _request('dupliquer_saisie')) {
-               $formulaire_actuel = saisies_dupliquer($formulaire_actuel, $dupliquer_saisie);  
+               $formulaire_actuel = saisies_dupliquer($formulaire_actuel, $dupliquer_saisie);
        }
-       
+
        // Si on demande à supprimer une saisie
-       if ($supprimer_saisie = _request('supprimer_saisie')){
+       if ($supprimer_saisie = _request('supprimer_saisie')) {
                $formulaire_actuel = saisies_supprimer($formulaire_actuel, $supprimer_saisie);
        }
-       
+
        // Si on enregistre la conf d'une saisie
-       if ($nom = _request('enregistrer_saisie')){
+       if ($nom = _request('enregistrer_saisie')) {
                // On récupère ce qui a été modifié
                $saisie_modifiee = _request("saisie_modifiee_$nom");
-               
+
                // On regarde s'il y a une position à modifier
-               if (isset($saisie_modifiee['position'])){
+               if (isset($saisie_modifiee['position'])) {
                        $position = $saisie_modifiee['position'];
                        unset($saisie_modifiee['position']);
                        // On ne déplace que si ce n'est pas la même chose
-                       if ($position != $nom)
+                       if ($position != $nom) {
                                $formulaire_actuel = saisies_deplacer($formulaire_actuel, $nom, $position);
+                       }
                }
-               
+
                // On regarde s'il y a des options de vérification à modifier
                if (isset($saisie_modifiee['verifier']['type'])
-                 and ($type_verif = $saisie_modifiee['verifier']['type']) != '')
-               {
+                       and ($type_verif = $saisie_modifiee['verifier']['type']) != '') {
                        $saisie_modifiee['verifier'] = array(
                                'type' => $type_verif,
                                'options' => $saisie_modifiee['verifier'][$type_verif]
                        );
-               }
-               else {
+               } else {
                        unset($saisie_modifiee['verifier']);
                }
 
@@ -352,17 +357,18 @@ function formulaires_construire_formulaire_traiter($identifiant, $formulaire_ini
                if (isset($saisie_modifiee['verifier']['options']) and $saisie_modifiee['verifier']['options']) {
                        $saisie_modifiee['verifier']['options'] = array_filter($saisie_modifiee['verifier']['options'], 'saisie_option_contenu_vide');
                }
-               
+
                // On désinfecte à la main
-               if (is_array($saisie_modifiee['options']))
+               if (is_array($saisie_modifiee['options'])) {
                        spip_desinfecte($saisie_modifiee['options']);
-               
+               }
+
                // On modifie enfin
                $formulaire_actuel = saisies_modifier($formulaire_actuel, $nom, $saisie_modifiee);
        }
 
        // Si on demande à réinitialiser
-       if (_request('reinitialiser') == 'oui'){
+       if (_request('reinitialiser') == 'oui') {
                $formulaire_actuel = $formulaire_initial;
        }
 
@@ -377,26 +383,26 @@ function formulaires_construire_formulaire_traiter($identifiant, $formulaire_ini
 
 // À utiliser avec un array_walk_recursive()
 // Applique une transformation à la @valeur@ de tous les champs "nom" d'un formulaire, y compris loin dans l'arbo
-function formidable_transformer_nom(&$valeur, $cle, $transformation){
-       if ($cle == 'nom' and is_string($valeur)){
+function formidable_transformer_nom(&$valeur, $cle, $transformation) {
+       if ($cle == 'nom' and is_string($valeur)) {
                $valeur = str_replace('@valeur@', $valeur, $transformation);
        }
 }
 
 // Préparer une saisie pour la transformer en truc configurable
-function formidable_generer_saisie_configurable($saisie, $env){
+function formidable_generer_saisie_configurable($saisie, $env) {
        // On récupère le nom
        $nom = $saisie['options']['nom'];
-       $identifiant = isset($saisie['identifiant']) ? $saisie['identifiant'] : "";
+       $identifiant = isset($saisie['identifiant']) ? $saisie['identifiant'] : '';
        // On cherche si ya un formulaire de config
-       $formulaire_config = isset($env['erreurs']['configurer_'.$nom]) ? $env['erreurs']['configurer_'.$nom] : "";
+       $formulaire_config = isset($env['erreurs']['configurer_'.$nom]) ? $env['erreurs']['configurer_'.$nom] : '';
        // On ajoute une classe
        if (!isset($saisie['options']['conteneur_class'])) {
                $saisie['options']['conteneur_class'] = ''; // initialisation
        }
        // Compat ancien nom li_class
        if (isset($saisie['options']['li_class'])) {
-               $saisie['options']['conteneur_class'] .= " " . $saisie['options']['li_class']; // initialisation
+               $saisie['options']['conteneur_class'] .= ' ' . $saisie['options']['li_class']; // initialisation
        }
        $saisie['options']['conteneur_class'] .= ' configurable';
 
@@ -411,7 +417,7 @@ function formidable_generer_saisie_configurable($saisie, $env){
                                'formulaires/inc-construire_formulaire-actions',
                                array(
                                        'nom' => $nom,
-                                       'identifiant' => $identifiant, 
+                                       'identifiant' => $identifiant,
                                        'formulaire_config' => $formulaire_config,
                                        'deplacable' => $env['_chemin_ui']
                                )
@@ -428,7 +434,7 @@ function formidable_generer_saisie_configurable($saisie, $env){
        );
 
        // Si ya un form de config on l'ajoute à la fin
-       if (is_array($formulaire_config)){
+       if (is_array($formulaire_config)) {
                // On double l'environnement
                $env2 = $env;
                // On ajoute une classe
@@ -436,9 +442,9 @@ function formidable_generer_saisie_configurable($saisie, $env){
 
                // Si possible on met en readonly
                $saisie['options']['readonly'] = 'oui';
-               
+
                // On vire les sous-saisies s'il y en a
-               if (isset($saisie['saisies']) and $saisie['saisies'] and is_array($saisie['saisies'])){
+               if (isset($saisie['saisies']) and $saisie['saisies'] and is_array($saisie['saisies'])) {
                        $nb_champs_masques = count(saisies_lister_champs($saisie['saisies']));
                        $saisie['saisies'] = array(
                                array(
@@ -450,9 +456,9 @@ function formidable_generer_saisie_configurable($saisie, $env){
                                )
                        );
                }
-               
+
                // On va ajouter le champ pour la position
-               if (!($chemin_description = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][description]", true))){
+               if (!($chemin_description = saisies_chercher($formulaire_config, "saisie_modifiee_${nom}[options][description]", true))) {
                        $chemin_description = array(0);
                        $formulaire_config = saisies_inserer(
                                $formulaire_config,
@@ -483,22 +489,21 @@ function formidable_generer_saisie_configurable($saisie, $env){
                        ),
                        $chemin_description
                );
-               
+
                $env2['saisies'] = $formulaire_config;
-               
+
                // Un test pour savoir si on prend le _request ou bien
                $erreurs_test = $env['erreurs'];
                unset($erreurs_test['configurer_'.$nom]);
                unset($erreurs_test['positionner']);
                unset($erreurs_test['message_erreur']);
 
-               if ($erreurs_test){
+               if ($erreurs_test) {
                        // Là aussi on désinfecte à la main
                        if (isset($env2["saisie_modifiee_$nom"]['options']) and is_array($env2["saisie_modifiee_$nom"]['options'])) {
                                spip_desinfecte($env2["saisie_modifiee_$nom"]['options']);
                        }
-               }
-               else{
+               } else {
                        $env2["saisie_modifiee_$nom"] = $env2['_saisies_par_nom'][$nom];
                        // il n'y a pas toujours de verification...
                        if (isset($env2["saisie_modifiee_$nom"]['verifier'])) {
@@ -506,7 +511,7 @@ function formidable_generer_saisie_configurable($saisie, $env){
                                        = $env2["saisie_modifiee_$nom"]['verifier']['options'];
                        }
                }
-               
+
                $env2['fond_generer'] = 'inclure/generer_saisies';
                $saisie = saisies_inserer_html(
                        $saisie,
@@ -539,7 +544,7 @@ function formidable_generer_saisie_configurable($saisie, $env){
 **/
 function saisie_option_contenu_vide($var) {
        if (!$var) {
-               if (is_string($var) AND strlen($var)) {
+               if (is_string($var) and strlen($var)) {
                        return true;
                }
                return false;
@@ -547,29 +552,29 @@ function saisie_option_contenu_vide($var) {
        return true;
 }
 
-function saisies_groupe_inserer($formulaire_actuel, $saisie){
+function saisies_groupe_inserer($formulaire_actuel, $saisie) {
        include_spip('inclure/configurer_saisie_fonctions');
-       
+
                //le groupe de saisies
-               $saisies_charger_infos = saisies_charger_infos($saisie,$saisies_repertoire = "saisies/groupes");
-               
+               $saisies_charger_infos = saisies_charger_infos($saisie, $saisies_repertoire = 'saisies/groupes');
+
                //le tableau est-il en options ou en saisies ?
                $classique_yaml=count($saisies_charger_infos['options']);
                $formidable_yaml=count($saisies_charger_infos['saisies']);
-               if($classique_yaml>0) {
+               if ($classique_yaml>0) {
                        $champ_options = 'options';
                }
-               if($formidable_yaml>0) { 
+               if ($formidable_yaml>0) {
                        $champ_options = 'saisies';
                }
-               
-               //les champs du groupe 
-               foreach($saisies_charger_infos[$champ_options] as $info_saisie){
+
+               //les champs du groupe
+               foreach ($saisies_charger_infos[$champ_options] as $info_saisie) {
                        unset($info_saisie['identifiant']);
                        $saisies_disponibles = saisies_lister_disponibles();
                        $construire_nom = $info_saisie[$champ_options]['nom'] ? $info_saisie[$champ_options]['nom'] : $info_saisie['saisie'];
-                       $nom = $info_saisie[$champ_options]['nom'] = saisies_generer_nom($formulaire_actuel,$construire_nom);
-                       
+                       $nom = $info_saisie[$champ_options]['nom'] = saisies_generer_nom($formulaire_actuel, $construire_nom);
+
                        $formulaire_actuel = saisies_inserer($formulaire_actuel, $info_saisie);
                }
                return $formulaire_actuel;
index ac5eb14..c71bb7b 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function formulaires_saisies_cvt_saisies_dist(){
+function formulaires_saisies_cvt_saisies_dist() {
        return array(
                array(
                        'saisie' => 'input',
@@ -37,4 +39,3 @@ function formulaires_saisies_cvt_saisies_dist(){
                )
        );
 }
-
index 1af591c..a62df55 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-annuler-16.png and b/www/plugins/saisies/images/formulaire-annuler-16.png differ
index 36a909b..9602239 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-configurer-16.png and b/www/plugins/saisies/images/formulaire-configurer-16.png differ
index 6e13dd3..ae1f378 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-deplacer-16.png and b/www/plugins/saisies/images/formulaire-deplacer-16.png differ
index f9f4e9b..81b29b0 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-dupliquer-16.png and b/www/plugins/saisies/images/formulaire-dupliquer-16.png differ
index 06b2491..a16058a 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-enregistrer-16.png and b/www/plugins/saisies/images/formulaire-enregistrer-16.png differ
index 5dce298..3753bdb 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-reinitialiser-24.png and b/www/plugins/saisies/images/formulaire-reinitialiser-24.png differ
index 6a0e70a..7bc466f 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-saisie-defaut.png and b/www/plugins/saisies/images/formulaire-saisie-defaut.png differ
index 6f4a6a6..6ac75b7 100644 (file)
Binary files a/www/plugins/saisies/images/formulaire-supprimer-16.png and b/www/plugins/saisies/images/formulaire-supprimer-16.png differ
index e1e6f37..e2fb5cf 100644 (file)
Binary files a/www/plugins/saisies/images/logo_saisie_48.png and b/www/plugins/saisies/images/logo_saisie_48.png differ
index 6fdf70d..c499c62 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_auteurs.png and b/www/plugins/saisies/images/saisies_auteurs.png differ
index 71565b0..5d58513 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_case.png and b/www/plugins/saisies/images/saisies_case.png differ
index 8f0a9bf..bd3a39f 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_checkbox.png and b/www/plugins/saisies/images/saisies_checkbox.png differ
index 96ef9a4..f12401b 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_date.png and b/www/plugins/saisies/images/saisies_date.png differ
index be5c134..6bc9948 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_explication.png and b/www/plugins/saisies/images/saisies_explication.png differ
index f9efaca..3648cf0 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_fieldset.png and b/www/plugins/saisies/images/saisies_fieldset.png differ
index cb552bf..8af937e 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_hidden.png and b/www/plugins/saisies/images/saisies_hidden.png differ
index ccaa722..f0d9278 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_input.png and b/www/plugins/saisies/images/saisies_input.png differ
index a32b607..9445412 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_oui_non.png and b/www/plugins/saisies/images/saisies_oui_non.png differ
index c85d949..c4d45d1 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_radio.png and b/www/plugins/saisies/images/saisies_radio.png differ
index 24eece2..e9f5cae 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_selecteur_article.png and b/www/plugins/saisies/images/saisies_selecteur_article.png differ
index 026a114..3ddb984 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_selecteur_rubrique.png and b/www/plugins/saisies/images/saisies_selecteur_rubrique.png differ
index 77acfe3..e976778 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_selecteur_rubrique_article.png and b/www/plugins/saisies/images/saisies_selecteur_rubrique_article.png differ
index dab25d3..40bbb60 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_selection.png and b/www/plugins/saisies/images/saisies_selection.png differ
index d682108..b353ba2 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_selection_multiple.png and b/www/plugins/saisies/images/saisies_selection_multiple.png differ
index 84277b8..227036b 100644 (file)
Binary files a/www/plugins/saisies/images/saisies_textarea.png and b/www/plugins/saisies/images/saisies_textarea.png differ
index 53853ef..ad7a3e8 100644 (file)
-<?php\r
-\r
-/**\r
- * Gestion de l'affichage des saisies\r
- *\r
- * @package SPIP\Saisies\Saisies\r
-**/\r
-\r
-// Sécurité\r
-if (!defined('_ECRIRE_INC_VERSION')) return;\r
-\r
-/*\r
- * Une librairie pour manipuler ou obtenir des infos sur un tableau de saisies\r
- *\r
- * saisies_lister_par_nom()\r
- * saisies_lister_champs()\r
- * saisies_lister_valeurs_defaut()\r
- * saisies_charger_champs()\r
- * saisies_chercher()\r
- * saisies_supprimer()\r
- * saisies_inserer()\r
- * saisies_deplacer()\r
- * saisies_modifier()\r
- * saisies_verifier()\r
- * saisies_comparer()\r
- * saisies_generer_html()\r
- * saisies_generer_vue()\r
- * saisies_generer_nom()\r
- * saisies_inserer_html()\r
- * saisies_lister_disponibles()\r
- * saisies_autonomes()\r
- */\r
-\r
-// Différentes méthodes pour trouver les saisies\r
-include_spip('inc/saisies_lister');\r
-\r
-// Différentes méthodes pour manipuler une liste de saisies\r
-include_spip('inc/saisies_manipuler');\r
-\r
-// Les outils pour afficher les saisies et leur vue\r
-include_spip('inc/saisies_afficher');\r
-\r
-/**\r
- * Cherche la description des saisies d'un formulaire CVT dont on donne le nom\r
- *\r
- * @param string $form Nom du formulaire dont on cherche les saisies\r
- * @param array $args Tableau d'arguments du formulaire\r
- * @return array Retourne les saisies du formulaire sinon false\r
- */\r
-function saisies_chercher_formulaire($form, $args){\r
-       if ($fonction_saisies = charger_fonction('saisies', 'formulaires/'.$form, true)\r
-               and $saisies = call_user_func_array($fonction_saisies, $args)\r
-               and is_array($saisies)\r
-               // On passe les saisies dans un pipeline normé comme pour CVT\r
-               and $saisies = pipeline(\r
-                       'formulaire_saisies',\r
-                       array(\r
-                               'args' => array('form' => $form, 'args' => $args),\r
-                               'data' => $saisies\r
-                       )\r
-               )\r
-               // Si c'est toujours un tableau après le pipeline\r
-               and is_array($saisies)\r
-       ){\r
-               return $saisies;\r
-       }\r
-       else{\r
-               return false;\r
-       }\r
-}\r
-\r
-/**\r
- * Cherche une saisie par son id, son nom ou son chemin et renvoie soit la saisie, soit son chemin\r
- *\r
- * @param array $saisies Un tableau décrivant les saisies\r
- * @param unknown_type $id_ou_nom_ou_chemin L'identifiant ou le nom de la saisie à chercher ou le chemin sous forme d'une liste de clés\r
- * @param bool $retourner_chemin Indique si on retourne non pas la saisie mais son chemin\r
- * @return array Retourne soit la saisie, soit son chemin, soit null\r
- */\r
-function saisies_chercher($saisies, $id_ou_nom_ou_chemin, $retourner_chemin=false){\r
-\r
-       if (is_array($saisies) and $id_ou_nom_ou_chemin){\r
-               if (is_string($id_ou_nom_ou_chemin)){\r
-                       $nom = $id_ou_nom_ou_chemin;\r
-                       // identifiant ? premier caractere @\r
-                       $id = ($nom[0] == '@');\r
-\r
-                       foreach($saisies as $cle => $saisie){\r
-                               $chemin = array($cle);\r
-                               // notre saisie est la bonne ?\r
-                               if ($nom == ($id ? $saisie['identifiant'] : $saisie['options']['nom'])) {\r
-                                       return $retourner_chemin ? $chemin : $saisie;\r
-                               // sinon a telle des enfants ? et si c'est le cas, cherchons dedans\r
-                               } elseif (isset($saisie['saisies']) and is_array($saisie['saisies']) and $saisie['saisies']\r
-                                       and ($retour = saisies_chercher($saisie['saisies'], $nom, $retourner_chemin))) {\r
-                                               return $retourner_chemin ? array_merge($chemin, array('saisies'), $retour) : $retour;\r
-                               }\r
-\r
-                       }\r
-               }\r
-               elseif (is_array($id_ou_nom_ou_chemin)){\r
-                       $chemin = $id_ou_nom_ou_chemin;\r
-                       $saisie = $saisies;\r
-                       // On vérifie l'existence quand même\r
-                       foreach ($chemin as $cle){\r
-                               if (isset($saisie[$cle])) $saisie = $saisie[$cle];\r
-                               else return null;\r
-                       }\r
-                       // Si c'est une vraie saisie\r
-                       if ($saisie['saisie'] and $saisie['options']['nom'])\r
-                               return $retourner_chemin ? $chemin : $saisie;\r
-               }\r
-       }\r
-       \r
-       return null;\r
-}\r
-\r
-/**\r
- * Génère un nom unique pour un champ d'un formulaire donné\r
- *\r
- * @param array $formulaire\r
- *     Le formulaire à analyser \r
- * @param string $type_saisie\r
- *     Le type de champ dont on veut un identifiant \r
- * @return string\r
- *     Un nom unique par rapport aux autres champs du formulaire\r
- */\r
-function saisies_generer_nom($formulaire, $type_saisie){\r
-       $champs = saisies_lister_champs($formulaire);\r
-       \r
-       // Tant que type_numero existe, on incrémente le compteur\r
-       $compteur = 1;\r
-       while (array_search($type_saisie.'_'.$compteur, $champs) !== false)\r
-               $compteur++;\r
-       \r
-       // On a alors un compteur unique pour ce formulaire\r
-       return $type_saisie.'_'.$compteur;\r
-}\r
-\r
-/**\r
- * Crée un identifiant Unique\r
- * pour toutes les saisies donnees qui n'en ont pas \r
- *\r
- * @param Array $saisies Tableau de saisies\r
- * @param Bool $regenerer Régénère un nouvel identifiant pour toutes les saisies ?\r
- * @return Array Tableau de saisies complété des identifiants\r
- */\r
-function saisies_identifier($saisies, $regenerer = false) {\r
-       if (!is_array($saisies)) {\r
-               return array();\r
-       }\r
-       foreach ($saisies as $k => $saisie) {\r
-               $saisies[$k] = saisie_identifier($saisie, $regenerer);\r
-       }\r
-       return $saisies;\r
-}\r
-\r
-/**\r
- * Crée un identifiant Unique\r
- * pour la saisie donnee si elle n'en a pas\r
- * (et pour ses sous saisies éventuels)\r
- *\r
- * @param Array $saisie Tableau d'une saisie\r
- * @param Bool $regenerer Régénère un nouvel identifiant pour la saisie ?\r
- * @return Array Tableau de la saisie complété de l'identifiant\r
-**/\r
-function saisie_identifier($saisie, $regenerer = false) {\r
-       if (!isset($saisie['identifiant']) OR !$saisie['identifiant']) {\r
-               $saisie['identifiant'] = uniqid('@');\r
-       } elseif ($regenerer) {\r
-               $saisie['identifiant'] = uniqid('@');\r
-       }\r
-       if (isset($saisie['saisies']) AND is_array($saisie['saisies'])) {\r
-               $saisie['saisies'] = saisies_identifier($saisie['saisies'], $regenerer);\r
-       }\r
-       return $saisie;\r
-}\r
-\r
-/**\r
- * Vérifier tout un formulaire tel que décrit avec les Saisies\r
- *\r
- * @param array $formulaire Le contenu d'un formulaire décrit dans un tableau de Saisies\r
- * @param bool $saisies_masquees_nulles Si TRUE, les saisies masquées selon afficher_si ne seront pas verifiées, leur valeur étant forcée a NULL. Cette valeur NULL est transmise à traiter (via set_request).\r
- * @return array Retourne un tableau d'erreurs\r
- */\r
-function saisies_verifier($formulaire, $saisies_masquees_nulles=true){\r
-       include_spip('inc/verifier');\r
-       $erreurs = array();\r
-       $verif_fonction = charger_fonction('verifier','inc',true);\r
-\r
-       if ($saisies_masquees_nulles)\r
-               $formulaire = saisies_verifier_afficher_si($formulaire);\r
-       \r
-       $saisies = saisies_lister_par_nom($formulaire);\r
-       foreach ($saisies as $saisie){\r
-               $obligatoire = isset($saisie['options']['obligatoire']) ? $saisie['options']['obligatoire'] : '';\r
-               $champ = $saisie['options']['nom'];\r
-               $file = ($saisie['saisie'] == 'input' and isset($saisie['options']['type']) and $saisie['options']['type'] == 'file');\r
-               $verifier = isset($saisie['verifier']) ? $saisie['verifier'] : false;\r
-\r
-               // Si le nom du champ est un tableau indexé, il faut parser !\r
-               if (preg_match('/([\w]+)((\[[\w]+\])+)/', $champ, $separe)){\r
-                       $valeur = _request($separe[1]);\r
-                       preg_match_all('/\[([\w]+)\]/', $separe[2], $index);\r
-                       // On va chercher au fond du tableau\r
-                       foreach($index[1] as $cle){\r
-                               $valeur = isset($valeur[$cle]) ? $valeur[$cle] : null;\r
-                       }\r
-               }\r
-               // Sinon la valeur est juste celle du nom\r
-               else\r
-                       $valeur = _request($champ);\r
-               \r
-               // Pour la saisie "destinataires" il faut filtrer si jamais on a mis un premier choix vide\r
-               if ($saisie['saisie'] == 'destinataires') {\r
-                       $valeur = array_filter($valeur);\r
-               }\r
-               \r
-               // On regarde d'abord si le champ est obligatoire\r
-               if ($obligatoire\r
-                       and $obligatoire != 'non'\r
-                       and (\r
-                               ($file and !$_FILES[$champ]['name'])\r
-                               or (!$file and (\r
-                                       is_null($valeur)\r
-                                       or (is_string($valeur) and trim($valeur) == '')\r
-                                       or (is_array($valeur) and count($valeur) == 0)\r
-                               ))\r
-                       )\r
-               ) {\r
-                       $erreurs[$champ] =\r
-                               (isset($saisie['options']['erreur_obligatoire']) and $saisie['options']['erreur_obligatoire'])\r
-                               ? $saisie['options']['erreur_obligatoire']\r
-                               : _T('info_obligatoire');\r
-               }\r
-\r
-               // On continue seulement si ya pas d'erreur d'obligation et qu'il y a une demande de verif\r
-               if ((!isset($erreurs[$champ]) or !$erreurs[$champ]) and is_array($verifier) and $verif_fonction){\r
-                       $normaliser = null;\r
-                       // Si le champ n'est pas valide par rapport au test demandé, on ajoute l'erreur\r
-                       $options = isset($verifier['options']) ? $verifier['options'] : array();\r
-                       if ($erreur_eventuelle = $verif_fonction($valeur, $verifier['type'], $options, $normaliser)) {\r
-                               $erreurs[$champ] = $erreur_eventuelle;\r
-                       // S'il n'y a pas d'erreur et que la variable de normalisation a été remplie, on l'injecte dans le POST\r
-                       } elseif (!is_null($normaliser)) {\r
-                               set_request($champ, $normaliser);\r
-                       }\r
-               }\r
-       }\r
-       \r
-       return $erreurs;\r
-}\r
-\r
-/**\r
- * Applatie une description tabulaire\r
- * @param string $tab Le tableau à aplatir\r
- * @return $nouveau_tab\r
- */\r
-function saisies_aplatir_tableau($tab){\r
-       $nouveau_tab = array();\r
-       foreach($tab as $entree=>$contenu){\r
-               if (is_array($contenu)) {\r
-                       foreach ($contenu as $cle => $valeur) {\r
-                               $nouveau_tab[$cle] = $valeur;\r
-                       }\r
-               } else {\r
-                       $nouveau_tab[$entree] = $contenu;\r
-               }\r
-       }\r
-       return $nouveau_tab;\r
-}\r
-\r
-/**\r
- * Applatie une description chaînée, en supprimant les sous-groupes.\r
- * @param string $chaine La chaîne à aplatir\r
- * @return $chaine\r
- */\r
-function saisies_aplatir_chaine($chaine){\r
-       return trim(preg_replace("#(?:^|\n)(\*(?:.*)|/\*)\n#i","\n",$chaine));\r
-}\r
-\r
-/**\r
- * Transforme une chaine en tableau avec comme principe :\r
- * \r
- * - une ligne devient une case\r
- * - si la ligne est de la forme truc|bidule alors truc est la clé et bidule la valeur\r
- * - si la ligne commence par * alors on commence un sous-tableau\r
- * - si la ligne est égale à /*, alors on fini le sous-tableau\r
- * \r
- * @param string $chaine Une chaine à transformer\r
- * @param string $separateur Séparateur utilisé\r
- * @return array Retourne un tableau PHP\r
- */\r
-function saisies_chaine2tableau($chaine, $separateur="\n"){\r
-       if ($chaine and is_string($chaine)){\r
-               $tableau = array();\r
-               $soustab = False;\r
-               // On découpe d'abord en lignes\r
-               $lignes = explode($separateur, $chaine);\r
-               foreach ($lignes as $i=>$ligne){\r
-                       $ligne = trim(trim($ligne), '|');\r
-                       // Si ce n'est pas une ligne sans rien\r
-                       if ($ligne !== ''){\r
-                               // si ca commence par * c'est qu'on va faire un sous tableau\r
-                               if (strpos($ligne,"*")===0) {\r
-                                       $soustab=True;\r
-                                       $soustab_cle    = _T_ou_typo(substr($ligne,1), 'multi');\r
-                                       if (!isset($tableau[$soustab_cle])){\r
-                                               $tableau[$soustab_cle] = array();\r
-                                       }\r
-                               }\r
-                               elseif ($ligne=="/*") {//si on finit sous tableau\r
-                                       $soustab=False;\r
-                               }\r
-                               else{//sinon c'est une entrée normale\r
-                               // Si on trouve un découpage dans la ligne on fait cle|valeur\r
-                                       if (strpos($ligne, '|') !== false) {\r
-                                               list($cle,$valeur) = explode('|', $ligne, 2);\r
-                                               // permettre les traductions de valeurs au passage\r
-                                               if ($soustab == True){\r
-                                                       $tableau[$soustab_cle][$cle] = _T_ou_typo($valeur, 'multi');\r
-                                               } else {\r
-                                                       $tableau[$cle] = _T_ou_typo($valeur, 'multi');\r
-                                               }\r
-                                       }\r
-                               // Sinon on génère la clé\r
-                                       else{\r
-                                               if ($soustab == True) {\r
-                                                       $tableau[$soustab_cle][$i] = _T_ou_typo($ligne,'multi');\r
-                                               } else {\r
-                                                       $tableau[$i] = _T_ou_typo($ligne,'multi');\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               return $tableau;\r
-       }\r
-       // Si c'est déjà un tableau on lui applique _T_ou_typo (qui fonctionne de manière récursive avant de le renvoyer\r
-       elseif (is_array($chaine)){\r
-               return _T_ou_typo($chaine, 'multi');\r
-       } else {\r
-               return array();\r
-       }\r
-}\r
-\r
-/**\r
- * Transforme un tableau en chaine de caractères avec comme principe :\r
- * \r
- * - une case de vient une ligne de la chaine\r
- * - chaque ligne est générée avec la forme cle|valeur\r
- * - si une entrée du tableau est elle même un tableau, on met une ligne de la forme *clef\r
- * - pour marquer que l'on quitte un sous-tableau, on met une ligne commencant par /*, sauf si on bascule dans un autre sous-tableau.\r
- *\r
- * @param array $tableau Tableau à transformer\r
- * @return string Texte représentant les données du tableau\r
- */\r
-function saisies_tableau2chaine($tableau){\r
-       if ($tableau and is_array($tableau)){\r
-               $chaine = '';\r
-               $avant_est_tableau = False;\r
-               foreach($tableau as $cle=>$valeur){\r
-                       if (is_array($valeur)){\r
-                               $avant_est_tableau = True;\r
-                               $ligne=trim("*$cle");\r
-                               $chaine .= "$ligne\n";\r
-                               $chaine .= saisies_tableau2chaine($valeur)."\n";\r
-                               }\r
-                       else{   \r
-                               if ($avant_est_tableau == True){\r
-                                               $avant_est_tableau = False;\r
-                                               $chaine.="/*\n";\r
-                                       }\r
-                               $ligne = trim("$cle|$valeur");\r
-                               $chaine .= "$ligne\n";\r
-                       }\r
-               }\r
-               $chaine = trim($chaine);\r
-       \r
-               return $chaine;\r
-       }\r
-       // Si c'est déjà une chaine on la renvoie telle quelle\r
-       elseif (is_string($tableau)){\r
-               return $tableau;\r
-       }\r
-       else{\r
-               return '';\r
-       }\r
-}\r
-\r
-\r
-\r
-\r
-/**\r
- * Transforme une valeur en tableau d'élements si ce n'est pas déjà le cas\r
- *\r
- * @param mixed $valeur\r
- * @return array Tableau de valeurs\r
-**/\r
-function saisies_valeur2tableau($valeur) {\r
-       if (is_array($valeur)) {\r
-               return $valeur;\r
-       }\r
-\r
-       if (!strlen($valeur)) {\r
-               return array();\r
-       }\r
-\r
-       $t = saisies_chaine2tableau($valeur);\r
-       if (count($t) > 1) {\r
-               return $t;\r
-       }\r
-\r
-       // qu'une seule valeur, c'est qu'elle a peut etre un separateur a virgule\r
-       // et a donc une cle est 0 dans ce cas la d'ailleurs\r
-       if (isset($t[0])) {\r
-               $t = saisies_chaine2tableau($t[0], ',');\r
-       }\r
-\r
-       return $t;\r
-}\r
-\r
-\r
-/**\r
- * Pour les saisies multiples (type checkbox) proposant un choix alternatif,\r
- * retrouve à partir des data de choix proposés\r
- * et des valeurs des choix enregistrés\r
- * le texte enregistré pour le choix alternatif.\r
- *\r
- * @param array $data\r
- * @param array $valeur\r
- * @return string choix_alternatif\r
-**/\r
-function saisies_trouver_choix_alternatif($data,$valeur) {\r
-       if (!is_array($valeur)) {\r
-               $valeur = saisies_chaine2tableau($valeur) ;\r
-       }\r
-       if (!is_array($data)) {\r
-               $data = saisies_chaine2tableau($data) ;\r
-       }\r
-       $choix_theorique = array_keys($data);\r
-       $choix_alternatif = array_values(array_diff($valeur,$choix_theorique));\r
-       return $choix_alternatif[0];//on suppose que personne ne s'est amusé à proposer deux choix alternatifs\r
-}\r
-\r
-/**\r
- * Génère une page d'aide listant toutes les saisies et leurs options\r
- *\r
- * Retourne le résultat du squelette `inclure/saisies_aide` auquel\r
- * on a transmis toutes les saisies connues.\r
- * \r
- * @return string Code HTML\r
- */\r
-function saisies_generer_aide(){\r
-       // On a déjà la liste par saisie\r
-       $saisies = saisies_lister_disponibles();\r
-\r
-       // On construit une liste par options\r
-       $options = array();\r
-       foreach ($saisies as $type_saisie=>$saisie){\r
-               $options_saisie = saisies_lister_par_nom($saisie['options'], false);\r
-               foreach ($options_saisie as $nom=>$option){\r
-                       // Si l'option n'existe pas encore\r
-                       if (!isset($options[$nom])){\r
-                               $options[$nom] = _T_ou_typo($option['options']);\r
-                       }\r
-                       // On ajoute toujours par qui c'est utilisé\r
-                       $options[$nom]['utilisee_par'][] = $type_saisie;\r
-               }\r
-               ksort($options_saisie);\r
-               $saisies[$type_saisie]['options'] = $options_saisie;\r
-       }\r
-       ksort($options);\r
-\r
-       return recuperer_fond(\r
-               'inclure/saisies_aide',\r
-               array(\r
-                       'saisies' => $saisies,\r
-                       'options' => $options\r
-               )\r
-       );\r
-}\r
-\r
-/**\r
- * Le tableau de saisies a-t-il une option afficher_si ?\r
- *\r
- * @param array $saisies Un tableau de saisies\r
- * @return boolean\r
- */\r
-\r
-function saisies_afficher_si($saisies) {\r
-       $saisies = saisies_lister_par_nom($saisies,true);\r
-       // Dès qu'il y a au moins une option afficher_si, on l'active\r
-       foreach ($saisies as $saisie) {\r
-               if (isset($saisie['options']['afficher_si']))\r
-                       return true;\r
-       }\r
-       return false;\r
-}\r
-\r
-\r
-/**\r
- * Le tableau de saisies a-t-il une option afficher_si_remplissage ?\r
- *\r
- * @param array $saisies Un tableau de saisies\r
- * @return boolean\r
- */\r
-function saisies_afficher_si_remplissage($saisies) {\r
-       $saisies = saisies_lister_par_nom($saisies,true);\r
-       // Dès qu'il y a au moins une option afficher_si_remplissage, on l'active\r
-       foreach ($saisies as $saisie) {\r
-               if (isset($saisie['options']['afficher_si_remplissage']))\r
-                       return true;\r
-       }\r
-       return false;\r
-}\r
-\r
+<?php
+
+/**
+ * Gestion de l'affichage des saisies
+ *
+ * @package SPIP\Saisies\Saisies
+**/
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/*
+ * Une librairie pour manipuler ou obtenir des infos sur un tableau de saisies
+ *
+ * saisies_lister_par_nom()
+ * saisies_lister_champs()
+ * saisies_lister_valeurs_defaut()
+ * saisies_charger_champs()
+ * saisies_chercher()
+ * saisies_supprimer()
+ * saisies_inserer()
+ * saisies_deplacer()
+ * saisies_modifier()
+ * saisies_verifier()
+ * saisies_comparer()
+ * saisies_generer_html()
+ * saisies_generer_vue()
+ * saisies_generer_nom()
+ * saisies_inserer_html()
+ * saisies_lister_disponibles()
+ * saisies_autonomes()
+ */
+
+// Différentes méthodes pour trouver les saisies
+include_spip('inc/saisies_lister');
+
+// Différentes méthodes pour manipuler une liste de saisies
+include_spip('inc/saisies_manipuler');
+
+// Les outils pour afficher les saisies et leur vue
+include_spip('inc/saisies_afficher');
+
+/**
+ * Cherche la description des saisies d'un formulaire CVT dont on donne le nom
+ *
+ * @param string $form Nom du formulaire dont on cherche les saisies
+ * @param array $args Tableau d'arguments du formulaire
+ * @return array Retourne les saisies du formulaire sinon false
+ */
+function saisies_chercher_formulaire($form, $args) {
+       if ($fonction_saisies = charger_fonction('saisies', 'formulaires/'.$form, true)
+               and $saisies = call_user_func_array($fonction_saisies, $args)
+               and is_array($saisies)
+               // On passe les saisies dans un pipeline normé comme pour CVT
+               and $saisies = pipeline(
+                       'formulaire_saisies',
+                       array(
+                               'args' => array('form' => $form, 'args' => $args),
+                               'data' => $saisies
+                       )
+               )
+               // Si c'est toujours un tableau après le pipeline
+               and is_array($saisies)
+       ) {
+               return $saisies;
+       } else {
+               return false;
+       }
+}
+
+/**
+ * Cherche une saisie par son id, son nom ou son chemin et renvoie soit la saisie, soit son chemin
+ *
+ * @param array $saisies Un tableau décrivant les saisies
+ * @param unknown_type $id_ou_nom_ou_chemin L'identifiant ou le nom de la saisie à chercher ou le chemin sous forme d'une liste de clés
+ * @param bool $retourner_chemin Indique si on retourne non pas la saisie mais son chemin
+ * @return array Retourne soit la saisie, soit son chemin, soit null
+ */
+function saisies_chercher($saisies, $id_ou_nom_ou_chemin, $retourner_chemin = false) {
+       if (is_array($saisies) and $id_ou_nom_ou_chemin) {
+               if (is_string($id_ou_nom_ou_chemin)) {
+                       $nom = $id_ou_nom_ou_chemin;
+                       // identifiant ? premier caractere @
+                       $id = ($nom[0] == '@');
+
+                       foreach ($saisies as $cle => $saisie) {
+                               $chemin = array($cle);
+                               // notre saisie est la bonne ?
+                               if ($nom == ($id ? $saisie['identifiant'] : $saisie['options']['nom'])) {
+                                       return $retourner_chemin ? $chemin : $saisie;
+                               // sinon a telle des enfants ? et si c'est le cas, cherchons dedans
+                               } elseif (isset($saisie['saisies']) and is_array($saisie['saisies']) and $saisie['saisies']
+                                       and ($retour = saisies_chercher($saisie['saisies'], $nom, $retourner_chemin))) {
+                                               return $retourner_chemin ? array_merge($chemin, array('saisies'), $retour) : $retour;
+                               }
+                       }
+               } elseif (is_array($id_ou_nom_ou_chemin)) {
+                       $chemin = $id_ou_nom_ou_chemin;
+                       $saisie = $saisies;
+                       // On vérifie l'existence quand même
+                       foreach ($chemin as $cle) {
+                               if (isset($saisie[$cle])) {
+                                       $saisie = $saisie[$cle];
+                               } else {
+                                       return null;
+                               }
+                       }
+                       // Si c'est une vraie saisie
+                       if ($saisie['saisie'] and $saisie['options']['nom']) {
+                               return $retourner_chemin ? $chemin : $saisie;
+                       }
+               }
+       }
+
+       return null;
+}
+
+/**
+ * Génère un nom unique pour un champ d'un formulaire donné
+ *
+ * @param array $formulaire
+ *     Le formulaire à analyser
+ * @param string $type_saisie
+ *     Le type de champ dont on veut un identifiant
+ * @return string
+ *     Un nom unique par rapport aux autres champs du formulaire
+ */
+function saisies_generer_nom($formulaire, $type_saisie) {
+       $champs = saisies_lister_champs($formulaire);
+
+       // Tant que type_numero existe, on incrémente le compteur
+       $compteur = 1;
+       while (array_search($type_saisie.'_'.$compteur, $champs) !== false) {
+               $compteur++;
+       }
+
+       // On a alors un compteur unique pour ce formulaire
+       return $type_saisie.'_'.$compteur;
+}
+
+/**
+ * Crée un identifiant Unique
+ * pour toutes les saisies donnees qui n'en ont pas
+ *
+ * @param Array $saisies Tableau de saisies
+ * @param Bool $regenerer Régénère un nouvel identifiant pour toutes les saisies ?
+ * @return Array Tableau de saisies complété des identifiants
+ */
+function saisies_identifier($saisies, $regenerer = false) {
+       if (!is_array($saisies)) {
+               return array();
+       }
+       foreach ($saisies as $k => $saisie) {
+               $saisies[$k] = saisie_identifier($saisie, $regenerer);
+       }
+       return $saisies;
+}
+
+/**
+ * Crée un identifiant Unique
+ * pour la saisie donnee si elle n'en a pas
+ * (et pour ses sous saisies éventuels)
+ *
+ * @param Array $saisie Tableau d'une saisie
+ * @param Bool $regenerer Régénère un nouvel identifiant pour la saisie ?
+ * @return Array Tableau de la saisie complété de l'identifiant
+**/
+function saisie_identifier($saisie, $regenerer = false) {
+       if (!isset($saisie['identifiant']) or !$saisie['identifiant']) {
+               $saisie['identifiant'] = uniqid('@');
+       } elseif ($regenerer) {
+               $saisie['identifiant'] = uniqid('@');
+       }
+       if (isset($saisie['saisies']) and is_array($saisie['saisies'])) {
+               $saisie['saisies'] = saisies_identifier($saisie['saisies'], $regenerer);
+       }
+       return $saisie;
+}
+
+/**
+ * Vérifier tout un formulaire tel que décrit avec les Saisies
+ *
+ * @param array $formulaire Le contenu d'un formulaire décrit dans un tableau de Saisies
+ * @param bool $saisies_masquees_nulles Si TRUE, les saisies masquées selon afficher_si ne seront pas verifiées, leur valeur étant forcée a NULL. Cette valeur NULL est transmise à traiter (via set_request).
+ * @return array Retourne un tableau d'erreurs
+ */
+function saisies_verifier($formulaire, $saisies_masquees_nulles = true) {
+       include_spip('inc/verifier');
+       $erreurs = array();
+       $verif_fonction = charger_fonction('verifier', 'inc', true);
+
+       if ($saisies_masquees_nulles) {
+               $formulaire = saisies_verifier_afficher_si($formulaire);
+       }
+
+       $saisies = saisies_lister_par_nom($formulaire);
+       foreach ($saisies as $saisie) {
+               $obligatoire = isset($saisie['options']['obligatoire']) ? $saisie['options']['obligatoire'] : '';
+               $champ = $saisie['options']['nom'];
+               $file = ($saisie['saisie'] == 'input' and isset($saisie['options']['type']) and $saisie['options']['type'] == 'file');
+               $verifier = isset($saisie['verifier']) ? $saisie['verifier'] : false;
+
+               // Si le nom du champ est un tableau indexé, il faut parser !
+               if (preg_match('/([\w]+)((\[[\w]+\])+)/', $champ, $separe)) {
+                       $valeur = _request($separe[1]);
+                       preg_match_all('/\[([\w]+)\]/', $separe[2], $index);
+                       // On va chercher au fond du tableau
+                       foreach ($index[1] as $cle) {
+                               $valeur = isset($valeur[$cle]) ? $valeur[$cle] : null;
+                       }
+               } else {
+                       // Sinon la valeur est juste celle du nom
+                       $valeur = _request($champ);
+               }
+
+               // Pour la saisie "destinataires" il faut filtrer si jamais on a mis un premier choix vide
+               if ($saisie['saisie'] == 'destinataires') {
+                       $valeur = array_filter($valeur);
+               }
+
+               // On regarde d'abord si le champ est obligatoire
+               if ($obligatoire
+                       and $obligatoire != 'non'
+                       and (
+                               ($file and !$_FILES[$champ]['name'])
+                               or (!$file and (
+                                       is_null($valeur)
+                                       or (is_string($valeur) and trim($valeur) == '')
+                                       or (is_array($valeur) and count($valeur) == 0)
+                               ))
+                       )
+               ) {
+                       $erreurs[$champ] =
+                               (isset($saisie['options']['erreur_obligatoire']) and $saisie['options']['erreur_obligatoire'])
+                               ? $saisie['options']['erreur_obligatoire']
+                               : _T('info_obligatoire');
+               }
+
+               // On continue seulement si ya pas d'erreur d'obligation et qu'il y a une demande de verif
+               if ((!isset($erreurs[$champ]) or !$erreurs[$champ]) and is_array($verifier) and $verif_fonction) {
+                       $normaliser = null;
+                       // Si le champ n'est pas valide par rapport au test demandé, on ajoute l'erreur
+                       $options = isset($verifier['options']) ? $verifier['options'] : array();
+                       if ($erreur_eventuelle = $verif_fonction($valeur, $verifier['type'], $options, $normaliser)) {
+                               $erreurs[$champ] = $erreur_eventuelle;
+                       // S'il n'y a pas d'erreur et que la variable de normalisation a été remplie, on l'injecte dans le POST
+                       } elseif (!is_null($normaliser)) {
+                               set_request($champ, $normaliser);
+                       }
+               }
+       }
+
+       return $erreurs;
+}
+
+/**
+ * Applatie une description tabulaire
+ * @param string $tab Le tableau à aplatir
+ * @return $nouveau_tab
+ */
+function saisies_aplatir_tableau($tab) {
+       $nouveau_tab = array();
+       foreach ($tab as $entree => $contenu) {
+               if (is_array($contenu)) {
+                       foreach ($contenu as $cle => $valeur) {
+                               $nouveau_tab[$cle] = $valeur;
+                       }
+               } else {
+                       $nouveau_tab[$entree] = $contenu;
+               }
+       }
+       return $nouveau_tab;
+}
+
+/**
+ * Applatie une description chaînée, en supprimant les sous-groupes.
+ * @param string $chaine La chaîne à aplatir
+ * @return $chaine
+ */
+function saisies_aplatir_chaine($chaine) {
+       return trim(preg_replace("#(?:^|\n)(\*(?:.*)|/\*)\n#i", "\n", $chaine));
+}
+
+/**
+ * Transforme une chaine en tableau avec comme principe :
+ *
+ * - une ligne devient une case
+ * - si la ligne est de la forme truc|bidule alors truc est la clé et bidule la valeur
+ * - si la ligne commence par * alors on commence un sous-tableau
+ * - si la ligne est égale à /*, alors on fini le sous-tableau
+ *
+ * @param string $chaine Une chaine à transformer
+ * @param string $separateur Séparateur utilisé
+ * @return array Retourne un tableau PHP
+ */
+function saisies_chaine2tableau($chaine, $separateur = "\n") {
+       if ($chaine and is_string($chaine)) {
+               $tableau = array();
+               $soustab = false;
+               // On découpe d'abord en lignes
+               $lignes = explode($separateur, $chaine);
+               foreach ($lignes as $i => $ligne) {
+                       $ligne = trim(trim($ligne), '|');
+                       // Si ce n'est pas une ligne sans rien
+                       if ($ligne !== '') {
+                               // si ca commence par * c'est qu'on va faire un sous tableau
+                               if (strpos($ligne, '*') === 0) {
+                                       $soustab=true;
+                                       $soustab_cle = _T_ou_typo(substr($ligne, 1), 'multi');
+                                       if (!isset($tableau[$soustab_cle])) {
+                                               $tableau[$soustab_cle] = array();
+                                       }
+                               } elseif ($ligne == '/*') {//si on finit sous tableau
+                                       $soustab=false;
+                               } else {
+                                       //sinon c'est une entrée normale
+                                       // Si on trouve un découpage dans la ligne on fait cle|valeur
+                                       if (strpos($ligne, '|') !== false) {
+                                               list($cle,$valeur) = explode('|', $ligne, 2);
+                                               // permettre les traductions de valeurs au passage
+                                               if ($soustab == true) {
+                                                       $tableau[$soustab_cle][$cle] = _T_ou_typo($valeur, 'multi');
+                                               } else {
+                                                       $tableau[$cle] = _T_ou_typo($valeur, 'multi');
+                                               }
+                                       } else {
+                                               // Sinon on génère la clé
+                                               if ($soustab == true) {
+                                                       $tableau[$soustab_cle][$i] = _T_ou_typo($ligne, 'multi');
+                                               } else {
+                                                       $tableau[$i] = _T_ou_typo($ligne, 'multi');
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return $tableau;
+       } elseif (is_array($chaine)) {
+               // Si c'est déjà un tableau on lui applique _T_ou_typo (qui fonctionne de manière récursive avant de le renvoyer
+               return _T_ou_typo($chaine, 'multi');
+       } else {
+               return array();
+       }
+}
+
+/**
+ * Transforme un tableau en chaine de caractères avec comme principe :
+ *
+ * - une case de vient une ligne de la chaine
+ * - chaque ligne est générée avec la forme cle|valeur
+ * - si une entrée du tableau est elle même un tableau, on met une ligne de la forme *clef
+ * - pour marquer que l'on quitte un sous-tableau, on met une ligne commencant par /*, sauf si on bascule dans un autre sous-tableau.
+ *
+ * @param array $tableau Tableau à transformer
+ * @return string Texte représentant les données du tableau
+ */
+function saisies_tableau2chaine($tableau) {
+       if ($tableau and is_array($tableau)) {
+               $chaine = '';
+               $avant_est_tableau = false;
+               foreach ($tableau as $cle => $valeur) {
+                       if (is_array($valeur)) {
+                               $avant_est_tableau = true;
+                               $ligne=trim("*$cle");
+                               $chaine .= "$ligne\n";
+                               $chaine .= saisies_tableau2chaine($valeur)."\n";
+                       } else {
+                               if ($avant_est_tableau == true) {
+                                       $avant_est_tableau = false;
+                                       $chaine.="/*\n";
+                               }
+                               $ligne = trim("$cle|$valeur");
+                               $chaine .= "$ligne\n";
+                       }
+               }
+               $chaine = trim($chaine);
+
+               return $chaine;
+       } elseif (is_string($tableau)) {
+               // Si c'est déjà une chaine on la renvoie telle quelle
+               return $tableau;
+       } else {
+               return '';
+       }
+}
+
+/**
+ * Transforme une valeur en tableau d'élements si ce n'est pas déjà le cas
+ *
+ * @param mixed $valeur
+ * @return array Tableau de valeurs
+**/
+function saisies_valeur2tableau($valeur) {
+       if (is_array($valeur)) {
+               return $valeur;
+       }
+
+       if (!strlen($valeur)) {
+               return array();
+       }
+
+       $t = saisies_chaine2tableau($valeur);
+       if (count($t) > 1) {
+               return $t;
+       }
+
+       // qu'une seule valeur, c'est qu'elle a peut etre un separateur a virgule
+       // et a donc une cle est 0 dans ce cas la d'ailleurs
+       if (isset($t[0])) {
+               $t = saisies_chaine2tableau($t[0], ',');
+       }
+
+       return $t;
+}
+
+/**
+ * Pour les saisies multiples (type checkbox) proposant un choix alternatif,
+ * retrouve à partir des data de choix proposés
+ * et des valeurs des choix enregistrés
+ * le texte enregistré pour le choix alternatif.
+ *
+ * @param array $data
+ * @param array $valeur
+ * @return string choix_alternatif
+**/
+function saisies_trouver_choix_alternatif($data, $valeur) {
+       if (!is_array($valeur)) {
+               $valeur = saisies_chaine2tableau($valeur) ;
+       }
+       if (!is_array($data)) {
+               $data = saisies_chaine2tableau($data) ;
+       }
+       $choix_theorique = array_keys($data);
+       $choix_alternatif = array_values(array_diff($valeur, $choix_theorique));
+       return $choix_alternatif[0];//on suppose que personne ne s'est amusé à proposer deux choix alternatifs
+}
+
+/**
+ * Génère une page d'aide listant toutes les saisies et leurs options
+ *
+ * Retourne le résultat du squelette `inclure/saisies_aide` auquel
+ * on a transmis toutes les saisies connues.
+ *
+ * @return string Code HTML
+ */
+function saisies_generer_aide() {
+       // On a déjà la liste par saisie
+       $saisies = saisies_lister_disponibles();
+
+       // On construit une liste par options
+       $options = array();
+       foreach ($saisies as $type_saisie => $saisie) {
+               $options_saisie = saisies_lister_par_nom($saisie['options'], false);
+               foreach ($options_saisie as $nom => $option) {
+                       // Si l'option n'existe pas encore
+                       if (!isset($options[$nom])) {
+                               $options[$nom] = _T_ou_typo($option['options']);
+                       }
+                       // On ajoute toujours par qui c'est utilisé
+                       $options[$nom]['utilisee_par'][] = $type_saisie;
+               }
+               ksort($options_saisie);
+               $saisies[$type_saisie]['options'] = $options_saisie;
+       }
+       ksort($options);
+
+       return recuperer_fond(
+               'inclure/saisies_aide',
+               array(
+                       'saisies' => $saisies,
+                       'options' => $options
+               )
+       );
+}
+
+/**
+ * Le tableau de saisies a-t-il une option afficher_si ?
+ *
+ * @param array $saisies Un tableau de saisies
+ * @return boolean
+ */
+
+function saisies_afficher_si($saisies) {
+       $saisies = saisies_lister_par_nom($saisies, true);
+       // Dès qu'il y a au moins une option afficher_si, on l'active
+       foreach ($saisies as $saisie) {
+               if (isset($saisie['options']['afficher_si'])) {
+                       return true;
+               }
+       }
+       return false;
+}
+
+
+/**
+ * Le tableau de saisies a-t-il une option afficher_si_remplissage ?
+ *
+ * @param array $saisies Un tableau de saisies
+ * @return boolean
+ */
+function saisies_afficher_si_remplissage($saisies) {
+       $saisies = saisies_lister_par_nom($saisies, true);
+       // Dès qu'il y a au moins une option afficher_si_remplissage, on l'active
+       foreach ($saisies as $saisie) {
+               if (isset($saisie['options']['afficher_si_remplissage'])) {
+                       return true;
+               }
+       }
+       return false;
+}
index 4e7e348..f90c820 100644 (file)
@@ -155,9 +155,8 @@ function saisies_generer_html($champ, $env = array()) {
                }
 
                $contexte = array_merge($env, $contexte);
-       }
-       // Sinon on ne sélectionne que quelques éléments importants
-       else {
+       } else {
+               // Sinon on ne sélectionne que quelques éléments importants
                // On récupère la liste des erreurs
                $contexte['erreurs'] = $env['erreurs'];
                // On récupère la langue de l'objet si existante
@@ -170,20 +169,19 @@ function saisies_generer_html($champ, $env = array()) {
 
        // Dans tous les cas on récupère de l'environnement la valeur actuelle du champ
        // Si le nom du champ est un tableau indexé, il faut parser !
-       if (isset($contexte['nom']) and preg_match('/([\w]+)((\[[\w]+\])+)/', $contexte['nom'], $separe)) {
+       if (isset($contexte['nom']) and preg_match('/([\w]+)((\[[\w]+\])+)/', $contexte['nom'], $separe)
+                       and isset($env[$separe[1]])) {
                $contexte['valeur'] = $env[$separe[1]];
                preg_match_all('/\[([\w]+)\]/', $separe[2], $index);
                // On va chercher au fond du tableau
                foreach ($index[1] as $cle) {
                        $contexte['valeur'] = isset($contexte['valeur'][$cle]) ? $contexte['valeur'][$cle] : null;
                }
-       }
-       // Sinon la valeur est juste celle du nom si elle existe
-       elseif (isset($contexte['nom']) and isset($env[$contexte['nom']])) {
+       } elseif (isset($contexte['nom']) and isset($env[$contexte['nom']])) {
+               // Sinon la valeur est juste celle du nom si elle existe
                $contexte['valeur'] = $env[$contexte['nom']];
-       }
-       // Sinon rien
-       else {
+       } else {
+               // Sinon rien
                $contexte['valeur'] = null;
        }
 
@@ -266,20 +264,18 @@ function saisies_generer_vue($saisie, $env = array(), $env_obligatoire = array()
        // Dans tous les cas on récupère de l'environnement la valeur actuelle du champ
 
        // On regarde en priorité s'il y a un tableau listant toutes les valeurs
-       if ($env['valeurs'] and is_array($env['valeurs']) and isset($env['valeurs'][$contexte['nom']])) {
+       if (!empty($env['valeurs']) and is_array($env['valeurs']) and isset($env['valeurs'][$contexte['nom']])) {
                $contexte['valeur'] = $env['valeurs'][$contexte['nom']];
-       }
-       // Si le nom du champ est un tableau indexé, il faut parser !
-       elseif (preg_match('/([\w]+)((\[[\w]+\])+)/', $contexte['nom'], $separe)) {
+       } elseif (preg_match('/([\w]+)((\[[\w]+\])+)/', $contexte['nom'], $separe)) {
+               // Si le nom du champ est un tableau indexé, il faut parser !
                $contexte['valeur'] = $env[$separe[1]];
                preg_match_all('/\[([\w]+)\]/', $separe[2], $index);
                // On va chercher au fond du tableau
                foreach ($index[1] as $cle) {
                        $contexte['valeur'] = $contexte['valeur'][$cle];
                }
-       }
-       // Sinon la valeur est juste celle du nom
-       else {
+       } else {
+               // Sinon la valeur est juste celle du nom
                // certains n'ont pas de nom (fieldset)
                $contexte['valeur'] = isset($env[$contexte['nom']]) ? $env[$contexte['nom']] : '';
        }
@@ -334,7 +330,12 @@ function saisies_generer_js_afficher_si($saisies, $id_form) {
                                                                $class_li = 'explication_'.$saisie['options']['nom'];
                                                                break;
                                                        default:
-                                                               $class_li = 'editer_'.$saisie['options']['nom'];
+                                                               // Les [] dans le nom de la saisie sont transformés en _ dans le
+                                                               // nom de la classe, il faut faire pareil
+                                                               $class_li = 'editer_' . rtrim(
+                                                                       preg_replace('/[][]\[?/', '_', $saisie['options']['nom']),
+                                                                       '_'
+                                                               );
                                                }
                                                $afficher_si = isset($saisie['options']['afficher_si']) ? $saisie['options']['afficher_si'] : '';
                                                $afficher_si_remplissage = isset($saisie['options']['afficher_si_remplissage']) ? $saisie['options']['afficher_si_remplissage'] : '';
index 6dc3b80..d66a8b7 100644 (file)
@@ -255,12 +255,13 @@ function saisies_comparer_rappel($a, $b) {
  *
  * @param array $saisies_anciennes Un tableau décrivant des saisies
  * @param array $saisies_nouvelles Un autre tableau décrivant des saisies
- * @param bool  $avec_conteneur    Indique si on veut prendre en compte dans la comparaison les conteneurs comme les fieldsets
+ * @param bool  $avec_conteneur    Indique si on veut prendre en compte dans la comparaison
+ * les conteneurs comme les fieldsets
  *
  * @return array Retourne le tableau des saisies supprimées, ajoutées et modifiées
  */
 function saisies_comparer_par_identifiant($saisies_anciennes, $saisies_nouvelles, $avec_conteneur = true) {
-       return saisies_comparer($saisies_anciennes, $saisies_nouvelles, $avec_conteneur, $tri = 'identifiant');
+       return saisies_comparer($saisies_anciennes, $saisies_nouvelles, $avec_conteneur, 'identifiant');
 }
 
 /**
@@ -268,7 +269,7 @@ function saisies_comparer_par_identifiant($saisies_anciennes, $saisies_nouvelles
  *
  * @return array Un tableau listant des saisies et leurs options
  */
-function saisies_lister_disponibles($saisies_repertoire = "saisies") {
+function saisies_lister_disponibles($saisies_repertoire = 'saisies') {
        static $saisies = null;
 
        if (is_null($saisies)) {
@@ -299,7 +300,7 @@ function saisies_lister_disponibles($saisies_repertoire = "saisies") {
  *
  * @return array Un tableau listant des saisies et leurs options
  */
-function saisies_groupes_lister_disponibles($saisies_repertoire = "saisies") {
+function saisies_groupes_lister_disponibles($saisies_repertoire = 'saisies') {
        static $saisies = null;
 
        if (is_null($saisies)) {
@@ -311,7 +312,7 @@ function saisies_groupes_lister_disponibles($saisies_repertoire = "saisies") {
                                $type_saisie = preg_replace(',[.]yaml$,i', '', $fichier);
                                $dossier = str_replace($fichier, '', $chemin);
                                // On ne garde que les saisies qui ont bien le HTML avec !
-                               if (is_array($saisie = saisies_charger_infos($type_saisie,$saisies_repertoire))) {
+                               if (is_array($saisie = saisies_charger_infos($type_saisie, $saisies_repertoire))) {
                                        $saisies[$type_saisie] = $saisie;
                                }
                        }
@@ -325,7 +326,7 @@ function saisies_groupes_lister_disponibles($saisies_repertoire = "saisies") {
  *
  * @return array Un tableau listant des saisies et leurs options
  */
-function saisies_lister_disponibles_sql($saisies_repertoire = "saisies") {
+function saisies_lister_disponibles_sql($saisies_repertoire = 'saisies') {
        $saisies = array();
        $saisies_disponibles = saisies_lister_disponibles($saisies_repertoire);
        foreach ($saisies_disponibles as $type => $saisie) {
@@ -344,7 +345,7 @@ function saisies_lister_disponibles_sql($saisies_repertoire = "saisies") {
  *
  * @return array Un tableau contenant le YAML décodé
  */
-function saisies_charger_infos($type_saisie,$saisies_repertoire = "saisies") {
+function saisies_charger_infos($type_saisie, $saisies_repertoire = 'saisies') {
        if (defined('_DIR_PLUGIN_YAML')) {
                include_spip('inc/yaml');
                $fichier = find_in_path("$saisies_repertoire/$type_saisie.yaml");
index e498390..0894e06 100644 (file)
@@ -140,17 +140,15 @@ function saisies_deplacer($saisies, $id_ou_nom_ou_chemin, $ou) {
                if (!$ou) {
                        $saisies = saisies_supprimer($saisies, $id_ou_nom_ou_chemin);
                        $chemin = array(count($saisies));
-               }
-               // Si l'endroit est entre crochet, c'est un conteneur
-               elseif (preg_match('/^\[(@?[\w]*)\]$/', $ou, $match)) {
+               } elseif (preg_match('/^\[(@?[\w]*)\]$/', $ou, $match)) {
+                       // Si l'endroit est entre crochet, c'est un conteneur
                        $parent = $match[1];
                        // Si dans les crochets il n'y a rien, on met à la fin du formulaire
                        if (!$parent) {
                                $saisies = saisies_supprimer($saisies, $id_ou_nom_ou_chemin);
                                $chemin = array(count($saisies));
-                       }
-                       // Sinon on vérifie que ce conteneur existe
-                       elseif (saisies_chercher($saisies, $parent, true)) {
+                       } elseif (saisies_chercher($saisies, $parent, true)) {
+                               // Sinon on vérifie que ce conteneur existe
                                // S'il existe on supprime la saisie et on recherche la nouvelle position
                                $saisies = saisies_supprimer($saisies, $id_ou_nom_ou_chemin);
                                $parent = saisies_chercher($saisies, $parent, true);
@@ -158,9 +156,8 @@ function saisies_deplacer($saisies, $id_ou_nom_ou_chemin, $ou) {
                        } else {
                                $chemin = false;
                        }
-               }
-               // Sinon ça sera devant un champ
-               else {
+               } else {
+                       // Sinon ça sera devant un champ
                        // On vérifie que le champ existe
                        if (saisies_chercher($saisies, $ou, true)) {
                                // S'il existe on supprime la saisie
@@ -205,8 +202,7 @@ function saisies_modifier($saisies, $id_ou_nom_ou_chemin, $modifs) {
                $modifs['options']['nom'] = $parent[$position]['options']['nom'];
        }
        // On récupère les enfants tels quels s'il n'y a pas des enfants dans la modif
-       if (
-               !isset($modifs['saisies'])
+       if (!isset($modifs['saisies'])
                and isset($parent[$position]['saisies'])
                and is_array($parent[$position]['saisies'])
        ) {
index da20293..07e988f 100644 (file)
@@ -1,17 +1,20 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function construire_configuration_saisie($saisie, $avec_nom='non'){
+function construire_configuration_saisie($saisie, $avec_nom = 'non') {
        include_spip('inc/yaml');
        $configuration_saisie = yaml_decode_file(find_in_path('saisies/'.$saisie.'.yaml'));
-       
-       if (is_array($configuration_saisie)){
+
+       if (is_array($configuration_saisie)) {
                $configuration_saisie = $configuration_saisie['options'];
                // On ne met le premier champ permettant de configurer le "name" seulement si on le demande explicitement
-               if ($avec_nom == 'oui')
-                       array_unshift($configuration_saisie[0]['contenu'],
+               if ($avec_nom == 'oui') {
+                       array_unshift(
+                               $configuration_saisie[0]['contenu'],
                                array(
                                        'saisie' => 'input',
                                        'options' => array(
@@ -28,10 +31,9 @@ function construire_configuration_saisie($saisie, $avec_nom='non'){
                                        )
                                )
                        );
-       }
-       else
+               }
+       } else {
                $configuration_saisie = array();
-       
+       }
        return $configuration_saisie;
 }
-
index 138397a..bfc7b82 100644 (file)
@@ -16,5 +16,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'إنشاء حقول استمارات بسهولة',
        'saisies_titre' => 'إدخال للاستمارات'
 );
-
-?>
index 7ba1e40..4d64520 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Unkompliziertes Erstellen von Eingabefeldern für Formulare.',
        'saisies_titre' => 'Eingabefelder für Formulare'
 );
-
-?>
index 4da860b..bf6a2e7 100644 (file)
@@ -17,5 +17,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Create easily forms fields.',
        'saisies_titre' => 'Entries for forms'
 );
-
-?>
index 4e4684b..8f279fe 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Escribir fácilmente los campos de formularios.',
        'saisies_titre' => 'Entradas para formularios'
 );
-
-?>
index 4107b51..d3e0dab 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Écrire facilement des champs de formulaires.',
        'saisies_titre' => 'Saisies pour formulaires'
 );
-
-?>
index a6c0317..cda4f4b 100644 (file)
@@ -17,5 +17,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Écrire facilement des champs de formulaires.',
        'saisies_titre' => 'Saisies pour formulaires'
 );
-
-?>
index e16d00f..c7826bb 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Eenvoudig formuliervelden maken.',
        'saisies_titre' => 'Invoer voor formulieren'
 );
-
-?>
index 057c563..a2729f2 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Facilitar a entrada de dados em campos de formulários.',
        'saisies_titre' => 'Entrada de dados para formulários'
 );
-
-?>
index b0ed597..7913aa7 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Упрощение работы по созданию форм',
        'saisies_titre' => 'Поля для форм (saises)'
 );
-
-?>
index c8e2287..443e741 100644 (file)
@@ -15,5 +15,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'saisies_slogan' => 'Jednoduchý zápis polí formulárov.',
        'saisies_titre' => 'Vstupy pre formuláre'
 );
-
-?>
index d5b0a84..36886a5 100644 (file)
@@ -1,47 +1,47 @@
 <traduction module="saisies" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/saisies/trunk/lang/" reference="fr">
-       <langue code="ca" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=ca" total="170" traduits="85" relire="0" modifs="9" nouveaux="76" pourcent="50.00">
+       <langue code="ca" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=ca" total="172" traduits="85" relire="0" modifs="9" nouveaux="78" pourcent="49.42">
        </langue>
-       <langue code="de" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=de" total="170" traduits="145" relire="0" modifs="3" nouveaux="22" pourcent="85.29">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=de" total="172" traduits="145" relire="0" modifs="3" nouveaux="24" pourcent="84.30">
                <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/saisies?lang_cible=en" total="170" traduits="169" relire="0" modifs="0" nouveaux="1" pourcent="99.41">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=en" total="172" traduits="172" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="jack31" lien="http://trad.spip.net/auteur/jack31" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
                <traducteur nom="Paolo" lien="http://trad.spip.net/auteur/paolo" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=es" total="170" traduits="162" relire="0" modifs="0" nouveaux="8" pourcent="95.29">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=es" total="172" traduits="162" relire="0" modifs="0" nouveaux="10" pourcent="94.19">
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
                <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
                <traducteur nom="severo" lien="http://trad.spip.net/auteur/severo" />
        </langue>
-       <langue code="fa" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fa" total="170" traduits="107" relire="0" modifs="3" nouveaux="60" pourcent="62.94">
+       <langue code="fa" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fa" total="172" traduits="107" relire="0" modifs="3" nouveaux="62" pourcent="62.21">
                <traducteur nom="Davood Hossein" lien="http://trad.spip.net/auteur/davood-hossein" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fr" total="170" traduits="170" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fr" total="172" traduits="172" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fr_tu" total="170" traduits="159" relire="0" modifs="0" nouveaux="11" pourcent="93.53">
+       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=fr_tu" total="172" traduits="159" relire="0" modifs="0" nouveaux="13" pourcent="92.44">
                <traducteur nom="beatnick" lien="http://trad.spip.net/auteur/beatnick" />
                <traducteur nom="Cerf" lien="http://trad.spip.net/auteur/cerf" />
        </langue>
-       <langue code="it" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=it" total="170" traduits="139" relire="0" modifs="3" nouveaux="28" pourcent="81.76">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=it" total="172" traduits="139" relire="0" modifs="3" nouveaux="30" pourcent="80.81">
        </langue>
-       <langue code="nl" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=nl" total="170" traduits="165" relire="0" modifs="0" nouveaux="5" pourcent="97.06">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=nl" total="172" traduits="172" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="mpossoz" lien="http://trad.spip.net/auteur/mpossoz" />
        </langue>
-       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=pt_br" total="170" traduits="169" relire="0" modifs="0" nouveaux="1" pourcent="99.41">
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=pt_br" total="172" traduits="170" relire="0" modifs="0" nouveaux="2" pourcent="98.84">
                <traducteur nom="placido" lien="http://trad.spip.net/auteur/placido" />
                <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
        </langue>
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=ru" total="170" traduits="148" relire="0" modifs="10" nouveaux="12" pourcent="87.06">
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=ru" total="172" traduits="148" relire="0" modifs="10" nouveaux="14" pourcent="86.05">
                <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
                <traducteur nom="olly" lien="http://trad.spip.net/auteur/olly" />
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=sk" total="170" traduits="162" relire="0" modifs="0" nouveaux="8" pourcent="95.29">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/saisies?lang_cible=sk" total="172" traduits="162" relire="0" modifs="0" nouveaux="10" pourcent="94.19">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
index 959fc0b..9c686e4 100644 (file)
@@ -117,5 +117,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index c2d8dfe..4e6dce0 100644 (file)
@@ -177,5 +177,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'Zzz'
 );
-
-?>
index b4818be..a582617 100644 (file)
@@ -23,6 +23,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'construire_action_dupliquer_copie' => '(copy)',
        'construire_action_supprimer' => 'Delete',
        'construire_ajouter_champ' => 'Add a field',
+       'construire_ajouter_groupe' => 'Add a group',
        'construire_attention_enregistrer' => 'Remember to save your changes!',
        'construire_attention_modifie' => 'The form below is different from the initial form. You can reset it to the state before the changes.',
        'construire_attention_supprime' => 'Your changes include deletions of fields. Please confirm the registration of the new version of the form.',
@@ -107,6 +108,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_label_case_label' => 'Label located beside the check box',
        'option_label_explication' => 'The title that will be displayed.',
        'option_label_label' => 'Label',
+       'option_limite_branche_explication' => 'Limit the choice to one specific branch of the site',
+       'option_limite_branche_label' => 'Limit to one branch',
        'option_maxlength_explication' => 'The user can not type more characters than this number.',
        'option_maxlength_label' => 'Maximum number of characters',
        'option_multiple_explication' => 'The user will be able to select several values',
@@ -198,5 +201,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 0ecef17..35b671e 100644 (file)
@@ -191,5 +191,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 34d2550..1ccba8b 100644 (file)
@@ -133,5 +133,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index ed7e220..0beef4a 100644 (file)
@@ -106,6 +106,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_label_case_label' => 'Label placé à côté de la case',
        'option_label_explication' => 'Le titre qui sera affiché.',
        'option_label_label' => 'Label',
+       'option_limite_branche_explication' => 'Limitera le choix à une branche spécifique du site',
+       'option_limite_branche_label' => 'Limiter à une branche',
        'option_maxlength_explication' => 'L’utilisateur ne pourra pas taper plus de caractères que ce nombre.',
        'option_maxlength_label' => 'Nombre de caractères maximum',
        'option_multiple_explication' => 'L’utilisateur pourra sélectionner plusieurs valeurs',
@@ -197,5 +199,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index cb888bc..3b442a8 100644 (file)
@@ -188,5 +188,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 1b24b97..974106b 100644 (file)
@@ -171,5 +171,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 2678a15..61ec016 100644 (file)
@@ -23,6 +23,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'construire_action_dupliquer_copie' => '(copy)',
        'construire_action_supprimer' => 'Verwijder',
        'construire_ajouter_champ' => 'Voeg veld toe',
+       'construire_ajouter_groupe' => 'Een groep toevoegen',
        'construire_attention_enregistrer' => 'Sla je wijzingen op!',
        'construire_attention_modifie' => 'Het onderstaande formulier wijkt van het oorspronkelijke af. Je kunt het naar de oorspronkelijke staat herstellen.',
        'construire_attention_supprime' => 'Je wijzigingen bevatten verwijderingen van velden. Bevestig de nieuwe formulierversie.',
@@ -107,6 +108,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_label_case_label' => 'Label staat naast de checkbox',
        'option_label_explication' => 'De titel die zal worden weergegeven.',
        'option_label_label' => 'Label',
+       'option_limite_branche_explication' => 'Beperk de keuze tot een specifieke tak van de site',
+       'option_limite_branche_label' => 'Tot één tak (hoofdrubriek) beperken',
        'option_maxlength_explication' => 'De gebruikers kan niet meer tekens invoeren dan dit aantal.',
        'option_maxlength_label' => 'Maximum aantal tekens',
        'option_multiple_explication' => 'De gebruiker kan meerdere waardes kiezen',
@@ -138,6 +141,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_type_label' => 'Veldtype',
        'option_type_password' => 'Verborgen tekst tijdens invoer (bv: wachtwoord)',
        'option_type_text' => 'Normaal',
+       'option_valeur_non_explication' => 'Geposte waarde wanneer de checkbox niet wordt geselecteerd',
+       'option_valeur_non_label' => 'Waarde non',
+       'option_valeur_oui_explication' => 'Geposte waarde wanneer de checkbox is geselecteerd',
+       'option_valeur_oui_label' => 'Waarde oui',
 
        // S
        'saisie_auteurs_explication' => 'Laat je een of meer auteurs kiezen',
@@ -194,5 +201,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 315dbd4..9705f87 100644 (file)
@@ -23,6 +23,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'construire_action_dupliquer_copie' => '(cópia)',
        'construire_action_supprimer' => 'Excluir',
        'construire_ajouter_champ' => 'Incluir um campo',
+       'construire_ajouter_groupe' => 'Incluir um grupo',
        'construire_attention_enregistrer' => 'Lembre-se de gravar as suas alterações!',
        'construire_attention_modifie' => 'O formulário abaixo é diferente do formulário inicial.Você tem a possibilidade de revertê-lo ao estado em que estava, antes das suas alterações.',
        'construire_attention_supprime' => 'As suas alterações incluem exclusões de campos. Por favor, confirme a gravação desta nova versão do formulário.',
@@ -200,5 +201,3 @@ Você pode indicar o início de um subgrupo, no formato "*Título do subgrupo".
        // Z
        'z' => 'zzz'
 );
-
-?>
index 6594de7..0f19484 100644 (file)
@@ -187,5 +187,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 37b305b..a2d89dd 100644 (file)
@@ -191,5 +191,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // Z
        'z' => 'zzz'
 );
-
-?>
index 579e54b..5fe2150 100644 (file)
@@ -1,7 +1,7 @@
 <paquet
        prefix="saisies"
        categorie="outil"
-       version="2.6.1"
+       version="2.7.10"
        etat="stable"
        compatibilite="[3.0.0;3.1.*]"
        logo="images/logo_saisie_48.png"
@@ -19,6 +19,7 @@
        <pipeline nom="header_prive" inclure="saisies_pipelines.php" />
        <pipeline nom="affichage_final" inclure="saisies_pipelines.php" />
        <pipeline nom="saisies_autonomes" action="" />
+       <pipeline nom="saisies_construire_formulaire_config" action="" />
        <pipeline nom="formulaire_saisies" action="" />
        <pipeline nom="formulaire_charger" inclure="saisies_pipelines.php" />
        <pipeline nom="formulaire_verifier" inclure="saisies_pipelines.php" />
index 5556cf9..9dbb831 100644 (file)
@@ -1,3 +1,7 @@
 <?php
 
-include_spip('prive/formulaires/selecteur/selecteur_fonctions');
\ No newline at end of file
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('prive/formulaires/selecteur/selecteur_fonctions');
index 342fc40..68dd24a 100644 (file)
@@ -21,6 +21,7 @@
   - saisies_base_conteneur : définit la balise englobante de la saisie (balise div par défaut en SPIP 3.1+, et li avant)\r
   - conteneur_class : Classe CSS à ajouter au conteneur\r
   - li_class : pour compatibilité. Voir conteneur_class\r
+  - label_class : pour mettre des styles sur les labels\r
 \r
   \r
   Exemples d'appels :\r
@@ -33,7 +34,7 @@
 [(#ENV{nom}|oui)\r
        #SET{obligatoire,#ENV{obligatoire}|et{#ENV{obligatoire}|!={non}}|?{obligatoire,''}}\r
        #SET{disable,#ENV{disable,#ENV{disable_avec_post}}|et{#ENV{disable,#ENV{disable_avec_post}}|!={non}}|?{#ENV{disable}|is_array|?{#ENV{disable,#ARRAY},disabled},''}}\r
-       #SET{readonly,#ENV{readonly}|et{#ENV{readonly}!={non}}|?{readonly,''}}\r
+       #SET{readonly,#ENV{readonly}|et{#ENV{readonly}|!={non}}|?{readonly,''}}\r
        #SET{saisies_autonomes,#VAL|saisies_autonomes}\r
 \r
        [(#ENV{type_saisie}|in_array{#GET{saisies_autonomes}}|oui)\r
@@ -45,7 +46,7 @@
                <!--!inserer_saisie_editer-->\r
                <[(#ENV{saisies_base_conteneur,[(#VAL{li}|saisie_balise_structure_formulaire)]})] class="editer editer_[(#ENV{nom}|saisie_nom2classe)][ (#GET{obligatoire})][ (#GET{erreurs}|oui)erreur][ (#GET{conteneur_class})][ (#ENV{conteneur_class,#ENV{li_class}})][ saisie_(#ENV{type_saisie})]"[ data-id="(#ENV{id_saisie})"]>\r
                        #ENV*{inserer_debut}\r
-                       [<label[(#ENV{type_saisie}|match{oui_non|radio|checkbox}|non) for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"]>(#ENV*{label})[<span class='obligatoire'>(#GET{obligatoire}|oui)[(#ENV*{info_obligatoire}|is_null|?{<:info_obligatoire_02:>,#ENV*{info_obligatoire}})]</span>]</label>]\r
+                       [<label[(#ENV{type_saisie}|match{oui_non|radio|checkbox}|non) for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"][ class="(#ENV{label_class})"]>(#ENV*{label})[<span class='obligatoire'>(#GET{obligatoire}|oui)[(#ENV*{info_obligatoire}|is_null|?{<:info_obligatoire_02:>,#ENV*{info_obligatoire}})]</span>]</label>]\r
                        [<span class='erreur_message'>(#GET{erreurs})</span>]\r
                        [<p class="explication" id="[explication_(#ENV{nom}|saisie_nom2name)]">(#ENV*{explication})</p>]\r
                        [<em class='attention'>(#ENV*{attention})</em>]\r
index c14e0a9..1dbc335 100644 (file)
        [(#GET{disabled}|oui) #SET{disabled,#ARRAY|push{#GET{disabled}}} ]
 ]
 [(#ENV{tout_selectionner}|oui)
-       <div class="[(#ENV{choix,choix})][ (#ENV{choix,choix})_tout_selectionner ]none-nojs">
+       <div class="[(#ENV{choix,choix})][ (#ENV{choix,choix})_tout_selectionner ][ (#ENV{class}) ]none-nojs">
                <input type="checkbox" name="#ENV{nom}_tout" class="checkbox" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_tout" value="on" onChange="if (jQuery(this).prop('checked')==true) jQuery(this).parent('div').parent().find('input').prop('checked',true); else jQuery(this).parent('div').parent().find('input').prop('checked',false);"/>
-               <label for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_tout"><:saisies:tout_selectionner:></label>
+               <label for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_tout"[ class="(#ENV{label_class})"]><:saisies:tout_selectionner:></label>
        </div>
 ]
 
 <BOUCLE_checkbox(POUR){tableau #GET{datas}}>
-<div class="#ENV{choix,choix}[ (#ENV{choix,choix})_#CLE]">[(#SET{id,champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_[(#COMPTEUR_BOUCLE|concat{'-',#CLE}|md5)]})]
+<div class="#ENV{choix,choix}[ (#ENV{choix,choix})_#CLE][ (#ENV{class})]">[(#SET{id,champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_[(#COMPTEUR_BOUCLE|concat{'-',#CLE}|md5)]})]
        <input type="checkbox" name="#ENV{nom}[]" class="checkbox" id="#GET{id}"[ (#CLE|in_array{#ENV{valeur_forcee,#GET{valeur,#GET{defaut}}}}|oui)checked="checked"] value="#CLE"[(#CLE|in_array{#GET{disabled}}|oui) disabled="disabled"][ aria-describedby="(#ENV{describedby})"][ (#ENV*{attributs})] />
        <label for="#GET{id}"[(#CLE|in_array{#ENV{valeur_forcee,#GET{valeur,#GET{defaut}}}}|oui)class="on"]>#VALEUR</label>
 </div>
 </BOUCLE_checkbox>
 [(#ENV{choix_alternatif}|oui)
-<div class="#ENV{choix,choix} choix_alternatif[ (#ENV{choix,choix})_alternatif]">
+<div class="#ENV{choix,choix} choix_alternatif[ (#ENV{choix,choix})_alternatif][ (#ENV{class})]">
     <input name="#ENV{nom}\[choix_alternatif\]" id="[champ_(#ENV{id,#ENV{nom}}|saisie_nom2classe)_choix_alternatif]"[ value="(#ENV{datas}|saisies_trouver_choix_alternatif{#GET{valeur}})"] />
     
-    <label for="[champ_(#ENV{id,#ENV{nom}}|saisie_nom2classe)_choix_alternatif]">
+    <label for="[champ_(#ENV{id,#ENV{nom}}|saisie_nom2classe)_choix_alternatif]"[ class="(#ENV{label_class})"]>
          [(#ENV{choix_alternatif_label, <:saisies:option_choix_alternatif_label_defaut:>})]
     </label>
     [<p class="explication">
index 5caa781..c29e332 100644 (file)
@@ -8,14 +8,13 @@
   Exemple d'appel :
        [(#SAISIE{choisir_objets, gis_objets,
                label=<:gis:cfg_lbl_activer_objets:>,
+               defaut=#LISTE{spip_articles,spip_rubriques},
                exclus=spip_gis})]
 
 ]
-
 [(#REM) defaut peut être une chaine (plusieurs valeurs ou pas) qu'on sait décomposer ]
 #SET{defaut, #ENV{defaut}|saisies_chaine2tableau}
 
 [(#REM) valeur doit être un tableau ! ]
-#SET{valeur, #ENV{valeur}|saisies_valeur2tableau}
-
+#SET{valeur, #ENV{valeur,#GET{defaut}}|saisies_valeur2tableau}
 #INCLURE{fond=formulaires/inc-choisir-objets,name=#ENV{nom},selected=#GET{valeur},exclus=#ENV{exclus}}
index 6f775da..7d24a10 100644 (file)
@@ -16,7 +16,8 @@
 
                [(#ENV{label}|oui)
                        [(#REM) Récupérer le tag qui sera utilisé pour la légende ]
-                       [(#SET{tag, [(#ENV*{tagfield,#GLOBALS{debut_intertitre,<h3>}}|inserer_attribut{class,legend})]})]
+                       [(#SET{tag_titre_defaut,[<(#VAL{"{{{ titre }}}"}|propre|replace{"<(\S*).*>",$1,i})>]})]
+                       [(#SET{tag, [(#ENV*{tagfield,#GET{tag_titre_defaut}}|inserer_attribut{class,legend})]})]
                        [(#INCLURE{fond=inclure/fieldset_legend, env}|wrap{#GET{tag}})]
                ]
 
index 4dcea59..136323f 100644 (file)
@@ -10,6 +10,7 @@
   - disable : champ insaisissable ? 'oui' (defaut : '')\r
   - valeur_forcee : valeur utilisee meme si une valeur est dans l'environnement\r
   - autofocus : indique si le champ prend le focus a l'affichage (HTML5 requis)\r
+  - placeholder : texte du placeholder\r
   \r
   Exemple d'appel :\r
        [(#SAISIE{input,couleur_foncee,\r
@@ -45,4 +46,4 @@
 ]</BOUCLE_selection>\r
 </datalist>\r
 </B_selection>\r
-<input type="#GET{type}" name="#ENV{nom}" class="#GET{type}[ (#ENV{class})]" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"[ list="(#GET{list_id})"][ value="(#ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}})"][ size="(#ENV{size})"][ maxlength="(#ENV{maxlength})"][ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ placeholder="(#ENV{placeholder})"][(#HTML5|oui)[(#ENV{obligatoire}|et{#ENV{obligatoire}!={non}}|oui) required="required"][ min="(#ENV{min})"][ max="(#ENV{max})"][ step="(#ENV{step})"][(#ENV{autofocus}|et{#ENV{autofocus}!={non}}|oui) autofocus="autofocus"]][(#GET{val_autocomplete}|find{#ENV{autocomplete}}|oui) autocomplete="#ENV{autocomplete}"][ aria-describedby="(#ENV{describedby})"][ (#ENV*{attributs})] />\r
+<input type="#GET{type}" name="#ENV{nom}" class="#GET{type}[ (#ENV{class})]" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"[ list="(#GET{list_id})"][ value="(#ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}})"][ size="(#ENV{size})"][ maxlength="(#ENV{maxlength})"][ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ placeholder="(#ENV{placeholder})"][(#HTML5|oui)[(#ENV{obligatoire}|et{#ENV{obligatoire}|!={non}}|oui) required="required"][ min="(#ENV{min})"][ max="(#ENV{max})"][ step="(#ENV{step})"][(#ENV{autofocus}|et{#ENV{autofocus}|!={non}}|oui) autofocus="autofocus"]][(#GET{val_autocomplete}|find{#ENV{autocomplete}}|oui) autocomplete="#ENV{autocomplete}"][ aria-describedby="(#ENV{describedby})"][ (#ENV*{attributs})] />\r
index 9889094..0eac98f 100644 (file)
                explication=<:plugin:explication_afficher_liste:>})]
 ]
 #SET{valeur,#ENV{valeur_forcee,#ENV{valeur}}|is_null|?{#ENV{defaut},#ENV{valeur_forcee,#ENV{valeur}}}}
-<div class="choix">
+<div class="choix[ (#ENV{class})]">
        <input type="radio" name="#ENV{nom}" class="radio" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_oui"[ (#GET{valeur}|=={#ENV{valeur_oui,on}}|oui)checked="checked"] value="#ENV{valeur_oui,on}" [ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ aria-describedby="(#ENV{describedby})"] />
        <label for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_oui"[(#GET{valeur}|=={#ENV{valeur_oui,on}}|oui)class="on"]><:item_oui:></label>
 </div>
-<div class="choix">
+<div class="choix[ (#ENV{class})]">
        <input type="radio" name="#ENV{nom}" class="radio" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_non"[ (#GET{valeur}|=={#ENV{valeur_non,''}}|ou{#GET{valeur}|non})checked="checked"] value="#ENV{valeur_non,''}" [ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ aria-describedby="(#ENV{describedby})"] />
        <label for="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]_non"[(#GET{valeur}|=={#ENV{valeur_non,''}}|ou{#GET{valeur}|non})class="on"]><:item_non:></label>
 </div>
index dc4a183..bbf8dcd 100644 (file)
@@ -13,7 +13,7 @@
   - afficher_art_dans_langue_interface : si oui, on n'affiche que les articles de la langue de l'interface\r
   - limite_branche : branche dans laquelle on limite le selecteur\r
   - defaut : valeur par defaut si pas présente dans l'environnement\r
-  - valeur_forcee : valeur utilisee meme si une valeur est dans l'environnement\r
+  - valeur_forcee : valeur utilisee meme si une valeur est dans l'environnement. Doit être de type #ARRAY{'article|3','article|9',etc}\r
         \r
   Exemple d'appel :\r
        [(#SAISIE{selecteur_article,id_article,\r
index 029e908..b2c94ca 100644 (file)
@@ -65,6 +65,12 @@ options:
           nom: 'readonly'\r
           label: '<:saisies:option_readonly_label:>'\r
           explication: '<:saisies:option_readonly_explication:>'\r
+      -\r
+        saisie: 'input'\r
+        options:\r
+          nom: 'limite_branche'\r
+          label: '<:saisies:option_limite_branche_label:>'\r
+          explication: '<:saisies:option_limite_branche_explication:>'\r
   -\r
     saisie: 'fieldset'\r
     options:\r
index dfb1733..7c0ec57 100644 (file)
@@ -38,7 +38,7 @@
 [(#REM) Attention, la valeur ou la valeur forcée peut être une chaine vide. On doit donc tester avec is_null. ]
 #SET{valeur,#ENV{valeur_forcee}|is_null|?{#ENV{valeur}|is_null|?{#ENV{defaut},#ENV{valeur}},#ENV{valeur_forcee}}}
 
-<select [(#HTML5|oui)[(#ENV{obligatoire}|et{#ENV{obligatoire}!={non}}|oui) required="required"]] name="#ENV{nom}" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"[ class="(#ENV{class})"][ disabled="(#ENV{disable})"][ size="(#ENV{size})"][ (#ENV*{attributs})]>
+<select [(#HTML5|oui)[(#ENV{obligatoire}|et{#ENV{obligatoire}|!={non}}|oui) required="required"]] name="#ENV{nom}" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]"[ class="(#ENV{class})"][ disabled="(#ENV{disable})"][ size="(#ENV{size})"][ (#ENV*{attributs})]>
 [(#ENV{cacher_option_intro}|non)<option value="">[(#ENV{option_intro})]</option>]
 <BOUCLE_selection(POUR){tableau #GET{datas}}>
        <B_cond>
index c0f07b2..6fc3f70 100644 (file)
@@ -18,5 +18,5 @@
 [(#REM) Si la valeur est un tableau, le plugin sait le transformer en chaine, plutôt que d'afficher "Array" ]
 #SET{valeur, #ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}}}
 #SET{valeur, #GET{valeur}|is_array|?{(#GET{valeur}|saisies_tableau2chaine), #GET{valeur}}}
-<textarea name="#ENV{nom}" class="[(#ENV{class}) ][inserer_barre_(#ENV{inserer_barre}) ][(#ENV{previsualisation}|oui)inserer_previsualisation]" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]" rows="[(#ENV{rows,20})]" cols="[(#ENV{cols,40})]"[ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ placeholder="(#ENV{placeholder})"][(#ENV{obligatoire}|et{#ENV{obligatoire}!={non}}|et{#HTML5}|oui) required="required"][ aria-describedby="(#ENV{describedby})"][ (#ENV*{attributs})]>
+<textarea name="#ENV{nom}" class="[(#ENV{class}) ][inserer_barre_(#ENV{inserer_barre}) ][(#ENV{previsualisation}|oui)inserer_previsualisation]" id="champ_[(#ENV{id,#ENV{nom}}|saisie_nom2classe)]" rows="[(#ENV{rows,20})]" cols="[(#ENV{cols,40})]"[ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"][ placeholder="(#ENV{placeholder})"][(#ENV{obligatoire}|et{#ENV{obligatoire}|!={non}}|et{#HTML5}|oui) required="required"][ aria-describedby="(#ENV{describedby})"][ (#ENV*{attributs})]>
 #GET{valeur}</textarea>
index 31da91b..e010e4e 100644 (file)
@@ -6,7 +6,9 @@
  * @package SPIP\Saisies\Fonctions
 **/
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/saisies');
 include_spip('balise/saisie');
@@ -22,22 +24,26 @@ include_spip('formulaires/selecteur/generique_fonctions');
  * @return string
  *   $tag initial ou div
  */
-function saisie_balise_structure_formulaire($tag){
-       static $is_div=null;
-       if (is_null($is_div)){
-               $version = explode(".",$GLOBALS['spip_version_branche']);
-               if ($version[0]>3 OR ($version[0]==3 AND $version[1]>0))
+function saisie_balise_structure_formulaire($tag) {
+
+       static $is_div = null;
+       if (is_null($is_div)) {
+               $version = explode('.', $GLOBALS['spip_version_branche']);
+               if ($version[0] > 3 or ($version[0] == 3 and $version[1] > 0)) {
                        $is_div = true;
+               }
+       }
+       if ($is_div) {
+               return 'div';
        }
-       if ($is_div) return "div";
        return $tag;
 }
 // variante plus simple a ecrire dans les squelettes
 // [(#DIV|sinon{ul})]
 if (!function_exists('balise_DIV_dist')
-  and $version = explode(".",$GLOBALS['spip_version_branche'])
-  and ($version[0]>3 OR ($version[0]==3 AND $version[1]>0))){
-       function balise_DIV_dist($p){
+       and $version = explode('.', $GLOBALS['spip_version_branche'])
+       and ($version[0]>3 or ($version[0]==3 and $version[1] > 0))) {
+       function balise_DIV_dist($p) {
                $p->code = "'div'";
                $p->interdire_scripts = false;
                return $p;
@@ -53,11 +59,13 @@ if (!function_exists('balise_DIV_dist')
  * @param string|array $env
  * @return string
  */
-function saisie_traitement_vue($valeur,$env){
-       if (is_string($env))
+function saisie_traitement_vue($valeur, $env) {
+       if (is_string($env)) {
                $env = unserialize($env);
-       if (!function_exists('propre'))
+       }
+       if (!function_exists('propre')) {
                include_spip('inc/texte');
+       }
 
        $valeur = trim($valeur);
 
@@ -67,9 +75,8 @@ function saisie_traitement_vue($valeur,$env){
        if ($valeur and !isset($env['traitements'])) {
                if (in_array($env['type_saisie'], array('textarea'))) {
                        $valeur = propre($valeur);
-               }
-               else {
-                       $valeur = "<p>" . typo($valeur) . "</p>";
+               } else {
+                       $valeur = '<p>' . typo($valeur) . '</p>';
                }
        }
 
@@ -78,7 +85,7 @@ function saisie_traitement_vue($valeur,$env){
 
 /**
  * Passer un nom en une valeur compatible avec une classe css
- * 
+ *
  * - toto => toto,
  * - toto/truc => toto_truc,
  * - toto[truc] => toto_truc
@@ -92,7 +99,7 @@ function saisie_nom2classe($nom) {
 
 /**
  * Passer un nom en une valeur compatible avec un `name` de formulaire
- * 
+ *
  * - toto => toto,
  * - toto/truc => toto[truc],
  * - toto[truc] => toto[truc]
@@ -117,24 +124,25 @@ function saisie_nom2name($nom) {
  *     ```
  *     #GLOBALS{debut_intertitre}
  *     ```
- * 
+ *
  * @param Champ $p
  *     Pile au niveau de la balise
  * @return Champ
  *     Pile complétée du code php de la balise.
 **/
 function balise_GLOBALS_dist($p) {
-       if (function_exists('balise_ENV'))
+       if (function_exists('balise_ENV')) {
                return balise_ENV($p, '$GLOBALS');
-       else
+       } else {
                return balise_ENV_dist($p, '$GLOBALS');
+       }
 }
 
 /**
  * Liste les éléments du sélecteur générique triés
  *
  * Les éléments sont triés par objets puis par identifiants
- * 
+ *
  * @example
  *     L'entrée :
  *     'rubrique|3,rubrique|5,article|2'
@@ -172,7 +180,7 @@ function picker_selected_par_objet($selected) {
 
        // on remet tout en file
        $liste = array();
-       foreach ($res as $objet=>$ids) {
+       foreach ($res as $objet => $ids) {
                foreach ($ids as $id) {
                        $liste[] = array('objet' => $objet, 'id_objet' => $id);
                }
@@ -191,19 +199,18 @@ function picker_selected_par_objet($selected) {
  *               'url_edit' : l'url d'édition de l'objet ;
  *               'texte_objets' : le nom humain de l'objet éditorial.
  */
-function lister_tables_objets_edit()
-{
-    include_spip('base/abstract_sql');
+function lister_tables_objets_edit() {
+       include_spip('base/abstract_sql');
 
-    $objets = lister_tables_objets_sql();
-    $objets_edit = array();
+       $objets = lister_tables_objets_sql();
+       $objets_edit = array();
 
-    foreach ($objets as $objet => $definition) {
-        if (isset($definition['editable']) and isset($definition['url_edit']) and $definition['url_edit'] != '') {
-            $objets_edit[$objet] = array('type' => $definition['type'], 'url_edit' => $definition['url_edit'], 'texte_objets' => $definition['texte_objets']);
-        }
-    }
-    $objets_edit = array_filter($objets_edit);
+       foreach ($objets as $objet => $definition) {
+               if (isset($definition['editable']) and isset($definition['url_edit']) and $definition['url_edit'] != '') {
+                       $objets_edit[$objet] = array('type' => $definition['type'], 'url_edit' => $definition['url_edit'], 'texte_objets' => $definition['texte_objets']);
+               }
+       }
+       $objets_edit = array_filter($objets_edit);
 
-    return $objets_edit;
+       return $objets_edit;
 }
index a64d7dc..c35bebe 100644 (file)
@@ -7,10 +7,11 @@
 **/
 
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-if (!function_exists('_T_ou_typo')){
+if (!function_exists('_T_ou_typo')) {
        /**
         * une fonction qui regarde si $texte est une chaine de langue
         * de la forme <:qqch:>
@@ -24,26 +25,26 @@ if (!function_exists('_T_ou_typo')){
         * @return mixed
         *     Retourne la valeur éventuellement modifiée.
         */
-       function _T_ou_typo($valeur, $mode_typo='toujours') {
+       function _T_ou_typo($valeur, $mode_typo = 'toujours') {
                // Si la valeur est bien une chaine (et pas non plus un entier déguisé)
-               if (is_string($valeur) and !intval($valeur)){
+               if (is_string($valeur) and !intval($valeur)) {
                        // Si la chaine est du type <:truc:> on passe à _T()
-                       if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) 
+                       if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) {
                                $valeur = _T($match[1]);
-                       // Sinon on la passe a typo()
-                       else {
-                               if (!in_array($mode_typo, array('toujours', 'multi', 'jamais')))
+                       } else {
+                               // Sinon on la passe a typo()
+                               if (!in_array($mode_typo, array('toujours', 'multi', 'jamais'))) {
                                        $mode_typo = 'toujours';
-                       
-                               if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '<multi>') !== false)){
+                               }
+
+                               if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '<multi>') !== false)) {
                                        include_spip('inc/texte');
                                        $valeur = typo($valeur);
                                }
                        }
-               }
-               // Si c'est un tableau, on reapplique la fonction récursivement
-               elseif (is_array($valeur)){
-                       foreach ($valeur as $cle => $valeur2){
+               } elseif (is_array($valeur)) {
+                       // Si c'est un tableau, on reapplique la fonction récursivement
+                       foreach ($valeur as $cle => $valeur2) {
                                $valeur[$cle] = _T_ou_typo($valeur2, $mode_typo);
                        }
                }
@@ -51,4 +52,3 @@ if (!function_exists('_T_ou_typo')){
                return $valeur;
        }
 }
-
index ef94504..ff94b5e 100644 (file)
@@ -7,21 +7,24 @@
 **/
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Ajoute les scripts JS et CSS de saisies dans l'espace privé
  *
- * @param string $flux 
+ * @param string $flux
  * @return string
 **/
-function saisies_header_prive($flux){
+function saisies_header_prive($flux) {
        $js = find_in_path('javascript/saisies.js');
        $flux .= "\n<script type='text/javascript' src='$js'></script>\n";
        $css = generer_url_public('saisies.css');
        $flux .= "\n<link rel='stylesheet' href='$css' type='text/css' media='all' />\n";
        $css_constructeur = find_in_path('css/formulaires_constructeur.css');
        $flux .= "\n<link rel='stylesheet' href='$css_constructeur' type='text/css' />\n";
+       
        return $flux;
 }
 
@@ -30,39 +33,39 @@ function saisies_header_prive($flux){
  *
  * Ajoute également de quoi gérer le datepicker de la saisie date si
  * celle-ci est utilisée dans la page.
- * 
- * @param string $flux 
+ *
+ * @param string $flux
  * @return string
 **/
-function saisies_affichage_final($flux){
+function saisies_affichage_final($flux) {
        if (
                $GLOBALS['html'] // si c'est bien du HTML
-               and ($p = strpos($flux,"<!--!inserer_saisie_editer-->")) !== false // et qu'on a au moins une saisie
-               and strpos($flux,'<head') !== false // et qu'on a la balise <head> quelque part
-       ){
+               and ($p = strpos($flux, '<!--!inserer_saisie_editer-->')) !== false // et qu'on a au moins une saisie
+               and strpos($flux, '<head') !== false // et qu'on a la balise <head> quelque part
+       ) {
                // On insère la CSS devant le premier <link> trouvé
-               if (!$pi = strpos($flux, "<link") AND !$pi=strpos($flux, '</head')) {
+               if (!$pi = strpos($flux, '<link') and !$pi = strpos($flux, '</head')) {
                        $pi = $p; // si pas de <link inserer comme un goret entre 2 <li> de saisies
                }
                $css = generer_url_public('saisies.css');
                $ins_css = "\n<link rel='stylesheet' href='$css' type='text/css' media='all' />\n";
 
-               if (strpos($flux,"saisie_date")!==false){//si on a une saisie de type date, on va charger les css de jquery_ui
-                   include_spip("jqueryui_pipelines");
-                       if (function_exists("jqueryui_dependances")){
-                               $ui_plugins = jqueryui_dependances(array("jquery.ui.datepicker"));
-                               $theme_css = "jquery.ui.theme";
-                               $ui_css_dir = "css";
+               if (strpos($flux, 'saisie_date') !==false) {//si on a une saisie de type date, on va charger les css de jquery_ui
+                       include_spip('jqueryui_pipelines');
+                       if (function_exists('jqueryui_dependances')) {
+                               $ui_plugins = jqueryui_dependances(array('jquery.ui.datepicker'));
+                               $theme_css = 'jquery.ui.theme';
+                               $ui_css_dir = 'css';
                                // compatibilité SPIP 3.1 et jQuery UI 1.11
-                               $version = explode(".",$GLOBALS['spip_version_branche']);
-                               if ($version[0]>3 OR ($version[0]==3 AND $version[1]>0)) {
-                                       $theme_css = "theme";
-                                       $ui_css_dir = "css/ui";
+                               $version = explode('.', $GLOBALS['spip_version_branche']);
+                               if ($version[0] > 3 or ($version[0] == 3 and $version[1] > 0)) {
+                                       $theme_css = 'theme';
+                                       $ui_css_dir = 'css/ui';
                                }
-                               array_push($ui_plugins,$theme_css);
-                               foreach ($ui_plugins as $ui_plug){
+                               array_push($ui_plugins, $theme_css);
+                               foreach ($ui_plugins as $ui_plug) {
                                        $ui_plug_css = find_in_path("$ui_css_dir/$ui_plug.css");
-                                       if (strpos($flux,"$ui_css_dir/$ui_plug.css")===false){// si pas déjà chargé
+                                       if (strpos($flux, "$ui_css_dir/$ui_plug.css") === false) {// si pas déjà chargé
                                                $ins_css .= "\n<link rel='stylesheet' href='$ui_plug_css' type='text/css' media='all' />\n";
                                        }
                                }
@@ -76,6 +79,7 @@ function saisies_affichage_final($flux){
                $ins_js = "\n<script type='text/javascript' src='$js'></script>\n";
                $flux = substr_replace($flux, $ins_js, $pos_head, 0);
        }
+       
        return $flux;
 }
 
@@ -86,13 +90,13 @@ function saisies_affichage_final($flux){
  * Recherche une fonction `formulaires_XX_saisies_dist` et l'utilise si elle
  * est présente. Cette fonction doit retourner une liste de saisies dont on se
  * sert alors pour calculer les champs utilisés dans le formulaire.
- * 
- * @param array $flux 
+ *
+ * @param array $flux
  * @return array
 **/
-function saisies_formulaire_charger($flux){
+function saisies_formulaire_charger($flux) {
        // Si le flux data est inexistant, on quitte : Le CVT d'origine a décidé de ne pas continuer
-       if (!is_array($flux['data'])){
+       if (!is_array($flux['data'])) {
                return $flux;
        }
 
@@ -118,15 +122,16 @@ function saisies_formulaire_charger($flux){
  * qu'il n'y a pas de squelette spécifique pour afficher le HTML du formulaire,
  * alors on utilise le formulaire générique intégré au plugin saisie, qui calculera le HTML
  * à partir de la déclaration des saisies indiquées.
- * 
+ *
  * @see saisies_formulaire_charger()
- * 
+ *
  * @param array $flux
  * @return array
 **/
-function saisies_styliser($flux){
-       // Si on cherche un squelette de formulaire
-       if (strncmp($flux['args']['fond'],'formulaires/',12)==0
+function saisies_styliser($flux) {
+       if (
+               // Si on cherche un squelette de formulaire
+               strncmp($flux['args']['fond'], 'formulaires/', 12) == 0
                // Et qu'il y a des saisies dans le contexte
                and isset($flux['args']['contexte']['_saisies'])
                // Et que le fichier choisi est vide ou n'existe pas
@@ -134,7 +139,7 @@ function saisies_styliser($flux){
                and $ext = $flux['args']['ext']
                and lire_fichier($flux['data'].'.'.$ext, $contenu_squelette)
                and !trim($contenu_squelette)
-       ){
+       ) {
                $flux['data'] = preg_replace("/\.$ext$/", '', find_in_path("formulaires/inc-saisies-cvt.$ext"));
        }
 
@@ -149,25 +154,24 @@ function saisies_styliser($flux){
  *
  * @see saisies_formulaire_charger()
  * @uses saisies_verifier()
- * 
+ *
  * @param array $flux
  *     Liste des erreurs du formulaire
  * @return array
  *     iste des erreurs
  */
-function saisies_formulaire_verifier($flux){
+function saisies_formulaire_verifier($flux) {
        // Il faut que la fonction existe et qu'elle retourne bien un tableau
        include_spip('inc/saisies');
        $saisies = saisies_chercher_formulaire($flux['args']['form'], $flux['args']['args']);
        if ($saisies) {
                // On ajoute au contexte les champs à déclarer
                $erreurs = saisies_verifier($saisies);
-               if ($erreurs and !isset($erreurs['message_erreur']))
+               if ($erreurs and !isset($erreurs['message_erreur'])) {
                        $erreurs['message_erreur'] = _T('saisies:erreur_generique');
+               }
                $flux['data'] = array_merge($erreurs, $flux['data']);
        }
 
        return $flux;
 }
-
-
index 8dcb131..c033a76 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/saisies/trunk
-Revision: 95750
-Dernier commit: 2016-03-04 03:21:42 +0100 
+Revision: 99298
+Dernier commit: 2016-08-31 06:04:06 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/saisies/trunk</origine>
-<revision>95750</revision>
-<commit>2016-03-04 03:21:42 +0100 </commit>
+<revision>99298</revision>
+<commit>2016-08-31 06:04:06 +0200 </commit>
 </svn_revision>
\ No newline at end of file
diff --git a/www/plugins/seo-dev/action/editer_seo.php b/www/plugins/seo-dev/action/editer_seo.php
new file mode 100644 (file)
index 0000000..3f4f2fc
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * @param $objet
+ * @param $id_objet
+ * @param string $prefixe
+ * @return string
+ */
+function action_editer_seo_dist($objet, $id_objet, $prefixe = '') {
+       include_spip('inc/autoriser');
+       $err = '';
+
+       // si id_article n'est pas un nombre, c'est une creation
+       // mais on verifie qu'on a toutes les donnees qu'il faut.
+       if ($objet
+               and $id_objet
+               and autoriser('modifier', $objet, $id_objet)) {
+               $meta_tags = array('title', 'description', 'author', 'keywords', 'copyright', 'robots');
+
+               $existing = array();
+               $rows = sql_allfetsel('*', 'spip_seo', 'id_objet=' . intval($id_objet) . ' AND objet=' . sql_quote($objet));
+               foreach ($rows as $row) {
+                       $existing[$row['meta_name']] = $row['meta_content'];
+               }
+
+               $dels = array();
+               $inss = array();
+               foreach ($meta_tags as $tag) {
+                       $value = _request($prefixe.$tag);
+                       if (is_null($value) or !strlen($value)) {
+                               if (isset($existing[$tag])) {
+                                       $dels[] = $tag;
+                               }
+                       } else {
+                               if (!isset($existing[$tag])) {
+                                       $inss[] = array('objet'=>$objet,'id_objet'=>$id_objet,'meta_name'=>$tag,'meta_content'=>$value);
+                               } elseif ($value!==$existing[$tag]) {
+                                       sql_updateq('spip_seo', array('meta_content' => $value), 'id_objet=' . intval($id_objet) . ' AND objet=' . sql_quote($objet).' AND meta_name='.sql_quote($tag));
+                               }
+                       }
+                       if (($value = _request($tag)) && (strlen($value)>0)) {
+                               sql_insertq('spip_seo', array('id_objet' => $id_objet, 'objet' => $objet, 'meta_name' => $tag, 'meta_content' => $value));
+                       }
+               }
+               if (count($dels)) {
+                       sql_delete('spip_seo', 'id_objet=' . intval($id_objet) . ' AND objet=' . sql_quote($objet). ' AND '.sql_in('meta_name', $dels));
+               }
+               if (count($inss)) {
+                       sql_insertq_multi('spip_seo', $inss);
+               }
+
+               return '';
+       }
+
+       return 'Erreur : acces interdit';
+}
diff --git a/www/plugins/seo-dev/base/seo_tables.php b/www/plugins/seo-dev/base/seo_tables.php
new file mode 100644 (file)
index 0000000..3aa0237
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * BouncingOrange SPIP SEO plugin
+ *
+ * @category   SEO
+ * @package    SPIP_SEO
+ * @author     Pierre ROUSSET (p.rousset@gmail.com)
+ * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
+ * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function seo_declarer_tables_interfaces($interface) {
+       $interface['table_des_tables']['seo'] = 'seo';
+
+       return $interface;
+}
+
+function seo_declarer_tables_principales($tables_principales) {
+       //-- Table SEO -----------------------------------------------------
+       $seo = array(
+               'id_objet' => 'int(11) NOT NULL',
+               'objet' => 'varchar(10) NOT NULL',
+               'meta_name' => 'varchar(20) NOT NULL',
+               'meta_content' => 'text NOT NULL'
+       );
+
+       $seo_cles = array(
+               'PRIMARY KEY' => 'id_objet, objet, meta_name'
+       );
+
+       $tables_principales['spip_seo'] = array(
+               'field' => &$seo,
+               'key' => &$seo_cles
+       );
+
+       return $tables_principales;
+}
diff --git a/www/plugins/seo-dev/formulaires/configurer_seo.html b/www/plugins/seo-dev/formulaires/configurer_seo.html
new file mode 100644 (file)
index 0000000..20b1e0b
--- /dev/null
@@ -0,0 +1,383 @@
+<div class="formulaire_spip formulaire_config formulaire_#FORM">
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+
+       <form method="post" action="#ENV{action}">
+               <div>
+                       #ACTION_FORMULAIRE{#ENV{action}}
+                       <!-- Insertion auto -->
+                       <ul>
+                               #SET{name,insert_head/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]<p class="explication"><:seo:insert_head_descriptif:><br /><:seo:forcer_squelette_descriptif:></p>
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:insert_head_activate:></label>
+                                               </div>
+                               </li>
+                               [(#REM)
+                               #SET{name,forcer_squelette}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]<p class="explication"><:seo:forcer_squelette_descriptif:></p>
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="#GET{name}" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="#GET{name}" class="checkbox" id="#GET{name}_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="#GET{name}_#GET{val}"><:seo:forcer_squelette_label:></label>
+                                               </div>
+                               </li>
+                               ]
+                       </ul>
+
+                       <!-- Meta tags -->
+                       <fieldset class="meta_tags">
+                               <legend>[(#CHEMIN{img_pack/meta_tags-24.png}|balise_img)] <:seo:meta_tags:></legend>
+                               <ul>
+                                       <!-- descriptions and others -->
+                                       #SET{name,meta_tags/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                       ]
+                                                       #SET{val_non,no}
+                                                       #SET{val,yes}
+                                                       <div class="choix">[
+                                                               (#REM) Valeur envoyee si case non cochee]
+                                                               <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                               <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                               <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:meta_tags_activate:></label>
+                                                       </div>
+                                       </li>
+                                       <li class="fieldset suite">
+                                               <fieldset>
+                                                       <legend><:seo:meta_tags_editing:></legend>
+                                                       <ul>
+                                                               #SET{name,meta_tags/activate_editing}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                                               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                               ]
+                                                                               #SET{val_non,no}
+                                                                               #SET{val,yes}
+                                                                               <div class="choix">[
+                                                                                       (#REM) Valeur envoyee si case non cochee]
+                                                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:meta_tags_edit_activate:></label>
+                                                                               </div>
+                                                               </li>
+                                                               <li class="suite">
+                                                                       #SET{name,meta_tags/editable_tables}
+                                                                       <INCLURE{fond=formulaires/inc-choisir-objets,name=#GET{name}|cfgname_to_inputname{},id=#GET{name}|cfgname_to_id{},selected=#ENV{#GET{name},#LISTE{spip_articles,spip_rubriques}}} />
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                               <fieldset>
+                                                       <legend><:seo:meta_tags_sommaire:></legend>
+                                                       <ul>
+                                                               #SET{name,meta_tags/tag/title}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_title:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                               #SET{name,meta_tags/tag/description}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_description:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<textarea name="[(#GET{name}|cfgname_to_inputname)]" class="textarea" id="[(#GET{name}|cfgname_to_id)]">#ENV*{#GET{name},#GET{defaut}}</textarea>
+                                                               </li>
+                                                               #SET{name,meta_tags/tag/keywords}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_keywords:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                               #SET{name,meta_tags/tag/copyright}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_copyright:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                               #SET{name,meta_tags/tag/author}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_author:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                               #SET{name,meta_tags/tag/robots}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_robots:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'INDEX, FOLLOW'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'INDEX, NOFOLLOW'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'NOINDEX, FOLLOW'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'NOINDEX, NOFOLLOW'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'INDEX, FOLLOW, NOARCHIVE'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'INDEX, NOFOLLOW, NOARCHIVE'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'NOINDEX, NOFOLLOW, NOARCHIVE'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                       </select>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                               <fieldset>
+                                                       <legend><:seo:meta_tags_default:></legend>
+                                                       <ul>
+                                                               #SET{name,meta_tags/default/title}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_title:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'page'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_page_title_value:></option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                               #SET{val,'page_sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_page_title_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                               #SET{name,meta_tags/default/description}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_description:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'page'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_page_description_value:></option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                               #SET{val,'page_sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_page_description_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                               #SET{name,meta_tags/default/keywords}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_keywords:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                               #SET{name,meta_tags/default/copyright}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_copyright:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                               #SET{name,meta_tags/default/author}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_author:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                               #SET{name,meta_tags/default/robots}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:meta_robots:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<select name="[(#GET{name}|cfgname_to_inputname)]" class="select" id="[(#GET{name}|cfgname_to_id)]">
+                                                                               #SET{val,''}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                                                               #SET{val,'sommaire'}
+                                                                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:seo:meta_sommaire_value:></option>
+                                                                       </select>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                       </li>
+
+                                       <!-- Urls Canoniques -->
+                                       #SET{name,canonical_url/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:canonical_url_activate:></label>
+                                               </div>
+                                       </li>
+
+                                       <!-- Google Webmaster Tools -->
+                                       #SET{name,webmaster_tools/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:google_webmaster_tools_activate:></label>
+                                               </div>
+                                       </li>
+                                       <li     class="fieldset suite">
+                                               <fieldset>
+                                                       <ul>
+                                                               #SET{name,webmaster_tools/id}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:google_webmaster_tools_id:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                       </li>
+
+                                       <!-- Bing Webmaster Tools -->
+                                       #SET{name,bing/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:bing_webmaster_activate:></label>
+                                               </div>
+                                       </li>
+                                       <li     class="fieldset suite">
+                                               <fieldset>
+                                                       <ul>
+                                                               #SET{name,bing/id}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:bing_webmaster_id:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                       </li>
+
+                                       <!-- Alexa -->
+                                       #SET{name,alexa/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:alexa_activate:></label>
+                                               </div>
+                                       </li>
+                                       <li     class="fieldset suite">
+                                               <fieldset>
+                                                       <ul>
+                                                               #SET{name,alexa/id}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:alexa_id:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                       </li>
+                               </ul>
+                       </fieldset>
+                       <!-- Google Analytics -->
+                       <fieldset class="meta_google_analytics">
+                               <legend>[(#CHEMIN{img_pack/google_analytics-24.png}|balise_img)] <:seo:google_analytics:></legend>
+                               <ul>
+                                       #SET{name,analytics/activate}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                               <span class='erreur_message'>(#GET{erreurs})</span>
+                                               ]
+                                               #SET{val_non,no}
+                                               #SET{val,yes}
+                                               <div class="choix">[
+                                                       (#REM) Valeur envoyee si case non cochee]
+                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:google_analytics_activate:></label>
+                                               </div>
+                                       </li>
+                                       <li     class="fieldset suite">
+                                               <fieldset>
+                                                       <ul>
+                                                               #SET{name,analytics/id}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs/#GET{name}}}
+                                                               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                                                                       <label for="[(#GET{name}|cfgname_to_id)]"><:seo:google_analytics_id:></label>[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ]<input type="text" name="[(#GET{name}|cfgname_to_inputname)]" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="[(#GET{name}|cfgname_to_id)]" [(#HTML5|et{#GET{obli}})required='required']/>
+                                                               </li>
+                                                               #SET{name,analytics/universal}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                                                               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
+                                                                       <span class='erreur_message'>(#GET{erreurs})</span>
+                                                                       ][(#SET{val_non,no})] [(#SET{val,yes})]
+                                                                       <div class="choix">[
+                                                                                       (#REM) Valeur envoyee si case non cochee]
+                                                                                       <input type="hidden" name="[(#GET{name}|cfgname_to_inputname)]" value="#GET{val_non}" />
+                                                                                       <input type="checkbox" name="[(#GET{name}|cfgname_to_inputname)]" class="checkbox" id="[(#GET{name}|cfgname_to_id)]_#GET{val}" value="#GET{val}"[(#GET{val}|=={#ENV{#GET{name},#GET{defaut}}}|oui)checked="checked"] />
+                                                                                       <label for="[(#GET{name}|cfgname_to_id)]_#GET{val}"><:seo:google_analytics_universal:></label>
+                                                                       </div>
+                                                               </li>
+                                                       </ul>
+                                               </fieldset>
+                                       </li>
+                               </ul>
+                       </fieldset>
+                       <p class="boutons">
+                               <input type="submit" value="<:bouton_valider:>" class="submit" />
+                       </p>
+               </div>
+       </form>
+</div>
+<style type="text/css">
+       .muted {opacity: 0.6;}
+       .suite {margin-left: 40px;}
+</style>
+<script type="text/javascript">
+jQuery(function(){
+       jQuery('.suite').each(function(){
+               var me = jQuery(this);
+               var input = me.prev('.editer').find('input.checkbox');
+               if (jQuery.prop) { /* spip 3 */
+                       if (!input.prop('checked')) jQuery(this).hide();
+                       input.change(function(){if (jQuery(this).prop('checked')) me.show('fast'); else me.hide('fast');});
+               } else {
+                       if (!input.attr('checked')) jQuery(this).hide();
+                       input.change(function(){if (jQuery(this).attr('checked')) me.show('fast'); else me.hide('fast');});
+               }
+       })
+});
+</script>
diff --git a/www/plugins/seo-dev/formulaires/configurer_seo.php b/www/plugins/seo-dev/formulaires/configurer_seo.php
new file mode 100644 (file)
index 0000000..c5acd44
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function cfgname_to_inputname($key) {
+       if (strpos($key, '/') === false) {
+               return $key;
+       }
+       $key = explode('/', $key);
+       $main = array_shift($key);
+       $key = '['.implode('][', $key).']';
+       return $main.$key;
+}
+
+function cfgname_to_id($key) {
+       return preg_replace(',\W,', '_', $key);
+}
diff --git a/www/plugins/seo-dev/formulaires/editer_seo.html b/www/plugins/seo-dev/formulaires/editer_seo.html
new file mode 100644 (file)
index 0000000..14610bf
--- /dev/null
@@ -0,0 +1,74 @@
+<div class="formulaire_spip formulaire_editer formulaire_editer_seo formulaire_editer_seo-#ENV{objet}-#ENV{id_objet}">
+       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
+       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
+       [(#ENV{editable})
+       <form method='post' action='#ENV{action}'><div>
+               [(#REM) declarer les hidden qui declencheront le service du formulaire 
+               parametre : url d'action ]
+               #ACTION_FORMULAIRE{#ENV{action}}
+         <ul>
+                 #SET{name,title}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:seo:meta_title:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<p class='explication'><:seo:explication_title:></p>
+                               <input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                       </li>
+                 #SET{name,description}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:seo:meta_description:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<textarea name="#GET{name}" class="textarea">
+#ENV*{#GET{name},#GET{defaut}}</textarea>
+                       </li>
+                 #SET{name,keywords}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:seo:meta_keywords:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                       </li>
+                 #SET{name,copyright}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:seo:meta_copyright:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                       </li>
+                 #SET{name,author}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="#GET{name}"><:seo:meta_author:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+                       </li>
+                       #SET{name,robots}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+                       <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                               <label for="[(#GET{name})]"><:seo:meta_robots:></label>[
+                               <span class='erreur_message'>(#GET{erreurs})</span>
+                               ]<select name="[(#GET{name})]" class="select" id="[(#GET{name})]">
+                                       #SET{val,''}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'INDEX, FOLLOW'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'INDEX, NOFOLLOW'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'NOINDEX, FOLLOW'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'NOINDEX, NOFOLLOW'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'INDEX, FOLLOW, NOARCHIVE'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'INDEX, NOFOLLOW, NOARCHIVE'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                                       #SET{val,'NOINDEX, NOFOLLOW, NOARCHIVE'}
+                                       <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               </select>
+                       </li>
+         </ul>
+
+         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
+         <!--extra-->
+         <p class='boutons'>
+               <input type='submit' class='submit' value='<:bouton_enregistrer:>' />
+         </p>
+       </div></form>
+       ]
+</div>
diff --git a/www/plugins/seo-dev/formulaires/editer_seo.php b/www/plugins/seo-dev/formulaires/editer_seo.php
new file mode 100644 (file)
index 0000000..71fef06
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/actions');
+include_spip('inc/editer');
+
+function formulaires_editer_seo_charger($objet, $id_objet, $retour = '') {
+       $valeurs = array();
+       $valeurs['objet'] = $objet;
+       $valeurs['id_objet'] = $id_objet;
+       $metas = sql_select('*', 'spip_seo', 'id_objet ='.intval($id_objet).' AND objet ='.sql_quote($objet));
+       while ($meta = sql_fetch($metas)) {
+               $valeurs[$meta['meta_name']] = $meta['meta_content'];
+       }
+       $valeurs['editable'] = true;
+       return $valeurs;
+}
+
+/**
+ * Identifier le formulaire en faisant abstraction des parametres qui
+ * ne representent pas l'objet edite
+ */
+function formulaires_editer_seo_identifier_dist($objet, $id_objet, $retour = '') {
+       return serialize(array(intval($id_objet),$objet));
+}
+
+function formulaires_editer_seo_verifier($objet, $id_objet, $retour = '') {
+       $erreurs = array();
+       return $erreurs;
+}
+
+function formulaires_editer_seo_traiter($objet, $id_objet, $retour = '') {
+       $editer_seo = charger_fonction('editer_seo', 'action');
+
+       $err = $editer_seo($objet, $id_objet);
+
+       if (!$err) {
+               return array('message_ok'=>_L('Meta tags mis a jour'));
+       } else {
+               return array('message_erreur'=>_L('Vous n\'avez pas le droit de modifier ces meta-tags : '.$err));
+       }
+}
diff --git a/www/plugins/seo-dev/formulaires/inc-editer-seo.html b/www/plugins/seo-dev/formulaires/inc-editer-seo.html
new file mode 100644 (file)
index 0000000..002f3ec
--- /dev/null
@@ -0,0 +1,78 @@
+<fieldset class="meta-tags">
+       <legend class="poignee">[(#CHEMIN{img_pack/meta_tags-24.png}|balise_img)] <:seo:meta_tags:></legend>
+       <span class='poignee porte_fermee'>> Configurer les meta-tags</span><span class='poignee porte_ouverte'>> Replier les meta-tags</span>
+       <input type="hidden" name="seo_metas" value="1" />
+       <ul class='porte'>
+                #SET{name,meta_title}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="#GET{name}"><:seo:meta_title:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<p class='explication'><:seo:explication_title:></p>
+                       <input type="text" name="#GET{name}" class="text countchars" data-maxchar="70" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+               </li>
+                #SET{name,meta_description}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="#GET{name}"><:seo:meta_description:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<p class='explication'><:seo:explication_description:></p>
+                       <textarea name="#GET{name}" class="textarea countchars" data-maxchar="160">
+#ENV*{#GET{name},#GET{defaut}}</textarea>
+               </li>
+                #SET{name,meta_keywords}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="#GET{name}"><:seo:meta_keywords:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+               </li>
+                #SET{name,meta_copyright}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="#GET{name}"><:seo:meta_copyright:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+               </li>
+                #SET{name,meta_author}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="#GET{name}"><:seo:meta_author:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
+               </li>
+               #SET{name,meta_robots}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
+               <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
+                       <label for="[(#GET{name})]"><:seo:meta_robots:></label>[
+                       <span class='erreur_message'>(#GET{erreurs})</span>
+                       ]<select name="[(#GET{name})]" class="select" id="[(#GET{name})]">
+                               #SET{val,''}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'INDEX, FOLLOW'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'INDEX, NOFOLLOW'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'NOINDEX, FOLLOW'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'NOINDEX, NOFOLLOW'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'INDEX, FOLLOW, NOARCHIVE'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'INDEX, NOFOLLOW, NOARCHIVE'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                               #SET{val,'NOINDEX, NOFOLLOW, NOARCHIVE'}
+                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]>[(#GET{val})]</option>
+                       </select>
+               </li>
+       </ul>
+       <script type='text/javascript'>/*<![CDATA[*/
+       if (window.jQuery){jQuery(function(){
+               jQuery.getScript('[(#PRODUIRE{fond=javascript/seo.js,lang=#ENV{lang}}|compacte)]',function(){seo_init();});
+       });}/*]]>*/</script>
+</fieldset>
+
+<script>
+       $(function(){
+               jQuery('.porte').hide();
+               jQuery('.poignee').on('click', function(e) { jQuery('.porte').slideToggle(); jQuery(".poignee").toggleClass("porte_ouverte"); e.preventDefault(); });
+       });
+</script>
+<style type="text/css">
+       .poignee{cursor: pointer;margin-bottom: 10px}
+       .porte_ouverte{display: none;}
+</style>
diff --git a/www/plugins/seo-dev/img_pack/alexa-24.png b/www/plugins/seo-dev/img_pack/alexa-24.png
new file mode 100644 (file)
index 0000000..c270b69
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/alexa-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/bing-24.png b/www/plugins/seo-dev/img_pack/bing-24.png
new file mode 100644 (file)
index 0000000..54e1ae9
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/bing-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/canonical_url-24.png b/www/plugins/seo-dev/img_pack/canonical_url-24.png
new file mode 100644 (file)
index 0000000..43f34b4
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/canonical_url-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/google_analytics-24.png b/www/plugins/seo-dev/img_pack/google_analytics-24.png
new file mode 100644 (file)
index 0000000..a334a47
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/google_analytics-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/google_webmaster-24.png b/www/plugins/seo-dev/img_pack/google_webmaster-24.png
new file mode 100644 (file)
index 0000000..e27175d
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/google_webmaster-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/meta_tags-24.png b/www/plugins/seo-dev/img_pack/meta_tags-24.png
new file mode 100644 (file)
index 0000000..1ab847a
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/meta_tags-24.png differ
diff --git a/www/plugins/seo-dev/img_pack/seo-24.png b/www/plugins/seo-dev/img_pack/seo-24.png
new file mode 100644 (file)
index 0000000..c9f08ad
Binary files /dev/null and b/www/plugins/seo-dev/img_pack/seo-24.png differ
diff --git a/www/plugins/seo-dev/inclure/seo-head.html b/www/plugins/seo-dev/inclure/seo-head.html
new file mode 100644 (file)
index 0000000..f9c67ce
--- /dev/null
@@ -0,0 +1,2 @@
+[(#ENV**{head}|seo_insere_remplace_metas{#ENV*{contexte}}|replace{'\s+<(meta|script|link|style)','
+<$1'})]
\ No newline at end of file
diff --git a/www/plugins/seo-dev/javascript/jquery.simplycountable.js b/www/plugins/seo-dev/javascript/jquery.simplycountable.js
new file mode 100644 (file)
index 0000000..db3f947
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+* jQuery Simply Countable plugin
+* Provides a character counter for any text input or textarea
+*
+* @version 0.4.2
+* @homepage http://github.com/aaronrussell/jquery-simply-countable/
+* @author Aaron Russell (http://www.aaronrussell.co.uk)
+*
+* Copyright (c) 2009-2010 Aaron Russell (aaron@gc4.co.uk)
+* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+*/
+
+(function($){
+
+  $.fn.simplyCountable = function(options){
+    
+    options = $.extend({
+      counter: '#counter',
+      countType: 'characters',
+      wordSeparator: ' ',
+      maxCount: 140,
+      strictMax: false,
+      countDirection: 'down',
+      safeClass: 'safe',
+      overClass: 'over',
+      thousandSeparator: ',',
+      onOverCount: function(){},
+      onSafeCount: function(){},
+      onMaxCount: function(){}
+    }, options);
+    
+    var countable = this;
+    var counter = $(options.counter);
+    if (!counter.length) { return false; }
+    regex = new RegExp('['+options.wordSeparator+']+');
+    
+    var countCheck = function(){
+           
+      var count;
+      var revCount;
+      
+      var reverseCount = function(ct){
+        return ct - (ct*2) + options.maxCount;
+      }
+      
+      var countInt = function(){
+        return (options.countDirection === 'up') ? revCount : count;
+      }
+      
+      var numberFormat = function(ct){
+        var prefix = '';
+        if (options.thousandSeparator){
+          ct = ct.toString();
+          // Handle large negative numbers
+          if (ct.match(/^-/)) {
+            ct = ct.substr(1);
+            prefix = '-';
+          }
+          for (var i = ct.length-3; i > 0; i -= 3){
+            ct = ct.substr(0,i) + options.thousandSeparator + ct.substr(i);
+          }
+        }
+        return prefix + ct;
+      }
+      
+      /* Calculates count for either words or characters */
+      if (options.countType === 'words'){
+        count = options.maxCount - $.trim(countable.val()).split(regex).length;
+        if (countable.val() === ''){ count += 1; }
+      }
+      else { count = options.maxCount - countable.val().length; }
+      revCount = reverseCount(count);
+      
+      /* If strictMax set restrict further characters */
+      if (options.strictMax && count <= 0){
+        var content = countable.val();
+        if (count < 0 || content.match(new RegExp('['+options.wordSeparator+']$'))) {
+          options.onMaxCount(countInt(), countable, counter);
+        }
+        if (options.countType === 'words'){
+          countable.val(content.split(regex).slice(0, options.maxCount).join(options.wordSeparator));
+        }
+        else { countable.val(content.substring(0, options.maxCount)); }
+        count = 0, revCount = options.maxCount;
+      }
+      
+      counter.text(numberFormat(countInt()));
+      
+      /* Set CSS class rules and API callbacks */
+      if (!counter.hasClass(options.safeClass) && !counter.hasClass(options.overClass)){
+        if (count < 0){ counter.addClass(options.overClass); }
+        else { counter.addClass(options.safeClass); }
+      }
+      else if (count < 0 && counter.hasClass(options.safeClass)){
+        counter.removeClass(options.safeClass).addClass(options.overClass);
+        options.onOverCount(countInt(), countable, counter);
+      }
+      else if (count >= 0 && counter.hasClass(options.overClass)){
+        counter.removeClass(options.overClass).addClass(options.safeClass);
+        options.onSafeCount(countInt(), countable, counter);
+      }
+      
+    };
+    
+    countCheck();
+    countable.keyup(countCheck);
+    countable.bind('paste', function(){
+      // Wait a few miliseconds for the pasting
+      setTimeout(countCheck, 5);
+    });
+    
+  };
+
+})(jQuery);
\ No newline at end of file
diff --git a/www/plugins/seo-dev/javascript/seo.js.html b/www/plugins/seo-dev/javascript/seo.js.html
new file mode 100644 (file)
index 0000000..32382c3
--- /dev/null
@@ -0,0 +1,27 @@
+#HTTP_HEADER{Content-type:text/javascript}
+if (!jQuery.fn.simplyCountable){
+#INCLURE{javascript/jquery.simplycountable.js}
+}
+
+var seo_init = function(){
+       jQuery('.countchars').each(function(){
+               var count =  $(this).attr('data-maxchar');
+               if(count){
+                       var name = $(this).attr('name')+'_counter';
+                       $(this).after('<p class="counter"><:seo:info_count_max:><span class="'+name+'"></span></p>')
+                       $(this).simplyCountable({
+                               counter:                        '.'+name,
+                           maxCount:           count,
+                           strictMax:          false,
+                           safeClass:          'safecount',
+                           overClass:          'overcount',
+                           onOverCount:        function(count, countable, counter){
+                               $('.'+name).parents('.counter').addClass('erreur_message');
+                           },
+                           onSafeCount:        function(count, countable, counter){
+                               $('.'+name).parents('.counter').removeClass('erreur_message');
+                           },
+                       });
+               }
+       });
+};
\ No newline at end of file
diff --git a/www/plugins/seo-dev/lang/paquet-seo.xml b/www/plugins/seo-dev/lang/paquet-seo.xml
new file mode 100644 (file)
index 0000000..5b46100
--- /dev/null
@@ -0,0 +1,22 @@
+<traduction module="paquet-seo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/seo/trunk/lang/" reference="fr">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-seo?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-seo?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-seo?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-seo?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="pt_br" url="http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=pt_br" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=ru" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-seo?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/seo-dev/lang/paquet-seo_en.php b/www/plugins/seo-dev/lang/paquet-seo_en.php
new file mode 100644 (file)
index 0000000..4b3a692
--- /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-seo?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO is a plugin who add the possibility to insert in the head of your website: meta tags, canoical URL, Google webmaster tools Meta Code and Google Analytics javascript code. It is fully configurable in the SPIP configuration page and in each article or rubrique page for meta tags.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_es.php b/www/plugins/seo-dev/lang/paquet-seo_es.php
new file mode 100644 (file)
index 0000000..fddd2f1
--- /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-seo?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO es un plugin que añade la posibilidad de insertar en la parte superior de su sitio web: meta tags, URL canónica, Google webmaster tools Meta Code y Google Analytics javascript. Puede configurarse desde la página de configuración de SPIP así como desde cada sección y artículo para las les meta tags.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_fr.php b/www/plugins/seo-dev/lang/paquet-seo_fr.php
new file mode 100644 (file)
index 0000000..f767ff8
--- /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_/seo/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO est un plugin qui ajoute la possibilité d’insérer dans la partie head de votre site web : meta tags, URL canonique, Google webmaster tools Meta Code et Google Analytics javascript. Il est configurable dans la page de configuration de SPIP ainsi que dans chaque rubrique et article pour les meta tags.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_nl.php b/www/plugins/seo-dev/lang/paquet-seo_nl.php
new file mode 100644 (file)
index 0000000..3eb36dd
--- /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-seo?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO is een plugin die de head van je site kan aanpassen met: meta tags, canonieke URL, Google webmaster tools Meta Code en Google Analytics javascript. Je kunt hem configureren met een configuratie-bladzijde in SPIP. Meta tags kun je ook in iedere rubriek en ieder artikel instellen.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Optimalisatie voor zoekmachines'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_pt_br.php b/www/plugins/seo-dev/lang/paquet-seo_pt_br.php
new file mode 100644 (file)
index 0000000..949d8ac
--- /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-seo?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO é um plugin que inclui a possibilidade de se inserir, na área <head> do seu website, meta tags, URL canônica, Google webmaster tools Meta Code e Google Analytics javascript. É parametrizável na página de configuração do SPIP, bem como em todas as seções e matérias, pelas meta tags.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_ru.php b/www/plugins/seo-dev/lang/paquet-seo_ru.php
new file mode 100644 (file)
index 0000000..cf77c3f
--- /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-seo?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'Этот плагин предоставляет возможность вставлять в шапку вашего сайта мета теги, канонический вид URL, Google webmaster tools, Meta Code, и Google Analytics javascript code. Каждой статье и каждому разделу вы можете придавать уникальные мета теги.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Поисковая оптимизация (SEO)'
+);
diff --git a/www/plugins/seo-dev/lang/paquet-seo_sk.php b/www/plugins/seo-dev/lang/paquet-seo_sk.php
new file mode 100644 (file)
index 0000000..1e8a37d
--- /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-seo?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'seo_description' => 'SEO je zásuvný modul, ktorý ponúka možnosť vložiť do hlavičky stránky meta tagy, kanonickú podobu internetových adries, meta kód nástrojov pre webmasterov od spoločnosti Google a javaskript z Google Analytics. Meta tagy sa dajú nastaviť na stránke s nastaveniami SPIPu, ako aj v každej rubrike a v každom článku.',
+       'seo_nom' => 'SEO',
+       'seo_slogan' => 'Optimalizácia pre vyhľadávače'
+);
diff --git a/www/plugins/seo-dev/lang/seo.xml b/www/plugins/seo-dev/lang/seo.xml
new file mode 100644 (file)
index 0000000..35cdf2d
--- /dev/null
@@ -0,0 +1,26 @@
+<traduction module="seo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/seo/trunk/lang/" reference="fr">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/seo?lang_cible=en" total="41" traduits="41" 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="kent1" lien="http://trad.spip.net/auteur/kent1" />
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/seo?lang_cible=es" total="41" traduits="39" relire="0" modifs="2" nouveaux="0" pourcent="95.12">
+               <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/seo?lang_cible=fr" total="41" traduits="41" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/seo?lang_cible=nl" total="41" traduits="41" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+               <traducteur nom="mpossoz" lien="http://trad.spip.net/auteur/mpossoz" />
+       </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/seo?lang_cible=pt_br" total="41" traduits="41" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/seo?lang_cible=ru" total="41" traduits="39" relire="0" modifs="2" nouveaux="0" pourcent="95.12">
+               <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/seo?lang_cible=sk" total="41" traduits="39" relire="0" modifs="2" nouveaux="0" pourcent="95.12">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/seo-dev/lang/seo_en.php b/www/plugins/seo-dev/lang/seo_en.php
new file mode 100644 (file)
index 0000000..2e22799
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Activate Alexa',
+       'alexa_id' => 'Website Alexa’s ID',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Enable Bing Webmaster Tools',
+       'bing_webmaster_id' => 'Meta Code verification',
+
+       // C
+       'canonical_url' => 'Canonical URL',
+       'canonical_url_activate' => 'Activate Canonical URL meta',
+
+       // E
+       'explication_description' => 'It is recommended that the length is less than or equal to 160 characters.',
+       'explication_title' => 'It is recommended that the length is between 5 and 70 characters.',
+
+       // F
+       'forcer_squelette_descriptif' => 'SEO metas are prioritary to the metas generated by the skeleton',
+       'forcer_squelette_label' => 'Load metas for all skeletons',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Activate Google Analytics',
+       'google_analytics_id' => 'Google Analytics web property ID',
+       'google_webmaster_tools' => 'Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Activate Google Webmaster Tools',
+       'google_webmaster_tools_id' => 'Meta Code verification',
+
+       // I
+       'info_count_max' => 'Characters to achieve the optimum limit:',
+       'insert_head' => 'Automatic insertion in #INSERT_HEAD',
+       'insert_head_activate' => 'Activate automatic insertion',
+       'insert_head_descriptif' => 'Automatic insertion of SEO configuration in the <head>',
+
+       // M
+       'meta_author' => 'Author:',
+       'meta_copyright' => 'Copyright:',
+       'meta_description' => 'Description:',
+       'meta_keywords' => 'Keywords:',
+       'meta_page_description_sommaire_value' => 'Page Description Value + Home Page Meta Value',
+       'meta_page_description_value' => 'Page Description Value',
+       'meta_page_title_sommaire_value' => 'Page Title Value + Home Page Meta Value',
+       'meta_page_title_value' => 'Page Title Value',
+       'meta_robots' => 'Robots:',
+       'meta_sommaire_value' => 'Home Page Meta Value',
+       'meta_tags' => 'Meta Tags',
+       'meta_tags_activate' => 'Activate editorial meta tags',
+       'meta_tags_default' => 'Defaults values for meta tags (for articles and sections)',
+       'meta_tags_edit_activate' => 'Activate meta tags editing in sections and articles',
+       'meta_tags_editing' => 'Meta tags editing',
+       'meta_tags_sommaire' => 'Summary meta tags value (home page)',
+       'meta_title' => 'Title:',
+
+       // S
+       'seo' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/seo_es.php b/www/plugins/seo-dev/lang/seo_es.php
new file mode 100644 (file)
index 0000000..a08ae42
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Activar Alexa',
+       'alexa_id' => 'Identificador del sitio para Alexa',
+
+       // B
+       'bing_webmaster' => 'Herramientas para administradores web de Bing (Bing Webmaster Tools)',
+       'bing_webmaster_activate' => 'Activar Herramientas para administradores web de Bing (Bing Webmaster Tools)',
+       'bing_webmaster_id' => 'Metacódigo de verificación',
+
+       // C
+       'canonical_url' => 'URL Canónicas',
+       'canonical_url_activate' => 'Activar la meta de URL Canónicas',
+
+       // E
+       'explication_description' => 'Es aconsejable que la longitud sea inferior o igual a 160 caracteres.',
+       'explication_title' => 'Es aconsejable que la longitud oscile entre 5 y 70 caracteres.',
+
+       // F
+       'forcer_squelette_descriptif' => 'Las metas SEO son prioritarias para las metas generadas por los esqueletos',
+       'forcer_squelette_label' => 'Cargar las metas para todos los esqueletos',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Activar Google Analytics',
+       'google_analytics_id' => 'Google Analytics web property ID',
+       'google_webmaster_tools' => 'Herramientas de administradores web de Google (Google Webmaster Tools)',
+       'google_webmaster_tools_activate' => 'Activar Herramientas de administradores de Google (Google Webmaster Tools)',
+       'google_webmaster_tools_id' => 'Metacódigo de verificación',
+
+       // I
+       'info_count_max' => 'Caracteres para alcanzar el límite óptimo:',
+       'insert_head' => 'Inserción automática en #INSERT_HEAD',
+       'insert_head_activate' => 'Activar la inserción automática',
+       'insert_head_descriptif' => 'Inserción automática de la configuración SEO en el &lt;head&gt;',
+
+       // M
+       'meta_author' => 'Autor:',
+       'meta_copyright' => 'Copyright:',
+       'meta_description' => 'Descripción:',
+       'meta_keywords' => 'Palabras clave:',
+       'meta_page_description_sommaire_value' => 'Valor de la Descripción de la Página + Valor Meta del Sumario',
+       'meta_page_description_value' => 'Valor de la Descripción de la Página',
+       'meta_page_title_sommaire_value' => 'Valor del Título de la Página + Valor Meta del Sumario',
+       'meta_page_title_value' => 'Valor del Título de la Página',
+       'meta_robots' => 'Robots:',
+       'meta_sommaire_value' => 'Valor de la Meta del Sumario',
+       'meta_tags' => 'Meta Tags',
+       'meta_tags_activate' => 'Activar las Meta Tags editoriales',
+       'meta_tags_default' => 'Valor de las Meta Tags por defecto (para Artículos y Secciones)', # MODIF
+       'meta_tags_edit_activate' => 'Activar la edición de las meta tags en las secciones y artículos', # MODIF
+       'meta_tags_editing' => 'Edición de las Meta Tags',
+       'meta_tags_sommaire' => 'Valor de las Meta Tags del sumario (página de inicio)',
+       'meta_title' => 'Título:',
+
+       // S
+       'seo' => 'Search Engine Optimisation (Optimización de motor de búsqueda)'
+);
diff --git a/www/plugins/seo-dev/lang/seo_fr.php b/www/plugins/seo-dev/lang/seo_fr.php
new file mode 100644 (file)
index 0000000..673218a
--- /dev/null
@@ -0,0 +1,70 @@
+<?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_/seo/trunk/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Activer Alexa',
+       'alexa_id' => 'Identifiant du site pour Alexa',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Activer Bing Webmaster Tools',
+       'bing_webmaster_id' => 'Meta code de vérification',
+
+       // C
+       'canonical_url' => 'URL Canoniques',
+       'canonical_url_activate' => 'Activer la meta d’URL Canoniques',
+
+       // E
+       'explication_description' => 'Il est conseillé que la longueur soit inférieure ou égale à 160 caractères.',
+       'explication_title' => 'Il est conseillé que la longueur soit comprise entre 5 et 70 caractères.',
+
+       // F
+       'forcer_squelette_descriptif' => 'Les metas SEO sont prioritaires aux metas générées par les squelettes',
+       'forcer_squelette_label' => 'Charger les metas pour tous squelettes',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Activer Google Analytics',
+       'google_analytics_id' => 'Google Analytics web property ID',
+       'google_webmaster_tools' => 'Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Activer Google Webmaster Tools',
+       'google_webmaster_tools_id' => 'Meta code de vérification',
+
+       // I
+       'info_count_max' => 'Caractères pour atteindre la limite optimale : ',
+       'insert_head' => 'Insertion automatique dans #INSERT_HEAD',
+       'insert_head_activate' => 'Activer l’insertion automatique',
+       'insert_head_descriptif' => 'Insertion automatique de la configuration SEO dans le &lt;head&gt;',
+
+       // M
+       'meta_author' => 'Auteur :',
+       'meta_copyright' => 'Copyright :',
+       'meta_description' => 'Description :',
+       'meta_keywords' => 'Mots Clefs :',
+       'meta_page_description_sommaire_value' => 'Valeur de la Description de la Page + Valeur Meta du Sommaine',
+       'meta_page_description_value' => 'Valeur de la Description de la Page',
+       'meta_page_title_sommaire_value' => 'Valeur du Titre de la Page + Valeur Meta du Sommaire',
+       'meta_page_title_value' => 'Valeur du Titre de la Page',
+       'meta_robots' => 'Robots :',
+       'meta_sommaire_value' => 'Valeur de la Meta du Sommaire',
+       'meta_tags' => 'Meta Tags',
+       'meta_tags_activate' => 'Activer les balises metas éditoriales',
+       'meta_tags_default' => 'Valeur des balises metas par défaut (pour les objets éditoriaux)',
+       'meta_tags_edit_activate' => 'Activer l’édition des meta tags dans les objets éditoriaux',
+       'meta_tags_editing' => 'Édition des balises metas',
+       'meta_tags_sommaire' => 'Valeur des balises metas du sommaire (page d’accueil)',
+       'meta_title' => 'Titre :',
+
+       // S
+       'seo' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/seo_nl.php b/www/plugins/seo-dev/lang/seo_nl.php
new file mode 100644 (file)
index 0000000..88a0036
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Alexa activeren',
+       'alexa_id' => 'Identificatie van de site voor Alexa',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Bing Webmaster Tools activeren',
+       'bing_webmaster_id' => 'Meta code voor de verificatie',
+
+       // C
+       'canonical_url' => 'URL Canonicals',
+       'canonical_url_activate' => 'De meta voor URL Canonicals activeren',
+
+       // E
+       'explication_description' => 'Het is beter de lengte te beperken tot maximaal 160 tekens.',
+       'explication_title' => 'Het is beter een lengte van 5 tot 70 tekens aan te houden.',
+
+       // F
+       'forcer_squelette_descriptif' => 'De meta van SEO hebben voorrang boven die van de skeletten',
+       'forcer_squelette_label' => 'Laad de metas voor alle skeletten',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Google Analytics activeren',
+       'google_analytics_id' => 'Google Analytics web property ID',
+       'google_webmaster_tools' => 'Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Google Webmaster Tools activeren',
+       'google_webmaster_tools_id' => 'Meta code voor de verificatie',
+
+       // I
+       'info_count_max' => 'Caractères pour atteindre la limite optimale: ',
+       'insert_head' => 'Automatisch invoegen in #INSERT_HEAD',
+       'insert_head_activate' => 'Activeer het automatisch invoegen',
+       'insert_head_descriptif' => 'Automatisch invoegen van de SEO configuratie in de &lt;head&gt;',
+
+       // M
+       'meta_author' => 'Auteur:',
+       'meta_copyright' => 'Copyright:',
+       'meta_description' => 'Omschrijving:',
+       'meta_keywords' => 'Trefwoorden:',
+       'meta_page_description_sommaire_value' => 'Waarde van de Omschrijving van de Pagina + Waarde van de Meta van de Beginpagina',
+       'meta_page_description_value' => 'Waarde van de Omschrijving van de Pagina',
+       'meta_page_title_sommaire_value' => 'Waarde van de Titel van de Pagina + Waarde van de Meta van de Beginpagina',
+       'meta_page_title_value' => 'Waarde van de Titel van de Pagina',
+       'meta_robots' => 'Robots:',
+       'meta_sommaire_value' => 'Waarde van de Meta van de Beginpagina',
+       'meta_tags' => 'Meta Tags',
+       'meta_tags_activate' => 'Activeer de editoriële Meta tags',
+       'meta_tags_default' => 'Standaardwaarde van de meta tags (voor editorials objecten)',
+       'meta_tags_edit_activate' => 'Activeer de aanpassing van meta tags in editorials objecten',
+       'meta_tags_editing' => 'Aanpassing van meta tags',
+       'meta_tags_sommaire' => 'Waarde van de meta tags van de beginpagina (sommaire)',
+       'meta_title' => 'Titel:',
+
+       // S
+       'seo' => 'Optimalisatie voor zoekmachines'
+);
diff --git a/www/plugins/seo-dev/lang/seo_pt_br.php b/www/plugins/seo-dev/lang/seo_pt_br.php
new file mode 100644 (file)
index 0000000..87caefc
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Ativar o Alexa',
+       'alexa_id' => 'Identificador do site para o Alexa',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Ativar as Bing Webmaster Tools',
+       'bing_webmaster_id' => 'Meta código de verificação',
+
+       // C
+       'canonical_url' => 'URLs Canônico',
+       'canonical_url_activate' => 'Ativar a meta do URL Canônico',
+
+       // E
+       'explication_description' => 'É recomendável que o tamanho seja inferior ou igual a 160 caracteres.',
+       'explication_title' => 'É recomendável que o tamanho seja entre 5 e 70 caracteres.',
+
+       // F
+       'forcer_squelette_descriptif' => 'As metas SEO são prioritárias em relação às metas gerais dos templates',
+       'forcer_squelette_label' => 'Carregar as metas para todos os templates',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Ativar o Google Analytics',
+       'google_analytics_id' => 'Google Analytics web property ID',
+       'google_webmaster_tools' => 'Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Ativar o Google Webmaster Tools',
+       'google_webmaster_tools_id' => 'Meta código de verificação',
+
+       // I
+       'info_count_max' => 'Caracteres para atingir ao limite ideal: ',
+       'insert_head' => 'Inserção automática em #INSERT_HEAD',
+       'insert_head_activate' => 'Ativar a inserção automática',
+       'insert_head_descriptif' => 'Inserção automática da configuração SEO no &lt;head&gt;',
+
+       // M
+       'meta_author' => 'Autor:',
+       'meta_copyright' => 'Copyright:',
+       'meta_description' => 'Descrição:',
+       'meta_keywords' => 'Palavras-chaves:',
+       'meta_page_description_sommaire_value' => 'Valor da descrição da Página + Valor Meta do Resumo',
+       'meta_page_description_value' => 'Valor da Descrição da Página',
+       'meta_page_title_sommaire_value' => 'Valor do Título da Página + Valor Meta da Página Inicial',
+       'meta_page_title_value' => 'Valor do Título da Página',
+       'meta_robots' => 'Robôs:',
+       'meta_sommaire_value' => 'Valor Meta da Página Inicial',
+       'meta_tags' => 'Meta Tags',
+       'meta_tags_activate' => 'Ativar as meta tags editoriais',
+       'meta_tags_default' => 'Valor das meta tags padrão (para os objetos editoriais)',
+       'meta_tags_edit_activate' => 'Ativar a edição das meta tags nos objetos editoriais',
+       'meta_tags_editing' => 'Edição das meta tags',
+       'meta_tags_sommaire' => 'Valor das meta tags da página inicial (home)',
+       'meta_title' => 'Título:',
+
+       // S
+       'seo' => 'Search Engine Optimisation'
+);
diff --git a/www/plugins/seo-dev/lang/seo_ru.php b/www/plugins/seo-dev/lang/seo_ru.php
new file mode 100644 (file)
index 0000000..1e8cf28
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Включить Alexa',
+       'alexa_id' => 'Сайт идентификатор для Alexa',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Включить Bing Webmaster Tools',
+       'bing_webmaster_id' => 'Проверочный мета код',
+
+       // C
+       'canonical_url' => 'Канонические URL',
+       'canonical_url_activate' => 'Включить канонические URL',
+
+       // E
+       'explication_description' => 'Длинна ссылки не должна превышать 160 символов.',
+       'explication_title' => 'Рекомендуемая  длинна от 5 до 70 символов.',
+
+       // F
+       'forcer_squelette_descriptif' => 'Мета теги, заданные в плагине, имеют больший приоритет, чем теги, указанные в шаблонах.',
+       'forcer_squelette_label' => 'Подключать мета теги во все шаблоны',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Добавить Google Analytics',
+       'google_analytics_id' => 'Google Analytics ID',
+       'google_webmaster_tools' => 'Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Включить Google Webmaster Tools',
+       'google_webmaster_tools_id' => 'Проверка Meta code ',
+
+       // I
+       'info_count_max' => 'Минимальное количество символов: ',
+       'insert_head' => 'Подключать автоматически в #INSERT_HEAD',
+       'insert_head_activate' => 'Включить',
+       'insert_head_descriptif' => 'Автоматическая вставка мета-тегов в &lt;header&gt;',
+
+       // M
+       'meta_author' => 'Автор :',
+       'meta_copyright' => 'Copyright:',
+       'meta_description' => 'Описание:',
+       'meta_keywords' => 'Ключевые слова :',
+       'meta_page_description_sommaire_value' => 'Значение Description страницы + значение Meta главной',
+       'meta_page_description_value' => 'Значение Description страницы',
+       'meta_page_title_sommaire_value' => 'Title страницы + значение Meta главной',
+       'meta_page_title_value' => 'Title страницы',
+       'meta_robots' => 'Роботы :',
+       'meta_sommaire_value' => 'Значение Meta главной страницы',
+       'meta_tags' => 'Mета Теги',
+       'meta_tags_activate' => 'Включить',
+       'meta_tags_default' => 'Сгенерировать Mета Теги по умолчанию (для статей и разделов)', # MODIF
+       'meta_tags_edit_activate' => 'Включить возможность редактирования мета тегов для разделов и статей', # MODIF
+       'meta_tags_editing' => 'Редактирование мета-тегов',
+       'meta_tags_sommaire' => 'Мета теги главной страницы',
+       'meta_title' => 'Title :',
+
+       // S
+       'seo' => 'Поисковая оптимизация'
+);
diff --git a/www/plugins/seo-dev/lang/seo_sk.php b/www/plugins/seo-dev/lang/seo_sk.php
new file mode 100644 (file)
index 0000000..3f73740
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'S.E.O' => 'SEO',
+
+       // A
+       'alexa' => 'Alexa',
+       'alexa_activate' => 'Aktivovať Alexu',
+       'alexa_id' => 'Identifikátor stránky na Alexu',
+
+       // B
+       'bing_webmaster' => 'Bing Webmaster Tools',
+       'bing_webmaster_activate' => 'Aktivovať Bing Webmaster Tools',
+       'bing_webmaster_id' => 'Meta kód na overenie',
+
+       // C
+       'canonical_url' => 'Kanonická podoba adries',
+       'canonical_url_activate' => 'Aktivovať kanonické adresy URL',
+
+       // E
+       'explication_description' => 'Odporúča sa, aby mal 160 znakov alebo menej.',
+       'explication_title' => 'Odporúča sa, aby mal od 5 do 70 znakov.',
+
+       // F
+       'forcer_squelette_descriptif' => 'Hlavičky meta zo SEO majú prednosť pred tými, ktoré vygenerujú šablóny',
+       'forcer_squelette_label' => 'Nahrať hlavičky meta pre všetky šablóny',
+
+       // G
+       'google_analytics' => 'Google Analytics',
+       'google_analytics_activate' => 'Aktivovať Google Analytics',
+       'google_analytics_id' => 'ID webového objektu Google Analytics ',
+       'google_webmaster_tools' => 'Nástroje Google Webmaster Tools',
+       'google_webmaster_tools_activate' => 'Aktivovať Google Webmaster Tools',
+       'google_webmaster_tools_id' => 'Kontrolný kód',
+
+       // I
+       'info_count_max' => 'Počet znakov na dosiahnutie optimálneho limitu:',
+       'insert_head' => 'Automatické vkladanie do #INSERT_HEAD',
+       'insert_head_activate' => 'Aktivovať automatické vkladanie',
+       'insert_head_descriptif' => 'Automatické vkladanie nastavenia SEO do &lt;hlavičky&gt;',
+
+       // M
+       'meta_author' => 'Autor(ka):',
+       'meta_copyright' => 'Autorské práva:',
+       'meta_description' => 'Opis:',
+       'meta_keywords' => 'Kľúčové slová:',
+       'meta_page_description_sommaire_value' => 'Hodnota opisu stránky + hodnota tagu Zhrnutie',
+       'meta_page_description_value' => 'Hodnota opisu stránky',
+       'meta_page_title_sommaire_value' => 'Hodnota nadpisu stránky + hodnota tagu Zhrnutie',
+       'meta_page_title_value' => 'Hodnota nadpisu stránky',
+       'meta_robots' => 'Roboty:',
+       'meta_sommaire_value' => 'Hodnota tagu Zhrnutie',
+       'meta_tags' => 'Meta tagy',
+       'meta_tags_activate' => 'Aktivovať redakčné meta tagy',
+       'meta_tags_default' => 'Predvolená hodnota meta tagov (pre články a rubriky)', # MODIF
+       'meta_tags_edit_activate' => 'Aktivovať úpravu meta tagov v rubrikách a článkoch', # MODIF
+       'meta_tags_editing' => 'Úprava meta tagov',
+       'meta_tags_sommaire' => 'Hodnota meta tagov zhrnutia (úvodná stránka)',
+       'meta_title' => 'Nadpis:',
+
+       // S
+       'seo' => 'Optimalizácia pre vyhľadávače'
+);
diff --git a/www/plugins/seo-dev/paquet.xml b/www/plugins/seo-dev/paquet.xml
new file mode 100644 (file)
index 0000000..b52f84f
--- /dev/null
@@ -0,0 +1,37 @@
+<paquet
+       prefix="seo"
+       categorie="statistique"
+       version="2.1.5"
+       etat="test"
+       compatibilite="[3.0.0;3.1.*]"
+       logo="seo.png"
+       schema="1.1.1"
+       documentation="http://contrib.spip.net/?rubrique1248"
+>      
+
+       <nom>SEO</nom>
+       <!-- Search Engine Optimisation -->
+
+       <auteur mail="p.rousset@gmail.com">Pierre ROUSSET</auteur>
+
+       <copyright>2009-2014</copyright>
+
+       <licence lien="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2</licence>
+
+       <pipeline nom="declarer_tables_principales" inclure="base/seo_tables.php" />
+       <pipeline nom="declarer_tables_interfaces" inclure="base/seo_tables.php" />
+
+       <pipeline nom="recuperer_fond" action="recuperer_fond" inclure="seo_pipelines.php" />
+       <pipeline nom="affichage_final" action="affichage_final" inclure="seo_pipelines.php" />
+       <pipeline nom="autoriser" inclure="seo_pipelines.php" />
+
+       <pipeline nom="affiche_milieu" action="affiche_milieu" inclure="seo_pipelines_ecrire.php" />
+       <pipeline nom="afficher_contenu_objet" action="afficher_contenu_objet" inclure="seo_pipelines_ecrire.php" />
+       <pipeline nom="formulaire_fond" action="formulaire_fond" inclure="seo_pipelines_ecrire.php" />
+       <pipeline nom="formulaire_charger" action="formulaire_charger" inclure="seo_pipelines_ecrire.php" />
+       <pipeline nom="formulaire_traiter" action="formulaire_traiter" inclure="seo_pipelines_ecrire.php" />
+
+       <pipeline nom="post_seo" action="" />
+
+       <menu nom="seo" titre="seo:seo" parent="menu_squelette" icone="images/seo-16.png" action="configurer_seo" />
+</paquet>
diff --git a/www/plugins/seo-dev/prive/objets/seo-metas.html b/www/plugins/seo-dev/prive/objets/seo-metas.html
new file mode 100644 (file)
index 0000000..68d98ad
--- /dev/null
@@ -0,0 +1,10 @@
+<B_metas>
+[(#BOITE_OUVRIR{[(#CHEMIN{img_pack/meta_tags-24.png}|balise_img{'',cadre-icone})]Metas-tags,simple seo-metas})]
+<BOUCLE_metas(SEO){objet}{id_objet}{meta_name IN title,description,keywords,copyright,author,robots}>
+<div class="champ contenu_meta_#META_NAME[ (#META_CONTENT|strlen|?{'',vide})]">
+<div class='label'>[(#VAL{seo:meta_}|concat{#META_NAME}|_T)]</div>
+<div class='valeur #META_NAME'>#META_CONTENT</div>
+</div>
+</BOUCLE_metas>
+#BOITE_FERMER
+</B_metas>
\ No newline at end of file
diff --git a/www/plugins/seo-dev/prive/squelettes/contenu/configurer_seo.html b/www/plugins/seo-dev/prive/squelettes/contenu/configurer_seo.html
new file mode 100644 (file)
index 0000000..7a1b741
--- /dev/null
@@ -0,0 +1,10 @@
+[(#REM)
+
+       Inclusion dans la page de configuration
+
+]
+[(#AUTORISER{configurer,_seo}|sinon_interdire_acces)]
+<h1 class="grostitre"><:seo:seo:></h1>
+[<div class="ajax">
+       (#FORMULAIRE_CONFIGURER_SEO)
+</div>]
\ No newline at end of file
diff --git a/www/plugins/seo-dev/prive/squelettes/inclure/seo_metas.html b/www/plugins/seo-dev/prive/squelettes/inclure/seo_metas.html
new file mode 100644 (file)
index 0000000..08278e3
--- /dev/null
@@ -0,0 +1,3 @@
+<div class="ajax">
+       #FORMULAIRE_EDITER_SEO{#ENV{objet},#ENV{id_objet}}
+</div>
\ No newline at end of file
diff --git a/www/plugins/seo-dev/prive/style_prive_plugin_seo.html b/www/plugins/seo-dev/prive/style_prive_plugin_seo.html
new file mode 100644 (file)
index 0000000..2ce11f5
--- /dev/null
@@ -0,0 +1,28 @@
+[(#REM)
+
+       Ce squelette definit les styles de l'espace prive
+
+       Note: l'entete "Vary:" sert a repousser l'entete par
+       defaut "Vary: Cookie,Accept-Encoding", qui est (un peu)
+       genant en cas de "rotation du cookie de session" apres
+       un changement d'IP (effet de clignotement).
+
+       ATTENTION: il faut absolument le charset sinon Firefox croit que
+       c'est du text/html !
+]
+#CACHE{3600*100,cache-client}
+#HTTP_HEADER{Content-Type: text/css; charset=iso-8859-15}
+#HTTP_HEADER{Vary: Accept-Encoding}
+
+#SET{claire,##ENV{couleur_claire,edf3fe}}
+#SET{foncee,##ENV{couleur_foncee,3874b0}}
+
+[(#REM)
+       Dans SPIP 3.0 dans le privé, il y a une définition de l'id copyright avec un text-align à droite
+       On le rétabli à gauche pour les formulaires (ici on a un input)
+]
+.editer #copyright{
+       text-align:[(#ENV{left})];
+}
+#wysiwyg .box.seo-metas {margin:0;margin-top:25px;}
+#wysiwyg .seo-metas .label,#wysiwyg .seo-metas .valeur {display:inline;}
\ No newline at end of file
diff --git a/www/plugins/seo-dev/prive/themes/spip/images/seo-16.png b/www/plugins/seo-dev/prive/themes/spip/images/seo-16.png
new file mode 100644 (file)
index 0000000..1f6dde5
Binary files /dev/null and b/www/plugins/seo-dev/prive/themes/spip/images/seo-16.png differ
diff --git a/www/plugins/seo-dev/prive/themes/spip/images/seo-24.png b/www/plugins/seo-dev/prive/themes/spip/images/seo-24.png
new file mode 100644 (file)
index 0000000..c9f08ad
Binary files /dev/null and b/www/plugins/seo-dev/prive/themes/spip/images/seo-24.png differ
diff --git a/www/plugins/seo-dev/seo.png b/www/plugins/seo-dev/seo.png
new file mode 100644 (file)
index 0000000..c78641e
Binary files /dev/null and b/www/plugins/seo-dev/seo.png differ
diff --git a/www/plugins/seo-dev/seo_administrations.php b/www/plugins/seo-dev/seo_administrations.php
new file mode 100644 (file)
index 0000000..9851f98
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/meta');
+include_spip('base/abstract_sql');
+
+// Installation et mise à jour
+function seo_upgrade($nom_meta_version_base, $version_cible) {
+
+       $version_actuelle = '0.0';
+       if ((!isset($GLOBALS['meta'][$nom_meta_version_base]))
+               || (($version_actuelle = $GLOBALS['meta'][$nom_meta_version_base])!=$version_cible)
+       ) {
+               /* Installation normale */
+               if (version_compare($version_actuelle, '0.0', '=')) {
+                       // Création des tables
+                       include_spip('base/create');
+                       creer_base();
+
+                       /**
+                        * La config de base active insert_head
+                        * (les utilisateurs n'ont pas à modifier leurs squelettes et à penser à l'activer)
+                        */
+                       $config_base = array();
+                       $config_base['insert_head']['activate'] = 'yes';
+                       ecrire_meta('seo', serialize($config_base), 'non');
+
+                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
+               }
+               /* Gestion des anciennes tables, la numérotation base était de 1.0 */
+               if (version_compare($version_actuelle, '1.0', '<=')) {
+                       include_spip('base/create');
+
+                       // On change le nom de la table initialement mal choisi
+                       $prefixe = $GLOBALS['table_prefix'];
+                       sql_query("RENAME TABLE seo_meta_tags TO $prefixe" . '_seo');
+                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
+               }
+               if (version_compare($version_actuelle, '1.1.0', '<')) {
+                       sql_alter('TABLE spip_seo DROP PRIMARY KEY');
+                       sql_alter('TABLE spip_seo CHANGE type_object objet varchar(10) NOT NULL');
+                       sql_alter('TABLE spip_seo CHANGE id_object id_objet int(11) NOT NULL');
+                       sql_alter('TABLE spip_seo ADD PRIMARY KEY ( `id_objet` , `objet` , `meta_name` )');
+                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
+               }
+               if (version_compare($version_actuelle, '1.1.1', '<')) {
+                       if (defined('_SEO_FORCER_SQUELETTE')) {
+                               ecrire_config('seo/forcer_squelette', 'yes');
+                       }
+                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
+               }
+       }
+}
+
+// Désinstallation
+function seo_vider_tables($nom_meta_version_base) {
+
+       // On efface la table du plugin
+       sql_drop_table('spip_seo');
+
+       // On efface la méta de configuration
+       effacer_meta('seo');
+
+       // On efface la version entregistrée
+       effacer_meta($nom_meta_version_base);
+}
diff --git a/www/plugins/seo-dev/seo_fonctions.php b/www/plugins/seo-dev/seo_fonctions.php
new file mode 100644 (file)
index 0000000..e2f7c02
--- /dev/null
@@ -0,0 +1,461 @@
+<?php
+/**
+ * BouncingOrange SPIP SEO plugin
+ *
+ * @category   SEO
+ * @package    SPIP\SEO\Fonctions
+ * @author     Pierre ROUSSET (p.rousset@gmail.com)
+ * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
+ * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+include_spip('inc/texte');
+
+function seo_interprete_contexte($contexte) {
+       static $infos;
+       $s = serialize($contexte);
+       if (isset($infos[$s])) {
+               return $infos[$s];
+       }
+       $infos[$s] = array('objet' => 'sommaire');
+       if (isset($contexte['page'])) {
+               $infos[$s] = array('objet' => $contexte['page']);
+       }
+       if (isset($contexte['type-page'])) {
+               $infos[$s]['objet'] = $contexte['type-page'];
+               if ($infos[$s]['objet']!=='sommaire'
+                       and $primary = id_table_objet($infos[$s]['objet'])
+                       and isset($contexte[$primary])) {
+                       $infos[$s]['id_objet'] = $contexte[$primary];
+                       $infos[$s]['primary'] = $primary;
+                       $infos[$s]['table_sql'] = table_objet_sql($infos[$s]['objet']);
+               }
+               return $infos[$s];
+       }
+       // d'abord les rubriques
+       if (isset($contexte['id_rubrique'])) {
+               $infos[$s] = array(
+                       'objet'=>'rubrique',
+                       'id_objet'=>$contexte['id_rubrique'],
+                       'primary'=>'id_rubrique',
+                       'table_sql'=>'spip_rubriques'
+               );
+       }
+       // puis voyons si on trouve un objet plus precis
+       $tables = lister_tables_objets_sql();
+       foreach ($tables as $t => $d) {
+               if ($t!=='spip_rubriques'
+                       and isset($d['key']['PRIMARY KEY'])
+                       and ($infos[$s]['objet']!=='rubrique'
+                       or isset($d['field']['id_rubrique']))
+               ) {
+                       $primary = $d['key']['PRIMARY KEY'];
+                       if (isset($contexte[$primary])) {
+                               $infos[$s]['objet'] = $d['type'];
+                               $infos[$s]['id_objet'] = $contexte[$primary];
+                               $infos[$s]['primary'] = $primary;
+                               $infos[$s]['table_sql'] = $t;
+                               return $infos[$s];
+                       }
+               }
+       }
+       return $infos[$s];
+}
+
+/**
+ * Remplace les meta du head par celles calculees par le plugin
+ * utilise par le squelette inclure/seo-head
+ *
+ * @param string $head
+ * @param array $contexte
+ * @return string
+ */
+function seo_insere_remplace_metas($head, $contexte) {
+
+       $append = '<!--seo_insere-->';
+       // on ne fait rien si deja insere
+       if (strpos($head, $append) !== false) {
+               return $head;
+       }
+
+       include_spip('inc/config');
+       $config = lire_config('seo/');
+       $i = seo_interprete_contexte($contexte);
+       $is_sommaire = ($i['objet']=='sommaire');
+
+       if (isset($config['meta_tags']['activate']) and $config['meta_tags']['activate']=='yes') {
+               /* d'abord les meta tags */
+               $meta_tags = seo_generer_meta_tags(null, $contexte);
+
+               foreach ($meta_tags as $key => $meta) {
+                       $preg = '';
+                       if ($key=='title') {
+                               /**
+                                * Si le tag est <title>
+                                */
+                               $preg = "/(<{$key}[^>]*>.*<\/{$key}[^>]*>)/Uims";
+                       } else {
+                               /**
+                                * Le tag est une <meta>
+                                */
+                               $preg = "/(<meta\s+name=['\"]{$key}['\"][^>]*>)/Uims";
+                       }
+
+                       // remplacer la meta si on la trouve
+                       if ($preg and preg_match($preg, $head, $match)) {
+                               if (stristr($match[0], "data-strict") === FALSE)
+                                       $head = str_replace($match[0], $meta, $head);
+                       } else {
+                               $append .= "$meta\n";
+                       }
+               }
+       }
+       /* META GOOGLE WEBMASTER TOOLS */
+       if (isset($config['webmaster_tools'])
+               and $config['webmaster_tools']['activate']=='yes'
+               and $is_sommaire) {
+               $append .= "\n" . seo_generer_webmaster_tools();
+       }
+
+       if (isset($config['bing'])
+               and $config['bing']['activate'] == 'yes'
+               and $is_sommaire) {
+               $append .= "\n" . seo_generer_bing();
+       }
+
+       /* CANONICAL URL */
+       if (isset($config['canonical_url'])
+               and $config['canonical_url']['activate']=='yes') {
+               $append .= "\n" . seo_generer_urls_canoniques($contexte);
+       }
+
+       /* GOOGLE ANALYTICS */
+       if (isset($config['analytics'])
+               and $config['analytics']['activate']=='yes') {
+               $append .= "\n" . seo_generer_google_analytics();
+       }
+
+       /* ALEXA */
+       if (isset($config['alexa'])
+               and $config['alexa']['activate']=='yes'
+               and $is_sommaire) {
+               $append .= "\n" . seo_generer_alexa();
+       }
+
+       if ($append) {
+               $append = "\n$append\n";
+               // sinon ajouter en fin de </head>
+               if ($p = stripos($head, '</head>')) {
+                       $head = substr_replace($head, $append, $p, 0);
+               } else {
+                       $head .= $append;
+               }
+       }
+
+       return $head;
+}
+
+/**
+ * Renvoyer la balise <link> pour URL CANONIQUES
+ *
+ * @param array $contexte
+ * @return string
+ */
+function seo_generer_urls_canoniques($contexte) {
+       include_spip('inc/urls');
+       $i = seo_interprete_contexte($contexte);
+
+       if (isset($i['id_objet'])) {
+               return '<link rel="canonical" href="' . generer_url_entite_absolue($i['id_objet'], $i['objet']) . '" />';
+       } elseif ($i['objet'] == 'sommaire') {
+               return '<link rel="canonical" href="' . url_de_base() . '" />';
+       }
+
+       return '';
+}
+
+/**
+ * Renvoyer la balise SCRIPT de Google Analytics
+ *
+ * @return string
+ */
+function seo_generer_google_analytics() {
+       include_spip('inc/config');
+
+       /* GOOGLE ANALYTICS */
+       if ($id = lire_config('seo/analytics/id')) {
+               $id = texte_script($id);
+               // Nouvelle balise : http://www.google.com/support/analytics/bin/answer.py?hl=fr_FR&answer=174090&utm_id=ad
+               if (!lire_config('seo/analytics/universal')) {
+                       return "<script type=\"text/javascript\">
+       var _gaq = _gaq || [];
+       _gaq.push(['_setAccount', '$id']);
+       _gaq.push(['_trackPageview']);
+       (function() {
+               var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+               ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+               var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+       })();
+</script>
+";
+               } else {
+                       return "<script type=\"text/javascript\">
+       (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+       })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+       ga('create', '$id', 'auto');
+       ga('send', 'pageview');
+</script>
+";
+               }
+       }
+
+       return '';
+}
+
+/**
+ * Renvoyer les META Classiques
+ * - Meta Titre / Description / etc.
+ *
+ * @param null|array $contexte
+ * @return array
+ */
+function seo_calculer_meta_tags($contexte = null) {
+       include_spip('inc/config');
+       include_spip('inc/filtres');
+       $config = lire_config('seo/');
+
+       if (is_null($contexte)) {
+               $contexte = $GLOBALS['contexte'];
+       }
+       $i = seo_interprete_contexte($contexte);
+
+       /* META TAGS */
+
+       // If the meta tags configuration is activate
+       $meta_tags = array();
+
+       if (isset($i['id_objet'])) {
+               $trouver_table = charger_fonction('trouver_table', 'base');
+               $desc = $trouver_table($i['table_sql']);
+               $select = array();
+               if (isset($desc['titre'])) {
+                       $select[] = $desc['titre'];
+               } elseif (isset($desc['field']['titre'])) {
+                       $select[] = 'titre';
+               }
+               if (isset($desc['field']['descriptif'])) {
+                       $select[] = 'descriptif';
+               }
+               if (isset($desc['field']['chapo'])) {
+                       $select[] = 'chapo';
+               }
+               if (isset($desc['field']['texte'])) {
+                       $select[] = 'texte';
+               }
+
+               $tag = array();
+               if (count($select)) {
+                       $select = implode(',', $select);
+                       $row = sql_fetsel($select, $i['table_sql'], $i['primary'].'=' . intval($i['id_objet']));
+                       if ($row) {
+                               if (isset($row['titre'])) {
+                                       $tag['title'] = couper(extraire_multi($row['titre'], isset($contexte['lang']) ? $contexte['lang'] : $GLOBALS['spip_lang']), 64);
+                                       unset($row['titre']);
+                               }
+                               if (isset($row['lang'])) {
+                                       unset($row['lang']);
+                               }
+
+                               if (count($row)) {
+                                       $tag['description'] = couper(implode(' ', $row), 150, '');
+                               }
+                       }
+               }
+               // Get the value set by default
+               if (isset($config['meta_tags']['default']) and is_array($config['meta_tags']['default'])) {
+                       foreach ($config['meta_tags']['default'] as $name => $option) {
+                               $meta_tags[$name] = array();
+                               if (in_array($option, array('page', 'page_sommaire'))) {
+                                       if (isset($tag[$name])) {
+                                               $meta_tags[$name][] = $tag[$name];
+                                       }
+                               }
+                               if (in_array($option, array('sommaire','page_sommaire'))) {
+                                       if (isset($config['meta_tags']['tag'][$name])) {
+                                               $meta_tags[$name][] = $config['meta_tags']['tag'][$name];
+                                       }
+                               }
+                               if (count($meta_tags[$name])) {
+                                       $meta_tags[$name] = implode(' - ', $meta_tags[$name]);
+                               } else {
+                                       unset($meta_tags[$name]);
+                               }
+                       }
+               }
+
+               // If the meta tags rubrique and articles editing is activate (should overwrite other setting)
+               if (isset($config['meta_tags']['activate_editing'])
+                       and $config['meta_tags']['activate_editing'] == 'yes') {
+                       $result = sql_select('*', 'spip_seo', 'id_objet=' . intval($i['id_objet']) . ' AND objet=' . sql_quote($i['objet']));
+                       while ($r = sql_fetch($result)) {
+                               if ($r['meta_content'] != '') {
+                                       $meta_tags[$r['meta_name']] = $r['meta_content'];
+                               }
+                       }
+               }
+       } elseif ($i['objet'] == 'sommaire') {
+               $meta_tags = isset($config['meta_tags']['tag'])?$config['meta_tags']['tag']:array();
+       }
+       $meta_tags = pipeline('post_seo', array
+               (
+                       'args' => array(
+                               'contexte' => $contexte,
+                               'config' => $config
+                       ),
+                       'data' => $meta_tags
+               )
+       );
+       return $meta_tags;
+}
+
+/**
+ * @param null|array $contexte
+ * @param null|array $meta_tags
+ * @return array
+ */
+function seo_generer_meta_tags($meta_tags = null, $contexte = null) {
+       $tags = array();
+       //Set meta list if not provided
+       if (!is_array($meta_tags)) {
+               $meta_tags = seo_calculer_meta_tags($contexte);
+       }
+
+       // Print the result on the page
+       foreach ($meta_tags as $name => $content) {
+               if ($content!='') {
+                       if ($name == 'title') {
+                               $tags[$name] = '<title>' . trim(entites_html(supprimer_numero(textebrut(propre($content))))) . '</title>';
+                       } else {
+                               $tags[$name] = '<meta name="' . $name . '" content="' . trim(attribut_html(textebrut(propre($content)))) . '" />';
+                       }
+               }
+       }
+       return $tags;
+}
+
+/**
+ * Renvoyer une META toute seule (hors balise)
+ * @param string $nom
+ * @return string
+ */
+function seo_generer_meta_brute($nom) {
+       include_spip('inc/config');
+       return lire_config("seo/meta_tags/tag/$nom", '');
+}
+
+/**
+ * Renvoyer la META GOOGLE WEBMASTER TOOLS
+ * @return string
+ */
+function seo_generer_webmaster_tools() {
+       include_spip('inc/config');
+       if ($id = lire_config('seo/webmaster_tools/id')) {
+               return '<meta name="google-site-verification" content="' . texte_script($id) . '" />';
+       }
+}
+
+
+/**
+ * Renvoyer la META BING TOOLS
+ * @return string
+ */
+function seo_generer_bing() {
+       include_spip('inc/config');
+       if ($id=lire_config('seo/bing/id')) {
+               return '<meta name="msvalidate.01" content="' . texte_script($id) . '" />';
+       }
+}
+
+/**
+ * Renvoyer la META ALEXA
+ * @return string
+ */
+function seo_generer_alexa() {
+       include_spip('inc/config');
+       if ($id=lire_config('seo/alexa/id')) {
+               return '<meta name="alexaVerifyID" content="' . texte_script($id) . '" />';
+       }
+}
+
+/**
+ * #SEO_URL
+ * Renvoyer la balise <link> pour URL CANONIQUES
+ * @param $p
+ */
+function balise_SEO_URL_dist($p) {
+       $p->code = "seo_generer_urls_canoniques(\$Pile[0])";
+       $p->interdire_scripts = false;
+       return $p;
+}
+
+/**
+ * #SEO_GA
+ * Renvoyer la balise SCRIPT de Google Analytics
+ * @param $p
+ */
+function balise_SEO_GA_dist($p) {
+       $p->code = "seo_generer_google_analytics()";
+       $p->interdire_scripts = false;
+       return $p;
+}
+
+/**
+ * #SEO_META_TAGS
+ * Renvoyer les META editoriales
+ * - Meta Titre / Description / etc.
+ * @param $p
+ */
+function balise_SEO_META_TAGS_dist($p) {
+       $p->code = 'implode("\\n",seo_generer_meta_tags(null,$Pile[0]))';
+       $p->interdire_scripts = false;
+       return $p;
+}
+
+/**
+ * #SEO_META_BRUTE{nom_de_la_meta}
+ * Renvoyer la valeur de la meta appelée (sans balise)
+ * @param $p
+ */
+function balise_SEO_META_BRUTE_dist($p) {
+       $_nom = str_replace("'", '', interprete_argument_balise(1, $p));
+       $p->code = "table_valeur(seo_calculer_meta_tags(),$_nom,'')";
+       $p->interdire_scripts = false;
+       return $p;
+}
+
+/**
+ * #SEO_GWT
+ * Renvoyer la META GOOGLE WEBMASTER TOOLS
+ * @param $p
+ */
+function balise_SEO_GWT_dist($p) {
+       $p->code = "seo_generer_webmaster_tools()";
+       $p->interdire_scripts = false;
+       return $p;
+}
+
+/**
+ * #SEO : insere toutes les meta d'un coup, a l'endroit indique
+ * @param $p
+ */
+function balise_SEO_dist($p) {
+       $p->code = "seo_insere_remplace_metas('',\$Pile[0])";
+       $p->interdire_scripts = false;
+       return $p;
+}
diff --git a/www/plugins/seo-dev/seo_pipelines.php b/www/plugins/seo-dev/seo_pipelines.php
new file mode 100644 (file)
index 0000000..0a64023
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * BouncingOrange SPIP SEO plugin
+ *
+ * @category   SEO
+ * @package    SPIP\SEO\Pipelines
+ * @author     Pierre ROUSSET (p.rousset@gmail.com)
+ * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
+ * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function seo_autoriser() {
+}
+
+function autoriser_seo_bouton_dist($faire, $type, $id, $qui, $opt) {
+       // seul les administrateurs globaux ont acces au bouton de configuration
+       return autoriser('configurer', '_seo');
+}
+
+/**
+ * Insertion dans le squelette head/truc de Z si dispo
+ * Remplace/ajoute des metas et title a celles du squelette
+ *
+ * @param string $flux
+ *     Le contenu de la page
+ * @return string
+ *     Le contenu de la page modifiée
+ */
+function seo_recuperer_fond($flux) {
+       if (strncmp($flux['args']['fond'], 'head/', 5)==0
+               and strpos($flux['data']['texte'], '<!--seo_insere-->') === false
+               and strpos($flux['data']['texte'], '<title') !== false
+               and include_spip('inc/config')
+               and lire_config('seo/insert_head/activate', 'no') == 'yes'
+       ) {
+               $flux['data']['texte'] = recuperer_fond('inclure/seo-head', array('head' => $flux['data']['texte'], 'contexte' => $flux['args']['contexte']));
+       }
+       return $flux;
+}
+
+/**
+ * Insertion dans le pipeline affichage_final (SPIP)
+ * Remplace/ajoute des metas et title a celles du <head>
+ *
+ * @param string $flux
+ *     Le contenu de la page
+ * @return string
+ *     Le contenu de la page modifiée
+ */
+function seo_affichage_final($flux) {
+
+       #$t = spip_timer();
+       /**
+        * On n'agit que si on a un head
+        * sinon c'est tout et n'importe quoi
+        */
+       if ($GLOBALS['html']
+               and stripos($flux, '<head>') !== false
+               and strpos($flux, '<!--seo_insere-->') === false
+               and include_spip('inc/config')
+               and lire_config('seo/insert_head/activate', 'no') == 'yes'
+               and ($ps = stripos($flux, '<head>')) !== false
+               and ($pe = stripos($flux, '</head>')) !== false
+               and $pe > $ps
+               and $head = substr($flux, $ps+6, $pe-$ps-6)
+               ) {
+               $head_new = recuperer_fond('inclure/seo-head', array('head' => $head, 'contexte' => $GLOBALS['contexte']));
+               $flux = str_replace($head, $head_new, $flux);
+       }
+       #var_dump(spip_timer());
+       return $flux;
+}
\ No newline at end of file
diff --git a/www/plugins/seo-dev/seo_pipelines_ecrire.php b/www/plugins/seo-dev/seo_pipelines_ecrire.php
new file mode 100644 (file)
index 0000000..c45ab05
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+/**
+ * BouncingOrange SPIP SEO plugin
+ *
+ * @category   SEO
+ * @package    SPIP\SEO\Pipelines
+ * @author     Pierre ROUSSET (p.rousset@gmail.com)
+ * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
+ * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function seo_metas_editable($objet) {
+       include_spip('inc/config');
+       if (lire_config('seo/meta_tags/activate', 'off') == 'yes'
+               && lire_config('seo/meta_tags/activate_editing', 'off') == 'yes') {
+               $table_sql = table_objet_sql($objet);
+               if (in_array($table_sql, lire_config('seo/meta_tags/editable_tables', array('spip_articles', 'spip_rubriques')))) {
+                       return true;
+               }
+       }
+       return false;
+}
+/**
+ * Insertion dans le pipeline afficher_contenu_objet (SPIP)
+ *
+ * Afficher les meta-tags en bas du contenu de l'objet
+ *
+ * @param array $flux
+ *             Le contexte du pipeline
+ * @return array $flux
+ *             Le contexte du pipeline modifé
+ */
+function seo_afficher_contenu_objet($flux) {
+       $flux['data'] .= recuperer_fond('prive/objets/seo-metas', array('objet' => $flux['args']['type'], 'id_objet' => $flux['args']['id_objet']));
+       return $flux;
+}
+
+/**
+ * Insertion dans le pipeline formulaire_charger
+ *
+ * Charger les valeurs des meta-tags pour la saisie dans l'objet
+ *
+ * @param array $flux
+ *             Le contexte du pipeline
+ * @return array $flux
+ *             Le contexte du pipeline modifié
+ */
+function seo_formulaire_charger($flux) {
+       if (strncmp($flux['args']['form'], 'editer_', 7) == 0
+               and $objet = substr($flux['args']['form'], 7)
+               and seo_metas_editable($objet)) {
+               $valeurs = array(
+                       'meta_title'=>'',
+                       'meta_description'=>'',
+                       'meta_keywords'=>'',
+                       'meta_copyright'=>'',
+                       'meta_author'=>'',
+                       'meta_robots'=>'',
+               );
+               if ($id_objet = intval($flux['args']['args'][0])) {
+                       $metas = sql_select('*', 'spip_seo', 'id_objet ='.intval($id_objet).' AND objet ='.sql_quote($objet));
+                       while ($meta = sql_fetch($metas)) {
+                               $valeurs['meta_'.$meta['meta_name']] = $meta['meta_content'];
+                       }
+               }
+               $flux['data'] = array_merge($flux['data'], $valeurs);
+       }
+       return $flux;
+}
+
+/**
+ * Enregistrer les valeurs des meta-tags apres la saisie dans l'objet
+ * @param array $flux
+ * @return array
+ */
+function seo_formulaire_traiter($flux) {
+       if (strncmp($flux['args']['form'], 'editer_', 7) == 0
+               and $objet = substr($flux['args']['form'], 7)
+               and _request('seo_metas')
+               and $id_table_objet=id_table_objet($objet)
+               and isset($flux['data'][$id_table_objet])
+               and $id_objet=$flux['data'][$id_table_objet]) {
+               $editer_seo = charger_fonction('editer_seo', 'action');
+               $err = $editer_seo($objet, $id_objet, 'meta_');
+
+               if ($err) {
+                       if (!isset($flux['data']['message_erreur'])) {
+                               $flux['data']['message_erreur'] = '';
+                       }
+                       $flux['data']['message_erreur'] .= ' ' ._L('Vous n\'avez pas le droit de modifier les meta-tags : '.$err);
+                       if (isset($flux['data']['redirect'])) {
+                               unset($flux['data']['redirect']);
+                       }
+               }
+       }
+       return $flux;
+}
+
+
+/**
+ * Insertion dans le pipeline formulaire_fond (SPIP)
+ *
+ * Ajouter la saisie des meta-tags dans le form de saisie de l'objet
+ *
+ * @param array $flux
+ *             Le contexte du pipeline
+ * @return array $flux
+ *             Le contexte du pipeline modifié
+ */
+function seo_formulaire_fond($flux) {
+
+       if (isset($flux['args']['args']['type'])
+               and $objet = $flux['args']['args']['type']
+               and $flux['args']['form']=="editer_$objet"
+               and seo_metas_editable($objet)) {
+               $ins = recuperer_fond('formulaires/inc-editer-seo', $flux['args']['contexte']);
+               if ($p=strpos($flux['data'], $i = '<!--extra-->')
+                       or $p=strrpos($flux['data'], $i = '</ul>')) {
+                       $p = $p + strlen($i);
+                       $flux['data'] = substr_replace($flux['data'], $ins, $p, 0);
+               }
+       }
+       return $flux;
+}
diff --git a/www/plugins/seo-dev/svn.revision b/www/plugins/seo-dev/svn.revision
new file mode 100644 (file)
index 0000000..eb9d79f
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/seo/trunk
+Revision: 99225
+Dernier commit: 2016-08-21 05:19:01 +0200 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/seo/trunk</origine>
+<revision>99225</revision>
+<commit>2016-08-21 05:19:01 +0200 </commit>
+</svn_revision>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/action/editer_seo.php b/www/plugins/seo-v1/action/editer_seo.php
deleted file mode 100644 (file)
index 62d741a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-/**
- * @return array
- */
-function action_editer_seo_dist(){
-       include_spip('inc/autoriser');
-       $err = "";
-
-       // si id_article n'est pas un nombre, c'est une creation 
-       // mais on verifie qu'on a toutes les donnees qu'il faut.
-       if (!$id_objet = _request('id_objet') OR !$objet = _request('objet')){
-               $err = "Pas d'objet ou id_objet";
-       } else {
-               if (!autoriser('modifier', $objet, $id_objet)){
-                       $err = "Error auth :(";
-               } else {
-                       $meta_tags = array('title', 'description', 'author', 'keywords', 'copyright', 'robots');
-                       sql_delete("spip_seo", "id_objet = " . intval($id_objet) . " AND objet =" . sql_quote($objet));
-                       foreach ($meta_tags as $tag){
-                               if (($value = _request($tag)) && (strlen($value)>0)){
-                                       sql_insertq('spip_seo', array('id_objet' => $id_objet, 'objet' => $objet, 'meta_name' => $tag, 'meta_content' => $value));
-                               }
-                       }
-               }
-       }
-
-       if ($err)
-               spip_log("echec editeur seo: $err", _LOG_ERREUR);
-
-       return array(array($objet, $id_objet), $err);
-}
-
-?>
diff --git a/www/plugins/seo-v1/base/seo_tables.php b/www/plugins/seo-v1/base/seo_tables.php
deleted file mode 100644 (file)
index 1f9337f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-// Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-function seo_declarer_tables_interfaces($interface){
-       $interface['table_des_tables']['seo'] = 'seo';
-
-       return $interface;
-}
-
-function seo_declarer_tables_principales($tables_principales){
-       //-- Table SEO -----------------------------------------------------
-       $seo = array(
-               'id_objet' => "int(11) NOT NULL",
-               'objet' => "varchar(10) NOT NULL",
-               'meta_name' => "varchar(20) NOT NULL",
-               'meta_content' => "text NOT NULL"
-       );
-
-       $seo_cles = array(
-               "PRIMARY KEY" => "id_objet, objet, meta_name"
-       );
-
-       $tables_principales['spip_seo'] = array(
-               'field' => &$seo,
-               'key' => &$seo_cles
-       );
-
-       return $tables_principales;
-}
-
-?>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/exec/seo_config.php b/www/plugins/seo-v1/exec/seo_config.php
deleted file mode 100644 (file)
index 94ff0eb..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * BouncingOrange SPIP SEO plugin
- *
- * @category   SEO
- * @package    SPIP_SEO
- * @author     Pierre ROUSSET (p.rousset@gmail.com)
- * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
- * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
- */
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-function exec_seo_config(){
-
-       if (!autoriser('configurer', 'configuration')){
-               include_spip('inc/minipres');
-               echo minipres();
-               exit();
-       }
-
-       ///// PAGE /////
-
-       $titre_page = _T('icone_configuration_site');
-       $rubrique = 'configuration';
-       $sous_rubrique = 'seo';
-
-       $commencer_page = charger_fonction('commencer_page', 'inc');
-       echo($commencer_page(_T('seo:seo') . ' - ' . $titre_page, $rubrique, $sous_rubrique));
-
-       $page_result = ''
-               . '<br /><br /><br />'
-               . gros_titre(_T('titre_page_config_contenu'), '', false)
-               . barre_onglets($rubrique, $sous_rubrique)
-               . debut_gauche($rubrique, true)
-               . pipeline('affiche_gauche', array('args' => array('exec' => 'seo_config'), 'data' => ''))
-               . creer_colonne_droite($rubrique, true)
-               . pipeline('affiche_droite', array('args' => array('exec' => 'seo_config'), 'data' => ''))
-               . debut_droite($rubrique, true);
-
-       // Insert Head //
-
-       // Meta tag //
-
-       // Canonical URL //
-
-       // Google Webmaster Tools //
-
-       // Google Analytics //
-
-       $page_result .= recuperer_fond('prive/configurer_seo');
-
-       echo $page_result, pipeline('affiche_milieu', array('args' => array('exec' => $sous_rubrique), 'data' => '')), fin_gauche(), fin_page();
-}
-
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_alexa.html b/www/plugins/seo-v1/formulaires/configurer_seo_alexa.html
deleted file mode 100644 (file)
index f5f1c19..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/alexa-24.png}|image_reduire{0,24})] <:seo:alexa:></h3>
-                               <ul>
-                                       <li class="editer editer_alexa_activate">
-                                               <label for="alexa_activate"><:seo:alexa_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="alexa_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] onChange="active_alexa(jQuery(this), jQuery('.editer_alexa_id'))"/>
-                                       </li>
-                                       <li class="editer editer_alexa_id">
-                                               <label for="alexa_id"><:seo:alexa_id:></label>
-                                               <input type="text" name="alexa_id" value="#ENV{alexa_id}" id="alexa_id" class="text" />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-<script type="text/javascript">
-       function active_alexa(checkbox, form) {
-               checkbox.is(':checked') ? form.slideDown()  : form.slideUp();
-       }
-       [(#ENV{activate}|=={yes}|non)
-       jQuery('.editer_alexa_id').hide();]
-</script>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_alexa.php b/www/plugins/seo-v1/formulaires/configurer_seo_alexa.php
deleted file mode 100644 (file)
index 9911534..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_alexa_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['alexa']) ? $config['alexa'] : array('id' => '');
-       $valeurs['alexa_id'] = $valeurs['id'];
-       
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-       
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_alexa_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['alexa'])) {
-               $config['alexa'] = array();
-       }
-       $config['alexa']['activate'] = _request('activate','no');
-       $config['alexa']['id'] = _request('alexa_id',''); 
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_bing.html b/www/plugins/seo-v1/formulaires/configurer_seo_bing.html
deleted file mode 100644 (file)
index 1817feb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/bing-24.png}|image_reduire{0,24})] <:seo:bing_webmaster:></h3>
-                               <ul>
-                                       <li class="editer editer_bing_activate">
-                                               <label for="bing_activate"><:seo:bing_webmaster_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="bing_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] onchange="active_bing(jQuery(this), jQuery('.editer_bing_id'))"/>
-                                       </li>
-                                       <li class="editer editer_bing_id">
-                                               <label for="bing_id"><:seo:bing_webmaster_id:></label>
-                                               <input type="text" name="bing_id" value="#ENV{bing_id}" id="bing_id" class="text" />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-<script type="text/javascript">
-       function active_bing(checkbox, form) {
-               jQuery(checkbox).is(':checked') ? form.slideDown()  : form.slideUp();
-       }
-       [(#ENV{activate}|=={yes}|non)
-       jQuery('.editer_bing_id').hide();]
-</script>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_bing.php b/www/plugins/seo-v1/formulaires/configurer_seo_bing.php
deleted file mode 100644 (file)
index 3775148..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_bing_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['bing']) ? $config['bing'] : array('id' => '');
-       $valeurs['bing_id'] = $valeurs['id'];
-       
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration'))
-               $valeurs['editable'] = false;
-
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_bing_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['bing']))
-               $config['bing'] = array();
-       $config['bing']['activate'] = _request('activate','no');
-       $config['bing']['id'] = _request('bing_id',''); 
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.html b/www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.html
deleted file mode 100644 (file)
index cb77d22..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/google_analytics-24.png}|image_reduire{0,24})] <:seo:google_analytics:></h3>
-                               <ul>
-                                       <li class="editer editer_analytics_activate">
-                                               <label for="analytics_activate"><:seo:google_analytics_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="analytics_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] onChange="active_analytics(jQuery(this), jQuery('.editer_analytics_id'))"/>
-                                       </li>
-                                       <li class="editer editer_analytics_id">
-                                               <label for="analytics_id"><:seo:google_analytics_id:></label>
-                                               <input type="text" name="analytics_id" value="#ENV{analytics_id}" id="analytics_id" class="text" />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-<script type="text/javascript">
-       function active_analytics(checkbox, form) {
-               checkbox.is(':checked') ? form.slideDown()  : form.slideUp();
-       }
-       [(#ENV{activate}|=={yes}|non)
-       jQuery('.editer_analytics_id').hide();]
-</script>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.php b/www/plugins/seo-v1/formulaires/configurer_seo_ganalytics.php
deleted file mode 100644 (file)
index eafdf03..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_ganalytics_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['analytics']) ? $config['analytics'] : array('id' => '') ;
-       $valeurs['analytics_id'] = $valeurs['id'];
-       
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-       
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_ganalytics_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['analytics'])) {
-               $config['analytics'] = array();
-       }
-       $config['analytics']['activate'] = _request('activate','no');
-       $config['analytics']['id'] = _request('analytics_id',''); 
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_insert_head.html b/www/plugins/seo-v1/formulaires/configurer_seo_insert_head.html
deleted file mode 100644 (file)
index 0d9e647..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend"><:seo:insert_head:></h3>
-                               <ul>
-                                       <li class="editer editer_insert_head_activate">
-                                               <p class="explication"><:seo:insert_head_descriptif:></p>
-                                               <label for="insert_head_activate"><:seo:insert_head_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="insert_head_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] />
-                                       </li>
-                                       <li class="editer editer_forcer_squelette">
-                                               <p class="explication"><:seo:forcer_squelette_descriptif:></p>
-                                               <label for="forcer_squelette"><:seo:forcer_squelette_label:></label>
-                                               <input type="checkbox" value="yes" name="forcer_squelette" id="forcer_squelette"[(#ENV{forcer_squelette}|=={yes}|oui)checked="checked"] />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-</div>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_insert_head.php b/www/plugins/seo-v1/formulaires/configurer_seo_insert_head.php
deleted file mode 100644 (file)
index f0a1884..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_insert_head_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = $config['insert_head'];
-       $valeurs['forcer_squelette'] = $config['forcer_squelette'];
-
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-       
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_insert_head_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['insert_head'])) {
-               $config['insert_head'] = array();
-       }
-       $config['insert_head']['activate'] = _request('activate','no');
-       $config['forcer_squelette'] = _request('forcer_squelette','no');
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_metas.html b/www/plugins/seo-v1/formulaires/configurer_seo_metas.html
deleted file mode 100644 (file)
index d9fef1f..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/meta_tags-24.png}|image_reduire{0,24})] <:seo:meta_tags:></h3>
-                               <ul>
-                                       <li class="editer editer_meta_tags_activate">
-                                               <label for="meta_tags_activate"><:seo:meta_tags_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="meta_tags_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] onChange="active_metas(jQuery(this), jQuery('#fieldset_activate_editing,#fieldset_sommaire,#fieldset_default'))"/>
-                                       </li>
-                                       <li class="fieldset" id="fieldset_activate_editing">
-                                               <h3 class="legend"><:seo:meta_tags_editing:></h3>
-                                               <ul>
-                                                       <li class="editer editer_meta_tags_activate_editing">
-                                                               <div class="choix">
-                                                               <input type="checkbox" value="yes" name="activate_editing" id="meta_tags_activate_editing"[(#ENV{activate_editing}|=={yes}|oui)checked="checked"] />
-                                                               <label for="meta_tags_activate_editing"><:seo:meta_tags_edit_activate:></label>
-                                                               </div>
-                                                       </li>
-                                               </ul>
-                                       </li>
-                                       <li class="fieldset" id="fieldset_sommaire">
-                                               <h3 class="legend"><:seo:meta_tags_sommaire:></h3>
-                                               <ul>
-                                                       <li class="editer editer_sommaire_title">
-                                                               <label for="title"><:seo:meta_title:></label>
-                                                               <input type="text" name="title" value="#ENV{title}" id="title" class="text" />
-                                                       </li>
-                                                       <li class="editer editer_sommaire_description">
-                                                               <label for="description"><:seo:meta_description:></label>
-                                                               <textarea name="description" id="description" type="text" class="text" rows="5">#ENV{description}</textarea>
-                                                       </li>
-                                                       <li class="editer editer_sommaire_keywords">
-                                                               <label for="keywords"><:seo:meta_keywords:></label>
-                                                               <input type="text" name="keywords" value="#ENV{keywords}" id="keywords" class="text" />
-                                                       </li>
-                                                       <li class="editer editer_sommaire_copyright">
-                                                               <label for="copyright"><:seo:meta_copyright:></label>
-                                                               <input type="text" name="copyright" value="#ENV{copyright}" id="copyright" class="text" />
-                                                       </li>
-                                                       <li class="editer editer_sommaire_auteur">
-                                                               <label for="author"><:seo:meta_author:></label>
-                                                               <input type="text" name="author" value="#ENV{author}" id="author" class="text" />
-                                                       </li>
-                                                       <li class="editer editer_sommaire_robots">
-                                                               <label for="robots"><:seo:meta_robots:></label>
-                                                               <select name="robots" id="robots" class="text">
-                                                                       <option #ENV{robots}|=={''}|oui)selected="selected"] value=""></option>
-                                                                       <option #ENV{robots}|=={'INDEX, FOLLOW'}|oui)selected="selected"] value="INDEX, FOLLOW">INDEX, FOLLOW</option>
-                                                                       <option #ENV{robots}|=={'INDEX, NOFOLLOW'}|oui)selected="selected"] value="INDEX, NOFOLLOW">INDEX, NOFOLLOW</option>
-                                                                       <option #ENV{robots}|=={'NOINDEX, FOLLOW'}|oui)selected="selected"] value="NOINDEX, FOLLOW">NOINDEX, FOLLOW</option>
-                                                                       <option #ENV{robots}|=={'NOINDEX, NOFOLLOW'}|oui)selected="selected"] value="NOINDEX, NOFOLLOW">NOINDEX, NOFOLLOW</option>
-                                                                       <option #ENV{robots}|=={'INDEX, FOLLOW, NOARCHIVE'}|oui)selected="selected"] value="INDEX, FOLLOW, NOARCHIVE">INDEX, FOLLOW, NOARCHIVE</option>
-                                                                       <option #ENV{robots}|=={'INDEX, NOFOLLOW, NOARCHIVE'}|oui)selected="selected"] value="INDEX, NOFOLLOW, NOARCHIVE">INDEX, NOFOLLOW, NOARCHIVE</option>
-                                                                       <option #ENV{robots}|=={'NOINDEX, NOFOLLOW, NOARCHIVE'}|oui)selected="selected"] value="NOINDEX, NOFOLLOW, NOARCHIVE">NOINDEX, NOFOLLOW, NOARCHIVE</option>
-                                                               </select>
-                                                       </li>
-                                               </ul>
-                                       </li>
-                                       <li class="fieldset" id="fieldset_default">
-                                               <h3 class="legend"><:seo:meta_tags_default:></h3>
-                                               <ul>
-                                                       <li class="editer editer_default_title">
-                                                               <label for="default_title"><:seo:meta_title:></label>
-                                                               <select name="default_title" id="default_title" class="text">
-                                                                       <option[(#ENV{default_title}|=={''}|oui)selected="selected"] value=""></option>'
-                                                                       <option[(#ENV{default_title}|=={'page'}|oui)selected="selected"] value="page"><:seo:meta_page_title_value:></option>
-                                                                       <option[(#ENV{default_title}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                                       <option[(#ENV{default_title}|=={'page_sommaire'}|oui)selected="selected"] value="page_sommaire"><:seo:meta_page_title_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                                       <li class="editer editer_default_description">
-                                                               <label for="default_description"><:seo:meta_description:></label>
-                                                               <select name="default_description" id="default_description" class="text">
-                                                                       <option[(#ENV{default_description}|=={''}|oui)selected="selected"] value=""></option>'
-                                                                       <option[(#ENV{default_description}|=={'page'}|oui)selected="selected"] value="page"><:seo:meta_page_description_value:></option>
-                                                                       <option[(#ENV{default_description}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                                       <option[(#ENV{default_description}|=={'page_sommaire'}|oui)selected="selected"] value="page_sommaire"><:seo:meta_page_description_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                                       <li class="editer editer_default_keywords">
-                                                               <label for="default_keywords"><:seo:meta_keywords:></label>
-                                                               <select name="default_keywords" id="default_keywords" class="text">
-                                                                       <option[(#ENV{default_keywords}|=={''}|oui)selected="selected"] value=""></option>'
-                                                                       <option[(#ENV{default_keywords}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                                       <li class="editer editer_default_copyright">
-                                                               <label for="default_copyright"><:seo:meta_copyright:></label>
-                                                               <select name="default_copyright" id="default_copyright" class="text">
-                                                                       <option[(#ENV{default_copyright}|=={''}|oui)selected="selected"] value=""></option>
-                                                                       <option[(#ENV{default_copyright}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                                       <li class="editer editer_default_author">
-                                                               <label for="default_author"><:seo:meta_author:></label>
-                                                               <select name="default_author" id="default_author" class="text">
-                                                                       <option[(#ENV{default_author}|=={''}|oui)selected="selected"] value=""></option>
-                                                                       <option[(#ENV{default_author}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                                       <li class="editer editer_default_robots">
-                                                               <label for="default_robots"><:seo:meta_robots:></label>
-                                                               <select name="default_robots" id="default_robots" class="text">
-                                                                       <option[(#ENV{default_robots}|=={''}|oui)selected="selected"] value=""></option>
-                                                                       <option[(#ENV{default_robots}|=={'sommaire'}|oui)selected="selected"] value="sommaire"><:seo:meta_sommaire_value:></option>
-                                                               </select>
-                                                       </li>
-                                               </ul>
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-<script type="text/javascript">
-       function active_metas(checkbox, form) {
-               checkbox.is(':checked') ? form.slideDown()  : form.slideUp();
-       }
-       [(#ENV{activate}|=={yes}|non)
-       jQuery('#fieldset_activate_editing,#fieldset_sommaire,#fieldset_default').hide();]
-</script>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_metas.php b/www/plugins/seo-v1/formulaires/configurer_seo_metas.php
deleted file mode 100644 (file)
index 0014040..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_metas_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['meta_tags']) ? $config['meta_tags'] : array();
-       if(isset($valeurs['tag']) and is_array($valeurs['tag'])){
-               foreach($valeurs['tag'] as $tag => $val){
-                       $valeurs[$tag] = $val;
-                       unset($valeurs['tag'][$tag]);
-               }
-       }
-       if(isset($valeurs['default']) and is_array($valeurs['default'])){
-               foreach($valeurs['default'] as $tag => $val){
-                       $valeurs['default_'.$tag] = $val;
-                       unset($valeurs['default'][$tag]);
-               }
-       }
-       unset($valeurs['tag']);
-       unset($valeurs['default']);
-
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-       
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_metas_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['meta_tags'])) {
-               $config['meta_tags'] = array();
-       }
-       $config['meta_tags']['activate'] = _request('activate','no');
-       $config['meta_tags']['activate_editing'] = _request('activate','no');
-       
-       $config['meta_tags']['tag']['title'] = _request('title');
-       $config['meta_tags']['tag']['description'] = _request('description');
-       $config['meta_tags']['tag']['keywords'] = _request('keywords');
-       $config['meta_tags']['tag']['copyright'] = _request('copyright');
-       $config['meta_tags']['tag']['author'] = _request('author');
-       $config['meta_tags']['tag']['robots'] = _request('robots');
-       
-       $config['meta_tags']['default']['title'] = _request('default_title');
-       $config['meta_tags']['default']['description'] = _request('default_description');
-       $config['meta_tags']['default']['keywords'] = _request('default_keywords');
-       $config['meta_tags']['default']['copyright'] = _request('default_copyright');
-       $config['meta_tags']['default']['author'] = _request('default_author');
-       $config['meta_tags']['default']['robots'] = _request('default_robots');
-       
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.html b/www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.html
deleted file mode 100644 (file)
index 09819e6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/canonical_url-24.png}|image_reduire{0,24})] <:seo:canonical_url:></h3>
-                               <ul>
-                                       <li class="editer editer_canonical_url_activate">
-                                               <label for="canonical_url_activate"><:seo:canonical_url_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="canonical_url_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.php b/www/plugins/seo-v1/formulaires/configurer_seo_urls_canoniques.php
deleted file mode 100644 (file)
index 5f6cc87..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_urls_canoniques_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['canonical_url']) ? $config['canonical_url'] : array();
-       
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-       
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_urls_canoniques_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['canonical_url'])) {
-               $config['canonical_url'] = array();
-       }
-       $config['canonical_url']['activate'] = _request('activate','no');
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.html b/www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.html
deleted file mode 100644 (file)
index 113b541..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="formulaire_spip formulaire_config formulaire_#FORM">
-
-[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
-[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-
-<form method="post" action="#ENV{action}">
-       <div>
-               #ACTION_FORMULAIRE{#ENV{action}}
-               <ul>
-                       <li class="fieldset">
-                               <h3 class="legend">[(#CHEMIN{img_pack/google_webmaster-24.png}|image_reduire{0,24})] <:seo:google_webmaster_tools:></h3>
-                               <ul>
-                                       <li class="editer editer_webmaster_tools_activate">
-                                               <label for="webmaster_tools_activate"><:seo:google_webmaster_tools_activate:></label>
-                                               <input type="checkbox" value="yes" name="activate" id="webmaster_tools_activate"[(#ENV{activate}|=={yes}|oui)checked="checked"] onChange="active_webmaster_tools(jQuery(this), jQuery('.editer_webmaster_tools_id'))"/>
-                                       </li>
-                                       <li class="editer editer_webmaster_tools_id">
-                                               <label for="webmaster_tools_id"><:seo:google_webmaster_tools_id:></label>
-                                               <input type="text" name="webmaster_tools_id" value="#ENV{webmaster_tools_id}" id="webmaster_tools_id" class="text" />
-                                       </li>
-                               </ul>
-                       </li>
-               </ul>
-               <p class="boutons">
-                       <input type="submit" value="<:bouton_valider:>" class="submit" />
-               </p>
-       </div>
-</form>
-<script type="text/javascript">
-       function active_webmaster_tools(checkbox, form) {
-               checkbox.is(':checked') ? form.slideDown()  : form.slideUp();
-       }
-       [(#ENV{activate}|=={yes}|non)
-       jQuery('.editer_webmaster_tools_id').hide();]
-</script>
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.php b/www/plugins/seo-v1/formulaires/configurer_seo_webmaster_tools.php
deleted file mode 100644 (file)
index a6df97d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-
-function formulaires_configurer_seo_webmaster_tools_charger_dist(){
-
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $valeurs = isset($config['webmaster_tools']) ? $config['webmaster_tools'] : array('id' => '');
-       $valeurs['webmaster_tools_id'] = $valeurs['id'];
-       
-       $valeurs['editable'] = true;
-       
-       if (!autoriser('configurer', 'configuration')) {
-               $valeurs['editable'] = false;
-       }
-
-       return $valeurs;
-}
-
-function formulaires_configurer_seo_webmaster_tools_traiter_dist(){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (!isset($config['webmaster_tools'])) {
-               $config['webmaster_tools'] = array();
-       }
-       $config['webmaster_tools']['activate'] = _request('activate','no');
-       $config['webmaster_tools']['id'] = _request('webmaster_tools_id',''); 
-       $config = serialize($config);
-       ecrire_meta('seo',$config);
-       include_spip('inc/invalideur');
-       suivre_invalideur('1');
-       return array('message_ok'=>_T('config_info_enregistree'),'editable'=>true);
-}
-?>
diff --git a/www/plugins/seo-v1/formulaires/editer_seo.html b/www/plugins/seo-v1/formulaires/editer_seo.html
deleted file mode 100644 (file)
index 2c980f2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<div class="formulaire_spip formulaire_editer formulaire_editer_seo formulaire_editer_seo-#ENV{objet}-#ENV{id_objet}">
-       [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
-       [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
-       [(#ENV{editable})
-       <form method='post' action='#ENV{action}'><div>
-               [(#REM) declarer les hidden qui declencheront le service du formulaire 
-               parametre : url d'action ]
-               #ACTION_FORMULAIRE{#ENV{action}}
-         <input type='hidden' name='id_objet' value='#ENV{id_objet}' />
-         <input type='hidden' name='objet' value='#ENV{objet}' />
-         <ul>
-           <li class="editer editer_title[ (#ENV**{erreurs}|table_valeur{title}|oui)erreur]">
-               <label for="title"><:seo:meta_title:></label>[
-               <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{title})</span>
-               ]<input type='text' class='text' name='title' id='title' value="[(#ENV**{title,''})]" />
-           </li>
-           [<li class="editer editer_description[ (#ENV**{erreurs}|table_valeur{description}|oui)erreur]">(#ENV**{description}|match{^=,Uis}|non)
-                       <label for="description"><:seo:meta_description:></label>[
-                       <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{description})</span>
-                       ]<textarea name='description' id='description' rows='3' cols='40'>[(#ENV**{description})]</textarea>
-               </li>]
-           <li class="editer editer_keywords[ (#ENV**{erreurs}|table_valeur{keywords}|oui)erreur]">
-               <label for="keywords"><:seo:meta_keywords:></label>[
-               <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{keywords})</span>
-               ]<input type='text' class='text' name='keywords' id='keywords' value="[(#ENV**{keywords,''})]" />
-           </li>
-           <li class="editer editer_copyright[ (#ENV**{erreurs}|table_valeur{copyright}|oui)erreur]">
-               <label for="copyright"><:seo:meta_copyright:></label>[
-               <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{copyright})</span>
-               ]<input type='text' class='text' name='copyright' id='copyright' value="[(#ENV**{copyright,''})]" />
-           </li>
-           <li class="editer editer_author[ (#ENV**{erreurs}|table_valeur{author}|oui)erreur]">
-               <label for="author"><:seo:meta_author:></label>[
-               <span class='erreur_message'>(#ENV**{erreurs}|table_valeur{author})</span>
-               ]<input type='text' class='text' name='author' id='author' value="[(#ENV**{author,''})]" />
-           </li>
-         </ul>
-
-         [(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
-         <!--extra-->
-         <p class='boutons'>
-               <input type='submit' class='submit' value='<:bouton_enregistrer:>' />
-         </p>
-       </div></form>
-       ]
-</div>
diff --git a/www/plugins/seo-v1/formulaires/editer_seo.php b/www/plugins/seo-v1/formulaires/editer_seo.php
deleted file mode 100644 (file)
index fa47632..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-include_spip('inc/actions');
-include_spip('inc/editer');
-
-function formulaires_editer_seo_charger($objet, $id_objet, $retour=''){
-       $valeurs = array();
-       $valeurs['objet'] = $objet;
-       $valeurs['id_objet'] = $id_objet;
-       $metas = sql_select("*", "spip_seo", "id_objet =".intval($id_objet)." AND objet =".sql_quote($objet));
-       while($meta = sql_fetch($metas)){
-               $valeurs[$meta['meta_name']] = $meta['meta_content'];
-       }
-       $valeurs['editable'] = true;
-       return $valeurs;
-}
-
-/**
- * Identifier le formulaire en faisant abstraction des parametres qui
- * ne representent pas l'objet edite
- */
-function formulaires_editer_seo_identifier_dist($objet, $id_objet, $retour=''){
-       return serialize(array(intval($id_objet),$objet));
-}
-
-function formulaires_editer_seo_verifier($objet, $id_objet, $retour=''){
-       $erreurs = array();
-       return $erreurs;
-}
-
-function formulaires_editer_seo_traiter($objet, $id_objet, $retour=''){
-       $editer_seo = charger_fonction('editer_seo','action');
-       $editer_seo();
-       
-       return;
-       //return formulaires_editer_objet_traiter('seo',$id_objet,$objet,$lier_trad,$retour,$config_fonc,$row,$hidden);
-}
-
-?>
diff --git a/www/plugins/seo-v1/img_pack/alexa-24.png b/www/plugins/seo-v1/img_pack/alexa-24.png
deleted file mode 100644 (file)
index c270b69..0000000
Binary files a/www/plugins/seo-v1/img_pack/alexa-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/bing-24.png b/www/plugins/seo-v1/img_pack/bing-24.png
deleted file mode 100644 (file)
index 54e1ae9..0000000
Binary files a/www/plugins/seo-v1/img_pack/bing-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/canonical_url-24.png b/www/plugins/seo-v1/img_pack/canonical_url-24.png
deleted file mode 100644 (file)
index 43f34b4..0000000
Binary files a/www/plugins/seo-v1/img_pack/canonical_url-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/google_analytics-24.png b/www/plugins/seo-v1/img_pack/google_analytics-24.png
deleted file mode 100644 (file)
index a334a47..0000000
Binary files a/www/plugins/seo-v1/img_pack/google_analytics-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/google_webmaster-24.png b/www/plugins/seo-v1/img_pack/google_webmaster-24.png
deleted file mode 100644 (file)
index e27175d..0000000
Binary files a/www/plugins/seo-v1/img_pack/google_webmaster-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/meta_tags-24.png b/www/plugins/seo-v1/img_pack/meta_tags-24.png
deleted file mode 100644 (file)
index 1ab847a..0000000
Binary files a/www/plugins/seo-v1/img_pack/meta_tags-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/img_pack/seo-24.png b/www/plugins/seo-v1/img_pack/seo-24.png
deleted file mode 100644 (file)
index c9f08ad..0000000
Binary files a/www/plugins/seo-v1/img_pack/seo-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/lang/paquet-seo.xml b/www/plugins/seo-v1/lang/paquet-seo.xml
deleted file mode 100644 (file)
index ed623da..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<traduction module="paquet-seo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/seo/lang/" reference="fr">
-       <langue code="en" />
-       <langue code="fr" />
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=ru">
-               <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
-               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
-       </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=sk">
-               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
-       </langue>
-</traduction>
diff --git a/www/plugins/seo-v1/lang/paquet-seo_en.php b/www/plugins/seo-v1/lang/paquet-seo_en.php
deleted file mode 100644 (file)
index 8bfea58..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=en
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'seo_description' => 'SEO is a plugin who add the possibility to insert in the head of your website: meta tags, canoical URL, Google webmaster tools Meta Code and Google Analytics javascript code. It is fully configurable in the SPIP configuration page and in each article or rubrique page for meta tags.',
-       'seo_nom' => 'SEO',
-       'seo_slogan' => 'Search Engine Optimisation'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/paquet-seo_fr.php b/www/plugins/seo-v1/lang/paquet-seo_fr.php
deleted file mode 100644 (file)
index fd4b5ae..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?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_/seo/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'seo_description' => 'SEO est un plugin qui ajoute la possibilité d\'insérer dans la partie head de votre site web : meta tags, URL canonique, Google webmaster tools Meta Code et Google Analytics javascript. Il est configurable dans la page de configuration de SPIP ainsi que dans chaque rubrique et article pour les meta tags.',
-       'seo_nom' => 'SEO',
-       'seo_slogan' => 'Search Engine Optimisation'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/paquet-seo_ru.php b/www/plugins/seo-v1/lang/paquet-seo_ru.php
deleted file mode 100644 (file)
index 4cda1a8..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=ru
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'seo_description' => 'Этот плагин предоставляет возможность вставлять в шапку вашего сайта мета теги, канонический вид URL, Google webmaster tools, Meta Code, и Google Analytics javascript code. Каждой статье и каждому разделу вы можете придавать уникальные мета теги.',
-       'seo_nom' => 'SEO',
-       'seo_slogan' => 'Поисковая оптимизация (SEO)'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/paquet-seo_sk.php b/www/plugins/seo-v1/lang/paquet-seo_sk.php
deleted file mode 100644 (file)
index 9abc22b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-seo?lang_cible=sk
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'seo_description' => 'SEO je zásuvný modul, ktorý ponúka možnosť vložiť do hlavičky stránky meta tagy, kanonickú podobu internetových adries, meta kód nástrojov pre webmasterov od spoločnosti Google a javaskript z Google Analytics. Meta tagy sa dajú nastaviť na stránke s nastaveniami SPIPu, ako aj v každej rubrike a v každom článku.',
-       'seo_nom' => 'SEO',
-       'seo_slogan' => 'Optimalizácia pre vyhľadávače'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/seo.xml b/www/plugins/seo-v1/lang/seo.xml
deleted file mode 100644 (file)
index 4720173..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<traduction module="seo" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/seo/lang/" reference="fr">
-       <langue code="en" url="http://trad.spip.net/tradlang_module/seo?lang_cible=en">
-               <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
-       </langue>
-       <langue code="fr" />
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/seo?lang_cible=ru">
-               <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
-               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
-       </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/seo?lang_cible=sk">
-               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
-       </langue>
-</traduction>
diff --git a/www/plugins/seo-v1/lang/seo_en.php b/www/plugins/seo-v1/lang/seo_en.php
deleted file mode 100644 (file)
index dd145c0..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=en
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'S.E.O' => 'SEO',
-
-       // A
-       'alexa' => 'Alexa',
-       'alexa_activate' => 'Activate Alexa',
-       'alexa_id' => 'Website Alexa\'s ID',
-
-       // B
-       'bing_webmaster' => 'Bing Webmaster Tools',
-       'bing_webmaster_activate' => 'Enable Bing Webmaster Tools',
-       'bing_webmaster_id' => 'Meta Code verification',
-
-       // C
-       'canonical_url' => 'Canonical URL',
-       'canonical_url_activate' => 'Activate Canonical URL',
-
-       // F
-       'forcer_squelette_descriptif' => 'SEO metas are prioritary to the one generated by the skeleton',
-       'forcer_squelette_label' => 'Load metas for all skeletons',
-
-       // G
-       'google_analytics' => 'Google Analytics',
-       'google_analytics_activate' => 'Activate Analytics',
-       'google_analytics_id' => 'Google Analytics web property ID',
-       'google_webmaster_tools' => 'Google Webmaster Tools',
-       'google_webmaster_tools_activate' => 'Activate Webmaster Tools',
-       'google_webmaster_tools_id' => 'Meta Code verification',
-
-       // I
-       'insert_head' => 'Automatic insertion in #INSERT_HEAD',
-       'insert_head_activate' => 'Activate automatic insertion',
-       'insert_head_descriptif' => 'Automatic insertion of SEO configuration in &lt;header&gt;',
-
-       // M
-       'meta_author' => 'Author:',
-       'meta_copyright' => 'Copyright:',
-       'meta_description' => 'Description:',
-       'meta_keywords' => 'Keywords:',
-       'meta_page_description_sommaire_value' => 'Page Description Value + Home Page Meta Value',
-       'meta_page_description_value' => 'Page Description Value',
-       'meta_page_title_sommaire_value' => 'Page Title Value + Home Page Meta Value',
-       'meta_page_title_value' => 'Page Title Value',
-       'meta_robots' => 'Robots:',
-       'meta_sommaire_value' => 'Home Page Meta Value',
-       'meta_tags' => 'Meta Tags',
-       'meta_tags_activate' => 'Activate meta tags',
-       'meta_tags_default' => 'Defaults Meta Tag (for Articles and Sections)',
-       'meta_tags_edit_activate' => 'Activate meta tags editing in sections and articles',
-       'meta_tags_editing' => 'Meta Tags Editing',
-       'meta_tags_sommaire' => 'Home Page Meta Tags',
-       'meta_title' => 'Title:',
-
-       // S
-       'seo' => 'Search Engine Optimisation'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/seo_fr.php b/www/plugins/seo-v1/lang/seo_fr.php
deleted file mode 100644 (file)
index 3fe76d0..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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_/seo/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'S.E.O' => 'SEO',
-
-       // A
-       'alexa' => 'Alexa',
-       'alexa_activate' => 'Activer Alexa',
-       'alexa_id' => 'Identifiant du site pour Alexa',
-
-       // B
-       'bing_webmaster' => 'Bing Webmaster Tools',
-       'bing_webmaster_activate' => 'Activer Bing Webmaster Tools',
-       'bing_webmaster_id' => 'Meta code de vérification',
-
-       // C
-       'canonical_url' => 'URL Canoniques',
-       'canonical_url_activate' => 'Activer les URL Canoniques',
-
-       // F
-       'forcer_squelette_descriptif' => 'Les metas SEO sont prioritaires aux meta générées par les squelettes',
-       'forcer_squelette_label' => 'Charger les metas pour tous squelettes',
-
-       // G
-       'google_analytics' => 'Google Analytics',
-       'google_analytics_activate' => 'Activer Analytics',
-       'google_analytics_id' => 'Google Analytics web property ID',
-       'google_webmaster_tools' => 'Google Webmaster Tools',
-       'google_webmaster_tools_activate' => 'Activer Webmaster Tools',
-       'google_webmaster_tools_id' => 'Meta code de vérification',
-
-       // I
-       'insert_head' => 'Insertion automatique dans #INSERT_HEAD',
-       'insert_head_activate' => 'Activer l\'insertion automatique',
-       'insert_head_descriptif' => 'Insertion automatique de la configuration SEO dans le &lt;header&gt;',
-
-       // M
-       'meta_author' => 'Auteur :',
-       'meta_copyright' => 'Copyright :',
-       'meta_description' => 'Description :',
-       'meta_keywords' => 'Mots Clefs :',
-       'meta_page_description_sommaire_value' => 'Valeur de la Description de la Page + Valeur Meta du Sommaine',
-       'meta_page_description_value' => 'Valeur de la Description de la Page',
-       'meta_page_title_sommaire_value' => 'Valeur du Titre de la Page + Valeur Meta du Sommaire',
-       'meta_page_title_value' => 'Valeur du Titre de la Page',
-       'meta_robots' => 'Robots :',
-       'meta_sommaire_value' => 'Valeur de la Meta du Sommaire',
-       'meta_tags' => 'Meta Tags',
-       'meta_tags_activate' => 'Activer les meta tags',
-       'meta_tags_default' => 'Valeur des Meta Tags par Défaut (pour les Articles et les Rubriques)',
-       'meta_tags_edit_activate' => 'Activer l\'édition des meta tags dans les rubriques et les articles',
-       'meta_tags_editing' => 'Edition des Meta Tags',
-       'meta_tags_sommaire' => 'Valeur des Meta Tags du Sommaire (page d\'accueil)',
-       'meta_title' => 'Titre :',
-
-       // S
-       'seo' => 'Search Engine Optimisation'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/seo_ru.php b/www/plugins/seo-v1/lang/seo_ru.php
deleted file mode 100644 (file)
index b8fe400..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=ru
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'S.E.O' => 'SEO',
-
-       // A
-       'alexa' => 'Alexa',
-       'alexa_activate' => 'Включить Alexa',
-       'alexa_id' => 'Сайт идентификатор для Alexa',
-
-       // B
-       'bing_webmaster' => 'Bing Webmaster Tools',
-       'bing_webmaster_activate' => 'Включить Bing Webmaster Tools',
-       'bing_webmaster_id' => 'Проверочный мета код',
-
-       // C
-       'canonical_url' => 'Канонические URL',
-       'canonical_url_activate' => 'Включить канонические URL',
-
-       // F
-       'forcer_squelette_descriptif' => 'Мета теги, заданные в плагине, имеют больший приоритет, чем теги, указанные в шаблонах.',
-       'forcer_squelette_label' => 'Подключать мета теги во все шаблоны',
-
-       // G
-       'google_analytics' => 'Google Analytics',
-       'google_analytics_activate' => 'Включить Analytics',
-       'google_analytics_id' => 'Google Analytics ID',
-       'google_webmaster_tools' => 'Google Webmaster Tools',
-       'google_webmaster_tools_activate' => 'Включить Webmaster Tools',
-       'google_webmaster_tools_id' => 'Проверка Meta code ',
-
-       // I
-       'insert_head' => 'Подключать автоматически в #INSERT_HEAD',
-       'insert_head_activate' => 'Включить',
-       'insert_head_descriptif' => 'Автоматическая вставка мета-тегов в &lt;header&gt;',
-
-       // M
-       'meta_author' => 'Автор :',
-       'meta_copyright' => 'Copyright:',
-       'meta_description' => 'Описание:',
-       'meta_keywords' => 'Ключевые слова :',
-       'meta_page_description_sommaire_value' => 'Значение Description страницы + значение Meta главной',
-       'meta_page_description_value' => 'Значение Description страницы',
-       'meta_page_title_sommaire_value' => 'Title страницы + значение Meta главной',
-       'meta_page_title_value' => 'Title страницы',
-       'meta_robots' => 'Роботы :',
-       'meta_sommaire_value' => 'Значение Meta главной страницы',
-       'meta_tags' => 'Mета Теги',
-       'meta_tags_activate' => 'Включить',
-       'meta_tags_default' => 'Сгенерировать Mета Теги по умолчанию (для статей и разделов)',
-       'meta_tags_edit_activate' => 'Включить возможность редактирования мета тегов для разделов и статей',
-       'meta_tags_editing' => 'Редактирование мета-тегов',
-       'meta_tags_sommaire' => 'Мета теги главной страницы',
-       'meta_title' => 'Title :',
-
-       // S
-       'seo' => 'Поисковая оптимизация'
-);
-
-?>
diff --git a/www/plugins/seo-v1/lang/seo_sk.php b/www/plugins/seo-v1/lang/seo_sk.php
deleted file mode 100644 (file)
index 089e1c3..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
-// extrait automatiquement de http://trad.spip.net/tradlang_module/seo?lang_cible=sk
-// ** ne pas modifier le fichier **
-
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-       // S
-       'S.E.O' => 'SEO',
-
-       // A
-       'alexa' => 'Alexa',
-       'alexa_activate' => 'Aktivovať Alexu',
-       'alexa_id' => 'Identifikátor stránky na Alexu',
-
-       // B
-       'bing_webmaster' => 'Bing Webmaster Tools', # NEW
-       'bing_webmaster_activate' => 'Activer Bing Webmaster Tools', # NEW
-       'bing_webmaster_id' => 'Meta code de vérification', # NEW
-
-       // C
-       'canonical_url' => 'Kanonická podoba adries',
-       'canonical_url_activate' => 'Aktivovať kanonickú podobu adries',
-
-       // F
-       'forcer_squelette_descriptif' => 'Hlavičky meta zo SEO majú prednosť pred hlavičkami meta, ktoré vygenerujú šablóny',
-       'forcer_squelette_label' => 'Nahrať hlavičky meta pre všetky šablóny',
-
-       // G
-       'google_analytics' => 'Google Analytics',
-       'google_analytics_activate' => 'Aktivovať Google Analytics',
-       'google_analytics_id' => 'ID webového objektu Google Analytics ',
-       'google_webmaster_tools' => 'Nástroje Google Webmaster Tools',
-       'google_webmaster_tools_activate' => 'Aktivovať Nástroje pre webmastera',
-       'google_webmaster_tools_id' => 'Kontrolný kód',
-
-       // I
-       'insert_head' => 'Automatické vkladanie do #INSERT_HEAD',
-       'insert_head_activate' => 'Aktivovať automatické vkladanie',
-       'insert_head_descriptif' => 'Automatické vkladanie nastavenia SEO do &lt;hlavičky&gt;',
-
-       // M
-       'meta_author' => 'Autor(ka):',
-       'meta_copyright' => 'Autorské práva:',
-       'meta_description' => 'Popis:',
-       'meta_keywords' => 'Kľúčové slová:',
-       'meta_page_description_sommaire_value' => 'Hodnota popisu stránky + hodnota tagu zhrnutie',
-       'meta_page_description_value' => 'Hodnota popisu stránky',
-       'meta_page_title_sommaire_value' => 'Hodnota nadpisu stránky + hodnota tagu Zhrnutie',
-       'meta_page_title_value' => 'Hodnota nadpisu stránky',
-       'meta_robots' => 'Roboty:',
-       'meta_sommaire_value' => 'Hodnota tagu Zhrnutie',
-       'meta_tags' => 'Meta tagy',
-       'meta_tags_activate' => 'Aktivovať meta tagy',
-       'meta_tags_default' => 'Predvolená hodnota meta tagov (pre články a rubriky)',
-       'meta_tags_edit_activate' => 'Aktivovať úpravu meta tagov v rubrikách a článkoch',
-       'meta_tags_editing' => 'Úprava meta tagov',
-       'meta_tags_sommaire' => 'Hodnota meta tagov zhrnutia (úvodná stránka)',
-       'meta_title' => 'Nadpis:',
-
-       // S
-       'seo' => 'Optimalizácia pre vyhľadávače'
-);
-
-?>
diff --git a/www/plugins/seo-v1/paquet.xml b/www/plugins/seo-v1/paquet.xml
deleted file mode 100644 (file)
index 1444471..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<paquet
-       prefix="seo"
-       categorie="statistique"
-       version="1.8.1"
-       etat="test"
-       compatibilite="[2.0.0;3.0.*]"
-       logo="seo.png"
-       schema="1.1.1"
-       documentation="http://contrib.spip.net/?rubrique1248"
->      
-
-       <nom>SEO</nom>
-       <!-- Search Engine Optimisation -->
-
-       <auteur mail="p.rousset@gmail.com">Pierre ROUSSET</auteur>
-
-       <copyright>2009-2012</copyright>
-
-       <licence lien="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2</licence>
-
-       <pipeline nom="declarer_tables_principales" inclure="base/seo_tables.php" />
-       <pipeline nom="declarer_tables_interfaces" inclure="base/seo_tables.php" />
-       <pipeline nom="insert_head" action="insert_head" inclure="pipelines/seo_insert_head.php" />
-       <pipeline nom="affichage_final" action="affichage_final" inclure="pipelines/seo_affichage_final.php" />
-       <pipeline nom="affiche_milieu" action="affiche_milieu" inclure="pipelines/seo_affiche_milieu.php" />
-       <pipeline nom="ajouter_onglets" action="ajouter_onglets" inclure="pipelines/seo_ajouter_onglets.php" />
-       <pipeline nom="autoriser" inclure="pipelines/seo_autoriser.php" />
-
-       <menu nom="seo" titre="seo:seo" parent="menu_configuration" icone="images/seo-16.png" action="configurer_seo" />
-</paquet>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/pipelines/seo_affichage_final.php b/www/plugins/seo-v1/pipelines/seo_affichage_final.php
deleted file mode 100644 (file)
index 2626c2d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-/**
- * BouncingOrange SPIP SEO plugin
- *
- * @category   SEO
- * @package    SPIP_SEO
- * @author     Pierre ROUSSET (p.rousset@gmail.com)
- * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
- * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
- */
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-/**
- * Insertion dans le pipeline affichage_final (SPIP)
- * Remplacement des métas et title dans le <head>
- * Remplace les métas et title du squelette et celles insérées via insert_head également
- *
- * @param string $flux
- *     Le contenu de la page
- * @return string
- *     Le contenu de la page modifié
- */
-function seo_affichage_final($flux){
-       preg_match('/<head>(.*)<\/head>/mis', $flux, $head);
-       $head = isset($head[1]) ? $head[1] : false;
-
-       /**
-        * On n'agit que si on a un head
-        * sinon c'est tout et n'importe quoi
-        */
-       if ($head){
-               /**
-                * Pour lire_config
-                */
-               include_spip('inc/config');
-
-               $forcer_squelette = lire_config('seo/forcer_squelette', 'no');
-               if ($forcer_squelette!='yes')
-                       return $flux;
-
-               include_spip('seo_fonctions');
-
-               $meta_tags = calculer_meta_tags();
-
-               foreach ($meta_tags as $key => $value){
-                       $meta = generer_meta_tags(array($key => $value));
-                       $flux_meta = '';
-                       /**
-                        * Si le tag est <title>
-                        */
-                       if ($key=='title')
-                               $flux_meta = preg_replace("/(<\s*$key.*?>.*?<\/\s*$key.*?>)/mi", $meta, $flux, 1);
-                       /**
-                        * Le tag est une <meta>
-                        */
-                       else
-                               $flux_meta = preg_replace("/(<\s*meta\s*name=\"$key\"\s*content=\".*?\".*?>)/mi", $meta, $flux, 1);
-
-                       /**
-                        * Si $flux == $flux_meta
-                        * C'est que _SEO_FORCER_SQUELETTE est placé
-                        * On ajoute les metas juste avant </head>
-                        */
-                       if ($flux==$flux_meta)
-                               $flux_meta = str_replace('</head>', "\n" . $meta . "</head>", $flux);
-
-                       $flux = $flux_meta;
-               }
-       }
-       return $flux;
-}
-
diff --git a/www/plugins/seo-v1/pipelines/seo_affiche_milieu.php b/www/plugins/seo-v1/pipelines/seo_affiche_milieu.php
deleted file mode 100644 (file)
index 3a003ae..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- * BouncingOrange SPIP SEO plugin
- *
- * @category   SEO
- * @package    SPIP_SEO
- * @author     Pierre ROUSSET (p.rousset@gmail.com)
- * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
- * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
- */
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-/**
- * Afficher le formulaire de config des meta dans l'admin
- * @param array $vars
- * @return array
- */
-function seo_affiche_milieu($vars){
-       include_spip('inc/autoriser');
-       include_spip('inc/presentation');
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       // Rubrique
-       if (in_array($vars["args"]["exec"], array('naviguer', 'rubrique')) && $vars["args"]["id_rubrique"]!=''){
-               $objet = 'rubrique';
-               $id_objet = $vars["args"]["id_rubrique"];
-               // Article
-       } elseif (in_array($vars["args"]["exec"], array('articles', 'article')) && $vars["args"]["id_article"]!='') {
-               $objet = 'article';
-               $id_objet = $vars["args"]["id_article"];
-               // Other case we quit
-       } else {
-               return $vars;
-       }
-
-       // If meta tags are activates
-       if ($config['meta_tags']['activate']!='yes' || $config['meta_tags']['activate_editing']!='yes'){
-               return $vars;
-       }
-
-       $ret = '';
-
-       $bouton = bouton_block_depliable(_T('seo:meta_tags'), false, "SEO");
-       $ret .= debut_block_depliable(false, "SEO");
-
-       // List         
-       $ret .= recuperer_fond('prive/squelettes/inclure/seo_metas', array('objet' => $objet, 'id_objet' => $id_objet));
-
-       $ret .= fin_block();
-
-       // Create the border with the content
-       $ret = '<div class="nettoyeur"></div>' . debut_cadre_enfonce(_DIR_PLUGIN_SEO . 'img_pack/meta_tags-24.png', true, "", $bouton) . $ret . fin_cadre_enfonce(true);
-
-       $vars["data"] .= $ret;
-
-       return $vars;
-}
diff --git a/www/plugins/seo-v1/pipelines/seo_ajouter_onglets.php b/www/plugins/seo-v1/pipelines/seo_ajouter_onglets.php
deleted file mode 100644 (file)
index 38009db..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * BouncingOrange SPIP SEO plugin
- *
- * @category   SEO
- * @package    SPIP_SEO
- * @author     Pierre ROUSSET (p.rousset@gmail.com)
- * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
- * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
- */
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-function seo_ajouter_onglets($flux){
-
-       global $connect_statut, $connect_toutes_rubriques;
-
-       // seul les administrateurs globaux ont acces au bouton de configuration
-       if ($connect_statut && $connect_toutes_rubriques){
-               if ($flux['args']=='configuration'){
-                       $flux['data']['seo'] = new Bouton(_DIR_PLUGIN_SEO . "img_pack/seo-24.png", _T("seo:seo"), generer_url_ecrire('seo_config'));
-               }
-       }
-
-       return ($flux);
-}
-
-?>
diff --git a/www/plugins/seo-v1/pipelines/seo_autoriser.php b/www/plugins/seo-v1/pipelines/seo_autoriser.php
deleted file mode 100644 (file)
index ece880b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-function seo_autoriser(){
-}
-
-function autoriser_seo_bouton_dist($faire, $type, $id, $qui, $opt){
-       global $connect_statut, $connect_toutes_rubriques;
-
-       // seul les administrateurs globaux ont acces au bouton de configuration
-       return $connect_statut && $connect_toutes_rubriques;
-}
-
-?>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/pipelines/seo_insert_head.php b/www/plugins/seo-v1/pipelines/seo_insert_head.php
deleted file mode 100644 (file)
index 04f67cd..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * BouncingOrange SPIP SEO plugin
- *
- * @category   SEO
- * @package    SPIP_SEO
- * @author     Pierre ROUSSET (p.rousset@gmail.com)
- * @copyright  Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com)
- * @license    http://opensource.org/licenses/gpl-2.0.php  General Public License (GPL 2.0)
- */
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-/**
- * Inserer les meta dans le head
- *
- * @param string $flux
- * @return string
- */
-function seo_insert_head($flux){
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-       if (isset($config['insert_head']) && $config['insert_head']['activate']=='yes'){
-               $contexte = $GLOBALS['contexte'];
-               unset($contexte['lang']);
-               unset($contexte['date']);
-               unset($contexte['date_default']);
-               unset($contexte['date_redac']);
-               unset($contexte['date_redac_default']);
-               unset($contexte['lang']);
-               if (count($contexte)==0){
-                       $objet = 'sommaire';
-               } elseif (isset($contexte['id_article'])) {
-                       $id_objet = $contexte['id_article'];
-                       $objet = 'article';
-               } elseif (isset($contexte['id_rubrique'])) {
-                       $id_objet = $contexte['id_rubrique'];
-                       $objet = 'rubrique';
-               }
-               /* META TAGS */
-               if (isset($config['meta_tags']) && $config['meta_tags']['activate']=='yes'){
-                       if (!defined('_SEO_FORCER_SQUELETTE')){
-                               $meta_tags = calculer_meta_tags();
-                               $flux .= generer_meta_tags($meta_tags);
-                       }
-               }
-               /* META GOOGLE WEBMASTER TOOLS */
-               if (isset($config['webmaster_tools']) && $config['webmaster_tools']['activate']=='yes' && $objet=='sommaire'){
-                       $flux .= generer_webmaster_tools();
-               }
-
-               if (isset($config['bing']) && $config['bing']['activate']=='yes' && $objet=='sommaire'){
-                       $flux .= generer_bing();
-               }
-
-               /* CANONICAL URL */
-               if (isset($config['canonical_url']) && $config['canonical_url']['activate']=='yes'){
-                       $flux .= generer_urls_canoniques();
-               }
-
-               /* GOOGLE ANALYTICS */
-               if (isset($config['analytics']) && $config['analytics']['activate']=='yes'){
-                       $flux .= generer_google_analytics();
-               }
-
-               /* ALEXA */
-               if (isset($config['alexa']) && $config['alexa']['activate']=='yes' && $objet=='sommaire'){
-                       $flux .= generer_alexa();
-               }
-       }
-
-       return $flux;
-}
-
diff --git a/www/plugins/seo-v1/plugin.xml b/www/plugins/seo-v1/plugin.xml
deleted file mode 100644 (file)
index 6dd4d73..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<plugin>\r
-       <nom><multi>[fr]SEO[en]SEO</multi></nom>\r
-       <slogan>Search Engine Optimisation</slogan>\r
-       <auteur>[Pierre ROUSSET->p.rousset@gmail.com] for [Bouncing Orange->http://www.bouncingorange.com/]</auteur>\r
-       <prefix>seo</prefix>\r
-       <icon>seo.png</icon>\r
-       <description>\r
-               <multi>\r
-                       [fr]SEO est un plugin qui ajoute la possibilit&#233; d'ins&#233;rer dans la partie head de votre site web : meta tags, URL canonique, Google webmaster tools Meta Code et Google Analytics javascript. Il est configurable dans la page de configuration de SPIP ainsi que dans chaque rubrique et article pour les meta tags.\r
-                       [en]SEO is a plugin who add the possibility to insert in the head of your website: meta tags, canoical URL, Google webmaster tools Meta Code and Google Analytics javascript code. It is fully configurable in the SPIP configuration page and in each article or rubrique page for meta tags.\r
-               </multi>\r
-       </description>\r
-       <lien>http://contrib.spip.net/?rubrique1248</lien>\r
-       <licence>(c) 2009-2012 GPL v2</licence>\r
-       <etat>test</etat>\r
-       \r
-       <version>1.8.1</version>\r
-       <version_base>1.1.1</version_base>\r
-\r
-       <install>seo_administrations.php</install>\r
-       <pipeline>\r
-               <nom>declarer_tables_principales</nom>\r
-               <inclure>base/seo_tables.php</inclure>\r
-       </pipeline>\r
-       <pipeline>\r
-               <nom>declarer_tables_interfaces</nom>\r
-               <inclure>base/seo_tables.php</inclure>\r
-       </pipeline>\r
-\r
-       <fonctions>seo_fonctions.php</fonctions>\r
-\r
-       <pipeline>\r
-        <nom>insert_head</nom>\r
-               <action>insert_head</action>\r
-        <inclure>pipelines/seo_insert_head.php</inclure>\r
-    </pipeline>\r
-       <pipeline>\r
-        <nom>affiche_milieu</nom>\r
-               <action>affiche_milieu</action>\r
-        <inclure>pipelines/seo_affiche_milieu.php</inclure>\r
-    </pipeline>\r
-       <pipeline>\r
-               <nom>ajouter_onglets</nom>\r
-               <action>ajouter_onglets</action>\r
-        <inclure>pipelines/seo_ajouter_onglets.php</inclure>\r
-       </pipeline>\r
-       <pipeline>\r
-               <nom>autoriser</nom>\r
-               <inclure>pipelines/seo_autoriser.php</inclure>\r
-       </pipeline>\r
-\r
-       <bouton id="seo" parent="bando_configuration">\r
-               <icone>img_pack/seo-24.png</icone>\r
-               <titre>seo:seo</titre>  \r
-               <url>seo_config</url>   \r
-       </bouton>\r
-       \r
-       <chemin dir='' />\r
-       <necessite id="SPIP" version="[2.0.0;3.0.99]" />\r
-       <categorie>statistique</categorie>\r
-</plugin>\r
diff --git a/www/plugins/seo-v1/prive/configurer_seo.html b/www/plugins/seo-v1/prive/configurer_seo.html
deleted file mode 100644 (file)
index f80ceb3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-[(#REM)
-
-       Inclusion dans la page de configuration
-       
-       Affiche les 6 formulaires de configuration :
-       -* FORMULAIRE_CONFIGURER_SEO_INSERT_HEAD
-       -* FORMULAIRE_CONFIGURER_SEO_METAS
-       -* FORMULAIRE_CONFIGURER_SEO_URLS_CANONIQUES
-       -* FORMULAIRE_CONFIGURER_SEO_WEBMASTER_TOOLS
-       -* FORMULAIRE_CONFIGURER_SEO_BING
-       -* FORMULAIRE_CONFIGURER_SEO_GANALYTICS
-       -* FORMULAIRE_CONFIGURER_SEO_ALEXA
-
-]
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_INSERT_HEAD)
-</div>]
-
-<br />
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_METAS)
-</div>]
-
-<br />
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_URLS_CANONIQUES)
-</div>]
-
-<br />
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_WEBMASTER_TOOLS)
-</div>]
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_BING)
-</div>]
-
-<br />
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_GANALYTICS)
-</div>]
-
-<br />
-
-[<div class="ajax">
-(#FORMULAIRE_CONFIGURER_SEO_ALEXA)
-</div>]
\ No newline at end of file
diff --git a/www/plugins/seo-v1/prive/squelettes/contenu/configurer_seo.html b/www/plugins/seo-v1/prive/squelettes/contenu/configurer_seo.html
deleted file mode 100644 (file)
index 1e401d9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<INCLURE{fond=prive/configurer_seo} />
diff --git a/www/plugins/seo-v1/prive/squelettes/inclure/seo_metas.html b/www/plugins/seo-v1/prive/squelettes/inclure/seo_metas.html
deleted file mode 100644 (file)
index 08278e3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="ajax">
-       #FORMULAIRE_EDITER_SEO{#ENV{objet},#ENV{id_objet}}
-</div>
\ No newline at end of file
diff --git a/www/plugins/seo-v1/prive/style_prive_plugin_seo.html b/www/plugins/seo-v1/prive/style_prive_plugin_seo.html
deleted file mode 100644 (file)
index 9bbcc87..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[(#REM)
-
-       Ce squelette definit les styles de l'espace prive
-
-       Note: l'entete "Vary:" sert a repousser l'entete par
-       defaut "Vary: Cookie,Accept-Encoding", qui est (un peu)
-       genant en cas de "rotation du cookie de session" apres
-       un changement d'IP (effet de clignotement).
-
-       ATTENTION: il faut absolument le charset sinon Firefox croit que
-       c'est du text/html !
-]
-#CACHE{3600*100,cache-client}
-#HTTP_HEADER{Content-Type: text/css; charset=iso-8859-15}
-#HTTP_HEADER{Vary: Accept-Encoding}
-
-#SET{claire,##ENV{couleur_claire,edf3fe}}
-#SET{foncee,##ENV{couleur_foncee,3874b0}}
-
-[(#REM)
-       Dans SPIP 3.0 dans le privé, il y a une définition de l'id copyright avec un text-align à droite
-       On le rétabli à gauche pour les formulaires (ici on a un input)
-]
-.editer #copyright{
-       text-align:[(#ENV{left})];
-}
diff --git a/www/plugins/seo-v1/prive/themes/spip/images/seo-16.png b/www/plugins/seo-v1/prive/themes/spip/images/seo-16.png
deleted file mode 100644 (file)
index c4a9d22..0000000
Binary files a/www/plugins/seo-v1/prive/themes/spip/images/seo-16.png and /dev/null differ
diff --git a/www/plugins/seo-v1/prive/themes/spip/images/seo-24.png b/www/plugins/seo-v1/prive/themes/spip/images/seo-24.png
deleted file mode 100644 (file)
index c9f08ad..0000000
Binary files a/www/plugins/seo-v1/prive/themes/spip/images/seo-24.png and /dev/null differ
diff --git a/www/plugins/seo-v1/seo.png b/www/plugins/seo-v1/seo.png
deleted file mode 100644 (file)
index c78641e..0000000
Binary files a/www/plugins/seo-v1/seo.png and /dev/null differ
diff --git a/www/plugins/seo-v1/seo_administrations.php b/www/plugins/seo-v1/seo_administrations.php
deleted file mode 100644 (file)
index 65999c3..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-// Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/meta');
-include_spip('base/abstract_sql');
-
-// Installation et mise à jour
-function seo_upgrade($nom_meta_version_base, $version_cible){
-
-       $version_actuelle = '0.0';
-       if (
-               (!isset($GLOBALS['meta'][$nom_meta_version_base]))
-               || (($version_actuelle = $GLOBALS['meta'][$nom_meta_version_base])!=$version_cible)
-       ){
-               /* Installation normale */
-               if (version_compare($version_actuelle, '0.0', '=')){
-                       // Création des tables
-                       include_spip('base/create');
-                       creer_base();
-
-                       /**
-                        * La config de base active insert_head
-                        * (les utilisateurs n'ont pas à modifier leurs squelettes et à penser à l'activer)
-                        */
-                       $config_base = array();
-                       $config_base['insert_head']['activate'] = 'yes';
-                       ecrire_meta('seo', serialize($config_base), 'non');
-
-                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
-               }
-               /* Gestion des anciennes tables, la numérotation base était de 1.0 */
-               if (version_compare($version_actuelle, '1.0', '<=')){
-                       include_spip('base/create');
-
-                       // On change le nom de la table initialement mal choisi
-                       $prefixe = $GLOBALS['table_prefix'];
-                       sql_query("RENAME TABLE seo_meta_tags TO $prefixe" . "_seo");
-                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
-               }
-               if (version_compare($version_actuelle, '1.1.0', '<')){
-                       sql_alter('TABLE spip_seo DROP PRIMARY KEY');
-                       sql_alter('TABLE spip_seo CHANGE type_object objet varchar(10) NOT NULL');
-                       sql_alter('TABLE spip_seo CHANGE id_object id_objet int(11) NOT NULL');
-                       sql_alter('TABLE spip_seo ADD PRIMARY KEY ( `id_objet` , `objet` , `meta_name` )');
-                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
-               }
-               if (version_compare($version_actuelle, '1.1.1', '<')){
-                       if (defined('_SEO_FORCER_SQUELETTE'))
-                               ecrire_config('seo/forcer_squelette', 'yes');
-                       ecrire_meta($nom_meta_version_base, $version_actuelle = $version_cible, 'non');
-               }
-       }
-}
-
-// Désinstallation
-function seo_vider_tables($nom_meta_version_base){
-
-       // On efface la table du plugin
-       sql_drop_table('spip_seo');
-
-       // On efface la méta de configuration
-       effacer_meta('seo');
-
-       // On efface la version entregistrée
-       effacer_meta($nom_meta_version_base);
-}
diff --git a/www/plugins/seo-v1/seo_fonctions.php b/www/plugins/seo-v1/seo_fonctions.php
deleted file mode 100644 (file)
index fc1a002..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-<?php
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-include_spip('inc/texte');
-
-/**
- * Renvoyer la balise <link> pour URL CANONIQUES
- * @return string $flux
- */
-function generer_urls_canoniques(){
-       include_spip('balise/url_');
-
-       if (count($GLOBALS['contexte'])==0){
-               $objet = 'sommaire';
-       } elseif (isset($GLOBALS['contexte']['id_article'])) {
-               $id_objet = $GLOBALS['contexte']['id_article'];
-               $objet = 'article';
-       } elseif (isset($GLOBALS['contexte']['id_rubrique'])) {
-               $id_objet = $GLOBALS['contexte']['id_rubrique'];
-               $objet = 'rubrique';
-       }
-
-       switch ($objet) {
-               case 'sommaire':
-                       $flux .= '<link rel="canonical" href="' . url_de_base() . '" />';
-                       break;
-               default:
-                       $flux .= '<link rel="canonical" href="' . url_de_base() . generer_url_entite($id_objet, $objet) . '" />';
-                       break;
-       }
-
-       return $flux;
-}
-
-/**
- * Renvoyer la balise SCRIPT de Google Analytics
- * @return string $flux
- */
-function generer_google_analytics(){
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       /* GOOGLE ANALYTICS */
-       if ($config['analytics']['id']){
-               // Nouvelle balise : http://www.google.com/support/analytics/bin/answer.py?hl=fr_FR&answer=174090&utm_id=ad
-               $flux .= "<script type=\"text/javascript\">
-       var _gaq = _gaq || [];
-       _gaq.push(['_setAccount', '" . $config['analytics']['id'] . "']);
-       _gaq.push(['_trackPageview']);
-       (function() {
-               var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-               ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-               var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-       })();
-</script>
-";
-       }
-
-       return $flux;
-}
-
-/**
- * Renvoyer les META Classiques
- * - Meta Titre / Description / etc.
- * @return string $flux
- */
-function calculer_meta_tags(){
-
-    include_spip('inc/texte');
-
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       if (isset($GLOBALS['contexte']['id_article'])){
-               $id_objet = $GLOBALS['contexte']['id_article'];
-               $objet = 'article';
-       } elseif (isset($GLOBALS['contexte']['id_rubrique'])) {
-               $id_objet = $GLOBALS['contexte']['id_rubrique'];
-               $objet = 'rubrique';
-       } else {
-               $objet = 'sommaire';
-       }
-
-       /* META TAGS */
-
-       // If the meta tags configuration is activate
-       $meta_tags = array();
-
-       switch ($objet) {
-               case 'sommaire':
-                       $meta_tags = $config['meta_tags']['tag'];
-                       break;
-               default:
-                       $table = table_objet_sql($objet);
-                       $id_table_objet = id_table_objet($objet);
-                       $title = couper(sql_getfetsel("titre", $table, "$id_table_objet = " . intval($id_objet)), 64);
-                       $requete = sql_allfetsel("descriptif,texte", $table, "$id_table_objet = " . intval($id_objet));
-                       if ($requete) $description = couper(implode(" ", $requete[0]), 150, '');
-                       // Get the value set by default
-                       foreach ($config['meta_tags']['default'] as $name => $option){
-                               if ($option=='sommaire'){
-                                       $meta_tags[$name] = $config['meta_tags']['tag'][$name];
-                               } elseif ($option=='page') {
-                                       if ($name=='title') $meta_tags['title'] = $title;
-                                       if ($name=='description') $meta_tags['description'] = $description;
-                               } elseif ($option=='page_sommaire') {
-                                       if ($name=='title') $meta_tags['title'] = $title . (($title!='') ? ' - ' : '') . $config['meta_tags']['tag'][$name];
-                                       if ($name=='description') $meta_tags['description'] = $description . (($description!='') ? ' - ' : '') . $config['meta_tags']['tag'][$name];
-                               }
-                       }
-
-                       // If the meta tags rubrique and articles editing is activate (should overwrite other setting)
-                       if ($config['meta_tags']['activate_editing']=='yes' && ($objet=='article' || $objet=='rubrique')){
-                               $result = sql_select("*", "spip_seo", "id_objet = " . intval($id_objet) . " AND objet = " . sql_quote($objet));
-                               while ($r = sql_fetch($result)){
-                                       if ($r['meta_content']!='')
-                                               $meta_tags[$r['meta_name']] = $r['meta_content'];
-                               }
-                       }
-                       break;
-       }
-
-       return $meta_tags;
-}
-
-function generer_meta_tags($meta_tags = null){
-       $flux = '';
-       //Set meta list if not provided
-       if (!is_array($meta_tags))
-               $meta_tags = calculer_meta_tags();
-
-       // Print the result on the page
-       foreach ($meta_tags as $name => $content){
-               if ($content!='')
-                       if ($name=='title')
-                               $flux .= '<title>' . trim(htmlspecialchars(supprimer_numero(textebrut(propre($content))))) . '</title>' . "\n";
-                       else
-                               $flux .= '<meta name="' . $name . '" content="' . trim(htmlspecialchars(textebrut(propre($content)))) . '" />' . "\n";
-
-       }
-       return $flux;
-}
-
-/**
- * Renvoyer une META toute seule (hors balise)
- * @param string $nom
- * @return string|bool
- */
-function generer_meta_brute($nom){
-       $config = unserialize($GLOBALS['meta']['seo']);
-       $nom = strtolower($nom);
-
-       if ($config['meta_tags']['tag'][$nom]){
-               return $config['meta_tags']['tag'][$nom];
-       }
-
-       return false;
-}
-
-/**
- * Renvoyer la META GOOGLE WEBMASTER TOOLS
- * @return string $flux
- */
-function generer_webmaster_tools(){
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       if ($config['webmaster_tools']['id'])
-               return '<meta name="google-site-verification" content="' . $config['webmaster_tools']['id'] . '" />
-               ';
-}
-
-
-/**
- * Renvoyer la META BING TOOLS
- * @return string $flux
- */
-function generer_bing(){
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       if ($config['bing']['id'])
-               return '<meta name="msvalidate.01" content="' . $config['bing']['id'] . '" />
-               ';
-}
-
-/**
- * Renvoyer la META ALEXA
- * @return string $flux
- */
-function generer_alexa(){
-       /* CONFIG */
-       $config = unserialize($GLOBALS['meta']['seo']);
-
-       if ($config['alexa']['id'])
-               return '<meta name="alexaVerifyID" content="' . $config['alexa']['id'] . '"/>';
-}
-
-/**
- * #SEO_URL
- * Renvoyer la balise <link> pour URL CANONIQUES
- */
-function balise_SEO_URL($p){
-       $p->code = "calculer_balise_SEO_URL()";
-       return $p;
-}
-
-function calculer_balise_SEO_URL(){
-       $flux = generer_urls_canoniques();
-       return $flux;
-}
-
-/**
- * #SEO_GA
- * Renvoyer la balise SCRIPT de Google Analytics
- */
-function balise_SEO_GA($p){
-       $p->code = "calculer_balise_SEO_GA()";
-       return $p;
-}
-
-function calculer_balise_SEO_GA(){
-       $flux = generer_google_analytics();
-       return $flux;
-}
-
-/**
- * #SEO_META_TAGS
- * Renvoyer les META Classiques
- * - Meta Titre / Description / etc.
- */
-function balise_SEO_META_TAGS($p){
-       $p->code = "calculer_balise_SEO_META_TAGS()";
-       return $p;
-}
-
-function calculer_balise_SEO_META_TAGS(){
-       $flux = generer_meta_tags();
-       return $flux;
-}
-
-/**
- * #SEO_META_BRUTE{nom_de_la_meta}
- * Renvoyer la valeur de la meta appelée (sans balise)
- */
-function balise_SEO_META_BRUTE($p){
-       $_nom = str_replace("'", "", interprete_argument_balise(1, $p));
-       $p->code = "calculer_balise_META_BRUTE($_nom)";
-       $p->interdire_scripts = false;
-       return $p;
-}
-
-function calculer_balise_META_BRUTE($_nom){
-       $metas = calculer_meta_tags();
-       $meta = $metas[$_nom];
-       if (!$meta)
-               return "";
-       return $meta;
-}
-
-/**
- * #SEO_GWT
- * Renvoyer la META GOOGLE WEBMASTER TOOLS
- */
-function balise_SEO_GWT($p){
-       $p->code = "calculer_balise_SEO_GWT()";
-       return $p;
-}
-
-function calculer_balise_SEO_GWT(){
-       $flux = generer_webmaster_tools();
-       return $flux;
-}
-
diff --git a/www/plugins/seo-v1/svn.revision b/www/plugins/seo-v1/svn.revision
deleted file mode 100644 (file)
index 3c3f577..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<svn_revision>
-<text_version>
-Origine: file:///home/svn/repository/spip-zone/_plugins_/seo/branches/v1
-Revision: 84614
-Dernier commit: 2014-09-14 23:33:31 +0200 
-</text_version>
-<origine>file:///home/svn/repository/spip-zone/_plugins_/seo/branches/v1</origine>
-<revision>84614</revision>
-<commit>2014-09-14 23:33:31 +0200 </commit>
-</svn_revision>
\ No newline at end of file
index 5534a15..80aea7a 100755 (executable)
@@ -42,5 +42,4 @@
     <necessite id="notifications" version= "[3.0.10;]" />
     <necessite id="odt2spip" version= "[2.0.1;]" />
     <necessite id="piwik" version= "[0.6.0;]" />
-    <necessite id="seo" version= "[1.8.1;]" />
 </plugin>
index 8252930..f138239 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/annuler-recherche.png and b/www/plugins/spip-bonux-3/img_pack/annuler-recherche.png differ
index 35d3d3d..3d1a092 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/article-12.png and b/www/plugins/spip-bonux-3/img_pack/article-12.png differ
index 2865fd0..01dcd02 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/deplier-droite.png and b/www/plugins/spip-bonux-3/img_pack/deplier-droite.png differ
index 5dab592..92fc307 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/frame-close.png and b/www/plugins/spip-bonux-3/img_pack/frame-close.png differ
index c180e0f..9675083 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/item-add.png and b/www/plugins/spip-bonux-3/img_pack/item-add.png differ
index 566f4f6..6346715 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/item-remove.png and b/www/plugins/spip-bonux-3/img_pack/item-remove.png differ
index b3a220b..2c1db2e 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/logo-bonux.gif and b/www/plugins/spip-bonux-3/img_pack/logo-bonux.gif differ
index f483cef..dfdd5c9 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/message_erreur-24.png and b/www/plugins/spip-bonux-3/img_pack/message_erreur-24.png differ
index 27d3247..7f80d7b 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/message_notice-24.png and b/www/plugins/spip-bonux-3/img_pack/message_notice-24.png differ
index dfcdb41..55708cb 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/message_ok-24.png and b/www/plugins/spip-bonux-3/img_pack/message_ok-24.png differ
index fffbb43..d787156 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/spip-bonux.png and b/www/plugins/spip-bonux-3/img_pack/spip-bonux.png differ
index 5f21f7b..788c725 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_asc-12.png and b/www/plugins/spip-bonux-3/img_pack/tri_asc-12.png differ
index 89cfd50..19b2e99 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_asc-16.png and b/www/plugins/spip-bonux-3/img_pack/tri_asc-16.png differ
index cf55fbf..02267bc 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_asc-24.png and b/www/plugins/spip-bonux-3/img_pack/tri_asc-24.png differ
index a8a2918..f6d5357 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_asc.png and b/www/plugins/spip-bonux-3/img_pack/tri_asc.png differ
index c853769..e2b7e6d 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_desc-12.png and b/www/plugins/spip-bonux-3/img_pack/tri_desc-12.png differ
index 6d9d043..47e1d28 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_desc-16.png and b/www/plugins/spip-bonux-3/img_pack/tri_desc-16.png differ
index f34ae54..3f3a153 100644 (file)
Binary files a/www/plugins/spip-bonux-3/img_pack/tri_desc-24.png and b/www/plugins/spip-bonux-3/img_pack/tri_desc-24.png differ
index 5fd2c99..1ab6f6a 100644 (file)
@@ -2,11 +2,13 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Recuperer les champs date_xx et heure_xx, verifier leur coherence et les reformater
@@ -16,28 +18,28 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * @param array $erreurs
  * @return int
  */
-function verifier_corriger_date_saisie($suffixe,$horaire,&$erreurs){
+function verifier_corriger_date_saisie($suffixe, $horaire, &$erreurs) {
        include_spip('inc/filtres');
        $date = _request("date_$suffixe").($horaire?' '.trim(_request("heure_$suffixe")).':00':'');
        $date = recup_date($date);
-       if (!$date)
+       if (!$date) {
                return '';
+       }
        $ret = null;
-       if (!$ret=mktime(0,0,0,$date[1],$date[2],$date[0]))
+       if (!$ret=mktime(0, 0, 0, $date[1], $date[2], $date[0])) {
                $erreurs["date_$suffixe"] = _T('spip_bonux:erreur_date');
-       elseif (!$ret=mktime($date[3],$date[4],$date[5],$date[1],$date[2],$date[0]))
+       } elseif (!$ret=mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0])) {
                $erreurs["date_$suffixe"] = _T('spip_bonux:erreur_heure');
-       if ($ret){
-               if (trim(_request("date_$suffixe")!==($d=date('d/m/Y',$ret)))){
+       }
+       if ($ret) {
+               if (trim(_request("date_$suffixe") !== ($d=date('d/m/Y', $ret)))) {
                        $erreurs["date_$suffixe"] = _T('spip_bonux:erreur_date_corrigee');
-                       set_request("date_$suffixe",$d);
+                       set_request("date_$suffixe", $d);
                }
-               if ($horaire AND trim(_request("heure_$suffixe")!==($h=date('H:i',$ret)))){
+               if ($horaire and trim(_request("heure_$suffixe") !== ($h = date('H:i', $ret)))) {
                        $erreurs["heure_$suffixe"] = _T('spip_bonux:erreur_heure_corrigee');
-                       set_request("heure_$suffixe",$h);
+                       set_request("heure_$suffixe", $h);
                }
        }
        return $ret;
 }
-
-?>
\ No newline at end of file
index bad0aed..769c16e 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
  *
  * Fonctions d'export d'une requete sql ou d'un tableau
@@ -11,7 +11,9 @@
  *
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/charsets');
 include_spip('inc/filtres');
@@ -40,43 +42,48 @@ function exporter_csv_champ($champ) {
  */
 function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null) {
        $output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n";
-       if ($importer_charset){
+       if ($importer_charset) {
+               $output = str_replace('’', '\'', $output);
                $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset);
        }
        return $output;
 }
 
 
-function inc_exporter_csv_dist($titre, $resource, $delim=',', $entetes = null,$envoyer = true){
+function inc_exporter_csv_dist($titre, $resource, $delim = ',', $entetes = null, $envoyer = true) {
 
        $filename = preg_replace(',[^-_\w]+,', '_', translitteration(textebrut(typo($titre))));
-       
-       if ($delim == 'TAB') $delim = "\t";
-       if (!in_array($delim,array(',',';',"\t")))
-               $delim = ",";
+
+       if ($delim == 'TAB') {
+               $delim = "\t";
+       }
+       if (!in_array($delim, array(',', ';', "\t"))) {
+               $delim = ',';
+       }
 
        $charset = $GLOBALS['meta']['charset'];
        $importer_charset = null;
-       if ($delim == ',')
+       if ($delim == ',') {
                $extension = 'csv';
-       else {
+       else {
                $extension = 'xls';
                # Excel n'accepte pas l'utf-8 ni les entites html... on transcode tout ce qu'on peut
                $importer_charset = $charset = 'iso-8859-1';
        }
        $filename = "$filename.$extension";
 
-       if ($entetes AND is_array($entetes) AND count($entetes))
-               $output = exporter_csv_ligne($entetes,$delim,$importer_charset);
+       if ($entetes and is_array($entetes) and count($entetes)) {
+               $output = exporter_csv_ligne($entetes, $delim, $importer_charset);
+       }
 
        // on passe par un fichier temporaire qui permet de ne pas saturer la memoire
        // avec les gros exports
-       $fichier = sous_repertoire(_DIR_CACHE,"export") . $filename;
+       $fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename;
        $fp = fopen($fichier, 'w');
        $length = fwrite($fp, $output);
 
-       while ($row=is_array($resource)?array_shift($resource):sql_fetch($resource)){
-               $output = exporter_csv_ligne($row,$delim,$importer_charset);
+       while ($row = is_array($resource) ? array_shift($resource) : sql_fetch($resource)) {
+               $output = exporter_csv_ligne($row, $delim, $importer_charset);
                $length += fwrite($fp, $output);
        }
        fclose($fp);
@@ -88,11 +95,9 @@ function inc_exporter_csv_dist($titre, $resource, $delim=',', $entetes = null,$e
                //Header("Content-Type: text/plain; charset=$charset");
                Header("Content-Length: $length");
                ob_clean();
-    flush();
-    readfile($fichier);
+               flush();
+               readfile($fichier);
        }
 
        return $fichier;
 }
-
-?>
\ No newline at end of file
index f09d392..cc54095 100644 (file)
@@ -2,14 +2,16 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
- * 
+ *
  * Fonctions de lecture d'un fichier CSV pour transformation en array()
- * 
+ *
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/charsets');
 
@@ -30,13 +32,14 @@ include_spip('inc/charsets');
  * @param unknown_type $texte
  * @return array
  */
-function importer_csv_importcharset($texte){
+function importer_csv_importcharset($texte) {
        // le plus frequent, en particulier avec les trucs de ms@@@
        $charset_source = 'iso-8859-1';
        // mais open-office sait faire mieux, donc mefiance !
-       if (is_utf8($texte))
+       if (is_utf8($texte)) {
                $charset_source = 'utf-8';
-       return importer_charset($texte,$charset_source);
+       }
+       return importer_charset($texte, $charset_source);
 }
 
 /**
@@ -46,7 +49,7 @@ function importer_csv_importcharset($texte){
  * @param string $key
  * @return string
  */
-function importer_csv_nettoie_key($key){
+function importer_csv_nettoie_key($key) {
        return translitteration($key);
        /*$accents=array('�','�','�','�','�',"�","�","'");
        $accents_rep=array('e','e','e','a','u',"o","c","_");
@@ -65,37 +68,40 @@ function importer_csv_nettoie_key($key){
  * @param int $len
  * @return array
  */
-function inc_importer_csv_dist($file, $head = false, $delim = ",", $enclos = '"', $len = 10000) {
+function inc_importer_csv_dist($file, $head = false, $delim = ',', $enclos = '"', $len = 10000) {
        $return = false;
        if (@file_exists($file)
-               AND $handle = fopen($file, "r")){
+               and $handle = fopen($file, 'r')) {
                if ($head) {
                        $header = fgetcsv($handle, $len, $delim, $enclos);
-                       if ($header){
-                               $header = array_map('importer_csv_importcharset',$header);
-                               $header = array_map('importer_csv_nettoie_key',$header);
+                       if ($header) {
+                               $header = array_map('importer_csv_importcharset', $header);
+                               $header = array_map('importer_csv_nettoie_key', $header);
                                $header_type = array();
                                foreach ($header as $heading) {
-                                       if (!isset($header_type[$heading]))
-                                               $header_type[$heading] = "scalar";
-                                       else
-                                               $header_type[$heading] = "array";
+                                       if (!isset($header_type[$heading])) {
+                                               $header_type[$heading] = 'scalar';
+                                       } else {
+                                               $header_type[$heading] = 'array';
+                                       }
                                }
                        }
                }
-               while (($data = fgetcsv($handle, $len, $delim, $enclos)) !== FALSE) {
-                       $data = array_map('importer_csv_importcharset',$data);
-                       if ($head AND isset($header)) {
+               while (($data = fgetcsv($handle, $len, $delim, $enclos)) !== false) {
+                       $data = array_map('importer_csv_importcharset', $data);
+                       if ($head and isset($header)) {
                                $row = array();
-                               foreach ($header as $key=>$heading) {
-                                       if ($header_type[$heading]=="array"){
-                                               if (!isset($row[$heading]))
+                               foreach ($header as $key => $heading) {
+                                       if ($header_type[$heading] == 'array') {
+                                               if (!isset($row[$heading])) {
                                                        $row[$heading] = array();
-                                               if (isset($data[$key]) AND strlen($data[$key]))
+                                               }
+                                               if (isset($data[$key]) and strlen($data[$key])) {
                                                        $row[$heading][]= $data[$key];
-                                       }
-                                       else
+                                               }
+                                       } else {
                                                $row[$heading]=(isset($data[$key])) ? $data[$key] : '';
+                                       }
                                }
                                $return[]=$row;
                        } else {
@@ -105,4 +111,3 @@ function inc_importer_csv_dist($file, $head = false, $delim = ",", $enclos = '"'
        }
        return $return;
 }
-
index 26d83f1..76182d3 100644 (file)
@@ -19,6 +19,9 @@
        <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=nl" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
        </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=pt_br" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
        <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=ru" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
index 020ad4a..28b19f1 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 جداول، عدادات، الخ.',
        'spip_bonux_slogan' => 'الملحق الذي يجعل SPIP أكثر بياضاً من.'
 );
-
-?>
index a0477cb..9423241 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        Tabellen, Zähler, usw.',
        'spip_bonux_slogan' => 'Der Plug-in, der SPIPer wäscht als SPIP.'
 );
-
-?>
index 051e1e6..b63b2a1 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        arrays, counter, etc.',
        'spip_bonux_slogan' => 'The plugin that make SPIP better than SPIP.'
 );
-
-?>
index 924e45b..4ab6b8b 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        Tableros, contador, etcétera.',
        'spip_bonux_slogan' => 'El plugin que lava más SPIP que SPIP.'
 );
-
-?>
index b44df3b..abb6fb3 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'spip_bonux_description' => 'پلاگيني كه اسپيپ را از اسپيپ بهتر مي‌سازد، با هداياي داخلي قشنگ، تابلو، شمارشگر و غيره. ',
        'spip_bonux_slogan' => 'پلاگيني كه اسپيپ را از اسپيپ بهتر مي‌سازد '
 );
-
-?>
index 5d132bb..46da5e5 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/spip-bonux-3/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        Tableaux, compteur, etc.',
        'spip_bonux_slogan' => 'Le plugin qui lave plus SPIP que SPIP.'
 );
-
-?>
index 97b9f18..c2ae31f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        Tabellen, teller, enz.',
        'spip_bonux_slogan' => 'De plugin die SPIP nog SPIPper maakt.'
 );
-
-?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_pt_br.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_pt_br.php
new file mode 100644 (file)
index 0000000..4e1f502
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'O plugin que lava mais SPIP que SPIP, com 
+Le plugin qui lave plus SPIP que SPIP, com brindes no pacote!
+       Tabela, contador etc.',
+       'spip_bonux_slogan' => 'O plugin que lava mais SPIP que SPIP.'
+);
index 0e7e554..b3b6ad2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'spip_bonux_description' => 'SPIP Bonux необходим для работы многих других плагинов. Он существенно расширяет возможности SPIP, делая его лучше чем SPIP :)))',
        'spip_bonux_slogan' => 'SPIP Bonux существенно расширяет возможности SPIP, делая его лучше чем SPIP :)))'
 );
-
-?>
index c779759..68d50be 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        Tabuľky, počítadlo, a i.',
        'spip_bonux_slogan' => 'Zásuvný modul, ktorý prečistí SPIP ako SPIP.'
 );
-
-?>
index 7ee8b8b..02c1b76 100644 (file)
@@ -19,6 +19,9 @@
        <langue code="nl" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=nl" total="13" traduits="13" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
        </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=pt_br" total="13" traduits="13" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
+       </langue>
        <langue code="ru" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=ru" total="13" traduits="12" relire="0" modifs="1" nouveaux="0" pourcent="92.31">
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
        </langue>
index 7e98053..1e96ce1 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=ar
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'الصفحات'
 );
-
-?>
index 0070def..839352d 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Seiten'
 );
-
-?>
index 823a498..baacc0c 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Pages'
 );
-
-?>
index 8899e18..6641933 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Páginas'
 );
-
-?>
index 0b195da..9e40474 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'صفحه‌ها'
 );
-
-?>
index ced3602..fbeb300 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/spip-bonux-3/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -30,5 +32,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Pages'
 );
-
-?>
index 2105c7e..f3b92e0 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Blz.'
 );
-
-?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_pt_br.php b/www/plugins/spip-bonux-3/lang/spip_bonux_pt_br.php
new file mode 100644 (file)
index 0000000..03c4b34
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=pt_br
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Exibir o calendário',
+       'annee_precedente' => 'Ano anterior',
+       'annee_suivante' => 'Próximo ano',
+       'annuler_recherche' => 'Cancelar a busca',
+
+       // B
+       'bouton_fermer' => 'Fechar',
+
+       // E
+       'erreur_date' => 'Esta data está incorreta',
+       'erreur_date_corrigee' => 'A data foi corrigida',
+       'erreur_heure' => 'Esta hora está incorreta',
+       'erreur_heure_corrigee' => 'A hora foi corrigida',
+
+       // I
+       'id_rapide' => 'Inclusão rápida',
+
+       // M
+       'mois_precedent' => 'Mês anterior',
+       'mois_suivant' => 'Mês seguinte',
+
+       // P
+       'pages' => 'Päginas'
+);
index d5bfd32..cd47219 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Страницы'
 );
-
-?>
index e231e0d..e08b989 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -32,5 +34,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        // P
        'pages' => 'Stránky'
 );
-
-?>
diff --git a/www/plugins/spip-bonux-3/lib/array_column/array_column.php b/www/plugins/spip-bonux-3/lib/array_column/array_column.php
new file mode 100755 (executable)
index 0000000..1e7fa99
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/**
+ * This file is part of the array_column library
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @copyright Copyright (c) Ben Ramsey (http://benramsey.com)
+ * @license http://opensource.org/licenses/MIT MIT
+ */
+
+if (!function_exists('array_column')) {
+    /**
+     * Returns the values from a single column of the input array, identified by
+     * the $columnKey.
+     *
+     * Optionally, you may provide an $indexKey to index the values in the returned
+     * array by the values from the $indexKey column in the input array.
+     *
+     * @param array $input A multi-dimensional array (record set) from which to pull
+     *                     a column of values.
+     * @param mixed $columnKey The column of values to return. This value may be the
+     *                         integer key of the column you wish to retrieve, or it
+     *                         may be the string key name for an associative array.
+     * @param mixed $indexKey (Optional.) The column to use as the index/keys for
+     *                        the returned array. This value may be the integer key
+     *                        of the column, or it may be the string key name.
+     * @return array
+     */
+    function array_column($input = null, $columnKey = null, $indexKey = null)
+    {
+        // Using func_get_args() in order to check for proper number of
+        // parameters and trigger errors exactly as the built-in array_column()
+        // does in PHP 5.5.
+        $argc = func_num_args();
+        $params = func_get_args();
+
+        if ($argc < 2) {
+            trigger_error("array_column() expects at least 2 parameters, {$argc} given", E_USER_WARNING);
+            return null;
+        }
+
+        if (!is_array($params[0])) {
+            trigger_error(
+                'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
+                E_USER_WARNING
+            );
+            return null;
+        }
+
+        if (!is_int($params[1])
+            && !is_float($params[1])
+            && !is_string($params[1])
+            && $params[1] !== null
+            && !(is_object($params[1]) && method_exists($params[1], '__toString'))
+        ) {
+            trigger_error('array_column(): The column key should be either a string or an integer', E_USER_WARNING);
+            return false;
+        }
+
+        if (isset($params[2])
+            && !is_int($params[2])
+            && !is_float($params[2])
+            && !is_string($params[2])
+            && !(is_object($params[2]) && method_exists($params[2], '__toString'))
+        ) {
+            trigger_error('array_column(): The index key should be either a string or an integer', E_USER_WARNING);
+            return false;
+        }
+
+        $paramsInput = $params[0];
+        $paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null;
+
+        $paramsIndexKey = null;
+        if (isset($params[2])) {
+            if (is_float($params[2]) || is_int($params[2])) {
+                $paramsIndexKey = (int) $params[2];
+            } else {
+                $paramsIndexKey = (string) $params[2];
+            }
+        }
+
+        $resultArray = array();
+
+        foreach ($paramsInput as $row) {
+            $key = $value = null;
+            $keySet = $valueSet = false;
+
+            if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) {
+                $keySet = true;
+                $key = (string) $row[$paramsIndexKey];
+            }
+
+            if ($paramsColumnKey === null) {
+                $valueSet = true;
+                $value = $row;
+            } elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) {
+                $valueSet = true;
+                $value = $row[$paramsColumnKey];
+            }
+
+            if ($valueSet) {
+                if ($keySet) {
+                    $resultArray[$key] = $value;
+                } else {
+                    $resultArray[] = $value;
+                }
+            }
+
+        }
+
+        return $resultArray;
+    }
+
+}
index 97984a5..113bf55 100644 (file)
@@ -9,7 +9,7 @@
 [<a href='[(#ENV{url}|parametre_url{#ENV{debut},''})]' class='lien_pagination' rel='nofollow'>(#GET{premiere}|>{1}|?{'...',''})</a> [<span class='sep separateur'>(#GET*{separateur})</span>]]
 <BOUCLE_pages(POUR){tableau #GET{pages}}>
 [(#SET{item, #VALEUR|moins{1}|mult{#ENV{pas}} })]
-[(#ENV{url}|parametre_url{#ENV{debut},#GET{item}}|aoustrong{#VALEUR,#VALEUR|=={#ENV{page_courante}},lien_pagination,'',nofollow})]
+[(#ENV{url}|parametre_url{#ENV{debut},#GET{item}}|lien_ou_expose{#VALEUR,#VALEUR|=={#ENV{page_courante}},lien_pagination,'',nofollow})]
 [<span class='sep separateur'>(#VALEUR|<{#GET{derniere}}|?{#GET{separateur}})</span>]
 </BOUCLE_pages>
 [[<span class='sep separateur'>(#GET*{separateur})</span>] <a href='[(#ENV{url}|parametre_url{#ENV{debut},#ENV{nombre_pages}|moins{1}|mult{#ENV{pas}}})]' class='lien_pagination' rel='nofollow'>(#GET{derniere}|<{#ENV{nombre_pages}}|?{'...',''})</a>]
index b430e23..65e2d40 100644 (file)
@@ -1,12 +1,12 @@
 <paquet
        prefix="spip_bonux"
        categorie="outil"
-       version="3.0.6"
+       version="3.3.2"
        etat="stable"
        compatibilite="[3.0.0;3.1.*]"
        logo="img_pack/spip-bonux.png"
-       documentation="http://contrib.spip.net/SPIP-Bonux"
->      
+       documentation="http://contrib.spip.net/Bonux-pour-SPIP3"
+>
 
        <nom>SPIP Bonux</nom>
        <!-- Le plugin qui lave plus SPIP que SPIP, avec des chouettes cadeaux dedans -->
@@ -15,8 +15,8 @@
        <auteur>Matthieu Marcillaud</auteur>
        <auteur>romy.tetue.net</auteur>
 
-       <copyright>2008-2013</copyright>
+       <copyright>2008-2015</copyright>
 
        <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL</licence>
        <pipeline nom="affichage_final" />
-</paquet>
\ No newline at end of file
+</paquet>
index 59bce20..4c2ab18 100644 (file)
@@ -2,12 +2,14 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
  *
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Empile un element dans un tableau declare par #SET{tableau,#ARRAY}
@@ -17,18 +19,19 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * @return Champ
  *     La balise ne retourne rien ("")
 **/
-function balise_SET_PUSH_dist($p){
-       $_nom = interprete_argument_balise(1,$p);
-       $_valeur = interprete_argument_balise(2,$p);
+function balise_SET_PUSH_dist($p) {
+       $_nom = interprete_argument_balise(1, $p);
+       $_valeur = interprete_argument_balise(2, $p);
 
-       if ($_nom AND $_valeur)
+       if ($_nom and $_valeur) {
                // si le tableau n'existe pas encore, on le cree
                // on ajoute la valeur ensuite (sans passer par array_push)
                $p->code = "vide((\$cle=$_nom)
                        . vide((!isset(\$Pile['vars'][\$cle]) OR !is_array(\$Pile['vars'][\$cle]))?\$Pile['vars'][\$cle]=array():'')
                        . vide(\$Pile['vars'][\$cle][]=$_valeur))";
-       else
+       } else {
                $p->code = "''";
+       }
 
        $p->interdire_scripts = false; // la balise ne renvoie rien
        return $p;
@@ -47,19 +50,19 @@ function balise_SET_PUSH_dist($p){
  * @return Champ
  *     La balise ne retourne rien ("")
 **/
-function balise_SET_MERGE_dist($p){
-       $_nom = interprete_argument_balise(1,$p);
-       $_t1 = interprete_argument_balise(2,$p);
-       $_t2 = interprete_argument_balise(3,$p);
+function balise_SET_MERGE_dist($p) {
+       $_nom = interprete_argument_balise(1, $p);
+       $_t1 = interprete_argument_balise(2, $p);
+       $_t2 = interprete_argument_balise(3, $p);
 
-       if ($_nom AND $_t1 AND !$_t2)
+       if ($_nom and $_t1 and !$_t2) {
                // 2 arguments : merge de $_nom et $_t1 dans $_nom
                // si le tableau n'existe pas encore, on le cree
                $p->code = "vide((\$cle=$_nom)
                        . vide((!isset(\$Pile['vars'][\$cle]) OR !is_array(\$Pile['vars'][\$cle]))?\$Pile['vars'][\$cle]=array():'')
                        . vide(is_array(\$new=$_t1)?'':\$new=array(\$new))
                        . vide(\$Pile['vars'][\$cle] = array_merge(\$Pile['vars'][\$cle],\$new)))";
-       elseif ($_nom AND $_t1 AND $_t2)
+       } elseif ($_nom and $_t1 and $_t2) {
                // 3 arguments : merge de $_t1 et $_t2 dans $_nom
                // si le tableau n'existe pas encore, on le cree
                $p->code = "vide((\$cle=$_nom)
@@ -67,8 +70,9 @@ function balise_SET_MERGE_dist($p){
                        . vide(is_array(\$new1=$_t1)?'':\$new1=array(\$new1))
                        . vide(is_array(\$new2=$_t2)?'':\$new2=array(\$new2))
                        . vide(\$Pile['vars'][\$cle] = array_merge(\$new1,\$new2)))";
-       else
+       } else {
                $p->code = "''";
+       }
 
        $p->interdire_scripts = false; // la balise ne renvoie rien
        return $p;
@@ -82,8 +86,9 @@ function balise_SET_MERGE_dist($p){
  */
 function balise_COMPTEUR_dist($p) {
        calculer_balise_criteres('compteur', $p);
-       if ($p->code=="''")
-               calculer_balise_criteres('compteur', $p, "compteur_left");
+       if ($p->code == "''") {
+               calculer_balise_criteres('compteur', $p, 'compteur_left');
+       }
        return $p;
 }
 
@@ -117,20 +122,18 @@ function balise_MAXIMUM_dist($p) {
  */
 function balise_STATS_dist($p) {
        if (isset($p->param[0][2][0])
-       AND $nom = ($p->param[0][2][0]->texte)) {
+               and $nom = ($p->param[0][2][0]->texte)) {
                return calculer_balise_criteres($nom, $p, 'stats');
        }
        return $p;
 }
 
-function calculer_balise_criteres($nom, $p, $motif="") {
+function calculer_balise_criteres($nom, $p, $motif = '') {
        $p->code = "''";
        $motif = $motif ? $motif : $nom;
        if (isset($p->param[0][1][0])
-       AND $champ = ($p->param[0][1][0]->texte)) {
+               and $champ = ($p->param[0][1][0]->texte)) {
                return rindex_pile($p, $nom."_$champ", $motif);
        }
-  return $p;
+       return $p;
 }
-
-?>
index 2fd43e0..d6ce6cf 100644 (file)
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
- * 
+ *
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
- * http://www.spip-contrib.net/Classer-les-articles-par-nombre-de#forum409210
  * Permet de faire un comptage par table liee
- * exemple
- * <BOUCLE1(AUTEURS){compteur articles}{par compteur_articles}>
- * #ID_AUTEUR : #COMPTEUR{articles}
- * </BOUCLE1>
- * pour avoir les auteurs classes par articles et le nombre d'article de chacun
  *
- * @param unknown_type $idb
- * @param unknown_type $boucles
- * @param unknown_type $crit
+ * @syntaxe `{compteur table[, champ]}`
+ * @link http://www.spip-contrib.net/Classer-les-articles-par-nombre-de#forum409210
+ *
+ * @example
+ *     Pour avoir les auteurs classes par articles et
+ *     le nombre d'article de chacun :
+ *
+ *     ```
+ *     <BOUCLE1(AUTEURS){compteur articles}{par compteur_articles}>
+ *     #ID_AUTEUR : #COMPTEUR{articles}
+ *     </BOUCLE1>
+ *     ```
+ *
+ * @note
+ *     Avec un seul argument {compteur autre_table} le groupby est fait
+ *     implicitement sur la cle primaire de la boucle en cours.
+ *     Avec un second argument {compteur autre_table,champ_fusion}
+ *     le groupby est fait sur le champ_fusion"
+ *
+ * @param string $idb
+ *     Identifiant de la boucle
+ * @param Boucle[] $boucles
+ *     AST du squelette
+ * @param Critere $crit
+ *     Paramètres du critère dans cette boucle
+ * @param bool $left
+ *     true pour utiliser un left join plutôt qu'un inner join.
+ * @return void
  */
-function critere_compteur($idb, &$boucles, $crit, $left=false){
+function critere_compteur($idb, &$boucles, $crit, $left = false) {
        $boucle = &$boucles[$idb];
 
-       $_fusion = calculer_liste($crit->param[1], array(), $boucles, $boucle->id_parent);
+       if (isset($crit->param[1])) {
+               $_fusion = calculer_liste($crit->param[1], array(), $boucles, $boucle->id_parent);
+       } else {
+               $_fusion = "''";
+       }
        $params = $crit->param;
        $table = reset($params);
        $table = $table[0]->texte;
        $op = false;
-       if(preg_match(',^(\w+)([<>=])([0-9]+)$,',$table,$r)){
+       if (preg_match(',^(\w+)([<>=])([0-9]+)$,', $table, $r)) {
                $table=$r[1];
-               if (count($r)>=3) $op=$r[2];
-               if (count($r)>=4) $op_val=$r[3];
+               if (count($r)>=3) {
+                       $op=$r[2];
+               }
+               if (count($r)>=4) {
+                       $op_val=$r[3];
+               }
        }
        $type = objet_type($table);
        $type_id = id_table_objet($type);
-       
+
        /**
         * Si la clé primaire est une clé multiple, on prend la première partie
         * Utile pour compter les versions de spip_versions par exemple
         */
-       if(count($types = explode(',',$type_id)) > 1)
+       if (count($types = explode(',', $type_id)) > 1) {
                $type_id = $types[0];
+       }
        $table_sql = table_objet_sql($type);
 
-       $trouver_table = charger_fonction('trouver_table','base');
+       $trouver_table = charger_fonction('trouver_table', 'base');
        $arrivee = array($table, $trouver_table($table, $boucle->sql_serveur));
        $depart = array($boucle->id_table,$trouver_table($boucle->id_table, $boucle->sql_serveur));
 
        // noter les jointures deja installees
        $joins = array_keys($boucle->from);
-       if ($compt = calculer_jointure($boucle,$depart,$arrivee)){
-               if ($_fusion!="''"){
+       if ($compt = calculer_jointure($boucle, $depart, $arrivee)) {
+               if ($_fusion!="''") {
                        // en cas de jointure, on ne veut pas du group_by sur la cle primaire !
                        // cela casse le compteur !
-                       foreach($boucle->group as $k=>$group)
-                               if ($group == $boucle->id_table.'.'.$boucle->primary)
+                       foreach ($boucle->group as $k => $group) {
+                               if ($group == $boucle->id_table.'.'.$boucle->primary) {
                                        unset($boucle->group[$k]);
+                               }
+                       }
                        $boucle->group[] = '".($gb='.$_fusion.')."';
                }
 
-               $boucle->select[]= "COUNT($compt.$type_id) AS compteur_$table"; 
-               if ($op)
+               $boucle->select[]= "COUNT($compt.$type_id) AS compteur_$table";
+               if ($op) {
                        $boucle->having[]= array("'".$op."'", "'compteur_".$table."'",$op_val);
-               if ($left){
-                       foreach($boucle->from as $k=>$val){
-                               if (!in_array($k, $joins)){
+               }
+               if ($left) {
+                       foreach ($boucle->from as $k => $val) {
+                               if (!in_array($k, $joins)) {
                                        $boucle->from_type[$k] = 'left';
                                }
                        }
@@ -82,37 +115,37 @@ function critere_compteur($idb, &$boucles, $crit, $left=false){
  * @param <type> $boucles
  * @param <type> $crit
  */
-function critere_compteur_left($idb, &$boucles, $crit){
+function critere_compteur_left($idb, &$boucles, $crit) {
        critere_compteur($idb, $boucles, $crit, true);
 }
 
 /**  Critere {somme champ} #SOMME{champ} */
-function critere_somme($idb, &$boucles, $crit){
+function critere_somme($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array('SUM'=>'somme'), $idb, $boucles, $crit);
 }
 
 /**  Critere {compte champ} #COMPTE{champ} */
-function critere_compte($idb, &$boucles, $crit){
+function critere_compte($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array('COUNT'=>'compte'), $idb, $boucles, $crit);
 }
 
 /**  Critere {moyenne champ} #MOYENNE{champ} */
-function critere_moyenne($idb, &$boucles, $crit){
+function critere_moyenne($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array('AVG'=>'moyenne'), $idb, $boucles, $crit);
 }
 
 /**  Critere {minimum champ} #MINIMUM{champ} */
-function critere_minimum($idb, &$boucles, $crit){
+function critere_minimum($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array('MIN'=>'minimum'), $idb, $boucles, $crit);
 }
 
 /**  Critere {maximum champ} #MAXIMUM{champ} */
-function critere_maximum($idb, &$boucles, $crit){
+function critere_maximum($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array('MAX'=>'maximum'), $idb, $boucles, $crit);
 }
 
 /**  Critere {stats champ} calcul la totale : somme, compte, minimum, moyenne, maximum */
-function critere_stats($idb, &$boucles, $crit){
+function critere_stats($idb, &$boucles, $crit) {
        calcul_critere_fonctions(array(
                'SUM'=>'somme',
                'COUNT'=>'compte',
@@ -131,17 +164,18 @@ function calcul_critere_fonctions($func, $idb, &$boucles, $crit) {
        $champ = $champ[0]->texte;
 
        // option DISTINCT {compte DISTINCT(id_article) }
-       $filter="";
+       $filter = '';
        if (preg_match('/^([a-zA-Z]+)\(\s*([a-zA-Z_]+)\s*\)$/', trim($champ), $r)) {
                $filter = $r[1]; // DISTINCT
                $champ = $r[2]; // id_article
        }
-       
+
        $sel = $filter ? "$filter($champ)" : $champ;
        foreach ($func as $f => $as) {
                $boucle->select[]= "$f($sel) AS $as" . "_$champ";
        }
 }
 
-
-?>
+function critere_fusion_supprimer_dist($idb, &$boucles, $crit){
+       $boucles[$idb]->group = array();
+}
index c3b7411..d383bbe 100644 (file)
@@ -2,12 +2,15 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
- * 
+ *
  */
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
 include_spip('public/spip_bonux_criteres');
 include_spip('public/spip_bonux_balises');
 
@@ -19,27 +22,112 @@ include_spip('public/spip_bonux_balises');
  * @param string $class
  * @return string
  */
-function tag_img($img,$alt="",$class=""){
+function tag_img($img, $alt = '', $class = '') {
        $balise_img = chercher_filtre('balise_img');
-       return $balise_img($img,$alt,$class);
+
+       return $balise_img($img, $alt, $class);
 }
 
-function previsu_verifier_cle_temporaire($cle){
+function previsu_verifier_cle_temporaire($cle) {
        $validite = 12; // validite de 12h maxi
        $old = 0;
+
        do {
-               $date = date('Y-m-d H',strtotime("-$old hour"));
-               if ($cle==previsu_cle_temporaire($date))
+               $date = date('Y-m-d H', strtotime("-$old hour"));
+               if ($cle == previsu_cle_temporaire($date)) {
                        return true;
-       } while ($old++<$validite);
+               }
+       } while ($old++ < $validite);
+
        return false;
 }
-function previsu_cle_temporaire($date=null){
+
+function previsu_cle_temporaire($date = null) {
        include_spip('inc/securiser_action');
-       if (!$date) $date = date('Y-m-d H');
+
+       if (!$date) {
+               $date = date('Y-m-d H');
+       }
+
        $url = self();
        $cle = md5($url.$date.secret_du_site());
+
        return $cle;
 }
 
-?>
+if (!function_exists('push_table_valeur')) {
+/**
+ * Filtre ajoutant une valeur à la fin d'une liste, possiblement dans une clé d'un tableau (comme table_valeur()).
+ *
+ * Attention, cette fonction est bien un "push", c'est-à-dire qu'elle ajoute un élément à la fin d'une liste.
+ *
+ * #TABLEAU|push_table_valeur{a/b/c, valeur, #CONDITION}
+ * - si la clé "c" est une liste : on ajoute "valeur" à la fin
+ * - si la clé "c" n'existe pas : on crée une liste et on met la première valeur dedans
+ * - si la clé "c" est un scalaire : on ne fait rien
+ * - si les clés autres que la dernière n'existent pas : on en fait des tableaux en cascade
+ *
+ * @see table_valeur
+ * @filtre
+ * @param array|object|string $table
+ *     Table ou objet dont on veut modifier ou augmenter une des clés/propriétés. Peut être une chaîne à désérialiser contenant ce tableau ou cet objet.
+ * @param string $chemin
+ *     Une suite de clés ou de propriétés d'objet, séparées par le caractère "/" : un/element/ici
+ * @param mixed $valeur
+ *     Une valeur à ajouter au paramètre précédent.
+ * @param mixed $condition=true
+ *     Une valeur quelconque qui sera testée de manière booléenne pour savoir si on fait le traitement ou pas.
+ *     Cela allège l'écriture si l'ajout de valeur ne doit se faire que sous condition, notamment que s'il y a une valeur à ajouter.
+ * @param string $cle_finale
+ *     Une clé dans laquelle placer la valeur si précisée
+ * @return array|object
+ *     Retourne le tableau ou l'objet initial, modifié suivant les paramètres.
+ */
+function push_table_valeur($table, $chemin, $valeur, $condition = true, $cle_finale = false) {
+       // Si la condition est fausse, on ne fait rien du tout
+       if ($condition) {
+               $table = is_string($table) ? @unserialize($table) : $table;
+               $element_a_modifier =& $table;
+
+               // S'il y a un emplacement donné, on cherche si c'est un tableau
+               if ($chemin and is_string($chemin) and $chemin = explode('/', $chemin) and is_array($chemin)) {
+                       $i = 0;
+                       foreach ($chemin as $cle) {
+                               $i += 1;
+                               // On ne fait que s'il la clé vaut quelque chose
+                               if ($cle !== '') {
+                                       // Si c'est un tableau, on vérifie si la clé existe
+                                       if (is_array($element_a_modifier)) {
+                                               // Si la clé n'existe pas : on met un tableau vide qui se remplira
+                                               if (!isset($element_a_modifier[$cle])) {
+                                                       $element_a_modifier[$cle] = array();
+                                               }
+                                               $element_a_modifier =& $element_a_modifier[$cle];
+                                       } elseif (is_object($element_a_modifier)) {
+                                               // Si c'est un objet on vérifie si la propriété existe
+                                               // Si la propriété n'existe pas : on met un tableau vide qui se remplira
+                                               if (!isset($element_a_modifier->$cle)) {
+                                                       $element_a_modifier->$cle = array();
+                                               }
+                                               $element_a_modifier =& $element_a_modifier->$cle;
+                                       }
+                               }
+                       }
+               }
+
+               // Maintenant on est au bon endroit de ce qu'on veut modifier :
+
+               // Si l'élément à modifier est bien un tableau : on push la valeur dedans
+               if (is_array($element_a_modifier)) {
+                       if ($cle_finale and is_string($cle_finale)) {
+                               $element_a_modifier[$cle_finale] = $valeur;
+                       } else {
+                               array_push($element_a_modifier, $valeur);
+                       }
+               }
+               // Sinon (si c'est un scalaire) on ne fait rien et il faudra utiliser set_table_valeur() par exemple
+       }
+
+       return $table;
+}
+}
index c72b079..a2b9dee 100644 (file)
@@ -2,45 +2,49 @@
 /**
  * Plugin Spip-Bonux
  * Le plugin qui lave plus SPIP que SPIP
- * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Tetue
  * Licence GPL
- * 
+ *
  */
 
+// On inclu une bonne fois pour toutes array_column
+include_spip('lib/array_column/array_column');
+
 if (_request('var_mode')=='preview'
-  AND $cle = _request('var_relecture')){
-       include_spip("spip_bonux_fonctions");
-       if (previsu_verifier_cle_temporaire($cle)){
-               include_spip("inc/autoriser");
-               autoriser_exception('previsualiser','',0);
-               define('_VAR_PREVIEW_EXCEPTION',true);
+       and $cle = _request('var_relecture')) {
+       include_spip('spip_bonux_fonctions');
+       if (previsu_verifier_cle_temporaire($cle)) {
+               include_spip('inc/autoriser');
+               autoriser_exception('previsualiser', '', 0);
+               define('_VAR_PREVIEW_EXCEPTION', true);
        }
 }
 
-function spip_bonux_affichage_final($flux){
-       if (defined('_VAR_PREVIEW') AND _VAR_PREVIEW){
-               $p = stripos($flux,"</body>");
-               $url_relecture = parametre_url(self(),'var_mode','preview','&');
-               $js = "";
-               if (!defined('_VAR_PREVIEW_EXCEPTION')){
-                       $url_relecture = parametre_url($url_relecture,'var_relecture',previsu_cle_temporaire(),'&');
-                       $label = "Relecture temporaire";
-               }
-               else {
+function spip_bonux_affichage_final($flux) {
+       if (defined('_VAR_PREVIEW') and _VAR_PREVIEW) {
+               $p = stripos($flux, '</body>');
+               $url_relecture = parametre_url(self(), 'var_mode', 'preview', '&');
+               $js = '';
+               if (!defined('_VAR_PREVIEW_EXCEPTION')) {
+                       $url_relecture = parametre_url($url_relecture, 'var_relecture', previsu_cle_temporaire(), '&');
+                       $label = 'Relecture temporaire';
+               } else {
                        $label = _T('previsualisation');
                        $js = "jQuery('.spip-previsu').html('Relecture temporaire');";
                }
                $js .= "jQuery('#spip-admin').append('<a class=\"spip-admin-boutons review_link\" href=\"$url_relecture\">$label</a>');";
                $js = "jQuery(function(){ $js });";
                $js = "<script>$js</script>";
-               $flux = substr_replace($flux,$js,$p,0);
+               $flux = substr_replace($flux, $js, $p, 0);
        }
        return $flux;
 }
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
- /**
+/**
  * une fonction qui regarde si $texte est une chaine de langue
  * de la forme <:qqch:>
  * si oui applique _T()
@@ -51,37 +55,34 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  * @return unknown_type Retourne la valeur éventuellement modifiée.
  */
 if (!function_exists('_T_ou_typo')) {
-function _T_ou_typo($valeur, $mode_typo='toujours') {
-       
+function _T_ou_typo($valeur, $mode_typo = 'toujours') {
+
        // Si la valeur est bien une chaine (et pas non plus un entier déguisé)
-       if (is_string($valeur) and !intval($valeur)){
+       if (is_string($valeur) and !intval($valeur)) {
                // Si la chaine est du type <:truc:> on passe à _T()
-               if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) 
+               if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) {
                        $valeur = _T($match[1]);
-               // Sinon on la passe a typo()
-               else {
-                       if (!in_array($mode_typo, array('toujours', 'multi', 'jamais')))
+               } else {
+                       // Sinon on la passe a typo()
+                       if (!in_array($mode_typo, array('toujours', 'multi', 'jamais'))) {
                                $mode_typo = 'toujours';
-                       
-                       if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '<multi>') !== false)){
+                       }
+                       if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '<multi>') !== false)) {
                                include_spip('inc/texte');
                                $valeur = typo($valeur);
                        }
                }
-       }
-       // Si c'est un tableau, on reapplique la fonction récursivement
-       elseif (is_array($valeur)){
-               foreach ($valeur as $cle => $valeur2){
+       } elseif (is_array($valeur)) {
+               // Si c'est un tableau, on reapplique la fonction récursivement
+               foreach ($valeur as $cle => $valeur2) {
                        $valeur[$cle] = _T_ou_typo($valeur2, $mode_typo);
                }
        }
-
        return $valeur;
-
 }
 }
 
-/*
+/**
  * Insère toutes les valeurs du tableau $arr2 après (ou avant) $cle dans le tableau $arr1.
  * Si $cle n'est pas trouvé, les valeurs de $arr2 seront ajoutés à la fin de $arr1.
  *
@@ -96,13 +97,12 @@ function _T_ou_typo($valeur, $mode_typo='toujours') {
  * @return array Retourne le tableau avec l'insertion
  */
 if (!function_exists('spip_array_insert')) {
-function spip_array_insert($arr1, $cle, $arr2, $avant=false){
+function spip_array_insert($arr1, $cle, $arr2, $avant = false) {
        $index = array_search($cle, array_keys($arr1));
-       if($index === false){
+       if ($index === false) {
                $index = count($arr1); // insert @ end of array if $key not found
-       }
-       else {
-               if(!$avant){
+       } else {
+               if (!$avant) {
                        $index++;
                }
        }
@@ -115,16 +115,18 @@ function spip_array_insert($arr1, $cle, $arr2, $avant=false){
  * Une fonction extrêmement pratique, mais qui n'est disponible qu'à partir de PHP 5.3 !
  * cf. http://www.php.net/manual/fr/function.array-replace-recursive.php
  */
-if (!function_exists('array_replace_recursive')){
-       function array_replace_recursive($array, $array1){
-               function recurse($array, $array1){
-                       foreach ($array1 as $key => $value){
+if (!function_exists('array_replace_recursive')) {
+       function array_replace_recursive($array, $array1) {
+               function recurse($array, $array1) {
+                       foreach ($array1 as $key => $value) {
                                // create new key in $array, if it is empty or not an array
-                               if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
+                               if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) {
                                        $array[$key] = array();
+                               }
                                // overwrite the value in the base array
-                               if (is_array($value))
+                               if (is_array($value)) {
                                        $value = recurse($array[$key], $value);
+                               }
                                $array[$key] = $value;
                        }
                        return $array;
@@ -133,16 +135,124 @@ if (!function_exists('array_replace_recursive')){
                // handle the arguments, merge one by one
                $args = func_get_args();
                $array = $args[0];
-               if (!is_array($array))
+               if (!is_array($array)) {
                        return $array;
-               
-               for ($i = 1; $i < count($args); $i++)
-                       if (is_array($args[$i]))
+               }
+
+               for ($i = 1; $i < count($args); $i++) {
+                       if (is_array($args[$i])) {
                                $array = recurse($array, $args[$i]);
-               
+                       }
+               }
                return $array;
        }
 }
 
+if (!function_exists('text_truncate')) {
+/**
+* Truncates text.
+*
+* Cuts a string to the length of $length and replaces the last characters
+* with the ending if the text is longer than length.
+*
+* ### Options:
+*
+* - `ending` Will be used as Ending and appended to the trimmed string
+* - `exact` If false, $text will not be cut mid-word
+* - `html` If true, HTML tags would be handled correctly
+*
+* @param string  $text String to truncate.
+* @param integer $length Length of returned string, including ellipsis.
+* @param array $options An array of html attributes and options.
+* @return string Trimmed string.
+* @access public
+* @link http://book.cakephp.org/view/1469/Text#truncate-1625
+*/
+function text_truncate($text, $length = 100, $options = array()) {
+       $default = array(
+               'ending' => '...', 'exact' => true, 'html' => false
+       );
+       $options = array_merge($default, $options);
+       extract($options);
+
+       if ($html) {
+               if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
+                       return $text;
+               }
+               $totalLength = mb_strlen(strip_tags($ending));
+               $openTags = array();
+               $truncate = '';
+
+               preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);
+               foreach ($tags as $tag) {
+                       if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {
+                               if (preg_match('/<[\w]+[^>]*>/s', $tag[0])) {
+                                       array_unshift($openTags, $tag[2]);
+                               } else if (preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag)) {
+                                       $pos = array_search($closeTag[1], $openTags);
+                                       if ($pos !== false) {
+                                               array_splice($openTags, $pos, 1);
+                                       }
+                               }
+                       }
+                       $truncate .= $tag[1];
+
+                       $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));
+                       if ($contentLength + $totalLength > $length) {
+                               $left = $length - $totalLength;
+                               $entitiesLength = 0;
+                               if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {
+                                       foreach ($entities[0] as $entity) {
+                                               if ($entity[1] + 1 - $entitiesLength <= $left) {
+                                                       $left--;
+                                                       $entitiesLength += mb_strlen($entity[0]);
+                                               } else {
+                                                       break;
+                                               }
+                                       }
+                               }
+                               $truncate .= mb_substr($tag[3], 0, $left + $entitiesLength);
+                               break;
+                       } else {
+                               $truncate .= $tag[3];
+                               $totalLength += $contentLength;
+                       }
+                       if ($totalLength >= $length) {
+                               break;
+                       }
+               }
+       } else {
+               if (mb_strlen($text) <= $length) {
+                       return $text;
+               } else {
+                       $truncate = mb_substr($text, 0, $length - mb_strlen($ending));
+               }
+       }
+       if (!$exact) {
+               $spacepos = mb_strrpos($truncate, ' ');
+               if (isset($spacepos)) {
+                       if ($html) {
+                               $bits = mb_substr($truncate, $spacepos);
+                               preg_match_all('/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);
+                               if (!empty($droppedTags)) {
+                                       foreach ($droppedTags as $closingTag) {
+                                               if (!in_array($closingTag[1], $openTags)) {
+                                                       array_unshift($openTags, $closingTag[1]);
+                                               }
+                                       }
+                               }
+                       }
+                       $truncate = mb_substr($truncate, 0, $spacepos);
+               }
+       }
+       $truncate .= $ending;
+
+       if ($html) {
+               foreach ($openTags as $tag) {
+                       $truncate .= '</'.$tag.'>';
+               }
+       }
 
-?>
+       return $truncate;
+}
+}
index 2456049..e96e098 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/spip-bonux-3
-Revision: 84222
-Dernier commit: 2014-08-17 14:44:00 +0200 
+Revision: 98598
+Dernier commit: 2016-06-29 17:04:02 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/spip-bonux-3</origine>
-<revision>84222</revision>
-<commit>2014-08-17 14:44:00 +0200 </commit>
+<revision>98598</revision>
+<commit>2016-06-29 17:04:02 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index eaee532..3fb8cf7 100644 (file)
@@ -22,12 +22,16 @@ function balise_PIWIK_dyn() {
                include_spip('inc/config');
        $config = lire_config('piwik',array());
        if(!empty($config['urlpiwik']) && is_numeric($config['idpiwik']) && ($config['mode_insertion'] == 'balise')){
-               if(@in_array($GLOBALS['visiteur_session']['statut'],lire_config('piwik/restreindre_statut_public',array()))||@in_array($GLOBALS['visiteur_session']['id_auteur'],lire_config('piwik/restreindre_auteurs_public',array()))){
+               if(
+                       (isset($GLOBALS['visiteur_session']['statut']) && in_array($GLOBALS['visiteur_session']['statut'],lire_config('piwik/restreindre_statut_public',array())))
+                       ||(isset($GLOBALS['visiteur_session']['id_auteur']) && in_array($GLOBALS['visiteur_session']['id_auteur'],lire_config('piwik/restreindre_auteurs_public',array())))){
                        return;
                }
-               $piwik_ips = array_flip(preg_split('/(\s*[;,]\s*|\s+)/',trim($config['exclure_ips']),-1,PREG_SPLIT_NO_EMPTY));
-               if (isset($piwik_ips[$GLOBALS['ip']])) {
-                       return;
+               if(isset($config['exclure_ips'])){
+                       $piwik_ips = array_flip(preg_split('/(\s*[;,]\s*|\s+)/',trim($config['exclure_ips']),-1,PREG_SPLIT_NO_EMPTY));
+                       if (isset($piwik_ips[$GLOBALS['ip']])) {
+                               return;
+                       }
                }
                return array(
                'prive/piwik',
index 3987d36..6091646 100644 (file)
@@ -1,4 +1,7 @@
-<traduction module="paquet-piwik" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/spip_piwik_2_0/lang/" reference="fr">
+<traduction module="paquet-piwik" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=de" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=en" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
        <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=es" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
diff --git a/www/plugins/spip_piwik_2_0/lang/paquet-piwik_de.php b/www/plugins/spip_piwik_2_0/lang/paquet-piwik_de.php
new file mode 100644 (file)
index 0000000..3b4556a
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // P
+       'piwik_description' => 'Fügt den Webseiten das Statistiktool (Website Traffic Analyse) PIWIK hinzu.',
+       'piwik_slogan' => 'SPIP-Schnittstelle mit PIWIK'
+);
index b7564ec..9e43dfd 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Adds the Piwik statistics script (web traffic analyzer) on the pages of the site.',
        'piwik_slogan' => 'Link [SPIP->http://www.spip.net] and [Piwik->http://www.piwik.org]'
 );
-
-?>
index bd240e2..373af57 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Añade el script de estadísticas Piwik (analizador de tráfico web) en las páginas del sitio web.',
        'piwik_slogan' => 'Conectar Spip y Piwik'
 );
-
-?>
index ee78176..0463277 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'افزودن نويسه‌ي آماري پيويك (تحليلگر ترافيك وب)(Piwik) روي صفحه‌هاي سايت ',
        'piwik_slogan' => 'پيوند [اسپيپ->http://www.spip.net] و [پيويك->http://www.piwik.org]'
 );
-
-?>
index 79d9c02..002b582 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/spip_piwik/spip_piwik_2_0/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Ajoute le script de statistiques Piwik (analyseur de trafic web) sur les pages du site.',
        'piwik_slogan' => 'Interfacer Spip et Piwik'
 );
-
-?>
index 0e4c927..51ba83d 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Voeg het script voor statistieken van Piwik (analyse van webverkeer) toe aan de bladzijdes van de site.',
        'piwik_slogan' => 'Koppel SPIP en Piwik'
 );
-
-?>
index ca346af..be8fbf0 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Добавляет код системы веб-аналитики Piwik на все страницы сайта.',
        'piwik_slogan' => 'Объединяет [SPIP->http://www.spip.net] и [Piwik->http://www.piwik.org]'
 );
-
-?>
index 60df298..1c5f6e6 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-piwik?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'piwik_description' => 'Na stránky webu pridá skript so štatistikami Piwik (analyzátor návštevnosti webu).',
        'piwik_slogan' => 'Rozhranie Spip a Piwik'
 );
-
-?>
index 710b738..0380331 100644 (file)
@@ -1,7 +1,8 @@
-<traduction module="piwik" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/spip_piwik_2_0/lang/" reference="fr">
+<traduction module="piwik" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0/lang/" reference="fr">
        <langue code="ca" url="http://trad.spip.net/tradlang_module/piwik?lang_cible=ca" total="37" traduits="28" relire="0" modifs="0" nouveaux="9" pourcent="75.68">
        </langue>
-       <langue code="de" url="http://trad.spip.net/tradlang_module/piwik?lang_cible=de" total="37" traduits="28" relire="0" modifs="0" nouveaux="9" pourcent="75.68">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/piwik?lang_cible=de" total="37" traduits="37" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
        </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/piwik?lang_cible=en" total="37" traduits="37" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
index b18ecdb..2139618 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=ca
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -49,5 +51,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Nom d’usuari',
        'textes_url_piwik' => 'El vostre servidor piwik'
 );
-
-?>
index e2f7166..70f40eb 100644 (file)
@@ -3,35 +3,48 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // A
        'action_creer_site' => 'Site anlegen',
+       'action_recuperer_liste' => 'Liste der Websites abrufen',
 
        // C
        'cfg_description_piwik' => 'Hier können sie ihre PIWIK-Anmeldedaten sowie die Adresse des Servers für ihre Statistiken angeben.',
        'cfg_erreur_recuperation_data' => 'Kommunikation mit dem Server gescheitert, bitte überprüfen sie die Adresse und das Token.',
        'cfg_erreur_token' => 'Ihre Token-ID ist ungültig.',
+       'cfg_erreur_user_token' => 'Bneutzername und Token stimmen nicht überein',
 
        // E
        'explication_adresse_serveur' => 'Geben sie die Adresse ohne "http://" oder "https://" und ohne Slash "/" am Ende an.',
+       'explication_conformite_cnil' => 'Fügt eine <a href="http://www.cnil.fr/fileadmin/documents/approfondir/dossier/internet/Configuration_piwik.pdf">Javascript-Funktion</a> hinzu, mit der die <a href="http://www.cnil.fr/vos-obligations/sites-web-cookies-et-autres-traceurs/outils-et-codes-sources/la-mesure-daudience/"> CNIL-Regeln </a> zu Cookies umgesetzt werden.',
        'explication_creer_site' => 'Mit diesem Link können sie auf dem PIWIK-Server eine Site anlegen, welche dann in der Liste angezeigt wird. Bitte prüfen sie, ob sie den Namen und die Adresse ihrer SPIP-Website richtig eingetragen haben, denn diese Daten werden an PIWIK übertragen.',
        'explication_exclure_ips' => 'Um mehrere Adressen auszuschließen, trennen sie sie bitte mit einem Semikolon.',
        'explication_identifiant_site' => 'Die Liste der auf dem PIWIK-Server verfügbaren Websites wurde aufgrund der angegebenen Informationen übertragen. Bitte wählen sie in der untenstehenden Liste die gewünschte Site aus.',
-       'explication_mode_insertion' => 'Es gibt zwei Methoden, den für das Funktionieren des Plugins erforderlichen Code in die Seiten einzufügen: Mit der Pipeline "indert_head" (vollautomatisch aber ohne erweiterte Konfigurationsmöglichkeiten) oder durch Einfügen des Tags #PIWIK in den Fußbereich ihrer Skelette (dann können sie alle Konfigurationsoptionen nutzen).',
+       'explication_mode_insertion' => 'Es gibt zwei Methoden, den für das Funktionieren des Plugins erforderlichen Code in die Seiten einzufügen: Mit der Pipeline "insert_head" (vollautomatisch aber ohne erweiterte Konfigurationsmöglichkeiten) oder durch Einfügen des Tags #PIWIK in den Fußbereich ihrer Skelette (dann können sie alle Konfigurationsoptionen nutzen).',
+       'explication_recuperer_liste' => 'Mit dem folgenden Link kann eine Liste der Websites abgerufen werden, die mit Ihrem Konto auf dem PIWIK-Server verwaltet werden können.',
        'explication_restreindre_statut_prive' => 'Wählen sie hier den Status der Besucher, deren Zugriffe auf das Redaktionssystem nicht in der Statistik erfaßt werden',
        'explication_restreindre_statut_public' => 'Wählen sie hier den Status der Besucher, deren Zugriffe auf den öffentlichen Teil der Website nicht in der Statistik erfaßt werden',
        'explication_token' => 'Das Identifikations-Token finden sie in ihren persönlichen Einstellungen oder im API-Bereich ihres PIWIK-Servers.',
 
+       // I
+       'info_aucun_site_compte' => 'Ihrem PIWIK-Konto sind keine Websites zugeordnet.',
+       'info_aucun_site_compte_demander_admin' => 'Sie müssen einen Administrator des PIWIK-Servers bitten, Ihrem Konto eine Website hinzuzufügen.',
+
        // L
        'label_adresse_serveur' => 'Adresse (URL) des Servers (https:// oder http://)',
        'label_comptabiliser_prive' => 'Abrufe des Redaktionssystems erfassen',
+       'label_conformite_cnil' => 'CNIL-Regeln',
        'label_creer_site' => 'Eine Site auf dem Piwik-Server anlegen',
        'label_exclure_ips' => 'Bestimmte IP-Adressen ausschließen',
        'label_identifiant_site' => 'ID ihrer Website auf dem Piwik-Server',
        'label_mode_insertion' => 'Typ des Einfügens in die öffentlichen Seiten',
+       'label_piwik_user' => 'PIWIK Benutzerkonto',
+       'label_recuperer_liste' => 'Website-Liste vom PIWIK-Server abrufen',
        'label_restreindre_auteurs_prive' => 'Einschränkungen für manche angemeldeten Besucher (Redaktion)',
        'label_restreindre_auteurs_public' => 'Einschränkungen für manche angemeldeten Besucher (öffentlicher Bereich)',
        'label_restreindre_statut_prive' => 'Einschränkungen für manche Mitglieder im Redaktionssystem',
@@ -49,5 +62,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Ihre ID',
        'textes_url_piwik' => 'Ihr Piwik-Server'
 );
-
-?>
index e1de0a4..95862b6 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -60,5 +62,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Your identifier',
        'textes_url_piwik' => 'Your piwik server'
 );
-
-?>
index 4f7f712..4523ccb 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -58,5 +60,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Su identificador',
        'textes_url_piwik' => 'Su servidor Piwik'
 );
-
-?>
index 4568b31..ed35563 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -58,5 +60,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'شناسه‌ي شما',
        'textes_url_piwik' => 'ميزبان پي‌ويك شما'
 );
-
-?>
index 685ddfb..ade033c 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/spip_piwik/spip_piwik_2_0/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+// Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0/lang/
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -58,5 +60,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Votre identifiant',
        'textes_url_piwik' => 'Votre serveur piwik'
 );
-
-?>
index 2016de5..059d3fc 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -58,5 +60,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Ton identifiant',
        'textes_url_piwik' => 'Ton serveur piwik'
 );
-
-?>
index d4d288c..0c5c6ed 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -60,5 +62,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Je identificatie',
        'textes_url_piwik' => 'Je Piwik server'
 );
-
-?>
index f7b5d4e..c519adc 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/piwik?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -60,5 +62,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'texte_votre_identifiant' => 'Váš identifikátor',
        'textes_url_piwik' => 'Váš server pre piwik'
 );
-
-?>
index 9bdae39..f5d442c 100644 (file)
@@ -1,13 +1,13 @@
 <paquet
        prefix="piwik"
        categorie="statistique"
-       version="0.6.2"
+       version="0.8.0"
        etat="stable"
-       compatibilite="[2.0.8;3.0.*]"
+       compatibilite="[2.0.8;3.1.*]"
        logo="piwik.png"
        schema="0.1"
        documentation="http://contrib.spip.net/?article2860"
->      
+>
 
        <nom>Piwik</nom>
        <!-- Interfacer Spip et Piwik -->
index 137bc17..78f0008 100644 (file)
@@ -2,7 +2,7 @@
        <nom>Piwik</nom>\r
        <slogan>Interfacer Spip et Piwik</slogan>\r
        <auteur>jsb, kent1</auteur>\r
-       <version>0.6.2</version>\r
+       <version>0.8.0</version>\r
        <licence>GNU/GPL</licence>\r
        <etat>stable</etat>\r
        <version_base>0.1</version_base>\r
                <nom>header_prive</nom>\r
                <inclure>piwik_pipelines.php</inclure>\r
        </pipeline>\r
-       <necessite id="SPIP" version="[2.0.8;3.0.99]" />\r
+       <necessite id="SPIP" version="[2.0.8;3.1.99]" />\r
        <necessite id='cfg' version='[1.13.0;]' />\r
        <necessite id='saisies' version='[1.1;]' />\r
        <necessite id='spip_bonux' version='[1.8;]' />\r
        <categorie>statistique</categorie>\r
        <traduire gestionnaire="salvatore" module="piwik" reference="fr" />\r
-</plugin>
\ No newline at end of file
+</plugin>\r
index 2cb81b3..413f995 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
-Origine: file:///home/svn/repository/spip-zone/_plugins_/spip_piwik/spip_piwik_2_0
-Revision: 84614
-Dernier commit: 2014-09-14 23:33:31 +0200 
+Origine: file:///home/svn/repository/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0
+Revision: 97469
+Dernier commit: 2016-05-07 22:05:10 +0200 
 </text_version>
-<origine>file:///home/svn/repository/spip-zone/_plugins_/spip_piwik/spip_piwik_2_0</origine>
-<revision>84614</revision>
-<commit>2014-09-14 23:33:31 +0200 </commit>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/spip_piwik/branches/spip_piwik_2_0</origine>
+<revision>97469</revision>
+<commit>2016-05-07 22:05:10 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 79d7ab5..26dc98e 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/verifier');
 include_spip('inc/saisies');
@@ -9,17 +11,17 @@ include_spip('inc/saisies');
 /*
  * Génère une page d'aide listant toutes les saisies et leurs options
  */
-function verifier_generer_aide(){
+function verifier_generer_aide() {
        // On a déjà la liste par saisie
        $verifications = verifier_lister_disponibles();
-       
+
        // On construit une liste par options
        $options = array();
-       foreach ($verifications as $type_verif=>$verification){
+       foreach ($verifications as $type_verif => $verification) {
                $options_verification = saisies_lister_par_nom($verification['options'], false);
-               foreach ($options_verification as $nom=>$option){
+               foreach ($options_verification as $nom => $option) {
                        // Si l'option n'existe pas encore
-                       if (!isset($options[$nom])){
+                       if (!isset($options[$nom])) {
                                $options[$nom] = _T_ou_typo($option['options']);
                        }
                        // On ajoute toujours par qui c'est utilisé
@@ -29,11 +31,9 @@ function verifier_generer_aide(){
                $verifications[$type_verif]['options'] = $options_verification;
        }
        ksort($options);
-       
+
        return array(
                'verifications' => $verifications,
                'options' => $options
        );
 }
-
-?>
index 815579d..351968c 100644 (file)
Binary files a/www/plugins/verifier/images/verifier-128.png and b/www/plugins/verifier/images/verifier-128.png differ
index 8b4a05f..ae8c749 100644 (file)
-<?php\r
-/**\r
- * To validate an email address according to RFCs 5321, 5322 and others\r
- * \r
- * Copyright © 2008-2011, Dominic Sayers                                      <br>\r
- * Test schema documentation Copyright © 2011, Daniel Marschall                       <br>\r
- * All rights reserved.\r
- * \r
- * Redistribution and use in source and binary forms, with or without modification,\r
- * are permitted provided that the following conditions are met:\r
- * \r
- *     - Redistributions of source code must retain the above copyright notice,\r
- *       this list of conditions and the following disclaimer.\r
- *     - Redistributions in binary form must reproduce the above copyright notice,\r
- *       this list of conditions and the following disclaimer in the documentation\r
- *       and/or other materials provided with the distribution.\r
- *     - Neither the name of Dominic Sayers nor the names of its contributors may be\r
- *       used to endorse or promote products derived from this software without\r
- *       specific prior written permission.\r
- * \r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\r
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\r
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- * \r
- * @package    is_email\r
- * @author     Dominic Sayers <dominic@sayers.cc>\r
- * @copyright  2008-2011 Dominic Sayers\r
- * @license    http://www.opensource.org/licenses/bsd-license.php BSD License\r
- * @link       http://www.dominicsayers.com/isemail\r
- * @version    3.01.1 - Fixed examples and readme.txt\r
- */\r
-\r
-// The quality of this code has been improved greatly by using PHPLint\r
-// Copyright (c) 2010 Umberto Salsi\r
-// This is free software; see the license for copying conditions.\r
-// More info: http://www.icosaedro.it/phplint/\r
-/*.\r
-       require_module 'standard';\r
-       require_module 'pcre';\r
-.*/\r
-\r
-if (!defined('ISEMAIL_VALID')) {\r
-/*:diagnostic constants start:*/\r
-// This part of the code is generated using data from test/meta.xml. Beware of making manual alterations\r
-       // Categories\r
-       define('ISEMAIL_VALID_CATEGORY', 1);\r
-       define('ISEMAIL_DNSWARN', 7);\r
-       define('ISEMAIL_RFC5321', 15);\r
-       define('ISEMAIL_CFWS', 31);\r
-       define('ISEMAIL_DEPREC', 63);\r
-       define('ISEMAIL_RFC5322', 127);\r
-       define('ISEMAIL_ERR', 255);\r
-\r
-       // Diagnoses\r
-       // Address is valid\r
-       define('ISEMAIL_VALID', 0);\r
-       // Address is valid but a DNS check was not successful\r
-       define('ISEMAIL_DNSWARN_NO_MX_RECORD', 5);\r
-       define('ISEMAIL_DNSWARN_NO_RECORD', 6);\r
-       // Address is valid for SMTP but has unusual elements\r
-       define('ISEMAIL_RFC5321_TLD', 9);\r
-       define('ISEMAIL_RFC5321_TLDNUMERIC', 10);\r
-       define('ISEMAIL_RFC5321_QUOTEDSTRING', 11);\r
-       define('ISEMAIL_RFC5321_ADDRESSLITERAL', 12);\r
-       define('ISEMAIL_RFC5321_IPV6DEPRECATED', 13);\r
-       // Address is valid within the message but cannot be used unmodified for the envelope\r
-       define('ISEMAIL_CFWS_COMMENT', 17);\r
-       define('ISEMAIL_CFWS_FWS', 18);\r
-       // Address contains deprecated elements but may still be valid in restricted contexts\r
-       define('ISEMAIL_DEPREC_LOCALPART', 33);\r
-       define('ISEMAIL_DEPREC_FWS', 34);\r
-       define('ISEMAIL_DEPREC_QTEXT', 35);\r
-       define('ISEMAIL_DEPREC_QP', 36);\r
-       define('ISEMAIL_DEPREC_COMMENT', 37);\r
-       define('ISEMAIL_DEPREC_CTEXT', 38);\r
-       define('ISEMAIL_DEPREC_CFWS_NEAR_AT', 49);\r
-       // The address is only valid according to the broad definition of RFC 5322. It is otherwise invalid.\r
-       define('ISEMAIL_RFC5322_DOMAIN', 65);\r
-       define('ISEMAIL_RFC5322_TOOLONG', 66);\r
-       define('ISEMAIL_RFC5322_LOCAL_TOOLONG', 67);\r
-       define('ISEMAIL_RFC5322_DOMAIN_TOOLONG', 68);\r
-       define('ISEMAIL_RFC5322_LABEL_TOOLONG', 69);\r
-       define('ISEMAIL_RFC5322_DOMAINLITERAL', 70);\r
-       define('ISEMAIL_RFC5322_DOMLIT_OBSDTEXT', 71);\r
-       define('ISEMAIL_RFC5322_IPV6_GRPCOUNT', 72);\r
-       define('ISEMAIL_RFC5322_IPV6_2X2XCOLON', 73);\r
-       define('ISEMAIL_RFC5322_IPV6_BADCHAR', 74);\r
-       define('ISEMAIL_RFC5322_IPV6_MAXGRPS', 75);\r
-       define('ISEMAIL_RFC5322_IPV6_COLONSTRT', 76);\r
-       define('ISEMAIL_RFC5322_IPV6_COLONEND', 77);\r
-       // Address is invalid for any purpose\r
-       define('ISEMAIL_ERR_EXPECTING_DTEXT', 129);\r
-       define('ISEMAIL_ERR_NOLOCALPART', 130);\r
-       define('ISEMAIL_ERR_NODOMAIN', 131);\r
-       define('ISEMAIL_ERR_CONSECUTIVEDOTS', 132);\r
-       define('ISEMAIL_ERR_ATEXT_AFTER_CFWS', 133);\r
-       define('ISEMAIL_ERR_ATEXT_AFTER_QS', 134);\r
-       define('ISEMAIL_ERR_ATEXT_AFTER_DOMLIT', 135);\r
-       define('ISEMAIL_ERR_EXPECTING_QPAIR', 136);\r
-       define('ISEMAIL_ERR_EXPECTING_ATEXT', 137);\r
-       define('ISEMAIL_ERR_EXPECTING_QTEXT', 138);\r
-       define('ISEMAIL_ERR_EXPECTING_CTEXT', 139);\r
-       define('ISEMAIL_ERR_BACKSLASHEND', 140);\r
-       define('ISEMAIL_ERR_DOT_START', 141);\r
-       define('ISEMAIL_ERR_DOT_END', 142);\r
-       define('ISEMAIL_ERR_DOMAINHYPHENSTART', 143);\r
-       define('ISEMAIL_ERR_DOMAINHYPHENEND', 144);\r
-       define('ISEMAIL_ERR_UNCLOSEDQUOTEDSTR', 145);\r
-       define('ISEMAIL_ERR_UNCLOSEDCOMMENT', 146);\r
-       define('ISEMAIL_ERR_UNCLOSEDDOMLIT', 147);\r
-       define('ISEMAIL_ERR_FWS_CRLF_X2', 148);\r
-       define('ISEMAIL_ERR_FWS_CRLF_END', 149);\r
-       define('ISEMAIL_ERR_CR_NO_LF', 150);\r
-// End of generated code\r
-/*:diagnostic constants end:*/\r
-\r
-       // function control\r
-       define('ISEMAIL_THRESHOLD'              , 16);\r
-\r
-       // Email parts\r
-       define('ISEMAIL_COMPONENT_LOCALPART'    , 0);\r
-       define('ISEMAIL_COMPONENT_DOMAIN'       , 1);\r
-       define('ISEMAIL_COMPONENT_LITERAL'      , 2);\r
-       define('ISEMAIL_CONTEXT_COMMENT'        , 3);\r
-       define('ISEMAIL_CONTEXT_FWS'            , 4);\r
-       define('ISEMAIL_CONTEXT_QUOTEDSTRING'   , 5);\r
-       define('ISEMAIL_CONTEXT_QUOTEDPAIR'     , 6);\r
-\r
-       // Miscellaneous string constants\r
-       define('ISEMAIL_STRING_AT'              , '@');\r
-       define('ISEMAIL_STRING_BACKSLASH'       , '\\');\r
-       define('ISEMAIL_STRING_DOT'             , '.');\r
-       define('ISEMAIL_STRING_DQUOTE'          , '"');\r
-       define('ISEMAIL_STRING_OPENPARENTHESIS' , '(');\r
-       define('ISEMAIL_STRING_CLOSEPARENTHESIS', ')');\r
-       define('ISEMAIL_STRING_OPENSQBRACKET'   , '[');\r
-       define('ISEMAIL_STRING_CLOSESQBRACKET'  , ']');\r
-       define('ISEMAIL_STRING_HYPHEN'          , '-');\r
-       define('ISEMAIL_STRING_COLON'           , ':');\r
-       define('ISEMAIL_STRING_DOUBLECOLON'     , '::');\r
-       define('ISEMAIL_STRING_SP'              , ' ');\r
-       define('ISEMAIL_STRING_HTAB'            , "\t");\r
-       define('ISEMAIL_STRING_CR'              , "\r");\r
-       define('ISEMAIL_STRING_LF'              , "\n");\r
-       define('ISEMAIL_STRING_IPV6TAG'         , 'IPv6:');\r
-       // US-ASCII visible characters not valid for atext (http://tools.ietf.org/html/rfc5322#section-3.2.3)\r
-       define('ISEMAIL_STRING_SPECIALS'        , '()<>[]:;@\\,."');\r
-}\r
-\r
-/**\r
- * Check that an email address conforms to RFCs 5321, 5322 and others\r
- *\r
- * As of Version 3.0, we are now distinguishing clearly between a Mailbox\r
- * as defined by RFC 5321 and an addr-spec as defined by RFC 5322. Depending\r
- * on the context, either can be regarded as a valid email address. The\r
- * RFC 5321 Mailbox specification is more restrictive (comments, white space\r
- * and obsolete forms are not allowed)\r
- *\r
- * @param string       $email          The email address to check\r
- * @param boolean      $checkDNS       If true then a DNS check for MX records will be made\r
- * @param mixed                $errorlevel     Determines the boundary between valid and invalid addresses.\r
- *                                     Status codes above this number will be returned as-is,\r
- *                                     status codes below will be returned as ISEMAIL_VALID. Thus the\r
- *                                     calling program can simply look for ISEMAIL_VALID if it is\r
- *                                     only interested in whether an address is valid or not. The\r
- *                                     errorlevel will determine how "picky" is_email() is about\r
- *                                     the address.\r
- *\r
- *                                     If omitted or passed as false then is_email() will return\r
- *                                     true or false rather than an integer error or warning.\r
- *\r
- *                                     NB Note the difference between $errorlevel = false and\r
- *                                     $errorlevel = 0\r
- * @param array                $parsedata      If passed, returns the parsed address components\r
- */\r
-/*.mixed.*/ function is_email($email, $checkDNS = false, $errorlevel = false, &$parsedata = array()) {\r
-       // Check that $email is a valid address. Read the following RFCs to understand the constraints:\r
-       //      (http://tools.ietf.org/html/rfc5321)\r
-       //      (http://tools.ietf.org/html/rfc5322)\r
-       //      (http://tools.ietf.org/html/rfc4291#section-2.2)\r
-       //      (http://tools.ietf.org/html/rfc1123#section-2.1)\r
-       //      (http://tools.ietf.org/html/rfc3696) (guidance only)\r
-// version 2.0: Enhance $diagnose parameter to $errorlevel\r
-// version 3.0: Introduced status categories\r
-// revision 3.1: BUG: $parsedata was passed by value instead of by reference\r
-\r
-       if (is_bool($errorlevel)) {\r
-               $threshold      = ISEMAIL_VALID;\r
-               $diagnose       = (bool) $errorlevel;\r
-       } else {\r
-               $diagnose       = true;\r
-\r
-               switch ((int) $errorlevel) {\r
-               case E_WARNING: $threshold      = ISEMAIL_THRESHOLD;    break;  // For backward compatibility\r
-               case E_ERROR:   $threshold      = ISEMAIL_VALID;        break;  // For backward compatibility\r
-               default:        $threshold      = (int) $errorlevel;\r
-               }\r
-       }\r
-\r
-       $return_status = array(ISEMAIL_VALID);\r
-\r
-       // Parse the address into components, character by character\r
-       $raw_length     = strlen($email);\r
-       $context        = ISEMAIL_COMPONENT_LOCALPART;  // Where we are\r
-       $context_stack  = array($context);              // Where we have been\r
-       $context_prior  = ISEMAIL_COMPONENT_LOCALPART;  // Where we just came from\r
-       $token          = '';                           // The current character\r
-       $token_prior    = '';                           // The previous character\r
-       $parsedata      = array(\r
-                               ISEMAIL_COMPONENT_LOCALPART     => '',\r
-                               ISEMAIL_COMPONENT_DOMAIN        => ''\r
-                              );                       // For the components of the address\r
-\r
-       $atomlist       = array(\r
-                               ISEMAIL_COMPONENT_LOCALPART     => array(''),\r
-                               ISEMAIL_COMPONENT_DOMAIN        => array('')\r
-                              );                       // For the dot-atom elements of the address\r
-       $element_count  = 0;\r
-       $element_len    = 0;\r
-       $hyphen_flag    = false;                        // Hyphen cannot occur at the end of a subdomain\r
-       $end_or_die     = false;                        // CFWS can only appear at the end of the element\r
-\r
-//-echo "<table style=\"clear:left;\">"; // debug\r
-       for ($i = 0; $i < $raw_length; $i++) {\r
-               $token = $email[$i];\r
-//-echo "<tr><td><strong>$context|",(($end_or_die) ? 'true' : 'false'),"|$token|" . max($return_status) . "</strong></td>"; // debug\r
-\r
-               switch ($context) {\r
-               //-------------------------------------------------------------\r
-               // local-part\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_COMPONENT_LOCALPART:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                       //   local-part      =   dot-atom / quoted-string / obs-local-part\r
-                       //\r
-                       //   dot-atom        =   [CFWS] dot-atom-text [CFWS]\r
-                       //\r
-                       //   dot-atom-text   =   1*atext *("." 1*atext)\r
-                       //\r
-                       //   quoted-string   =   [CFWS]\r
-                       //                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE\r
-                       //                       [CFWS]\r
-                       //\r
-                       //   obs-local-part  =   word *("." word)\r
-                       //\r
-                       //   word            =   atom / quoted-string\r
-                       //\r
-                       //   atom            =   [CFWS] 1*atext [CFWS]\r
-                       switch ($token) {\r
-                       // Comment\r
-                       case ISEMAIL_STRING_OPENPARENTHESIS:\r
-                               if ($element_len === 0)\r
-                                       // Comments are OK at the beginning of an element\r
-                                       $return_status[]        = ($element_count === 0) ? ISEMAIL_CFWS_COMMENT : ISEMAIL_DEPREC_COMMENT;\r
-                               else {\r
-                                       $return_status[]        = ISEMAIL_CFWS_COMMENT;\r
-                                       $end_or_die             = true; // We can't start a comment in the middle of an element, so this better be the end\r
-                               }\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_COMMENT;\r
-                               break;\r
-                       // Next dot-atom element\r
-                       case ISEMAIL_STRING_DOT:\r
-                               if ($element_len === 0)\r
-                                       // Another dot, already?\r
-                                       $return_status[] = ($element_count === 0) ? ISEMAIL_ERR_DOT_START : ISEMAIL_ERR_CONSECUTIVEDOTS;        // Fatal error\r
-                               else\r
-                                       // The entire local-part can be a quoted string for RFC 5321\r
-                                       // If it's just one atom that is quoted then it's an RFC 5322 obsolete form\r
-                                       if ($end_or_die) $return_status[] = ISEMAIL_DEPREC_LOCALPART;\r
-\r
-                                       $end_or_die     = false;        // CFWS & quoted strings are OK again now we're at the beginning of an element (although they are obsolete forms)\r
-                                       $element_len    = 0;\r
-                                       $element_count++;\r
-                                       $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                                       $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  = '';\r
-\r
-                               break;\r
-                       // Quoted string\r
-                       case ISEMAIL_STRING_DQUOTE:\r
-                               if ($element_len === 0) {\r
-                                       // The entire local-part can be a quoted string for RFC 5321\r
-                                       // If it's just one atom that is quoted then it's an RFC 5322 obsolete form\r
-                                       $return_status[]        = ($element_count === 0) ? ISEMAIL_RFC5321_QUOTEDSTRING : ISEMAIL_DEPREC_LOCALPART;\r
-\r
-                                       $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                                       $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;\r
-                                       $element_len++;\r
-                                       $end_or_die             = true; // Quoted string must be the entire element\r
-                                       $context_stack[]        = $context;\r
-                                       $context                = ISEMAIL_CONTEXT_QUOTEDSTRING;\r
-                               } else {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error\r
-                               }\r
-\r
-                               break;\r
-                       // Folding White Space\r
-                       case ISEMAIL_STRING_CR:\r
-                       case ISEMAIL_STRING_SP:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {$return_status[] = ISEMAIL_ERR_CR_NO_LF; break;} // Fatal error\r
-\r
-                               if ($element_len === 0)\r
-                                       $return_status[] = ($element_count === 0) ? ISEMAIL_CFWS_FWS : ISEMAIL_DEPREC_FWS;\r
-                               else\r
-                                       $end_or_die = true;     // We can't start FWS in the middle of an element, so this better be the end\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_FWS;\r
-                               $token_prior            = $token;\r
-\r
-                               break;\r
-                       // @\r
-                       case ISEMAIL_STRING_AT:\r
-                               // At this point we should have a valid local-part\r
-                               if (count($context_stack) !== 1) die('Unexpected item on context stack');\r
-\r
-                               if      ($parsedata[ISEMAIL_COMPONENT_LOCALPART] === '')\r
-                                                               $return_status[]        = ISEMAIL_ERR_NOLOCALPART;      // Fatal error\r
-                               elseif  ($element_len === 0)    $return_status[]        = ISEMAIL_ERR_DOT_END;  // Fatal error\r
-                               // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.1\r
-                               //   The maximum total length of a user name or other local-part is 64\r
-                               //   octets.\r
-                               elseif  (strlen($parsedata[ISEMAIL_COMPONENT_LOCALPART]) > 64)\r
-                                                               $return_status[]        = ISEMAIL_RFC5322_LOCAL_TOOLONG;\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                               //   Comments and folding white space\r
-                               //   SHOULD NOT be used around the "@" in the addr-spec.\r
-                               //\r
-                               // http://tools.ietf.org/html/rfc2119\r
-                               // 4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean that\r
-                               //    there may exist valid reasons in particular circumstances when the\r
-                               //    particular behavior is acceptable or even useful, but the full\r
-                               //    implications should be understood and the case carefully weighed\r
-                               //    before implementing any behavior described with this label.\r
-                               elseif  (($context_prior === ISEMAIL_CONTEXT_COMMENT) || ($context_prior === ISEMAIL_CONTEXT_FWS))\r
-                                                               $return_status[]        = ISEMAIL_DEPREC_CFWS_NEAR_AT;\r
-\r
-                               // Clear everything down for the domain parsing\r
-                               $context        = ISEMAIL_COMPONENT_DOMAIN;     // Where we are\r
-                               $context_stack  = array($context);              // Where we have been\r
-                               $element_count  = 0;\r
-                               $element_len    = 0;\r
-                               $end_or_die     = false;                        // CFWS can only appear at the end of the element\r
-\r
-                               break;\r
-                       // atext\r
-                       default:\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.3\r
-                               //    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII\r
-                               //                        "!" / "#" /        ;  characters not including\r
-                               //                        "$" / "%" /        ;  specials.  Used for atoms.\r
-                               //                        "&" / "'" /\r
-                               //                        "*" / "+" /\r
-                               //                        "-" / "/" /\r
-                               //                        "=" / "?" /\r
-                               //                        "^" / "_" /\r
-                               //                        "`" / "{" /\r
-                               //                        "|" / "}" /\r
-                               //                        "~"\r
-                               if ($end_or_die) {\r
-                                       // We have encountered atext where it is no longer valid\r
-                                       switch ($context_prior) {\r
-                                       case ISEMAIL_CONTEXT_COMMENT:\r
-                                       case ISEMAIL_CONTEXT_FWS:\r
-                                               $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_CFWS;\r
-                                               break;\r
-                                       case ISEMAIL_CONTEXT_QUOTEDSTRING:\r
-                                               $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_QS;\r
-                                               break;\r
-                                       default:\r
-                                               die ("More atext found where none is allowed, but unrecognised prior context: $context_prior");\r
-                                       }\r
-                               } else {\r
-                                       $context_prior  = $context;\r
-                                       $ord            = ord($token);\r
-\r
-                                       if (($ord < 33) || ($ord > 126) || ($ord === 10) || (!is_bool(strpos(ISEMAIL_STRING_SPECIALS, $token))))\r
-                                               $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error\r
-\r
-                                       $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                                       $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;\r
-                                       $element_len++;\r
-                               }\r
-                       }\r
-\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Domain\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_COMPONENT_DOMAIN:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                       //   domain          =   dot-atom / domain-literal / obs-domain\r
-                       //\r
-                       //   dot-atom        =   [CFWS] dot-atom-text [CFWS]\r
-                       //\r
-                       //   dot-atom-text   =   1*atext *("." 1*atext)\r
-                       //\r
-                       //   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]\r
-                       //\r
-                       //   dtext           =   %d33-90 /          ; Printable US-ASCII\r
-                       //                       %d94-126 /         ;  characters not including\r
-                       //                       obs-dtext          ;  "[", "]", or "\"\r
-                       //\r
-                       //   obs-domain      =   atom *("." atom)\r
-                       //\r
-                       //   atom            =   [CFWS] 1*atext [CFWS]\r
-\r
-\r
-                       // http://tools.ietf.org/html/rfc5321#section-4.1.2\r
-                       //   Mailbox        = Local-part "@" ( Domain / address-literal )\r
-                       //\r
-                       //   Domain         = sub-domain *("." sub-domain)\r
-                       //\r
-                       //   address-literal  = "[" ( IPv4-address-literal /\r
-                       //                    IPv6-address-literal /\r
-                       //                    General-address-literal ) "]"\r
-                       //                    ; See Section 4.1.3\r
-\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                       //      Note: A liberal syntax for the domain portion of addr-spec is\r
-                       //      given here.  However, the domain portion contains addressing\r
-                       //      information specified by and used in other protocols (e.g.,\r
-                       //      [RFC1034], [RFC1035], [RFC1123], [RFC5321]).  It is therefore\r
-                       //      incumbent upon implementations to conform to the syntax of\r
-                       //      addresses for the context in which they are used.\r
-                       // is_email() author's note: it's not clear how to interpret this in\r
-                       // the context of a general email address validator. The conclusion I\r
-                       // have reached is this: "addressing information" must comply with\r
-                       // RFC 5321 (and in turn RFC 1035), anything that is "semantically\r
-                       // invisible" must comply only with RFC 5322.\r
-                       switch ($token) {\r
-                       // Comment\r
-                       case ISEMAIL_STRING_OPENPARENTHESIS:\r
-                               if ($element_len === 0)\r
-                                       // Comments at the start of the domain are deprecated in the text\r
-                                       // Comments at the start of a subdomain are obs-domain\r
-                                       // (http://tools.ietf.org/html/rfc5322#section-3.4.1)\r
-                                       $return_status[]        = ($element_count === 0) ? ISEMAIL_DEPREC_CFWS_NEAR_AT : ISEMAIL_DEPREC_COMMENT;\r
-                               else {\r
-                                       $return_status[]        = ISEMAIL_CFWS_COMMENT;\r
-                                       $end_or_die             = true; // We can't start a comment in the middle of an element, so this better be the end\r
-                               }\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_COMMENT;\r
-                               break;\r
-                       // Next dot-atom element\r
-                       case ISEMAIL_STRING_DOT:\r
-                               if ($element_len === 0)\r
-                                       // Another dot, already?\r
-                                       $return_status[]        = ($element_count === 0) ? ISEMAIL_ERR_DOT_START : ISEMAIL_ERR_CONSECUTIVEDOTS; // Fatal error\r
-                               elseif ($hyphen_flag)\r
-                                       // Previous subdomain ended in a hyphen\r
-                                       $return_status[]        = ISEMAIL_ERR_DOMAINHYPHENEND;  // Fatal error\r
-                               else\r
-                                       // Nowhere in RFC 5321 does it say explicitly that the\r
-                                       // domain part of a Mailbox must be a valid domain according\r
-                                       // to the DNS standards set out in RFC 1035, but this *is*\r
-                                       // implied in several places. For instance, wherever the idea\r
-                                       // of host routing is discussed the RFC says that the domain\r
-                                       // must be looked up in the DNS. This would be nonsense unless\r
-                                       // the domain was designed to be a valid DNS domain. Hence we\r
-                                       // must conclude that the RFC 1035 restriction on label length\r
-                                       // also applies to RFC 5321 domains.\r
-                                       //\r
-                                       // http://tools.ietf.org/html/rfc1035#section-2.3.4\r
-                                       // labels          63 octets or less\r
-                                       if ($element_len > 63) $return_status[] = ISEMAIL_RFC5322_LABEL_TOOLONG;\r
-\r
-                                       $end_or_die             = false;        // CFWS is OK again now we're at the beginning of an element (although it may be obsolete CFWS)\r
-                                       $element_len            = 0;\r
-                                       $element_count++;\r
-                                       $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     = '';\r
-                                       $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-\r
-                               break;\r
-                       // Domain literal\r
-                       case ISEMAIL_STRING_OPENSQBRACKET:\r
-                               if ($parsedata[ISEMAIL_COMPONENT_DOMAIN] === '') {\r
-                                       $end_or_die             = true; // Domain literal must be the only component\r
-                                       $element_len++;\r
-                                       $context_stack[]        = $context;\r
-                                       $context                = ISEMAIL_COMPONENT_LITERAL;\r
-                                       $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-                                       $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;\r
-                                       $parsedata[ISEMAIL_COMPONENT_LITERAL]                   = '';\r
-                               } else {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error\r
-                               }\r
-\r
-                               break;\r
-                       // Folding White Space\r
-                       case ISEMAIL_STRING_CR:\r
-                       case ISEMAIL_STRING_SP:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {$return_status[] = ISEMAIL_ERR_CR_NO_LF; break;} // Fatal error\r
-\r
-                               if ($element_len === 0)\r
-                                       $return_status[]        = ($element_count === 0) ? ISEMAIL_DEPREC_CFWS_NEAR_AT : ISEMAIL_DEPREC_FWS;\r
-                               else {\r
-                                       $return_status[]        = ISEMAIL_CFWS_FWS;\r
-                                       $end_or_die     = true; // We can't start FWS in the middle of an element, so this better be the end\r
-                               }\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_FWS;\r
-                               $token_prior            = $token;\r
-                               break;\r
-                       // atext\r
-                       default:\r
-                               // RFC 5322 allows any atext...\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.3\r
-                               //    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII\r
-                               //                        "!" / "#" /        ;  characters not including\r
-                               //                        "$" / "%" /        ;  specials.  Used for atoms.\r
-                               //                        "&" / "'" /\r
-                               //                        "*" / "+" /\r
-                               //                        "-" / "/" /\r
-                               //                        "=" / "?" /\r
-                               //                        "^" / "_" /\r
-                               //                        "`" / "{" /\r
-                               //                        "|" / "}" /\r
-                               //                        "~"\r
-\r
-                               // But RFC 5321 only allows letter-digit-hyphen to comply with DNS rules (RFCs 1034 & 1123)\r
-                               // http://tools.ietf.org/html/rfc5321#section-4.1.2\r
-                               //   sub-domain     = Let-dig [Ldh-str]\r
-                               //\r
-                               //   Let-dig        = ALPHA / DIGIT\r
-                               //\r
-                               //   Ldh-str        = *( ALPHA / DIGIT / "-" ) Let-dig\r
-                               //\r
-                               if ($end_or_die) {\r
-                                       // We have encountered atext where it is no longer valid\r
-                                       switch ($context_prior) {\r
-                                       case ISEMAIL_CONTEXT_COMMENT:\r
-                                       case ISEMAIL_CONTEXT_FWS:\r
-                                               $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_CFWS;\r
-                                               break;\r
-                                       case ISEMAIL_COMPONENT_LITERAL:\r
-                                               $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_DOMLIT;\r
-                                               break;\r
-                                       default:\r
-                                               die ("More atext found where none is allowed, but unrecognised prior context: $context_prior");\r
-                                       }\r
-                               }\r
-\r
-                               $ord            = ord($token);\r
-                               $hyphen_flag    = false;        // Assume this token isn't a hyphen unless we discover it is\r
-\r
-                               if (($ord < 33) || ($ord > 126) || (!is_bool(strpos(ISEMAIL_STRING_SPECIALS, $token)))) {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error\r
-                               } elseif ($token === ISEMAIL_STRING_HYPHEN) {\r
-                                       if ($element_len === 0) {\r
-                                               // Hyphens can't be at the beginning of a subdomain\r
-                                               $return_status[]        = ISEMAIL_ERR_DOMAINHYPHENSTART;        // Fatal error\r
-                                       }\r
-\r
-                                       $hyphen_flag = true;\r
-                               } elseif (!(($ord > 47 && $ord < 58) || ($ord > 64 && $ord < 91) || ($ord > 96 && $ord < 123))) {\r
-                                       // Not an RFC 5321 subdomain, but still OK by RFC 5322\r
-                                       $return_status[]        = ISEMAIL_RFC5322_DOMAIN;\r
-                               }\r
-\r
-                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;\r
-                               $element_len++;\r
-                       }\r
-\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Domain literal\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_COMPONENT_LITERAL:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                       //   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]\r
-                       //\r
-                       //   dtext           =   %d33-90 /          ; Printable US-ASCII\r
-                       //                       %d94-126 /         ;  characters not including\r
-                       //                       obs-dtext          ;  "[", "]", or "\"\r
-                       //\r
-                       //   obs-dtext       =   obs-NO-WS-CTL / quoted-pair\r
-                       switch ($token) {\r
-                       // End of domain literal\r
-                       case ISEMAIL_STRING_CLOSESQBRACKET:\r
-                               if ((int) max($return_status) < ISEMAIL_DEPREC) {\r
-                                       // Could be a valid RFC 5321 address literal, so let's check\r
-\r
-                                       // http://tools.ietf.org/html/rfc5321#section-4.1.2\r
-                                       //   address-literal  = "[" ( IPv4-address-literal /\r
-                                       //                    IPv6-address-literal /\r
-                                       //                    General-address-literal ) "]"\r
-                                       //                    ; See Section 4.1.3\r
-                                       //\r
-                                       // http://tools.ietf.org/html/rfc5321#section-4.1.3\r
-                                       //   IPv4-address-literal  = Snum 3("."  Snum)\r
-                                       //\r
-                                       //   IPv6-address-literal  = "IPv6:" IPv6-addr\r
-                                       //\r
-                                       //   General-address-literal  = Standardized-tag ":" 1*dcontent\r
-                                       //\r
-                                       //   Standardized-tag  = Ldh-str\r
-                                       //                     ; Standardized-tag MUST be specified in a\r
-                                       //                     ; Standards-Track RFC and registered with IANA\r
-                                       //\r
-                                       //   dcontent       = %d33-90 / ; Printable US-ASCII\r
-                                       //                  %d94-126 ; excl. "[", "\", "]"\r
-                                       //\r
-                                       //   Snum           = 1*3DIGIT\r
-                                       //                  ; representing a decimal integer\r
-                                       //                  ; value in the range 0 through 255\r
-                                       //\r
-                                       //   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp\r
-                                       //\r
-                                       //   IPv6-hex       = 1*4HEXDIG\r
-                                       //\r
-                                       //   IPv6-full      = IPv6-hex 7(":" IPv6-hex)\r
-                                       //\r
-                                       //   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"\r
-                                       //                  [IPv6-hex *5(":" IPv6-hex)]\r
-                                       //                  ; The "::" represents at least 2 16-bit groups of\r
-                                       //                  ; zeros.  No more than 6 groups in addition to the\r
-                                       //                  ; "::" may be present.\r
-                                       //\r
-                                       //   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal\r
-                                       //\r
-                                       //   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"\r
-                                       //                  [IPv6-hex *3(":" IPv6-hex) ":"]\r
-                                       //                  IPv4-address-literal\r
-                                       //                  ; The "::" represents at least 2 16-bit groups of\r
-                                       //                  ; zeros.  No more than 4 groups in addition to the\r
-                                       //                  ; "::" and IPv4-address-literal may be present.\r
-                                       //\r
-                                       // is_email() author's note: We can't use ip2long() to validate\r
-                                       // IPv4 addresses because it accepts abbreviated addresses\r
-                                       // (xxx.xxx.xxx), expanding the last group to complete the address.\r
-                                       // filter_var() validates IPv6 address inconsistently (up to PHP 5.3.3\r
-                                       // at least) -- see http://bugs.php.net/bug.php?id=53236 for example\r
-                                       $max_groups     = 8;\r
-                                       $matchesIP      = array();\r
-                       /*.mixed.*/     $index          = false;\r
-                                       $addressliteral = $parsedata[ISEMAIL_COMPONENT_LITERAL];\r
-\r
-                                       // Extract IPv4 part from the end of the address-literal (if there is one)\r
-                                       if (preg_match('/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', $addressliteral, $matchesIP) > 0) {\r
-                                               $index = strrpos($addressliteral, $matchesIP[0]);\r
-                                               if ($index !== 0) $addressliteral = substr($addressliteral, 0, $index) . '0:0'; // Convert IPv4 part to IPv6 format for further testing\r
-                                       }\r
-\r
-                                       if ($index === 0) {\r
-                                               // Nothing there except a valid IPv4 address, so...\r
-                                               $return_status[]        = ISEMAIL_RFC5321_ADDRESSLITERAL;\r
-                                       } elseif (strncasecmp($addressliteral, ISEMAIL_STRING_IPV6TAG, 5) !== 0) {\r
-                                               $return_status[]        = ISEMAIL_RFC5322_DOMAINLITERAL;\r
-                                       } else {\r
-                                               $IPv6           = substr($addressliteral, 5);\r
-                                               $matchesIP      = explode(ISEMAIL_STRING_COLON, $IPv6); // Revision 2.7: Daniel Marschall's new IPv6 testing strategy\r
-                                               $groupCount     = count($matchesIP);\r
-                                               $index          = strpos($IPv6,ISEMAIL_STRING_DOUBLECOLON);\r
-\r
-                                               if ($index === false) {\r
-                                                       // We need exactly the right number of groups\r
-                                                       if ($groupCount !== $max_groups)\r
-                                                               $return_status[]        = ISEMAIL_RFC5322_IPV6_GRPCOUNT;\r
-                                               } else {\r
-                                                       if ($index !== strrpos($IPv6,ISEMAIL_STRING_DOUBLECOLON))\r
-                                                               $return_status[]        = ISEMAIL_RFC5322_IPV6_2X2XCOLON;\r
-                                                       else {\r
-                                                               if ($index === 0 || $index === (strlen($IPv6) - 2)) $max_groups++;      // RFC 4291 allows :: at the start or end of an address with 7 other groups in addition\r
-\r
-                                                               if ($groupCount > $max_groups)\r
-                                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_MAXGRPS;\r
-                                                               elseif ($groupCount === $max_groups)\r
-                                                                       $return_status[]        = ISEMAIL_RFC5321_IPV6DEPRECATED;       // Eliding a single "::"\r
-                                                       }\r
-                                               }\r
-\r
-                                               // Revision 2.7: Daniel Marschall's new IPv6 testing strategy\r
-                                               if ((substr($IPv6, 0,  1) === ISEMAIL_STRING_COLON) && (substr($IPv6, 1,  1) !== ISEMAIL_STRING_COLON))\r
-                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_COLONSTRT;       // Address starts with a single colon\r
-                                               elseif ((substr($IPv6, -1) === ISEMAIL_STRING_COLON) && (substr($IPv6, -2, 1) !== ISEMAIL_STRING_COLON))\r
-                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_COLONEND;        // Address ends with a single colon\r
-                                               elseif (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0)\r
-                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_BADCHAR; // Check for unmatched characters\r
-                                               else\r
-                                                       $return_status[]        = ISEMAIL_RFC5321_ADDRESSLITERAL;\r
-                                       }\r
-                               } else\r
-                                       $return_status[]        = ISEMAIL_RFC5322_DOMAINLITERAL;\r
-\r
-\r
-                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;\r
-                               $element_len++;\r
-                               $context_prior          = $context;\r
-                               $context                = (int) array_pop($context_stack);\r
-                               break;\r
-                       case ISEMAIL_STRING_BACKSLASH:\r
-                               $return_status[]        = ISEMAIL_RFC5322_DOMLIT_OBSDTEXT;\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;\r
-                               break;\r
-                       // Folding White Space\r
-                       case ISEMAIL_STRING_CR:\r
-                       case ISEMAIL_STRING_SP:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {$return_status[] = ISEMAIL_ERR_CR_NO_LF; break;} // Fatal error\r
-\r
-                               $return_status[]        = ISEMAIL_CFWS_FWS;\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_FWS;\r
-                               $token_prior            = $token;\r
-                               break;\r
-                       // dtext\r
-                       default:\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                               //   dtext           =   %d33-90 /          ; Printable US-ASCII\r
-                               //                       %d94-126 /         ;  characters not including\r
-                               //                       obs-dtext          ;  "[", "]", or "\"\r
-                               //\r
-                               //   obs-dtext       =   obs-NO-WS-CTL / quoted-pair\r
-                               //\r
-                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control\r
-                               //                       %d11 /             ;  characters that do not\r
-                               //                       %d12 /             ;  include the carriage\r
-                               //                       %d14-31 /          ;  return, line feed, and\r
-                               //                       %d127              ;  white space characters\r
-                               $ord = ord($token);\r
-\r
-                               // CR, LF, SP & HTAB have already been parsed above\r
-                               if (($ord > 127) || ($ord === 0) || ($token === ISEMAIL_STRING_OPENSQBRACKET)) {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_DTEXT;  // Fatal error\r
-                                       break;\r
-                               } elseif (($ord < 33) || ($ord === 127)) {\r
-                                       $return_status[]        = ISEMAIL_RFC5322_DOMLIT_OBSDTEXT;\r
-                               }\r
-\r
-                               $parsedata[ISEMAIL_COMPONENT_LITERAL]                   .= $token;\r
-                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;\r
-                               $element_len++;\r
-                       }\r
-\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Quoted string\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_CONTEXT_QUOTEDSTRING:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.2.4\r
-                       //   quoted-string   =   [CFWS]\r
-                       //                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE\r
-                       //                       [CFWS]\r
-                       //\r
-                       //   qcontent        =   qtext / quoted-pair\r
-                       switch ($token) {\r
-                       // Quoted pair\r
-                       case ISEMAIL_STRING_BACKSLASH:\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;\r
-                               break;\r
-                       // Folding White Space\r
-                       // Inside a quoted string, spaces are allowed as regular characters.\r
-                       // It's only FWS if we include HTAB or CRLF\r
-                       case ISEMAIL_STRING_CR:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {$return_status[] = ISEMAIL_ERR_CR_NO_LF; break;} // Fatal error\r
-\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.2\r
-                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a\r
-                               //   structured header field are semantically interpreted as a single\r
-                               //   space character.\r
-\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.4\r
-                               //   the CRLF in any FWS/CFWS that appears within the quoted-string [is]\r
-                               //   semantically "invisible" and therefore not part of the quoted-string\r
-                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= ISEMAIL_STRING_SP;\r
-                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= ISEMAIL_STRING_SP;\r
-                               $element_len++;\r
-\r
-                               $return_status[]                = ISEMAIL_CFWS_FWS;\r
-                               $context_stack[]                = $context;\r
-                               $context                        = ISEMAIL_CONTEXT_FWS;\r
-                               $token_prior                    = $token;\r
-                               break;\r
-                       // End of quoted string\r
-                       case ISEMAIL_STRING_DQUOTE:\r
-                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;\r
-                               $element_len++;\r
-                               $context_prior                  = $context;\r
-                               $context                        = (int) array_pop($context_stack);\r
-                               break;\r
-                       // qtext\r
-                       default:\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.4\r
-                               //   qtext           =   %d33 /             ; Printable US-ASCII\r
-                               //                       %d35-91 /          ;  characters not including\r
-                               //                       %d93-126 /         ;  "\" or the quote character\r
-                               //                       obs-qtext\r
-                               //\r
-                               //   obs-qtext       =   obs-NO-WS-CTL\r
-                               //\r
-                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control\r
-                               //                       %d11 /             ;  characters that do not\r
-                               //                       %d12 /             ;  include the carriage\r
-                               //                       %d14-31 /          ;  return, line feed, and\r
-                               //                       %d127              ;  white space characters\r
-                               $ord = ord($token);\r
-\r
-                               if (($ord > 127) || ($ord === 0) || ($ord === 10)) {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_QTEXT;  // Fatal error\r
-                               } elseif (($ord < 32) || ($ord === 127))\r
-                                       $return_status[]        = ISEMAIL_DEPREC_QTEXT;\r
-\r
-                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;\r
-                               $element_len++;\r
-                       }\r
-\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.4.1\r
-                       //   If the\r
-                       //   string can be represented as a dot-atom (that is, it contains no\r
-                       //   characters other than atext characters or "." surrounded by atext\r
-                       //   characters), then the dot-atom form SHOULD be used and the quoted-\r
-                       //   string form SHOULD NOT be used.\r
-// To do\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Quoted pair\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_CONTEXT_QUOTEDPAIR:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.2.1\r
-                       //   quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp\r
-                       //\r
-                       //   VCHAR           =  %d33-126            ; visible (printing) characters\r
-                       //   WSP             =  SP / HTAB           ; white space\r
-                       //\r
-                       //   obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)\r
-                       //\r
-                       //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control\r
-                       //                       %d11 /             ;  characters that do not\r
-                       //                       %d12 /             ;  include the carriage\r
-                       //                       %d14-31 /          ;  return, line feed, and\r
-                       //                       %d127              ;  white space characters\r
-                       //\r
-                       // i.e. obs-qp       =  "\" (%d0-8, %d10-31 / %d127)\r
-                       $ord = ord($token);\r
-\r
-                       if      ($ord > 127)\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_QPAIR;  // Fatal error\r
-                       elseif  ((($ord < 31) && ($ord !== 9)) || ($ord === 127))       // SP & HTAB are allowed\r
-                                       $return_status[]        = ISEMAIL_DEPREC_QP;\r
-\r
-                       // At this point we know where this qpair occurred so\r
-                       // we could check to see if the character actually\r
-                       // needed to be quoted at all.\r
-                       // http://tools.ietf.org/html/rfc5321#section-4.1.2\r
-                       //   the sending system SHOULD transmit the\r
-                       //   form that uses the minimum quoting possible.\r
-// To do: check whether the character needs to be quoted (escaped) in this context\r
-                       $context_prior  = $context;\r
-                       $context        = (int) array_pop($context_stack);      // End of qpair\r
-                       $token          = ISEMAIL_STRING_BACKSLASH . $token;\r
-\r
-                       switch ($context) {\r
-                       case ISEMAIL_CONTEXT_COMMENT:\r
-                               break;\r
-                       case ISEMAIL_CONTEXT_QUOTEDSTRING:\r
-                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;\r
-                               $element_len    += 2;   // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash\r
-                               break;\r
-                       case ISEMAIL_COMPONENT_LITERAL:\r
-                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;\r
-                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;\r
-                               $element_len    += 2;   // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash\r
-                               break;\r
-                       default:\r
-                               die("Quoted pair logic invoked in an invalid context: $context");\r
-                       }\r
-\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Comment\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_CONTEXT_COMMENT:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.2.2\r
-                       //   comment         =   "(" *([FWS] ccontent) [FWS] ")"\r
-                       //\r
-                       //   ccontent        =   ctext / quoted-pair / comment\r
-                       switch ($token) {\r
-                       // Nested comment\r
-                       case ISEMAIL_STRING_OPENPARENTHESIS:\r
-                               // Nested comments are OK\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_COMMENT;\r
-                               break;\r
-                       // End of comment\r
-                       case ISEMAIL_STRING_CLOSEPARENTHESIS:\r
-                               $context_prior          = $context;\r
-                               $context                = (int) array_pop($context_stack);\r
-\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.2\r
-                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a\r
-                               //   structured header field are semantically interpreted as a single\r
-                               //   space character.\r
-                               //\r
-                               // is_email() author's note: This *cannot* mean that we must add a\r
-                               // space to the address wherever CFWS appears. This would result in\r
-                               // any addr-spec that had CFWS outside a quoted string being invalid\r
-                               // for RFC 5321.\r
-//                             if (($context === ISEMAIL_COMPONENT_LOCALPART) || ($context === ISEMAIL_COMPONENT_DOMAIN)) {\r
-//                                     $parsedata[$context]                    .= ISEMAIL_STRING_SP;\r
-//                                     $atomlist[$context][$element_count]     .= ISEMAIL_STRING_SP;\r
-//                                     $element_len++;\r
-//                             }\r
-\r
-                               break;\r
-                       // Quoted pair\r
-                       case ISEMAIL_STRING_BACKSLASH:\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;\r
-                               break;\r
-                       // Folding White Space\r
-                       case ISEMAIL_STRING_CR:\r
-                       case ISEMAIL_STRING_SP:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {$return_status[] = ISEMAIL_ERR_CR_NO_LF; break;} // Fatal error\r
-\r
-                               $return_status[]        = ISEMAIL_CFWS_FWS;\r
-\r
-                               $context_stack[]        = $context;\r
-                               $context                = ISEMAIL_CONTEXT_FWS;\r
-                               $token_prior            = $token;\r
-                               break;\r
-                       // ctext\r
-                       default:\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.3\r
-                               //   ctext           =   %d33-39 /          ; Printable US-ASCII\r
-                               //                       %d42-91 /          ;  characters not including\r
-                               //                       %d93-126 /         ;  "(", ")", or "\"\r
-                               //                       obs-ctext\r
-                               //\r
-                               //   obs-ctext       =   obs-NO-WS-CTL\r
-                               //\r
-                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control\r
-                               //                       %d11 /             ;  characters that do not\r
-                               //                       %d12 /             ;  include the carriage\r
-                               //                       %d14-31 /          ;  return, line feed, and\r
-                               //                       %d127              ;  white space characters\r
-                               $ord = ord($token);\r
-\r
-                               if (($ord > 127) || ($ord === 0) || ($ord === 10)) {\r
-                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_CTEXT;  // Fatal error\r
-                                       break;\r
-                               } elseif (($ord < 32) || ($ord === 127)) {\r
-                                       $return_status[]        = ISEMAIL_DEPREC_CTEXT;\r
-                               }\r
-                       }\r
-\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // Folding White Space\r
-               //-------------------------------------------------------------\r
-               case ISEMAIL_CONTEXT_FWS:\r
-                       // http://tools.ietf.org/html/rfc5322#section-3.2.2\r
-                       //   FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS\r
-                       //                                          ; Folding white space\r
-\r
-                       // But note the erratum:\r
-                       // http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908:\r
-                       //   In the obsolete syntax, any amount of folding white space MAY be\r
-                       //   inserted where the obs-FWS rule is allowed.  This creates the\r
-                       //   possibility of having two consecutive "folds" in a line, and\r
-                       //   therefore the possibility that a line which makes up a folded header\r
-                       //   field could be composed entirely of white space.\r
-                       //\r
-                       //   obs-FWS         =   1*([CRLF] WSP)\r
-                       if ($token_prior === ISEMAIL_STRING_CR) {\r
-                               if ($token === ISEMAIL_STRING_CR) {\r
-                                       $return_status[]        = ISEMAIL_ERR_FWS_CRLF_X2;      // Fatal error\r
-                                       break;\r
-                               }\r
-\r
-                               if (isset($crlf_count)) {\r
-                                       if (++$crlf_count > 1)\r
-                                               $return_status[]        = ISEMAIL_DEPREC_FWS;   // Multiple folds = obsolete FWS\r
-                               } else $crlf_count = 1;\r
-                       }\r
-\r
-                       switch ($token) {\r
-                       case ISEMAIL_STRING_CR:\r
-                               if ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))\r
-                                       $return_status[]        = ISEMAIL_ERR_CR_NO_LF; // Fatal error\r
-\r
-                               break;\r
-                       case ISEMAIL_STRING_SP:\r
-                       case ISEMAIL_STRING_HTAB:\r
-                               break;\r
-                       default:\r
-                               if ($token_prior === ISEMAIL_STRING_CR) {\r
-                                       $return_status[]        = ISEMAIL_ERR_FWS_CRLF_END;     // Fatal error\r
-                                       break;\r
-                               }\r
-\r
-                               if (isset($crlf_count)) unset($crlf_count);\r
-\r
-                               $context_prior                                  = $context;\r
-                               $context                                        = (int) array_pop($context_stack);      // End of FWS\r
-\r
-                               // http://tools.ietf.org/html/rfc5322#section-3.2.2\r
-                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a\r
-                               //   structured header field are semantically interpreted as a single\r
-                               //   space character.\r
-                               //\r
-                               // is_email() author's note: This *cannot* mean that we must add a\r
-                               // space to the address wherever CFWS appears. This would result in\r
-                               // any addr-spec that had CFWS outside a quoted string being invalid\r
-                               // for RFC 5321.\r
-//                             if (($context === ISEMAIL_COMPONENT_LOCALPART) || ($context === ISEMAIL_COMPONENT_DOMAIN)) {\r
-//                                     $parsedata[$context]                    .= ISEMAIL_STRING_SP;\r
-//                                     $atomlist[$context][$element_count]     .= ISEMAIL_STRING_SP;\r
-//                                     $element_len++;\r
-//                             }\r
-\r
-                               $i--;   // Look at this token again in the parent context\r
-                       }\r
-\r
-                       $token_prior = $token;\r
-                       break;\r
-               //-------------------------------------------------------------\r
-               // A context we aren't expecting\r
-               //-------------------------------------------------------------\r
-               default:\r
-                       die("Unknown context: $context");\r
-               }\r
-\r
-//-echo "<td>$context|",(($end_or_die) ? 'true' : 'false'),"|$token|" . max($return_status) . "</td></tr>"; // debug\r
-               if ((int) max($return_status) > ISEMAIL_RFC5322) break; // No point going on if we've got a fatal error\r
-       }\r
-\r
-       // Some simple final tests\r
-       if ((int) max($return_status) < ISEMAIL_RFC5322) {\r
-               if      ($context       === ISEMAIL_CONTEXT_QUOTEDSTRING)       $return_status[]        = ISEMAIL_ERR_UNCLOSEDQUOTEDSTR;        // Fatal error\r
-               elseif  ($context       === ISEMAIL_CONTEXT_QUOTEDPAIR)         $return_status[]        = ISEMAIL_ERR_BACKSLASHEND;             // Fatal error\r
-               elseif  ($context       === ISEMAIL_CONTEXT_COMMENT)            $return_status[]        = ISEMAIL_ERR_UNCLOSEDCOMMENT;          // Fatal error\r
-               elseif  ($context       === ISEMAIL_COMPONENT_LITERAL)          $return_status[]        = ISEMAIL_ERR_UNCLOSEDDOMLIT;           // Fatal error\r
-               elseif  ($token         === ISEMAIL_STRING_CR)                  $return_status[]        = ISEMAIL_ERR_FWS_CRLF_END;             // Fatal error\r
-               elseif  ($parsedata[ISEMAIL_COMPONENT_DOMAIN]   === '')         $return_status[]        = ISEMAIL_ERR_NODOMAIN;                 // Fatal error\r
-               elseif  ($element_len   === 0)                                  $return_status[]        = ISEMAIL_ERR_DOT_END;                  // Fatal error\r
-               elseif  ($hyphen_flag)                                          $return_status[]        = ISEMAIL_ERR_DOMAINHYPHENEND;          // Fatal error\r
-               // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.2\r
-               //   The maximum total length of a domain name or number is 255 octets.\r
-               elseif  (strlen($parsedata[ISEMAIL_COMPONENT_DOMAIN]) > 255)\r
-                                                                               $return_status[]        = ISEMAIL_RFC5322_DOMAIN_TOOLONG;\r
-               // http://tools.ietf.org/html/rfc5321#section-4.1.2\r
-               //   Forward-path   = Path\r
-               //\r
-               //   Path           = "<" [ A-d-l ":" ] Mailbox ">"\r
-               //\r
-               // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3\r
-               //   The maximum total length of a reverse-path or forward-path is 256\r
-               //   octets (including the punctuation and element separators).\r
-               //\r
-               // Thus, even without (obsolete) routing information, the Mailbox can\r
-               // only be 254 characters long. This is confirmed by this verified\r
-               // erratum to RFC 3696:\r
-               //\r
-               // http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690\r
-               //   However, there is a restriction in RFC 2821 on the length of an\r
-               //   address in MAIL and RCPT commands of 254 characters.  Since addresses\r
-               //   that do not fit in those fields are not normally useful, the upper\r
-               //   limit on address lengths should normally be considered to be 254.\r
-               elseif  (strlen($parsedata[ISEMAIL_COMPONENT_LOCALPART] . ISEMAIL_STRING_AT . $parsedata[ISEMAIL_COMPONENT_DOMAIN]) > 254)\r
-                                                                               $return_status[]        = ISEMAIL_RFC5322_TOOLONG;\r
-               // http://tools.ietf.org/html/rfc1035#section-2.3.4\r
-               // labels          63 octets or less\r
-               elseif ($element_len > 63)                                      $return_status[]        = ISEMAIL_RFC5322_LABEL_TOOLONG;\r
-       }\r
-\r
-       // Check DNS?\r
-       $dns_checked = false;\r
-\r
-       if ($checkDNS && ((int) max($return_status) < ISEMAIL_DNSWARN) && function_exists('dns_get_record')) {\r
-               // http://tools.ietf.org/html/rfc5321#section-2.3.5\r
-               //   Names that can\r
-               //   be resolved to MX RRs or address (i.e., A or AAAA) RRs (as discussed\r
-               //   in Section 5) are permitted, as are CNAME RRs whose targets can be\r
-               //   resolved, in turn, to MX or address RRs.\r
-               //\r
-               // http://tools.ietf.org/html/rfc5321#section-5.1\r
-               //   The lookup first attempts to locate an MX record associated with the\r
-               //   name.  If a CNAME record is found, the resulting name is processed as\r
-               //   if it were the initial name. ... If an empty list of MXs is returned,\r
-               //   the address is treated as if it was associated with an implicit MX\r
-               //   RR, with a preference of 0, pointing to that host.\r
-               //\r
-               // is_email() author's note: We will regard the existence of a CNAME to be\r
-               // sufficient evidence of the domain's existence. For performance reasons\r
-               // we will not repeat the DNS lookup for the CNAME's target, but we will\r
-               // raise a warning because we didn't immediately find an MX record.\r
-               if ($element_count === 0) $parsedata[ISEMAIL_COMPONENT_DOMAIN] .= '.';          // Checking TLD DNS seems to work only if you explicitly check from the root\r
-\r
-               $result = @dns_get_record($parsedata[ISEMAIL_COMPONENT_DOMAIN], DNS_MX);        // Not using checkdnsrr because of a suspected bug in PHP 5.3 (http://bugs.php.net/bug.php?id=51844)\r
-\r
-               if ((is_bool($result) && !(bool) $result))\r
-                       $return_status[] = ISEMAIL_DNSWARN_NO_RECORD;                   // Domain can't be found in DNS\r
-               else {\r
-                       if (count($result) === 0) {\r
-                               $return_status[]        = ISEMAIL_DNSWARN_NO_MX_RECORD;         // MX-record for domain can't be found\r
-                               $result                 = @dns_get_record($parsedata[ISEMAIL_COMPONENT_DOMAIN], DNS_A + DNS_CNAME);\r
-\r
-                               if (count($result) === 0)\r
-                                       $return_status[] = ISEMAIL_DNSWARN_NO_RECORD;           // No usable records for the domain can be found\r
-                       } else $dns_checked = true;\r
-               }\r
-       }\r
-\r
-       // Check for TLD addresses\r
-       // -----------------------\r
-       // TLD addresses are specifically allowed in RFC 5321 but they are\r
-       // unusual to say the least. We will allocate a separate\r
-       // status to these addresses on the basis that they are more likely\r
-       // to be typos than genuine addresses (unless we've already\r
-       // established that the domain does have an MX record)\r
-       //\r
-       // http://tools.ietf.org/html/rfc5321#section-2.3.5\r
-       //   In the case\r
-       //   of a top-level domain used by itself in an email address, a single\r
-       //   string is used without any dots.  This makes the requirement,\r
-       //   described in more detail below, that only fully-qualified domain\r
-       //   names appear in SMTP transactions on the public Internet,\r
-       //   particularly important where top-level domains are involved.\r
-       //\r
-       // TLD format\r
-       // ----------\r
-       // The format of TLDs has changed a number of times. The standards\r
-       // used by IANA have been largely ignored by ICANN, leading to\r
-       // confusion over the standards being followed. These are not defined\r
-       // anywhere, except as a general component of a DNS host name (a label).\r
-       // However, this could potentially lead to 123.123.123.123 being a\r
-       // valid DNS name (rather than an IP address) and thereby creating\r
-       // an ambiguity. The most authoritative statement on TLD formats that\r
-       // the author can find is in a (rejected!) erratum to RFC 1123\r
-       // submitted by John Klensin, the author of RFC 5321:\r
-       //\r
-       // http://www.rfc-editor.org/errata_search.php?rfc=1123&eid=1353\r
-       //   However, a valid host name can never have the dotted-decimal\r
-       //   form #.#.#.#, since this change does not permit the highest-level\r
-       //   component label to start with a digit even if it is not all-numeric.\r
-       if (!$dns_checked && ((int) max($return_status) < ISEMAIL_DNSWARN)) {\r
-               if      ($element_count === 0)  $return_status[]        = ISEMAIL_RFC5321_TLD;\r
-\r
-               if      (is_numeric($atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count][0]))\r
-                                               $return_status[]        = ISEMAIL_RFC5321_TLDNUMERIC;\r
-       }\r
-\r
-       $return_status          = array_unique($return_status);\r
-       $final_status           = (int) max($return_status);\r
-\r
-       if (count($return_status) !== 1) array_shift($return_status); // remove redundant ISEMAIL_VALID\r
-\r
-       $parsedata['status']    = $return_status;\r
-\r
-       if ($final_status < $threshold) $final_status = ISEMAIL_VALID;\r
-\r
-       return ($diagnose) ? $final_status : ($final_status < ISEMAIL_THRESHOLD);\r
-}\r
-?>\r
+<?php
+/**
+ * To validate an email address according to RFCs 5321, 5322 and others
+ *
+ * Copyright © 2008-2011, Dominic Sayers
+ * Test schema documentation Copyright © 2011, Daniel Marschall
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     - Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *     - Redistributions in binary form must reproduce the above copyright notice,
+ *       this list of conditions and the following disclaimer in the documentation
+ *       and/or other materials provided with the distribution.
+ *     - Neither the name of Dominic Sayers nor the names of its contributors may be
+ *       used to endorse or promote products derived from this software without
+ *       specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @package    is_email
+ * @author     Dominic Sayers <dominic@sayers.cc>
+ * @copyright  2008-2011 Dominic Sayers
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @link       http://www.dominicsayers.com/isemail
+ * @version    3.04.1 - Changed my link to http://isemail.info throughout
+ */
+
+// The quality of this code has been improved greatly by using PHPLint
+// Copyright (c) 2010 Umberto Salsi
+// This is free software; see the license for copying conditions.
+// More info: http://www.icosaedro.it/phplint/
+/*.
+       require_module 'standard';
+       require_module 'pcre';
+.*/
+
+if (!defined('ISEMAIL_VALID')) {
+/*:diagnostic constants start:*/
+// This part of the code is generated using data from test/meta.xml. Beware of making manual alterations
+       // Categories
+       define('ISEMAIL_VALID_CATEGORY', 1);
+       define('ISEMAIL_DNSWARN', 7);
+       define('ISEMAIL_RFC5321', 15);
+       define('ISEMAIL_CFWS', 31);
+       define('ISEMAIL_DEPREC', 63);
+       define('ISEMAIL_RFC5322', 127);
+       define('ISEMAIL_ERR', 255);
+
+       // Diagnoses
+       // Address is valid
+       define('ISEMAIL_VALID', 0);
+       // Address is valid but a DNS check was not successful
+       define('ISEMAIL_DNSWARN_NO_MX_RECORD', 5);
+       define('ISEMAIL_DNSWARN_NO_RECORD', 6);
+       // Address is valid for SMTP but has unusual elements
+       define('ISEMAIL_RFC5321_TLD', 9);
+       define('ISEMAIL_RFC5321_TLDNUMERIC', 10);
+       define('ISEMAIL_RFC5321_QUOTEDSTRING', 11);
+       define('ISEMAIL_RFC5321_ADDRESSLITERAL', 12);
+       define('ISEMAIL_RFC5321_IPV6DEPRECATED', 13);
+       // Address is valid within the message but cannot be used unmodified for the envelope
+       define('ISEMAIL_CFWS_COMMENT', 17);
+       define('ISEMAIL_CFWS_FWS', 18);
+       // Address contains deprecated elements but may still be valid in restricted contexts
+       define('ISEMAIL_DEPREC_LOCALPART', 33);
+       define('ISEMAIL_DEPREC_FWS', 34);
+       define('ISEMAIL_DEPREC_QTEXT', 35);
+       define('ISEMAIL_DEPREC_QP', 36);
+       define('ISEMAIL_DEPREC_COMMENT', 37);
+       define('ISEMAIL_DEPREC_CTEXT', 38);
+       define('ISEMAIL_DEPREC_CFWS_NEAR_AT', 49);
+       // The address is only valid according to the broad definition of RFC 5322. It is otherwise invalid.
+       define('ISEMAIL_RFC5322_DOMAIN', 65);
+       define('ISEMAIL_RFC5322_TOOLONG', 66);
+       define('ISEMAIL_RFC5322_LOCAL_TOOLONG', 67);
+       define('ISEMAIL_RFC5322_DOMAIN_TOOLONG', 68);
+       define('ISEMAIL_RFC5322_LABEL_TOOLONG', 69);
+       define('ISEMAIL_RFC5322_DOMAINLITERAL', 70);
+       define('ISEMAIL_RFC5322_DOMLIT_OBSDTEXT', 71);
+       define('ISEMAIL_RFC5322_IPV6_GRPCOUNT', 72);
+       define('ISEMAIL_RFC5322_IPV6_2X2XCOLON', 73);
+       define('ISEMAIL_RFC5322_IPV6_BADCHAR', 74);
+       define('ISEMAIL_RFC5322_IPV6_MAXGRPS', 75);
+       define('ISEMAIL_RFC5322_IPV6_COLONSTRT', 76);
+       define('ISEMAIL_RFC5322_IPV6_COLONEND', 77);
+       // Address is invalid for any purpose
+       define('ISEMAIL_ERR_EXPECTING_DTEXT', 129);
+       define('ISEMAIL_ERR_NOLOCALPART', 130);
+       define('ISEMAIL_ERR_NODOMAIN', 131);
+       define('ISEMAIL_ERR_CONSECUTIVEDOTS', 132);
+       define('ISEMAIL_ERR_ATEXT_AFTER_CFWS', 133);
+       define('ISEMAIL_ERR_ATEXT_AFTER_QS', 134);
+       define('ISEMAIL_ERR_ATEXT_AFTER_DOMLIT', 135);
+       define('ISEMAIL_ERR_EXPECTING_QPAIR', 136);
+       define('ISEMAIL_ERR_EXPECTING_ATEXT', 137);
+       define('ISEMAIL_ERR_EXPECTING_QTEXT', 138);
+       define('ISEMAIL_ERR_EXPECTING_CTEXT', 139);
+       define('ISEMAIL_ERR_BACKSLASHEND', 140);
+       define('ISEMAIL_ERR_DOT_START', 141);
+       define('ISEMAIL_ERR_DOT_END', 142);
+       define('ISEMAIL_ERR_DOMAINHYPHENSTART', 143);
+       define('ISEMAIL_ERR_DOMAINHYPHENEND', 144);
+       define('ISEMAIL_ERR_UNCLOSEDQUOTEDSTR', 145);
+       define('ISEMAIL_ERR_UNCLOSEDCOMMENT', 146);
+       define('ISEMAIL_ERR_UNCLOSEDDOMLIT', 147);
+       define('ISEMAIL_ERR_FWS_CRLF_X2', 148);
+       define('ISEMAIL_ERR_FWS_CRLF_END', 149);
+       define('ISEMAIL_ERR_CR_NO_LF', 150);
+// End of generated code
+/*:diagnostic constants end:*/
+
+       // function control
+       define('ISEMAIL_THRESHOLD', 16);
+
+       // Email parts
+       define('ISEMAIL_COMPONENT_LOCALPART', 0);
+       define('ISEMAIL_COMPONENT_DOMAIN', 1);
+       define('ISEMAIL_COMPONENT_LITERAL', 2);
+       define('ISEMAIL_CONTEXT_COMMENT', 3);
+       define('ISEMAIL_CONTEXT_FWS', 4);
+       define('ISEMAIL_CONTEXT_QUOTEDSTRING', 5);
+       define('ISEMAIL_CONTEXT_QUOTEDPAIR', 6);
+
+       // Miscellaneous string constants
+       define('ISEMAIL_STRING_AT', '@');
+       define('ISEMAIL_STRING_BACKSLASH', '\\');
+       define('ISEMAIL_STRING_DOT', '.');
+       define('ISEMAIL_STRING_DQUOTE', '"');
+       define('ISEMAIL_STRING_OPENPARENTHESIS', '(');
+       define('ISEMAIL_STRING_CLOSEPARENTHESIS', ')');
+       define('ISEMAIL_STRING_OPENSQBRACKET', '[');
+       define('ISEMAIL_STRING_CLOSESQBRACKET', ']');
+       define('ISEMAIL_STRING_HYPHEN', '-');
+       define('ISEMAIL_STRING_COLON', ':');
+       define('ISEMAIL_STRING_DOUBLECOLON', '::');
+       define('ISEMAIL_STRING_SP', ' ');
+       define('ISEMAIL_STRING_HTAB', "\t");
+       define('ISEMAIL_STRING_CR', "\r");
+       define('ISEMAIL_STRING_LF', "\n");
+       define('ISEMAIL_STRING_IPV6TAG', 'IPv6:');
+       // US-ASCII visible characters not valid for atext (http://tools.ietf.org/html/rfc5322#section-3.2.3)
+       define('ISEMAIL_STRING_SPECIALS', '()<>[]:;@\\,."');
+}
+
+/**
+ * Check that an email address conforms to RFCs 5321, 5322 and others
+ *
+ * As of Version 3.0, we are now distinguishing clearly between a Mailbox
+ * as defined by RFC 5321 and an addr-spec as defined by RFC 5322. Depending
+ * on the context, either can be regarded as a valid email address. The
+ * RFC 5321 Mailbox specification is more restrictive (comments, white space
+ * and obsolete forms are not allowed)
+ *
+ * @param string       $email          The email address to check
+ * @param boolean      $checkDNS       If true then a DNS check for MX records will be made
+ * @param mixed                $errorlevel     Determines the boundary between valid and invalid addresses.
+ *                                     Status codes above this number will be returned as-is,
+ *                                     status codes below will be returned as ISEMAIL_VALID. Thus the
+ *                                     calling program can simply look for ISEMAIL_VALID if it is
+ *                                     only interested in whether an address is valid or not. The
+ *                                     errorlevel will determine how "picky" is_email() is about
+ *                                     the address.
+ *
+ *                                     If omitted or passed as false then is_email() will return
+ *                                     true or false rather than an integer error or warning.
+ *
+ *                                     NB Note the difference between $errorlevel = false and
+ *                                     $errorlevel = 0
+ * @param array                $parsedata      If passed, returns the parsed address components
+ */
+/*.mixed.*/ function is_email($email, $checkDNS = false, $errorlevel = false, &$parsedata = array()) {
+       // Check that $email is a valid address. Read the following RFCs to understand the constraints:
+       //      (http://tools.ietf.org/html/rfc5321)
+       //      (http://tools.ietf.org/html/rfc5322)
+       //      (http://tools.ietf.org/html/rfc4291#section-2.2)
+       //      (http://tools.ietf.org/html/rfc1123#section-2.1)
+       //      (http://tools.ietf.org/html/rfc3696) (guidance only)
+       // version 2.0: Enhance $diagnose parameter to $errorlevel
+       // version 3.0: Introduced status categories
+       // revision 3.1: BUG: $parsedata was passed by value instead of by reference
+
+       if (is_bool($errorlevel)) {
+               $threshold      = ISEMAIL_VALID;
+               $diagnose       = (bool) $errorlevel;
+       } else {
+               $diagnose       = true;
+
+               switch ((int) $errorlevel) {
+                       case E_WARNING:
+                               $threshold      = ISEMAIL_THRESHOLD;
+                               break;  // For backward compatibility
+                       case E_ERROR:
+                               $threshold      = ISEMAIL_VALID;
+                               break;  // For backward compatibility
+                       default:
+                               $threshold      = (int) $errorlevel;
+               }
+       }
+
+       $return_status = array(ISEMAIL_VALID);
+
+       // Parse the address into components, character by character
+       $raw_length     = strlen($email);
+       $context        = ISEMAIL_COMPONENT_LOCALPART;  // Where we are
+       $context_stack  = array($context);              // Where we have been
+       $context_prior  = ISEMAIL_COMPONENT_LOCALPART;  // Where we just came from
+       $token          = '';                           // The current character
+       $token_prior    = '';                           // The previous character
+       $parsedata      = array(
+               ISEMAIL_COMPONENT_LOCALPART     => '',
+               ISEMAIL_COMPONENT_DOMAIN        => ''
+       );                      // For the components of the address
+
+       $atomlist       = array(
+               ISEMAIL_COMPONENT_LOCALPART     => array(''),
+               ISEMAIL_COMPONENT_DOMAIN        => array('')
+       );                      // For the dot-atom elements of the address
+       $element_count  = 0;
+       $element_len    = 0;
+       $hyphen_flag    = false;                        // Hyphen cannot occur at the end of a subdomain
+       $end_or_die     = false;                        // CFWS can only appear at the end of the element
+
+//-echo "<table style=\"clear:left;\">"; // debug
+       for ($i = 0; $i < $raw_length; $i++) {
+               $token = $email[$i];
+//-echo "<tr><td><strong>$context|",(($end_or_die) ? 'true' : 'false'),
+//"|$token|" . max($return_status) . "</strong></td>"; // debug
+
+               switch ($context) {
+                       //-------------------------------------------------------------
+                       // local-part
+                       //-------------------------------------------------------------
+                       case ISEMAIL_COMPONENT_LOCALPART:
+                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                               //   local-part      =   dot-atom / quoted-string / obs-local-part
+                               //
+                               //   dot-atom        =   [CFWS] dot-atom-text [CFWS]
+                               //
+                               //   dot-atom-text   =   1*atext *("." 1*atext)
+                               //
+                               //   quoted-string   =   [CFWS]
+                               //                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE
+                               //                       [CFWS]
+                               //
+                               //   obs-local-part  =   word *("." word)
+                               //
+                               //   word            =   atom / quoted-string
+                               //
+                               //   atom            =   [CFWS] 1*atext [CFWS]
+                               switch ($token) {
+                                       // Comment
+                                       case ISEMAIL_STRING_OPENPARENTHESIS:
+                                               if ($element_len === 0) {
+                                                       // Comments are OK at the beginning of an element
+                                                       $return_status[] = ($element_count === 0) ?
+                                                               ISEMAIL_CFWS_COMMENT : ISEMAIL_DEPREC_COMMENT;
+                                               } else {
+                                                       $return_status[] = ISEMAIL_CFWS_COMMENT;
+                                                       $end_or_die = true;
+                                                       // We can't start a comment in the middle of an element, so this better be the end
+                                               }
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_COMMENT;
+                                               break;
+                                       // Next dot-atom element
+                                       case ISEMAIL_STRING_DOT:
+                                               if ($element_len === 0) {
+                                                       // Another dot, already?
+                                                       // Fatal error
+                                                       $return_status[] = ($element_count === 0)
+                                                               ? ISEMAIL_ERR_DOT_START : ISEMAIL_ERR_CONSECUTIVEDOTS;
+                                               } else {
+                                                       // The entire local-part can be a quoted string for RFC 5321
+                                                       // If it's just one atom that is quoted then it's an RFC 5322 obsolete form
+                                                       if ($end_or_die) {
+                                                               $return_status[] = ISEMAIL_DEPREC_LOCALPART;
+                                                       }
+                                               }
+                                               // CFWS & quoted strings are OK again now we're at the beginning of an element
+                                               // (although they are obsolete forms)
+                                               $end_or_die     = false;
+                                               $element_len    = 0;
+                                               $element_count++;
+                                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  = '';
+                                               break;
+                                       // Quoted string
+                                       case ISEMAIL_STRING_DQUOTE:
+                                               if ($element_len === 0) {
+                                                       // The entire local-part can be a quoted string for RFC 5321
+                                                       // If it's just one atom that is quoted then it's an RFC 5322 obsolete form
+                                                       $return_status[] = ($element_count === 0)
+                                                               ? ISEMAIL_RFC5321_QUOTEDSTRING : ISEMAIL_DEPREC_LOCALPART;
+
+                                                       $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;
+                                                       $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;
+                                                       $element_len++;
+                                                       $end_or_die             = true; // Quoted string must be the entire element
+                                                       $context_stack[]        = $context;
+                                                       $context                = ISEMAIL_CONTEXT_QUOTEDSTRING;
+                                               } else {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error
+                                               }
+
+                                               break;
+                                       // Folding White Space
+                                       case ISEMAIL_STRING_CR:
+                                       case ISEMAIL_STRING_SP:
+                                       case ISEMAIL_STRING_HTAB:
+                                               if (($token === ISEMAIL_STRING_CR)
+                                                       && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {
+                                                       $return_status[] = ISEMAIL_ERR_CR_NO_LF;
+                                                       break;
+                                               }       // Fatal error
+
+                                               if ($element_len === 0) {
+                                                       $return_status[] = ($element_count === 0) ? ISEMAIL_CFWS_FWS : ISEMAIL_DEPREC_FWS;
+                                               } else {
+                                                       // We can't start FWS in the middle of an element, so this better be the end
+                                                       $end_or_die = true;
+                                               }
+
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_FWS;
+                                               $token_prior            = $token;
+
+                                               break;
+                                       // @
+                                       case ISEMAIL_STRING_AT:
+                                               // At this point we should have a valid local-part
+                                               if (count($context_stack) !== 1) {
+                                                       die('Unexpected item on context stack');
+                                               }
+
+                                               if ($parsedata[ISEMAIL_COMPONENT_LOCALPART] === '') {
+                                                       $return_status[]        = ISEMAIL_ERR_NOLOCALPART;      // Fatal error
+                                               } elseif ($element_len === 0) {
+                                                       $return_status[]        = ISEMAIL_ERR_DOT_END;  // Fatal error
+                                               } elseif (strlen($parsedata[ISEMAIL_COMPONENT_LOCALPART]) > 64) {
+                                                       // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.1
+                                                       //   The maximum total length of a user name or other local-part is 64
+                                                       //   octets.
+                                                       $return_status[]        = ISEMAIL_RFC5322_LOCAL_TOOLONG;
+                                               } elseif (($context_prior === ISEMAIL_CONTEXT_COMMENT) || ($context_prior === ISEMAIL_CONTEXT_FWS)) {
+                                                       // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                                                       //   Comments and folding white space
+                                                       //   SHOULD NOT be used around the "@" in the addr-spec.
+                                                       //
+                                                       // http://tools.ietf.org/html/rfc2119
+                                                       // 4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean that
+                                                       //    there may exist valid reasons in particular circumstances when the
+                                                       //    particular behavior is acceptable or even useful, but the full
+                                                       //    implications should be understood and the case carefully weighed
+                                                       //    before implementing any behavior described with this label.
+                                                       $return_status[]        = ISEMAIL_DEPREC_CFWS_NEAR_AT;
+                                               }
+                                               // Clear everything down for the domain parsing
+                                               $context        = ISEMAIL_COMPONENT_DOMAIN;     // Where we are
+                                               $context_stack  = array($context);              // Where we have been
+                                               $element_count  = 0;
+                                               $element_len    = 0;
+                                               $end_or_die     = false;                        // CFWS can only appear at the end of the element
+
+                                               break;
+                                       // atext
+                                       default:
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.3
+                                               //    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
+                                               //                        "!" / "#" /        ;  characters not including
+                                               //                        "$" / "%" /        ;  specials.  Used for atoms.
+                                               //                        "&" / "'" /
+                                               //                        "*" / "+" /
+                                               //                        "-" / "/" /
+                                               //                        "=" / "?" /
+                                               //                        "^" / "_" /
+                                               //                        "`" / "{" /
+                                               //                        "|" / "}" /
+                                               //                        "~"
+                                               if ($end_or_die) {
+                                                       // We have encountered atext where it is no longer valid
+                                                       switch ($context_prior) {
+                                                               case ISEMAIL_CONTEXT_COMMENT:
+                                                               case ISEMAIL_CONTEXT_FWS:
+                                                                       $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_CFWS;
+                                                                       break;
+                                                               case ISEMAIL_CONTEXT_QUOTEDSTRING:
+                                                                       $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_QS;
+                                                                       break;
+                                                               default:
+                                                                       die("More atext found where none is allowed, but unrecognised prior context: $context_prior");
+                                                       }
+                                               } else {
+                                                       $context_prior  = $context;
+                                                       $ord            = ord($token);
+                                                       if (($ord < 33) || ($ord > 126) || ($ord === 10)
+                                                               || (!is_bool(strpos(ISEMAIL_STRING_SPECIALS, $token)))) {
+                                                               $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error
+                                                       }
+
+                                                       $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;
+                                                       $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;
+                                                       $element_len++;
+                                               }
+                               }
+                               break;
+                       //-------------------------------------------------------------
+                       // Domain
+                       //-------------------------------------------------------------
+                       case ISEMAIL_COMPONENT_DOMAIN:
+                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                               //   domain          =   dot-atom / domain-literal / obs-domain
+                               //
+                               //   dot-atom        =   [CFWS] dot-atom-text [CFWS]
+                               //
+                               //   dot-atom-text   =   1*atext *("." 1*atext)
+                               //
+                               //   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
+                               //
+                               //   dtext           =   %d33-90 /          ; Printable US-ASCII
+                               //                       %d94-126 /         ;  characters not including
+                               //                       obs-dtext          ;  "[", "]", or "\"
+                               //
+                               //   obs-domain      =   atom *("." atom)
+                               //
+                               //   atom            =   [CFWS] 1*atext [CFWS]
+
+
+                               // http://tools.ietf.org/html/rfc5321#section-4.1.2
+                               //   Mailbox        = Local-part "@" ( Domain / address-literal )
+                               //
+                               //   Domain         = sub-domain *("." sub-domain)
+                               //
+                               //   address-literal  = "[" ( IPv4-address-literal /
+                               //                    IPv6-address-literal /
+                               //                    General-address-literal ) "]"
+                               //                    ; See Section 4.1.3
+
+                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                               //      Note: A liberal syntax for the domain portion of addr-spec is
+                               //      given here.  However, the domain portion contains addressing
+                               //      information specified by and used in other protocols (e.g.,
+                               //      [RFC1034], [RFC1035], [RFC1123], [RFC5321]).  It is therefore
+                               //      incumbent upon implementations to conform to the syntax of
+                               //      addresses for the context in which they are used.
+                               // is_email() author's note: it's not clear how to interpret this in
+                               // the context of a general email address validator. The conclusion I
+                               // have reached is this: "addressing information" must comply with
+                               // RFC 5321 (and in turn RFC 1035), anything that is "semantically
+                               // invisible" must comply only with RFC 5322.
+                               switch ($token) {
+                                       // Comment
+                                       case ISEMAIL_STRING_OPENPARENTHESIS:
+                                               if ($element_len === 0) {
+                                                       // Comments at the start of the domain are deprecated in the text
+                                                       // Comments at the start of a subdomain are obs-domain
+                                                       // (http://tools.ietf.org/html/rfc5322#section-3.4.1)
+                                                       $return_status[] = ($element_count === 0) ?
+                                                               ISEMAIL_DEPREC_CFWS_NEAR_AT : ISEMAIL_DEPREC_COMMENT;
+                                               } else {
+                                                       $return_status[] = ISEMAIL_CFWS_COMMENT;
+                                                       // We can't start a comment in the middle of an element, so this better be the end
+                                                       $end_or_die = true;
+                                               }
+
+                                               $context_stack[] = $context;
+                                               $context = ISEMAIL_CONTEXT_COMMENT;
+                                               break;
+                                       // Next dot-atom element
+                                       case ISEMAIL_STRING_DOT:
+                                               if ($element_len === 0) {
+                                                       // Another dot, already?
+                                                       $return_status[] = ($element_count === 0) ?
+                                                               ISEMAIL_ERR_DOT_START : ISEMAIL_ERR_CONSECUTIVEDOTS; // Fatal error
+                                               } elseif ($hyphen_flag) {
+                                                       // Previous subdomain ended in a hyphen
+                                                       $return_status[] = ISEMAIL_ERR_DOMAINHYPHENEND; // Fatal error
+                                               } else {
+                                                       // Nowhere in RFC 5321 does it say explicitly that the
+                                                       // domain part of a Mailbox must be a valid domain according
+                                                       // to the DNS standards set out in RFC 1035, but this *is*
+                                                       // implied in several places. For instance, wherever the idea
+                                                       // of host routing is discussed the RFC says that the domain
+                                                       // must be looked up in the DNS. This would be nonsense unless
+                                                       // the domain was designed to be a valid DNS domain. Hence we
+                                                       // must conclude that the RFC 1035 restriction on label length
+                                                       // also applies to RFC 5321 domains.
+                                                       //
+                                                       // http://tools.ietf.org/html/rfc1035#section-2.3.4
+                                                       // labels          63 octets or less
+                                                       if ($element_len > 63) {
+                                                               $return_status[] = ISEMAIL_RFC5322_LABEL_TOOLONG;
+                                                       }
+                                               }
+                                               // CFWS is OK again now we're at the beginning of an element
+                                               // (although it may be obsolete CFWS)
+                                               $end_or_die = false;
+                                               $element_len            = 0;
+                                               $element_count++;
+                                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     = '';
+                                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;
+
+                                               break;
+                                       // Domain literal
+                                       case ISEMAIL_STRING_OPENSQBRACKET:
+                                               if ($parsedata[ISEMAIL_COMPONENT_DOMAIN] === '') {
+                                                       $end_or_die             = true; // Domain literal must be the only component
+                                                       $element_len++;
+                                                       $context_stack[]        = $context;
+                                                       $context                = ISEMAIL_COMPONENT_LITERAL;
+                                                       $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;
+                                                       $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;
+                                                       $parsedata[ISEMAIL_COMPONENT_LITERAL]                   = '';
+                                               } else {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error
+                                               }
+
+                                               break;
+                                       // Folding White Space
+                                       case ISEMAIL_STRING_CR:
+                                       case ISEMAIL_STRING_SP:
+                                       case ISEMAIL_STRING_HTAB:
+                                               if (($token === ISEMAIL_STRING_CR) && ((++$i === $raw_length)
+                                                       || ($email[$i] !== ISEMAIL_STRING_LF))) {
+                                                       $return_status[] = ISEMAIL_ERR_CR_NO_LF;
+                                                       break;
+                                               } // Fatal error
+
+                                               if ($element_len === 0) {
+                                                       $return_status[] = ($element_count === 0) ?
+                                                               ISEMAIL_DEPREC_CFWS_NEAR_AT : ISEMAIL_DEPREC_FWS;
+                                               } else {
+                                                       $return_status[] = ISEMAIL_CFWS_FWS;
+                                                       // We can't start FWS in the middle of an element, so this better be the end
+                                                       $end_or_die     = true;
+                                               }
+
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_FWS;
+                                               $token_prior            = $token;
+                                               break;
+                                       // atext
+                                       default:
+                                               // RFC 5322 allows any atext...
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.3
+                                               //    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
+                                               //                        "!" / "#" /        ;  characters not including
+                                               //                        "$" / "%" /        ;  specials.  Used for atoms.
+                                               //                        "&" / "'" /
+                                               //                        "*" / "+" /
+                                               //                        "-" / "/" /
+                                               //                        "=" / "?" /
+                                               //                        "^" / "_" /
+                                               //                        "`" / "{" /
+                                               //                        "|" / "}" /
+                                               //                        "~"
+
+                                               // But RFC 5321 only allows letter-digit-hyphen to comply with DNS rules (RFCs 1034 & 1123)
+                                               // http://tools.ietf.org/html/rfc5321#section-4.1.2
+                                               //   sub-domain     = Let-dig [Ldh-str]
+                                               //
+                                               //   Let-dig        = ALPHA / DIGIT
+                                               //
+                                               //   Ldh-str        = *( ALPHA / DIGIT / "-" ) Let-dig
+                                               //
+                                               if ($end_or_die) {
+                                                       // We have encountered atext where it is no longer valid
+                                                       switch ($context_prior) {
+                                                               case ISEMAIL_CONTEXT_COMMENT:
+                                                               case ISEMAIL_CONTEXT_FWS:
+                                                                       $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_CFWS;
+                                                                       break;
+                                                               case ISEMAIL_COMPONENT_LITERAL:
+                                                                       $return_status[]        = ISEMAIL_ERR_ATEXT_AFTER_DOMLIT;
+                                                                       break;
+                                                               default:
+                                                                       die("More atext found where none is allowed, but unrecognised prior context: $context_prior");
+                                                       }
+                                               }
+
+                                               $ord            = ord($token);
+                                               $hyphen_flag    = false;        // Assume this token isn't a hyphen unless we discover it is
+
+                                               if (($ord < 33) || ($ord > 126) || (!is_bool(strpos(ISEMAIL_STRING_SPECIALS, $token)))) {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_ATEXT;  // Fatal error
+                                               } elseif ($token === ISEMAIL_STRING_HYPHEN) {
+                                                       if ($element_len === 0) {
+                                                               // Hyphens can't be at the beginning of a subdomain
+                                                               $return_status[]        = ISEMAIL_ERR_DOMAINHYPHENSTART;        // Fatal error
+                                                       }
+
+                                                       $hyphen_flag = true;
+                                               } elseif (!(($ord > 47 && $ord < 58)
+                                                       || ($ord > 64 && $ord < 91)
+                                                       || ($ord > 96 && $ord < 123))) {
+                                                       // Not an RFC 5321 subdomain, but still OK by RFC 5322
+                                                       $return_status[]        = ISEMAIL_RFC5322_DOMAIN;
+                                               }
+
+                                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;
+                                               $element_len++;
+                               }
+                               break;
+                       //-------------------------------------------------------------
+                       // Domain literal
+                       //-------------------------------------------------------------
+                       case ISEMAIL_COMPONENT_LITERAL:
+                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                               //   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
+                               //
+                               //   dtext           =   %d33-90 /          ; Printable US-ASCII
+                               //                       %d94-126 /         ;  characters not including
+                               //                       obs-dtext          ;  "[", "]", or "\"
+                               //
+                               //   obs-dtext       =   obs-NO-WS-CTL / quoted-pair
+                               switch ($token) {
+                                       // End of domain literal
+                                       case ISEMAIL_STRING_CLOSESQBRACKET:
+                                               if ((int) max($return_status) < ISEMAIL_DEPREC) {
+                                                       // Could be a valid RFC 5321 address literal, so let's check
+
+                                                       // http://tools.ietf.org/html/rfc5321#section-4.1.2
+                                                       //   address-literal  = "[" ( IPv4-address-literal /
+                                                       //                    IPv6-address-literal /
+                                                       //                    General-address-literal ) "]"
+                                                       //                    ; See Section 4.1.3
+                                                       //
+                                                       // http://tools.ietf.org/html/rfc5321#section-4.1.3
+                                                       //   IPv4-address-literal  = Snum 3("."  Snum)
+                                                       //
+                                                       //   IPv6-address-literal  = "IPv6:" IPv6-addr
+                                                       //
+                                                       //   General-address-literal  = Standardized-tag ":" 1*dcontent
+                                                       //
+                                                       //   Standardized-tag  = Ldh-str
+                                                       //                     ; Standardized-tag MUST be specified in a
+                                                       //                     ; Standards-Track RFC and registered with IANA
+                                                       //
+                                                       //   dcontent       = %d33-90 / ; Printable US-ASCII
+                                                       //                  %d94-126 ; excl. "[", "\", "]"
+                                                       //
+                                                       //   Snum           = 1*3DIGIT
+                                                       //                  ; representing a decimal integer
+                                                       //                  ; value in the range 0 through 255
+                                                       //
+                                                       //   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
+                                                       //
+                                                       //   IPv6-hex       = 1*4HEXDIG
+                                                       //
+                                                       //   IPv6-full      = IPv6-hex 7(":" IPv6-hex)
+                                                       //
+                                                       //   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
+                                                       //                  [IPv6-hex *5(":" IPv6-hex)]
+                                                       //                  ; The "::" represents at least 2 16-bit groups of
+                                                       //                  ; zeros.  No more than 6 groups in addition to the
+                                                       //                  ; "::" may be present.
+                                                       //
+                                                       //   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
+                                                       //
+                                                       //   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
+                                                       //                  [IPv6-hex *3(":" IPv6-hex) ":"]
+                                                       //                  IPv4-address-literal
+                                                       //                  ; The "::" represents at least 2 16-bit groups of
+                                                       //                  ; zeros.  No more than 4 groups in addition to the
+                                                       //                  ; "::" and IPv4-address-literal may be present.
+                                                       //
+                                                       // is_email() author's note: We can't use ip2long() to validate
+                                                       // IPv4 addresses because it accepts abbreviated addresses
+                                                       // (xxx.xxx.xxx), expanding the last group to complete the address.
+                                                       // filter_var() validates IPv6 address inconsistently (up to PHP 5.3.3
+                                                       // at least) -- see http://bugs.php.net/bug.php?id=53236 for example
+                                                       $max_groups     = 8;
+                                                       $matchesIP      = array();
+                                       /*.mixed.*/     $index          = false;
+                                                       $addressliteral = $parsedata[ISEMAIL_COMPONENT_LITERAL];
+
+                                                       // Extract IPv4 part from the end of the address-literal (if there is one)
+                                                       if (preg_match(
+                                                               '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/',
+                                                               $addressliteral,
+                                                               $matchesIP
+                                                       ) > 0) {
+                                                               $index = strrpos($addressliteral, $matchesIP[0]);
+                                                               if ($index !== 0) {
+                                                                       // Convert IPv4 part to IPv6 format for further testing
+                                                                       $addressliteral = substr($addressliteral, 0, $index) . '0:0';
+                                                               }
+                                                       }
+
+                                                       if ($index === 0) {
+                                                               // Nothing there except a valid IPv4 address, so...
+                                                               $return_status[]        = ISEMAIL_RFC5321_ADDRESSLITERAL;
+                                                       } elseif (strncasecmp($addressliteral, ISEMAIL_STRING_IPV6TAG, 5) !== 0) {
+                                                               $return_status[]        = ISEMAIL_RFC5322_DOMAINLITERAL;
+                                                       } else {
+                                                               $IPv6           = substr($addressliteral, 5);
+                                                               // Revision 2.7: Daniel Marschall's new IPv6 testing strategy
+                                                               $matchesIP      = explode(ISEMAIL_STRING_COLON, $IPv6);
+                                                               $groupCount     = count($matchesIP);
+                                                               $index          = strpos($IPv6, ISEMAIL_STRING_DOUBLECOLON);
+
+                                                               if ($index === false) {
+                                                                       // We need exactly the right number of groups
+                                                                       if ($groupCount !== $max_groups) {
+                                                                               $return_status[]        = ISEMAIL_RFC5322_IPV6_GRPCOUNT;
+                                                                       }
+                                                               } else {
+                                                                       if ($index !== strrpos($IPv6, ISEMAIL_STRING_DOUBLECOLON)) {
+                                                                               $return_status[]        = ISEMAIL_RFC5322_IPV6_2X2XCOLON;
+                                                                       } else {
+                                                                               if ($index === 0 || $index === (strlen($IPv6) - 2)) {
+                                                                                       $max_groups++;
+                                                                                       // RFC 4291 allows :: at the start or end of an address with 7 other groups in addition
+                                                                               }
+
+                                                                               if ($groupCount > $max_groups) {
+                                                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_MAXGRPS;
+                                                                               } elseif ($groupCount === $max_groups) {
+                                                                                       $return_status[]        = ISEMAIL_RFC5321_IPV6DEPRECATED;       // Eliding a single "::"
+                                                                               }
+                                                                       }
+                                                               }
+
+                                                               // Revision 2.7: Daniel Marschall's new IPv6 testing strategy
+                                                               if ((substr($IPv6, 0, 1) === ISEMAIL_STRING_COLON) && (substr($IPv6, 1, 1) !== ISEMAIL_STRING_COLON)) {
+                                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_COLONSTRT;       // Address starts with a single colon
+                                                               } elseif ((substr($IPv6, -1) === ISEMAIL_STRING_COLON) && (substr($IPv6, -2, 1) !== ISEMAIL_STRING_COLON)) {
+                                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_COLONEND;        // Address ends with a single colon
+                                                               } elseif (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) {
+                                                                       $return_status[]        = ISEMAIL_RFC5322_IPV6_BADCHAR; // Check for unmatched characters
+                                                               } else {
+                                                                       $return_status[]        = ISEMAIL_RFC5321_ADDRESSLITERAL;
+                                                               }
+                                                       }
+                                               } else {
+                                                       $return_status[]        = ISEMAIL_RFC5322_DOMAINLITERAL;
+                                               }
+
+                                               $parsedata[ISEMAIL_COMPONENT_DOMAIN] .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count] .= $token;
+                                               $element_len++;
+                                               $context_prior = $context;
+                                               $context = (int) array_pop($context_stack);
+                                               break;
+                                       case ISEMAIL_STRING_BACKSLASH:
+                                               $return_status[]        = ISEMAIL_RFC5322_DOMLIT_OBSDTEXT;
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;
+                                               break;
+                                       // Folding White Space
+                                       case ISEMAIL_STRING_CR:
+                                       case ISEMAIL_STRING_SP:
+                                       case ISEMAIL_STRING_HTAB:
+                                               if (($token === ISEMAIL_STRING_CR)
+                                                       && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {
+                                                       $return_status[] = ISEMAIL_ERR_CR_NO_LF;
+                                                       break;
+                                               }       // Fatal error
+
+                                               $return_status[]        = ISEMAIL_CFWS_FWS;
+
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_FWS;
+                                               $token_prior            = $token;
+                                               break;
+                                       // dtext
+                                       default:
+                                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                                               //   dtext           =   %d33-90 /          ; Printable US-ASCII
+                                               //                       %d94-126 /         ;  characters not including
+                                               //                       obs-dtext          ;  "[", "]", or "\"
+                                               //
+                                               //   obs-dtext       =   obs-NO-WS-CTL / quoted-pair
+                                               //
+                                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
+                                               //                       %d11 /             ;  characters that do not
+                                               //                       %d12 /             ;  include the carriage
+                                               //                       %d14-31 /          ;  return, line feed, and
+                                               //                       %d127              ;  white space characters
+                                               $ord = ord($token);
+
+                                               // CR, LF, SP & HTAB have already been parsed above
+                                               if (($ord > 127) || ($ord === 0) || ($token === ISEMAIL_STRING_OPENSQBRACKET)) {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_DTEXT;  // Fatal error
+                                                       break;
+                                               } elseif (($ord < 33) || ($ord === 127)) {
+                                                       $return_status[]        = ISEMAIL_RFC5322_DOMLIT_OBSDTEXT;
+                                               }
+
+                                               $parsedata[ISEMAIL_COMPONENT_LITERAL]                   .= $token;
+                                               $parsedata[ISEMAIL_COMPONENT_DOMAIN]                    .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;
+                                               $element_len++;
+                               }
+                               break;
+                       //-------------------------------------------------------------
+                       // Quoted string
+                       //-------------------------------------------------------------
+                       case ISEMAIL_CONTEXT_QUOTEDSTRING:
+                               // http://tools.ietf.org/html/rfc5322#section-3.2.4
+                               //   quoted-string   =   [CFWS]
+                               //                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE
+                               //                       [CFWS]
+                               //
+                               //   qcontent        =   qtext / quoted-pair
+                               switch ($token) {
+                                       // Quoted pair
+                                       case ISEMAIL_STRING_BACKSLASH:
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;
+                                               break;
+                                       // Folding White Space
+                                       // Inside a quoted string, spaces are allowed as regular characters.
+                                       // It's only FWS if we include HTAB or CRLF
+                                       case ISEMAIL_STRING_CR:
+                                       case ISEMAIL_STRING_HTAB:
+                                               if (($token === ISEMAIL_STRING_CR)
+                                                       && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {
+                                                       $return_status[] = ISEMAIL_ERR_CR_NO_LF;
+                                                       break;
+                                               }// Fatal error
+
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.2
+                                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a
+                                               //   structured header field are semantically interpreted as a single
+                                               //   space character.
+
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.4
+                                               //   the CRLF in any FWS/CFWS that appears within the quoted-string [is]
+                                               //   semantically "invisible" and therefore not part of the quoted-string
+                                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= ISEMAIL_STRING_SP;
+                                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= ISEMAIL_STRING_SP;
+                                               $element_len++;
+
+                                               $return_status[]                = ISEMAIL_CFWS_FWS;
+                                               $context_stack[]                = $context;
+                                               $context                        = ISEMAIL_CONTEXT_FWS;
+                                               $token_prior                    = $token;
+                                               break;
+                                       // End of quoted string
+                                       case ISEMAIL_STRING_DQUOTE:
+                                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;
+                                               $element_len++;
+                                               $context_prior                  = $context;
+                                               $context                        = (int) array_pop($context_stack);
+                                               break;
+                                       // qtext
+                                       default:
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.4
+                                               //   qtext           =   %d33 /             ; Printable US-ASCII
+                                               //                       %d35-91 /          ;  characters not including
+                                               //                       %d93-126 /         ;  "\" or the quote character
+                                               //                       obs-qtext
+                                               //
+                                               //   obs-qtext       =   obs-NO-WS-CTL
+                                               //
+                                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
+                                               //                       %d11 /             ;  characters that do not
+                                               //                       %d12 /             ;  include the carriage
+                                               //                       %d14-31 /          ;  return, line feed, and
+                                               //                       %d127              ;  white space characters
+                                               $ord = ord($token);
+
+                                               if (($ord > 127) || ($ord === 0) || ($ord === 10)) {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_QTEXT;  // Fatal error
+                                               } elseif (($ord < 32) || ($ord === 127)) {
+                                                       $return_status[]        = ISEMAIL_DEPREC_QTEXT;
+                                               }
+
+                                               $parsedata[ISEMAIL_COMPONENT_LOCALPART]                 .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;
+                                               $element_len++;
+                               }
+
+                               // http://tools.ietf.org/html/rfc5322#section-3.4.1
+                               //   If the
+                               //   string can be represented as a dot-atom (that is, it contains no
+                               //   characters other than atext characters or "." surrounded by atext
+                               //   characters), then the dot-atom form SHOULD be used and the quoted-
+                               //   string form SHOULD NOT be used.
+                               //   To do
+                               break;
+                       //-------------------------------------------------------------
+                       // Quoted pair
+                       //-------------------------------------------------------------
+                       case ISEMAIL_CONTEXT_QUOTEDPAIR:
+                               // http://tools.ietf.org/html/rfc5322#section-3.2.1
+                               //   quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp
+                               //
+                               //   VCHAR           =  %d33-126            ; visible (printing) characters
+                               //   WSP             =  SP / HTAB           ; white space
+                               //
+                               //   obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)
+                               //
+                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
+                               //                       %d11 /             ;  characters that do not
+                               //                       %d12 /             ;  include the carriage
+                               //                       %d14-31 /          ;  return, line feed, and
+                               //                       %d127              ;  white space characters
+                               //
+                               // i.e. obs-qp       =  "\" (%d0-8, %d10-31 / %d127)
+                               $ord = ord($token);
+
+                               if ($ord > 127) {
+                                               $return_status[]        = ISEMAIL_ERR_EXPECTING_QPAIR;  // Fatal error
+                               } elseif ((($ord < 31) && ($ord !== 9)) || ($ord === 127)) {
+                                       // SP & HTAB are allowed
+                                       $return_status[]        = ISEMAIL_DEPREC_QP;
+                               }
+
+                               // At this point we know where this qpair occurred so
+                               // we could check to see if the character actually
+                               // needed to be quoted at all.
+                               // http://tools.ietf.org/html/rfc5321#section-4.1.2
+                               //   the sending system SHOULD transmit the
+                               //   form that uses the minimum quoting possible.
+                               // To do: check whether the character needs to be quoted (escaped) in this context
+                               $context_prior  = $context;
+                               $context        = (int) array_pop($context_stack);      // End of qpair
+                               $token          = ISEMAIL_STRING_BACKSLASH . $token;
+
+                               switch ($context) {
+                                       case ISEMAIL_CONTEXT_COMMENT:
+                                               break;
+                                       case ISEMAIL_CONTEXT_QUOTEDSTRING:
+                                               $parsedata[ISEMAIL_COMPONENT_LOCALPART] .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_LOCALPART][$element_count]  .= $token;
+                                               $element_len    += 2;
+                                               // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash
+                                               break;
+                                       case ISEMAIL_COMPONENT_LITERAL:
+                                               $parsedata[ISEMAIL_COMPONENT_DOMAIN] .= $token;
+                                               $atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count]     .= $token;
+                                               $element_len    += 2;
+                                               // The maximum sizes specified by RFC 5321 are octet counts, so we must include the backslash
+                                               break;
+                                       default:
+                                               die("Quoted pair logic invoked in an invalid context: $context");
+                               }
+
+                               break;
+                       //-------------------------------------------------------------
+                       // Comment
+                       //-------------------------------------------------------------
+                       case ISEMAIL_CONTEXT_COMMENT:
+                               // http://tools.ietf.org/html/rfc5322#section-3.2.2
+                               //   comment         =   "(" *([FWS] ccontent) [FWS] ")"
+                               //
+                               //   ccontent        =   ctext / quoted-pair / comment
+                               switch ($token) {
+                                       // Nested comment
+                                       case ISEMAIL_STRING_OPENPARENTHESIS:
+                                               // Nested comments are OK
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_COMMENT;
+                                               break;
+                                       // End of comment
+                                       case ISEMAIL_STRING_CLOSEPARENTHESIS:
+                                               $context_prior          = $context;
+                                               $context                = (int) array_pop($context_stack);
+
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.2
+                                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a
+                                               //   structured header field are semantically interpreted as a single
+                                               //   space character.
+                                               //
+                                               // is_email() author's note: This *cannot* mean that we must add a
+                                               // space to the address wherever CFWS appears. This would result in
+                                               // any addr-spec that had CFWS outside a quoted string being invalid
+                                               // for RFC 5321.
+                                               //      if (($context === ISEMAIL_COMPONENT_LOCALPART) || ($context === ISEMAIL_COMPONENT_DOMAIN)) {
+                                               //      $parsedata[$context]                    .= ISEMAIL_STRING_SP;
+                                               //      $atomlist[$context][$element_count]     .= ISEMAIL_STRING_SP;
+                                               //      $element_len++;
+                                               //      }
+
+                                               break;
+                                       // Quoted pair
+                                       case ISEMAIL_STRING_BACKSLASH:
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_QUOTEDPAIR;
+                                               break;
+                                       // Folding White Space
+                                       case ISEMAIL_STRING_CR:
+                                       case ISEMAIL_STRING_SP:
+                                       case ISEMAIL_STRING_HTAB:
+                                               if (($token === ISEMAIL_STRING_CR)
+                                                       && ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF))) {
+                                                       $return_status[] = ISEMAIL_ERR_CR_NO_LF;
+                                                       break;
+                                               } // Fatal error
+
+                                               $return_status[]        = ISEMAIL_CFWS_FWS;
+
+                                               $context_stack[]        = $context;
+                                               $context                = ISEMAIL_CONTEXT_FWS;
+                                               $token_prior            = $token;
+                                               break;
+                                       // ctext
+                                       default:
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.3
+                                               //   ctext           =   %d33-39 /          ; Printable US-ASCII
+                                               //                       %d42-91 /          ;  characters not including
+                                               //                       %d93-126 /         ;  "(", ")", or "\"
+                                               //                       obs-ctext
+                                               //
+                                               //   obs-ctext       =   obs-NO-WS-CTL
+                                               //
+                                               //   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
+                                               //                       %d11 /             ;  characters that do not
+                                               //                       %d12 /             ;  include the carriage
+                                               //                       %d14-31 /          ;  return, line feed, and
+                                               //                       %d127              ;  white space characters
+                                               $ord = ord($token);
+
+                                               if (($ord > 127) || ($ord === 0) || ($ord === 10)) {
+                                                       $return_status[]        = ISEMAIL_ERR_EXPECTING_CTEXT;  // Fatal error
+                                                       break;
+                                               } elseif (($ord < 32) || ($ord === 127)) {
+                                                       $return_status[]        = ISEMAIL_DEPREC_CTEXT;
+                                               }
+                               }
+                               break;
+                       //-------------------------------------------------------------
+                       // Folding White Space
+                       //-------------------------------------------------------------
+                       case ISEMAIL_CONTEXT_FWS:
+                               // http://tools.ietf.org/html/rfc5322#section-3.2.2
+                               //   FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS
+                               //                                          ; Folding white space
+
+                               // But note the erratum:
+                               // http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908:
+                               //   In the obsolete syntax, any amount of folding white space MAY be
+                               //   inserted where the obs-FWS rule is allowed.  This creates the
+                               //   possibility of having two consecutive "folds" in a line, and
+                               //   therefore the possibility that a line which makes up a folded header
+                               //   field could be composed entirely of white space.
+                               //
+                               //   obs-FWS         =   1*([CRLF] WSP)
+                               if ($token_prior === ISEMAIL_STRING_CR) {
+                                       if ($token === ISEMAIL_STRING_CR) {
+                                               $return_status[]        = ISEMAIL_ERR_FWS_CRLF_X2;      // Fatal error
+                                               break;
+                                       }
+                                       if (isset($crlf_count)) {
+                                               if (++$crlf_count > 1) {
+                                                       $return_status[]        = ISEMAIL_DEPREC_FWS;   // Multiple folds = obsolete FWS
+                                               }
+                                       } else {
+                                               $crlf_count = 1;
+                                       }
+                               }
+
+                               switch ($token) {
+                                       case ISEMAIL_STRING_CR:
+                                               if ((++$i === $raw_length) || ($email[$i] !== ISEMAIL_STRING_LF)) {
+                                                       $return_status[]        = ISEMAIL_ERR_CR_NO_LF; // Fatal error
+                                               }
+                                               break;
+                                       case ISEMAIL_STRING_SP:
+                                       case ISEMAIL_STRING_HTAB:
+                                               break;
+                                       default:
+                                               if ($token_prior === ISEMAIL_STRING_CR) {
+                                                       $return_status[]        = ISEMAIL_ERR_FWS_CRLF_END;     // Fatal error
+                                                       break;
+                                               }
+
+                                               if (isset($crlf_count)) {
+                                                       unset($crlf_count);
+                                               }
+
+                                               $context_prior                                  = $context;
+                                               $context                                        = (int) array_pop($context_stack);      // End of FWS
+
+                                               // http://tools.ietf.org/html/rfc5322#section-3.2.2
+                                               //   Runs of FWS, comment, or CFWS that occur between lexical tokens in a
+                                               //   structured header field are semantically interpreted as a single
+                                               //   space character.
+                                               //
+                                               // is_email() author's note: This *cannot* mean that we must add a
+                                               // space to the address wherever CFWS appears. This would result in
+                                               // any addr-spec that had CFWS outside a quoted string being invalid
+                                               // for RFC 5321.
+               //                              if (($context === ISEMAIL_COMPONENT_LOCALPART) || ($context === ISEMAIL_COMPONENT_DOMAIN)) {
+               //                                      $parsedata[$context]                    .= ISEMAIL_STRING_SP;
+               //                                      $atomlist[$context][$element_count]     .= ISEMAIL_STRING_SP;
+               //                                      $element_len++;
+               //                              }
+
+                                               $i--;   // Look at this token again in the parent context
+                               }
+
+                               $token_prior = $token;
+                               break;
+                       //-------------------------------------------------------------
+                       // A context we aren't expecting
+                       //-------------------------------------------------------------
+                       default:
+                               die("Unknown context: $context");
+               }
+
+//-echo "<td>$context|",(($end_or_die) ? 'true' : 'false'),"|$token|" . max($return_status) . "</td></tr>"; // debug
+               if ((int) max($return_status) > ISEMAIL_RFC5322) {
+                       break;  // No point going on if we've got a fatal error
+               }
+       }
+
+       // Some simple final tests
+       if ((int) max($return_status) < ISEMAIL_RFC5322) {
+               if ($context    === ISEMAIL_CONTEXT_QUOTEDSTRING) {
+                       $return_status[]        = ISEMAIL_ERR_UNCLOSEDQUOTEDSTR; // Fatal error
+               } elseif ($context      === ISEMAIL_CONTEXT_QUOTEDPAIR) {
+                       $return_status[]        = ISEMAIL_ERR_BACKSLASHEND; // Fatal error
+               } elseif ($context      === ISEMAIL_CONTEXT_COMMENT) {
+                       $return_status[]        = ISEMAIL_ERR_UNCLOSEDCOMMENT; // Fatal error
+               } elseif ($context      === ISEMAIL_COMPONENT_LITERAL) {
+                       $return_status[]        = ISEMAIL_ERR_UNCLOSEDDOMLIT; // Fatal error
+               } elseif ($token                === ISEMAIL_STRING_CR) {
+                       $return_status[]        = ISEMAIL_ERR_FWS_CRLF_END; // Fatal error
+               } elseif ($parsedata[ISEMAIL_COMPONENT_DOMAIN]  === '') {
+                       $return_status[]        = ISEMAIL_ERR_NODOMAIN; // Fatal error
+               } elseif ($element_len  === 0) {
+                       $return_status[]        = ISEMAIL_ERR_DOT_END; // Fatal error
+               } elseif ($hyphen_flag) {
+                       $return_status[]        = ISEMAIL_ERR_DOMAINHYPHENEND; // Fatal error
+               } elseif (strlen($parsedata[ISEMAIL_COMPONENT_DOMAIN]) > 255) {
+                       // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.2
+                       //   The maximum total length of a domain name or number is 255 octets.
+                       $return_status[]        = ISEMAIL_RFC5322_DOMAIN_TOOLONG;
+               } elseif (strlen(
+                       $parsedata[ISEMAIL_COMPONENT_LOCALPART] . ISEMAIL_STRING_AT . $parsedata[ISEMAIL_COMPONENT_DOMAIN]
+               ) > 254) {
+                       // http://tools.ietf.org/html/rfc5321#section-4.1.2
+                       //   Forward-path   = Path
+                       //
+                       //   Path           = "<" [ A-d-l ":" ] Mailbox ">"
+                       //
+                       // http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3
+                       //   The maximum total length of a reverse-path or forward-path is 256
+                       //   octets (including the punctuation and element separators).
+                       //
+                       // Thus, even without (obsolete) routing information, the Mailbox can
+                       // only be 254 characters long. This is confirmed by this verified
+                       // erratum to RFC 3696:
+                       //
+                       // http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690
+                       //   However, there is a restriction in RFC 2821 on the length of an
+                       //   address in MAIL and RCPT commands of 254 characters.  Since addresses
+                       //   that do not fit in those fields are not normally useful, the upper
+                       //   limit on address lengths should normally be considered to be 254.
+                       $return_status[]        = ISEMAIL_RFC5322_TOOLONG;
+               } elseif ($element_len > 63) {
+                       // http://tools.ietf.org/html/rfc1035#section-2.3.4
+                       // labels          63 octets or less
+                       $return_status[]        = ISEMAIL_RFC5322_LABEL_TOOLONG;
+               }
+       }
+
+       // Check DNS?
+       $dns_checked = false;
+
+       if ($checkDNS && ((int) max($return_status) < ISEMAIL_DNSWARN) && function_exists('dns_get_record')) {
+               // http://tools.ietf.org/html/rfc5321#section-2.3.5
+               //   Names that can
+               //   be resolved to MX RRs or address (i.e., A or AAAA) RRs (as discussed
+               //   in Section 5) are permitted, as are CNAME RRs whose targets can be
+               //   resolved, in turn, to MX or address RRs.
+               //
+               // http://tools.ietf.org/html/rfc5321#section-5.1
+               //   The lookup first attempts to locate an MX record associated with the
+               //   name.  If a CNAME record is found, the resulting name is processed as
+               //   if it were the initial name. ... If an empty list of MXs is returned,
+               //   the address is treated as if it was associated with an implicit MX
+               //   RR, with a preference of 0, pointing to that host.
+               //
+               // is_email() author's note: We will regard the existence of a CNAME to be
+               // sufficient evidence of the domain's existence. For performance reasons
+               // we will not repeat the DNS lookup for the CNAME's target, but we will
+               // raise a warning because we didn't immediately find an MX record.
+               if ($element_count === 0) {
+                       $parsedata[ISEMAIL_COMPONENT_DOMAIN] .= '.';
+                       // Checking TLD DNS seems to work only if you explicitly check from the root
+               }
+               // Not using checkdnsrr because of a suspected bug in PHP 5.3 (http://bugs.php.net/bug.php?id=51844)
+               $result = @dns_get_record($parsedata[ISEMAIL_COMPONENT_DOMAIN], DNS_MX);
+
+               if ((is_bool($result) && !(bool) $result)) {
+                       $return_status[] = ISEMAIL_DNSWARN_NO_RECORD;
+                       // Domain can't be found in DNS
+               } else {
+                       if (count($result) === 0) {
+                               $return_status[] = ISEMAIL_DNSWARN_NO_MX_RECORD;                // MX-record for domain can't be found
+                               $result = @dns_get_record($parsedata[ISEMAIL_COMPONENT_DOMAIN], DNS_A + DNS_CNAME);
+
+                               if (count($result) === 0) {
+                                       $return_status[] = ISEMAIL_DNSWARN_NO_RECORD;
+                                       // No usable records for the domain can be found
+                               }
+                       } else {
+                               $dns_checked = true;
+                       }
+               }
+       }
+
+       // Check for TLD addresses
+       // -----------------------
+       // TLD addresses are specifically allowed in RFC 5321 but they are
+       // unusual to say the least. We will allocate a separate
+       // status to these addresses on the basis that they are more likely
+       // to be typos than genuine addresses (unless we've already
+       // established that the domain does have an MX record)
+       //
+       // http://tools.ietf.org/html/rfc5321#section-2.3.5
+       //   In the case
+       //   of a top-level domain used by itself in an email address, a single
+       //   string is used without any dots.  This makes the requirement,
+       //   described in more detail below, that only fully-qualified domain
+       //   names appear in SMTP transactions on the public Internet,
+       //   particularly important where top-level domains are involved.
+       //
+       // TLD format
+       // ----------
+       // The format of TLDs has changed a number of times. The standards
+       // used by IANA have been largely ignored by ICANN, leading to
+       // confusion over the standards being followed. These are not defined
+       // anywhere, except as a general component of a DNS host name (a label).
+       // However, this could potentially lead to 123.123.123.123 being a
+       // valid DNS name (rather than an IP address) and thereby creating
+       // an ambiguity. The most authoritative statement on TLD formats that
+       // the author can find is in a (rejected!) erratum to RFC 1123
+       // submitted by John Klensin, the author of RFC 5321:
+       //
+       // http://www.rfc-editor.org/errata_search.php?rfc=1123&eid=1353
+       //   However, a valid host name can never have the dotted-decimal
+       //   form #.#.#.#, since this change does not permit the highest-level
+       //   component label to start with a digit even if it is not all-numeric.
+       if (!$dns_checked && ((int) max($return_status) < ISEMAIL_DNSWARN)) {
+               if ($element_count      === 0) {
+                       $return_status[]        = ISEMAIL_RFC5321_TLD;
+               }
+
+               if (is_numeric($atomlist[ISEMAIL_COMPONENT_DOMAIN][$element_count][0])) {
+                       $return_status[]        = ISEMAIL_RFC5321_TLDNUMERIC;
+               }
+       }
+
+       $return_status          = array_unique($return_status);
+       $final_status           = (int) max($return_status);
+
+       if (count($return_status) !== 1) {
+               array_shift($return_status); // remove redundant ISEMAIL_VALID
+       }
+
+       $parsedata['status'] = $return_status;
+
+       if ($final_status < $threshold) {
+               $final_status = ISEMAIL_VALID;
+       }
+
+       return ($diagnose) ? $final_status : ($final_status < ISEMAIL_THRESHOLD);
+}
index 7c11864..03ec6b3 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Fonction de base de l'API de vérification.
@@ -13,19 +15,24 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  *             alors la valeur modifie sera stockee dans cette variable.
  * @return string Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function inc_verifier_dist($valeur, $type, $options=null, &$valeur_normalisee=null){
+function inc_verifier_dist($valeur, $type, $options = null, &$valeur_normalisee = null) {
 
        // On vérifie que les options sont bien un tableau
-       if (!is_array($options))
+       if (!is_array($options)) {
                $options = array();
+       }
 
        // Si la valeur est vide, il n'y a rien a verifier donc c'est bon
-       if (is_null($valeur) or (is_string($valeur) and $valeur == '')) return '';
+       if (is_null($valeur) or (is_string($valeur) and $valeur == '')) {
+               return '';
+       }
        // Si c'est une date avec horaire c'est un tableau
-       if (is_array($valeur) and isset($valeur['date']) and $valeur[date] == '') return '';
+       if (is_array($valeur) and isset($valeur['date']) and $valeur['date'] == '') {
+               return '';
+       }
 
        // On cherche si une fonction correspondant au type existe
-       if ($verifier = charger_fonction($type, 'verifier',true)){
+       if ($verifier = charger_fonction($type, 'verifier', true)) {
                $erreur = $verifier($valeur, $options, $valeur_normalisee);
        }
 
@@ -47,21 +54,21 @@ function inc_verifier_dist($valeur, $type, $options=null, &$valeur_normalisee=nu
 
 /**
  * Liste toutes les vérifications possibles
- * 
+ *
  * @param string $repertoire
  *             Dans quel repertoire chercher les yaml.
- * 
+ *
  * @return Retourne un tableau listant les vérifications et leurs options
  */
-function verifier_lister_disponibles($repertoire='verifier'){
+function verifier_lister_disponibles($repertoire = 'verifier') {
        static $verifications = array();
 
        if (!isset($verifications[$repertoire])) {
                $verifications[$repertoire] = array();
                $liste = find_all_in_path("$repertoire/", '.+[.]yaml$');
 
-               if (count($liste)){
-                       foreach ($liste as $fichier=>$chemin){
+               if (count($liste)) {
+                       foreach ($liste as $fichier => $chemin) {
                                $type = preg_replace(',[.]yaml$,i', '', $fichier);
                                $dossier = str_replace($fichier, '', $chemin);
                                // On ne garde que les vérifications qui ont bien la fonction !
@@ -85,22 +92,20 @@ function verifier_lister_disponibles($repertoire='verifier'){
  *
  * @param string $type_verif
  *             Le type de la vérification
- * 
+ *
  * @param string $repertoire
  *             Dans quel repertoire chercher les yaml.
- * 
+ *
  * @return array Un tableau contenant le YAML décodé
  */
-function verifier_charger_infos($type_verif, $repertoire='verifier'){
+function verifier_charger_infos($type_verif, $repertoire = 'verifier') {
        include_spip('inc/yaml');
        $fichier = find_in_path("$repertoire/$type_verif.yaml");
        $verif = yaml_decode_file($fichier);
-       if (is_array($verif)){
+       if (is_array($verif)) {
                $verif['titre']       = (isset($verif['titre'])       and $verif['titre'])       ? _T_ou_typo($verif['titre']) : $type_verif;
                $verif['description'] = (isset($verif['description']) and $verif['description']) ? _T_ou_typo($verif['description']) : '';
                $verif['icone']       = (isset($verif['icone'])       and $verif['icone'])       ? _T_ou_typo($verif['icone']) : '';
        }
        return $verif;
 }
-
-?>
index 8df661f..d037708 100644 (file)
@@ -13,6 +13,9 @@
        <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=fr_tu" total="3" traduits="3" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="Cerf" lien="http://trad.spip.net/auteur/cerf" />
        </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-verifier?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-verifier?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>
index 9bcbc7b..8a8381c 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'API Wertprüfung',
        'verifier_slogan' => 'API zur Prüfung von Werten'
 );
-
-?>
index 84b56a3..4ca6a67 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'Control API',
        'verifier_slogan' => 'A generic API to control a value'
 );
-
-?>
index d2983be..8284b24 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'API de verificación',
        'verifier_slogan' => 'Una API genérica para verificar un valor'
 );
-
-?>
index 4968c25..b9f5dd5 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/verifier/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'API de vérification',
        'verifier_slogan' => 'Une API générique pour vérifier une valeur'
 );
-
-?>
index 4bcba90..e05d2f4 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'API de vérification',
        'verifier_slogan' => 'Une API générique pour vérifier une valeur'
 );
-
-?>
diff --git a/www/plugins/verifier/lang/paquet-verifier_nl.php b/www/plugins/verifier/lang/paquet-verifier_nl.php
new file mode 100644 (file)
index 0000000..a0cc05e
--- /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-verifier?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // V
+       'verifier_description' => 'Levert de functie <code>verifier($waarde, $type, $opties, &$valeur_normalisee)</code> om de geldigheid van een waarde te controleren.',
+       'verifier_nom' => 'Verificatie API',
+       'verifier_slogan' => 'Een generieke API om een waarde te controleren'
+);
index b43eab8..8b648fc 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'API для валидации данных (verifier)',
        'verifier_slogan' => 'Плагин обеспечивает API для валидации данных. Необходим для работы многих плагинов.'
 );
-
-?>
index 17d95e4..b7efcec 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-verifier?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'verifier_nom' => 'Aplikácia na overenie',
        'verifier_slogan' => 'Spoločná aplikácia na overenie hodnoty'
 );
-
-?>
index c2097b3..126de85 100644 (file)
@@ -1,39 +1,45 @@
 <traduction module="verifier" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/verifier/lang/" reference="fr">
-       <langue code="ca" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=ca" total="95" traduits="42" relire="0" modifs="6" nouveaux="47" pourcent="44.21">
+       <langue code="ca" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=ca" total="119" traduits="42" relire="0" modifs="6" nouveaux="71" pourcent="35.29">
        </langue>
-       <langue code="de" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=de" total="95" traduits="66" relire="0" modifs="4" nouveaux="25" pourcent="69.47">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=de" total="119" traduits="66" relire="0" modifs="4" nouveaux="49" pourcent="55.46">
                <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
        </langue>
-       <langue code="en" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=en" total="95" traduits="95" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="en" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=en" total="119" traduits="119" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Benitron" lien="http://trad.spip.net/auteur/benitron" />
                <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
                <traducteur nom="Mark" lien="http://trad.spip.net/auteur/mark" />
                <traducteur nom="RastaPopoulos" lien="http://trad.spip.net/auteur/rastapopoulos" />
                <traducteur nom="tcharlss" lien="http://trad.spip.net/auteur/drbouvierleduc" />
        </langue>
-       <langue code="es" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=es" total="95" traduits="95" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="es" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=es" total="119" traduits="96" relire="0" modifs="0" nouveaux="23" pourcent="80.67">
                <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel-s-bujaldon" />
+               <traducteur nom="tcharlss" lien="http://trad.spip.net/auteur/drbouvierleduc" />
        </langue>
-       <langue code="fa" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fa" total="95" traduits="82" relire="0" modifs="4" nouveaux="9" pourcent="86.32">
+       <langue code="fa" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fa" total="119" traduits="82" relire="0" modifs="4" nouveaux="33" pourcent="68.91">
                <traducteur nom="Davood Hossein" lien="http://trad.spip.net/auteur/davood-hossein" />
        </langue>
-       <langue code="fr" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fr" total="95" traduits="95" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fr" total="119" traduits="119" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
-       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fr_tu" total="95" traduits="95" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="fr_tu" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=fr_tu" total="119" traduits="95" relire="0" modifs="0" nouveaux="24" pourcent="79.83">
                <traducteur nom="beatnick" lien="http://trad.spip.net/auteur/beatnick" />
                <traducteur nom="Cerf" lien="http://trad.spip.net/auteur/cerf" />
                <traducteur nom="stefdn" lien="http://trad.spip.net/auteur/stefdn" />
        </langue>
-       <langue code="it" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=it" total="95" traduits="66" relire="0" modifs="4" nouveaux="25" pourcent="69.47">
+       <langue code="it" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=it" total="119" traduits="66" relire="0" modifs="4" nouveaux="49" pourcent="55.46">
                <traducteur nom="Cap" lien="http://trad.spip.net/auteur/cap" />
        </langue>
-       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=pt_br" total="95" traduits="66" relire="0" modifs="4" nouveaux="25" pourcent="69.47">
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=nl" total="119" traduits="119" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="Hanjo" lien="http://trad.spip.net/auteur/hanjo" />
+       </langue>
+       <langue code="pt_br" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=pt_br" total="119" traduits="90" relire="0" modifs="4" nouveaux="25" pourcent="75.63">
                <traducteur nom="Ricardo Porto" lien="http://trad.spip.net/auteur/ricardo-porto" />
        </langue>
-       <langue code="ru" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=ru" total="95" traduits="86" relire="0" modifs="0" nouveaux="9" pourcent="90.53">
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=ru" total="119" traduits="86" relire="0" modifs="0" nouveaux="33" pourcent="72.27">
                <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
        </langue>
-       <langue code="sk" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=sk" total="95" traduits="95" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/verifier?lang_cible=sk" total="119" traduits="95" relire="0" modifs="0" nouveaux="24" pourcent="79.83">
                <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
        </langue>
 </traduction>
index 17e53ea..4626409 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=ca
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -61,5 +63,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_telephone' => 'Número de telèfon',
        'type_telephone_description' => 'Verifica que el número de telèfon correspon a un esquema reconegut.'
 );
-
-?>
index 741fd14..c4c9ed2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -83,5 +85,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Prüft ob der URL einem anerkannten Schema entspricht.'
 );
-
-?>
index ded9950..07af8f4 100644 (file)
@@ -3,12 +3,14 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // E
-       'erreur_code_postal' => 'This post code is invalid.',
+       'erreur_code_postal' => 'This postcode is invalid.',
        'erreur_comparaison_egal' => 'The value must be equal to the field "@nom_champ@"',
        'erreur_comparaison_egal_type' => 'The value must be equal and the same type as the field "@nom_champ@"',
        'erreur_comparaison_grand' => 'The value must be greater than the field "@nom_champ@"',
@@ -29,6 +31,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_heure' => 'The timetable specified does not exist.',
        'erreur_heure_format' => 'The time format is not valid.',
        'erreur_id_document' => 'This document identifier is not valid.',
+       'erreur_id_objet' => 'This identifier is not valid.',
        'erreur_inconnue_generique' => 'The format is invalid.',
        'erreur_isbn' => 'the ISBN number is not valid (ex: 978-2-1234-5680-3 or 2-1234-5680-X)',
        'erreur_isbn_13_X' => 'Un numéro ISBN-13 ne peut pas se terminer par X.', # a 13 digits ISBN number must not end with an X.
@@ -38,6 +41,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_isbn_segment' => 'the segment "@segment@" has @nb@ exceeding caracter(s).',
        'erreur_isbn_segment_lettre' => 'the segment "@segment@" must not have any letter.',
        'erreur_numerique' => 'The number format is invalid.',
+       'erreur_objet' => 'This object is not valid',
        'erreur_regex' => 'The regex string is incorrectly formatted.',
        'erreur_siren' => 'The SIREN number is invalid.',
        'erreur_siret' => 'The SIRET number is invalid.',
@@ -56,6 +60,20 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'normaliser_option_date_en_datetime' => '"Datetime" format (for SQL)',
 
        // O
+       'option_code_postal_pays_explication' => 'Two-letter country code : FR, DZ, DE, etc.',
+       'option_code_postal_pays_label' => 'Country',
+       'option_comparaison_champ_champ_explication' => 'Field identifier (« name » attribute)',
+       'option_comparaison_champ_champ_label' => 'Field',
+       'option_comparaison_champ_comparaison_explication' => 'Type of comparison',
+       'option_comparaison_champ_comparaison_label' => 'Comparison',
+       'option_comparaison_champ_egal' => '== Equal',
+       'option_comparaison_champ_egal_type' => '=== Identical (same kind)',
+       'option_comparaison_champ_grand' => '> Greater than',
+       'option_comparaison_champ_grand_egal' => '>= Greater than or equal to ',
+       'option_comparaison_champ_nom_champ_explication' => 'Field name for human beings',
+       'option_comparaison_champ_nom_champ_label' => 'Field name',
+       'option_comparaison_champ_petit' => '< Less than',
+       'option_comparaison_champ_petit_egal' => '<= Less than or equal to',
        'option_couleur_normaliser_label' => 'Normalize the color code?',
        'option_couleur_type_hexa' => 'Color code in hexadecimal format',
        'option_couleur_type_label' => 'Checking type to be made',
@@ -87,6 +105,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_url_type_protocole_web' => 'Web protocols: HTTP or HTTPS',
 
        // T
+       'type_code_postal' => 'Postal code',
+       'type_code_postal_description' => 'Check that the value is a valid postal code.',
+       'type_comparaison_champ' => 'Comparison',
+       'type_comparaison_champ_description' => 'Compare the value with another field from _request().',
        'type_couleur' => 'Colour',
        'type_couleur_description' => 'Check if the value is a color code.',
        'type_date' => 'Date',
@@ -99,6 +121,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_email_disponible_description' => 'Check that the email address has not already been used by another system user.',
        'type_entier' => 'Integer',
        'type_entier_description' => 'Check that the value is an integer, with the option of being restricted between two range values.',
+       'type_id_document' => 'Document number',
+       'type_id_document_description' => 'Check that the value matches an existing document number.',
+       'type_isbn' => 'ISBN',
+       'type_isbn_description' => 'Check that the value is a 10 or 13 digits long ISBN',
        'type_regex' => 'Regular expression',
        'type_regex_description' => 'Check that the value matches the defined expression. For more information on using regular expressions, please refer to <a href="http://fr2.php.net/manual/en/reference.pcre.pattern.syntax.php">the online PHP help</a>.',
        'type_siren_siret' => 'SIREN or SIRET',
@@ -110,5 +136,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Verify that the URL matches a recognised format.'
 );
-
-?>
index a03a6c0..b33166f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -56,6 +58,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'normaliser_option_date_en_datetime' => 'En formato «Datetime» (para SQL)',
 
        // O
+       'option_code_postal_pays_explication' => 'Two-letters country code: FR, DZ, DE, etc.',
        'option_couleur_normaliser_label' => '¿Normalizar el código color?',
        'option_couleur_type_hexa' => 'Código color en formato hexadecimal',
        'option_couleur_type_label' => 'Tipo de verificación a efectuar',
@@ -110,5 +113,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Verifica que la url corresponde a un patrón conocido.'
 );
-
-?>
index 1d057de..f0f20c6 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -101,5 +103,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'يو.آر.ال ',
        'type_url_description' => 'چك كنيد كه يو.آر.ال با يك فرمت شناخته شده جور باشد. '
 );
-
-?>
index 45bd84b..f6a4294 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/verifier/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -27,6 +29,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_heure' => 'L’horaire indiqué n’existe pas.',
        'erreur_heure_format' => 'Le format de l’heure n’est pas accepté.',
        'erreur_id_document' => 'Cet identifiant de document n’est pas valide.',
+       'erreur_id_objet' => 'Cet identifiant n’est pas valide.',
        'erreur_inconnue_generique' => 'Le format n’est pas correct.',
        'erreur_isbn' => 'Le numéro ISBN n’est pas valide (ex : 978-2-1234-5680-3 ou 2-1234-5680-X)',
        'erreur_isbn_13_X' => 'Un numéro ISBN-13 ne peut pas se terminer par X.',
@@ -36,6 +39,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_isbn_segment' => 'Le segment "@segment@" comprend @nb@ chiffre(s) en trop.',
        'erreur_isbn_segment_lettre' => 'Le segment "@segment@" ne doit pas contenir de lettre.',
        'erreur_numerique' => 'Le format du nombre n’est pas valide.',
+       'erreur_objet' => 'Cet objet n’est pas valide',
        'erreur_regex' => 'Le format de la chaîne n’est pas valide.',
        'erreur_siren' => 'Le numéro de SIREN n’est pas valide.',
        'erreur_siret' => 'Le numéro de SIRET n’est pas valide.',
@@ -54,6 +58,20 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'normaliser_option_date_en_datetime' => 'Au format « Datetime » (pour SQL)',
 
        // O
+       'option_code_postal_pays_explication' => 'Code à 2 chiffres d’un pays : FR, DZ, DE, etc.',
+       'option_code_postal_pays_label' => 'Pays',
+       'option_comparaison_champ_champ_explication' => 'Identifiant du champ (attribut « name »)',
+       'option_comparaison_champ_champ_label' => 'Champ',
+       'option_comparaison_champ_comparaison_explication' => 'Type de comparaison à effectuer',
+       'option_comparaison_champ_comparaison_label' => 'Comparaison',
+       'option_comparaison_champ_egal' => '== Égal',
+       'option_comparaison_champ_egal_type' => '=== Identique (même type)',
+       'option_comparaison_champ_grand' => '> Plus grand',
+       'option_comparaison_champ_grand_egal' => '>= Plus grand ou égal',
+       'option_comparaison_champ_nom_champ_explication' => 'Nom du champ pour les humains',
+       'option_comparaison_champ_nom_champ_label' => 'Nom du champ',
+       'option_comparaison_champ_petit' => '< Plus petit',
+       'option_comparaison_champ_petit_egal' => '<= Plus petit ou égal',
        'option_couleur_normaliser_label' => 'Normaliser le code couleur ?',
        'option_couleur_type_hexa' => 'Code couleur au format héxadécimal',
        'option_couleur_type_label' => 'Type de vérification à effectuer',
@@ -85,6 +103,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'option_url_type_protocole_web' => 'Protocoles web : http ou https',
 
        // T
+       'type_code_postal' => 'Code postal',
+       'type_code_postal_description' => 'Vérifie que la valeur est un code postal valide.',
+       'type_comparaison_champ' => 'Comparaison',
+       'type_comparaison_champ_description' => 'Compare la valeur avec un autre champ du _request().',
        'type_couleur' => 'Couleur',
        'type_couleur_description' => 'Vérifie que la valeur est un code couleur.',
        'type_date' => 'Date',
@@ -97,6 +119,10 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_email_disponible_description' => 'Vérifie que l’adresse de courriel n’est pas déjà utilisé par un autre utilisateur du système.',
        'type_entier' => 'Nombre entier',
        'type_entier_description' => 'Vérifie que la valeur est un entier, avec la possibilité de restreindre entre deux valeurs.',
+       'type_id_document' => 'Numéro d’un document',
+       'type_id_document_description' => 'Vérifie que la valeur correspond à un numéro de document existant.',
+       'type_isbn' => 'Numéro ISBN',
+       'type_isbn_description' => 'Vérifie que la valeur correspond à un numéro ISBN à 10 ou 13 chiffres.',
        'type_regex' => 'Expression régulière',
        'type_regex_description' => 'Vérifie que la valeur correspond au masque demandé. Pour l’utilisation des masques, reportez-vous à <a href="http://fr2.php.net/manual/fr/reference.pcre.pattern.syntax.php">l’aide en ligne de PHP</a>.',
        'type_siren_siret' => 'SIREN ou SIRET',
@@ -108,5 +134,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Vérifie que l’url correspond à un schéma reconnu.'
 );
-
-?>
index a847061..1db9f30 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=fr_tu
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -110,5 +112,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Vérifie que l’url correspond à un schéma reconnu.'
 );
-
-?>
index 1e21a26..73398a5 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=it
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -83,5 +85,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Verifica che l’url corrisponda ad uno schema riconosciuto.'
 );
-
-?>
diff --git a/www/plugins/verifier/lang/verifier_nl.php b/www/plugins/verifier/lang/verifier_nl.php
new file mode 100644 (file)
index 0000000..b2f3328
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // E
+       'erreur_code_postal' => 'Deze postcode is ongeldig.',
+       'erreur_comparaison_egal' => 'De waarde moet gelijk zijn aan het veld "@nom_champ@"',
+       'erreur_comparaison_egal_type' => 'De waarde moet gelijk zijn aan en hetzelfde type hebben als het veld "@nom_champ@"',
+       'erreur_comparaison_grand' => 'De waarde moet groter zijn dan het veld "@nom_champ@"',
+       'erreur_comparaison_grand_egal' => 'De waarde moet gelijk zijn aan of groter zijn dan het veld "@nom_champ@"',
+       'erreur_comparaison_petit' => 'De waarde moet kleiner zijn dan het veld "@nom_champ@"',
+       'erreur_comparaison_petit_egal' => 'De waarde moet gelijk zijn aan of kleiner zijn dan het veld "@nom_champ@"',
+       'erreur_couleur' => 'De kleurcode is ongeldig.',
+       'erreur_date' => 'De datum is ongeldig.',
+       'erreur_date_format' => 'Het datumformaat is ongeldig.',
+       'erreur_decimal' => 'De waarde moet een decimaal getal zijn.',
+       'erreur_decimal_nb_decimales' => 'Het getal moet meer dan @nb_decimales@ decimalen na de punt hebben.',
+       'erreur_email' => 'Het e-mailadres <em>@email@</em> is niet correct geformatteerd.',
+       'erreur_email_nondispo' => 'Het e-mailadres <em>@email@</em> werd al gebruikt.',
+       'erreur_entier' => 'De waarde moet een geheel getal zijn.',
+       'erreur_entier_entre' => 'De waarde moet liggen tussen @min@ en @max@.',
+       'erreur_entier_max' => 'De waarde moet kleiner zijn dan @max@.',
+       'erreur_entier_min' => 'De waarde moet groter zijn dan @min@.',
+       'erreur_heure' => 'De vermelde tijd bestaat niet.',
+       'erreur_heure_format' => 'Het tijdformaat is niet geldig.',
+       'erreur_id_document' => 'Deze document-identificatie is niet geldig.',
+       'erreur_id_objet' => 'Deze identificatie is ongeldig.',
+       'erreur_inconnue_generique' => 'Het formaat is ongeldig.',
+       'erreur_isbn' => 'de ISBN code is niet geldig (bv: 978-2-1234-5680-3 of 2-1234-5680-X)',
+       'erreur_isbn_13_X' => 'Een ISBN-13 code kan niet eindigen met een X.',
+       'erreur_isbn_G' => 'Het eerste segment moet gelijk zijn aan 978 of 979.',
+       'erreur_isbn_nb_caracteres' => 'de ISBN code moet 10 of 13 tekens bevatten (momenteel @nb@), de streepjes niet meegeteld.',
+       'erreur_isbn_nb_segments' => 'de ISBN code moet uit 4 of 5 segmenten bestaan (momenteel @nb@).',
+       'erreur_isbn_segment' => 'het segment "@segment@" heeft @nb@ teveel teken(s).',
+       'erreur_isbn_segment_lettre' => 'het segment "@segment@" mag geen letters bevatten.',
+       'erreur_numerique' => 'Het nummerformaat is ongeldig.',
+       'erreur_objet' => 'Dit object is niet geldig',
+       'erreur_regex' => 'De regex string is incorrect geformatteerd.',
+       'erreur_siren' => 'Het SIREN nummer is ongeldig.',
+       'erreur_siret' => 'Het SIRET number is ongeldig.',
+       'erreur_taille_egal' => 'De waarde moet uit exact @egal@ tekens bestaan (momenteel @nb@).',
+       'erreur_taille_entre' => 'De waarde moet tussen de @min@ en @max@ tekens bevatten (momenteel @nb@).',
+       'erreur_taille_max' => 'De waarde mag niet meer dan @max@ tekens bevatten (momenteel @nb@).',
+       'erreur_taille_min' => 'De waarde moet minimaal @min@ ctekens bevatten (momenteel @nb@).',
+       'erreur_telephone' => 'Het telefoonnummer is ongeldig.',
+       'erreur_url' => 'Het URL-adres <em>@url@</em> is ongeldig.',
+       'erreur_url_protocole' => 'Het ingevoerde adres <em>(@url@)</em> moet beginnen met @protocole@',
+       'erreur_url_protocole_exact' => 'Het ingevoerde adres <em>(@url@)</em> begint niet met een geldig protocol (bv. http://)',
+
+       // N
+       'normaliser_option_date' => 'De datum normaliseren?',
+       'normaliser_option_date_aucune' => 'Nee',
+       'normaliser_option_date_en_datetime' => '"Datetime" formaat (voor SQL)',
+
+       // O
+       'option_code_postal_pays_explication' => 'Tweeletterige landcode: FR, DE, NL, enz.',
+       'option_code_postal_pays_label' => 'Land',
+       'option_comparaison_champ_champ_explication' => 'Veld identificatie («name» attribuut)',
+       'option_comparaison_champ_champ_label' => 'Veld',
+       'option_comparaison_champ_comparaison_explication' => 'Soort vergelijking',
+       'option_comparaison_champ_comparaison_label' => 'Vergelijking',
+       'option_comparaison_champ_egal' => '== Gelijk',
+       'option_comparaison_champ_egal_type' => '=== Identiek (zelfde soort)',
+       'option_comparaison_champ_grand' => '> Groter dan',
+       'option_comparaison_champ_grand_egal' => '>= Groter dan of gelijk aan ',
+       'option_comparaison_champ_nom_champ_explication' => 'Veldnaam voor mensen',
+       'option_comparaison_champ_nom_champ_label' => 'Veldnaam',
+       'option_comparaison_champ_petit' => '< Kleiner dan',
+       'option_comparaison_champ_petit_egal' => '<= Kleiner dan of gelijk aan',
+       'option_couleur_normaliser_label' => 'De kleurcode normaliseren?',
+       'option_couleur_type_hexa' => 'Kleurcode in hexadecimaal formaat',
+       'option_couleur_type_label' => 'Uit te voeren type verificatie',
+       'option_decimal_nb_decimales_label' => 'Aantal decimale plaatsen',
+       'option_email_disponible_label' => 'Beschikbaar adres',
+       'option_email_disponible_label_case' => 'Controleer of het adres niet al door een andere gebruiker wordt gebruikt',
+       'option_email_mode_5322' => 'Controleer tegen de meest stricte beschikbare standaard',
+       'option_email_mode_label' => 'Email verificatiemethode',
+       'option_email_mode_normal' => 'Normale SPIP verificatie',
+       'option_email_mode_strict' => 'Minder tolerante verificatie',
+       'option_entier_max_label' => 'Maximum waarde',
+       'option_entier_min_label' => 'Minimum waarde',
+       'option_regex_modele_label' => 'De waarde moet met de volgende expressie overeen komen',
+       'option_siren_siret_mode_label' => 'Wat controleer je?',
+       'option_siren_siret_mode_siren' => 'SIREN nummer',
+       'option_siren_siret_mode_siret' => 'SIRET nummer',
+       'option_taille_max_label' => 'Maximum grootte',
+       'option_taille_min_label' => 'Minimum grootte',
+       'option_url_mode_complet' => 'Volledige verificatie van de URL',
+       'option_url_mode_label' => 'URL verificatiemethode',
+       'option_url_mode_php_filter' => 'Volledige URL verificatie met het PHP filter FILTER_VALIDATE_URL',
+       'option_url_mode_protocole_seul' => 'Uitsluitend verificatie van het protocol',
+       'option_url_protocole_label' => 'Naam van het te verifiëren protocol',
+       'option_url_type_protocole_exact' => 'Geef hieronder een protocol aan:',
+       'option_url_type_protocole_ftp' => 'File transfer protocols: FTP of SFTP',
+       'option_url_type_protocole_label' => 'Te verifiëren type protocol',
+       'option_url_type_protocole_mail' => 'Mail protocols: IMAP, POP3 of SMTP',
+       'option_url_type_protocole_tous' => 'Alle toegelaten protocols',
+       'option_url_type_protocole_web' => 'Web protocols: HTTP of HTTPS',
+
+       // T
+       'type_code_postal' => 'Postcode',
+       'type_code_postal_description' => 'Controleer of de waarde een geldige postcode is.',
+       'type_comparaison_champ' => 'Vergelijking',
+       'type_comparaison_champ_description' => 'Vergelijk de waarde met een ander veld uit _request().',
+       'type_couleur' => 'Kleur',
+       'type_couleur_description' => 'Controleer of de waarde een kleurcode is.',
+       'type_date' => 'Datum',
+       'type_date_description' => 'Controleer of de waarde een datum is in formaat DD/MM/YYYY. Het scheidingsteken kan van alles zijn (".", "/", enz).',
+       'type_decimal' => 'Decimaal getal',
+       'type_decimal_description' => 'Controleer of de waarde een decimaal getal is, met opties voor een bepaalde reeks en het aaantal decimale plaatsen.',
+       'type_email' => 'E-mailadres',
+       'type_email_description' => 'Controleer of het e-mailadres juist is geformatteerd.',
+       'type_email_disponible' => 'Beschikbaarheid van een e-mailadres',
+       'type_email_disponible_description' => 'Controleer of het e-mailadres niet al door een andere systeemgebruiker wordt gebruikt.',
+       'type_entier' => 'Geheel getal',
+       'type_entier_description' => 'Controleer of de waarde een geheel getal is, met de optie van een bepaalde reeks.',
+       'type_id_document' => 'Documentnummer',
+       'type_id_document_description' => 'Controleer of de waarde met een bestaand documentnummer overeen komt.',
+       'type_isbn' => 'ISBN',
+       'type_isbn_description' => 'Controleer of de waarde een 10 of 13 teks lange ISBN code is',
+       'type_regex' => 'Regular expression',
+       'type_regex_description' => 'Controleer of de waarde met de expressie overeen komt.',
+       'type_siren_siret' => 'SIREN or SIRET',
+       'type_siren_siret_description' => 'Check that the value is a valid number from the French <a href="http://fr.wikipedia.org/wiki/SIREN">Système d’Identification du Répertoire des ENtreprises</a> (Company Registry ID System).',
+       'type_taille' => 'Grootte',
+       'type_taille_description' => 'Controleer of de grootte van de waarde binnen een bepaald minimum en/of maximum valt.',
+       'type_telephone' => 'Telefoonnumber',
+       'type_telephone_description' => 'Controleer of het telefoonnummer met een herkend formaat overeen komt.',
+       'type_url' => 'URL',
+       'type_url_description' => 'Controleer of de URL een herkend formaat heeft.'
+);
index 8f1f555..5a9f1fd 100644 (file)
@@ -3,12 +3,21 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=pt_br
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
        // E
        'erreur_code_postal' => 'Este Cep está incorreto.',
+       'erreur_comparaison_egal' => 'O valor deve ser igual ao campo "@nom_champ@"',
+       'erreur_comparaison_egal_type' => 'O valor deve ser igual e do mesmo tipo que o campo "@nom_champ@"',
+       'erreur_comparaison_grand' => 'O valor deve ser superior ao campo "@nom_champ@"',
+       'erreur_comparaison_grand_egal' => 'O valor deve ser superior ou igual ao campo "@nom_champ@"',
+       'erreur_comparaison_petit' => 'O valor deve ser inferior ao campo "@nom_champ@"',
+       'erreur_comparaison_petit_egal' => 'O valor deve ser inferior ou igual ao campo "@nom_champ@"',
+       'erreur_couleur' => 'O código de cor não é válido.',
        'erreur_date' => 'A data não é válida.',
        'erreur_date_format' => 'O formato da data não é aceitável.',
        'erreur_decimal' => 'O valor deve ser um número decimal.',
@@ -19,7 +28,17 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_entier_entre' => 'O valor dever ser entre @min@ e @max@.',
        'erreur_entier_max' => 'O valor deve ser inferior a @max@.',
        'erreur_entier_min' => 'O valor deve ser superior a @min@.',
+       'erreur_heure' => 'O horário indicado não existe.',
+       'erreur_heure_format' => 'O formato de hora não é aceitável.',
        'erreur_id_document' => 'Esta extensão de documento não é válida.',
+       'erreur_inconnue_generique' => 'O formato não está correto.',
+       'erreur_isbn' => 'O número ISBN não é válido (ex: 978-2-1234-5680-3 ou 2-1234-5680-X)',
+       'erreur_isbn_13_X' => 'Um número ISBN-13 não pode terminar em X.',
+       'erreur_isbn_G' => 'O primeiro segmento deve ser igual a 978 ou 979.',
+       'erreur_isbn_nb_caracteres' => 'O número ISBN deve ter 10 ou 13 caractéres, sem contar os traços (atualmente @nb@).',
+       'erreur_isbn_nb_segments' => 'O número ISBN deve ter 4 ou 5 segmentos (atualmente @nb@).',
+       'erreur_isbn_segment' => 'O segmento "@segment@" tem @nb@ número(s) a mais.',
+       'erreur_isbn_segment_lettre' => 'O segmento "@segment@" não pode conter letras.',
        'erreur_numerique' => 'O formato do número não é válido.',
        'erreur_regex' => 'O formato da expressão não é válido.',
        'erreur_siren' => 'O número SIREN não é válido.',
@@ -33,7 +52,16 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'erreur_url_protocole' => 'O endereço informado <em>(@url@)</em> deve começar com @protocole@',
        'erreur_url_protocole_exact' => 'O endereço informado <em>(@url@)</em> não começa com um protocolo válido (http:// por exemplo)',
 
+       // N
+       'normaliser_option_date' => 'Normalizar a data?',
+       'normaliser_option_date_aucune' => 'Não',
+       'normaliser_option_date_en_datetime' => 'No formato «Datetime» (para SQL)',
+
        // O
+       'option_code_postal_pays_explication' => 'C´odigo de dois caractéres de país: BR, PT, FR etc.',
+       'option_code_postal_pays_label' => 'País',
+       'option_comparaison_champ_champ_explication' => 'Identificador do campos (atributo « nome »)',
+       'option_comparaison_champ_champ_label' => 'Campo',
        'option_decimal_nb_decimales_label' => 'Número de décimais depois da vírgula',
        'option_email_disponible_label' => 'Endereço disponível',
        'option_email_disponible_label_case' => 'Verificar se o endereço já não está sendo utilizado por um usuário',
@@ -83,5 +111,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Verifica se o url corresponde a um esquema reconhecido.'
 );
-
-?>
index 77a4376..53c27fe 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -101,5 +103,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'URL',
        'type_url_description' => 'Проверить соответствие ли URL  формат ввода.'
 );
-
-?>
index 6b8ce9f..69aad93 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/verifier?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -110,5 +112,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'type_url' => 'Internetová adresa',
        'type_url_description' => 'Overí, či sa internetová adresa zhoduje s rozoznávaným formátom.'
 );
-
-?>
index 01304d2..ed23b79 100644 (file)
@@ -1,11 +1,11 @@
 <paquet\r
        prefix="verifier"\r
        categorie="outil"\r
-       version="1.0.5"\r
+       version="1.0.11"\r
        etat="stable"\r
-       compatibilite="[2.0.10;3.0.*]"\r
+       compatibilite="[2.0.10;3.1.*]"\r
        logo="images/verifier-128.png"\r
-       documentation="http://contrib.spip.net/Verifier,1505"\r
+       documentation="http://contrib.spip.net/Verifier"\r
 >\r
 \r
        <nom>API de v&#233;rification</nom>\r
index 4aca752..e77b041 100644 (file)
@@ -9,7 +9,7 @@
        <auteur>[Les Développements Durables->http://www.ldd.fr]</auteur>\r
        <icon>images/verifier-128.png</icon>\r
        <licence>GPL v3</licence>\r
-       <version>1.0.5</version>\r
+       <version>1.0.11</version>\r
        <etat>stable</etat>\r
        <description>\r
                <multi>\r
                </multi>\r
        </description>\r
        <prefix>verifier</prefix>\r
-       <lien>http://contrib.spip.net/Verifier,1505</lien>\r
+       <lien>http://contrib.spip.net/Verifier</lien>\r
        <pipeline>\r
                <nom>verifier</nom>\r
                <action></action>\r
        </pipeline>\r
-       <necessite id="SPIP" version="[2.0.10;3.0.99]" />\r
-       <utilise id="yaml" />   \r
+       <necessite id="SPIP" version="[2.0.10;3.1.99]" />\r
+       <utilise id="yaml" />\r
        <categorie>outil</categorie>\r
        <traduire gestionnaire="salvatore" module="verifier" reference="fr" />\r
 </plugin>\r
-\r
index 83ba0ac..e9f5e9f 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/verifier
-Revision: 84141
-Dernier commit: 2014-08-11 09:06:34 +0200 
+Revision: 99301
+Dernier commit: 2016-08-31 06:04:07 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/verifier</origine>
-<revision>84141</revision>
-<commit>2014-08-11 09:06:34 +0200 </commit>
+<revision>99301</revision>
+<commit>2016-08-31 06:04:07 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 90705cf..71b96c0 100644 (file)
@@ -1,19 +1,21 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Un code postal francais est compose de 5 chiffres
  * http://fr.wikipedia.org/wiki/Code_postal_en_France
  * a completer pour d'autre pays
- * 
+ *
  * cf : http://fr.wikipedia.org/wiki/Codes_postaux
- * 
+ *
  * La regexp par défaut doit valider toutes les possibilités
  * -* combinaisons de chiffres et de lettres et aussi tiret
  * -* notations internationales cf : http://en.wikipedia.org/wiki/List_of_postal_codes#On_the_use_of_country_codes
- * 
+ *
  * @param string $valeur
  *   La valeur à vérifier.
  * @param array $options
@@ -21,16 +23,18 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_code_postal_dist($valeur, $options=array()){
+function verifier_code_postal_dist($valeur, $options = array()) {
        $erreur = _T('verifier:erreur_code_postal');
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return $erreur;
+       }
 
        $ok = '';
-       switch ($options['pays']){
+       switch ($options['pays']) {
                case 'FR':
-                       if (!preg_match(",^((0[1-9])|([1-8][0-9])|(9[0-8]))[0-9]{3}$,", $valeur))
+                       if (!preg_match(',^((0[1-9])|([1-8][0-9])|(9[0-8]))[0-9]{3}$,', $valeur)) {
                                return $erreur;
+                       }
                        break;
                case 'DZ':// Algérie
                case 'DE':// Allemagne
@@ -50,12 +54,14 @@ function verifier_code_postal_dist($valeur, $options=array()){
                case 'MX':// Mexique
                case 'UA':// Ukraine
                        // 5 chiffres
-                       if (!preg_match(",^[0-9]{5}$,", $valeur))
+                       if (!preg_match(',^[0-9]{5}$,', $valeur)) {
                                return $erreur;
+                       }
                        break;
                default:
-                       if (!preg_match('/^[A-Z]{1,2}[-|\s][0-9]{3,6}$|^[0-9]{3,6}$|^[0-9|A-Z]{2,5}[-|\s][0-9|A-Z]{2,4}$|^[A-Z]{1,2} [0-9|A-Z]{2,5}[-|\s][0-9|A-Z]{2,4}/i',$valeur))
+                       if (!preg_match('/^[A-Z]{1,2}[-|\s][0-9]{3,6}$|^[0-9]{3,6}$|^[0-9|A-Z]{2,5}[-|\s][0-9|A-Z]{2,4}$|^[A-Z]{1,2} [0-9|A-Z]{2,5}[-|\s][0-9|A-Z]{2,4}/i', $valeur)) {
                                return $erreur;
+                       }
                        break;
        }
 
diff --git a/www/plugins/verifier/verifier/code_postal.yaml b/www/plugins/verifier/verifier/code_postal.yaml
new file mode 100644 (file)
index 0000000..e76237f
--- /dev/null
@@ -0,0 +1,10 @@
+
+titre: '<:verifier:type_code_postal:>'
+description: '<:verifier:type_code_postal_description:>'
+options:
+  -
+    saisie: 'input'
+    options:
+      nom: 'pays'
+      label: '<:verifier:option_code_postal_pays_label:>'
+      explication: '<:verifier:option_code_postal_pays_explication:>'
index d04e34a..e4eeae7 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Compare la valeur avec un autre champ du _request().
@@ -13,17 +15,20 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_comparaison_champ_dist($valeur, $options=array()){
+function verifier_comparaison_champ_dist($valeur, $options = array()) {
        include_spip('inc/filtres');
-       
+
        // On vérifie qu'on a bien un champ à comparer
-       if (!$champ = $options['champ'] or !is_scalar($champ)) return true;
-       else $valeur_champ = _request($champ);
-       
+       if (!$champ = $options['champ'] or !is_scalar($champ)) {
+               return true;
+       } else {
+               $valeur_champ = _request($champ);
+       }
+
        // On cherche le nom du champ
        $nom_champ = $options['nom_champ'] ? $options['nom_champ'] : $champ;
-       
-       switch ($options['comparaison']){
+
+       switch ($options['comparaison']) {
                case 'petit':
                        return $valeur < $valeur_champ ? '' : _T('verifier:erreur_comparaison_petit', array('nom_champ'=>$nom_champ));
                        break;
@@ -44,4 +49,3 @@ function verifier_comparaison_champ_dist($valeur, $options=array()){
                        break;
        }
 }
-
diff --git a/www/plugins/verifier/verifier/comparaison_champ.yaml b/www/plugins/verifier/verifier/comparaison_champ.yaml
new file mode 100644 (file)
index 0000000..0f824ab
--- /dev/null
@@ -0,0 +1,29 @@
+
+titre: '<:verifier:type_comparaison_champ:>'
+description: '<:verifier:type_comparaison_champ_description:>'
+options:
+  -
+    saisie: 'input'
+    options:
+      nom: 'champ'
+      label: '<:verifier:option_comparaison_champ_champ_label:>'
+      explication: '<:verifier:option_comparaison_champ_champ_explication:>'
+  -
+    saisie: 'input'
+    options:
+      nom: 'nom_champ'
+      label: '<:verifier:option_comparaison_champ_nom_champ_label:>'
+      explication: '<:verifier:option_comparaison_champ_nom_champ_explication:>'
+  -
+    saisie: 'radio'
+    options:
+      nom: 'comparaison'
+      label: '<:verifier:option_comparaison_champ_comparaison_label:>'
+      explication: '<:verifier:option_comparaison_champ_comparaison_explication:>'
+      datas:
+        '': '<:verifier:option_comparaison_champ_egal:>'
+        egal_type: '<:verifier:option_comparaison_champ_egal_type:>'
+        petit: '<:verifier:option_comparaison_champ_petit:>'
+        petit_egal: '<:verifier:option_comparaison_champ_petit_egal:>'
+        grand: '<:verifier:option_comparaison_champ_grand:>'
+        grand_egal: '<:verifier:option_comparaison_champ_grand_egal:>'
index 2445392..887a2dc 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie la validité d'un code couleur
- * 
+ *
  * @param string $valeur
  *   La valeur à vérifier.
  * @param array $options
@@ -16,24 +18,25 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_couleur_dist($valeur, $options=array(), &$valeur_normalisee=null){
+function verifier_couleur_dist($valeur, $options = array(), &$valeur_normalisee = null) {
        $erreur = _T('verifier:erreur_couleur');
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return $erreur;
+       }
 
        $ok = '';
-       switch ($options['type']){
+       switch ($options['type']) {
                case 'hexa':
                default:
-                       if (!preg_match(",^#[a-f0-9]{6}$,i", $valeur))
-                               if (isset($options['normaliser']) and preg_match(",^[a-f0-9]{6}$,i", $valeur))
-                                       $valeur_normalisee = "#".$valeur ;
-                               else
+                       if (!preg_match(',^#[a-f0-9]{6}$,i', $valeur)) {
+                               if (isset($options['normaliser']) and preg_match(',^[a-f0-9]{6}$,i', $valeur)) {
+                                       $valeur_normalisee = '#'.$valeur;
+                               } else {
                                        return $erreur;
+                               }
+                       }
                        break;
        }
 
        return $ok;
 }
-
-?>
\ No newline at end of file
index 184efda..bd628c5 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Une date au format JJ/MM/AAAA (avec séparateurs souples : espace / - .)
  * Options :
  * - format : permet de préciser le format de la date  jma pour jour/mois/année (par défaut), mja (pour mois / jour / année), amj (année/mois/jour)
- * TODO : compléter les formats 
+ * TODO : compléter les formats
  * On pourrait faire mieux, genre vérifier les jours en fonction du mois
  * Mais c'est pas très important, on reste simple
  *
@@ -20,70 +22,74 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_date_dist($valeur, $options=array(), &$valeur_normalisee=null){
+function verifier_date_dist($valeur, $options = array(), &$valeur_normalisee = null) {
        $erreur = _T('verifier:erreur_date_format');
        $horaire = false; // par défaut on ne teste qu'une date
-       
+
        // Si ce n'est ni une chaîne ni un tableau : pas le bon format
-       if (!is_string($valeur) and !is_array($valeur))
+       if (!is_string($valeur) and !is_array($valeur)) {
                return $erreur;
-       
+       }
+
        // Si c'est un tableau
        if (is_array($valeur)) {
                // S'il y a les bonnes infos on les garde aux bons endroits
-               if (
-                       isset($valeur['date']) and is_string($valeur['date'])
-                       and isset($valeur['heure']) and is_string($valeur['heure'])
-               ) {
+               if (isset($valeur['date']) and is_string($valeur['date'])
+                       and isset($valeur['heure']) and is_string($valeur['heure'])) {
                        $options['heure'] = $valeur['heure']; // l'heure pour la fonction de normalisation
                        $valeur = $valeur['date']; // valeur principale pour la date
                        $horaire = true; // on détecte une vérif avec horaire uniquement dans ce cas
-               }
-               // Sinon : pas le bon format
-               else {
+               } else {
+                       // Sinon : pas le bon format
                        return $erreur;
                }
        }
-       
+
        $ok = '';
-       
+
        // On tolère différents séparateurs
-       $valeur = preg_replace("#\.|/| #i",'-',$valeur);
-       
+       $valeur = preg_replace('#\.|/| #i', '-', $valeur);
+
        // On vérifie la validité du format
-       $format = isset($options['format']) ? $options['format'] : 'jma'; 
-       
+       $format = isset($options['format']) ? $options['format'] : 'jma';
+
        if ($format=='mja') {
-               if(!preg_match('#^[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}$#',$valeur)) return $erreur;
-               list($mois,$jour,$annee) = explode('-',$valeur);
+               if (!preg_match('#^[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}$#', $valeur)) {
+                       return $erreur;
+               }
+               list($mois,$jour,$annee) = explode('-', $valeur);
        } elseif ($format=='amj') {
-               if(!preg_match('#^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$#',$valeur)) return $erreur;
-               list($annee,$mois,$jour) = explode('-',$valeur);
+               if (!preg_match('#^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$#', $valeur)) {
+                       return $erreur;
+               }
+               list($annee,$mois,$jour) = explode('-', $valeur);
        } else {
        // Format jma par défaut
-               if(!preg_match('#^[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}$#',$valeur)) return $erreur;
-               list($jour,$mois,$annee) = explode('-',$valeur);
+               if (!preg_match('#^[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}$#', $valeur)) {
+                       return $erreur;
+               }
+               list($jour,$mois,$annee) = explode('-', $valeur);
+       }
+
+       // Validité de la date
+       $erreur = _T('verifier:erreur_date');
+       if (!checkdate($mois, $jour, $annee)) {
+               return $erreur;
        }
 
-               // Validité de la date
-               $erreur = _T('verifier:erreur_date');
-               if (!checkdate($mois, $jour, $annee)) return $erreur;
-       
-       if($horaire) {
+       if ($horaire) {
                // Format de l'heure
                $options['heure'] = str_replace(array('h','m','min'), array(':','',''), $options['heure']);
                if (!preg_match('#^([0-9]{1,2}):([0-9]{1,2})$#', $options['heure'], $hetm)) {
                        return _T('verifier:erreur_heure_format');
-               }
-               // Si c'est le bon format, on teste si les nombres donnés peuvent exister
-               else {
+               } else {
+                       // Si c'est le bon format, on teste si les nombres donnés peuvent exister
                        $heures = intval($hetm[1]);
                        $minutes = intval($hetm[2]);
-                       if ($heures < 0 or $heures > 23 or $minutes < 0 or $minutes > 59){
+                       if ($heures < 0 or $heures > 23 or $minutes < 0 or $minutes > 59) {
                                return _T('verifier:erreur_heure');
-                       }
-                       // Si tout est bon pour l'heure, on recompose en ajoutant des 0 si besoin
-                       else {
+                       } else {
+                               // Si tout est bon pour l'heure, on recompose en ajoutant des 0 si besoin
                                $options['heure'] = sprintf('%02d:%02d', $heures, $minutes);
                        }
                }
@@ -96,11 +102,8 @@ function verifier_date_dist($valeur, $options=array(), &$valeur_normalisee=null)
        return $ok;
 }
 
-
-
-
 /**
- * Convertir une date en datetime 
+ * Convertir une date en datetime
  *
 **/
 function normaliser_date_datetime_dist($valeur, $options, &$erreur) {
@@ -125,11 +128,11 @@ function normaliser_date_datetime_dist($valeur, $options, &$erreur) {
 
        if (!($date = mktime($date[3], $date[4], 0, (int)$date[1], (int)$date[2], (int)$date[0]))) {
                // mauvais format de date
-               $erreur = "Impossible de normaliser la date...";
+               $erreur = 'Impossible de normaliser la date...';
                return false;
        }
 
-       $date = date("Y-m-d H:i:s", $date);
+       $date = date('Y-m-d H:i:s', $date);
        $date = vider_date($date); // enlever les valeurs considerees comme nulles (1 1 1970, etc...)
 
        if (!$date) {
@@ -138,4 +141,3 @@ function normaliser_date_datetime_dist($valeur, $options, &$erreur) {
 
        return $date;
 }
-
index b144ead..55061e0 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie qu'un entier cohérent peut être extrait de la valeur
@@ -16,39 +18,39 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_decimal_dist($valeur, $options=array()){
+function verifier_decimal_dist($valeur, $options = array()) {
        $erreur = _T('verifier:erreur_decimal');
-       
+
        // Pas de tableau ni d'objet
-       if (is_numeric($valeur) and $valeur == floatval($valeur)){
+       if (is_numeric($valeur) and $valeur == floatval($valeur)) {
                // Si c'est une chaine on convertit en flottant
                $valeur = floatval($valeur);
                $ok = true;
                $erreur = '';
-               
-               if (isset($options['min']))
+
+               if (isset($options['min'])) {
                        $ok = ($ok and ($valeur >= $options['min']));
-               
-               if (isset($options['max'])){
+               }
+
+               if (isset($options['max'])) {
                        $ok = ($ok and ($valeur <= $options['max']));
                }
-               
-               if (!$ok){
-                       if (isset($options['min']) and isset($options['max']))
+
+               if (!$ok) {
+                       if (isset($options['min']) and isset($options['max'])) {
                                $erreur = _T('verifier:erreur_entier_entre', $options);
-                       elseif (isset($options['max']))
+                       } elseif (isset($options['max'])) {
                                $erreur = _T('verifier:erreur_entier_max', $options);
-                       else
+                       } else {
                                $erreur = _T('verifier:erreur_entier_min', $options);
+                       }
                }
        }
-       
+
        // On vérifie le nombre de décimales après la virgule
-       if ($nb_decimales = $options['nb_decimales'] and round($valeur, $nb_decimales) != $valeur){
+       if (isset($options['nb_decimales']) and $nb_decimales = $options['nb_decimales'] and round($valeur, $nb_decimales) != $valeur) {
                $erreur = _T('verifier:erreur_decimal_nb_decimales', array('nb_decimales' => $nb_decimales));
        }
-       
+
        return $erreur;
 }
-
-?>
index b525c31..286f455 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie la validité d'une adresse de courriel.
- * 
+ *
  * Les contraintes du mail sont déterminées par le mode de validation
  * En option, on contrôle aussi la disponibilité du mail dans la table des auteurs
  *
@@ -16,44 +18,49 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_email_dist($valeur, $options=array()){
+function verifier_email_dist($valeur, $options = array()) {
        include_spip('inc/filtres');
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return $erreur;
+       }
 
        // Disponibilite des courriels en base AUTEURS
        // Si l'adresse n'est pas disponible, on stoppe tout sinon on continue
-       if ($options['disponible'] and !verifier_disponibilite_email($valeur,isset($options['id_auteur'])?$options['id_auteur']:null)){
+       if (!empty($options['disponible']) and !verifier_disponibilite_email($valeur, isset($options['id_auteur']) ? $options['id_auteur'] : null)) {
                return _T('verifier:erreur_email_nondispo', array('email' => echapper_tags($valeur)));
        }
-       
+
        // Choix du mode de verification de la syntaxe des courriels
-       if (!$options['mode'] or !in_array($options['mode'], array('normal','rfc5322','strict'))){
+       if (empty($options['mode']) or !in_array($options['mode'], array('normal','rfc5322','strict'))) {
                $mode = 'normal';
-       }
-       else{
+       } else {
                $mode = $options['mode'];
        }
-               
-       $fonctions_disponibles = array('normal' => 'email_valide', 'rfc5322' => 'verifier_email_rfc5322', 'strict' => 'verifier_email_de_maniere_stricte');
+
+       $fonctions_disponibles = array(
+               'normal'  => 'email_valide',
+               'rfc5322' => 'verifier_email_rfc5322',
+               'strict'  => 'verifier_email_de_maniere_stricte'
+       );
        $fonction_verif = $fonctions_disponibles[$mode];
-       
-       if (!$fonction_verif($valeur))
+
+       if (!$fonction_verif($valeur)) {
                return _T('verifier:erreur_email', array('email' => echapper_tags($valeur)));
-       else
+       } else {
                return '';
+       }
 }
 
 /**
  * Changement de la RegExp d'origine
  *
- * Respect de la RFC5322 
+ * Respect de la RFC5322
  *
  * @link (phraseur détaillé ici : http://www.dominicsayers.com/isemail/)
  * @param string $valeur La valeur à vérifier
  * @return boolean Retourne true uniquement lorsque le mail est valide
  */
-function verifier_email_rfc5322($valeur){
+function verifier_email_rfc5322($valeur) {
        // Si c'est un spammeur autant arreter tout de suite
        if (preg_match(",[\n\r].*(MIME|multipart|Content-),i", $valeur)) {
                spip_log("Tentative d'injection de mail : $valeur");
@@ -61,8 +68,9 @@ function verifier_email_rfc5322($valeur){
        }
        include_spip('inc/is_email');
        foreach (explode(',', $valeur) as $adresse) {
-               if (!is_email(trim($adresse)))
+               if (!is_email(trim($adresse))) {
                        return false;
+               }
        }
        return true;
 }
@@ -77,7 +85,7 @@ function verifier_email_rfc5322($valeur){
  * @param string $valeur La valeur à vérifier
  * @return boolean Retourne true uniquement lorsque le mail est valide
  */
-function verifier_email_de_maniere_stricte($valeur){
+function verifier_email_de_maniere_stricte($valeur) {
        // Si c'est un spammeur autant arreter tout de suite
        if (preg_match(",[\n\r].*(MIME|multipart|Content-),i", $valeur)) {
                spip_log("Tentative d'injection de mail : $valeur");
@@ -86,11 +94,12 @@ function verifier_email_de_maniere_stricte($valeur){
        foreach (explode(',', $valeur) as $adresse) {
                // nettoyer certains formats
                // "Marie Toto <Marie@toto.com>"
-               $adresse = trim(preg_replace(",^[^<>\"]*<([^<>\"]+)>$,i", "\\1", $adresse));
-               if (!preg_match('/^([A-Za-z0-9]){1}([A-Za-z0-9]|-|_|\.)*@[A-Za-z0-9]([A-Za-z0-9]|-|\.){1,}\.[A-Za-z]{2,4}$/', $adresse))
+               $adresse = trim(preg_replace(',^[^<>\"]*<([^<>\"]+)>$,i', '\\1', $adresse));
+               if (!preg_match('/^([A-Za-z0-9]){1}([A-Za-z0-9]|-|_|\.)*@[A-Za-z0-9]([A-Za-z0-9]|-|\.){1,}\.[A-Za-z]{2,4}$/', $adresse)) {
                        return false;
+               }
        }
-       return true; 
+       return true;
 }
 
 /**
@@ -100,11 +109,12 @@ function verifier_email_de_maniere_stricte($valeur){
  * @param string $valeur La valeur à vérifier
  * @return boolean Retourne false lorsque le mail est déjà utilisé
  */
-function verifier_disponibilite_email($valeur,$exclure_id_auteur=null){
+function verifier_disponibilite_email($valeur, $exclure_id_auteur = null) {
        include_spip('base/abstract_sql');
 
-       if(sql_getfetsel('id_auteur', 'spip_auteurs', 'email='.sql_quote($valeur).(!is_null($exclure_id_auteur)?"AND statut<>'5poubelle' AND id_auteur<>".intval($exclure_id_auteur):'')))
+       if (sql_getfetsel('id_auteur', 'spip_auteurs', 'email='.sql_quote($valeur).(!is_null($exclure_id_auteur)?"AND statut<>'5poubelle' AND id_auteur<>".intval($exclure_id_auteur):''))) {
                return false;
-       else
+       } else {
                return true;
+       }
 }
index 2a82b73..22d3cab 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie qu'un entier cohérent peut être extrait de la valeur
@@ -16,34 +18,33 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_entier_dist($valeur, $options=array()){
+function verifier_entier_dist($valeur, $options = array()) {
        $erreur = _T('verifier:erreur_entier');
 
        // Pas de tableau ni d'objet
-       if (is_numeric($valeur) and $valeur == intval($valeur)){
+       if (is_numeric($valeur) and $valeur == intval($valeur)) {
                // Si c'est une chaine on convertit en entier
                $valeur = intval($valeur);
                $ok = true;
                $erreur = '';
-               
-               if (isset($options['min']))
+
+               if (isset($options['min'])) {
                        $ok = ($ok and ($valeur >= $options['min']));
-               
-               if (isset($options['max'])){
+               }
+               if (isset($options['max'])) {
                        $ok = ($ok and ($valeur <= $options['max']));
                }
-               
-               if (!$ok){
-                       if (isset($options['min']) and isset($options['max']))
+
+               if (!$ok) {
+                       if (isset($options['min']) and isset($options['max'])) {
                                $erreur = _T('verifier:erreur_entier_entre', $options);
-                       elseif (isset($options['max']))
+                       } elseif (isset($options['max'])) {
                                $erreur = _T('verifier:erreur_entier_max', $options);
-                       else
+                       } else {
                                $erreur = _T('verifier:erreur_entier_min', $options);
+                       }
                }
        }
-       
+
        return $erreur;
 }
-
-?>
index e0909db..08bdb61 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie que la valeur correspond à un id_dcoument valide
@@ -12,19 +14,18 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_id_document_dist($valeur, $options=array()){
+function verifier_id_document_dist($valeur, $options = array()) {
        $erreur = '';
-       
+
        if ($valeur !== '') {
                // On vérifie déjà qu'il s'agit d'un nombre
-               if(!is_numeric($valeur))
+               if (!is_numeric($valeur)) {
                        $erreur = _T('verifier:erreur_id_document');
-               // Puis qu'il y a au moins un document avec cet id
-               elseif (!sql_countsel('spip_documents',"id_document=$valeur"))
+               } elseif (!sql_countsel('spip_documents', 'id_document='.intval($valeur))) {
+                       // Puis qu'il y a au moins un document avec cet id
                        $erreur = _T('verifier:erreur_id_document');
+               }
        }
-       
+
        return $erreur;
 }
-
-?>
diff --git a/www/plugins/verifier/verifier/id_document.yaml b/www/plugins/verifier/verifier/id_document.yaml
new file mode 100644 (file)
index 0000000..f922b72
--- /dev/null
@@ -0,0 +1,3 @@
+
+titre: '<:verifier:type_id_document:>'
+description: '<:verifier:type_id_document_description:>'
diff --git a/www/plugins/verifier/verifier/id_objet.php b/www/plugins/verifier/verifier/id_objet.php
new file mode 100644 (file)
index 0000000..d14edeb
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+// Sécurité
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+/**
+ * Vérifie que la valeur correspond à un identifiant d'objet valide
+ *
+ * @param string $valeur
+ *   La valeur à vérifier.
+ * @param array $options
+ * @return string
+ *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
+ */
+function verifier_id_objet_dist($valeur, $options = array()) {
+       $erreur = '';
+
+       if ($valeur !== '') {
+               // On vérifie déjà qu'il s'agit d'un nombre
+               if (!is_numeric($valeur)) {
+                       $erreur = _T('verifier:erreur_id_objet');
+               } elseif (isset($options['objet'])) {
+                       $id_table_objet = id_table_objet($options['objet']);
+                       $table = table_objet_sql($options['objet']);
+                       if ($id_table_objet && $table) {
+                               if (!sql_countsel($table, $id_table_objet.'='.intval($valeur))) {
+                                       $erreur = _T('verifier:erreur_id_objet');
+                               }
+                       } else {
+                               $erreur = _T('verifier:erreur_objet');
+                       }
+               }
+       }
+
+       return $erreur;
+}
diff --git a/www/plugins/verifier/verifier/id_objet.yaml b/www/plugins/verifier/verifier/id_objet.yaml
new file mode 100644 (file)
index 0000000..f922b72
--- /dev/null
@@ -0,0 +1,3 @@
+
+titre: '<:verifier:type_id_document:>'
+description: '<:verifier:type_id_document_description:>'
index ba0a2ce..34946b1 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
- * Validation d'un numero ISBN 
+ * Validation d'un numero ISBN
  *
  * d apres https://fr.wikipedia.org/wiki/Numéro_ISBN
  * ISBN-13 : longeur totale 13 caracteres divises en 5 segments de la forme G - A - B - C - K
@@ -18,40 +20,34 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  *           A, B, C : idem ISBN-13
  *           K:  1 caractere entre 0 et 9, ou X (cle de controle calculee d apres les autres chiffres)
  *           ex: 2-1234-5680-X
- * 
+ *
  * Avec un numero ISBN comportant des tirets, on pourrait utiliser une regex
  * pour verifier que chaque segment comporte le nombre adequat de caracteres.
  * Cependant ca ne permet pas d indiquer precisement la nature de l erreur.
  * La regex au cas ou : "/^(97[89][- ]){0,1}[0-9]{1,5}[- ][0-9]{1,7}[- ][0-9]{1,6}[- ][0-9X]$/"
- * 
+ *
  *
  * @param string $valeur
  *   La valeur à vérifier.
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_isbn_dist($valeur, $options=array()){
+
+function verifier_isbn_dist($valeur, $options = array()) {
 
        // dans tous les cas, on doit avoir 10 ou 13 caracteres (en enlevant les tirets)
        $val['nb'] = $nb = strlen(preg_replace('/-/', '', $valeur));
-       if (!preg_match("/10|13/", $nb)) {
+       if (!preg_match('/10|13/', $nb)) {
                return _T('verifier:erreur_isbn_nb_caracteres', $val);
-       }
-
-       // un numero ISBN-13 ne peut pas se terminer par X
-       else if (preg_match("/^97[89].*X$/", $valeur)) {
-               return _T('verifier:erreur_isbn_13_X'); 
-       }
-
-       // s il y a le bon nombre de caracteres, on verifie qu il soient bien agences
-       else {
-
+       } else if (preg_match('/^97[89].*X$/', $valeur)) {
+               // un numero ISBN-13 ne peut pas se terminer par X
+               return _T('verifier:erreur_isbn_13_X');
+       } else {
+               // s il y a le bon nombre de caracteres, on verifie qu il soient bien agences
                // si le numero ISBN est decompose en segments par des tirets, verifier chaque segment
-               if (preg_match("/-/", $valeur)){
-
+               if (preg_match('/-/', $valeur)) {
                        // d'abord on recupere les valeurs de chaque segment
-                       $segments = explode("-", $valeur);
+                       $segments = explode('-', $valeur);
                        $val['nb'] = count($segments);
                        // ISBN-13
                        if ($val['nb'] == 5) {
@@ -61,62 +57,60 @@ function verifier_isbn_dist($valeur, $options=array()){
                                $B = $segments[2];
                                $C = $segments[3];
                                $K = $segments[4];
-                       }
-                       // ISBN-10
-                       else if ($val['nb'] == 4) {
+                       } elseif ($val['nb'] == 4) {
+                               // ISBN-10
                                $isbn = 10;
                                $A = $segments[0];
                                $B = $segments[1];
                                $C = $segments[2];
                                $K = $segments[3];
-                       }
-                       // nombre de segments incorrect (on ne sait jamais)
-                       else {
+                       } else {
+                               // nombre de segments incorrect (on ne sait jamais)
                                return _T('verifier:erreur_isbn_nb_segments', $val);
                        }
 
                        // puis ensuite, on verifie leur conformite
                        // G : 978 ou 979
-                       if ($G AND !preg_match("/97[89]/", $G)) {
+                       if ($G and !preg_match('/97[89]/', $G)) {
                                return _T('verifier:erreur_isbn_G');
                        }
                        // A, B et C doivent contenir des chiffres
-                       foreach (array($A,$B,$C) as $segment){
+                       foreach (array($A,$B,$C) as $segment) {
                                $val['segment'] = $segment;
-                               if (!is_numeric($segment))
+                               if (!is_numeric($segment)) {
                                        return _T('verifier:erreur_isbn_segment_lettre', $val);
+                               }
                        }
                        // A (code zone geographique) : 5 caracteres max
-                       if ($nbA = strlen($A) AND $nbA > 5) {
+                       if ($nbA = strlen($A) and $nbA > 5) {
                                $val['nb'] = $nbA - 5;
                                $val['segment'] = $A;
                                return _T('verifier:erreur_isbn_segment', $val);
                        }
                        // B (code editeur) : 7 caracteres max
-                       if ($nbB = strlen($B) AND $nbB > 7) {
+                       if ($nbB = strlen($B) and $nbB > 7) {
                                $val['nb'] = $nbB - 7;
                                $val['segment'] = $B;
                                return _T('verifier:erreur_isbn_segment', $val);
                        }
                        // C (code livre) : 6 caracteres max
-                       if ($nbC = strlen($C) AND $nbC > 6) {
+                       if ($nbC = strlen($C) and $nbC > 6) {
                                $val['nb'] = $nbC - 6;
                                $val['segment'] = $C;
                                return _T('verifier:erreur_isbn_segment', $val);
                        }
                        // K (cle de controle) : 1 caractere max
-                       if ($nbK = strlen($K) AND $nbK > 1) {
+                       if ($nbK = strlen($K) and $nbK > 1) {
                                $val['nb'] = $nbK - 1;
                                $val['segment'] = $K;
                                return _T('verifier:erreur_isbn_segment', $val);
                        }
-               }
-
-               // si le numero ISBN n a pas de tiret, on verifie au moyen d une regex
-               else {
+               } else {
+                       // si le numero ISBN n a pas de tiret, on verifie au moyen d une regex
                        // verification generique [978 ou 979] [9 chiffres] [1 chiffre ou lettre X]
-                       if (!preg_match("/^(97[89]){0,1}[0-9]{1,9}[0-9X]$/", $valeur))
+                       if (!preg_match('/^(97[89]){0,1}[0-9]{1,9}[0-9X]$/', $valeur)) {
                                return _T('verifier:erreur_isbn');
+                       }
                }
        }
 
diff --git a/www/plugins/verifier/verifier/isbn.yaml b/www/plugins/verifier/verifier/isbn.yaml
new file mode 100644 (file)
index 0000000..738ff27
--- /dev/null
@@ -0,0 +1,3 @@
+
+titre: '<:verifier:type_isbn:>'
+description: '<:verifier:type_isbn_description:>'
index 8ba8605..2157049 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifié une valeur suivant une expression régulière.
@@ -15,15 +17,15 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_regex_dist($valeur, $options=array()){
+function verifier_regex_dist($valeur, $options = array()) {
        $erreur = _T('verifier:erreur_regex');
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return $erreur;
+       }
 
-       if (preg_match($options['modele'], $valeur))
+       if (preg_match($options['modele'], $valeur)) {
                return '';
+       }
 
        return $erreur;
 }
-
-?>
index 04f0f71..6ff2fd3 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
- * Validation d'un SIREN ou d'un SIRET 
+ * Validation d'un SIREN ou d'un SIRET
  *
  * 1/ Un SIREN comporte STRICTEMENT 9 caractères
  * 1b/ Un SIRET comporte strictement 14 caractères
@@ -19,11 +21,10 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_siren_siret_dist($valeur, $options=array()){
-       if (!$options['mode'] or !in_array($options['mode'], array('siren', 'siret'))){
+function verifier_siren_siret_dist($valeur, $options = array()) {
+       if (!$options['mode'] or !in_array($options['mode'], array('siren', 'siret'))) {
                $mode = 'siren';
-       }
-       else{
+       } else {
                $mode = $options['mode'];
        }
 
@@ -31,43 +32,74 @@ function verifier_siren_siret_dist($valeur, $options=array()){
        $valeur = preg_replace('/\s/', '', $valeur);
 
        // Test de SIREN
-       if ($mode == 'siren'){
+       if ($mode == 'siren') {
                $erreur = _T('verifier:erreur_siren');
-               if (!is_string($valeur))
+               if (!is_string($valeur)) {
                        return $erreur;
+               }
 
                // Si pas 9 caractère, c'est déjà foiré !
-               if(!preg_match('/^[0-9]{9}$/',$valeur)) return $erreur;
-       
+               if (!preg_match('/^[0-9]{9}$/', $valeur)) {
+                       return $erreur;
+               }
+
                // On vérifie la clef de controle "1-2"
                $somme = 0;
                $i = 0; // Les impaires
-               while($i < 9){ $somme += $valeur[$i]; $i+=2; }
+               while ($i < 9) {
+                       $somme += $valeur[$i];
+                       $i+=2;
+               }
                $i = 1; // Les paires !
-               while($i < 9){ if((2*$valeur[$i])>9) $somme += (2*$valeur[$i])-9; else $somme += 2*$valeur[$i]; $i+=2; }
-       
-               if ($somme % 10) return $erreur;
-       }
-       // Test de SIRET
-       else{
+               while ($i < 9) {
+                       if ((2*$valeur[$i])>9) {
+                               $somme += (2*$valeur[$i])-9;
+                       } else {
+                               $somme += 2*$valeur[$i];
+                               $i+=2;
+                       }
+               }
+
+               if ($somme % 10) {
+                       return $erreur;
+               }
+       } else {
+               // Test de SIRET
                $erreur = _T('verifier:erreur_siret');
-               if (!is_string($valeur))
+               if (!is_string($valeur)) {
                        return $erreur;
+               }
 
                // Si pas 14 caractère, c'est déjà foiré !
-               if(!preg_match('/^[0-9]{14}$/',$valeur)) return $erreur;
-               if(preg_match('/[0]{8}/',$valeur)) return $erreur;
+               if (!preg_match('/^[0-9]{14}$/', $valeur)) {
+                       return $erreur;
+               }
+               if (preg_match('/[0]{8}/', $valeur)) {
+                       return $erreur;
+               }
 
                // Pour le SIRET on vérifie la clef de controle "1-2" avec les impaires *2
                // (vs pairs*2 pour SIREN, parce qu'on part de la fin)
                $somme = 0;
                $i = 1; // Les paires
-               while($i < 14){ $somme += $valeur[$i]; $i+=2; }
+               while ($i < 14) {
+                       $somme += $valeur[$i];
+                       $i+=2;
+               }
                $i = 0; // Les impaires !
-               while($i < 14){ if((2*$valeur[$i])>9) $somme += (2*$valeur[$i])-9; else $somme += 2*$valeur[$i]; $i+=2; }
-       
-               if($somme % 10) return $erreur;
+               while ($i < 14) {
+                       if ((2*$valeur[$i])>9) {
+                               $somme += (2*$valeur[$i])-9;
+                       } else {
+                               $somme += 2*$valeur[$i];
+                               $i+=2;
+                       }
+               }
+
+               if ($somme % 10) {
+                       return $erreur;
+               }
        }
-       
+
        return '';
 }
index b55ad1f..f74a61c 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifier une taille minimale/maximale, pour un mot de passe par exemple
@@ -14,37 +16,40 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
 
-function verifier_taille_dist($valeur, $options=array()){
+function verifier_taille_dist($valeur, $options = array()) {
        $ok = true;
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return _T('erreur_inconnue_generique');
-       
+       }
+
        include_spip('inc/charsets');
        $erreur = '';
        $taille = spip_strlen($valeur);
-       
-       if (isset($options['min']))
+
+       if (isset($options['min'])) {
                $ok = ($ok and ($taille >= $options['min']));
-       
-       if (isset($options['max'])){
+       }
+
+       if (isset($options['max'])) {
                $ok = ($ok and ($taille <= $options['max']));
        }
-       if (isset($options['egal'])){
+       if (isset($options['egal'])) {
                $ok = ($ok and ($taille == $options['egal']));
        }
-       
-       if (!$ok){
+
+       if (!$ok) {
                // On ajoute la taille actuelle aux valeurs de remplacement
                $options['nb'] = $taille;
-               if (isset($options['min']) and isset($options['max']))
+               if (isset($options['min']) and isset($options['max'])) {
                        $erreur = _T('verifier:erreur_taille_entre', $options);
-               elseif (isset($options['max']))
+               } elseif (isset($options['max'])) {
                        $erreur = _T('verifier:erreur_taille_max', $options);
-               elseif (isset($options['egal']))
+               } elseif (isset($options['egal'])) {
                        $erreur = _T('verifier:erreur_taille_egal', $options);
-               else
+               } else {
                        $erreur = _T('verifier:erreur_taille_min', $options);
+               }
        }
-       
+
        return $erreur;
 }
index 2051e24..70ed47a 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérifie un numéro de téléphone. Pour l'instant seulement avec le schéma français.
@@ -13,48 +15,58 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_telephone_dist($valeur, $options=array()){
+function verifier_telephone_dist($valeur, $options = array()) {
        $erreur = _T('verifier:erreur_telephone');
-       if (!is_string($valeur))
+       if (!is_string($valeur)) {
                return $erreur;
+       }
        $ok = '';
 
        // On accepte differentes notations, les points, les tirets, les espaces, les slashes
-       $tel = preg_replace("#\.|/|-| #i",'',$valeur);
+       $tel = preg_replace('#\.|/|-| #i', '', $valeur);
 
        // Pour les prefixes, on accepte les notations +33 et 0033
-       $prefixe_FR = "/^(\+|00)33/";
-       $prefixe_ES = "/^(\+|00)34/";
-       $prefixe_CH = "/^(\+|00)41/";
+       $prefixe_FR = '/^(\+|00)33/';
+       $prefixe_ES = '/^(\+|00)34/';
+       $prefixe_CH = '/^(\+|00)41/';
        if (preg_match($prefixe_FR, $tel)) {
                $options['pays'] = 'FR';
-               $tel = preg_replace($prefixe_FR,'0',$tel);
+               $tel = preg_replace($prefixe_FR, '0', $tel);
        }
        if (preg_match($prefixe_ES, $tel)) {
                $options['pays'] = 'ES';
-               $tel = preg_replace($prefixe_ES,'',$tel);
+               $tel = preg_replace($prefixe_ES, '', $tel);
        }
        if (preg_match($prefixe_CH, $tel)) {
                $options['pays'] = 'CH';
-               $tel = preg_replace($prefixe_CH,'0',$tel);
+               $tel = preg_replace($prefixe_CH, '0', $tel);
        }
 
-       switch($options['pays']){
+       switch ($options['pays']) {
                case 'CH':
-                       if (!preg_match("/^0[1-9]{9}$/",$tel)) return $erreur;
+                       if (!preg_match('/^0[1-9]{9}$/', $tel)) {
+                               return $erreur;
+                       }
                        break;
                case 'ES':
-                       if (!preg_match("/^[69][0-9]{8}$/",$tel)) return $erreur;
+                       if (!preg_match('/^[69][0-9]{8}$/', $tel)) {
+                               return $erreur;
+                       }
                        break;
                case 'FR':
-                       if (!preg_match("/^0[1-9][0-9]{8}$/",$tel)) return $erreur;
+                       if (!preg_match('/^0[1-9][0-9]{8}$/', $tel)) {
+                               return $erreur;
+                       }
+                       break;
                default:
                        // On interdit les 000 etc. mais je pense qu'on peut faire plus malin
                        // On interdit egalement les "numéros" tout en lettres
                        // TODO finaliser les numéros à la con
-                       if(intval($tel) == 0) return $erreur;
+                       if (intval($tel) == 0) {
+                               return $erreur;
+                       }
                        break;
        }
-       
+
        return $ok;
 }
index ce5120f..be3ac08 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 /**
  * Vérification d'une URL
- * 
+ *
  * Si auncune option n'est définie, vérifie uniquement si un protocole de type web est défini
  *
  * @param string $valeur
@@ -17,35 +19,33 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
  * @return string
  *   Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
  */
-function verifier_url_dist($valeur, $options=array()){
-       if (!is_string($valeur))
+function verifier_url_dist($valeur, $options = array()) {
+       if (!is_string($valeur)) {
                return _T('erreur_inconnue_generique');
+       }
 
        // Choix du mode de verification de la syntaxe des url
-       if (!$options['mode'] or !in_array($options['mode'], array('protocole_seul','php_filter','complet'))){
+       if (!$options['mode'] or !in_array($options['mode'], array('protocole_seul','php_filter','complet'))) {
                $mode = 'protocole_seul';
-       }
-       else{
+       } else {
                $mode = $options['mode'];
        }
-               
+
        // Choix du type de protocole à vérifier
-       if (!$options['type_protocole'] or !in_array($options['type_protocole'], array('tous','web','mail','ftp','exact'))){
+       if (!$options['type_protocole'] or !in_array($options['type_protocole'], array('tous','web','mail','ftp','exact'))) {
                $type_protocole = 'web';
-       }
-       else{
+       } else {
                $type_protocole = $options['type_protocole'];
                $protocole = '' ;
-               if ($type_protocole=='exact' && $options['protocole']){
+               if ($type_protocole=='exact' && $options['protocole']) {
                        $protocole = $options['protocole'];
                }
        }
-               
+
        $fonctions_disponibles = array('protocole_seul' => 'verifier_url_protocole', 'php_filter' => 'verifier_php_filter', 'complet' => 'verifier_url_complet');
        $fonction_verif = $fonctions_disponibles[$mode];
-       
-       return $fonction_verif($valeur,$type_protocole,$protocole) ;
 
+       return $fonction_verif($valeur,$type_protocole,$protocole) ;
 }
 
 /**
@@ -56,23 +56,27 @@ function verifier_url_dist($valeur, $options=array()){
  * @param string $protocole : nom du protocole (si type_protocole=exact)
  * @return boolean Retourne true uniquement lorsque l'url est valide
  */
-function verifier_url_protocole($url,$type_protocole,$protocole){
-
-       $urlregex = array('tous' => "#^([a-z0-9]*)\:\/\/.*$# i",
-                                                'web' => "#^(https?)\:\/\/.*$# i",
-                                                'ftp' => "#^(s?ftp)\:\/\/.*$# i",
-                                                'mail' => "#^(pop3|smtp|imap)\:\/\/.*$# i",
-                                                'exact' => "#^(".$protocole.")\:\/\/.*$# i");
-       
-       $msg_erreur = array('tous' => "",
-                                                        'web' => "http://, https://",
-                                                        'ftp' => "^ftp://, sftp://",
-                                                        'mail' => "pop3://, smtp://, imap://",
-                                                        'exact' => $protocole."://" );
-       
+function verifier_url_protocole($url, $type_protocole, $protocole) {
+
+       $urlregex = array(
+               'tous' => '#^([a-z0-9]*)\:\/\/.*$# i',
+               'web' => '#^(https?)\:\/\/.*$# i',
+               'ftp' => '#^(s?ftp)\:\/\/.*$# i',
+               'mail' => '#^(pop3|smtp|imap)\:\/\/.*$# i',
+               'exact' => '#^(".$protocole.")\:\/\/.*$# i'
+       );
+
+       $msg_erreur = array(
+               'tous' => '',
+               'web' => 'http://, https://',
+               'ftp' => '^ftp://, sftp://',
+               'mail' => 'pop3://, smtp://, imap://',
+               'exact' => $protocole.'://'
+       );
+
 
        if (!preg_match($urlregex[$type_protocole], $url)) {
-               if($type_protocole=="tous") {
+               if ($type_protocole == 'tous') {
                        return _T('verifier:erreur_url_protocole_exact', array('url' => echapper_tags($url)));
                } else {
                        return _T('verifier:erreur_url_protocole', array('url' => echapper_tags($url),'protocole' => $msg_erreur[$type_protocole]));
@@ -89,10 +93,11 @@ function verifier_url_protocole($url,$type_protocole,$protocole){
  * @param string $protocole : nom du protocole (si type_protocole=exact)
  * @return boolean Retourne true uniquement lorsque l'url est valide
  */
-function verifier_php_filter($url,$type_protocole,$protocole){
+function verifier_php_filter($url, $type_protocole, $protocole) {
 
-       if (!filter_var($url, FILTER_VALIDATE_URL))
+       if (!filter_var($url, FILTER_VALIDATE_URL)) {
                return _T('verifier:erreur_url', array('url' => echapper_tags($valeur)));
+       }
        return '';
 }
 
@@ -107,33 +112,34 @@ function verifier_php_filter($url,$type_protocole,$protocole){
  * @param string $protocole : nom du protocole (si type_protocole=exact)
  * @return boolean Retourne true uniquement lorsque l'url est valide
  */
-function verifier_url_complet($url,$type_protocole,$protocole){
-       
-       if($msg=verifier_url_protocole($url,$type_protocole,$protocole)!=''){
+function verifier_url_complet($url, $type_protocole, $protocole) {
+
+       if ($msg = verifier_url_protocole($url, $type_protocole, $protocole) != '') {
                return $msg;
        }
        // SCHEME
-       $urlregex = "#^(.*)\:\/\/";
-       
+       $urlregex = '#^(.*)\:\/\/';
+
        // USER AND PASS (optional)
-       $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?";
-       
+       $urlregex .= '([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?';
+
        // HOSTNAME OR IP
-       $urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; // http://x = allowed (ex. http://localhost, http://routerlogin)
+       $urlregex .= '[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*'; // http://x = allowed (ex. http://localhost, http://routerlogin)
        //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)+"; // http://x.x = minimum
        //$urlregex .= "([a-z0-9+\$_-]+\.)*[a-z0-9+\$_-]{2,3}"; // http://x.xx(x) = minimum
        //use only one of the above
-       
+
        // PORT (optional)
-       $urlregex .= "(\:[0-9]{2,5})?";
+       $urlregex .= '(\:[0-9]{2,5})?';
        // PATH (optional)
-       $urlregex .= "(\/([a-z0-9+\$_%,-]\.?)+)*\/?";
+       $urlregex .= '(\/([a-z0-9+\$_%,-]\.?)+)*\/?';
        // GET Query (optional)
-       $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?";
+       $urlregex .= '(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?';
        // ANCHOR (optional)
-       $urlregex .= "(\#[a-z_.-][a-z0-9+\$_.-]*)?\$# i";
-       
-       if (!preg_match($urlregex, $url))
+       $urlregex .= '(\#[a-z_.-][a-z0-9+\$_.-]*)?\$# i';
+
+       if (!preg_match($urlregex, $url)) {
                return _T('verifier:erreur_url', array('url' => echapper_tags($valeur)));
+       }
        return '';
-}
\ No newline at end of file
+}
index a9f27e5..4b95e90 100644 (file)
@@ -1,16 +1,17 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 function yaml_article($id_article) {
        include_spip('inc/yaml');
        $a = array_filter(sql_fetsel('*', 'spip_articles', 'id_article='.$id_article));
        $a['rubrique'] = array_filter(sql_fetsel('*', 'spip_rubriques', 'id_rubrique='.$a['id_rubrique']));
 
-       foreach(sql_allfetsel('*', 'spip_mots AS m LEFT JOIN spip_mots_articles AS c ON m.id_mot=c.id_mot', 'c.id_article='.$id_article) as $m)
+       foreach (sql_allfetsel('*', 'spip_mots AS m LEFT JOIN spip_mots_articles AS c ON m.id_mot=c.id_mot', 'c.id_article='.$id_article) as $m) {
                $a['mots'][] = array_filter($m);
+       }
 
-       return yaml_encode(
-               array_filter($a)
-               );
-}
\ No newline at end of file
+       return yaml_encode(array_filter($a));
+}
index 0e12ea0..59f8974 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 # textwheel fournit yaml_decode() aussi...
 # include_spip('inc/yaml-mini');
@@ -13,13 +15,14 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
 # Regle de dev: ne pas se rendre dependant de la lib sous-jacente
 
 // Si on est en PHP4
- if (version_compare(PHP_VERSION, '5.0.0', '<'))
-       define('_LIB_YAML','spyc-php4'); 
- else {
+if (version_compare(PHP_VERSION, '5.0.0', '<')) {
+       define('_LIB_YAML', 'spyc-php4');
+} else {
        // temporaire le temps de tester spyc
-       define('_LIB_YAML','sfyaml'); 
-       #define('_LIB_YAML','spyc'); 
+       define('_LIB_YAML', 'sfyaml');
+       #define('_LIB_YAML','spyc');
 }
+
 /*
  * Encode n'importe quelle structure en yaml
  * @param $struct
@@ -47,7 +50,7 @@ function yaml_encode($struct, $opt = array()) {
  *        boolean $show_error  true: arrete le parsing et retourne erreur en cas d'echec  - false: retourne un simple false en cas d'erreur de parsing
  */
 if (!function_exists('yaml_decode')) {
-function yaml_decode($input,$show_error=true) {
+function yaml_decode($input, $show_error = true) {
        // Si PHP4
        if (_LIB_YAML == 'spyc-php4') {
                require_once _DIR_PLUGIN_YAML.'spyc/spyc-php4.php';
@@ -60,24 +63,24 @@ function yaml_decode($input,$show_error=true) {
        }
 
        require_once _DIR_PLUGIN_YAML.'inc/yaml_sfyaml.php';
-       return yaml_sfyaml_decode($input,$show_error);
+       return yaml_sfyaml_decode($input, $show_error);
 }
 }
 
 /*
  * Decode un fichier en utilisant yaml_decode
- * @param string $fichier 
+ * @param string $fichier
  */
-function yaml_decode_file($fichier){
+function yaml_decode_file($fichier) {
        $yaml = '';
        $retour = false;
-       
+
        lire_fichier($fichier, $yaml);
        // Si on recupere bien quelque chose
-       if ($yaml){
+       if ($yaml) {
                $retour = yaml_decode($yaml);
        }
-       
+
        return $retour;
 }
 
@@ -87,24 +90,22 @@ function yaml_decode_file($fichier){
  * On passe donc par find_in_path() pour trouver le fichier
  * @param array $tableau
  */
-
-function yaml_charger_inclusions($tableau){
-       if (is_array($tableau)){
+function yaml_charger_inclusions($tableau) {
+       if (is_array($tableau)) {
                $retour = array();
-               foreach($tableau as $cle => $valeur) {
-                       if (is_string($valeur) && substr($valeur,0,8)=='inclure:' && substr($valeur,-5)=='.yaml')
-                               $retour = array_merge($retour,yaml_charger_inclusions(yaml_decode_file(find_in_path(substr($valeur,8)))));
-                       elseif (is_array($valeur))
-                               $retour = array_merge($retour,array($cle => yaml_charger_inclusions($valeur)));
-                       else
-                               $retour = array_merge($retour,array($cle => $valeur));
+               foreach ($tableau as $cle => $valeur) {
+                       if (is_string($valeur) && substr($valeur, 0, 8) == 'inclure:' && substr($valeur, -5) == '.yaml') {
+                               $retour = array_merge($retour, yaml_charger_inclusions(yaml_decode_file(find_in_path(substr($valeur, 8)))));
+                       } elseif (is_array($valeur)) {
+                               $retour = array_merge($retour, array($cle => yaml_charger_inclusions($valeur)));
+                       } else {
+                               $retour = array_merge($retour, array($cle => $valeur));
+                       }
                }
                return $retour;
-       }
-       elseif (is_string($tableau) && substr($tableau,0,8)=='inclure:' && substr($tableau,-5)=='.yaml')
-               return yaml_charger_inclusions(yaml_decode_file(find_in_path(substr($tableau,8))));
-       else
+       } elseif (is_string($tableau) && substr($tableau, 0, 8) == 'inclure:' && substr($tableau, -5) == '.yaml') {
+               return yaml_charger_inclusions(yaml_decode_file(find_in_path(substr($tableau, 8))));
+       } else {
                return $tableau;
+       }
 }
-
-?>
index 1d94844..02b4bb4 100644 (file)
@@ -1,36 +1,31 @@
-<?php\r
-if (!defined("_ECRIRE_INC_VERSION")) return;\r
-\r
-function yaml_sfyaml_encode($struct, $opt = array()) {\r
-       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYaml.php';\r
-       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYamlDumper.php';\r
-       $opt = array_merge(\r
-               array(\r
-                       'inline' => 2\r
-               ), $opt);\r
-       $yaml = new sfYamlDumper();\r
-       return $yaml->dump($struct, $opt['inline']);\r
-}\r
-\r
-function yaml_sfyaml_decode($input,$show_error=true) {\r
-       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYaml.php';\r
-       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYamlParser.php';\r
-\r
-       $yaml = new sfYamlParser();\r
-\r
-       try\r
-       {\r
-         $ret = $yaml->parse($input);\r
-       }\r
-       catch (Exception $e)\r
-       {\r
-               if ($show_error) \r
-              throw new InvalidArgumentException(sprintf('Unable to parse string: %s', $e->getMessage()));\r
-          else\r
-              return false;       \r
-       }\r
-\r
-       return $ret;\r
-}\r
-\r
-?>
\ No newline at end of file
+<?php
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+function yaml_sfyaml_encode($struct, $opt = array()) {
+       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYaml.php';
+       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYamlDumper.php';
+       $opt = array_merge(array('inline' => 2), $opt);
+       $yaml = new sfYamlDumper();
+       return $yaml->dump($struct, $opt['inline']);
+}
+
+function yaml_sfyaml_decode($input, $show_error = true) {
+       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYaml.php';
+       require_once _DIR_PLUGIN_YAML.'sfyaml/sfYamlParser.php';
+
+       $yaml = new sfYamlParser();
+
+       try {
+               $ret = $yaml->parse($input);
+       } catch (Exception $e) {
+               if ($show_error) {
+                       throw new InvalidArgumentException(sprintf('Unable to parse string: %s', $e->getMessage()));
+               } else {
+                       return false;
+               }
+       }
+
+       return $ret;
+}
index 75969ef..bcebb83 100644 (file)
@@ -1,15 +1,16 @@
 <?php
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 function inc_yaml_to_array_dist($u) {
        include_spip('inc/yaml');
-       if (is_array($yaml = yaml_decode($u)))
+       if (is_array($yaml = yaml_decode($u))) {
                $tableau = $yaml;
-       else if (is_object($yaml))
+       } elseif (is_object($yaml)) {
                $tableau = (array) $yaml;
+       }
 
        return $tableau;
 }
-
-?>
index 1f1c505..c683943 100644 (file)
@@ -10,6 +10,9 @@
        </langue>
        <langue code="fr" url="http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=fr" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
        </langue>
+       <langue code="nl" url="http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=nl" total="2" traduits="2" 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-yaml?lang_cible=ru" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="nazar" lien="http://trad.spip.net/auteur/nazar" />
                <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
index 7bae352..520009f 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 <code>yaml_decode()</code> and <code>yaml_encode()</code>. It also provides the yaml format for the (DATA) loop.',
        'yaml_slogan' => 'A simple file format for editing lists of data'
 );
-
-?>
index 90af6eb..38f5857 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'yaml_description' => 'Este plugin proporciona las funciones de lectura/escritura del formato YAML: <code>yaml_decode()</code> y <code>yaml_encode()</code>. También proporciona el formato yaml para el bucle (DATA).',
        'yaml_slogan' => 'Un formato de archivo simple para editar listas de datos'
 );
-
-?>
index 9d298e7..ebb1ecb 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'yaml_description' => 'اين پلاگين كاركردهاي خواندن/نوشتن فرمت يا.اي.ام.ال را فراهم مي‌آورد: <code>yaml_decode()</code> و<code>yaml_encode()</code>. همچنين فرمت يا.اي.ام.ال را براي حلقه‌ي (DATA) فراهم مي‌سازد.',
        'yaml_slogan' => 'فرمتي براي پروند‌ه ساده براي ويرايش فهرست‌هاي داده‌ها'
 );
-
-?>
index 9933ac5..66a6a9e 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/yaml/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -10,5 +12,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        <code>yaml_decode()</code> et <code>yaml_encode()</code>. Il fournit aussi le format yaml pour la boucle (DATA).',
        'yaml_slogan' => 'Un format de fichier simple pour éditer des listes de données'
 );
-
-?>
diff --git a/www/plugins/yaml/lang/paquet-yaml_nl.php b/www/plugins/yaml/lang/paquet-yaml_nl.php
new file mode 100644 (file)
index 0000000..39ec5b5
--- /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-yaml?lang_cible=nl
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // Y
+       'yaml_description' => 'Met behulp van deze plugin komt de functie van het lezen/schrijven in YAML-formaat beschikbaar:
+       <code>yaml_decode()</code> en <code>yaml_encode()</code>. Het formaat kan ook in de (DATA) lus worden gebruikt.',
+       'yaml_slogan' => 'Een eenvoudig bestandsformaat om gegevenslijsten te redigeren'
+);
index 8691623..e437435 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        <code>yaml_decode()</code> и <code>yaml_encode()</code>. И позволяет использовать YAML в запросе BOUCLE(DATA).',
        'yaml_slogan' => 'Позволяет работать с YAML форматом'
 );
-
-?>
index 4b44dfb..0bf17d2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-yaml?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -12,5 +14,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        <code>yaml_decode()</code> a <code>yaml_encode()</code>. Poskytuje formát yaml aj pre cyklus (DATA).',
        'yaml_slogan' => 'Jednoduchý formát súborov na upravovanie zoznamov dát'
 );
-
-?>
index 3b0b613..7507ae8 100644 (file)
@@ -1,11 +1,11 @@
 <paquet
        prefix="yaml"
        categorie="outil"
-       version="1.5.1"
+       version="1.5.2"
        etat="stable"
-       compatibilite="[2.0.10;3.0.*]"
+       compatibilite="[2.0.10;3.1.*]"
        logo="yaml.png"
-       documentation="http://www.spip-contrib.net/Le-plugin-YAML"
+       documentation="http://contrib.spip.net/Le-plugin-YAML"
 >
 
        <nom>YAML</nom>
@@ -16,4 +16,4 @@
        <credit lien="http://components.symfony-project.org/yaml/">Symfony YAML - Fabien Potencier</credit>
 
        <licence lien="http://opensource.org/licenses/mit-license.php">MIT</licence>
-</paquet>
\ No newline at end of file
+</paquet>
index c2e63a6..05bbe02 100644 (file)
@@ -3,17 +3,17 @@
        <slogan>Un format de fichier simple pour &#233;diter des listes de donn&#233;es.</slogan>
        <auteur>format d&#233;fini par yaml.org, librairie php d&#233;velopp&#233;e par Fabien Potencier pour Symfony</auteur>
        <licence>MIT</licence>
-       <version>1.5.1</version>
+       <version>1.5.2</version>
        <etat>stable</etat>
        <description>
        Ce plugin fournit les fonctions de lecture/&#233;criture du format YAML.
        <code>yaml_decode()</code> et <code>yaml_encode()</code>. Il fournit aussi le format yaml pour la boucle (DATA).
        </description>
        <prefix>YAML</prefix>
-       <lien>http://www.spip-contrib.net/Le-plugin-YAML</lien>
+       <lien>http://contrib.spip.net/Le-plugin-YAML</lien>
        <icon>yaml.png</icon>
        <fonctions>yaml_fonctions.php</fonctions>
-       <necessite id="SPIP" version="[2.0.10;3.0.99]" />
+       <necessite id="SPIP" version="[2.0.10;3.1.99]" />
        <categorie>outil</categorie>
        <chemin dir='' />
 </plugin>
index 4049a97..9b0df0b 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/yaml
-Revision: 78336
-Dernier commit: 2013-11-11 00:00:50 +0100 
+Revision: 97676
+Dernier commit: 2016-05-10 19:19:02 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/yaml</origine>
-<revision>78336</revision>
-<commit>2013-11-11 00:00:50 +0100 </commit>
+<revision>97676</revision>
+<commit>2016-05-10 19:19:02 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 0880d9a..ef2c1fb 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 
 // Sécurité
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 // Filtre permettant d'utiliser yaml_decode_file() dans un squelette
-function decoder_yaml($fichier){
+function decoder_yaml($fichier) {
        include_spip('inc/yaml');
        return yaml_decode_file($fichier);
 }
@@ -13,5 +15,3 @@ function inc_yaml_to_array($u) {
        include_spip('inc/yaml');
        return yaml_decode($u);
 }
-
-?>
index 05da9de..853616d 100644 (file)
Binary files a/www/plugins/zen-garden-2/images/themes-128.png and b/www/plugins/zen-garden-2/images/themes-128.png differ
index 7b6e426..79d027c 100644 (file)
Binary files a/www/plugins/zen-garden-2/images/themes-32.png and b/www/plugins/zen-garden-2/images/themes-32.png differ
index 28d544a..5cbc66f 100644 (file)
Binary files a/www/plugins/zen-garden-2/images/themes-64.png and b/www/plugins/zen-garden-2/images/themes-64.png differ
index a4135ce..5d04a22 100644 (file)
@@ -5,10 +5,17 @@
  *
  */
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined("_ECRIRE_INC_VERSION")) {
+       return;
+}
 
-if (!defined('_DIR_THEMES'))
-       define('_DIR_THEMES',_DIR_RACINE."themes/");
+if (!defined('_DIR_THEMES')) {
+       define('_DIR_THEMES', _DIR_RACINE . "themes/");
+}
+
+if (!defined('_DIR_THEMES_DIST')) {
+       define('_DIR_THEMES_DIST', _DIR_RACINE . "themes-dist/");
+}
 
 function zengarden_charge_themes($dir = _DIR_THEMES, $tous = false, $force = false){
        $themes = array();
@@ -17,7 +24,7 @@ function zengarden_charge_themes($dir = _DIR_THEMES, $tous = false, $force = fal
        $files = liste_plugin_files($dir);
 
        if (count($files)) {
-               $get_infos = charger_fonction('get_infos','plugins');
+               $get_infos = charger_fonction('get_infos', 'plugins');
 
                $t = $get_infos($files,$force,$dir);
                $themes = array();
@@ -36,5 +43,3 @@ function zengarden_charge_themes($dir = _DIR_THEMES, $tous = false, $force = fal
 
        return $themes;
 }
-
-?>
index 4fc2029..146a6f7 100644 (file)
@@ -3,6 +3,6 @@ jQuery(function() {
                .change(function(){
                        jQuery(this).parents('form').get(0).submit();
                })
-               .attr('value',theme_selected)
-         .siblings("input[type=submit]").hide();
-});
\ No newline at end of file
+               .val(theme_selected)
+               .siblings("input[type=submit]").hide();
+});
index b077dbf..705c345 100644 (file)
@@ -1,4 +1,7 @@
 <traduction module="paquet-zengarden" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/zen-garden/trunk/lang/" reference="fr">
+       <langue code="de" url="http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=de" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
+               <traducteur nom="klaus++" lien="http://trad.spip.net/auteur/klaus" />
+       </langue>
        <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=en" total="2" traduits="2" relire="0" modifs="0" nouveaux="0" pourcent="100.00">
                <traducteur nom="kent1" lien="http://trad.spip.net/auteur/kent1" />
        </langue>
diff --git a/www/plugins/zen-garden-2/lang/paquet-zengarden_de.php b/www/plugins/zen-garden-2/lang/paquet-zengarden_de.php
new file mode 100644 (file)
index 0000000..196f7a6
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+// This is a SPIP language file  --  Ceci est un fichier langue de SPIP
+// extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=de
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // Z
+       'zengarden_description' => ' ',
+       'zengarden_slogan' => 'Ein Zen-Garten für Skelette'
+);
index 4a7a463..4933fa5 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'A Zen garden for the skeletons'
 );
-
-?>
index 2f4b473..d5349b2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'Un jardín Zen para los esqueletos'
 );
-
-?>
index 197f251..d1d30aa 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'باغ ذن براي اسپيپ ' # MODIF
 );
-
-?>
index ce52b90..a834945 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/zen-garden/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -9,5 +11,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'Un jardin Zen pour les squelettes'
 );
-
-?>
index 085ef1e..4447517 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => 'Bekijk, probeer en kies het juiste thema voor je site. ',
        'zengarden_slogan' => 'SPIP in Zen-sferen'
 );
-
-?>
index a9e8233..f554b22 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=ru
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'Плагин "Zengarden" для SPIP' # MODIF
 );
-
-?>
index 638f449..f5a6825 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/paquet-zengarden?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -11,5 +13,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'zengarden_description' => ' ',
        'zengarden_slogan' => 'Zenová záhrada pre šablóny'
 );
-
-?>
index 2926626..172068b 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=de
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -34,5 +36,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'Dieses Thema wird zur Zeit verwendet',
        'themes' => 'Themen'
 );
-
-?>
index 64cb417..8aa20d6 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=en
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -33,5 +35,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'This theme is currently used',
        'themes' => 'Themes'
 );
-
-?>
index b2d1a98..048d5d2 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=es
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -33,5 +35,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'Este tema se utiliza actualmente',
        'themes' => 'Temas'
 );
-
-?>
index b92bad3..02a2315 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=fa
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -33,5 +35,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'در حال حاضر اين تم مورد استفاده است',
        'themes' => 'تم‌ها'
 );
-
-?>
index b06a554..bfbd2d6 100644 (file)
@@ -1,7 +1,9 @@
 <?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_/zen-garden/trunk/lang/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -31,5 +33,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'Ce thème est actuellement utilisé',
        'themes' => 'Thèmes'
 );
-
-?>
index d5fadba..4355bfe 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=nl
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -33,5 +35,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'Dit thema wordt momenteel gebruikt',
        'themes' => 'Thema’s'
 );
-
-?>
index 7ef76c6..7e4b7b4 100644 (file)
@@ -3,7 +3,9 @@
 // extrait automatiquement de http://trad.spip.net/tradlang_module/zengarden?lang_cible=sk
 // ** ne pas modifier le fichier **
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 $GLOBALS[$GLOBALS['idx_lang']] = array(
 
@@ -33,5 +35,3 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
        'theme_actif' => 'Tento farebný motív sa používa teraz',
        'themes' => 'Farebné motívy'
 );
-
-?>
index a35b28a..2a6d395 100644 (file)
@@ -1,11 +1,11 @@
 <paquet
        prefix="zengarden"
        categorie="maintenance"
-       version="2.5.3"
-       etat="test"
-       compatibilite="[3.0.0;3.0.*]"
+       version="2.6.3"
+       etat="stable"
+       compatibilite="[3.0.0;3.1.*]"
        logo="images/themes-32.png"
-       documentation="http://www.spip-contrib.net/SPIP-Zen-Garden"
+       documentation="http://contrib.spip.net/SPIP-Zen-Garden"
 >
        <nom>Zen-Garden</nom>
        <!-- Un jardin Zen pour les squelettes -->
index e25fb4b..6e518fb 100644 (file)
@@ -14,8 +14,8 @@
                </div>
                <div class="qTipContent">
                <div class='descriptif'>[(#VALEUR{description}|propre)]</div>
-               <div class='auteur'>[(#VAL{info_les_auteurs_1}|_T{#ARRAY{les_auteurs,#VALEUR{auteur}|implode{', '}|propre|PtoBR}})]</div>
-               <div class='licence'>[<:intitule_licence:> (#VALEUR{licence}|implode{','}|propre|PtoBR)]</div>
+               <div class='auteur'>[(#VAL{info_les_auteurs_1}|_T{#ARRAY{les_auteurs,#VALEUR{auteur}|zengarden_affiche_info|propre|PtoBR}})]</div>
+               <div class='licence'>[<:intitule_licence:> (#VALEUR{licence}|zengarden_affiche_info|propre|PtoBR)]</div>
                <B_squelettes>
                        <div class='squelette'>
                                <:zengarden:intitule_compatiblite_squelette:>
index 593170f..643b0c2 100644 (file)
@@ -6,8 +6,8 @@
 <h2><:zengarden:theme_actif:></h2>
 <h3>[(#VALEUR{nom}|typo|extraire_multi)]</h3>
 <div class='descriptif'>[(#VALEUR{description}|propre)]</div>
-<div class='auteur'>[(#VAL{info_les_auteurs_1}|_T{#ARRAY{les_auteurs,#VALEUR{auteur}|implode{', '}|propre|PtoBR}})]</div>
-<div class='licence'>[<:intitule_licence:> (#VALEUR{licence}|implode{','}|propre|PtoBR)]</div>
+<div class='auteur'>[(#VAL{info_les_auteurs_1}|_T{#ARRAY{les_auteurs,#VALEUR{auteur}|zengarden_affiche_info|propre|PtoBR}})]</div>
+<div class='licence'>[<:intitule_licence:> (#VALEUR{licence}|zengarden_affiche_info|propre|PtoBR)]</div>
 <p class='actions'><a class='ajax' href='#URL_ACTION_AUTEUR{zengarden_activer_theme,defaut:#CLE,#SELF}'>\[<:zengarden:desactiver_ce_theme:>\]</a></p>
 </li>
 </BOUCLE_sel>
index ebfc103..a31825f 100644 (file)
Binary files a/www/plugins/zen-garden-2/prive/themes/spip/images/themes-16.png and b/www/plugins/zen-garden-2/prive/themes/spip/images/themes-16.png differ
index 40ae7b4..13e8335 100644 (file)
@@ -1,10 +1,10 @@
 <svn_revision>
 <text_version>
 Origine: file:///home/svn/repository/spip-zone/_plugins_/zen-garden/trunk
-Revision: 79166
-Dernier commit: 2013-12-05 06:02:09 +0100 
+Revision: 97593
+Dernier commit: 2016-05-07 23:04:16 +0200 
 </text_version>
 <origine>file:///home/svn/repository/spip-zone/_plugins_/zen-garden/trunk</origine>
-<revision>79166</revision>
-<commit>2013-12-05 06:02:09 +0100 </commit>
+<revision>97593</revision>
+<commit>2016-05-07 23:04:16 +0200 </commit>
 </svn_revision>
\ No newline at end of file
index 715edd8..058f8fe 100644 (file)
@@ -6,8 +6,9 @@
  * @package SPIP\Zen-Garden\Fonctions
  */
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
+if (!defined("_ECRIRE_INC_VERSION")) {
+       return;
+}
 
 function zengarden_affiche_version_compatible($intervalle){
        if (!strlen($intervalle)) return '';
@@ -45,9 +46,13 @@ function zengarden_liste_themes($tous){
 
        $themes = array();
 
+       // charger les themes de themes-dist/
+       if (is_dir(_DIR_THEMES_DIST))
+               $themes = array_merge($themes, zengarden_charge_themes(_DIR_THEMES_DIST, $tous));
+
        // charger les themes de themes/
        if (is_dir(_DIR_THEMES))
-               $themes = array_merge($themes,zengarden_charge_themes(_DIR_THEMES,$tous));
+               $themes = array_merge($themes, zengarden_charge_themes(_DIR_THEMES, $tous));
 
        // ceux de squelettes/themes/
        if (is_dir($skels=_DIR_RACINE."squelettes/themes/"))
@@ -77,7 +82,7 @@ function zengarden_liste_themes($tous){
         * 
         * Pour être compatible un thème doit avoir un <utilise...> du squelette en question dans son paquet.xml
         */
-       $search = "";
+       $search = "dist";
        if (defined('_ZENGARDEN_FILTRE_THEMES')) $search=_ZENGARDEN_FILTRE_THEMES;
        elseif (defined('_DIR_PLUGIN_ZPIP')) $search="zpip";
        elseif (defined('_DIR_PLUGIN_Z')) $search="z";
@@ -119,4 +124,27 @@ function zengarden_filtrer_liste_plugins($flux){
        return $flux;
 }
 
-?>
\ No newline at end of file
+
+
+/**
+ * Afficher les auteurs ou licences
+ *
+ * Vient de plugin.xml ou paquet.xml
+ * 
+ * @param array $donnees
+ * @return string
+**/
+function zengarden_affiche_info($donnees) {
+       if (is_array($donnees) AND count($donnees)) {
+               $liste = array();
+               foreach ($donnees as $d) {
+                       if (!is_array($d)) {
+                               $liste[] = $d;
+                       } else {
+                               $liste[] = $d['nom'];
+                       }
+               }
+               return implode(',', $liste);
+       }
+       return '';
+}
index fe0e710..fb31811 100644 (file)
@@ -8,7 +8,9 @@
  * @package SPIP\Zen-Garden\Options
  */
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined("_ECRIRE_INC_VERSION")) {
+       return;
+}
 
 if (!defined('_DIR_PLUGIN_THEME')){
        // si on est en mode apercu, il suffit de repasser dans l'espace prive pour desactiver l'apercu
@@ -65,11 +67,12 @@ if (!defined('_DIR_PLUGIN_THEME')){
  *             Le contenu html de la page modifié
  */
 function zengarden_affichage_final($texte){
-       if ($GLOBALS['html'] and isset($GLOBALS['meta']['zengarden_switcher'])){
+       if ((!isset($GLOBALS['flag_preserver']) || $GLOBALS['flag_preserver'] != 1) && $GLOBALS['html'] and isset($GLOBALS['meta']['zengarden_switcher'])){
                include_spip('prive/zengarden_theme_fonctions');
                // on passe le theme selectionne en js pour ne pas polluer le cache du switcher
+               $theme = isset($_COOKIE['spip_zengarden_theme']) ? $_COOKIE['spip_zengarden_theme'] : '';
                $code = 
-                       "<script type='text/javascript'>var theme_selected='".$_COOKIE['spip_zengarden_theme']."'</script>"
+                       "<script type='text/javascript'>var theme_selected='$theme'</script>"
                        . recuperer_fond('inclure/zengarden_switcher');
                // On rajoute le code du selecteur de squelettes avant la balise </body>
                $texte=str_replace("</body>",$code."</body>",$texte);
@@ -77,4 +80,3 @@ function zengarden_affichage_final($texte){
        return $texte;
 }
 
-?>
index 44f5ee2..7b75082 100644 (file)
@@ -8,7 +8,9 @@
  * @package SPIP\Zen-Garden\Pipelines\r
  */\r
 \r
-if (!defined('_ECRIRE_INC_VERSION')) return;\r
+if (!defined('_ECRIRE_INC_VERSION')) {\r
+       return;\r
+}\r
 \r
 /**\r
  * Insertion dans le pipeline header_prive\r
@@ -28,5 +30,3 @@ function zengarden_header_prive($flux){
 \r
        return $flux;\r
 }\r
-\r
-?>\r