From f4ec306a1763fc67f43e42da02c7d3045e13ada1 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Fri, 28 Oct 2005 16:50:49 +0000 Subject: [PATCH] remplacement de la BALISE style utilisee pour les pages d'installation et assimilees par une balise Link sur une feuille de style. Petites differences graphiques par endroits, mais on ne voit presque jamais ces pages et il est justement plus facile de les changer a present --- ecrire/inc_getdocument.php3 | 15 ++++++--- ecrire/inc_presentation.php3 | 65 ++++++++++++------------------------ ecrire/install.php3 | 2 +- inc-cache.php3 | 18 ++++------ spip_test_dirs.php3 | 37 +++++++++----------- 5 files changed, 55 insertions(+), 82 deletions(-) diff --git a/ecrire/inc_getdocument.php3 b/ecrire/inc_getdocument.php3 index d82ca42418..472d1ae2d0 100644 --- a/ecrire/inc_getdocument.php3 +++ b/ecrire/inc_getdocument.php3 @@ -105,6 +105,7 @@ function deplacer_fichier_upload($source, $dest) { // et true si erreur = pas de fichier // pour les autres erreurs affiche le message d'erreur et meurt function check_upload_error($error, $msg='') { + global $spip_lang_right; switch ($error) { case 0: return false; @@ -129,10 +130,16 @@ function check_upload_error($error, $msg='') { spip_log ("erreur upload $error"); include_ecrire('inc_presentation.php3'); - install_debut_html(_T('forum_titre_erreur')); - echo "<p>$msg</p>\n"; - - install_fin_html(_DIR_RESTREINT_ABS . $GLOBALS['redirect']); + install_debut_html($msg); + echo '<form action="' , + _DIR_RESTREINT_ABS, + urldecode($GLOBALS['redirect']), + '"><div align="', + $spip_lang_right, + '"><input type="submit" class="fondl" value="', + _T('ecrire:bouton_suivant'), + ' >>"></div>', + '</form></body></html>'; exit; } diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3 index a827ab1bd6..a7e0602fd0 100644 --- a/ecrire/inc_presentation.php3 +++ b/ecrire/inc_presentation.php3 @@ -24,6 +24,7 @@ utiliser_langue_visiteur(); function debut_entete($title, $entete='') { global $flag_preserver; + if (headers_sent()) return; if (!$charset = lire_meta('charset')) $charset = 'utf-8'; if (!$entete) @@ -3412,55 +3413,31 @@ function mySel($varaut,$variable, $option = NULL) { // function install_debut_html($titre = 'AUTO') { - global $spip_lang_rtl; + global $attributes_body, $browser_verifForm; if ($titre=='AUTO') $titre=_T('info_installation_systeme_publication'); echo debut_entete($titre), - "<style type='text/css'> - <!-- - a {text-decoration: none; } - A:Hover {color:#FF9900; text-decoration: underline;} - .forml {width: 100%; background-color: #FFCC66; background-position: center bottom; float: none; color: #000000} - .formo {width: 100%; background-color: #FFF0E0; background-position: center bottom; weight: bold; float: none; color: #000000} - .fondl {background-color: #FFCC66; background-position: center bottom; float: none; color: #000000} - .fondo {background-color: #FFF0E0; background-position: center bottom; float: none; color: #000000} - .fondf {background-color: #FFFFFF; border-style: solid ; border-width: 1; border-color: #E86519; color: #E86519} - .serif { font-family: Georgia, Garamond, Times New Roman, serif; } - --> - </style> - </head> - <body bgcolor='#FFFFFF' text='#000000' link='#E86519' vlink='#6E003A' alink='#FF9900'"; - - if ($spip_lang_rtl) echo " dir='rtl'"; - - echo "><br><br><br> - <center> - <table width='450'> - <tr><td width='450' class='serif'> - <font face='Verdana,Arial,Sans,sans-serif' size='4' color='#970038'><B>$titre</b></font>\n<p>"; -} - -function install_fin_html($suite = '') { - - // bouton retour - global $spip_lang_right; - if ($suite) { - $link = new Link($suite); - echo $link->getForm(); - echo "<DIV align='$spip_lang_right'>" - . "<INPUT TYPE='submit' CLASS='fondl' VALUE='" - . _T('ecrire:bouton_suivant')." >>'></div>" - . "</FORM>"; - } - - echo ' - </td></tr></table> - </center> - </body> - </html> - '; + '<link rel="stylesheet" type="text/css" href="' . + _DIR_RESTREINT . + 'spip_style.php3?couleur_claire=' . + urlencode('#FFCC66') . + '&couleur_foncee=' . + urlencode('#000000') . + '&left=' . + $GLOBALS['spip_lang_left'] . + "\" > +</head> +<body $attributes_body> +<center><table width='450'><tr><th style='color: #970038; text-align: left'><h3>", + $titre, + "</h3></th></tr><tr><td class='serif'>"; +} + +function install_fin_html() { + + echo '</td></tr></table></body></html>'; } // Voir en ligne, ou apercu, ou rien (renvoie tout le bloc) diff --git a/ecrire/install.php3 b/ecrire/install.php3 index 7c5158c58b..b9f1c20548 100644 --- a/ecrire/install.php3 +++ b/ecrire/install.php3 @@ -398,7 +398,7 @@ else if ($etape == 3) { echo "<INPUT NAME=\"choix_db\" VALUE=\"new_spip\" TYPE=Radio id='nou'"; if (!$checked) echo " CHECKED"; echo "> <label for='nou'>"._T('info_creer_base')."</label> "; - echo "<INPUT TYPE='text' NAME='table_new' CLASS='fondo' VALUE=\"spip\" SIZE='20'></fieldset><P>"; + echo "<INPUT TYPE='text' NAME='table_new' CLASS='fondl' VALUE=\"spip\" SIZE='20'></fieldset><P>"; echo "<DIV align='$spip_lang_right'><INPUT TYPE='submit' CLASS='fondl' VALUE='"._T('bouton_suivant')." >>'>"; diff --git a/inc-cache.php3 b/inc-cache.php3 index 66fdcae6a3..2aaf4f1930 100644 --- a/inc-cache.php3 +++ b/inc-cache.php3 @@ -213,24 +213,18 @@ function determiner_cache($delais, &$use_cache, &$chemin_cache) { if (@file_exists($chemin_cache)) $use_cache = 1; // passer outre else { - spip_log("Erreur base de donnees & " + if (!spip_interdire_cache) { + spip_log("Erreur base de donnees & " . "impossible utiliser $chemin_cache"); - if (!$GLOBALS['flag_preserver']) { include_ecrire('inc_presentation.php3'); - if (!headers_sent()) { - install_debut_html(_T('info_travaux_titre')); - echo _T('titre_probleme_technique'); - install_fin_html(); - } - else echo _T('titre_probleme_technique'); - + install_debut_html(_T('info_travaux_titre'));echo _T('titre_probleme_technique');install_fin_html(); } + } // continuer quand meme, ca n'ira pas loin. // mais ne plus rien signaler, ne pas mettre en cache ... - $GLOBALS['flag_preserver'] = true; - define ('spip_interdire_cache', true); - } + $GLOBALS['flag_preserver'] = true; + define ('spip_interdire_cache', true); } // En cas de POST (et si la connexion est ok) supprimer le cache diff --git a/spip_test_dirs.php3 b/spip_test_dirs.php3 index 96f270020a..1f2f540619 100644 --- a/spip_test_dirs.php3 +++ b/spip_test_dirs.php3 @@ -69,43 +69,38 @@ while (list(, $my_dir) = each($test_dirs)) { } if ($bad_dirs OR $absent_dirs) { - install_debut_html(); if (!_FILE_CONNECT) { $titre = _T('dirs_preliminaire'); - $continuer = ' '._T('dirs_commencer'); + $continuer = ' '._T('dirs_commencer') . '.'; } else $titre = _T('dirs_probleme_droits'); $bad_url = "spip_test_dirs.php3"; if ($test_dir) $bad_url .= '?test_dir='.$test_dir; - echo "<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>"; - echo "<div align='right'>". menu_langues('var_lang_ecrire')."</div>\n"; + $res = "<div align='right'>". menu_langues('var_lang_ecrire')."</div>\n"; if ($bad_dirs) { - echo "<p>"; - echo _T('dirs_repertoires_suivants', - array('bad_dirs' => join(" ", $bad_dirs))); - echo "<B>". _T('login_recharger')."</b>"; + $res .= + _T('dirs_repertoires_suivants', + array('bad_dirs' => join(" ", $bad_dirs))) . + "<b>". _T('login_recharger')."</b>."; } if ($absent_dirs) { - echo "<p>"; - echo _T('dirs_repertoires_absents', - array('bad_dirs' => join(" ", $absent_dirs))); - echo "<B>". _T('login_recharger')."</b>"; + $res .= + _T('dirs_repertoires_absents', + array('bad_dirs' => join(" ", $absent_dirs))) . + "<b>". _T('login_recharger')."</b>."; } - echo $continuer.'. '; - echo aide ("install0"); - echo "<p>"; - - echo "<FORM ACTION='$bad_urls' METHOD='GET'>\n"; - echo "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' VALUE='". _T('login_recharger')."'></DIV>"; - echo "</FORM>"; - - install_fin_html(); + $res = "<p>" . $continuer . $res . aide ("install0") . "</p>" . + "<FORM ACTION='$bad_urls' METHOD='GET'>\n" . + "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' VALUE='". + _T('login_recharger')."'></DIV>" . + "</FORM>"; + install_debut_html($titre);echo $res; install_fin_html(); } else { if (!_FILE_CONNECT) -- GitLab