[ 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 // 16 // Presentation de l'interface privee, debut du HTML 17 // 18 19 // http://doc.spip.org/@inc_commencer_page_dist 20 function inc_commencer_page_dist($titre = "", $rubrique = "accueil", $sous_rubrique = "accueil", $id_rubrique = "") { 21 22 include_spip('inc/headers'); 23 24 http_no_cache(); 25 26 return init_entete($titre, $id_rubrique) 27 . init_body($rubrique, $sous_rubrique, $id_rubrique) 28 . "<div id='page' align='center'>" 29 . avertissement_messagerie() 30 . ((($rubrique == "messagerie") OR (_request('changer_config')!="oui")) 31 ? auteurs_recemment_connectes() : ''); 32 } 33 34 // envoi du doctype et du <head><title>...</head> 35 // http://doc.spip.org/@init_entete 36 function init_entete($titre='', $id_rubrique=0) { 37 include_spip('inc/gadgets'); 38 39 if (!$nom_site_spip = textebrut(typo($GLOBALS['meta']["nom_site"]))) 40 $nom_site_spip= _T('info_mon_site_spip'); 41 42 $head = "<title>[" 43 . $nom_site_spip 44 . "] " . textebrut(typo($titre)) . "</title>\n" 45 . "<meta http-equiv='Content-Type' content='text/html" 46 . (($c = $GLOBALS['meta']['charset']) ? 47 "; charset=$c" : '') 48 . "' />\n" 49 . envoi_link($nom_site_spip); 50 51 // anciennement verifForm 52 $head .= ' 53 <script type="text/javascript"><!-- 54 $(document).ready(function(){ 55 verifForm(); 56 $("#page") 57 .mouseover(function(){ 58 changestyle("garder-recherche"); 59 }); 60 ' 61 . 62 repercuter_gadgets($id_rubrique) 63 .' 64 }); 65 // --></script> 66 '; 67 68 return _DOCTYPE_ECRIRE 69 . html_lang_attributes() 70 . "<head>\n" 71 . pipeline('header_prive', $head) 72 . "</head>\n"; 73 } 74 75 // fonction envoyant la double serie d'icones de redac 76 // http://doc.spip.org/@init_body 77 function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique='') { 78 global $couleur_foncee, $couleur_claire; 79 global $connect_id_auteur, $auth_can_disconnect; 80 global $options, $spip_display, $spip_ecran; 81 global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right; 82 83 if ($spip_ecran == "large") $largeur = 974; else $largeur = 750; 84 85 $res = pipeline('body_prive',"<body class='$rubrique $sous_rubrique'" 86 . ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : "") 87 .'>') 88 . "\n<div><map name='map_layout' id='map_layout'>" 89 . lien_change_var (self(), 'set_disp', 1, '1,0,18,15', _T('lien_afficher_texte_seul'), "onmouseover=\"changestyle('bandeauvide');\" onfocus=\"changestyle('bandeauvide');\" onblur=\"changestyle('bandeauvide');\"") 90 . lien_change_var (self(), 'set_disp', 2, '19,0,40,15', _T('lien_afficher_texte_icones'), "onmouseover=\"changestyle('bandeauvide');\" onfocus=\"changestyle('bandeauvide');\" onblur=\"changestyle('bandeauvide');\"") 91 . lien_change_var (self(), 'set_disp', 3, '41,0,59,15', _T('lien_afficher_icones_seuls'), "onmouseover=\"changestyle('bandeauvide');\" onfocus=\"changestyle('bandeauvide');\" onblur=\"changestyle('bandeauvide');\"") 92 . "\n</map></div>"; 93 94 if ($spip_display == "4") { 95 $res .= "<ul>" 96 . "\n<li><a href='./'>"._T('icone_a_suivre')."</a></li>" 97 . "\n<li><a href='" . generer_url_ecrire("naviguer") . "'>"._T('icone_edition_site')."</a></li>" 98 . "\n<li><a href='" . generer_url_ecrire("forum"). "'>"._T('titre_forum')."</a></li>" 99 . "\n<li><a href='" . generer_url_ecrire("auteurs") . "'>"._T('icone_auteurs')."</a></li>" 100 . "\n<li><a href=\"".url_de_base()."\">"._T('icone_visiter_site')."</a></li>" 101 . "</ul>"; 102 103 return $res; 104 } 105 106 $res .= bandeau_double_rangee($rubrique, $sous_rubrique, $largeur); 107 108 if (true /*$bandeau_colore*/) { 109 if ($rubrique == "administration") { 110 $style = "background: url(" . _DIR_IMG_PACK . "rayures-danger.png); background-color: $couleur_foncee"; 111 $res .= "<style>a.icone26 { color: white; }</style>"; 112 } else $style = "background-color: $couleur_claire"; 113 114 $res .= "\n<div align='center' style=\"max-height: 40px; width: 100%; border-bottom: solid 1px white;$style\">" 115 . "<table cellpadding='0' style='background: none;' width='$largeur'><tr>" 116 . "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>" 117 . installer_gadgets($id_rubrique) 118 . "</td>" 119 . "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>" 120 121 // Redacteur connecte 122 // overflow pour masquer les noms tres longs 123 // (et eviter debords, notamment en ecran etroit) 124 125 . "<div style='width: " 126 . (($spip_ecran == "large") ? 300 : 110) 127 . "px; height: 14px; overflow: hidden;'>" 128 . "<a href='" 129 . generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur") 130 . "' class='icone26' title=\"" 131 . entites_html(_T('icone_informations_personnelles')) 132 . '">' 133 . typo($GLOBALS['auteur_session']['nom']) 134 . "</a></div>" 135 . "</td>" 136 . "<td> </td>" 137 . "<td class='bandeau_couleur' style='text-align: $spip_lang_right;' valign='middle'>"; 138 139 // Choix display 140 // $res .="<img src=_DIR_IMG_PACK . 'rien.gif' width='10' />"; 141 if ($options != "avancees") { 142 $lien = parametre_url(self(), 'set_options', 'avancees'); 143 $icone = "interface-display-comp.png"; 144 $alt =_T('icone_interface_complet'); 145 } else { 146 $lien = parametre_url(self(), 'set_options', 'basiques'); 147 $icone = "interface-display.png"; 148 $alt =_T('icone_interface_simple'); 149 } 150 $res .= "<a href='$lien' class='icone26' onmouseover=\"changestyle('bandeaudisplay');\" onfocus=\"changestyle('bandeaudisplay');\" onblur=\"changestyle('bandeaudisplay');\">" 151 . http_img_pack($icone, "$alt", "width='26' height='20'")."</a>" 152 . http_img_pack("rien.gif", "", "width='10' height='1'") 153 . http_img_pack("choix-layout$spip_lang_rtl".($spip_lang=='he'?'_he':'').".gif", _T('choix_interface'), "class='format_png' style='vertical-align: middle' width='59' height='15' usemap='#map_layout'") 154 . http_img_pack("rien.gif", "", "width='10' height='1'"); 155 // grand ecran 156 if ($spip_ecran == "large") { 157 $i = _T('info_petit_ecran'); 158 $res .= "<a href='". parametre_url(self(),'set_ecran', 'etroit') ."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\" onfocus=\"changestyle('bandeauecran');\" onblur=\"changestyle('bandeauecran');\">" . 159 http_img_pack("set-ecran-etroit.png", $i, "width='26' height='20'") . "</a>"; 160 $ecran = "<div><a href='".parametre_url(self(),'set_ecran', 'etroit')."' class='lien_sous'>"._T('info_petit_ecran')."</a>/<b>"._T('info_grand_ecran')."</b></div>"; 161 } else { 162 $i = _T('info_grand_ecran'); 163 $res .= "<a href='".parametre_url(self(),'set_ecran', 'large')."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\" onfocus=\"changestyle('bandeauecran');\" onblur=\"changestyle('bandeauecran');\">" . 164 http_img_pack("set-ecran.png", $i, "width='26' height='20'") ."</a>"; 165 $ecran = "<div><b>"._T('info_petit_ecran')."</b>/<a href='".parametre_url(self(),'set_ecran', 'large')."' class='lien_sous'>"._T('info_grand_ecran')."</a></div>"; 166 } 167 168 $res .= "</td>" 169 . "<td class='bandeau_couleur' style='width: 60px; text-align:$spip_lang_left;' valign='middle'>" 170 . choix_couleur() 171 . "</td>"; 172 // 173 // choix de la langue 174 // 175 if ($GLOBALS['all_langs']) { 176 $res .= "<td class='bandeau_couleur' style='width: 100px; text-align: $spip_lang_right;' valign='middle'>" 177 . menu_langues('var_lang_ecrire') 178 . "</td>"; 179 } 180 181 $res .= "<td class='bandeau_couleur' style='text-align: $spip_lang_right; width: 28px;' valign='middle'>"; 182 183 if ($auth_can_disconnect) { 184 $alt=_T('icone_deconnecter'); 185 $res .= "<a href='". 186 generer_url_action("logout","logout=prive") . 187 "' class='icone26' onmouseover=\"changestyle('bandeaudeconnecter');\" onfocus=\"changestyle('bandeaudeconnecter');\" onblur=\"changestyle('bandeaudeconnecter');\">" . 188 http_img_pack("deconnecter-24.gif", "$alt", "") . 189 "</a>"; 190 } 191 $res .= "</td>" 192 . "</tr></table>"; 193 194 } // fin bandeau colore 195 196 // <div> pour la barre des gadgets 197 // (elements invisibles qui s'ouvrent sous la barre precedente) 198 199 $res .= bandeau_gadgets($largeur, $options, $id_rubrique) 200 . "</div>" 201 . "</div>\n"; 202 203 if ($options != "avancees") $res .= "<div style='height: 18px;'> </div>"; 204 return $res; 205 } 206 207 // Choix dynamique de la couleur 208 209 // http://doc.spip.org/@choix_couleur 210 function choix_couleur() { 211 global $couleurs_spip; 212 $res = ''; 213 if ($couleurs_spip) { 214 $evt = ' 215 onmouseover="changestyle(\'bandeauinterface\');" 216 onfocus="changestyle(\'bandeauinterface\');" 217 onblur="changestyle(\'bandeauinterface\');"'; 218 219 foreach ($couleurs_spip as $key => $val) { 220 $res .= "<a href=\"" 221 . parametre_url(self(), 'set_couleur', $key) 222 . "\"$evt>" 223 . http_img_pack("rien.gif", 224 _T('choix_couleur_interface') . $key, 225 "width='8' height='8' style='margin: 1px; background-color: " . $val['couleur_claire'] . ";'") 226 . "</a>"; 227 } 228 } 229 return $res; 230 } 231 232 // http://doc.spip.org/@avertissement_messagerie 233 function avertissement_messagerie() { 234 global $couleur_foncee; 235 global $connect_id_auteur; 236 237 $result_messages = spip_query("SELECT lien.id_message FROM spip_messages AS messages, spip_auteurs_messages AS lien WHERE lien.id_auteur=$connect_id_auteur AND vu='non' AND statut='publie' AND type='normal' AND lien.id_message=messages.id_message"); 238 $total_messages = @spip_num_rows($result_messages); 239 if ($total_messages == 1) { 240 $row = @spip_fetch_array($result_messages); 241 $ze_message=$row['id_message']; 242 return "<div class='messages'><a href='" . generer_url_ecrire("message","id_message=$ze_message") . "'><span style='color: $couleur_foncee'>"._T('info_nouveau_message')."</span></a></div>"; 243 } elseif ($total_messages > 1) 244 return "<div class='messages'><a href='" . generer_url_ecrire("messagerie") . "'><span style='color: $couleur_foncee'>"._T('info_nouveaux_messages', array('total_messages' => $total_messages))."</span></a></div>"; 245 else return ''; 246 } 247 248 249 // http://doc.spip.org/@auteurs_recemment_connectes 250 function auteurs_recemment_connectes() 251 { 252 global $connect_id_auteur; 253 $res = ''; 254 $result_auteurs = spip_query("SELECT id_auteur FROM spip_auteurs WHERE id_auteur!=$connect_id_auteur AND en_ligne>DATE_SUB(NOW(),INTERVAL 15 MINUTE) AND statut IN ('0minirezo','1comite')"); 255 256 if (spip_num_rows($result_auteurs)) { 257 $formater_auteur = charger_fonction('formater_auteur', 'inc'); 258 $res = "<b>"._T('info_en_ligne'). " </b>"; 259 while ($row = spip_fetch_array($result_auteurs)) { 260 list($s, $mail, $nom, $w, $p) = $formater_auteur($row['id_auteur']); 261 $res .= "$mail $nom, "; 262 } 263 $res = substr($res,0,-2); 264 } 265 266 return $res ? "<div class='messages' style='color:#666;'>$res</div>" : ''; 267 } 268 269 270 // http://doc.spip.org/@lien_change_var 271 function lien_change_var($lien, $set, $couleur, $coords, $titre, $mouseOver="") { 272 $lien = parametre_url($lien, $set, $couleur); 273 return "\n<area shape='rect' href='$lien' coords='$coords' title=\"$titre\" alt=\"$titre\" $mouseOver />"; 274 } 275 276 277 ?>
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 |
![]() |