diff --git a/ecrire/exec/auteur_infos.php b/ecrire/exec/auteur_infos.php index 7a503f2cd3dbbffc284ab1a5ff50ddc98d301ad1..cebe851c98b24fbce31224aec7b756b7e1da406c 100644 --- a/ecrire/exec/auteur_infos.php +++ b/ecrire/exec/auteur_infos.php @@ -17,7 +17,7 @@ include_spip('inc/acces'); // http://doc.spip.org/@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; $id_auteur = intval($id_auteur); diff --git a/ecrire/inc/auth.php b/ecrire/inc/auth.php index 464a6cb68e59ddcd15f626b57f3c3c2ca2d60d2c..8abeb29ffd5f1b4b0d5030dd2ddbdd5d32d094a7 100644 --- a/ecrire/inc/auth.php +++ b/ecrire/inc/auth.php @@ -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) 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 // C'est soit parce que le serveur MySQL ne repond pas, // soit parce que la table des auteurs a changee (restauration etc) diff --git a/ecrire/inc/commencer_page.php b/ecrire/inc/commencer_page.php index 2158b39674d194a92789d1df62863a2a315a5a81..f0e3a0767c2ffc516f09f6d6f93f1b53eb72a026 100644 --- a/ecrire/inc/commencer_page.php +++ b/ecrire/inc/commencer_page.php @@ -76,15 +76,14 @@ function init_entete($titre='', $id_rubrique=0) { // http://doc.spip.org/@init_body function init_body($rubrique='accueil', $sous_rubrique='accueil', $id_rubrique='') { global $couleur_foncee, $couleur_claire; - global $connect_id_auteur, $connect_toutes_rubriques; - global $auth_can_disconnect; + global $connect_id_auteur, $auth_can_disconnect; global $options, $spip_display, $spip_ecran; global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right; if ($spip_ecran == "large") $largeur = 974; else $largeur = 750; $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', 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');\"") @@ -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');\" >" . 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();\" >" . - http_img_pack("loupe.png", "", "width='26' height='20'") ."</a>"; - - $res .= http_img_pack("rien.gif", " ", "width='10'"); - - $res .= "<a href='" . generer_url_ecrire("calendrier","type=semaine") . "' 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>" + $res .= "<a href='" + . generer_url_ecrire("recherche") + . "' class='icone26' onmouseover=\"changestyle('bandeaurecherche'); findObj('form_recherche').focus();\" >" + . http_img_pack("loupe.png", "", "width='26' height='20'") + ."</a>" + . http_img_pack("rien.gif", " ", "width='10'") + . "<a href='" + . generer_url_ecrire("calendrier","type=semaine") + . "' 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');\">" . - http_img_pack("cal-suivi.png", "", "width='26' height='20'") . "</a>"; - - - if (!($connect_toutes_rubriques)) { - $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;'>"; + http_img_pack("cal-suivi.png", "", "width='26' height='20'") + . "</a>" + . "</td>" + . "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>" // Redacteur connecte // overflow pour masquer les noms tres longs // (et eviter debords, notamment en ecran etroit) - if ($spip_ecran == "large") $largeur_nom=300; else $largeur_nom= 110; - - $res .= "<div style='width: ".$largeur_nom."px; height: 14px; overflow: hidden;'>" - . "<a href='" - . generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur&initial=-1") - . "' class='icone26' title=\"" - . entites_html(_T('icone_informations_personnelles')) - . '">' - . typo($GLOBALS['auteur_session']['nom']) - . "</a></div>"; - - $res .= "</td>" - . "<td> </td>" - . "<td class='bandeau_couleur' style='text-align: $spip_lang_right;' valign='middle'>"; + + . "<div style='width: " + . (($spip_ecran == "large") ? 300 : 110) + . "px; height: 14px; overflow: hidden;'>" + . "<a href='" + . generer_url_ecrire("auteur_infos","id_auteur=$connect_id_auteur&initial=-1") + . "' class='icone26' title=\"" + . entites_html(_T('icone_informations_personnelles')) + . '">' + . typo($GLOBALS['auteur_session']['nom']) + . "</a></div>" + . "</td>" + . "<td> </td>" + . "<td class='bandeau_couleur' style='text-align: $spip_lang_right;' valign='middle'>"; // Choix display // $res .="<img src=_DIR_IMG_PACK . 'rien.gif' width='10' />"; - if ($options != "avancees") { + if ($options != "avancees") { $lien = parametre_url(self(), 'set_options', 'avancees'); $icone = "interface-display-comp.png"; - } else { + } else { $lien = parametre_url(self(), 'set_options', 'basiques'); $icone = "interface-display.png"; - } - $res .= "<a href='$lien' class='icone26' onmouseover=\"changestyle('bandeaudisplay');\">" - . http_img_pack($icone, "", "width='26' height='20'")."</a>" - . 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("rien.gif", " ", "width='10' height='1'"); + } + $res .= "<a href='$lien' class='icone26' onmouseover=\"changestyle('bandeaudisplay');\">" + . http_img_pack($icone, "", "width='26' height='20'")."</a>" + . 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("rien.gif", " ", "width='10' height='1'"); // grand ecran - if ($spip_ecran == "large") { - $i = _T('info_petit_ecran'); - $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>"; - $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 { - $i = _T('info_grand_ecran'); - $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>"; - $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>" - . "<td class='bandeau_couleur' style='width: 60px; text-align:$spip_lang_left;' valign='middle'>" - . choix_couleur() - . "</td>"; + if ($spip_ecran == "large") { + $i = _T('info_petit_ecran'); + $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>"; + $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 { + $i = _T('info_grand_ecran'); + $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>"; + $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>" + . "<td class='bandeau_couleur' style='width: 60px; text-align:$spip_lang_left;' valign='middle'>" + . choix_couleur() + . "</td>"; // // choix de la langue // - if ($GLOBALS['all_langs']) { - $res .= "<td class='bandeau_couleur' style='width: 100px; text-align: $spip_lang_right;' valign='middle'>" - . menu_langues('var_lang_ecrire') - . "</td>"; - } + if ($GLOBALS['all_langs']) { + $res .= "<td class='bandeau_couleur' style='width: 100px; text-align: $spip_lang_right;' valign='middle'>" + . menu_langues('var_lang_ecrire') + . "</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='". generer_url_action("logout","logout=prive") . "' class='icone26' onmouseover=\"changestyle('bandeaudeconnecter');\">" . http_img_pack("deconnecter-24.gif", "", "") . "</a>"; - } - $res .= "</td>" - . "</tr></table>"; + } + $res .= "</td>" + . "</tr></table>"; -} // fin bandeau colore + } // fin bandeau colore // <div> pour la barre des gadgets // (elements invisibles qui s'ouvrent sous la barre precedente) diff --git a/ecrire/inc/formater_auteur.php b/ecrire/inc/formater_auteur.php index 2a0967c8534c7e2ce82a4d3afdc8fdef6a1a4983..1b48daf4d69ced75e64ea9254bd37edfc2a895c0 100644 --- a/ecrire/inc/formater_auteur.php +++ b/ecrire/inc/formater_auteur.php @@ -26,7 +26,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; // http://doc.spip.org/@inc_formater_auteur_dist 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); diff --git a/ecrire/inc/legender_auteur.php b/ecrire/inc/legender_auteur.php index 6454942510255ab84ed0484dc754681c4042eb32..87db39e046b505983827c4d4a5447d3aea2780ca 100644 --- a/ecrire/inc/legender_auteur.php +++ b/ecrire/inc/legender_auteur.php @@ -237,7 +237,7 @@ function legender_auteur_voir($auteur, $redirect) $pgp=$auteur["pgp"]; $extra = $auteur["extra"]; - $res .= "<table width='100%' cellpadding='0' border='0' cellspacing='0'>" + $res = "<table width='100%' cellpadding='0' border='0' cellspacing='0'>" . "<tr>" . "<td valign='top' width='100%'>" . gros_titre($nom,'',false) @@ -259,8 +259,8 @@ function legender_auteur_voir($auteur, $redirect) $clic = _T("admin_modifier_auteur"); $h = generer_url_ecrire("auteur_infos","id_auteur=$id_auteur&initial=0"); if (($_COOKIE['spip_accepte_ajax'] == 1 ) AND !$redirect) { - $evt .= "\nonclick=" . ajax_action_declencheur($h,$ancre); - $h = "<a\nhref='$h$a'$evt>$clic</a>"; + $evt = "\nonclick=" . ajax_action_declencheur($h,$ancre); + $h = "<a\nhref='$h#$ancre'$evt>$clic</a>"; } $res .= icone($clic, $h, "redacteurs-24.gif", "edit.gif", '', '',true); } diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index fdefe459a43bb16152c8f7ee1447148917006a05..e1b2282629248b24727f06a1e6e1ec420f2adbaa 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -281,12 +281,12 @@ function bloc_des_raccourcis($bloc) { . creer_colonne_droite('',true) . debut_cadre_enfonce('',true) . (($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') - ."</b><p />") + ."</b>") : ( "<h3>"._T('titre_cadre_raccourcis')."</h3><ul>")) . $bloc - . (($spip_display != 4) ? "</font>" : "</ul>") + . (($spip_display != 4) ? "</div>" : "</ul>") . fin_cadre_enfonce(true); } @@ -333,7 +333,7 @@ function afficher_liste($largeurs, $table, $styles = '') { // http://doc.spip.org/@afficher_liste_display_neq4 function afficher_liste_display_neq4($largeurs, $t, $styles = '') { - global $spip_lang_left; + global $spip_lang_left,$browser_name; $res = ''; $evt = (eregi("msie", $browser_name) ? " onmouseover=\"changeclass(this,'tr_liste_over');\" onmouseout=\"changeclass(this,'tr_liste');\"" :''); diff --git a/ecrire/index.php b/ecrire/index.php index 9f2a10b8bf7151f930877ef26474de1cf1228dc3..00407f60e99757b7b356a78913a917dd2ade1f1c 100644 --- a/ecrire/index.php +++ b/ecrire/index.php @@ -80,7 +80,6 @@ if (!preg_match(',^[a-z][0-9a-z_]*$,i', $exec)) $exec = "accueil"; if (autoriser_sans_cookie($exec)) { if (!isset($reinstall)) $reinstall = 'non'; - $GLOBALS['prefs'] = array('couleur' =>1, 'display'=>0, 'options'=>'avancees'); $var_auth = true; } else { $var_auth = charger_fonction('auth', 'inc'); @@ -92,14 +91,16 @@ if (autoriser_sans_cookie($exec)) { // Preferences de presentation // +if (!isset($GLOBALS['prefs'])) + $GLOBALS['prefs'] = array('couleur' =>1, 'display'=>0, 'options'=>'avancees'); $prefs_mod = false; if (isset($_GET['set_couleur'])) { $GLOBALS['prefs']['couleur'] = floor($_GET['set_couleur']); $prefs_mod = true; } -if (isset($_GET['set_display'])) { - $GLOBALS['prefs']['display'] = floor($_GET['set_display']); +if (isset($_GET['set_disp'])) { + $GLOBALS['prefs']['display'] = floor($_GET['set_disp']); $prefs_mod = true; } if (isset($_GET['set_options']) AND ($_GET['set_options'] == 'avancees' OR $_GET['set_options'] == 'basiques')) {