[SPIP Zone] r4864 - in /_plugins_/_ze_laboratoire_/tableless_barre: ./ inc/ inc/barre.php plugin.xml tableless_barre.css tableless_barre_pipelines.php

Author: renatoformato@virgilio.it
Date: Fri Aug 25 21:26:30 2006
New Revision: 4864

Log:
tableless shortcut toolbar

Added:
    _plugins_/_ze_laboratoire_/tableless_barre/
    _plugins_/_ze_laboratoire_/tableless_barre/inc/
    _plugins_/_ze_laboratoire_/tableless_barre/inc/barre.php
    _plugins_/_ze_laboratoire_/tableless_barre/plugin.xml
    _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre.css
    _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre_pipelines.php

Added: _plugins_/_ze_laboratoire_/tableless_barre/inc/barre.php

--- _plugins_/_ze_laboratoire_/tableless_barre/inc/barre.php (added)
+++ _plugins_/_ze_laboratoire_/tableless_barre/inc/barre.php Fri Aug 25 21:26:30 2006
@@ -0,0 +1,135 @@
+<?php
+
+/***************************************************************************\
+ * SPIP, Systeme de publication pour l'internet *
+ * *
+ * Copyright (c) 2001-2006 *
+ * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
+ * *
+ * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
+ * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
+\***************************************************************************/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+// construit un bouton (ancre) de raccourci avec icone et aide
+
+// http://doc.spip.org/@bouton_barre_racc
+function bouton_barre_racc($action, $img, $help, $champhelp) {
+
+ $a = attribut_html($help);
+ return "<a\nhref=\"javascript:"
+ .$action
+ ."\" tabindex='1000'\ntitle=\""
+ . $a
+ ."\""
+ .(!_DIR_RESTREINT ? '' : "\nonmouseover=\"helpline('"
+ .addslashes($a)
+ ."',$champhelp)\"\nonmouseout=\"helpline('"
+ .attribut_html(_T('barre_aide'))
+ ."', $champhelp)\"")
+ ."><img\nsrc='"
+ ._DIR_IMG_ICONES_BARRE
+ .$img
+ ."' height='16' width='16' align='middle' /></a>";
+}
+
+// construit un tableau de raccourcis pour un noeud de DOM
+
+// http://doc.spip.org/@afficher_barre
+function afficher_barre($champ, $forum=false, $lang='') {
+ global $spip_lang, $spip_lang_right, $spip_lang_left, $spip_lang;
+ static $num_barre = 0;
+ include_spip('inc/layer');
+ if (!$GLOBALS['browser_barre']) return '';
+ if (!$lang) $lang = $spip_lang;
+ $num_barre++;
+ $champhelp = "document.getElementById('barre_$num_barre')";
+
+ $ret = ($num_barre > 1) ? '' :
+ '<script type="text/javascript" src="' . _DIR_IMG_PACK. 'spip_barre.js"></script>';
+ $ret .= "<div class='spip_barre'>";
+ $ret .= "\n<div class='spip_barre_row'>";
+ $ret .= "\n<span style='text-align: $spip_lang_left;'>";
+ $col = 1;
+
+ // Italique, gras, intertitres
+ $ret .= bouton_barre_racc ("barre_raccourci('{','}',$champ)", "italique.png", _T('barre_italic'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_raccourci('{{','}}',$champ)", "gras.png", _T('barre_gras'), $champhelp);
+ if (!$forum) {
+ $ret .= bouton_barre_racc ("barre_raccourci('\n\n{{{','}}}\n\n',$champ)", "intertitre.png", _T('barre_intertitre'), $champhelp);
+ }
+ $ret .= "</span>\n<span>";
+ $col ++;
+
+ // Lien hypertexte, notes de bas de page, citations
+ $js = addslashes(_T('barre_lien_input'));
+ $ret .= bouton_barre_racc ("barre_demande('[','->',']', '$js', $champ)",
+ "lien.png", _T('barre_lien'), $champhelp);
+ if (!$forum) {
+ $ret .= bouton_barre_racc ("barre_raccourci('[[',']]',$champ)", "notes.png", _T('barre_note'), $champhelp);
+ } else {
+ $col ++;
+ $ret .= "</span>\n<span>"
+ . bouton_barre_racc ("barre_raccourci('\n\n&lt;quote&gt;','&lt;/quote&gt;\n\n',$champ)", "quote.png", _T('barre_quote'), $champhelp);
+ }
+
+ $ret .= "</span>";
+ $col++;
+
+ // Insertion de caracteres difficiles a taper au clavier (guillemets, majuscules accentuees...)
+ $ret .= "\n<span style='text-align: $spip_lang_left;'>";
+ $col++;
+ if ($lang == "fr" OR $lang == "eo" OR $lang == "cpf" OR $lang == "ar" OR $lang == "es") {
+ $ret .= bouton_barre_racc ("barre_raccourci('&laquo;','&raquo;',$champ)", "guillemets.png", _T('barre_guillemets'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_raccourci('&ldquo;','&rdquo;',$champ)", "guillemets-simples.png", _T('barre_guillemets_simples'), $champhelp);
+ }
+ else if ($lang == "bg" OR $lang == "de" OR $lang == "pl" OR $lang == "hr" OR $lang == "src") {
+ $ret .= bouton_barre_racc ("barre_raccourci('&bdquo;','&ldquo;',$champ)", "guillemets-de.png", _T('barre_guillemets'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_raccourci('&sbquo;','&lsquo;',$champ)", "guillemets-uniques-de.png", _T('barre_guillemets_simples'), $champhelp);
+ }
+ else {
+ $ret .= bouton_barre_racc ("barre_raccourci('&ldquo;','&rdquo;',$champ)", "guillemets-simples.png", _T('barre_guillemets'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_raccourci('&lsquo;','&rsquo;',$champ)", "guillemets-uniques.png", _T('barre_guillemets_simples'), $champhelp);
+ }
+ if ($lang == "fr" OR $lang == "eo" OR $lang == "cpf") {
+ $ret .= bouton_barre_racc ("barre_inserer('&Agrave;',$champ)", "agrave-maj.png", _T('barre_a_accent_grave'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_inserer('&Eacute;',$champ)", "eacute-maj.png", _T('barre_e_accent_aigu'), $champhelp);
+ if ($lang == "fr") {
+ $ret .= bouton_barre_racc ("barre_inserer('&oelig;',$champ)", "oelig.png", _T('barre_eo'), $champhelp);
+ $ret .= bouton_barre_racc ("barre_inserer('&OElig;',$champ)", "oelig-maj.png", _T('barre_eo_maj'), $champhelp);
+ }
+ }
+ $ret .= bouton_barre_racc ("barre_inserer('&euro;',$champ)", "euro.png", _T('barre_euro'), $champhelp);
+
+ $ret .= "</span>";
+ $col++;
+
+ if (!_DIR_RESTREINT) {
+ $ret .= "\n<span style='text-align:$spip_lang_right;'>";
+ $col++;
+ // $ret .= "&nbsp;&nbsp;&nbsp;";
+ $ret .= aide("raccourcis");
+ $ret .= "&nbsp;";
+ $ret .= "</span>";
+ }
+ $ret .= "</div>";
+
+ // Sur les forums publics, petite barre d'aide en survol des icones
+ if (_DIR_RESTREINT)
+ $ret .= "\n<div class='spip_barre_row'>\n<span><input disabled='disabled' type='text' class='barre' id='barre_$num_barre' size='45' maxlength='100'\nvalue=\"".attribut_html(_T('barre_aide'))."\" /></span></div>";
+
+ $ret .= "</div>";
+
+ return $ret;
+}
+
+// pour compatibilite arriere. utiliser directement le corps a present.
+
+// http://doc.spip.org/@afficher_claret
+function afficher_claret() {
+ include_spip('inc/layer');
+ return $GLOBALS['browser_caret'];
+}
+
+?>

Added: _plugins_/_ze_laboratoire_/tableless_barre/plugin.xml

--- _plugins_/_ze_laboratoire_/tableless_barre/plugin.xml (added)
+++ _plugins_/_ze_laboratoire_/tableless_barre/plugin.xml Fri Aug 25 21:26:30 2006
@@ -0,0 +1 @@
+<plugin>
  <nom> <!-- Nom du plugin -->
  Tableless shortcut toolbar
  </nom>
  <auteur> <!-- Auteur du plugin -->
  [Renato Formato->mailto:renatoformato@virgilio.it]
  </auteur>
  <version>
  0.1
  </version>
  <etat>
  dev
  </etat>
  <description>
  <multi>[it]La barra delle scorciatoie senza tabelle
  [en]Shortcut toolbar without table elements</multi>
  </description>
  <prefix>
  tableless_barre
  </prefix>
  <pipeline>
    <nom>header_prive</nom>
    <inclure>tableless_barre_pipelines.php</inclure>
  </pipeline>
</plugin>
\ No newline at end of file

Added: _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre.css

--- _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre.css (added)
+++ _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre.css Fri Aug 25 21:26:30 2006
@@ -0,0 +1,25 @@
+.spip_barre {display:table;width:100%;border-right: 1px solid #C0CAD4;border-top: 1px solid #C0CAD4;}
+.spip_barre_row {display:table-row;}
+.spip_barre_row span {
+ display:table-cell;
+ vertical-align:middle;
+ text-align: left;
+ border-left: 1px solid #C0CAD4;
+}
+/*IE ruins all the plans, as always. The width depends on the number of span in the toolbar.
+this number (25%=100/4 span) has to be changed by those who want to override inc/barre.php and add more span*/
+* html .spip_barre_row span {
+ display:inline-block;
+ width:25%;
+ margin-right:-4px;
+ height:100%
+}
+.spip_barre_row a img {
+ padding: 3px;
+ margin: 0;
+ background-color: #eee;
+ border-right: 1px solid #C0CAD4;
+}
+.spip_barre_row a:hover img {
+ background-color: #fff;
+}

Added: _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre_pipelines.php

--- _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre_pipelines.php (added)
+++ _plugins_/_ze_laboratoire_/tableless_barre/tableless_barre_pipelines.php Fri Aug 25 21:26:30 2006
@@ -0,0 +1,7 @@
+<?php
+
+function tableless_barre_header_prive($flux){
+ $flux .= '<link rel="stylesheet" href="'.find_in_path('tableless_barre.css').'" type="text/css" media="projection, screen" />';
+ return $flux;
+}
+?>