Author: cedric@yterium.com
Date: Tue Aug 8 19:45:52 2006
New Revision: 4444
Log:
bon ben voila, le chantier est ouvert ...
on commence par le menu rubriques en squelette. Quelques raccords a faire mais le principe y est...
Added:
_plugins_/_ze_laboratoire_/spiip/
_plugins_/_ze_laboratoire_/spiip/dist_back/
_plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.css
_plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.js
_plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html
_plugins_/_ze_laboratoire_/spiip/dist_back/rightarrow2.gif (with props)
_plugins_/_ze_laboratoire_/spiip/inc/
_plugins_/_ze_laboratoire_/spiip/inc/gadgets.php
_plugins_/_ze_laboratoire_/spiip/plugin.xml
_plugins_/_ze_laboratoire_/spiip/spiip_options.php
_plugins_/_ze_laboratoire_/spiip/spiip_pipelines.php
Added: _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.css
--- _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.css (added)
+++ _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.css Tue Aug 8 19:45:52 2006
@@ -0,0 +1,89 @@
+#nav-container{
+ font-size:76%;
+ }
+#nav, #nav ul {
+ float: left;
+ width: 100%;
+ list-style: none;
+ line-height: 1;
+ background: white;
+ font-weight: bold;
+ padding: 0;
+ border: solid #eda;
+ border-width: 1px 0;
+ margin: 0 0 1em 0;
+ text-align:left;
+}
+
+#nav a {
+ display: block;
+ width: 10em;
+ w\idth: 6em;
+ color: #7C6240;
+ text-decoration: none;
+ padding: 0.25em 2em;
+}
+
+#nav a.daddy {
+ background: url(rightarrow2.gif) center right no-repeat;
+}
+
+#nav li {
+ float: left;
+ padding: 0;
+ width: 10em;
+}
+
+#nav li ul {
+ position: absolute;
+ left: -999em;
+ height: auto;
+ width: 14.4em;
+ w\idth: 13.9em;
+ font-weight: normal;
+ border-width: 0.25em;
+ margin: 0;
+}
+
+#nav li li {
+ padding-right: 1em;
+ width: 13em
+}
+
+#nav li ul a {
+ width: 13em;
+ w\idth: 9em;
+}
+
+#nav li ul ul {
+ margin: -1.75em 0 0 14em;
+}
+
+#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul,
+#nav li.sfhover ul ul, #nav li.sfhover ul ul ul, #nav li.sfhover ul ul ul ul
+{
+ left: -999em;
+}
+
+
+#nav li:hover ul,
+#nav li li:hover ul,
+#nav li li li:hover ul,
+#nav li li li li:hover ul
+{
+ left: auto;
+}
+
+#nav li.sfhover ul{
+ left:auto;
+}
+#nav li li.sfhover ul,
+#nav li li li.sfhover ul,
+#nav li li li li.sfhover ul,
+{
+ left: auto;
+}
+
+#nav li:hover, #nav li.sfhover {
+ background: #eda;
+}
\ No newline at end of file
Added: _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.js
--- _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.js (added)
+++ _plugins_/_ze_laboratoire_/spiip/dist_back/gadget-rubriques.js Tue Aug 8 19:45:52 2006
@@ -0,0 +1,25 @@
+/*
+ * Javascript pour le menu deroulant sur MSIE
+ *
+ * adapte de http://www.htmldog.com/articles/suckerfish/dropdowns/example/
+ *
+ */
+/*sfHover = function() {
+ var sfEls = document.getElementById("nav").getElementsByTagName("li");
+ for (var i=0; i<sfEls.length; i++) {
+ sfEls[i].onmouseover=function() {
+ this.className+=" sfhover";
+ }
+ sfEls[i].onmouseout=function() {
+ this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+ }
+ }
+}*/
+//if (window.attachEvent) window.attachEvent("onload", sfHover);
+
+$(document).ready(function(){
+ $('li',document.getElementById("nav")).hover(
+ function(){$(this).addClass('sfhover')},
+ function(){$(this).removeClass('sfhover')}
+ );
+});
\ No newline at end of file
Added: _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html
--- _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html (added)
+++ _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html Tue Aug 8 19:45:52 2006
@@ -0,0 +1,5 @@
+<div id='nav-container'>
+<B_rubriques><div id="nav"><ul><li>Gadget<ul><li><a href='#URL_ECRIRE{articles_tous}'><:info_tout_site:></a></li>
+<BOUCLE_rubriques(RUBRIQUES) {racine} {par num titre, titre}><li><a href="#URL_ECRIRE{naviguer,id_rubrique=#ID_RUBRIQUE}" class="intitule<BOUCLE_test_soussect(RUBRIQUES){id_parent}{0,1}> daddy</BOUCLE_test_soussect>">[(#TITRE|supprimer_numero|couper{80})]</a>
+<B_sous_rubriques><ul><BOUCLE_sous_rubriques(RUBRIQUES) {id_parent} {par num titre, titre}><li><a href="#URL_ECRIRE{naviguer,id_rubrique=#ID_RUBRIQUE}"<BOUCLE_test_sousrub(RUBRIQUES){id_parent}{0,1}>class='daddy'</BOUCLE_test_sousrub>>[(#TITRE|supprimer_numero|couper{80})]</a><BOUCLE_re(BOUCLE_sous_rubriques)></BOUCLE_re></li></BOUCLE_sous_rubriques></ul></B_sous_rubriques>
+</li></BOUCLE_rubriques></ul></li></ul></div></B_rubriques></div>
\ No newline at end of file
Added: _plugins_/_ze_laboratoire_/spiip/dist_back/rightarrow2.gif
Binary file - no diff available.
Propchange: _plugins_/_ze_laboratoire_/spiip/dist_back/rightarrow2.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php
--- _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php (added)
+++ _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php Tue Aug 8 19:45:52 2006
@@ -0,0 +1,482 @@
+<?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;
+
+include_spip('inc/presentation');
+
+//
+// Le bandeau des gadgets s'affiche en deux temps :
+// 1. On affiche un minimum de <div> permettant aux boutons de jouer
+// du on/off au survol
+// -> fonction bandeau_gadgets()
+// 2. En fin de page on envoie le vrai contenu (bien lourd) via innerHTML
+// -> fonction dessiner_gadgets()
+//
+
+
+//
+// GADGET DES RUBRIQUES
+//
+function extraire_article($id_p) {
+ if (array_key_exists($id_p, $GLOBALS['db_art_cache'])) {
+ return $GLOBALS['db_art_cache'][$id_p];
+ } else {
+ return array();
+ }
+}
+
+function gen_liste_rubriques() {
+ // ici, un petit fichier cache ne fait pas de mal
+ if (lire_fichier(_DIR_SESSIONS.'cache-menu-rubriques.txt', $cache)
+ AND list($date,$GLOBALS['db_art_cache']) = @unserialize($cache)
+ AND $date == $GLOBALS['meta']["date_calcul_rubriques"])
+ return; // c'etait en cache 
+
+ // se restreindre aux rubriques utilisees recemment +secteurs
+ $liste="0";
+ $s = spip_query("SELECT id_rubrique FROM spip_rubriques ORDER BY id_parent=0 DESC, date DESC LIMIT 500");
+ while ($t = spip_fetch_array($s))
+ $liste .=",".$t['id_rubrique'];
+
+ $res = spip_query("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE id_rubrique IN ($liste) ORDER BY id_parent,0+titre,titre");
+
+ $GLOBALS['db_art_cache'] = array();
+ if (spip_num_rows($res) > 0) {
+ while ($row = spip_fetch_array($res)) {
+ $parent = $row['id_parent'];
+ $id = $row['id_rubrique'];
+ $GLOBALS['db_art_cache'][$parent][$id] =
+ supprimer_numero(typo(sinon($row['titre'], _T('ecrire:info_sans_titre'))));
+ }
+ }
+
+ // ecrire dans le cache
+ ecrire_fichier(_DIR_SESSIONS.'cache-menu-rubriques.txt',
+ serialize(array(
+ $GLOBALS['meta']["date_calcul_rubriques"],
+ $GLOBALS['db_art_cache']
+ ))
+ );
+}
+
+
+function gadget_rubriques() {
+ include_spip('public/assembler');
+ $contexte = array('lang' => 'fr');
+ $page = recuperer_fond('dist_back/inc-gadget-rubriques', $contexte);
+ return $page;
+
+ global $max_lignes;
+
+ gen_liste_rubriques();
+ $arr_low = extraire_article(0);
+
+ $total_lignes = $i = sizeof($arr_low);
+
+ $nb_col = min(10,max(1,ceil($total_lignes / 10)));
+ $max_lignes = ceil($total_lignes / $nb_col);
+
+ $count_lignes = 0;
+
+ if ($i > 0) {
+ $ret = "<div> </div>";
+ $ret .= "<div class='bandeau_rubriques' style='z-index: 1;'>";
+ foreach( $arr_low as $id_rubrique => $titre_rubrique) {
+
+ if ($count_lignes == $max_lignes) {
+ $count_lignes = 0;
+ $ret .= "</div></td><td valign='top' width='200'><div> </div><div class='bandeau_rubriques' style='z-index: 1;'>";
+ }
+ $count_lignes ++;
+
+ $ret .= bandeau_rubrique($id_rubrique, $titre_rubrique, $i);
+ $i = $i - 1;
+ }
+ $ret .= "</div>";
+ }
+ unset($GLOBALS['db_art_cache']); // On libere la memoire
+
+ $ret = "<table><tr><td valign='top' width='200'>\n"
+ . $ret
+ . "\n</td></tr></table>\n";
+
+ return $ret;
+}
+
+
+function bandeau_rubrique($id_rubrique, $titre_rubrique, $z = 1) {
+ global $zdecal;
+ global $max_lignes;
+ global $spip_ecran, $spip_display;
+ global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right;
+
+ $titre_rubrique = preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique);
+ $count_ligne = 0;
+ $zdecal = $zdecal + 1;
+ // Limiter volontairement le nombre de sous-menus
+ $zmax = 6;
+
+ if ($zdecal == 1) $image = "secteur-12.gif";
+ //else $image = "rubrique-12.gif";
+ else $image = '';
+
+ if (strlen($image) > 1)
+ $image = " style='background-image:url(" . http_wrapper($image) .");'";
+
+ $arr_rub = extraire_article($id_rubrique);
+
+ $i = sizeof($arr_rub);
+ if ($i > 0 AND $zdecal < $zmax) {
[... 383 lines stripped ...]