From 36710cc0535268b0892ad870fd950723ca3d037d Mon Sep 17 00:00:00 2001
From: Antoine Pitrou <pitrou@free.fr>
Date: Sat, 15 Mar 2003 22:53:02 +0000
Subject: [PATCH] simplifications & corrections langues

---
 ecrire/admin_repair.php3     |  2 --
 ecrire/aide_gauche.php3      |  3 ---
 ecrire/export_all.php3       |  3 ---
 ecrire/inc.php3              |  2 --
 ecrire/inc_admin.php3        | 26 ++++++++++++--------------
 ecrire/inc_auth.php3         |  2 --
 ecrire/inc_presentation.php3 |  3 +++
 ecrire/install.php3          |  2 --
 ecrire/upgrade.php3          |  2 --
 inc-calcul-squel.php3        |  1 -
 inc-login.php3               | 10 +++++-----
 spip_pass.php3               |  4 +++-
 spip_test_dirs.php3          | 18 ++++++++----------
 13 files changed, 31 insertions(+), 47 deletions(-)

diff --git a/ecrire/admin_repair.php3 b/ecrire/admin_repair.php3
index 669ee84b40..edf2dcf5bc 100644
--- a/ecrire/admin_repair.php3
+++ b/ecrire/admin_repair.php3
@@ -5,8 +5,6 @@ include ("inc_version.php3");
 include_ecrire ("inc_admin.php3");
 include_ecrire ("inc_texte.php3");
 include_ecrire ("inc_presentation.php3");
-include_ecrire ("inc_lang.php3");
-utiliser_langue_visiteur();
 
 
 /*
diff --git a/ecrire/aide_gauche.php3 b/ecrire/aide_gauche.php3
index d1dfeed525..ef5c148358 100644
--- a/ecrire/aide_gauche.php3
+++ b/ecrire/aide_gauche.php3
@@ -3,7 +3,6 @@
 include ("inc_version.php3");
 include_ecrire("inc_lang.php3");
 utiliser_langue_visiteur();
-gerer_menu_langues();
 
 if (file_exists($flag_ecrire ? "inc_connect.php3" : "ecrire/inc_connect.php3")) {
 	include_ecrire("inc_auth.php3");
@@ -199,8 +198,6 @@ for ($i=0; $i<=count($texte); $i++) {
 
 echo '</TABLE>';
 
-echo "<br><div align='center'>". menu_langues()."</div>";
-
 ?>
 </BODY>
 </HTML>
diff --git a/ecrire/export_all.php3 b/ecrire/export_all.php3
index b45d87c57c..138a0026eb 100644
--- a/ecrire/export_all.php3
+++ b/ecrire/export_all.php3
@@ -2,13 +2,10 @@
 
 include ("inc_version.php3");
 
-
 include_ecrire ("inc_auth.php3");
 include_ecrire ("inc_export.php3");
 include_ecrire ("inc_admin.php3");
 include_ecrire ("inc_presentation.php3");
-include_ecrire ("inc_lang.php3");
-utiliser_langue_visiteur();
 
 if (!$archive) {
 	if ($gz) $archive = "dump.xml.gz";
diff --git a/ecrire/inc.php3 b/ecrire/inc.php3
index 7b20a60b93..e16f207db8 100644
--- a/ecrire/inc.php3
+++ b/ecrire/inc.php3
@@ -11,8 +11,6 @@ include ("inc_version.php3");
 include_ecrire("inc_auth.php3");
 
 include_ecrire("inc_presentation.php3");
-include_ecrire("inc_lang.php3");
-utiliser_langue_visiteur();
 include_ecrire("inc_texte.php3");
 include_ecrire("inc_filtres.php3");
 include_ecrire("inc_urls.php3");
diff --git a/ecrire/inc_admin.php3 b/ecrire/inc_admin.php3
index b373d79b6d..b169f2f46d 100644
--- a/ecrire/inc_admin.php3
+++ b/ecrire/inc_admin.php3
@@ -17,8 +17,6 @@ function debut_admin($action, $commentaire='') {
 
 	if ((!$action) || ($connect_statut != "0minirezo")) {
 		include_ecrire ("inc_presentation.php3");
-		include_ecrire("inc_lang.php3");
-		utiliser_langue_visiteur();
 		install_debut_html(_T('info_acces_refuse'));
 		install_fin_html();
 		exit;
@@ -32,18 +30,18 @@ function debut_admin($action, $commentaire='') {
 	include_ecrire ("inc_presentation.php3");
 	install_debut_html(_T('info_action', array('action' => $action)));
 
-		if ($commentaire) {
-			echo "<p>".propre($commentaire)."</p>";
-		}	
+	if ($commentaire) {
+		echo "<p>".propre($commentaire)."</p>";
+	}
 
-		echo $this_link->getForm('POST');
-		echo "<P><B>"._T('info_authentification_ftp')."</B>";
-		echo aide("ftp_auth");
-		echo "<P>"._T('info_creer_repertoire');
-		echo "<P align='center'><INPUT TYPE='text' NAME='fichier' CLASS='fondl' VALUE=\"$fichier\" SIZE='30'>";
-		echo "<P> "._T('info_creer_repertoire_2');
-		echo "<P align='right'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_recharger_page')."' CLASS='fondo'>";
-		echo "</FORM>";
+	echo $this_link->getForm('POST');
+	echo "<P><B>"._T('info_authentification_ftp')."</B>";
+	echo aide("ftp_auth");
+	echo "<P>"._T('info_creer_repertoire');
+	echo "<P align='center'><INPUT TYPE='text' NAME='fichier' CLASS='fondl' VALUE=\"$fichier\" SIZE='30'>";
+	echo "<P> "._T('info_creer_repertoire_2');
+	echo "<P align='right'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_recharger_page')."' CLASS='fondo'>";
+	echo "</FORM>";
 
 	install_fin_html();
 	exit;
@@ -82,4 +80,4 @@ function verifier_action_auteur($action, $valeur, $id_auteur = 0) {
 }
 
 
-?>
\ No newline at end of file
+?>
diff --git a/ecrire/inc_auth.php3 b/ecrire/inc_auth.php3
index 09b38a8449..f4f937f1c5 100644
--- a/ecrire/inc_auth.php3
+++ b/ecrire/inc_auth.php3
@@ -198,8 +198,6 @@ function auth() {
 		// notamment, une restauration de base de donnees dans laquelle
 		// il n'existe pas.
 		include_ecrire('inc_presentation.php3');
-		include_ecrire("inc_lang.php3");
-		utiliser_langue_visiteur();
 		include_ecrire('inc_texte.php3');
 		install_debut_html(_T('avis_erreur_connexion'));
 		echo "<br><br><p>"._T('texte_inc_auth_1', array('auth_login' => $auth_login))." <A HREF='../spip_cookie.php3?logout=$auth_login'>".
diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3
index d4e1d75b91..0fe0f4e3c7 100644
--- a/ecrire/inc_presentation.php3
+++ b/ecrire/inc_presentation.php3
@@ -5,6 +5,9 @@
 if (defined("_ECRIRE_INC_PRESENTATION")) return;
 define("_ECRIRE_INC_PRESENTATION", "1");
 
+include_ecrire ("inc_lang.php3");
+utiliser_langue_visiteur();
+
 
 //
 // Aide
diff --git a/ecrire/install.php3 b/ecrire/install.php3
index d0b0aa94a8..c341f29589 100644
--- a/ecrire/install.php3
+++ b/ecrire/install.php3
@@ -3,8 +3,6 @@
 include ("inc_version.php3");
 
 include_ecrire ("inc_presentation.php3");
-include_ecrire ("inc_lang.php3");
-utiliser_langue_visiteur();
 
 gerer_menu_langues();
 
diff --git a/ecrire/upgrade.php3 b/ecrire/upgrade.php3
index 0bd4196da6..58d2d483b2 100644
--- a/ecrire/upgrade.php3
+++ b/ecrire/upgrade.php3
@@ -13,8 +13,6 @@ if ($reinstall == 'oui') {
 	@copy("inc_connect.php3", "inc_connect_install.php3");
 
 	include_ecrire("inc_presentation.php3");
-	include_ecrire ("inc_lang.php3");
-	utiliser_langue_visiteur();
 	install_debut_html(_T('titre_page_upgrade'));
 	echo "<p><b>"._T('texte_nouvelle_version_spip_1')."</b><p> ";
 	echo _T('texte_nouvelle_version_spip_2');
diff --git a/inc-calcul-squel.php3 b/inc-calcul-squel.php3
index 8c87aea989..eea8dfc85a 100644
--- a/inc-calcul-squel.php3
+++ b/inc-calcul-squel.php3
@@ -1865,7 +1865,6 @@ function calculer_boucle($id_boucle, $prefix_boucle)
 	$texte .= '	$query = $instance->requete;
 	$result = @spip_query($query);
 	if (!$result) {
-		include_ecrire("inc_presentation.php3");
 		$retour .= "<tt><br><br><blink>&lt;BOUCLE'.$id_boucle.'&gt;</blink><br>\n".
 		"<b>Erreur dans la requ&ecirc;te envoy&eacute;e &agrave; MySQL :</b><br>\n".
 		htmlspecialchars($query)."<br>\n<font color=\'red\'><b>&gt; ".
diff --git a/inc-login.php3 b/inc-login.php3
index ca8105a69d..25f9e41023 100644
--- a/inc-login.php3
+++ b/inc-login.php3
@@ -7,7 +7,7 @@ define("_INC_LOGIN", "1");
 
 
 include_ecrire ("inc_meta.php3");
-include_ecrire ("inc_presentation.php3");
+//include_ecrire ("inc_presentation.php3");
 include_ecrire ("inc_session.php3");
 include_ecrire ("inc_filtres.php3");
 include_ecrire ("inc_texte.php3");
@@ -37,11 +37,11 @@ function auth_http($cible, $essai_auth_http) {
 }
 
 function ouvre_login($titre) {
-	
+
 	$retour .= "<div>";
-	
+
 	if ($titre) $retour .= "<h3 class='spip'>$titre</h3>";
-	
+
 	$retour .= '<font size="2" face="Verdana,arial,helvetica,sans-serif">';
 	return $retour;
 }
@@ -164,7 +164,7 @@ function login($cible = '', $prive = 'prive', $message_login='') {
 				"document.write('"._T('login_login')." <b>$login</b> <br><font size=\\'2\\'>[<a href=\\'spip_cookie.php3?cookie_admin=non&url=".rawurlencode($clean_link->getUrl())."\\'>"._T('login_autre_identifiant')."</a>]</font>');\n" .
 				"//--></script>\n";
 			echo "<input type='hidden' name='session_login_hidden' value='$login'>";
-	
+
 			// si jaja inactif, le login est modifiable (puisque le challenge n'est pas utilise)
 			echo "<noscript>";
 			echo "<font face='Georgia, Garamond, Times, serif' size='3'>";
diff --git a/spip_pass.php3 b/spip_pass.php3
index 532022f6c6..2de3e16d2c 100644
--- a/spip_pass.php3
+++ b/spip_pass.php3
@@ -14,6 +14,8 @@ include_ecrire ("inc_acces.php3");
 
 include_local("inc-formulaires.php3");
 
+utiliser_langue_site();
+
 $inscriptions_ecrire = (lire_meta("accepter_inscriptions") == "oui") ;
 
 // recuperer le cookie de relance
@@ -121,4 +123,4 @@ echo "<p align='right'><script type='text/javascript'><!--
 
 install_fin_html();
 
-?>
\ No newline at end of file
+?>
diff --git a/spip_test_dirs.php3 b/spip_test_dirs.php3
index 7deb08836e..09b4b30be9 100644
--- a/spip_test_dirs.php3
+++ b/spip_test_dirs.php3
@@ -3,12 +3,12 @@
 include("ecrire/inc_version.php3");
 
 include_ecrire("inc_presentation.php3");
-include_ecrire ("inc_lang.php3");
-utiliser_langue_visiteur();
 
 gerer_menu_langues();
 
 function bad_dirs($bad_dirs, $test_dir, $install) {
+	install_debut_html();
+
 	if ($install) {
 		$titre = _T('dirs_preliminaire');
 		$continuer = _T('dirs_commencer');
@@ -18,7 +18,8 @@ function bad_dirs($bad_dirs, $test_dir, $install) {
 	$bad_url = "spip_test_dirs.php3";
 	if ($test_dir) $bad_url .= '?test_dir='.$test_dir;
 
-	echo "<BR><FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>";
+	echo "<br><div style='float: right'>". menu_langues()."</div>";
+	echo "<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>";
 
 	echo _T('dirs_repertoires_suivants', array('bad_dirs' => $bad_dirs));
 	echo " <B><A HREF='$bad_url'> ". _T('login_recharger')."</A> $continuer.";
@@ -26,11 +27,11 @@ function bad_dirs($bad_dirs, $test_dir, $install) {
 	if ($install)
 		echo aide ("install0");
 
-	echo "<br><div align='center'>". menu_langues()."</div>";
-
 	echo "<FORM ACTION='$bad_urls' METHOD='GET'>\n";
 	echo "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' NAME='Valider' VALUE='". _T('login_recharger')."'></DIV>";
-	echo "</FORM>";	
+	echo "</FORM>";
+
+	install_fin_html();
 }
 
 //
@@ -52,16 +53,13 @@ while (list(, $my_dir) = each($test_dirs)) {
 	if (!$f) $ok = false;
 	else if (!@fclose($f)) $ok = false;
 	else if (!@unlink($nom_fich)) $ok = false;
-	
+
 	if (!$ok) $bad_dirs[] = "<LI>".$my_dir;
 }
 
 if ($bad_dirs) {
 	$bad_dirs = join(" ", $bad_dirs);
-	install_debut_html();
 	bad_dirs($bad_dirs, $test_dir, $install);
-
-	install_fin_html();
 } else {
 	if ($install)
 		header("Location: ./ecrire/install.php3?etape=1");
-- 
GitLab