[PLUGINS] +Menu_Lang_lien
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 19 Jun 2013 06:34:02 +0000 (08:34 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 19 Jun 2013 06:34:02 +0000 (08:34 +0200)
78 files changed:
www/plugins/Menu_langue_lien/balise/menu_lang.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/fonds/cfg_menu_lang_liens.html [new file with mode: 0644]
www/plugins/Menu_langue_lien/formulaires/configurer_menu_lang_liens.html [new file with mode: 0644]
www/plugins/Menu_langue_lien/formulaires/menu_lang.html [new file with mode: 0644]
www/plugins/Menu_langue_lien/img_pack/world_link-16.png [new file with mode: 0755]
www/plugins/Menu_langue_lien/img_pack/world_link-24.png [new file with mode: 0644]
www/plugins/Menu_langue_lien/img_pack/world_link-32.png [new file with mode: 0755]
www/plugins/Menu_langue_lien/lang/mll.xml [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/mll_en.php [new file with mode: 0755]
www/plugins/Menu_langue_lien/lang/mll_es.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/mll_fr.php [new file with mode: 0755]
www/plugins/Menu_langue_lien/lang/mll_sk.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll.xml [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll_en.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll_es.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll_fr.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/lang/paquet-mll_sk.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/mll_options.php [new file with mode: 0644]
www/plugins/Menu_langue_lien/mll_pipelines.php [new file with mode: 0755]
www/plugins/Menu_langue_lien/mll_styles.css [new file with mode: 0755]
www/plugins/Menu_langue_lien/paquet.xml [new file with mode: 0644]
www/plugins/Menu_langue_lien/plugin.xml [new file with mode: 0644]
www/plugins/Menu_langue_lien/prive/squelettes/contenu/configurer_mll.html [new file with mode: 0644]
www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-16.png [new file with mode: 0755]
www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-24.png [new file with mode: 0644]
www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-32.png [new file with mode: 0755]
www/plugins/Menu_langue_lien/svn.revision [new file with mode: 0644]
www/plugins/spip-bonux-3/demo/boucle_et_saut.html [new file with mode: 0644]
www/plugins/spip-bonux-3/demo/boucles_iterations.html [new file with mode: 0644]
www/plugins/spip-bonux-3/demo/noeud.html [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/annuler-recherche.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/article-12.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/deplier-droite.gif [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/deplier-droite.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/frame-close.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/item-add.gif [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/item-add.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/item-remove.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/logo-bonux.gif [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/message_erreur-24.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/message_notice-24.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/message_ok-24.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/spip-bonux.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_asc-12.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_asc-16.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_asc-24.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_asc.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_desc-12.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_desc-16.png [new file with mode: 0644]
www/plugins/spip-bonux-3/img_pack/tri_desc-24.png [new file with mode: 0644]
www/plugins/spip-bonux-3/inc/date_gestion.php [new file with mode: 0644]
www/plugins/spip-bonux-3/inc/exporter_csv.php [new file with mode: 0644]
www/plugins/spip-bonux-3/inc/importer_csv.php [new file with mode: 0644]
www/plugins/spip-bonux-3/javascript/jquery.qtip-1.0.0-rc3.js [new file with mode: 0644]
www/plugins/spip-bonux-3/javascript/jquery.qtip.activate.js [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux.xml [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ar.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_en.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_es.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_fr.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ru.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/paquet-spip_bonux_sk.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux.xml [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_ar.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_en.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_es.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_fr.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_ru.php [new file with mode: 0644]
www/plugins/spip-bonux-3/lang/spip_bonux_sk.php [new file with mode: 0644]
www/plugins/spip-bonux-3/modeles/pagination_noancre.html [new file with mode: 0644]
www/plugins/spip-bonux-3/paquet.xml [new file with mode: 0644]
www/plugins/spip-bonux-3/public/spip_bonux_balises.php [new file with mode: 0644]
www/plugins/spip-bonux-3/public/spip_bonux_criteres.php [new file with mode: 0644]
www/plugins/spip-bonux-3/spip_bonux_fonctions.php [new file with mode: 0644]
www/plugins/spip-bonux-3/spip_bonux_options.php [new file with mode: 0644]
www/plugins/spip-bonux-3/svn.revision [new file with mode: 0644]
www/plugins/spip-bonux-3/tests/balises/set_merge.html [new file with mode: 0644]
www/plugins/spip-bonux-3/tests/balises/set_push.html [new file with mode: 0644]

diff --git a/www/plugins/Menu_langue_lien/balise/menu_lang.php b/www/plugins/Menu_langue_lien/balise/menu_lang.php
new file mode 100644 (file)
index 0000000..7816784
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+
+if (!defined("_ECRIRE_INC_VERSION")) return;   #securite
+
+// #MENU_LANG affiche le menu des langues de l'espace public
+// et preselectionne celle la globale $lang
+// ou de l'argument fourni: #MENU_LANG{#ENV{malangue}} 
+
+// http://doc.spip.org/@balise_MENU_LANG
+function balise_MENU_LANG ($p) {
+       $i_boucle = $p->nom_boucle ? $p->nom_boucle : ($p->id_boucle ? $p->id_boucle :'');
+       if($i_boucle){
+       $_id_objet = $p->boucles[$i_boucle]->primary;
+       }
+       
+       return calculer_balise_dynamique(
+               $p,
+               'MENU_LANG',
+               array(
+                       'LANG_TYPE_BOUCLE', // demande du type d'objet
+                       $_id_objet
+               )
+       );
+}
+
+// s'il n'y a qu'une langue eviter definitivement la balise ?php 
+// http://doc.spip.org/@balise_MENU_LANG_stat
+function balise_MENU_LANG_stat ($args, $context_compil) {
+       if (strpos($GLOBALS['meta']['langues_multilingue'],',') === false) return '';
+       $objet = $args[0];
+       $id_objet = $args[1];
+       if ($objet == 'balise_hors_boucle') {
+               $objet = '';
+               $id_objet = '';
+               $id_table_objet ='';
+       }else{
+               $objet = table_objet($objet);
+               $id_table_objet = id_table_objet($objet);
+       }
+       return array($objet, $id_objet,$id_table_objet);
+}
+
+// normalement $opt sera toujours non vide suite au test ci-dessus
+// http://doc.spip.org/@balise_MENU_LANG_dyn
+function balise_MENU_LANG_dyn($objet,$id_objet,$id_table_objet) {
+       include_spip('inc/lang');
+       # lien a partir de /
+       $cible = parametre_url(self(), 'lang' , '', '&');
+       $post = generer_url_action('converser', 'redirect='. rawurlencode($cible), '&');
+
+       return array('formulaires/menu_lang',
+               3600,
+               array(
+                       //'nom' => $nom,
+                       'lang' => $GLOBALS['spip_lang'],
+                       'url' => $post,
+                       $id_table_objet => $id_objet
+               )
+       );
+}
+
+// balise type_boucle de Rastapopoulos dans le plugin etiquettes
+// present aussi dans plugin ajaxforms...
+// bref, a integrer dans le core ? :p
+function balise_LANG_TYPE_BOUCLE($p) {
+       $type = $p->boucles[$p->id_boucle]->id_table;
+       $p->code = $type ? $type : "balise_hors_boucle";
+       return $p;
+}
+?>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/fonds/cfg_menu_lang_liens.html b/www/plugins/Menu_langue_lien/fonds/cfg_menu_lang_liens.html
new file mode 100644 (file)
index 0000000..c4f5082
--- /dev/null
@@ -0,0 +1,9 @@
+<!-- titre=<:mll:cfg_titre_mll:> -->
+<!-- icone=img_pack/world_link-16.png -->
+<!-- autoriser=webmestre -->
+<!-- refus=<:cfg:refus_configuration_webmestre:> -->
+
+#CACHE{0}
+<div class="ajax">
+#FORMULAIRE_CONFIGURER_MENU_LANG_LIENS
+</div>
diff --git a/www/plugins/Menu_langue_lien/formulaires/configurer_menu_lang_liens.html b/www/plugins/Menu_langue_lien/formulaires/configurer_menu_lang_liens.html
new file mode 100644 (file)
index 0000000..dc8600a
--- /dev/null
@@ -0,0 +1,47 @@
+<!-- autoriser=webmestre -->\r
+<!-- refus=<:cfg:refus_configuration_webmestre:> -->\r
+<!-- nom=menu_lang_liens -->\r
+\r
+<div class="formulaire_spip formulaire_configurer formulaire_configurer_mll">\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
+<form method="post" action="#ENV{action}"><div>\r
+       #ACTION_FORMULAIRE{#ENV{action}}\r
+       <ul>\r
+               <li class="editer_mll_langues_invisibles[ (#ENV**{erreurs}|table_valeur{licence_defaut}|oui)erreur]">\r
+                       <label for="langues_invisibles"><:mll:label_langues_invisibles:></label>\r
+                       <p class="explication"><:mll:explication_langues_invisibles:></p>\r
+                       <select name="langues_invisibles[]" id="langues_invisibles" multiple="oui">\r
+                               <BOUCLE_langues(POUR){tableau #CONFIG{langues_multilingue}|explode{','}}>\r
+                               <option value="#VALEUR"[(#VALEUR|in_array{#ENV{langues_invisibles,#ARRAY}}|oui)selected="selected"]>[(#VALEUR|traduire_nom_langue)]</option>\r
+                               </BOUCLE_langues>\r
+                       </select>\r
+               </li>\r
+               <li class="editer_mll_langues_supprimer[ (#ENV**{erreurs}|table_valeur{licence_defaut}|oui)erreur]">\r
+                       <label for="format"><:mll:label_format:></label>\r
+                       <div class="choix">\r
+                       <input type="radio" name="format" id="abrege" value="abrege" [(#ENV{format,abrege}|=={'abrege'}|?{' ',''})checked]/> \r
+                       <label for="abrege"><:mll:label_format_abrege:></label>\r
+                       </div>\r
+                       <div class="choix">\r
+                               <input type="radio" name="format" id="complet" value="complet" [(#ENV{format,abrege}|=={'complet'}|?{' ',''})checked]/> \r
+                               <label for="complet"><:mll:label_format_complet:></label>\r
+                       </div>            \r
+               </li>\r
+               <li class="editer_mll_langues_supprimer[ (#ENV**{erreurs}|table_valeur{licence_defaut}|oui)erreur]">\r
+                       <label for="formatliste"><:mll:label_format_liste:></label>\r
+                       <div class="choix">\r
+                               <input type="radio" name="formatliste" id="bloc" value="bloc" [(#ENV{formatliste,bloc}|=={'bloc'}|?{' ',''})checked]/> \r
+                               <label for="bloc"><:mll:label_format_liste_bloc:></label>\r
+                       </div>            \r
+                       <div class="choix">\r
+                               <input type="radio" name="formatliste" id="liste" value="liste" [(#ENV{formatliste,bloc}|=={'liste'}|?{' ',''})checked]/> \r
+                               <label for="liste"><:mll:label_format_liste_liste:></label>\r
+                       </div>\r
+               </li>\r
+       </ul>\r
+       <p class="boutons">\r
+               <input type="submit" name="_cfg_ok" class="submit" value="<:bouton_enregistrer:>" />\r
+       </p>\r
+</div></form>\r
+</div>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/formulaires/menu_lang.html b/www/plugins/Menu_langue_lien/formulaires/menu_lang.html
new file mode 100644 (file)
index 0000000..648967c
--- /dev/null
@@ -0,0 +1,70 @@
+[(#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_tradrub(CONDITION){si #PLUGIN{tradrub}}>
+    <BOUCLE_rubrique(RUBRIQUES){id_rubrique}>
+        #SET{ListeTraductions, #ARRAY{}}
+        <BOUCLE_TraductionRubriqueCourante(RUBRIQUES){traduction}{lang !IN #CONFIG{menu_lang_liens/langues_invisibles,#ARRAY}}>
+            #SET_MERGE{ListeTraductions,#GET{ListeTraductions},#ARRAY{#LANG,#URL_RUBRIQUE}}
+        </BOUCLE_TraductionRubriqueCourante>
+    </BOUCLE_rubrique>
+</BOUCLE_tradrub>
+
+[(#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
+Si non, rien
+
+Les langues "invisibles" sont les langues que le webmestre peut choisir de ne pas afficher dans le menu, 
+a partir du formulaire de configuration du plugin.
+
+Note : 'explode' est une fonction PHP : http://php.net/manual/fr/function.explode.php, utilisee ici pour renvoyer un tableau contenant 
+les langues utilisees, a partir de la variable meta 'langues_utilisees'. Ce tableau est compare avec le tableau des langues invisibles
+avec la fonction PHP 'array_diff' http://www.php.net/manual/fr/function.array-diff.php qui renvoie elle-meme un tableau. 
+
+]
+
+[(#SET{langues_a_afficher,[(#CONFIG{langues_utilisees}|explode{","}|array_diff{#CONFIG{menu_lang_liens/langues_invisibles, #ARRAY}})]})]
+
+<BOUCLE_PlusieursLanguesUtilisees(POUR){tableau #GET{langues_a_afficher}}{1,1}>
+<[(#CONFIG{menu_lang_liens/formatliste,bloc}|=={'bloc'}|?{div,ul})] id="menu_lang">
+[(#REM)
+On liste les langues utilisees dans le site
+]
+       <BOUCLE_ListeLangues(POUR){tableau #GET{langues_a_afficher}}>
+       [(#CONFIG{menu_lang_liens/formatliste,bloc}|=={'liste'}|oui)<li [(#COMPTEUR_BOUCLE|=={1}|oui)class="first"] [(#COMPTEUR_BOUCLE|=={#TOTAL_BOUCLE}|oui)class="last"]>]
+               [(#REM)
+               Si la langue n'est pas celle en cours, on fait un lien qui fait 2 actions :
+               - fixer le cookie de langue sur la langue demandee
+               - rediriger sur l'article dans la langue demandee si opportun
+                 sinon, revenir sur la page en cours
+               ]
+        [(#CONFIG{menu_lang_liens/format,abrege}|=={'complet'}|oui)[(#SET{nom_langue,[(#VALEUR|traduire_nom_langue)]})]]   
+        [(#CONFIG{menu_lang_liens/format,abrege}|=={'abrege'}|oui)[(#SET{nom_langue,[(#VALEUR)]})]]
+               [(#VALEUR|=={#ENV{lang}}|non)
+                       [(#REM)
+                               url_absolue pour éviter des problèmes en urls arbo
+                       ] 
+                       [<a href="[(#SELF|parametre_url{action,converser}|parametre_url{var_lang,#VALEUR}|parametre_url{redirect,#GET{ListeTraductions}|table_valeur{#VALEUR}|sinon{#SELF}|url_absolue})]" rel="alternate" lang="#VALEUR"[(#CONFIG{menu_lang_liens/format,abrege}|=={'abrege'}|oui) title="[(#VALEUR|traduire_nom_langue|ucfirst|attribut_html)]"] class="langue_#VALEUR">(#GET{nom_langue}|ucfirst)</a>]
+               ]
+               [(#REM)
+               Si la langue est celle en cours, afficher celle-ci en gras, sans lien
+               ]
+               [(#VALEUR|=={#ENV{lang}}|oui)
+                       [<strong class="langue_#VALEUR" title="[(#VALEUR|traduire_nom_langue|ucfirst|attribut_html)]">(#GET{nom_langue}|ucfirst)</strong>]
+               ]
+        [(#CONFIG{menu_lang_liens/formatliste,bloc}|=={'liste'}|oui)</li>]
+       </BOUCLE_ListeLangues>
+</[(#CONFIG{menu_lang_liens/formatliste,bloc}|=={'bloc'}|?{div,ul})]>
+</BOUCLE_PlusieursLanguesUtilisees>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/img_pack/world_link-16.png b/www/plugins/Menu_langue_lien/img_pack/world_link-16.png
new file mode 100755 (executable)
index 0000000..e737026
Binary files /dev/null and b/www/plugins/Menu_langue_lien/img_pack/world_link-16.png differ
diff --git a/www/plugins/Menu_langue_lien/img_pack/world_link-24.png b/www/plugins/Menu_langue_lien/img_pack/world_link-24.png
new file mode 100644 (file)
index 0000000..fcd0d5f
Binary files /dev/null and b/www/plugins/Menu_langue_lien/img_pack/world_link-24.png differ
diff --git a/www/plugins/Menu_langue_lien/img_pack/world_link-32.png b/www/plugins/Menu_langue_lien/img_pack/world_link-32.png
new file mode 100755 (executable)
index 0000000..5c1384a
Binary files /dev/null and b/www/plugins/Menu_langue_lien/img_pack/world_link-32.png differ
diff --git a/www/plugins/Menu_langue_lien/lang/mll.xml b/www/plugins/Menu_langue_lien/lang/mll.xml
new file mode 100644 (file)
index 0000000..aecfbcb
--- /dev/null
@@ -0,0 +1,10 @@
+<traduction module="mll" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/menu_langues_liens/lang/" reference="fr">
+       <langue code="en" />
+       <langue code="es" url="http://trad.spip.net/tradlang_module/mll?lang_cible=es">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel" />
+       </langue>
+       <langue code="fr" />
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/mll?lang_cible=sk">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/Menu_langue_lien/lang/mll_en.php b/www/plugins/Menu_langue_lien/lang/mll_en.php
new file mode 100755 (executable)
index 0000000..6e08135
--- /dev/null
@@ -0,0 +1,26 @@
+<?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=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_titre_mll' => 'Language menu as links',
+
+       // E
+       'explication_langues_invisibles' => 'Allows to remove some languages ​​from the menu',
+
+       // L
+       'label_format' => 'Languages display format',
+       'label_format_abrege' => 'Shortened (for instance, Fr)',
+       'label_format_complet' => 'Complete (for instance, Français)',
+       'label_format_liste' => 'Languages list display format',
+       'label_format_liste_bloc' => 'A block divided by spaces',
+       'label_format_liste_liste' => 'A bulleted list',
+       'label_langues_invisibles' => 'Invisible languages in the​​ menu'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/mll_es.php b/www/plugins/Menu_langue_lien/lang/mll_es.php
new file mode 100644 (file)
index 0000000..7264cf4
--- /dev/null
@@ -0,0 +1,26 @@
+<?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=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_titre_mll' => 'Menú de idiomas en forma de enlaces',
+
+       // E
+       'explication_langues_invisibles' => 'Permite quitar algunos idiomas del menú',
+
+       // L
+       'label_format' => 'Formato de visualización de los idiomas',
+       'label_format_abrege' => 'Abreviado (por ejemplo, Es)',
+       'label_format_complet' => 'Completo (por ejemplo, Español)',
+       'label_format_liste' => 'Formato de la lista de idiomas',
+       'label_format_liste_bloc' => 'Bloque separado por espacios',
+       'label_format_liste_liste' => 'Lista por viñetas',
+       'label_langues_invisibles' => 'Idiomas invisibles del menú'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/mll_fr.php b/www/plugins/Menu_langue_lien/lang/mll_fr.php
new file mode 100755 (executable)
index 0000000..e981ffe
--- /dev/null
@@ -0,0 +1,24 @@
+<?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;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_titre_mll' => 'Menu de langues sous forme de liens',
+
+       // E
+       'explication_langues_invisibles' => 'Permet d\'enlever certaines langues du menu',
+
+       // L
+       'label_format' => 'Format d\'affichage des langues',
+       'label_format_abrege' => 'Abrégé (par exemple, Fr)',
+       'label_format_complet' => 'Complet (par exemple, Français)',
+       'label_format_liste' => 'Format de la liste des langues',
+       'label_format_liste_bloc' => 'Un bloc séparé par des espaces',
+       'label_format_liste_liste' => 'Une liste à puces',
+       'label_langues_invisibles' => 'Langues invisibles du menu'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/mll_sk.php b/www/plugins/Menu_langue_lien/lang/mll_sk.php
new file mode 100644 (file)
index 0000000..59b56c4
--- /dev/null
@@ -0,0 +1,26 @@
+<?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=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // C
+       'cfg_titre_mll' => 'Jazykové menu vo forme odkazov',
+
+       // E
+       'explication_langues_invisibles' => 'Umožňuje odstrániť z menu niektoré jazyky',
+
+       // L
+       'label_format' => 'Formát zobrazenia jazykov',
+       'label_format_abrege' => 'Skrátený (napríklad Sk)',
+       'label_format_complet' => 'Úplný (napríklad Slovenčina)',
+       'label_format_liste' => 'Formát zoznamu jazykov',
+       'label_format_liste_bloc' => 'Blok oddelený medzerami',
+       'label_format_liste_liste' => 'Zoznam s odrážkami',
+       'label_langues_invisibles' => 'Jazyky, ktoré nebudú zobrazené v menu'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll.xml b/www/plugins/Menu_langue_lien/lang/paquet-mll.xml
new file mode 100644 (file)
index 0000000..4bd03eb
--- /dev/null
@@ -0,0 +1,10 @@
+<traduction module="paquet-mll" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/menu_langues_liens/lang/" reference="fr">
+       <langue code="en" />
+       <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=es">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel" />
+       </langue>
+       <langue code="fr" />
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-mll?lang_cible=sk">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll_en.php b/www/plugins/Menu_langue_lien/lang/paquet-mll_en.php
new file mode 100644 (file)
index 0000000..b31b6df
--- /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=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'mll_description' => 'Replace the original language menu by a clickable menu. This menu is displayed only if at least two languages are ​​actually used on the site.',
+       'mll_nom' => 'Language menu as links',
+       'mll_slogan' => 'View languages ​​as clickable links'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll_es.php b/www/plugins/Menu_langue_lien/lang/paquet-mll_es.php
new file mode 100644 (file)
index 0000000..15d889a
--- /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=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'mll_description' => 'Remplaza al menú desplegable de idiomas por un menú en el que hacer click. Este menú no se muestra salvo si hay al menos 2 idiomas verdaderamente utilizados en el sitio.',
+       'mll_nom' => 'Menú de idiomas con enlaces',
+       'mll_slogan' => 'Mostrar los idiomas bajo la forma de enlaces en los que hacer click'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll_fr.php b/www/plugins/Menu_langue_lien/lang/paquet-mll_fr.php
new file mode 100644 (file)
index 0000000..ad4808f
--- /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_/menu_langues_liens/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'mll_description' => 'Remplace le menu déroulant de langues par un menu cliquable. Ce menu n\'est affiché que s\'il y a au moins 2 langues vraiment utilisées dans le site.',
+       'mll_nom' => 'Menu de langues avec liens',
+       'mll_slogan' => 'Afficher les langues sous forme de liens cliquables'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/lang/paquet-mll_sk.php b/www/plugins/Menu_langue_lien/lang/paquet-mll_sk.php
new file mode 100644 (file)
index 0000000..f7117e7
--- /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=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // M
+       'mll_description' => 'Rozbaľovacie menu s jazykmi nahradí klikateľným. Toto menu sa nezobrazí, ak sa na stránke naozaj nepoužívajú aspoň 2 jazyky.',
+       'mll_nom' => 'Jazykové menu s odkazmi',
+       'mll_slogan' => 'Zobraziť jazyky vo forme klikateľných odkazov'
+);
+
+?>
diff --git a/www/plugins/Menu_langue_lien/mll_options.php b/www/plugins/Menu_langue_lien/mll_options.php
new file mode 100644 (file)
index 0000000..a5a023a
--- /dev/null
@@ -0,0 +1,4 @@
+<?php\r
+if (!defined("_ECRIRE_INC_VERSION")) return; \r
+$GLOBALS['forcer_lang'] = true;\r
+?>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/mll_pipelines.php b/www/plugins/Menu_langue_lien/mll_pipelines.php
new file mode 100755 (executable)
index 0000000..7e88b7b
--- /dev/null
@@ -0,0 +1,12 @@
+<?php\r
+if (!defined("_ECRIRE_INC_VERSION")) return; \r
+\r
+function mll_insert_head_css($flux){\r
+       // Insertion de la feuille de styles du menu de langues\r
+       $css_mll = find_in_path('mll_styles.css');\r
+       $flux .='<link rel="stylesheet" type="text/css" media="screen" href="'.$css_mll.'" />';\r
+\r
+       return $flux;\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/mll_styles.css b/www/plugins/Menu_langue_lien/mll_styles.css
new file mode 100755 (executable)
index 0000000..66e9f0c
--- /dev/null
@@ -0,0 +1,28 @@
+#menu_lang {\r
+    list-style: none outside none;    \r
+}\r
+\r
+#menu_lang li {\r
+    float: left;\r
+}\r
+\r
+#menu_lang li a, #menu_lang li span, #menu_lang li strong {\r
+    border-left: 1px solid;\r
+}\r
+\r
+#menu_lang li a, #menu_lang li span, #menu_lang li strong {\r
+    padding: 0 5px;\r
+    font-size: 11px;\r
+}\r
+\r
+#menu_lang li.first a, #menu_lang li.first span, #menu_lang li.first strong {\r
+    border: none;\r
+}\r
+\r
+#menu_lang li.last a, #menu_lang li.last span, #menu_lang li.last strong {\r
+    padding-right: 0;\r
+}\r
+\r
+#menu_lang li a:hover {\r
+    text-decoration: underline;\r
+}
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/paquet.xml b/www/plugins/Menu_langue_lien/paquet.xml
new file mode 100644 (file)
index 0000000..19a5c6b
--- /dev/null
@@ -0,0 +1,23 @@
+<paquet
+       prefix="mll"
+       categorie="navigation"
+       version="1.1.9"
+       etat="test"
+       compatibilite="[2.0.10;3.0.*]"
+       logo="prive/themes/spip/images/world_link-32.png"
+       documentation="http://www.spip-contrib.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>Jean-Baptiste Pressac</auteur>
+       <auteur lien="http://www.kent1.info">kent1</auteur>
+       <auteur>Cédric Morin</auteur>
+       <credit lien="http://www.fatcow.com/free-icons">icône par FatCow</credit>
+       <copyright>2009-2012</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;[" />
+       <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
diff --git a/www/plugins/Menu_langue_lien/plugin.xml b/www/plugins/Menu_langue_lien/plugin.xml
new file mode 100644 (file)
index 0000000..46eb697
--- /dev/null
@@ -0,0 +1,53 @@
+<plugin>\r
+       <nom>\r
+               <multi>\r
+                       [fr]Menu de langues avec liens\r
+                       [en]Language menu as links\r
+               </multi>\r
+       </nom>\r
+       <slogan>\r
+               <multi>\r
+               [fr]Afficher les langues sous forme de liens cliquables\r
+               [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
+       <licence>&#169; 2009-2012 GNU/GPL</licence>\r
+       <lien>http://www.spip-contrib.net/Menu-de-langues-sous-forme-de-liens</lien>\r
+       <version>1.1.9</version>\r
+       <etat>test</etat>\r
+       <description>\r
+               <multi>\r
+[fr]Remplace le menu d&#233;roulant de langues par un menu cliquable. Ce menu n'est affich&#233; que s'il y a au moins 2 langues vraiment utilis&#233;es dans le site.\r
+\r
+Icone par [FatCow->http://www.fatcow.com/free-icons]\r
+[en]Replace the original language menu by a clickable menu. This menu is displayed only if at least two languages are ​​actually used on the site.\r
+       \r
+Icon by [FatCow->http://www.fatcow.com/free-icons]\r
+               </multi>\r
+       </description>\r
+       <prefix>mll</prefix>\r
+       <icon>img_pack/world_link-32.png</icon>\r
+       <options>mll_options.php</options>\r
+       <pipeline>\r
+               <nom>insert_head_css</nom>\r
+               <inclure>mll_pipelines.php</inclure>\r
+       </pipeline>\r
+       <necessite id="SPIP" version="[2.0.10;2.1.99]" />\r
+       <necessite id='spip_bonux' version='[1.9.1;]' 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
+       <bouton id="config_mll" parent="configuration">\r
+       <icone>img_pack/world_link-24.png</icone>\r
+       <titre>mll:cfg_titre_mll</titre>   \r
+       <url>cfg</url>   \r
+       <args>cfg=menu_lang_liens</args>\r
+       </bouton>\r
+       <bouton id="bando_config_mll" parent="bando_configuration">\r
+       <icone>img_pack/world_link-16.png</icone>\r
+       <titre>mll:cfg_titre_mll</titre>   \r
+       <url>cfg</url>   \r
+       <args>cfg=menu_lang_liens</args>\r
+       </bouton>       \r
+</plugin>
\ No newline at end of file
diff --git a/www/plugins/Menu_langue_lien/prive/squelettes/contenu/configurer_mll.html b/www/plugins/Menu_langue_lien/prive/squelettes/contenu/configurer_mll.html
new file mode 100644 (file)
index 0000000..4cf4e9f
--- /dev/null
@@ -0,0 +1,5 @@
+[(#AUTORISER{webmestre}|sinon_interdire_acces)]
+<h1 class="grostitre"><:mll:cfg_titre_mll:></h1>
+<div class="ajax">
+       #FORMULAIRE_CONFIGURER_MENU_LANG_LIENS
+</div>
diff --git a/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-16.png b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-16.png
new file mode 100755 (executable)
index 0000000..e737026
Binary files /dev/null and b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-16.png differ
diff --git a/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-24.png b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-24.png
new file mode 100644 (file)
index 0000000..fcd0d5f
Binary files /dev/null and b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-24.png differ
diff --git a/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-32.png b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-32.png
new file mode 100755 (executable)
index 0000000..5c1384a
Binary files /dev/null and b/www/plugins/Menu_langue_lien/prive/themes/spip/images/world_link-32.png differ
diff --git a/www/plugins/Menu_langue_lien/svn.revision b/www/plugins/Menu_langue_lien/svn.revision
new file mode 100644 (file)
index 0000000..3d836e7
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/menu_langues_liens
+Revision: 71303
+Dernier commit: 2013-03-30 04:01:43 +0100 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/menu_langues_liens</origine>
+<revision>71303</revision>
+<commit>2013-03-30 04:01:43 +0100 </commit>
+</svn_revision>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/demo/boucle_et_saut.html b/www/plugins/spip-bonux-3/demo/boucle_et_saut.html
new file mode 100644 (file)
index 0000000..c43b737
--- /dev/null
@@ -0,0 +1,15 @@
+[(#REM)
+
+  Squelette
+  (c) 2009 xxx
+  Distribue sous licence GPL
+
+]
+<BOUCLE_art(ARTICLES){par id_article}{0,10}{'-'}>
+#TOTAL_BOUCLE:#COMPTEUR_BOUCLE:#ID_ARTICLE
+</BOUCLE_art>
+<hr />
+<BOUCLE_art2(ARTICLES){par id_article}{0,10}{'-'}>
+#TOTAL_BOUCLE:#COMPTEUR_BOUCLE:#ID_ARTICLE
+[(#SAUTER{1})]
+</BOUCLE_art2>
diff --git a/www/plugins/spip-bonux-3/demo/boucles_iterations.html b/www/plugins/spip-bonux-3/demo/boucles_iterations.html
new file mode 100644 (file)
index 0000000..004663d
--- /dev/null
@@ -0,0 +1,37 @@
+<BOUCLE_test10(POUR){tableau 1:10}>
+#CLE/#VALEUR<br />
+</BOUCLE_test10>
+#TOTAL_BOUCLE
+</B_test10>
+
+<hr />
+<BOUCLE_test11(POUR){tableau 1:2:10}>
+#CLE/#VALEUR<br />
+</BOUCLE_test11>
+#TOTAL_BOUCLE
+</B_test11>
+
+<hr />
+
+<BOUCLE_test12(POUR){tableau 10:-2:1}>
+#CLE/#VALEUR<br />
+</BOUCLE_test12>
+#TOTAL_BOUCLE
+</B_test12>
+
+<B_test13>
+       <p class="pagination">#PAGINATION</p>
+<BOUCLE_test13(POUR){tableau 1:100}{pagination}>
+#CLE/#VALEUR<br />
+</BOUCLE_test13>
+[#TOTAL_BOUCLE/#GRAND_TOTAL]
+</B_test13>
+
+<hr />
+
+<BOUCLE_test14(POUR){tableau 1:7}>
+       <BOUCLE_test15(POUR){tableau 1:#VALEUR}>
+       #VALEUR
+       </BOUCLE_test15>
+       <br />
+</BOUCLE_test14>
diff --git a/www/plugins/spip-bonux-3/demo/noeud.html b/www/plugins/spip-bonux-3/demo/noeud.html
new file mode 100644 (file)
index 0000000..8444005
--- /dev/null
@@ -0,0 +1,16 @@
+[(#REM)
+
+  Squelette
+  (c) xxx
+  Distribue sous licence GPL
+
+]
+#CACHE{0}
+
+<BOUCLE_rubn(RUBRIQUES){noeud}>
+<li>#ID_RUBRIQUE</li>
+</BOUCLE_rubn>
+<hr />
+<BOUCLE_rubf(RUBRIQUES){!feuille}>
+<li>#ID_RUBRIQUE</li>
+</BOUCLE_rubf>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/img_pack/annuler-recherche.png b/www/plugins/spip-bonux-3/img_pack/annuler-recherche.png
new file mode 100644 (file)
index 0000000..8252930
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/annuler-recherche.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/article-12.png b/www/plugins/spip-bonux-3/img_pack/article-12.png
new file mode 100644 (file)
index 0000000..35d3d3d
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/article-12.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/deplier-droite.gif b/www/plugins/spip-bonux-3/img_pack/deplier-droite.gif
new file mode 100644 (file)
index 0000000..b6a570d
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/deplier-droite.gif differ
diff --git a/www/plugins/spip-bonux-3/img_pack/deplier-droite.png b/www/plugins/spip-bonux-3/img_pack/deplier-droite.png
new file mode 100644 (file)
index 0000000..2865fd0
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/deplier-droite.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/frame-close.png b/www/plugins/spip-bonux-3/img_pack/frame-close.png
new file mode 100644 (file)
index 0000000..5dab592
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/frame-close.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/item-add.gif b/www/plugins/spip-bonux-3/img_pack/item-add.gif
new file mode 100644 (file)
index 0000000..33faedb
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/item-add.gif differ
diff --git a/www/plugins/spip-bonux-3/img_pack/item-add.png b/www/plugins/spip-bonux-3/img_pack/item-add.png
new file mode 100644 (file)
index 0000000..c180e0f
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/item-add.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/item-remove.png b/www/plugins/spip-bonux-3/img_pack/item-remove.png
new file mode 100644 (file)
index 0000000..566f4f6
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/item-remove.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/logo-bonux.gif b/www/plugins/spip-bonux-3/img_pack/logo-bonux.gif
new file mode 100644 (file)
index 0000000..b3a220b
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/logo-bonux.gif differ
diff --git a/www/plugins/spip-bonux-3/img_pack/message_erreur-24.png b/www/plugins/spip-bonux-3/img_pack/message_erreur-24.png
new file mode 100644 (file)
index 0000000..f483cef
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/message_erreur-24.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/message_notice-24.png b/www/plugins/spip-bonux-3/img_pack/message_notice-24.png
new file mode 100644 (file)
index 0000000..27d3247
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/message_notice-24.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/message_ok-24.png b/www/plugins/spip-bonux-3/img_pack/message_ok-24.png
new file mode 100644 (file)
index 0000000..dfcdb41
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/message_ok-24.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/spip-bonux.png b/www/plugins/spip-bonux-3/img_pack/spip-bonux.png
new file mode 100644 (file)
index 0000000..fffbb43
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/spip-bonux.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_asc-12.png b/www/plugins/spip-bonux-3/img_pack/tri_asc-12.png
new file mode 100644 (file)
index 0000000..5f21f7b
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_asc-12.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_asc-16.png b/www/plugins/spip-bonux-3/img_pack/tri_asc-16.png
new file mode 100644 (file)
index 0000000..89cfd50
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_asc-16.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_asc-24.png b/www/plugins/spip-bonux-3/img_pack/tri_asc-24.png
new file mode 100644 (file)
index 0000000..cf55fbf
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_asc-24.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_asc.png b/www/plugins/spip-bonux-3/img_pack/tri_asc.png
new file mode 100644 (file)
index 0000000..a8a2918
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_asc.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_desc-12.png b/www/plugins/spip-bonux-3/img_pack/tri_desc-12.png
new file mode 100644 (file)
index 0000000..c853769
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_desc-12.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_desc-16.png b/www/plugins/spip-bonux-3/img_pack/tri_desc-16.png
new file mode 100644 (file)
index 0000000..6d9d043
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_desc-16.png differ
diff --git a/www/plugins/spip-bonux-3/img_pack/tri_desc-24.png b/www/plugins/spip-bonux-3/img_pack/tri_desc-24.png
new file mode 100644 (file)
index 0000000..f34ae54
Binary files /dev/null and b/www/plugins/spip-bonux-3/img_pack/tri_desc-24.png differ
diff --git a/www/plugins/spip-bonux-3/inc/date_gestion.php b/www/plugins/spip-bonux-3/inc/date_gestion.php
new file mode 100644 (file)
index 0000000..5fd2c99
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+/**
+ * Recuperer les champs date_xx et heure_xx, verifier leur coherence et les reformater
+ *
+ * @param string $suffixe
+ * @param bool $horaire
+ * @param array $erreurs
+ * @return int
+ */
+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)
+               return '';
+       $ret = null;
+       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]))
+               $erreurs["date_$suffixe"] = _T('spip_bonux:erreur_heure');
+       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);
+               }
+               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);
+               }
+       }
+       return $ret;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/inc/exporter_csv.php b/www/plugins/spip-bonux-3/inc/exporter_csv.php
new file mode 100644 (file)
index 0000000..bad0aed
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ *
+ * Fonctions d'export d'une requete sql ou d'un tableau
+ * au format CSV
+ * Merge du plugin csv_import et spip-surcharges
+ *
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+include_spip('inc/charsets');
+include_spip('inc/filtres');
+include_spip('inc/texte');
+
+/**
+ * Exporter un champ pour un export CSV : pas de retour a la ligne,
+ * et echapper les guillements par des doubles guillemets
+ * @param string $champ
+ * @return string
+ */
+function exporter_csv_champ($champ) {
+       #$champ = str_replace("\r", "\n", $champ);
+       #$champ = preg_replace(",[\n]+,ms", "\n", $champ);
+       #$champ = str_replace("\n", ", ", $champ);
+       $champ = preg_replace(',[\s]+,ms', ' ', $champ);
+       $champ = str_replace('"', '""', $champ);
+       return '"'.$champ.'"';
+}
+
+/**
+ * Exporter une ligne complete au format CSV, avec delimiteur fourni
+ * @param array $ligne
+ * @param string $delim
+ * @return string
+ */
+function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null) {
+       $output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n";
+       if ($importer_charset){
+               $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset);
+       }
+       return $output;
+}
+
+
+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 = ",";
+
+       $charset = $GLOBALS['meta']['charset'];
+       $importer_charset = null;
+       if ($delim == ',')
+               $extension = 'csv';
+       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);
+
+       // 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;
+       $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);
+               $length += fwrite($fp, $output);
+       }
+       fclose($fp);
+
+       if ($envoyer) {
+               Header("Content-Type: text/comma-separated-values; charset=$charset");
+               Header("Content-Disposition: attachment; filename=$filename");
+               //non supporte
+               //Header("Content-Type: text/plain; charset=$charset");
+               Header("Content-Length: $length");
+               ob_clean();
+    flush();
+    readfile($fichier);
+       }
+
+       return $fichier;
+}
+
+?>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/inc/importer_csv.php b/www/plugins/spip-bonux-3/inc/importer_csv.php
new file mode 100644 (file)
index 0000000..f09d392
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ * 
+ * Fonctions de lecture d'un fichier CSV pour transformation en array()
+ * 
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+include_spip('inc/charsets');
+
+/**
+ * Based on an example by ramdac at ramdac dot org
+ * Returns a multi-dimensional array from a CSV file optionally using the
+ * first row as a header to create the underlying data as associative arrays.
+ * @param string $file Filepath including filename
+ * @param bool $head Use first row as header.
+ * @param string $delim Specify a delimiter other than a comma.
+ * @param int $len Line length to be passed to fgetcsv
+ * @return array or false on failure to retrieve any rows.
+ */
+
+/**
+ * Importer le charset d'une ligne
+ *
+ * @param unknown_type $texte
+ * @return array
+ */
+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))
+               $charset_source = 'utf-8';
+       return importer_charset($texte,$charset_source);
+}
+
+/**
+ * enlever les accents des cles presentes dans le head,
+ * sinon ca pose des problemes ...
+ *
+ * @param string $key
+ * @return string
+ */
+function importer_csv_nettoie_key($key){
+       return translitteration($key);
+       /*$accents=array('�','�','�','�','�',"�","�","'");
+       $accents_rep=array('e','e','e','a','u',"o","c","_");
+       return str_replace($accents,$accents_rep,$key);*/
+}
+
+/**
+ * Lit un fichier csv et retourne un tableau
+ * si $head est true, la premiere ligne est utilisee en header
+ * pour generer un tableau associatif
+ *
+ * @param string $file
+ * @param bool $head
+ * @param string $delim
+ * @param string $enclos
+ * @param int $len
+ * @return array
+ */
+function inc_importer_csv_dist($file, $head = false, $delim = ",", $enclos = '"', $len = 10000) {
+       $return = false;
+       if (@file_exists($file)
+               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);
+                               $header_type = array();
+                               foreach ($header as $heading) {
+                                       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)) {
+                               $row = array();
+                               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]))
+                                                       $row[$heading][]= $data[$key];
+                                       }
+                                       else
+                                               $row[$heading]=(isset($data[$key])) ? $data[$key] : '';
+                               }
+                               $return[]=$row;
+                       } else {
+                               $return[]=$data;
+                       }
+               }
+       }
+       return $return;
+}
+
diff --git a/www/plugins/spip-bonux-3/javascript/jquery.qtip-1.0.0-rc3.js b/www/plugins/spip-bonux-3/javascript/jquery.qtip-1.0.0-rc3.js
new file mode 100644 (file)
index 0000000..b71c021
--- /dev/null
@@ -0,0 +1,2040 @@
+/*!
+* jquery.qtip. The jQuery tooltip plugin
+*
+* Copyright (c) 2009 Craig Thompson
+* http://craigsworks.com
+*
+* Licensed under MIT
+* http://www.opensource.org/licenses/mit-license.php
+*
+* Launch  : February 2009
+* Version : 1.0.0-rc3
+* Released: Tuesday 12th May, 2009 - 00:00
+* Debug: jquery.qtip.debug.js
+*/
+
+"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
+/*jslint browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, strict: true, newcap: true, immed: true */
+
+/*global window: false, jQuery: false */
+(function ($) {
+       // Assign cache and event initialisation on document load
+       $(document).ready(function () {
+               // Adjust positions of the tooltips on window resize or scroll if enabled
+               var i;
+               $(window).bind('resize scroll', function (event) {
+                       for (i = 0; i < $.fn.qtip.interfaces.length; i++) {
+                               // Access current elements API
+                               var api = $.fn.qtip.interfaces[i];
+
+                               // Update position if resize or scroll adjustments are enabled
+                               if(api && api.status && api.status.rendered && api.options.position.type !== 'static' && api.elements.tooltip.is(':visible') &&
+                               (api.options.position.adjust.scroll && event.type === 'scroll' || api.options.position.adjust.resize && event.type === 'resize')) {
+                                       // Queue the animation so positions are updated correctly
+                                       api.updatePosition(event, true);
+                               }
+                       }
+               });
+
+               // Hide unfocus toolipts on document mousedown
+               $(document).bind('mouseenter.qtip', function (event) {
+                       if($(event.target).parents('div.qtip').length === 0) {
+                               var tooltip = $('.qtipSelector'),
+                                       api = tooltip.qtip('api');
+
+                               // Only hide if its visible and not the tooltips target
+                               if(tooltip.is(':visible') && api && api.status && !api.status.disabled && $(event.target).add(api.elements.target).length > 1) { api.hide(event); }
+                       }
+               });
+       });
+
+       // Corner object parser
+       function Corner(corner) {
+               if(!corner){ return false; }
+
+               this.x = String(corner).replace(/middle/i, 'center').match(/left|right|center/i)[0].toLowerCase();
+               this.y = String(corner).replace(/middle/i, 'center').match(/top|bottom|center/i)[0].toLowerCase();
+               this.offset = { left: 0, top: 0 };
+               this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
+               this.string = function(){ return (this.precedance === 'y') ? this.y+this.x : this.x+this.y; };
+       }
+
+       // Tip coordinates calculator
+       function calculateTip(corner, width, height) {
+               // Define tip coordinates in terms of height and width values
+               var tips = {
+                       bottomright: [[0, 0], [width, height], [width, 0]],
+                       bottomleft: [[0, 0], [width, 0], [0, height]],
+                       topright: [[0, height], [width, 0], [width, height]],
+                       topleft: [[0, 0], [0, height], [width, height]],
+                       topcenter: [[0, height], [width / 2, 0], [width, height]],
+                       bottomcenter: [[0, 0], [width, 0], [width / 2, height]],
+                       rightcenter: [[0, 0], [width, height / 2], [0, height]],
+                       leftcenter: [[width, 0], [width, height], [0, height / 2]]
+               };
+               tips.lefttop = tips.bottomright;
+               tips.righttop = tips.bottomleft;
+               tips.leftbottom = tips.topright;
+               tips.rightbottom = tips.topleft;
+
+               return tips[corner];
+       }
+
+       // Border coordinates calculator
+       function calculateBorders(radius) {
+               var borders;
+
+               // Use canvas element if supported
+               if($('<canvas />').get(0).getContext) {
+                       borders = {
+                               topLeft: [radius, radius],
+                               topRight: [0, radius],
+                               bottomLeft: [radius, 0],
+                               bottomRight: [0, 0]
+                       };
+               }
+
+               // Canvas not supported - Use VML (IE)
+               else if($.browser.msie) {
+                       borders = {
+                               topLeft: [-90, 90, 0],
+                               topRight: [-90, 90, -radius],
+                               bottomLeft: [90, 270, 0],
+                               bottomRight: [90, 270, -radius]
+                       };
+               }
+
+               return borders;
+       }
+
+
+       // Build a jQuery style object from supplied style object
+       function jQueryStyle(style, sub) {
+               var styleObj, i;
+
+               styleObj = $.extend(true, {}, style);
+               for (i in styleObj) {
+                       if(sub === true && (/(tip|classes)/i).test(i)) { delete styleObj[i]; }
+                       else if(!sub && (/(width|border|tip|title|classes|user)/i).test(i)) { delete styleObj[i]; }
+               }
+
+               return styleObj;
+       }
+
+       // Sanitize styles
+       function sanitizeStyle(style) {
+               if(typeof style.tip !== 'object') {
+                       style.tip = { corner: style.tip };
+               }
+               if(typeof style.tip.size !== 'object') {
+                       style.tip.size = {
+                               width: style.tip.size,
+                               height: style.tip.size
+                       };
+               }
+               if(typeof style.border !== 'object') {
+                       style.border = {
+                               width: style.border
+                       };
+               }
+               if(typeof style.width !== 'object') {
+                       style.width = {
+                               value: style.width
+                       };
+               }
+               if(typeof style.width.max === 'string') { style.width.max = parseInt(style.width.max.replace(/([0-9]+)/i, "$1"), 10); }
+               if(typeof style.width.min === 'string') { style.width.min = parseInt(style.width.min.replace(/([0-9]+)/i, "$1"), 10); }
+
+               // Convert deprecated x and y tip values to width/height
+               if(typeof style.tip.size.x === 'number') {
+                       style.tip.size.width = style.tip.size.x;
+                       delete style.tip.size.x;
+               }
+               if(typeof style.tip.size.y === 'number') {
+                       style.tip.size.height = style.tip.size.y;
+                       delete style.tip.size.y;
+               }
+
+               return style;
+       }
+
+       // Build styles recursively with inheritance
+       function buildStyle() {
+               var self, i, styleArray, styleExtend, finalStyle, ieAdjust;
+               self = this;
+
+               // Build style options from supplied arguments
+               styleArray = [true, {}];
+               for(i = 0; i < arguments.length; i++){ styleArray.push(arguments[i]); }
+               styleExtend = [$.extend.apply($, styleArray)];
+
+               // Loop through each named style inheritance
+               while(typeof styleExtend[0].name === 'string') {
+                       // Sanitize style data and append to extend array
+                       styleExtend.unshift(sanitizeStyle($.fn.qtip.styles[styleExtend[0].name]));
+               }
+
+               // Make sure resulting tooltip className represents final style
+               styleExtend.unshift(true, {
+                       classes: {
+                               tooltip: 'qtip-' + (arguments[0].name || 'defaults')
+                       }
+               }, $.fn.qtip.styles.defaults);
+
+               // Extend into a single style object
+               finalStyle = $.extend.apply($, styleExtend);
+
+               // Adjust tip size if needed (IE 1px adjustment bug fix)
+               ieAdjust = ($.browser.msie) ? 1 : 0;
+               finalStyle.tip.size.width += ieAdjust;
+               finalStyle.tip.size.height += ieAdjust;
+
+               // Force even numbers for pixel precision
+               if(finalStyle.tip.size.width % 2 > 0) { finalStyle.tip.size.width += 1; }
+               if(finalStyle.tip.size.height % 2 > 0) { finalStyle.tip.size.height += 1; }
+
+               // Sanitize final styles tip corner value
+               if(finalStyle.tip.corner === true) {
+                       if(self.options.position.corner.tooltip === 'center' && self.options.position.corner.target === 'center') {
+                               finalStyle.tip.corner = false;
+                       }
+                       else {
+                               finalStyle.tip.corner = self.options.position.corner.tooltip;
+                       }
+               }
+
+               return finalStyle;
+       }
+
+       // Border canvas draw method
+       function drawBorder(canvas, coordinates, radius, color) {
+               // Create corner
+               var context = canvas.get(0).getContext('2d');
+               context.fillStyle = color;
+               context.beginPath();
+               context.arc(coordinates[0], coordinates[1], radius, 0, Math.PI * 2, false);
+               context.fill();
+       }
+
+       // Create borders using canvas and VML
+       function createBorder() {
+               var self, i, width, radius, color, coordinates, containers, size, betweenWidth, betweenCorners, borderTop, borderBottom, borderCoord, sideWidth, vertWidth;
+               self = this;
+
+               // Destroy previous border elements, if present
+               self.elements.wrapper.find('.qtip-borderBottom, .qtip-borderTop').remove();
+
+               // Setup local variables
+               width = self.options.style.border.width;
+               radius = self.options.style.border.radius;
+               color = self.options.style.border.color || self.options.style.tip.color;
+
+               // Calculate border coordinates
+               coordinates = calculateBorders(radius);
+
+               // Create containers for the border shapes
+               containers = {};
+               for (i in coordinates) {
+                       // Create shape container
+                       containers[i] = '<div rel="' + i + '" style="' + ((/Left/).test(i) ? 'left' : 'right') + ':0; ' + 'position:absolute; height:' + radius + 'px; width:' + radius + 'px; overflow:hidden; line-height:0.1px; font-size:1px">';
+
+                       // Canvas is supported
+                       if($('<canvas />').get(0).getContext) { containers[i] += '<canvas height="' + radius + '" width="' + radius + '" style="vertical-align: top"></canvas>'; }
+
+                       // No canvas, but if it's IE use VML
+                       else if($.browser.msie) {
+                               size = radius * 2 + 3;
+                               containers[i] += '<v:arc stroked="false" fillcolor="' + color + '" startangle="' + coordinates[i][0] + '" endangle="' + coordinates[i][1] + '" ' + 'style="width:' + size + 'px; height:' + size + 'px; margin-top:' + ((/bottom/).test(i) ? -2 : -1) + 'px; ' + 'margin-left:' + ((/Right/).test(i) ? coordinates[i][2] - 3.5 : -1) + 'px; ' + 'vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>';
+
+                       }
+
+                       containers[i] += '</div>';
+               }
+
+               // Create between corners elements
+               betweenWidth = self.getDimensions().width - (Math.max(width, radius) * 2);
+               betweenCorners = '<div class="qtip-betweenCorners" style="height:' + radius + 'px; width:' + betweenWidth + 'px; ' + 'overflow:hidden; background-color:' + color + '; line-height:0.1px; font-size:1px;">';
+
+               // Create top border container
+               borderTop = '<div class="qtip-borderTop" dir="ltr" style="height:' + radius + 'px; ' + 'margin-left:' + radius + 'px; line-height:0.1px; font-size:1px; padding:0;">' + containers.topLeft + containers.topRight + betweenCorners;
+               self.elements.wrapper.prepend(borderTop);
+
+               // Create bottom border container
+               borderBottom = '<div class="qtip-borderBottom" dir="ltr" style="height:' + radius + 'px; ' + 'margin-left:' + radius + 'px; line-height:0.1px; font-size:1px; padding:0;">' + containers.bottomLeft + containers.bottomRight + betweenCorners;
+               self.elements.wrapper.append(borderBottom);
+
+               // Draw the borders if canvas were used (Delayed til after DOM creation)
+               if($('<canvas />').get(0).getContext) {
+                       self.elements.wrapper.find('canvas').each(function () {
+                               borderCoord = coordinates[$(this).parent('[rel]:first').attr('rel')];
+                               drawBorder.call(self, $(this), borderCoord, radius, color);
+                       });
+               }
+
+               // Create a phantom VML element (IE won't show the last created VML element otherwise)
+               else if($.browser.msie) { self.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>'); }
+
+               // Setup contentWrapper border
+               sideWidth = Math.max(radius, (radius + (width - radius)));
+               vertWidth = Math.max(width - radius, 0);
+               self.elements.contentWrapper.css({
+                       border: '0px solid ' + color,
+                       borderWidth: vertWidth + 'px ' + sideWidth + 'px'
+               });
+       }
+
+       // Canvas tip drawing method
+       function drawTip(canvas, coordinates, color) {
+               // Setup properties
+               var context = canvas.get(0).getContext('2d');
+               context.fillStyle = color;
+
+               // Create tip
+               context.beginPath();
+               context.moveTo(coordinates[0][0], coordinates[0][1]);
+               context.lineTo(coordinates[1][0], coordinates[1][1]);
+               context.lineTo(coordinates[2][0], coordinates[2][1]);
+               context.fill();
+       }
+
+       function positionTip(corner) {
+               var self, ieAdjust, positionAdjust, paddingCorner, paddingSize, newMargin;
+               self = this;
+
+               // Return if tips are disabled or tip is not yet rendered
+               if(self.options.style.tip.corner === false || !self.elements.tip) { return; }
+               if(!corner) { corner = new Corner(self.elements.tip.attr('rel')); }
+
+               // Setup adjustment variables
+               ieAdjust = positionAdjust = ($.browser.msie) ? 1 : 0;
+
+               // Set initial position
+               self.elements.tip.css(corner[corner.precedance], 0);
+
+               // Set position of tip to correct side
+               if(corner.precedance === 'y') {
+                       // Adjustments for IE6 - 0.5px border gap bug
+                       if($.browser.msie) {
+                               if(parseInt($.browser.version.charAt(0), 10) === 6) { positionAdjust = corner.y === 'top' ? -3 : 1; }
+                               else { positionAdjust = corner.y === 'top' ? 1 : 2; }
+                       }
+
+                       if(corner.x === 'center') {
+                               self.elements.tip.css({
+                                       left: '50%',
+                                       marginLeft: -(self.options.style.tip.size.width / 2)
+                               });
+                       }
+                       else if(corner.x === 'left') {
+                               self.elements.tip.css({
+                                       left: self.options.style.border.radius - ieAdjust
+                               });
+                       }
+                       else {
+                               self.elements.tip.css({
+                                       right: self.options.style.border.radius + ieAdjust
+                               });
+                       }
+
+                       if(corner.y === 'top') {
+                               self.elements.tip.css({
+                                       top: -positionAdjust
+                               });
+                       }
+                       else {
+                               self.elements.tip.css({
+                                       bottom: positionAdjust
+                               });
+                       }
+
+               }
+               else {
+                       // Adjustments for IE6 - 0.5px border gap bug
+                       if($.browser.msie) {
+                               positionAdjust = (parseInt($.browser.version.charAt(0), 10) === 6) ? 1 : (corner.x === 'left' ? 1 : 2);
+                       }
+
+                       if(corner.y === 'center') {
+                               self.elements.tip.css({
+                                       top: '50%',
+                                       marginTop: -(self.options.style.tip.size.height / 2)
+                               });
+                       }
+                       else if(corner.y === 'top') {
+                               self.elements.tip.css({
+                                       top: self.options.style.border.radius - ieAdjust
+                               });
+                       }
+                       else {
+                               self.elements.tip.css({
+                                       bottom: self.options.style.border.radius + ieAdjust
+                               });
+                       }
+
+                       if(corner.x === 'left') {
+                               self.elements.tip.css({
+                                       left: -positionAdjust
+                               });
+                       }
+                       else {
+                               self.elements.tip.css({
+                                       right: positionAdjust
+                               });
+                       }
+               }
+
+               // Adjust tooltip padding to compensate for tip
+               paddingCorner = 'padding-' + corner[corner.precedance];
+               paddingSize = self.options.style.tip.size[corner.precedance === 'x' ? 'width' : 'height'];
+               self.elements.tooltip.css('padding', 0).css(paddingCorner, paddingSize);
+
+               // Match content margin to prevent gap bug in IE6 ONLY
+               if($.browser.msie && parseInt($.browser.version.charAt(0), 6) === 6) {
+                       newMargin = parseInt(self.elements.tip.css('margin-top'), 10) || 0;
+                       newMargin += parseInt(self.elements.content.css('margin-top'), 10) || 0;
+
+                       self.elements.tip.css({ marginTop: newMargin });
+               }
+       }
+
+       // Create tip using canvas and VML
+       function createTip(corner) {
+               var self, color, coordinates, coordsize, path, tip;
+               self = this;
+
+               // Destroy previous tip, if there is one
+               if(self.elements.tip !== null) { self.elements.tip.remove(); }
+
+               // Setup color and corner values
+               color = self.options.style.tip.color || self.options.style.border.color;
+               if(self.options.style.tip.corner === false) { return; }
+               else if(!corner) { corner = new Corner(self.options.style.tip.corner); }
+
+               // Calculate tip coordinates
+               coordinates = calculateTip(corner.string(), self.options.style.tip.size.width, self.options.style.tip.size.height);
+
+               // Create tip element
+               self.elements.tip = '<div class="' + self.options.style.classes.tip + '" dir="ltr" rel="' + corner.string() + '" style="position:absolute; ' + 'height:' + self.options.style.tip.size.height + 'px; width:' + self.options.style.tip.size.width + 'px; ' + 'margin:0 auto; line-height:0.1px; font-size:1px;"></div>';
+
+               // Attach new tip to tooltip element
+               self.elements.tooltip.prepend(self.elements.tip);
+
+               // Use canvas element if supported
+               if($('<canvas />').get(0).getContext) { tip = '<canvas height="' + self.options.style.tip.size.height + '" width="' + self.options.style.tip.size.width + '"></canvas>'; }
+
+               // Canvas not supported - Use VML (IE)
+               else if($.browser.msie) {
+                       // Create coordize and tip path using tip coordinates
+                       coordsize = self.options.style.tip.size.width + ',' + self.options.style.tip.size.height;
+                       path = 'm' + coordinates[0][0] + ',' + coordinates[0][1];
+                       path += ' l' + coordinates[1][0] + ',' + coordinates[1][1];
+                       path += ' ' + coordinates[2][0] + ',' + coordinates[2][1];
+                       path += ' xe';
+
+                       // Create VML element
+                       tip = '<v:shape fillcolor="' + color + '" stroked="false" filled="true" path="' + path + '" coordsize="' + coordsize + '" ' + 'style="width:' + self.options.style.tip.size.width + 'px; height:' + self.options.style.tip.size.height + 'px; ' + 'line-height:0.1px; display:inline-block; behavior:url(#default#VML); ' + 'vertical-align:' + (corner.y === 'top' ? 'bottom' : 'top') + '"></v:shape>';
+
+                       // Create a phantom VML element (IE won't show the last created VML element otherwise)
+                       tip += '<v:image style="behavior:url(#default#VML);"></v:image>';
+
+                       // Prevent tooltip appearing above the content (IE z-index bug)
+                       self.elements.contentWrapper.css('position', 'relative');
+               }
+
+               // Create element reference and append vml/canvas
+               self.elements.tip = self.elements.tooltip.find('.' + self.options.style.classes.tip).eq(0);
+               self.elements.tip.html(tip);
+
+               // Draw the canvas tip (Delayed til after DOM creation)
+               if($('<canvas  />').get(0).getContext) { drawTip.call(self, self.elements.tip.find('canvas:first'), coordinates, color); }
+
+               // Fix IE small tip bug
+               if(corner.y === 'top' && $.browser.msie && parseInt($.browser.version.charAt(0), 10) === 6) {
+                       self.elements.tip.css({
+                               marginTop: -4
+                       });
+               }
+
+               // Set the tip position
+               positionTip.call(self, corner);
+       }
+
+       // Create title bar for content
+       function createTitle() {
+               var self = this;
+
+               // Destroy previous title element, if present
+               if(self.elements.title !== null) { self.elements.title.remove(); }
+
+               // Append new ARIA attribute to tooltip
+               self.elements.tooltip.attr('aria-labelledby', 'qtip-' + self.id + '-title');
+
+               // Create title element
+               self.elements.title = $('<div id="qtip-' + self.id + '-title" class="' + self.options.style.classes.title + '"></div>').css(jQueryStyle(self.options.style.title, true)).css({
+                       zoom: ($.browser.msie) ? 1 : 0
+               }).prependTo(self.elements.contentWrapper);
+
+               // Update title with contents if enabled
+               if(self.options.content.title.text) { self.updateTitle.call(self, self.options.content.title.text); }
+
+               // Create title close buttons if enabled
+               if(self.options.content.title.button !== false && typeof self.options.content.title.button === 'string') {
+                       self.elements.button = $('<a class="' + self.options.style.classes.button + '" role="button" style="float:right; position: relative"></a>').css(jQueryStyle(self.options.style.button, true)).html(self.options.content.title.button).prependTo(self.elements.title).click(function (event) {
+                               if(!self.status.disabled) { self.hide(event); }
+                       });
+               }
+       }
+
+       // Assign hide and show events
+       function assignEvents() {
+               var self, showTarget, hideTarget, inactiveEvents;
+               self = this;
+
+               // Setup event target variables
+               showTarget = self.options.show.when.target;
+               hideTarget = self.options.hide.when.target;
+
+               // Add tooltip as a hideTarget is its fixed
+               if(self.options.hide.fixed) { hideTarget = hideTarget.add(self.elements.tooltip); }
+
+               // Define events which reset the 'inactive' event handler
+               inactiveEvents = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove',
+                                                       'mouseout', 'mouseenter', 'mouseleave', 'mouseover'];
+
+               // Define 'inactive' event timer method
+               function inactiveMethod(event) {
+                       if(self.status.disabled === true) { return; }
+
+                       //Clear and reset the timer
+                       clearTimeout(self.timers.inactive);
+                       self.timers.inactive = setTimeout(function () {
+                               // Unassign 'inactive' events
+                               $(inactiveEvents).each(function () {
+                                       hideTarget.unbind(this + '.qtip-inactive');
+                                       self.elements.content.unbind(this + '.qtip-inactive');
+                               });
+
+                               // Hide the tooltip
+                               self.hide(event);
+                       }, self.options.hide.delay);
+               }
+
+               // Check if the tooltip is 'fixed'
+               if(self.options.hide.fixed === true) {
+                       self.elements.tooltip.bind('mouseover.qtip', function () {
+                               if(self.status.disabled === true) { return; }
+
+                               // Reset the hide timer
+                               clearTimeout(self.timers.hide);
+                       });
+               }
+
+               // Define show event method
+               function showMethod(event) {
+                       if(self.status.disabled === true) { return; }
+
+                       // If set, hide tooltip when inactive for delay period
+                       if(self.options.hide.when.event === 'inactive') {
+                               // Assign each reset event
+                               $(inactiveEvents).each(function () {
+                                       hideTarget.bind(this + '.qtip-inactive', inactiveMethod);
+                                       self.elements.content.bind(this + '.qtip-inactive', inactiveMethod);
+                               });
+
+                               // Start the inactive timer
+                               inactiveMethod();
+                       }
+
+                       // Clear hide timers
+                       clearTimeout(self.timers.show);
+                       clearTimeout(self.timers.hide);
+
+                       // Start show timer
+                       if(self.options.show.delay > 0) {
+                               self.timers.show = setTimeout(function () {
+                                       self.show(event);
+                               }, self.options.show.delay);
+                       }
+                       else {
+                               self.show(event);
+                       }
+               }
+
+               // Define hide event method
+               function hideMethod(event) {
+                       if(self.status.disabled === true) { return; }
+
+                       // Prevent hiding if tooltip is fixed and event target is the tooltip
+                       if(self.options.hide.fixed === true && (/mouse(out|leave)/i).test(self.options.hide.when.event) && $(event.relatedTarget).parents('div.qtip[id^="qtip"]').length > 0) {
+                               // Prevent default and popagation
+                               event.stopPropagation();
+                               event.preventDefault();
+
+                               // Reset the hide timer
+                               clearTimeout(self.timers.hide);
+                               return false;
+                       }
+
+                       // Clear timers and stop animation queue
+                       clearTimeout(self.timers.show);
+                       clearTimeout(self.timers.hide);
+                       self.elements.tooltip.stop(true, true);
+
+                       // If tooltip has displayed, start hide timer
+                       self.timers.hide = setTimeout(function () {
+                               self.hide(event);
+                       }, self.options.hide.delay);
+               }
+
+               // If mouse is the target, update tooltip position on mousemove
+               if(self.options.position.target === 'mouse' && self.options.position.type !== 'static') {
+                       showTarget.bind('mousemove.qtip', function (event) {
+                               // Set the new mouse positions if adjustment is enabled
+                               self.cache.mouse = {
+                                       left: event.pageX,
+                                       top: event.pageY
+                               };
+
+                               // Update the tooltip position only if the tooltip is visible and adjustment is enabled
+                               if(self.status.disabled === false && self.options.position.adjust.mouse === true && self.options.position.type !== 'static' && self.elements.tooltip.css('display') !== 'none') {
+                                       self.updatePosition(event);
+                               }
+                       });
+               }
+
+               // Both events and targets are identical, apply events using a toggle
+               if((self.options.show.when.target.add(self.options.hide.when.target).length === 1 &&
+               self.options.show.when.event === self.options.hide.when.event && self.options.hide.when.event !== 'inactive') ||
+               self.options.hide.when.event === 'unfocus') {
+                       self.cache.toggle = 0;
+                       // Use a toggle to prevent hide/show conflicts
+                       showTarget.bind(self.options.show.when.event + '.qtip', function (event) {
+                               if(self.cache.toggle === 0) { showMethod(event); }
+                               else { hideMethod(event); }
+                       });
+               }
+
+               // Events are not identical, bind normally
+               else {
+                       showTarget.bind(self.options.show.when.event + '.qtip', showMethod);
+
+                       // If the hide event is not 'inactive', bind the hide method
+                       if(self.options.hide.when.event !== 'inactive') { hideTarget.bind(self.options.hide.when.event + '.qtip', hideMethod); }
+               }
+
+               // Focus the tooltip on mouseover
+               if((/(fixed|absolute)/).test(self.options.position.type)) { self.elements.tooltip.bind('mouseover.qtip', self.focus); }
+       }
+
+       // BGIFRAME JQUERY PLUGIN ADAPTION
+       //   Special thanks to Brandon Aaron for this plugin
+       //   http://plugins.jquery.com/project/bgiframe
+       function bgiframe() {
+               var self, html, dimensions;
+               self = this;
+               dimensions = self.getDimensions();
+
+               // Setup iframe HTML string
+               html = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" ' + 'style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; ' + 'height:' + dimensions.height + 'px; width:' + dimensions.width + 'px" />';
+
+               // Append the new HTML and setup element reference
+               self.elements.bgiframe = self.elements.wrapper.prepend(html).children('.qtip-bgiframe:first');
+       }
+
+       // Define primary construct function
+       function construct() {
+               var self, content, url, data, method;
+               self = this;
+
+               // Call API method
+               self.beforeRender.call(self);
+
+               // Set rendered status to true
+               self.status.rendered = 2;
+
+               // Create initial tooltip elements
+               self.elements.tooltip = '<div qtip="' + self.id + '" id="qtip-' + self.id + '" role="tooltip" ' + 'aria-describedby="qtip-' + self.id + '-content" class="qtip ' + (self.options.style.classes.tooltip || self.options.style) + '" ' + 'style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; position:' + self.options.position.type + ';"> ' + '  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> ' + '    <div class="qtip-contentWrapper" style="overflow:hidden;"> ' + '       <div id="qtip-' + self.id + '-content" class="qtip-content ' + self.options.style.classes.content + '"></div> ' + '</div></div></div>';
+
+               // Append to container element
+               self.elements.tooltip = $(self.elements.tooltip);
+               self.elements.tooltip.appendTo(self.options.position.container);
+
+               // Setup tooltip qTip data
+               self.elements.tooltip.data('qtip', {
+                       current: 0,
+                       interfaces: [self]
+               });
+
+               // Setup element references
+               self.elements.wrapper = self.elements.tooltip.children('div:first');
+               self.elements.contentWrapper = self.elements.wrapper.children('div:first');
+               self.elements.content = self.elements.contentWrapper.children('div:first').css(jQueryStyle(self.options.style));
+
+               // Apply IE hasLayout fix to wrapper and content elements
+               if($.browser.msie) { self.elements.wrapper.add(self.elements.content).css({ zoom: 1 }); }
+
+               // Setup tooltip attributes
+               if(self.options.hide.when.event === 'unfocus') { self.elements.tooltip.attr('unfocus', true); }
+
+               // If an explicit width is set, updateWidth prior to setting content to prevent dirty rendering
+               if(typeof self.options.style.width.value === 'number') { self.updateWidth(); }
+
+               // Create borders and tips if supported by the browser
+               if($('<canvas />').get(0).getContext || $.browser.msie) {
+                       // Create border
+                       if(self.options.style.border.radius > 0) { createBorder.call(self); }
+                       else {
+                               self.elements.contentWrapper.css({
+                                       border: self.options.style.border.width + 'px solid ' + self.options.style.border.color
+                               });
+                       }
+
+                       // Create tip if enabled
+                       if(self.options.style.tip.corner !== false) { createTip.call(self); }
+               }
+
+               // Neither canvas or VML is supported, tips and borders cannot be drawn!
+               else {
+                       // Set defined border width
+                       self.elements.contentWrapper.css({
+                               border: self.options.style.border.width + 'px solid ' + self.options.style.border.color
+                       });
+
+                       // Reset border radius and tip
+                       self.options.style.border.radius = 0;
+                       self.options.style.tip.corner = false;
+               }
+
+               // Use the provided content string or DOM array
+               if((typeof self.options.content.text === 'string' && self.options.content.text.length > 0) || (self.options.content.text.jquery && self.options.content.text.length > 0)) { 
+                       content = self.options.content.text; 
+               }
+
+               // Check for valid title and alt attributes
+               else { content = ' '; }
+
+               // Set the tooltips content and create title if enabled
+               if(self.options.content.title.text !== false) { createTitle.call(self); }
+               self.updateContent(content, false);
+
+               // Assign events and toggle tooltip with focus
+               assignEvents.call(self);
+               if(self.options.show.ready === true) { self.show(); }
+
+               // Retrieve ajax content if provided
+               if(self.options.content.url !== false) {
+                       url = self.options.content.url;
+                       data = self.options.content.data;
+                       method = self.options.content.method || 'get';
+                       self.loadContent(url, data, method);
+               }
+
+               // Call API method and log event
+               self.status.rendered = true;
+               self.onRender.call(self);
+       }
+
+       // Instantiator
+       function QTip(target, options, id) {
+               // Declare this reference
+               var self = this;
+
+               // Setup class attributes
+               self.id = id;
+               self.options = options;
+               self.status = {
+                       animated: false,
+                       rendered: false,
+                       disabled: false,
+                       focused: false
+               };
+               self.elements = {
+                       target: target.addClass(self.options.style.classes.target),
+                       tooltip: null,
+                       wrapper: null,
+                       content: null,
+                       contentWrapper: null,
+                       title: null,
+                       button: null,
+                       tip: null,
+                       bgiframe: null
+               };
+               self.cache = {
+                       attr: false,
+                       mouse: {},
+                       toggle: 0,
+                       overflow: { left: false, top: false }
+               };
+               self.timers = {};
+
+               // Define exposed API methods
+               $.extend(self, self.options.api, {
+                       show: function (event) {
+                               var returned, solo;
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered) { return false; }
+
+                               // Only continue if element is visible
+                               if(self.elements.tooltip.css('display') !== 'none') { return self; }
+
+                               // Clear animation queue
+                               self.elements.tooltip.stop(true, false);
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforeShow.call(self, event);
+                               if(returned === false) { return self; }
+
+                               // Define afterShow callback method
+                               function afterShow() {
+                                       // Set ARIA hidden status attribute
+                                       self.elements.tooltip.attr('aria-hidden', true);
+
+                                       // Call API method and focus if it isn't static
+                                       if(self.options.position.type !== 'static') { self.focus(); }
+                                       self.onShow.call(self, event);
+
+                                       // Prevent antialias from disappearing in IE7 by removing filter and opacity attribute
+                                       if($.browser.msie) { 
+                                               var ieStyle = self.elements.tooltip.get(0).style;
+                                               ieStyle.removeAttribute('filter');
+                                               ieStyle.removeAttribute('opacity');
+                                       }
+                                       else {
+                                               self.elements.tooltip.css({ opacity: '' });
+                                       }
+                               }
+
+                               // Maintain toggle functionality if enabled
+                               self.cache.toggle = 1;
+
+                               // Update tooltip position if it isn't static
+                               if(self.options.position.type !== 'static') {
+                                       self.updatePosition(event, (self.options.show.effect.length > 0 && self.rendered !== 2));
+                               }
+
+                               // Hide other tooltips if tooltip is solo
+                               if(typeof self.options.show.solo === 'object') {
+                                       solo = $(self.options.show.solo);
+                               }
+                               else if(self.options.show.solo === true) {
+                                       solo = $('div.qtip').not(self.elements.tooltip);
+                               }
+                               if(solo) {
+                                       solo.each(function () {
+                                               if($(this).qtip('api').status.rendered === true) { $(this).qtip('api').hide(); }
+                                       });
+                               }
+
+                               // Show tooltip
+                               if(typeof self.options.show.effect.type === 'function') {
+                                       self.options.show.effect.type.call(self.elements.tooltip, self.options.show.effect.length);
+                                       self.elements.tooltip.queue(function () {
+                                               afterShow();
+                                               $(this).dequeue();
+                                       });
+                               }
+                               else {
+                                       switch (self.options.show.effect.type.toLowerCase()) {
+                                               case 'fade':
+                                                       self.elements.tooltip.fadeIn(self.options.show.effect.length, afterShow);
+                                               break;
+
+                                               case 'slide':
+                                                       self.elements.tooltip.slideDown(self.options.show.effect.length, function () {
+                                                               afterShow();
+                                                               if(self.options.position.type !== 'static') { self.updatePosition(event, true); }
+                                                       });
+                                               break;
+
+                                               case 'grow':
+                                                       self.elements.tooltip.show(self.options.show.effect.length, afterShow);
+                                               break;
+
+                                               default:
+                                                       self.elements.tooltip.show(null, afterShow);
+                                               break;
+                                       }
+
+                                       // Add active class to tooltip
+                                       self.elements.tooltip.addClass(self.options.style.classes.active);
+                               }
+
+                               // Log event and return
+                               return self;
+                       },
+
+                       hide: function (event) {
+                               var returned;
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered) { return false; }
+
+                               // Only continue if element is visible
+                               else if(self.elements.tooltip.css('display') === 'none') { return self; }
+
+                               // Stop show timer and animation queue
+                               clearTimeout(self.timers.show);
+                               self.elements.tooltip.stop(true, false);
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforeHide.call(self, event);
+                               if(returned === false) { return self; }
+
+                               // Define afterHide callback method
+                               function afterHide() {
+                                       // Set ARIA hidden status attribute
+                                       self.elements.tooltip.attr('aria-hidden', true);
+
+                                       // Remove opacity attribute
+                                       if($.browser.msie) { 
+                                               self.elements.tooltip.get(0).style.removeAttribute('opacity');
+                                       }
+                                       else {
+                                               self.elements.tooltip.css({ opacity: '' });
+                                       }
+
+                                       // Call API callback
+                                       self.onHide.call(self, event);
+                               }
+
+                               // Maintain toggle functionality if enabled
+                               self.cache.toggle = 0;
+
+                               // Hide tooltip
+                               if(typeof self.options.hide.effect.type === 'function') {
+                                       self.options.hide.effect.type.call(self.elements.tooltip, self.options.hide.effect.length);
+                                       self.elements.tooltip.queue(function () {
+                                               afterHide();
+                                               $(this).dequeue();
+                                       });
+                               }
+                               else {
+                                       switch (self.options.hide.effect.type.toLowerCase()) {
+                                               case 'fade':
+                                                       self.elements.tooltip.fadeOut(self.options.hide.effect.length, afterHide);
+                                               break;
+
+                                               case 'slide':
+                                                       self.elements.tooltip.slideUp(self.options.hide.effect.length, afterHide);
+                                               break;
+
+                                               case 'grow':
+                                                       self.elements.tooltip.hide(self.options.hide.effect.length, afterHide);
+                                               break;
+
+                                               default:
+                                                       self.elements.tooltip.hide(null, afterHide);
+                                               break;
+                                       }
+
+                                       // Remove active class to tooltip
+                                       self.elements.tooltip.removeClass(self.options.style.classes.active);
+                               }
+
+                               // Log event and return
+                               return self;
+                       },
+
+                       toggle: function (event, state) {
+                               var condition = /boolean|number/.test(typeof state) ? state : !self.elements.tooltip.is(':visible');
+
+                               self[condition ? 'show' : 'hide'](event);
+
+                               return self;
+                       },
+
+                       updatePosition: function (event, animate) {
+                               if(!self.status.rendered) {
+                                       return false;
+                               }
+
+                               var posOptions = options.position,
+                                       target = $(posOptions.target),
+                                       elemWidth = self.elements.tooltip.outerWidth(),
+                                       elemHeight = self.elements.tooltip.outerHeight(),
+                                       targetWidth, targetHeight, position,
+                                       my = posOptions.corner.tooltip,
+                                       at = posOptions.corner.target,
+                                       returned,
+                                       coords, i, mapName, imagePos,
+                                       adapt = {
+                                               left: function () {
+                                                       var leftEdge = $(window).scrollLeft(),
+                                                               rightEdge = $(window).width() + $(window).scrollLeft(),
+                                                               myOffset = my.x === 'center' ? elemWidth/2 : elemWidth,
+                                                               atOffset = my.x === 'center' ? targetWidth/2 : targetWidth,
+                                                               borderAdjust = (my.x === 'center' ? 1 : 2) * self.options.style.border.radius,
+                                                               offset = -2 * posOptions.adjust.x,
+                                                               pRight = position.left + elemWidth,
+                                                               adj;
+
+                                                       // Cut off by right side of window
+                                                       if(pRight > rightEdge) {
+                                                               adj = offset - myOffset - atOffset + borderAdjust;
+
+                                                               // Shifting to the left will make whole qTip visible, or will minimize how much is cut off
+                                                               if(position.left + adj > leftEdge || leftEdge - (position.left + adj) < pRight - rightEdge) {
+                                                                       return { adjust: adj, tip: 'right' };
+                                                               }
+                                                       }
+                                                       // Cut off by left side of window
+                                                       if(position.left < leftEdge) {
+                                                               adj = offset + myOffset + atOffset - borderAdjust;
+
+                                                               // Shifting to the right will make whole qTip visible, or will minimize how much is cut off
+                                                               if(pRight + adj < rightEdge || pRight + adj - rightEdge < leftEdge - position.left) {
+                                                                       return { adjust: adj, tip: 'left' };
+                                                               }
+                                                       }
+
+                                                       return { adjust: 0, tip: my.x };
+                                               },
+                                               top: function () {
+                                                       var topEdge = $(window).scrollTop(),
+                                                               bottomEdge = $(window).height() + $(window).scrollTop(),
+                                                               myOffset = my.y === 'center' ? elemHeight/2 : elemHeight,
+                                                               atOffset = my.y === 'center' ? targetHeight/2 : targetHeight,
+                                                               borderAdjust = (my.y === 'center' ? 1 : 2) * self.options.style.border.radius,
+                                                               offset = -2 * posOptions.adjust.y,
+                                                               pBottom = position.top + elemHeight,
+                                                               adj;
+
+                                                       // Cut off by bottom of window
+                                                       if(pBottom > bottomEdge) {
+                                                               adj = offset - myOffset - atOffset + borderAdjust;
+
+                                                               // Shifting to the top will make whole qTip visible, or will minimize how much is cut off
+                                                               if(position.top + adj > topEdge || topEdge - (position.top + adj) < pBottom - bottomEdge) {
+                                                                       return { adjust: adj, tip: 'bottom' };
+                                                               }
+                                                       }
+                                                       // Cut off by top of window
+                                                       if(position.top < topEdge) {
+                                                               adj = offset + myOffset + atOffset - borderAdjust;
+
+                                                               // Shifting to the top will make whole qTip visible, or will minimize how much is cut off
+                                                               if(pBottom + adj < bottomEdge || pBottom + adj - bottomEdge < topEdge - position.top) {
+                                                                       return { adjust: adj, tip: 'top' };
+                                                               }
+                                                       }
+
+                                                       return { adjust: 0, tip: my.y };
+                                               }
+                                       };
+
+                               if(event && options.position.target === 'mouse') {
+                                       // Force left top to allow flipping
+                                       at = { x: 'left', y: 'top' };
+                                       targetWidth = targetHeight = 0;
+                                       
+                                       // Use cached mouse coordiantes if not available
+                                       if(!event.pageX) {
+                                               position = self.cache.mouse;
+                                       }
+                                       else {
+                                               position = {
+                                                       top: event.pageY,
+                                                       left: event.pageX
+                                               };
+                                       }
+                               }
+                               else {
+                                       if(target[0] === document) {
+                                               targetWidth = target.width();
+                                               targetHeight = target.height();
+                                               position = { top: 0, left: 0 };
+                                       }
+                                       else if(target[0] === window) {
+                                               targetWidth = target.width();
+                                               targetHeight = target.height();
+                                               position = {
+                                                       top: target.scrollTop(),
+                                                       left: target.scrollLeft()
+                                               };
+                                       }
+                                       else if(target.is('area')) {
+                                               // Retrieve coordinates from coords attribute and parse into integers
+                                               coords = self.options.position.target.attr('coords').split(',');
+                                               for(i = 0; i < coords.length; i++) { coords[i] = parseInt(coords[i], 10); }
+
+                                               // Setup target position object
+                                               mapName = self.options.position.target.parent('map').attr('name');
+                                               imagePos = $('img[usemap="#' + mapName + '"]:first').offset();
+                                               position = {
+                                                       left: Math.floor(imagePos.left + coords[0]),
+                                                       top: Math.floor(imagePos.top + coords[1])
+                                               };
+
+                                               // Determine width and height of the area
+                                               switch (self.options.position.target.attr('shape').toLowerCase()) {
+                                                       case 'rect':
+                                                               targetWidth = Math.ceil(Math.abs(coords[2] - coords[0]));
+                                                               targetHeight = Math.ceil(Math.abs(coords[3] - coords[1]));
+                                                       break;
+
+                                                       case 'circle':
+                                                               targetWidth = coords[2] + 1;
+                                                               targetHeight = coords[2] + 1;
+                                                       break;
+
+                                                       case 'poly':
+                                                               targetWidth = coords[0];
+                                                               targetHeight = coords[1];
+
+                                                               for (i = 0; i < coords.length; i++) {
+                                                                       if(i % 2 === 0) {
+                                                                               if(coords[i] > targetWidth) { targetWidth = coords[i]; }
+                                                                               if(coords[i] < coords[0]) { position.left = Math.floor(imagePos.left + coords[i]); }
+                                                                       }
+                                                                       else {
+                                                                               if(coords[i] > targetHeight) { targetHeight = coords[i]; }
+                                                                               if(coords[i] < coords[1]) { position.top = Math.floor(imagePos.top + coords[i]); }
+                                                                       }
+                                                               }
+
+                                                               targetWidth = targetWidth - (position.left - imagePos.left);
+                                                               targetHeight = targetHeight - (position.top - imagePos.top);
+                                                       break;
+                                               }
+
+                                               // Adjust position by 2 pixels (Positioning bug?)
+                                               targetWidth -= 2;
+                                               targetHeight -= 2;
+                                       }
+                                       else {
+                                               targetWidth = target.outerWidth();
+                                               targetHeight = target.outerHeight();
+
+                                               if(!self.elements.tooltip.is(':visible')) {
+                                                       self.elements.tooltip.css({ left: '-10000000em' }).show();
+                                               }
+
+                                               // Account for tooltips offset parent if necessary
+                                               if(self.elements.tooltip.offsetParent()[0] === document.body) {
+                                                       position = target.offset();     
+                                               }
+                                               else {
+                                                       // Account for offset parent and it's scroll positions
+                                                       position = target.position();
+                                                       position.top += target.offsetParent().scrollTop();
+                                                       position.left += target.offsetParent().scrollLeft();
+                                               }
+                                       }
+
+                                       // Adjust position relative to target
+                                       position.left += at.x === 'right' ? targetWidth : at.x === 'center' ? targetWidth / 2 : 0;
+                                       position.top += at.y === 'bottom' ? targetHeight : at.y === 'center' ? targetHeight / 2 : 0;
+                               }
+
+                               // Adjust position relative to tooltip
+                               position.left += posOptions.adjust.x + (my.x === 'right' ? -elemWidth : my.x === 'center' ? -elemWidth / 2 : 0);
+                               position.top += posOptions.adjust.y + (my.y === 'bottom' ? -elemHeight : my.y === 'center' ? -elemHeight / 2 : 0);
+
+                               // Adjust for border radius
+                               if(self.options.style.border.radius > 0) {
+                                       if(my.x === 'left') { position.left -= self.options.style.border.radius; }
+                                       else if(my.x === 'right') { position.left += self.options.style.border.radius; }
+
+                                       if(my.y === 'top') { position.top -= self.options.style.border.radius; }
+                                       else if(my.y === 'bottom') { position.top += self.options.style.border.radius; }
+                               }
+
+                               // Adjust tooltip position if screen adjustment is enabled
+                               if(posOptions.adjust.screen) {
+                                       (function() {
+                                               var adjusted = { x: 0, y: 0 },
+                                                       adapted = { x: adapt.left(), y: adapt.top() },
+                                                       tip = new Corner(options.style.tip.corner);
+
+                                               if(self.elements.tip && tip) {
+                                                       // Adjust position according to adjustment that took place
+                                                       if(adapted.y.adjust !== 0) {
+                                                               position.top += adapted.y.adjust;
+                                                               tip.y = adjusted.y = adapted.y.tip;
+                                                       }
+                                                       if(adapted.x.adjust !== 0) {
+                                                               position.left += adapted.x.adjust;
+                                                               tip.x = adjusted.x = adapted.x.tip;
+                                                       }
+
+                                                       // Update overflow cache
+                                                       self.cache.overflow = {
+                                                               left: adjusted.x === false,
+                                                               top: adjusted.y === false
+                                                       };
+
+                                                       // Update and redraw the tip
+                                                       if(self.elements.tip.attr('rel') !== tip.string()) { createTip.call(self, tip); }
+                                               }
+                                       }());
+                               }
+
+                               // Initiate bgiframe plugin in IE6 if tooltip overlaps a select box or object element
+                               if(!self.elements.bgiframe && $.browser.msie && parseInt($.browser.version.charAt(0), 10) === 6) {
+                                       bgiframe.call(self);
+                               }
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforePositionUpdate.call(self, event);
+                               if(returned === false) { return self; }
+
+                               // Check if animation is enabled
+                               if(options.position.target !== 'mouse' && animate === true) {
+                                       // Set animated status
+                                       self.status.animated = true;
+
+                                       // Animate and reset animated status on animation end
+                                       self.elements.tooltip.stop().animate(position, 200, 'swing', function () {
+                                               self.status.animated = false;
+                                       });
+                               }
+
+                               // Set new position via CSS
+                               else { self.elements.tooltip.css(position); }
+
+                               // Call API method and log event if its not a mouse move
+                               self.onPositionUpdate.call(self, event);
+
+                               return self;
+                       },
+
+                       updateWidth: function (newWidth) {
+                               // Make sure tooltip is rendered and width is a number
+                               if(!self.status.rendered || (newWidth && typeof newWidth !== 'number')) { return false; }
+
+                               // Setup elements which must be hidden during width update
+                               var hidden = self.elements.contentWrapper.siblings().add(self.elements.tip).add(self.elements.button),
+                                       zoom = self.elements.wrapper.add(self.elements.contentWrapper.children()),
+                                       tooltip = self.elements.tooltip,
+                                       max = self.options.style.width.max,
+                                       min = self.options.style.width.min;
+
+                               // Calculate the new width if one is not supplied
+                               if(!newWidth) {
+                                       // Explicit width is set
+                                       if(typeof self.options.style.width.value === 'number') {
+                                               newWidth = self.options.style.width.value;
+                                       }
+
+                                       // No width is set, proceed with auto detection
+                                       else {
+                                               // Set width to auto initally to determine new width and hide other elements
+                                               self.elements.tooltip.css({ width: 'auto' });
+                                               hidden.hide();
+
+                                               // Set the new calculated width and if width has not numerical, grab new pixel width
+                                               tooltip.width(newWidth);
+
+                                               // Set position and zoom to defaults to prevent IE hasLayout bug
+                                               if($.browser.msie) {
+                                                       zoom.css({ zoom: '' });
+                                               }
+
+                                               // Set the new width
+                                               newWidth = self.getDimensions().width;
+
+                                               // Make sure its within the maximum and minimum width boundries
+                                               if(!self.options.style.width.value) {
+                                                       newWidth = Math.min(Math.max(newWidth, min), max);
+                                               }
+                                       }
+                               }
+
+                               // Adjust newWidth by 1px if width is odd (IE6 rounding bug fix)
+                               if(newWidth % 2) { newWidth += 1; }
+
+                               // Set the new calculated width and unhide other elements
+                               self.elements.tooltip.width(newWidth);
+                               hidden.show();
+
+                               // Set the border width, if enabled
+                               if(self.options.style.border.radius) {
+                                       self.elements.tooltip.find('.qtip-betweenCorners').each(function (i) {
+                                               $(this).width(newWidth - (self.options.style.border.radius * 2));
+                                       });
+                               }
+
+                               // IE only adjustments
+                               if($.browser.msie) {
+                                       // Reset position and zoom to give the wrapper layout (IE hasLayout bug)
+                                       zoom.css({ zoom: 1 });
+
+                                       // Set the new width
+                                       self.elements.wrapper.width(newWidth);
+
+                                       // Adjust BGIframe height and width if enabled
+                                       if(self.elements.bgiframe) { self.elements.bgiframe.width(newWidth).height(self.getDimensions.height); }
+                               }
+
+                               // Log event and return
+                               return self;
+                       },
+
+                       updateStyle: function (name) {
+                               var tip, borders, context, corner, coordinates;
+
+                               // Make sure tooltip is rendered and style is defined
+                               if(!self.status.rendered || typeof name !== 'string' || !$.fn.qtip.styles[name]) { return false; }
+
+                               // Set the new style object
+                               self.options.style = buildStyle.call(self, $.fn.qtip.styles[name], self.options.user.style);
+
+                               // Update initial styles of content and title elements
+                               self.elements.content.css(jQueryStyle(self.options.style));
+                               if(self.options.content.title.text !== false) { self.elements.title.css(jQueryStyle(self.options.style.title, true)); }
+
+                               // Update CSS border colour
+                               self.elements.contentWrapper.css({
+                                       borderColor: self.options.style.border.color
+                               });
+
+                               // Update tip color if enabled
+                               if(self.options.style.tip.corner !== false) {
+                                       if($('<canvas />').get(0).getContext) {
+                                               // Retrieve canvas context and clear
+                                               tip = self.elements.tooltip.find('.qtip-tip canvas:first');
+                                               context = tip.get(0).getContext('2d');
+                                               context.clearRect(0, 0, 300, 300);
+
+                                               // Draw new tip
+                                               corner = tip.parent('div[rel]:first').attr('rel');
+                                               coordinates = calculateTip(corner, self.options.style.tip.size.width, self.options.style.tip.size.height);
+                                               drawTip.call(self, tip, coordinates, self.options.style.tip.color || self.options.style.border.color);
+                                       }
+                                       else if($.browser.msie) {
+                                               // Set new fillcolor attribute
+                                               tip = self.elements.tooltip.find('.qtip-tip [nodeName="shape"]');
+                                               tip.attr('fillcolor', self.options.style.tip.color || self.options.style.border.color);
+                                       }
+                               }
+
+                               // Update border colors if enabled
+                               if(self.options.style.border.radius > 0) {
+                                       self.elements.tooltip.find('.qtip-betweenCorners').css({
+                                               backgroundColor: self.options.style.border.color
+                                       });
+
+                                       if($('<canvas />').get(0).getContext) {
+                                               borders = calculateBorders(self.options.style.border.radius);
+                                               self.elements.tooltip.find('.qtip-wrapper canvas').each(function () {
+                                                       // Retrieve canvas context and clear
+                                                       context = $(this).get(0).getContext('2d');
+                                                       context.clearRect(0, 0, 300, 300);
+
+                                                       // Draw new border
+                                                       corner = $(this).parent('div[rel]:first').attr('rel');
+                                                       drawBorder.call(self, $(this), borders[corner], self.options.style.border.radius, self.options.style.border.color);
+                                               });
+                                       }
+                                       else if($.browser.msie) {
+                                               // Set new fillcolor attribute on each border corner
+                                               self.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function () {
+                                                       $(this).attr('fillcolor', self.options.style.border.color);
+                                               });
+                                       }
+                               }
+
+                               // Log event and return
+                               return self;
+                       },
+
+                       updateContent: function (content, reposition) {
+                               var parsedContent, images, loadedImages;
+
+                               function afterLoad() {
+                                       // Update the tooltip width
+                                       self.updateWidth();
+
+                                       // If repositioning is enabled, update positions
+                                       if(reposition !== false) {
+                                               // Update position if tooltip isn't static
+                                               if(self.options.position.type !== 'static') { self.updatePosition(self.elements.tooltip.is(':visible'), true); }
+
+                                               // Reposition the tip if enabled
+                                               if(self.options.style.tip.corner !== false) { positionTip.call(self); }
+                                       }
+                               }
+
+                               // Make sure content is defined if not, return
+                               if(!content) { return false; }
+
+                               // Call API method and set new content if a string is returned
+                               parsedContent = self.beforeContentUpdate.call(self, content);
+                               if(typeof parsedContent === 'string') { content = parsedContent; }
+                               else if(parsedContent === false) { return; }
+
+                               // Continue normally if rendered, but if not set options.content.text instead
+                               if(self.status.rendered) {
+                                       // Set position and zoom to defaults to prevent IE hasLayout bug
+                                       if($.browser.msie) {
+                                               self.elements.contentWrapper.children().css({
+                                                       zoom: 'normal'
+                                               });
+                                       }
+
+                                       // Append new content if its a DOM array and show it if hidden
+                                       if(content.jquery && content.length > 0) { content.clone(true).appendTo(self.elements.content).show(); }
+
+                                       // Content is a regular string, insert the new content
+                                       else { self.elements.content.html(content); }
+
+                                       // Check if images need to be loaded before position is updated to prevent mis-positioning
+                                       images = self.elements.content.find('img[complete=false]');
+                                       if(images.length > 0) {
+                                               loadedImages = 0;
+                                               images.each(function (i) {
+                                                       $('<img src="' + $(this).attr('src') + '" />').load(function () {
+                                                               if(++loadedImages === images.length) { afterLoad(); }
+                                                       });
+                                               });
+                                       }
+                                       else { afterLoad(); }
+                               }
+                               else {
+                                       self.options.content.text = content;
+                               }
+
+                               // Call API method and log event
+                               self.onContentUpdate.call(self);
+                               return self;
+                       },
+
+                       loadContent: function (url, data, method) {
+                               var returned;
+
+                               function setupContent(content) {
+                                       // Call API method and log event
+                                       self.onContentLoad.call(self);
+
+                                       // Update the content
+                                       self.updateContent(content);
+                               }
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered) { return false; }
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforeContentLoad.call(self);
+                               if(returned === false) { return self; }
+
+                               // Load content using specified request type
+                               if(method === 'post') { $.post(url, data, setupContent); }
+                               else { $.get(url, data, setupContent); }
+
+                               return self;
+                       },
+
+                       updateTitle: function (content) {
+                               var returned;
+
+                               // Make sure tooltip is rendered and content is defined
+                               if(!self.status.rendered || !content) { return false; }
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforeTitleUpdate.call(self);
+                               if(returned === false) { return self; }
+
+                               // Set the new content and reappend the button if enabled
+                               if(self.elements.button) { self.elements.button = self.elements.button.clone(true); }
+                               self.elements.title.html(content);
+                               if(self.elements.button) { self.elements.title.prepend(self.elements.button); }
+
+                               // Call API method and log event
+                               self.onTitleUpdate.call(self);
+                               return self;
+                       },
+
+                       focus: function (event) {
+                               var curIndex, newIndex, elemIndex, returned;
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered || self.options.position.type === 'static') { return false; }
+
+                               // Set z-index variables
+                               curIndex = parseInt(self.elements.tooltip.css('z-index'), 10);
+                               newIndex = 15000 + $('div.qtip[id^="qtip"]').length - 1;
+
+                               // Only update the z-index if it has changed and tooltip is not already focused
+                               if(!self.status.focused && curIndex !== newIndex) {
+                                       // Call API method and if return value is false, halt
+                                       returned = self.beforeFocus.call(self, event);
+                                       if(returned === false) { return self; }
+
+                                       // Loop through all other tooltips
+                                       $('div.qtip[id^="qtip"]').not(self.elements.tooltip).each(function () {
+                                               if($(this).qtip('api').status.rendered === true) {
+                                                       elemIndex = parseInt($(this).css('z-index'), 10);
+
+                                                       // Reduce all other tooltip z-index by 1
+                                                       if(typeof elemIndex === 'number' && elemIndex > -1) {
+                                                               $(this).css({ zIndex: parseInt($(this).css('z-index'), 10) - 1 });
+                                                       }
+
+                                                       // Set focused status to false
+                                                       $(this).qtip('api').status.focused = false;
+                                               }
+                                       });
+
+                                       // Set the new z-index and set focus status to true
+                                       self.elements.tooltip.css({ zIndex: newIndex });
+                                       self.status.focused = true;
+
+                                       // Call API method and log event
+                                       self.onFocus.call(self, event);
+                               }
+
+                               return self;
+                       },
+
+                       disable: function (state) {
+                               self.status.disabled = state ? true : false;
+                               return self;
+                       },
+
+                       destroy: function () {
+                               var i, returned, interfaces,
+                                       oldattr = self.elements.target.data('old'+self.cache.attr[0]);
+
+                               // Call API method and if return value is false, halt
+                               returned = self.beforeDestroy.call(self);
+                               if(returned === false) { return self; }
+
+                               // Check if tooltip is rendered
+                               if(self.status.rendered) {
+                                       // Remove event handlers and remove element
+                                       self.options.show.when.target.unbind('mousemove.qtip', self.updatePosition);
+                                       self.options.show.when.target.unbind('mouseout.qtip', self.hide);
+                                       self.options.show.when.target.unbind(self.options.show.when.event + '.qtip');
+                                       self.options.hide.when.target.unbind(self.options.hide.when.event + '.qtip');
+                                       self.elements.tooltip.unbind(self.options.hide.when.event + '.qtip');
+                                       self.elements.tooltip.unbind('mouseover.qtip', self.focus);
+                                       self.elements.tooltip.remove();
+                               }
+
+                               // Tooltip isn't yet rendered, remove render event
+                               else { self.options.show.when.target.unbind(self.options.show.when.event + '.qtip-' + self.id + '-create'); }
+
+                               // Check to make sure qTip data is present on target element
+                               if(typeof self.elements.target.data('qtip') === 'object') {
+                                       // Remove API references from interfaces object
+                                       interfaces = self.elements.target.data('qtip').interfaces;
+                                       if(typeof interfaces === 'object' && interfaces.length > 0) {
+                                               // Remove API from interfaces array
+                                               for(i = 0; i < interfaces.length - 1; i++) {
+                                                       if(interfaces[i].id === self.id) { interfaces.splice(i, 1); }
+                                               }
+                                       }
+                               }
+                               $.fn.qtip.interfaces.splice(self.id, 1);
+
+                               // Set qTip current id to previous tooltips API if available
+                               if(typeof interfaces === 'object' && interfaces.length > 0) { self.elements.target.data('qtip').current = interfaces.length - 1; }
+                               else { self.elements.target.removeData('qtip'); }
+
+                               // Reset old title attribute if removed
+                               if(oldattr) {
+                                       self.elements.target.attr(self.cache.attr[0], oldattr);
+                               }
+
+                               // Call API method and log destroy
+                               self.onDestroy.call(self);
+
+                               return self.elements.target;
+                       },
+
+                       getPosition: function () {
+                               var show, offset;
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered) { return false; }
+
+                               show = (self.elements.tooltip.css('display') !== 'none') ? false : true;
+
+                               // Show and hide tooltip to make sure coordinates are returned
+                               if(show) { self.elements.tooltip.css({ visiblity: 'hidden' }).show(); }
+                               offset = self.elements.tooltip.offset();
+                               if(show) { self.elements.tooltip.css({ visiblity: 'visible' }).hide(); }
+
+                               return offset;
+                       },
+
+                       getDimensions: function () {
+                               var show, dimensions;
+
+                               // Make sure tooltip is rendered and if not, return
+                               if(!self.status.rendered) { return false; }
+
+                               show = (!self.elements.tooltip.is(':visible')) ? true : false;
+
+                               // Show and hide tooltip to make sure dimensions are returned
+                               if(show) { self.elements.tooltip.css({ visiblity: 'hidden' }).show(); }
+                               dimensions = {
+                                       height: self.elements.tooltip.outerHeight(),
+                                       width: self.elements.tooltip.outerWidth()
+                               };
+                               if(show) { self.elements.tooltip.css({ visiblity: 'visible' }).hide(); }
+
+                               return dimensions;
+                       }
+               });
+       }
+
+       // Implementation
+       $.fn.qtip = function (options, blanket) {
+               var i, id, interfaces, opts, obj, command, config, api;
+
+               // Return API / Interfaces if requested
+               if(typeof options === 'string') {
+                       if($(this).data('qtip')) {
+                               // Return requested object
+                               if(options === 'api') {
+                                       return $(this).data('qtip').interfaces[$(this).data('qtip').current];
+                               }
+                               else if(options === 'interfaces') {
+                                       return $(this).data('qtip').interfaces;
+                               }
+                       }
+                       else {
+                               return $(this);
+                       }
+               }
+
+               // Validate provided options
+               else {
+                       // Set null options object if no options are provided
+                       if(!options) { options = {}; }
+
+                       // Sanitize option data
+                       if(typeof options.content !== 'object' || (options.content.jquery && options.content.length > 0)) {
+                               options.content = { text: options.content };
+                       }
+                       if(typeof options.content.title !== 'object') {
+                               options.content.title = { text: options.content.title };
+                       }
+                       if(typeof options.position !== 'object') {
+                               options.position = { corner: options.position };
+                       }
+                       if(typeof options.position.corner !== 'object') {
+                               options.position.corner = {
+                                       target: options.position.corner,
+                                       tooltip: options.position.corner
+                               };
+                       }
+                       if(typeof options.show !== 'object') {
+                               options.show = { when: options.show };
+                       }
+                       if(typeof options.show.when !== 'object') {
+                               options.show.when = { event: options.show.when };
+                       }
+                       if(typeof options.show.effect !== 'object') {
+                               options.show.effect = { type: options.show.effect };
+                       }
+                       if(typeof options.hide !== 'object') {
+                               options.hide = { when: options.hide };
+                       }
+                       if(typeof options.hide.when !== 'object') {
+                               options.hide.when = { event: options.hide.when };
+                       }
+                       if(typeof options.hide.effect !== 'object') {
+                               options.hide.effect = { type: options.hide.effect };
+                       }
+                       if(typeof options.style !== 'object') {
+                               options.style = { name: options.style };
+                       }
+
+                       // Sanitize option styles
+                       options.style = sanitizeStyle(options.style);
+
+                       // Build main options object
+                       opts = $.extend(true, {}, $.fn.qtip.defaults, options);
+
+                       // Inherit all style properties into one syle object and include original options
+                       opts.style = buildStyle.call({
+                               options: opts
+                       }, opts.style);
+                       opts.user = $.extend(true, {}, options);
+               }
+
+               // Iterate each matched element
+               return $(this).each(function () // Return original elements as per jQuery guidelines
+               {
+                       var self = $(this), content = false;
+
+                       // Check for API commands
+                       if(typeof options === 'string') {
+                               command = options.toLowerCase();
+                               interfaces = $(this).qtip('interfaces');
+
+                               // Make sure API data exists
+                               if(typeof interfaces === 'object') {
+                                       // Check if API call is a BLANKET DESTROY command
+                                       if(blanket === true && command === 'destroy') {
+                                               for(i = interfaces.length - 1; i > -1; i--) {
+                                                       if('object' === typeof interfaces[i]) {
+                                                               interfaces[i].destroy();
+                                                       }
+                                               }
+                                       }
+
+                                       // API call is not a BLANKET DESTROY command
+                                       else {
+                                               // Check if supplied command effects this tooltip only (NOT BLANKET)
+                                               if(blanket !== true) { interfaces = [$(this).qtip('api')]; }
+
+                                               // Execute command on chosen qTips
+                                               for (i = 0; i < interfaces.length; i++) {
+                                                       // Destroy command doesn't require tooltip to be rendered
+                                                       if(command === 'destroy') { interfaces[i].destroy(); }
+
+                                                       // Only call API if tooltip is rendered and it wasn't a destroy call
+                                                       else if(interfaces[i].status.rendered === true) {
+                                                               if(command === 'show') { interfaces[i].show(); }
+                                                               else if(command === 'hide') { interfaces[i].hide(); }
+                                                               else if(command === 'focus') { interfaces[i].focus(); }
+                                                               else if(command === 'disable') { interfaces[i].disable(true); }
+                                                               else if(command === 'enable') { interfaces[i].disable(false); }
+                                                               else if(command === 'update') { interfaces[i].updatePosition(); }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                       // No API commands, continue with qTip creation
+                       else {
+                               // Create unique configuration object
+                               config = $.extend(true, {}, opts);
+                               config.hide.effect.length = opts.hide.effect.length;
+                               config.show.effect.length = opts.show.effect.length;
+
+                               // Sanitize target options
+                               if(config.position.container === false) { config.position.container = $(document.body); }
+                               if(config.position.target === false) { config.position.target = $(this); }
+                               if(config.show.when.target === false) { config.show.when.target = $(this); }
+                               if(config.hide.when.target === false) { config.hide.when.target = $(this); }
+
+                               // Parse corner options
+                               config.position.corner.tooltip = new Corner(config.position.corner.tooltip);
+                               config.position.corner.target = new Corner(config.position.corner.target);
+
+                               // If no content is provided, check title and alt attributes for fallback
+                               if(!config.content.text.length) {
+                                       $(['title', 'alt']).each(function(i, attr) {
+                                               var val = self.attr(attr);
+                                               if(val && val.length) {
+                                                       content = [attr, val];
+                                                       self.data('old'+attr, val).removeAttr(attr);
+                                                       config.content.text = val.replace(/\n/gi, '<br />');
+                                                       return false;
+                                               }
+                                       });
+                               }
+
+                               // Determine tooltip ID (Reuse array slots if possible)
+                               id = $.fn.qtip.interfaces.length;
+                               for (i = 0; i < id; i++) {
+                                       if(typeof $.fn.qtip.interfaces[i] === 'undefined') {
+                                               id = i;
+                                               break;
+                                       }
+                               }
+
+                               // Instantiate the tooltip
+                               obj = new QTip($(this), config, id);
+
+                               // Add API references and cache content if present
+                               $.fn.qtip.interfaces[id] = obj;
+                               obj.cache.attr = content;
+
+                               // Check if element already has qTip data assigned
+                               if(typeof $(this).data('qtip') === 'object' && $(this).data('qtip')) {
+                                       // Set new current interface id
+                                       if(typeof $(this).attr('qtip') === 'undefined') { $(this).data('qtip').current = $(this).data('qtip').interfaces.length; }
+
+                                       // Push new API interface onto interfaces array
+                                       $(this).data('qtip').interfaces.push(obj);
+                               }
+
+                               // No qTip data is present, create now
+                               else {
+                                       $(this).data('qtip', {
+                                               current: 0,
+                                               interfaces: [obj]
+                                       });
+                               }
+
+                               // If prerendering is disabled, create tooltip on showEvent
+                               if(config.content.prerender === false && config.show.when.event !== false && config.show.ready !== true) {
+                                       config.show.when.target.bind(config.show.when.event + '.qtip-' + id + '-create', { qtip: id }, function (event) {
+                                               // Retrieve API interface via passed qTip Id
+                                               api = $.fn.qtip.interfaces[event.data.qtip];
+
+                                               // Unbind show event and cache mouse coords
+                                               api.options.show.when.target.unbind(api.options.show.when.event + '.qtip-' + event.data.qtip + '-create');
+                                               api.cache.mouse = {
+                                                       left: event.pageX,
+                                                       top: event.pageY
+                                               };
+
+                                               // Render tooltip and start the event sequence
+                                               construct.call(api);
+                                               api.options.show.when.target.trigger(api.options.show.when.event);
+                                       });
+                               }
+
+                               // Prerendering is enabled, create tooltip now
+                               else {
+                                       // Set mouse position cache to top left of the element
+                                       obj.cache.mouse = {
+                                               left: config.show.when.target.offset().left,
+                                               top: config.show.when.target.offset().top
+                                       };
+
+                                       // Construct the tooltip
+                                       construct.call(obj);
+                               }
+                       }
+               });
+       };
+
+       // Define qTip API interfaces array
+       $.fn.qtip.interfaces = [];
+
+       /* Add intermediary method to the 'attr' class to allow other plugins to successfully 
+       retrieve the title of an element with a qTip applied */
+       $.fn.qtip.fn = { attr: $.fn.attr };
+       $.fn.attr = function(attr) {
+               var api = $(this).qtip('api');
+
+               return (arguments.length === 1 && (/title|alt/i).test(attr) && api.status && api.status.rendered === true)
+                       ? $(this).data('old' + api.cache.attr[0])
+                       : $.fn.qtip.fn.attr.apply(this, arguments);
+       };
+
+       // Define configuration defaults
+       $.fn.qtip.defaults = {
+               // Content
+               content: {
+                       prerender: false,
+                       text: false,
+                       url: false,
+                       data: null,
+                       title: {
+                               text: false,
+                               button: false
+                       }
+               },
+               // Position
+               position: {
+                       target: false,
+                       corner: {
+                               target: 'bottomRight',
+                               tooltip: 'topLeft'
+                       },
+                       adjust: {
+                               x: 0,
+                               y: 0,
+                               mouse: true,
+                               screen: false,
+                               scroll: true,
+                               resize: true
+                       },
+                       type: 'absolute',
+                       container: false
+               },
+               // Effects
+               show: {
+                       when: {
+                               target: false,
+                               event: 'mouseover'
+                       },
+                       effect: {
+                               type: 'fade',
+                               length: 100
+                       },
+                       delay: 140,
+                       solo: false,
+                       ready: false
+               },
+               hide: {
+                       when: {
+                               target: false,
+                               event: 'mouseout'
+                       },
+                       effect: {
+                               type: 'fade',
+                               length: 100
+                       },
+                       delay: 0,
+                       fixed: false
+               },
+               // Callbacks
+               api: {
+                       beforeRender: function () {},
+                       onRender: function () {},
+                       beforePositionUpdate: function () {},
+                       onPositionUpdate: function () {},
+                       beforeShow: function () {},
+                       onShow: function () {},
+                       beforeHide: function () {},
+                       onHide: function () {},
+                       beforeContentUpdate: function () {},
+                       onContentUpdate: function () {},
+                       beforeContentLoad: function () {},
+                       onContentLoad: function () {},
+                       beforeTitleUpdate: function () {},
+                       onTitleUpdate: function () {},
+                       beforeDestroy: function () {},
+                       onDestroy: function () {},
+                       beforeFocus: function () {},
+                       onFocus: function () {}
+               }
+       };
+
+       $.fn.qtip.styles = {
+               defaults: {
+                       background: 'white',
+                       color: '#111',
+                       overflow: 'hidden',
+                       textAlign: 'left',
+                       width: {
+                               min: 0,
+                               max: 250
+                       },
+                       padding: '5px 9px',
+                       border: {
+                               width: 1,
+                               radius: 0,
+                               color: '#d3d3d3'
+                       },
+                       tip: {
+                               corner: false,
+                               color: false,
+                               size: {
+                                       width: 13,
+                                       height: 13
+                               },
+                               opacity: 1
+                       },
+                       title: {
+                               background: '#e1e1e1',
+                               fontWeight: 'bold',
+                               padding: '7px 12px'
+                       },
+                       button: {
+                               cursor: 'pointer'
+                       },
+                       classes: {
+                               target: '',
+                               tip: 'qtip-tip',
+                               title: 'qtip-title',
+                               button: 'qtip-button',
+                               content: 'qtip-content',
+                               active: 'qtip-active'
+                       }
+               },
+               cream: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#F9E98E'
+                       },
+                       title: {
+                               background: '#F0DE7D',
+                               color: '#A27D35'
+                       },
+                       background: '#FBF7AA',
+                       color: '#A27D35',
+
+                       classes: {
+                               tooltip: 'qtip-cream'
+                       }
+               },
+               light: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#E2E2E2'
+                       },
+                       title: {
+                               background: '#f1f1f1',
+                               color: '#454545'
+                       },
+                       background: 'white',
+                       color: '#454545',
+
+                       classes: {
+                               tooltip: 'qtip-light'
+                       }
+               },
+               dark: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#303030'
+                       },
+                       title: {
+                               background: '#404040',
+                               color: '#f3f3f3'
+                       },
+                       background: '#505050',
+                       color: '#f3f3f3',
+
+                       classes: {
+                               tooltip: 'qtip-dark'
+                       }
+               },
+               red: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#CE6F6F'
+                       },
+                       title: {
+                               background: '#f28279',
+                               color: '#9C2F2F'
+                       },
+                       background: '#F79992',
+                       color: '#9C2F2F',
+
+                       classes: {
+                               tooltip: 'qtip-red'
+                       }
+               },
+               green: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#A9DB66'
+                       },
+                       title: {
+                               background: '#b9db8c',
+                               color: '#58792E'
+                       },
+                       background: '#CDE6AC',
+                       color: '#58792E',
+
+                       classes: {
+                               tooltip: 'qtip-green'
+                       }
+               },
+               blue: {
+                       border: {
+                               width: 3,
+                               radius: 0,
+                               color: '#ADD9ED'
+                       },
+                       title: {
+                               background: '#D0E9F5',
+                               color: '#5E99BD'
+                       },
+                       background: '#E5F6FE',
+                       color: '#4D9FBF',
+
+                       classes: {
+                               tooltip: 'qtip-blue'
+                       }
+               }
+       };
+}(jQuery));
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/javascript/jquery.qtip.activate.js b/www/plugins/spip-bonux-3/javascript/jquery.qtip.activate.js
new file mode 100644 (file)
index 0000000..3ab1c4e
--- /dev/null
@@ -0,0 +1,68 @@
+/* 
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+
+/*!
+ * jquery.qtip. The jQuery tooltip plugin
+ *
+ * Copyright (c) 2009 Craig Thompson
+ * http://craigsworks.com
+ *
+ * Licensed under MIT
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Launch  : February 2009
+ * Version : 1.0.0-rc3
+ * Released: Tuesday 12th May, 2009 - 00:00
+ * Debug: jquery.qtip.debug.js
+ */
+(function($)
+{
+       jQuery.fn.qtip_activate = function() {
+         return this.each(function() {
+                       var c=jQuery(this).attr('class');
+                       var ptarget = 'rightTop';
+                       var ptooltip = 'leftTop';
+                       var reg=new RegExp('target_[^\\s]+',"");
+                       var f=c.match(reg);
+                       if (f) { ptarget = f[0].substr(7);}
+                       reg=new RegExp('tooltip_[^\\s]+',"");
+                       f=c.match(reg);
+                       if (f) { ptooltip = f[0].substr(8);}
+
+                       var content = jQuery(this).siblings('.qTipContent');
+                       if (content.length)
+                               jQuery(this).qtip({
+                                       content: {
+                                               text: content
+                                       },
+                                       hide: {
+                                               fixed: true
+                                       },
+                                       style: {
+                                               tip: true,
+                                               name: 'light' // Inherit from preset style
+                                               /*width: { max:220}*/
+                                       },
+                                       position: {
+                                        corner: {target: ptarget, tooltip: ptooltip}
+                                       }
+                               });
+                       jQuery(this).addClass('qTipDone');
+               });
+       }
+
+       jQuery(function() {
+               jQuery('.qTip').qtip_activate();
+       });
+
+       // ... et a chaque fois que le DOM change
+       onAjaxLoad(function() {
+               if (jQuery){
+                       jQuery('.qTip',this).qtip_activate();
+               }
+       });
+
+})(jQuery);
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux.xml b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux.xml
new file mode 100644 (file)
index 0000000..f263448
--- /dev/null
@@ -0,0 +1,18 @@
+<traduction module="paquet-spip_bonux" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip-bonux-3/lang/" reference="fr">
+       <langue code="ar" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=ar">
+               <traducteur nom="George" lien="http://trad.spip.net/auteur/جورج-قندلفت" />
+       </langue>
+       <langue code="en" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=en">
+               <traducteur nom="Gilles" lien="http://trad.spip.net/auteur/gilles" />
+       </langue>
+       <langue code="es" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=es">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel" />
+       </langue>
+       <langue code="fr" />
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=ru">
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/paquet-spip_bonux?lang_cible=sk">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ar.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ar.php
new file mode 100644 (file)
index 0000000..020ad4a
--- /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-spip_bonux?lang_cible=ar
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'الملحق الذي يجعل SPIP أكثر بياضاً من SPIP، ويقدم هدايا ممتعة!
+جداول، عدادات، الخ.',
+       'spip_bonux_slogan' => 'الملحق الذي يجعل SPIP أكثر بياضاً من.'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_en.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_en.php
new file mode 100644 (file)
index 0000000..051e1e6
--- /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-spip_bonux?lang_cible=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'The plugin that make SPIP better than SPIP, with nice gifts inside !
+       arrays, counter, etc.',
+       'spip_bonux_slogan' => 'The plugin that make SPIP better than SPIP.'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_es.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_es.php
new file mode 100644 (file)
index 0000000..924e45b
--- /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-spip_bonux?lang_cible=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'El plugin que lava más SPIP que SPIP, ¡con bonitos regalos dentro!
+       Tableros, contador, etcétera.',
+       'spip_bonux_slogan' => 'El plugin que lava más SPIP que SPIP.'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_fr.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_fr.php
new file mode 100644 (file)
index 0000000..9068077
--- /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_/spip-bonux-3/lang/
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'Le plugin qui lave plus SPIP que SPIP, avec des chouettes cadeaux dedans !
+       Tableaux, compteur, etc.',
+       'spip_bonux_slogan' => 'Le plugin qui lave plus SPIP que SPIP.'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ru.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_ru.php
new file mode 100644 (file)
index 0000000..0e7e554
--- /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-spip_bonux?lang_cible=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'SPIP Bonux необходим для работы многих других плагинов. Он существенно расширяет возможности SPIP, делая его лучше чем SPIP :)))',
+       'spip_bonux_slogan' => 'SPIP Bonux существенно расширяет возможности SPIP, делая его лучше чем SPIP :)))'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_sk.php b/www/plugins/spip-bonux-3/lang/paquet-spip_bonux_sk.php
new file mode 100644 (file)
index 0000000..c779759
--- /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-spip_bonux?lang_cible=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // S
+       'spip_bonux_description' => 'Zásuvný modul, ktorý prečistí SPIP ako SPIP s peknými darčekmi vnútri!
+       Tabuľky, počítadlo, a i.',
+       'spip_bonux_slogan' => 'Zásuvný modul, ktorý prečistí SPIP ako SPIP.'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux.xml b/www/plugins/spip-bonux-3/lang/spip_bonux.xml
new file mode 100644 (file)
index 0000000..a7b88c8
--- /dev/null
@@ -0,0 +1,14 @@
+<traduction module="spip_bonux" gestionnaire="salvatore" url="http://trad.spip.net" source="svn://zone.spip.org/spip-zone/_plugins_/spip-bonux-3/lang/" reference="fr">
+       <langue code="ar" />
+       <langue code="en" />
+       <langue code="es" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=es">
+               <traducteur nom="Raquel S. Bujaldón" lien="http://trad.spip.net/auteur/raquel" />
+       </langue>
+       <langue code="fr" />
+       <langue code="ru" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=ru">
+               <traducteur nom="Serge Markitanenko" lien="http://trad.spip.net/auteur/serge-markitanenko" />
+       </langue>
+       <langue code="sk" url="http://trad.spip.net/tradlang_module/spip_bonux?lang_cible=sk">
+               <traducteur nom="jaro" lien="http://trad.spip.net/auteur/jaro" />
+       </langue>
+</traduction>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_ar.php b/www/plugins/spip-bonux-3/lang/spip_bonux_ar.php
new file mode 100644 (file)
index 0000000..7e98053
--- /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=ar
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'عرض الروزنامة',
+       'annee_precedente' => 'السنة السابقة',
+       'annee_suivante' => 'السنة التالية',
+       'annuler_recherche' => 'إلغاء البحث',
+
+       // B
+       'bouton_fermer' => 'إغلاق',
+
+       // E
+       'erreur_date' => 'هذا التاريخ غير صحيح',
+       'erreur_date_corrigee' => 'تم تصحيح التاريخ',
+       'erreur_heure' => 'هذه الساعة غير صحيحة',
+       'erreur_heure_corrigee' => 'تم تصحيح الساعة',
+
+       // I
+       'id_rapide' => 'إضافة سريعة',
+
+       // M
+       'mois_precedent' => 'الشهر السابق',
+       'mois_suivant' => 'الشهر التالي',
+
+       // P
+       'pages' => 'الصفحات'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_en.php b/www/plugins/spip-bonux-3/lang/spip_bonux_en.php
new file mode 100644 (file)
index 0000000..80fe663
--- /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=en
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Show the calendar',
+       'annee_precedente' => 'Previous year',
+       'annee_suivante' => 'Next year',
+       'annuler_recherche' => 'Cancel the search',
+
+       // B
+       'bouton_fermer' => 'Close',
+
+       // E
+       'erreur_date' => 'This date is incorrect',
+       'erreur_date_corrigee' => 'The date has been corrected',
+       'erreur_heure' => 'This hour is incorrect',
+       'erreur_heure_corrigee' => 'The hour has been corrected',
+
+       // I
+       'id_rapide' => 'Ajout rapide',
+
+       // M
+       'mois_precedent' => 'Previous month',
+       'mois_suivant' => 'Next month',
+
+       // P
+       'pages' => 'Pages'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_es.php b/www/plugins/spip-bonux-3/lang/spip_bonux_es.php
new file mode 100644 (file)
index 0000000..8899e18
--- /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=es
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Mostrar el calendario',
+       'annee_precedente' => 'Año anterior',
+       'annee_suivante' => 'Año siguiente',
+       'annuler_recherche' => 'Cancelar la búsqueda',
+
+       // B
+       'bouton_fermer' => 'Cerrar',
+
+       // E
+       'erreur_date' => 'Esta fecha es incorrecta',
+       'erreur_date_corrigee' => 'La fecha ha sido corregida',
+       'erreur_heure' => 'Esta hora es incorrecta',
+       'erreur_heure_corrigee' => 'La hora ha sido corregida',
+
+       // I
+       'id_rapide' => 'Añadido rápido',
+
+       // M
+       'mois_precedent' => 'Mes anterior',
+       'mois_suivant' => 'Mes siguiente',
+
+       // P
+       'pages' => 'Páginas'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_fr.php b/www/plugins/spip-bonux-3/lang/spip_bonux_fr.php
new file mode 100644 (file)
index 0000000..002ec6f
--- /dev/null
@@ -0,0 +1,34 @@
+<?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;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Afficher le calendrier',
+       'annee_precedente' => 'Anée précédente',
+       'annee_suivante' => 'Année suivante',
+       'annuler_recherche' => 'Annuler la recherche',
+
+       // B
+       'bouton_fermer' => 'Fermer',
+
+       // E
+       'erreur_date' => 'Cette date est incorrecte',
+       'erreur_date_corrigee' => 'La date a été corrigée',
+       'erreur_heure' => 'Cette heure est incorrecte',
+       'erreur_heure_corrigee' => 'L\'heure a été corrigée',
+
+       // I
+       'id_rapide' => 'Ajout rapide',
+
+       // M
+       'mois_precedent' => 'Mois précédent',
+       'mois_suivant' => 'Mois suivant',
+
+       // P
+       'pages' => 'Pages'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_ru.php b/www/plugins/spip-bonux-3/lang/spip_bonux_ru.php
new file mode 100644 (file)
index 0000000..7760ad2
--- /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=ru
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Показать календарь',
+       'annee_precedente' => 'Предыдущий год',
+       'annee_suivante' => 'Следующий год',
+       'annuler_recherche' => 'Отменить поиск',
+
+       // B
+       'bouton_fermer' => 'Закрыть',
+
+       // E
+       'erreur_date' => 'Неправильная дата',
+       'erreur_date_corrigee' => 'Дата была исправлена',
+       'erreur_heure' => 'Неправильный час',
+       'erreur_heure_corrigee' => 'Час был исправлен',
+
+       // I
+       'id_rapide' => 'Быстрое добавление',
+
+       // M
+       'mois_precedent' => 'Предыдущий месяц',
+       'mois_suivant' => 'Следующий месяц',
+
+       // P
+       'pages' => 'Страницы'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/lang/spip_bonux_sk.php b/www/plugins/spip-bonux-3/lang/spip_bonux_sk.php
new file mode 100644 (file)
index 0000000..96522f8
--- /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=sk
+// ** ne pas modifier le fichier **
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+$GLOBALS[$GLOBALS['idx_lang']] = array(
+
+       // A
+       'afficher_calendrier' => 'Zobraziť kalendár',
+       'annee_precedente' => 'Minulý rok',
+       'annee_suivante' => 'Budúci rok',
+       'annuler_recherche' => 'Zrušiť vyhľadávanie',
+
+       // B
+       'bouton_fermer' => 'Zatvoriť',
+
+       // E
+       'erreur_date' => 'Tento dátum je nesprávny',
+       'erreur_date_corrigee' => 'Dátum bol opravený',
+       'erreur_heure' => 'Tento čas je nesprávny',
+       'erreur_heure_corrigee' => 'Čas bol opravený',
+
+       // I
+       'id_rapide' => 'Rýchle pridanie',
+
+       // M
+       'mois_precedent' => 'Minulý mesiac',
+       'mois_suivant' => 'Budúci mesiac',
+
+       // P
+       'pages' => 'Stránky'
+);
+
+?>
diff --git a/www/plugins/spip-bonux-3/modeles/pagination_noancre.html b/www/plugins/spip-bonux-3/modeles/pagination_noancre.html
new file mode 100644 (file)
index 0000000..97984a5
--- /dev/null
@@ -0,0 +1,16 @@
+#SET{bornes,#ENV{page_courante}|bornes_pagination{#ENV{nombre_pages},10}}
+#SET{premiere, #GET{bornes}|reset}
+#SET{derniere, #GET{bornes}|end}
+#SET{pages,#GET{premiere}|range{#GET{derniere}}}
+#SET{separateur,#ENV{separateur,'|'}}
+[(#SET{label,[(#ENV{label}|sinon{<span class='pagination_label'><:spip_bonux:pages:></span>})]})]
+<B_pages>
+[(#GET{label})]
+[<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})]
+[<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>]
+</B_pages>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/paquet.xml b/www/plugins/spip-bonux-3/paquet.xml
new file mode 100644 (file)
index 0000000..b4909a7
--- /dev/null
@@ -0,0 +1,22 @@
+<paquet
+       prefix="spip_bonux"
+       categorie="outil"
+       version="3.0.5"
+       etat="stable"
+       compatibilite="[3.0.0-dev;3.1.*]"
+       logo="img_pack/spip-bonux.png"
+       documentation="http://www.spip-contrib.net/SPIP-Bonux"
+>      
+
+       <nom>SPIP Bonux</nom>
+       <!-- Le plugin qui lave plus SPIP que SPIP, avec des chouettes cadeaux dedans -->
+
+       <auteur>Cedric Morin</auteur>
+       <auteur>Matthieu Marcillaud</auteur>
+       <auteur>romy.tetue.net</auteur>
+
+       <copyright>2008-2013</copyright>
+
+       <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL</licence>
+       <pipeline nom="affichage_final" />
+</paquet>
diff --git a/www/plugins/spip-bonux-3/public/spip_bonux_balises.php b/www/plugins/spip-bonux-3/public/spip_bonux_balises.php
new file mode 100644 (file)
index 0000000..59bce20
--- /dev/null
@@ -0,0 +1,136 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ *
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+/**
+ * Empile un element dans un tableau declare par #SET{tableau,#ARRAY}
+ * #SET_PUSH{tableau,valeur}
+ *
+ * @param Champ $p : objet balise
+ * @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);
+
+       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
+               $p->code = "''";
+
+       $p->interdire_scripts = false; // la balise ne renvoie rien
+       return $p;
+}
+
+/**
+ * Si 3 arguments : Cree un tableau nom_tableau de t1 + t2
+ * #SET_MERGE{nom_tableau,t1,t2}
+ * #SET_MERGE{nom_tableau,#GET{tableau},#ARRAY{cle,valeur}}
+ *
+ * Si 2 arguments : Merge t1 dans nom_tableau
+ * #SET_MERGE{nom_tableau,t1}
+ * #SET_MERGE{nom_tableau,#GET{tableau}}
+ *
+ * @param Champ $p : objet balise
+ * @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);
+
+       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)
+               // 3 arguments : merge de $_t1 et $_t2 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(\$new1=$_t1)?'':\$new1=array(\$new1))
+                       . vide(is_array(\$new2=$_t2)?'':\$new2=array(\$new2))
+                       . vide(\$Pile['vars'][\$cle] = array_merge(\$new1,\$new2)))";
+       else
+               $p->code = "''";
+
+       $p->interdire_scripts = false; // la balise ne renvoie rien
+       return $p;
+}
+
+/**
+ * Balise #COMPTEUR associee au critere compteur
+ *
+ * @param Champ $p
+ * @return Champ
+ */
+function balise_COMPTEUR_dist($p) {
+       calculer_balise_criteres('compteur', $p);
+       if ($p->code=="''")
+               calculer_balise_criteres('compteur', $p, "compteur_left");
+       return $p;
+}
+
+/** Balise #SOMME associee au critere somme */
+function balise_SOMME_dist($p) {
+       return calculer_balise_criteres('somme', $p);
+}
+
+/** Balise #COMPTE associee au critere compte */
+function balise_COMPTE_dist($p) {
+       return calculer_balise_criteres('compte', $p);
+}
+
+/** Balise #MOYENNE associee au critere moyenne */
+function balise_MOYENNE_dist($p) {
+       return calculer_balise_criteres('moyenne', $p);
+}
+
+/** Balise #MINIMUM associee au critere moyenne */
+function balise_MINIMUM_dist($p) {
+       return calculer_balise_criteres('minimum', $p);
+}
+
+/** Balise #MAXIMUM associee au critere moyenne */
+function balise_MAXIMUM_dist($p) {
+       return calculer_balise_criteres('maximum', $p);
+}
+
+/** Balise #STATS associee au critere stats
+ * #STATS{id_article,moyenne}
+ */
+function balise_STATS_dist($p) {
+       if (isset($p->param[0][2][0])
+       AND $nom = ($p->param[0][2][0]->texte)) {
+               return calculer_balise_criteres($nom, $p, 'stats');
+       }
+       return $p;
+}
+
+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)) {
+               return rindex_pile($p, $nom."_$champ", $motif);
+       }
+  return $p;
+}
+
+?>
diff --git a/www/plugins/spip-bonux-3/public/spip_bonux_criteres.php b/www/plugins/spip-bonux-3/public/spip_bonux_criteres.php
new file mode 100644 (file)
index 0000000..2fd43e0
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ * 
+ */
+
+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
+ */
+function critere_compteur($idb, &$boucles, $crit, $left=false){
+       $boucle = &$boucles[$idb];
+
+       $_fusion = calculer_liste($crit->param[1], array(), $boucles, $boucle->id_parent);
+       $params = $crit->param;
+       $table = reset($params);
+       $table = $table[0]->texte;
+       $op = false;
+       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];
+       }
+       $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)
+               $type_id = $types[0];
+       $table_sql = table_objet_sql($type);
+
+       $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!="''"){
+                       // 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)
+                                       unset($boucle->group[$k]);
+                       $boucle->group[] = '".($gb='.$_fusion.')."';
+               }
+
+               $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)){
+                                       $boucle->from_type[$k] = 'left';
+                               }
+                       }
+               }
+       }
+}
+
+/**
+ * {compteur_left xxx} permet de faire la meme chose que {compteur xxx}
+ * mais avec un LEFT JOIN pour ne pas ignorer ceux qui ont un compteur nul
+ * @param <type> $idb
+ * @param <type> $boucles
+ * @param <type> $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){
+       calcul_critere_fonctions(array('SUM'=>'somme'), $idb, $boucles, $crit);
+}
+
+/**  Critere {compte champ} #COMPTE{champ} */
+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){
+       calcul_critere_fonctions(array('AVG'=>'moyenne'), $idb, $boucles, $crit);
+}
+
+/**  Critere {minimum champ} #MINIMUM{champ} */
+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){
+       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){
+       calcul_critere_fonctions(array(
+               'SUM'=>'somme',
+               'COUNT'=>'compte',
+               'AVG'=>'moyenne',
+               'MIN'=>'minimum',
+               'MAX'=>'maximum',
+       ), $idb, $boucles, $crit);
+}
+
+/* $func : array(FUNC => balise) */
+function calcul_critere_fonctions($func, $idb, &$boucles, $crit) {
+       $boucle = &$boucles[$idb];
+
+       $params = $crit->param;
+       $champ = reset($params);
+       $champ = $champ[0]->texte;
+
+       // option DISTINCT {compte DISTINCT(id_article) }
+       $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";
+       }
+}
+
+
+?>
diff --git a/www/plugins/spip-bonux-3/spip_bonux_fonctions.php b/www/plugins/spip-bonux-3/spip_bonux_fonctions.php
new file mode 100644 (file)
index 0000000..c3b7411
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ * 
+ */
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+include_spip('public/spip_bonux_criteres');
+include_spip('public/spip_bonux_balises');
+
+/**
+ * une fonction pour generer une balise img a partir d'un nom de fichier
+ *
+ * @param string $img
+ * @param string $alt
+ * @param string $class
+ * @return string
+ */
+function tag_img($img,$alt="",$class=""){
+       $balise_img = chercher_filtre('balise_img');
+       return $balise_img($img,$alt,$class);
+}
+
+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))
+                       return true;
+       } while ($old++<$validite);
+       return false;
+}
+function previsu_cle_temporaire($date=null){
+       include_spip('inc/securiser_action');
+       if (!$date) $date = date('Y-m-d H');
+       $url = self();
+       $cle = md5($url.$date.secret_du_site());
+       return $cle;
+}
+
+?>
diff --git a/www/plugins/spip-bonux-3/spip_bonux_options.php b/www/plugins/spip-bonux-3/spip_bonux_options.php
new file mode 100644 (file)
index 0000000..fd09065
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/**
+ * Plugin Spip-Bonux
+ * Le plugin qui lave plus SPIP que SPIP
+ * (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
+ * Licence GPL
+ * 
+ */
+
+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);
+       }
+}
+
+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);
+       }
+       return $flux;
+}
+
+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()
+ * si non applique typo() suivant le mode choisi
+ *
+ * @param unknown_type $valeur Une valeur à tester. Si c'est un tableau, la fonction s'appliquera récursivement dessus.
+ * @param string $mode_typo Le mode d'application de la fonction typo(), avec trois valeurs possibles "toujours", "jamais" ou "multi".
+ * @return unknown_type Retourne la valeur éventuellement modifiée.
+ */
+if (!function_exists('_T_ou_typo')) {
+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)){
+               // Si la chaine est du type <:truc:> on passe à _T()
+               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')))
+                               $mode_typo = 'toujours';
+                       
+                       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){
+                       $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.
+ *
+ * La fonction garde autant que possible les associations entre les clés. Elle fonctionnera donc aussi bien
+ * avec des tableaux à index numérique que des tableaux associatifs.
+ * Attention tout de même, elle utilise array_merge() donc les valeurs de clés étant en conflits seront écrasées.
+ *
+ * @param array $arr1 Tableau dans lequel se fera l'insertion
+ * @param unknown_type $cle Clé de $arr1 après (ou avant) laquelle se fera l'insertion
+ * @param array $arr2 Tableau contenant les valeurs à insérer
+ * @param bool $avant Indique si l'insertion se fait avant la clé (par défaut c'est après)
+ * @return array Retourne le tableau avec l'insertion
+ */
+if (!function_exists('array_insert')) {
+function array_insert($arr1, $cle, $arr2, $avant=false){
+       $index = array_search($cle, array_keys($arr1));
+       if($index === false){
+               $index = count($arr1); // insert @ end of array if $key not found
+       }
+       else {
+               if(!$avant){
+                       $index++;
+               }
+       }
+       $fin = array_splice($arr1, $index);
+       return array_merge($arr1, $arr2, $fin);
+}
+}
+
+/*
+ * 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){
+                               // create new key in $array, if it is empty or not an array
+                               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))
+                                       $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))
+                       return $array;
+               
+               for ($i = 1; $i < count($args); $i++)
+                       if (is_array($args[$i]))
+                               $array = recurse($array, $args[$i]);
+               
+               return $array;
+       }
+}
+
+
+?>
diff --git a/www/plugins/spip-bonux-3/svn.revision b/www/plugins/spip-bonux-3/svn.revision
new file mode 100644 (file)
index 0000000..50f6416
--- /dev/null
@@ -0,0 +1,10 @@
+<svn_revision>
+<text_version>
+Origine: file:///home/svn/repository/spip-zone/_plugins_/spip-bonux-3
+Revision: 71958
+Dernier commit: 2013-04-11 18:00:24 +0200 
+</text_version>
+<origine>file:///home/svn/repository/spip-zone/_plugins_/spip-bonux-3</origine>
+<revision>71958</revision>
+<commit>2013-04-11 18:00:24 +0200 </commit>
+</svn_revision>
\ No newline at end of file
diff --git a/www/plugins/spip-bonux-3/tests/balises/set_merge.html b/www/plugins/spip-bonux-3/tests/balises/set_merge.html
new file mode 100644 (file)
index 0000000..86b149f
--- /dev/null
@@ -0,0 +1,60 @@
+[(#REM)
+
+       la balise SET_MERGE sert a merger des valeurs dans un tableau #SET
+       #SET_MERGE{tab,t1} : merge tab et t1 dans tab
+       #SET_MERGE{tab,t1,t2} : merge t1 et t2 dans tab
+]
+
+[(#REM) ----- 2 arguments ------ ]
+[(#REM) 
+       SET SET+GET|merge = SET MERGE
+]
+       #SET{Aa,#ARRAY{a,aaa}} #SET{Aaa,#ARRAY{a,aaa}}
+       #SET{Ab,#ARRAY{b,bbb}}
+       [(#SET{Ac,[(#GET{Aa}|array_merge{#GET{Ab}})]})]
+       #SET_MERGE{Aaa,#GET{Ab}}
+       [(#GET{Ac}|!=={#GET{Aaa}}|oui)[(#SET{err,"Aaa et Ac sont differents"})]]
+
+
+[(#REM) 
+       SET_MERGE peut etre fait sans declarer un SET prealable
+]
+       #SET{Ba,#ARRAY{a,aaa}}
+       #SET_MERGE{Bb,#GET{Ba}}
+       [(#GET{Ba}|!=={#GET{Bb}}|oui)[(#SET{err,"Ba et Bb sont différents"})]]
+
+[(#REM) 
+       Si une chaine est donnee a MERGE, elle est transformee en tableau
+]
+       #SET_MERGE{C,coucou}
+       [(#GET{C}|!=={#ARRAY{0,coucou}})[(#SET{err,"(C) String non compris par #SET_MERGE"})]]
+
+
+[(#REM) ----- 3 arguments ------ ]
+[(#REM) 
+       SET SET+GET|merge = SET MERGE
+]
+       #SET{Fa,#ARRAY{a,aaa}}
+       #SET{Fb,#ARRAY{b,bbb}}
+       [(#SET{Fc,[(#GET{Fa}|array_merge{#GET{Fb}})]})]
+       #SET_MERGE{Fd,#GET{Fa},#GET{Fb}}
+       [(#GET{Fc}|!=={#GET{Fd}}|oui)[(#SET{err,"Fc et Fd sont differents"})]]
+       
+       
+[(#REM) 
+       MERGE peut etre fait sans declarer un SET prealable
+]
+       #SET{Ga,#ARRAY{a,aaa}}
+       #SET{Gb,#ARRAY{b,bbb}}
+       [(#SET{Gc,[(#GET{Ga}|array_merge{#GET{Gb}})]})]
+       #SET_MERGE{Gd,#GET{Ga},#GET{Gb}}
+       [(#GET{Gc}|!=={#GET{Gd}}|oui)[(#SET{err,"Gc et Gd sont différents"})]]
+
+
+[(#REM) 
+       Si une chaine est donnee a MERGE, elle est transformee en tableau
+]
+       #SET_MERGE{H,coucou,toutou}
+       [(#GET{H}|!=={#ARRAY{0,coucou,1,toutou}})[(#SET{err,"(H) String non compris par #SET_MERGE"})]]
+
+[(#GET{err}|?{ERREUR,OK}) #GET{err} ]
diff --git a/www/plugins/spip-bonux-3/tests/balises/set_push.html b/www/plugins/spip-bonux-3/tests/balises/set_push.html
new file mode 100644 (file)
index 0000000..74bc38e
--- /dev/null
@@ -0,0 +1,25 @@
+[(#REM)
+
+       la balise SET_PUSH sert a ajouter des valeurs dans un tableau #SET
+
+]
+
+[(#REM) 
+       SET GET|push = SET PUSH 
+]
+       #SET{A,#ARRAY}
+       #SET{B,#ARRAY}
+       [(#SET{A,[(#GET{A}|push{abc})]})]
+       #SET_PUSH{B,abc}
+       [(#GET{A}|!=={#GET{B}}|oui)[(#SET{err,"A et B sont différents"})]]
+
+
+[(#REM) 
+       SET_PUSH peut être fait sans declarer un SET prealable
+]
+       #SET_PUSH{C,abc}
+       [(#GET{A}|!=={#GET{C}}|oui)[(#SET{err,"A et C sont différents"})]]
+
+
+
+[(#GET{err}|?{ERREUR,OK}) #GET{err} ]