[ Index ] |
|
Code source de SPIP 1.9.2c |
1 <?php 2 3 /***************************************************************************\ 4 * SPIP, Systeme de publication pour l'internet * 5 * * 6 * Copyright (c) 2001-2007 * 7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * 8 * * 9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * 10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * 11 \***************************************************************************/ 12 13 if (!defined("_ECRIRE_INC_VERSION")) return; 14 15 include_spip('inc/presentation'); 16 17 // http://doc.spip.org/@exec_brouteur_dist 18 function exec_brouteur_dist() 19 { 20 global $spip_ecran, $spip_lang_left; 21 22 $id_rubrique = intval(_request('id_rubrique')); 23 24 if ($spip_ecran == "large") { 25 $largeur_table = 974; 26 $hauteur_table = 400; 27 $nb_col = 4; 28 } else { 29 $largeur_table = 750; 30 $hauteur_table = 300; 31 $nb_col = 3; 32 } 33 $largeur_col = round($largeur_table/$nb_col); 34 35 $commencer_page = charger_fonction('commencer_page', 'inc'); 36 echo $commencer_page(_T('titre_page_articles_tous'), "accueil", "tout-site", " hauteurFrame($nb_col);"); 37 38 echo "\n<div> </div>"; 39 40 echo "\n<table border='0' cellpadding='0' cellspacing='2' width='$largeur_table'>"; 41 42 if ($id_rubrique) { 43 $j = $nb_col; 44 while ($id_rubrique > 0) { 45 $result=spip_query("SELECT id_parent FROM spip_rubriques WHERE id_rubrique='$id_rubrique'"); 46 if ($row=spip_fetch_array($result)){ 47 $j--; 48 $dest[$j] = $id_rubrique; 49 $id_rubrique =$row['id_parent']; 50 } 51 } 52 $dest[$j-1] = 0; 53 54 while (!$dest[1]) { 55 for ($i = 0; $i < $nb_col; $i++) { 56 $dest[$i] = $dest[$i+1]; 57 } 58 } 59 60 if ($dest[0] > 0 AND $dest[$nb_col-2]) { 61 62 $la_rubrique = $dest[0]; 63 64 $result = spip_query("SELECT id_parent FROM spip_rubriques WHERE id_rubrique ='$la_rubrique'"); 65 if ($row = spip_fetch_array($result)) { 66 $la_rubrique =$row['id_parent']; 67 } 68 69 $compteur = 0; 70 $ret = ''; 71 while ($la_rubrique > 0) { 72 $result = spip_query("SELECT * FROM spip_rubriques WHERE id_rubrique ='$la_rubrique'"); 73 if ($row = spip_fetch_array($result)) { 74 $compteur++; 75 $titre = typo($row['titre']); 76 $la_rubrique =$row['id_parent']; 77 $lien = $dest[$nb_col-$compteur-1]; 78 if ($la_rubrique == 0) $icone = "secteur-24.gif"; 79 else $icone = "rubrique-24.gif"; 80 $ret = "\n<div " . 81 http_style_background($icone, 82 "$spip_lang_left no-repeat; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px") . "><a href='" . generer_url_ecrire("brouteur","id_rubrique=$lien") . "'>$titre</a></div>\n<div style='margin-$spip_lang_left: 28px;'>$ret</div>"; 83 } 84 } 85 $lien = $dest[$nb_col-$compteur-2]; 86 87 // Afficher la hierarchie pour "remonter" 88 echo "<tr><td colspan='$nb_col' style='text-align: $spip_lang_left;'>"; 89 90 echo "<div id='brouteur_hierarchie'>"; // pour calculer hauteur de iframe 91 echo "<div ", 92 http_style_background("racine-site-24.gif", 93 "$spip_lang_left no-repeat; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"), 94 "><a href='", 95 generer_url_ecrire("brouteur","id_rubrique=$lien"), 96 "'>", 97 _T('info_racine_site'), 98 "</a></div>", 99 "\n<div style='margin-$spip_lang_left: 28px;'>$ret</div>", 100 "</div>"; 101 echo "</div></td></tr>"; 102 } 103 } else { 104 $dest[0] = '0'; 105 } 106 107 echo "\n<tr>"; 108 109 for ($i=0; $i < $nb_col; $i++) { 110 echo "\n<td valign='top' width='$largeur_col'>"; 111 112 echo "<iframe width='100%' id='iframe$i' name='iframe$i'", 113 (" src='" . generer_url_ecrire('brouteur_frame',"rubrique=".$dest[$i]."&frame=$i'")), 114 " class='iframe-brouteur' height='", 115 $hauteur_table, 116 "'></iframe>"; 117 118 echo "</td>"; 119 } 120 echo "\n</tr></table>"; 121 122 // fixer la hauteur du brouteur de maniere a remplir l'ecran 123 // nota: code tire du plugin dimensions.js 124 echo "<script type='text/javascript'><!-- 125 jQuery('iframe.iframe-brouteur').height( 126 Math.max((window.innerHeight || jQuery.boxModel && document.documentElement.clientHeight || document.body.clientHeight || 0)-195,300) 127 ); 128 //--></script>\n"; 129 echo fin_page(); 130 } 131 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |