Update of /home/spip-cvs/spip/ecrire
In directory alan:/tmp/cvs-serv11576
Modified Files:
aide_index.php3 inc_calendrier.php inc_debug_sql.php3
inc_presentation.php3 inc_version.php3
Log Message:
unification des <head>...</head>
Index: aide_index.php3
RCS file: /home/spip-cvs/spip/ecrire/aide_index.php3,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- aide_index.php3 19 Oct 2004 19:56:02 -0000 1.23
+++ aide_index.php3 22 Oct 2004 18:01:58 -0000 1.24
@@ -1,6 +1,7 @@
<?php
include ("inc_version.php3");
+include_ecrire ("inc_presentation.php3");
// Eviter les calculs evitables (surtout en client/serveur sans cache !)
#$lastmodified = filemtime("aide_index.php3");
@@ -19,16 +20,6 @@
utiliser_langue_visiteur();
if ($var_lang) changer_langue($var_lang);
-// Debut page
-function entetes_html() {
- header('Content-Type: text/html; charset=utf-8');
- echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
- echo "<html dir=\"".($GLOBALS['spip_lang_rtl'] ? 'rtl' : 'ltr')."\">";
- echo "<head>";
- echo "<title>"._T('info_aide_en_ligne')."</title>";
-}
-
-
/////////////////////////////
// La frame de base
//
@@ -451,7 +442,7 @@
install_fin_html();
}
} else {
- entetes_html();
+ echo debut_entete(_T('info_aide_en_ligne'));
if ($frame == 'menu')
help_menu($aide, $html);
else if ($frame == 'body')
Index: inc_calendrier.php
RCS file: /home/spip-cvs/spip/ecrire/inc_calendrier.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- inc_calendrier.php 19 Oct 2004 09:28:44 -0000 1.18
+++ inc_calendrier.php 22 Oct 2004 18:01:58 -0000 1.19
@@ -217,7 +217,6 @@
function http_calendrier_retire_args($script, $args)
{
foreach($args as $arg) {
- spip_log("args $arg: $script");
$script = ereg_replace("$arg=[^&]*&",'', $script);
$script = ereg_replace("$arg=[^#]*#",'#', $script);
$script = ereg_replace("$arg=[^&#]*$",'', $script);
Index: inc_debug_sql.php3
RCS file: /home/spip-cvs/spip/ecrire/inc_debug_sql.php3,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- inc_debug_sql.php3 22 Oct 2004 11:12:21 -0000 1.1
+++ inc_debug_sql.php3 22 Oct 2004 18:01:58 -0000 1.2
@@ -5,11 +5,12 @@
if (defined("_INC_DEBUG_SQL")) return;
define("_INC_DEBUG_SQL", "1");
+include_ecrire('inc_presentation.php3');
+
// Si le code php produit des erreurs, on les affiche en surimpression
// sauf pour un visiteur non admin (lui ne voit rien de special)
// ajouter &var_debug=oui pour voir les erreurs et en parler sur spip@rezo.net
function affiche_erreurs_page($tableau_des_erreurs) {
- include_ecrire('inc_presentation.php3');
echo "<div id='spip-debug' style='position: absolute; top: 20;",
" z-index: 1000;'><ul><li>",
@@ -36,8 +37,6 @@
//
function erreur_requete_boucle($query, $id_boucle, $type) {
- include_ecrire("inc_presentation.php3");
-
// Calmer le jeu avec MySQL (si jamais on est en saturation)
@touch(_FILE_MYSQL_OUT); // pour spip_cron
@touch(_FILE_LOCK); // lock hebergeur
@@ -99,6 +98,7 @@
if ($HTTP_COOKIE_VARS['spip_admin'] OR
$auteur_session['statut'] == '0minirezo' OR
$GLOBALS['var_debug']) {
+ echo debut_entete('Debug'), '</head><body>';
die(affiche_erreurs_page($tableau_des_erreurs));
}
}
@@ -142,13 +142,12 @@
// l'environnement graphique du debuggueur
function debug_dumpfile ($texte) {
-
+ spip_log("dump $texte");
global $debug_objets, $debug_objet, $debug_affiche;
- if (!headers_sent())
- header("Content-Type: text/html; charset=".lire_meta('charset'));
if (!$GLOBALS['debug_objets']['sourcefile']) return;
spip_setcookie('spip_debug', 'oui', time()+12*3600);
- $page = "<html><head><title>Debug</title></head>\n<body>";
+ echo debut_entete('Debug');
+ $page = "</head>\n<body>";
echo calcul_admin_page('', $page),
"<div id='spip-debug' style='position: absolute; top: 20; z-index: 1000;'><ul>\n";
Index: inc_presentation.php3
RCS file: /home/spip-cvs/spip/ecrire/inc_presentation.php3,v
retrieving revision 1.496
retrieving revision 1.497
diff -u -d -r1.496 -r1.497
--- inc_presentation.php3 20 Oct 2004 13:22:25 -0000 1.496
+++ inc_presentation.php3 22 Oct 2004 18:01:58 -0000 1.497
@@ -1479,7 +1479,6 @@
echo "</form>";
}
-
//
// Presentation de l'interface privee, debut du HTML
//
@@ -1502,25 +1501,12 @@
$titre = textebrut(typo($titre));
if (!$nom_site_spip) $nom_site_spip="SPIP";
- if (!$charset = lire_meta('charset')) $charset = 'utf-8';
+ $adresse_site=lire_meta("adresse_site");
@Header(« Expires: 0 »);
@Header(« Cache-Control: no-cache,no-store »);
@Header(« Pragma: no-cache »);
- @Header(« Content-Type: text/html; charset=$charset »);
- echo « <!DOCTYPE HTML PUBLIC ‹ -//W3C//DTD HTML 4.01 Transitional//EN › ‹ http://www.w3.org/TR/html4/loose.dtd ›>\n »;
-// echo ‹ <html xmlns:m=« http://www.w3.org/1998/Math/MathML">’."\n".’<head>’."\n »;
-
-/* if (eregi(« msie », $browser_name)) {
- echo ‹ <object id=« mathplayer » classid=« clsid:32F66A20-7614-11D4-BD11-00104BD3F987 »> ›."\n". ›</object>’."\n";
- echo ‹ < ›.’?import namespace=« m » implementation="#mathplayer"?’.’>’."\n";
- }
-*/
- echo « <title>[$nom_site_spip] $titre</title>\n »;
- echo ‹ <meta http-equiv=« Content-Type » content="text/html; charset= ›.$charset.’">’;
-
- $adresse_site=lire_meta(« adresse_site »);
-
+ echo debut_entete("[$nom_site_spip] $titre");
if ($spip_display != 4) {
echo « <link rel=‹ alternate › type=‹ application/rss+xml › title=’ ».addslashes($nom_site_spip)."’ href=’$adresse_site/backend.php3’ />";
$activer_breves=lire_meta(« activer_breves »);
@@ -3291,16 +3277,10 @@
if ($titre==‹ AUTO ›)
$titre=_T(‹ info_installation_systeme_publication ›);
- if (!$charset = lire_meta('charset')) $charset = 'utf-8';
- @Header("Content-Type: text/html; charset=$charset");
-
- echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
- echo "\n<html><head>
- <title>$titre</title>
- <meta http-equiv='Expires' content='0'>
+ echo debut_entete($titre, '',''),
+ "<meta http-equiv='Expires' content='0'>
<meta http-equiv='cache-control' content='no-cache,no-store'>
<meta http-equiv='pragma' content='no-cache'>
- <meta http-equiv='Content-Type' content='text/html; charset=$charset'>
<style type='text/css'>
<!--
a {text-decoration: none; }
Index: inc_version.php3
RCS file: /home/spip-cvs/spip/ecrire/inc_version.php3,v
retrieving revision 1.389
retrieving revision 1.390
diff -u -d -r1.389 -r1.390
--- inc_version.php3 19 Oct 2004 19:56:02 -0000 1.389
+++ inc_version.php3 22 Oct 2004 18:01:58 -0000 1.390
@@ -5,8 +5,6 @@
if (defined("_ECRIRE_INC_VERSION")) return;
define("_ECRIRE_INC_VERSION", "1");
-
-
function define_once ($constant, $valeur) {
if (!defined($constant)) define($constant, $valeur);
}
@@ -221,8 +219,18 @@
# en fait flag_ecrire est une constante, equivalente a la nullite de:
define_once('_DIR_RESTREINT', (!@is_dir('ecrire') ? "" : "ecrire/"));
-define('_DIR_PREFIX1', (_DIR_RESTREINT ? "" : "../"));
-define('_DIR_PREFIX2', _DIR_RESTREINT);
+
+// essai d'un SPip multi-site. Expérimental.
+
+if ($d = ($GLOBALS['HTTP_GET_VARS']['var_install']))
+ {
+ $d = substr($d,0,strrpos($d,'/')+1);
+ define('_DIR_PREFIX1', $d);
+ define('_DIR_PREFIX2', $d);
+ } else {
+ define('_DIR_PREFIX1', (_DIR_RESTREINT ? "" : "../"));
+ define('_DIR_PREFIX2', _DIR_RESTREINT);
+ }
if (@file_exists(_DIR_PREFIX2 . 'mes_options.php3')) {
include(_DIR_PREFIX2 . 'mes_options.php3');
@@ -286,7 +294,7 @@
define_once('_ACCESS_FILE_NAME', '.htaccess');
define_once('_AUTH_USER_FILE', '.htpasswd');
-
+;
// Version courante de SPIP
// Stockee sous forme de nombre decimal afin de faciliter les comparaisons
// (utilise pour les modifs de la base de donnees)
@@ -1130,4 +1138,29 @@
}
}
+// Envoi des en-tetes
+
+function debut_entete($title)
+{
+// ‹ <html xmlns:m=« http://www.w3.org/1998/Math/MathML">’."\n".’<head>’."\n »;
+
+//if (eregi(« msie », $browser_name)) {
+// ‹ <object id=« mathplayer » classid=« clsid:32F66A20-7614-11D4-BD11-00104BD3F987 »> ›."\n". ›</object>’."\n";
+// ‹ < ›.’?import namespace=« m » implementation="#mathplayer"?’.’>’."\n";
+
+ $base=lire_meta(« adresse_site »);
+ if (!$base)
+ $base = dirname($GLOBALS[‹ HTTP_SERVERS_VARS ›][‹ SCRIPT_NAME ›]);
+ else
+ $base .= ‹ / › . (_DIR_RESTREINT ? ‹ › : ‹ ecrire/ ›);
+ if (!$charset = lire_meta(‹ charset ›)) $charset = ‹ utf-8 ›;
+ @Header(« Content-Type: text/html; charset=$charset »);
+ return « <!DOCTYPE HTML PUBLIC ‹ -//W3C//DTD HTML 4.01 Transitional//EN › ‹ http://www.w3.org/TR/html4/loose.dtd ›>\n » .
+ « <html dir=\ »".($GLOBALS[‹ spip_lang_rtl ›] ? ‹ rtl › : ‹ ltr ›)."\">\n" .
+ « <head>\n » .
+# « <base href=’$base’ />\n » . #
+ « <title>$title</title>\n » .
+ « <meta http-equiv=‹ Content-Type › content=‹ text/html; charset=$charset ›>\n »;
+}
+
?>