Skip to content
Extraits de code Groupes Projets
Valider 5533c7ee rédigé par esj's avatar esj
Parcourir les fichiers

Le triple bouton reglant l'affichage textuel et/ou non des icones du bandeau...

Le triple bouton reglant l'affichage textuel et/ou non des icones du bandeau principal ne marchait plus. L'icone d'info-perso était encore là pour les admins restreints. Solution au pb de [7788] pour etre enfin conforme XHTML. QQ globales indéfinies qui faussaient parfois l'affichage.
parent 4f9816c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,7 +17,7 @@ include_spip('inc/acces'); ...@@ -17,7 +17,7 @@ include_spip('inc/acces');
// http://doc.spip.org/@exec_auteur_infos_dist // http://doc.spip.org/@exec_auteur_infos_dist
function exec_auteur_infos_dist() function exec_auteur_infos_dist()
{ {
global $id_auteur, $redirect, $echec, $initial, global $id_auteur, $redirect, $echec, $initial, $spip_display,
$connect_statut, $connect_toutes_rubriques, $connect_id_auteur; $connect_statut, $connect_toutes_rubriques, $connect_id_auteur;
$id_auteur = intval($id_auteur); $id_auteur = intval($id_auteur);
......
...@@ -209,25 +209,10 @@ function inc_auth_dist() { ...@@ -209,25 +209,10 @@ function inc_auth_dist() {
} }
} }
// ceci n'arrive qu'a la premiere connexion il me semble
// si oui ce serait mieux de le mettre a la creation de l'auteur
if (! isset($prefs['display'])) auth_prefs();
// vide = pas de message d'erreur (cf exit(0) Unix) // vide = pas de message d'erreur (cf exit(0) Unix)
return ""; return "";
} }
// http://doc.spip.org/@auth_prefs
function auth_prefs()
{
if (!$GLOBALS['set_disp'] = $_COOKIE['spip_display'])
$GLOBALS['set_disp'] = 2;
if (!$GLOBALS['set_couleur'] = $_COOKIE['spip_couleur'])
$GLOBALS['set_couleur'] = 6;
if (!$GLOBALS['set_options'] = $_COOKIE['spip_options'])
$GLOBALS['set_options'] = 'basiques';
}
// Cas ou l'auteur a ete identifie mais on n'a pas d'info sur lui // Cas ou l'auteur a ete identifie mais on n'a pas d'info sur lui
// C'est soit parce que le serveur MySQL ne repond pas, // C'est soit parce que le serveur MySQL ne repond pas,
// soit parce que la table des auteurs a changee (restauration etc) // soit parce que la table des auteurs a changee (restauration etc)
......
...@@ -76,15 +76,14 @@ function init_entete($titre='', $id_rubrique=0) { ...@@ -76,15 +76,14 @@ function init_entete($titre='', $id_rubrique=0) {
// http://doc.spip.org/@init_body // http://doc.spip.org/@init_body
function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique='') { function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique='') {
global $couleur_foncee, $couleur_claire; global $couleur_foncee, $couleur_claire;
global $connect_id_auteur, $connect_toutes_rubriques; global $connect_id_auteur, $auth_can_disconnect;
global $auth_can_disconnect;
global $options, $spip_display, $spip_ecran; global $options, $spip_display, $spip_ecran;
global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right; global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right;
if ($spip_ecran == "large") $largeur = 974; else $largeur = 750; if ($spip_ecran == "large") $largeur = 974; else $largeur = 750;
$res = pipeline('body_prive',"<body ". _ATTRIBUTES_BODY . '>') $res = pipeline('body_prive',"<body ". _ATTRIBUTES_BODY . '>')
. "\n<map name='map_layout'>" . "\n<map name='map_layout' id='map_layout'>"
. lien_change_var (self(), 'set_disp', 1, '1,0,18,15', _T('lien_afficher_texte_seul'), "onmouseover=\"changestyle('bandeauvide');\"") . lien_change_var (self(), 'set_disp', 1, '1,0,18,15', _T('lien_afficher_texte_seul'), "onmouseover=\"changestyle('bandeauvide');\"")
. lien_change_var (self(), 'set_disp', 2, '19,0,40,15', _T('lien_afficher_texte_icones'), "onmouseover=\"changestyle('bandeauvide');\"") . lien_change_var (self(), 'set_disp', 2, '19,0,40,15', _T('lien_afficher_texte_icones'), "onmouseover=\"changestyle('bandeauvide');\"")
. lien_change_var (self(), 'set_disp', 3, '41,0,59,15', _T('lien_afficher_icones_seuls'), "onmouseover=\"changestyle('bandeauvide');\"") . lien_change_var (self(), 'set_disp', 3, '41,0,59,15', _T('lien_afficher_icones_seuls'), "onmouseover=\"changestyle('bandeauvide');\"")
...@@ -121,101 +120,96 @@ function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique=' ...@@ -121,101 +120,96 @@ function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique='
else $res .= "<a href='" . generer_url_ecrire("brouteur") . "' class='icone26' onmouseover=\"changestyle('bandeaunavrapide');\" >" . else $res .= "<a href='" . generer_url_ecrire("brouteur") . "' class='icone26' onmouseover=\"changestyle('bandeaunavrapide');\" >" .
http_img_pack("naviguer-site.png", "", "width='26' height='20'") . "</a>"; http_img_pack("naviguer-site.png", "", "width='26' height='20'") . "</a>";
$res .= "<a href='" . generer_url_ecrire("recherche") . "' class='icone26' onmouseover=\"changestyle('bandeaurecherche'); findObj('form_recherche').focus();\" >" . $res .= "<a href='"
http_img_pack("loupe.png", "", "width='26' height='20'") ."</a>"; . generer_url_ecrire("recherche")
. "' class='icone26' onmouseover=\"changestyle('bandeaurecherche'); findObj('form_recherche').focus();\" >"
$res .= http_img_pack("rien.gif", " ", "width='10'"); . http_img_pack("loupe.png", "", "width='26' height='20'")
."</a>"
$res .= "<a href='" . generer_url_ecrire("calendrier","type=semaine") . "' class='icone26' onmouseover=\"changestyle('bandeauagenda');\">" . . http_img_pack("rien.gif", " ", "width='10'")
http_img_pack("cal-rv.png", "", "width='26' height='20'") ."</a>" . "<a href='"
. "<a href='" . generer_url_ecrire("messagerie") . "' class='icone26' onmouseover=\"changestyle('bandeaumessagerie');\">" . . generer_url_ecrire("calendrier","type=semaine")
http_img_pack("cal-messagerie.png", "", "width='26' height='20'") ."</a>" . "' class='icone26' onmouseover=\"changestyle('bandeauagenda');\">"
. http_img_pack("cal-rv.png", "", "width='26' height='20'") ."</a>"
. "<a href='" . generer_url_ecrire("messagerie") . "' class='icone26' onmouseover=\"changestyle('bandeaumessagerie');\">"
. http_img_pack("cal-messagerie.png", "", "width='26' height='20'")
."</a>"
. "<a href='" . generer_url_ecrire("synchro") . "' class='icone26' onmouseover=\"changestyle('bandeausynchro');\">" . . "<a href='" . generer_url_ecrire("synchro") . "' class='icone26' onmouseover=\"changestyle('bandeausynchro');\">" .
http_img_pack("cal-suivi.png", "", "width='26' height='20'") . "</a>"; http_img_pack("cal-suivi.png", "", "width='26' height='20'")
. "</a>"
. "</td>"
if (!($connect_toutes_rubriques)) { . "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>"
$res .= http_img_pack("rien.gif", " ", "width='10'");
$res .= "<a href='" . generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur&initial=-1") . "' class='icone26' onmouseover=\"changestyle('bandeauinfoperso');\">" .
http_img_pack("fiche-perso.png", "", "onmouseover=\"changestyle();\"");
$res .= "</a>";
}
$res .= "</td>"
. "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>";
// Redacteur connecte // Redacteur connecte
// overflow pour masquer les noms tres longs // overflow pour masquer les noms tres longs
// (et eviter debords, notamment en ecran etroit) // (et eviter debords, notamment en ecran etroit)
if ($spip_ecran == "large") $largeur_nom=300; else $largeur_nom= 110;
. "<div style='width: "
$res .= "<div style='width: ".$largeur_nom."px; height: 14px; overflow: hidden;'>" . (($spip_ecran == "large") ? 300 : 110)
. "<a href='" . "px; height: 14px; overflow: hidden;'>"
. generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur&initial=-1") . "<a href='"
. "' class='icone26' title=\"" . generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur&initial=-1")
. entites_html(_T('icone_informations_personnelles')) . "' class='icone26' title=\""
. '">' . entites_html(_T('icone_informations_personnelles'))
. typo($GLOBALS['auteur_session']['nom']) . '">'
. "</a></div>"; . typo($GLOBALS['auteur_session']['nom'])
. "</a></div>"
$res .= "</td>" . "</td>"
. "<td> &nbsp; </td>" . "<td> &nbsp; </td>"
. "<td class='bandeau_couleur' style='text-align: $spip_lang_right;' valign='middle'>"; . "<td class='bandeau_couleur' style='text-align: $spip_lang_right;' valign='middle'>";
// Choix display // Choix display
// $res .="<img src=_DIR_IMG_PACK . 'rien.gif' width='10' />"; // $res .="<img src=_DIR_IMG_PACK . 'rien.gif' width='10' />";
if ($options != "avancees") { if ($options != "avancees") {
$lien = parametre_url(self(), 'set_options', 'avancees'); $lien = parametre_url(self(), 'set_options', 'avancees');
$icone = "interface-display-comp.png"; $icone = "interface-display-comp.png";
} else { } else {
$lien = parametre_url(self(), 'set_options', 'basiques'); $lien = parametre_url(self(), 'set_options', 'basiques');
$icone = "interface-display.png"; $icone = "interface-display.png";
} }
$res .= "<a href='$lien' class='icone26' onmouseover=\"changestyle('bandeaudisplay');\">" $res .= "<a href='$lien' class='icone26' onmouseover=\"changestyle('bandeaudisplay');\">"
. http_img_pack($icone, "", "width='26' height='20'")."</a>" . http_img_pack($icone, "", "width='26' height='20'")."</a>"
. http_img_pack("rien.gif", " ", "width='10' height='1'") . http_img_pack("rien.gif", " ", "width='10' height='1'")
. http_img_pack("choix-layout$spip_lang_rtl".($spip_lang=='he'?'_he':'').".gif", "abc", "class='format_png' style='vertical-align: middle' width='59' height='15' usemap='#map_layout'")
. http_img_pack("choix-layout$spip_lang_rtl".($spip_lang=='he'?'_he':'').".gif", "abc", "class='format_png' style='vertical-align: middle' width='59' height='15' usemap='#map_layout'") . http_img_pack("rien.gif", " ", "width='10' height='1'");
. http_img_pack("rien.gif", " ", "width='10' height='1'");
// grand ecran // grand ecran
if ($spip_ecran == "large") { if ($spip_ecran == "large") {
$i = _T('info_petit_ecran'); $i = _T('info_petit_ecran');
$res .= "<a href='". parametre_url(self(),'set_ecran', 'etroit') ."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\">" . $res .= "<a href='". parametre_url(self(),'set_ecran', 'etroit') ."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\">" .
http_img_pack("set-ecran-etroit.png", $i, "width='26' height='20'") . "</a>"; http_img_pack("set-ecran-etroit.png", $i, "width='26' height='20'") . "</a>";
$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>"; $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>";
} else { } else {
$i = _T('info_grand_ecran'); $i = _T('info_grand_ecran');
$res .= "<a href='".parametre_url(self(),'set_ecran', 'large')."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\">" . $res .= "<a href='".parametre_url(self(),'set_ecran', 'large')."' class='icone26' onmouseover=\"changestyle('bandeauecran');\" title=\"$i\">" .
http_img_pack("set-ecran.png", $i, "width='26' height='20'") ."</a>"; http_img_pack("set-ecran.png", $i, "width='26' height='20'") ."</a>";
$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>"; $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>";
} }
$res .= "</td>" $res .= "</td>"
. "<td class='bandeau_couleur' style='width: 60px; text-align:$spip_lang_left;' valign='middle'>" . "<td class='bandeau_couleur' style='width: 60px; text-align:$spip_lang_left;' valign='middle'>"
. choix_couleur() . choix_couleur()
. "</td>"; . "</td>";
// //
// choix de la langue // choix de la langue
// //
if ($GLOBALS['all_langs']) { if ($GLOBALS['all_langs']) {
$res .= "<td class='bandeau_couleur' style='width: 100px; text-align: $spip_lang_right;' valign='middle'>" $res .= "<td class='bandeau_couleur' style='width: 100px; text-align: $spip_lang_right;' valign='middle'>"
. menu_langues('var_lang_ecrire') . menu_langues('var_lang_ecrire')
. "</td>"; . "</td>";
} }
$res .= "<td class='bandeau_couleur' style='text-align: $spip_lang_right; width: 28px;' valign='middle'>"; $res .= "<td class='bandeau_couleur' style='text-align: $spip_lang_right; width: 28px;' valign='middle'>";
if ($auth_can_disconnect) { if ($auth_can_disconnect) {
$res .= "<a href='". $res .= "<a href='".
generer_url_action("logout","logout=prive") . generer_url_action("logout","logout=prive") .
"' class='icone26' onmouseover=\"changestyle('bandeaudeconnecter');\">" . "' class='icone26' onmouseover=\"changestyle('bandeaudeconnecter');\">" .
http_img_pack("deconnecter-24.gif", "", "") . http_img_pack("deconnecter-24.gif", "", "") .
"</a>"; "</a>";
} }
$res .= "</td>" $res .= "</td>"
. "</tr></table>"; . "</tr></table>";
} // fin bandeau colore } // fin bandeau colore
// <div> pour la barre des gadgets // <div> pour la barre des gadgets
// (elements invisibles qui s'ouvrent sous la barre precedente) // (elements invisibles qui s'ouvrent sous la barre precedente)
......
...@@ -26,7 +26,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; ...@@ -26,7 +26,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
// http://doc.spip.org/@inc_formater_auteur_dist // http://doc.spip.org/@inc_formater_auteur_dist
function inc_formater_auteur_dist($id_auteur) { function inc_formater_auteur_dist($id_auteur) {
global $connect_id_auteur, $spip_lang_rtl; global $connect_id_auteur, $spip_lang_rtl, $connect_statut;
$id_auteur = intval($id_auteur); $id_auteur = intval($id_auteur);
......
...@@ -237,7 +237,7 @@ function legender_auteur_voir($auteur, $redirect) ...@@ -237,7 +237,7 @@ function legender_auteur_voir($auteur, $redirect)
$pgp=$auteur["pgp"]; $pgp=$auteur["pgp"];
$extra = $auteur["extra"]; $extra = $auteur["extra"];
$res .= "<table width='100%' cellpadding='0' border='0' cellspacing='0'>" $res = "<table width='100%' cellpadding='0' border='0' cellspacing='0'>"
. "<tr>" . "<tr>"
. "<td valign='top' width='100%'>" . "<td valign='top' width='100%'>"
. gros_titre($nom,'',false) . gros_titre($nom,'',false)
...@@ -259,8 +259,8 @@ function legender_auteur_voir($auteur, $redirect) ...@@ -259,8 +259,8 @@ function legender_auteur_voir($auteur, $redirect)
$clic = _T("admin_modifier_auteur"); $clic = _T("admin_modifier_auteur");
$h = generer_url_ecrire("auteur_infos","id_auteur=$id_auteur&initial=0"); $h = generer_url_ecrire("auteur_infos","id_auteur=$id_auteur&initial=0");
if (($_COOKIE['spip_accepte_ajax'] == 1 ) AND !$redirect) { if (($_COOKIE['spip_accepte_ajax'] == 1 ) AND !$redirect) {
$evt .= "\nonclick=" . ajax_action_declencheur($h,$ancre); $evt = "\nonclick=" . ajax_action_declencheur($h,$ancre);
$h = "<a\nhref='$h$a'$evt>$clic</a>"; $h = "<a\nhref='$h#$ancre'$evt>$clic</a>";
} }
$res .= icone($clic, $h, "redacteurs-24.gif", "edit.gif", '', '',true); $res .= icone($clic, $h, "redacteurs-24.gif", "edit.gif", '', '',true);
} }
......
...@@ -281,12 +281,12 @@ function bloc_des_raccourcis($bloc) { ...@@ -281,12 +281,12 @@ function bloc_des_raccourcis($bloc) {
. creer_colonne_droite('',true) . creer_colonne_droite('',true)
. debut_cadre_enfonce('',true) . debut_cadre_enfonce('',true)
. (($spip_display != 4) . (($spip_display != 4)
? ("<font face='Verdana,Arial,Sans,sans-serif' size='1'><b>" ? ("<div style='font-family: Verdana,Arial,Sans,sans-serif; font-size: x-small'><b>"
._T('titre_cadre_raccourcis') ._T('titre_cadre_raccourcis')
."</b><p />") ."</b>")
: ( "<h3>"._T('titre_cadre_raccourcis')."</h3><ul>")) : ( "<h3>"._T('titre_cadre_raccourcis')."</h3><ul>"))
. $bloc . $bloc
. (($spip_display != 4) ? "</font>" : "</ul>") . (($spip_display != 4) ? "</div>" : "</ul>")
. fin_cadre_enfonce(true); . fin_cadre_enfonce(true);
} }
...@@ -333,7 +333,7 @@ function afficher_liste($largeurs, $table, $styles = '') { ...@@ -333,7 +333,7 @@ function afficher_liste($largeurs, $table, $styles = '') {
// http://doc.spip.org/@afficher_liste_display_neq4 // http://doc.spip.org/@afficher_liste_display_neq4
function afficher_liste_display_neq4($largeurs, $t, $styles = '') { function afficher_liste_display_neq4($largeurs, $t, $styles = '') {
global $spip_lang_left; global $spip_lang_left,$browser_name;
$res = ''; $res = '';
$evt = (eregi("msie", $browser_name) ? " onmouseover=\"changeclass(this,'tr_liste_over');\" onmouseout=\"changeclass(this,'tr_liste');\"" :''); $evt = (eregi("msie", $browser_name) ? " onmouseover=\"changeclass(this,'tr_liste_over');\" onmouseout=\"changeclass(this,'tr_liste');\"" :'');
......
...@@ -80,7 +80,6 @@ if (!preg_match(',^[a-z][0-9a-z_]*$,i', $exec)) $exec = "accueil"; ...@@ -80,7 +80,6 @@ if (!preg_match(',^[a-z][0-9a-z_]*$,i', $exec)) $exec = "accueil";
if (autoriser_sans_cookie($exec)) { if (autoriser_sans_cookie($exec)) {
if (!isset($reinstall)) $reinstall = 'non'; if (!isset($reinstall)) $reinstall = 'non';
$GLOBALS['prefs'] = array('couleur' =>1, 'display'=>0, 'options'=>'avancees');
$var_auth = true; $var_auth = true;
} else { } else {
$var_auth = charger_fonction('auth', 'inc'); $var_auth = charger_fonction('auth', 'inc');
...@@ -92,14 +91,16 @@ if (autoriser_sans_cookie($exec)) { ...@@ -92,14 +91,16 @@ if (autoriser_sans_cookie($exec)) {
// Preferences de presentation // Preferences de presentation
// //
if (!isset($GLOBALS['prefs']))
$GLOBALS['prefs'] = array('couleur' =>1, 'display'=>0, 'options'=>'avancees');
$prefs_mod = false; $prefs_mod = false;
if (isset($_GET['set_couleur'])) { if (isset($_GET['set_couleur'])) {
$GLOBALS['prefs']['couleur'] = floor($_GET['set_couleur']); $GLOBALS['prefs']['couleur'] = floor($_GET['set_couleur']);
$prefs_mod = true; $prefs_mod = true;
} }
if (isset($_GET['set_display'])) { if (isset($_GET['set_disp'])) {
$GLOBALS['prefs']['display'] = floor($_GET['set_display']); $GLOBALS['prefs']['display'] = floor($_GET['set_disp']);
$prefs_mod = true; $prefs_mod = true;
} }
if (isset($_GET['set_options']) AND ($_GET['set_options'] == 'avancees' OR $_GET['set_options'] == 'basiques')) { if (isset($_GET['set_options']) AND ($_GET['set_options'] == 'avancees' OR $_GET['set_options'] == 'basiques')) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter