From ebbed633f9fc34fa31b91dce363ea1271775d11f Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sat, 14 Jan 2006 08:33:15 +0000
Subject: [PATCH] input repetes dans les formulaires de mots

---
 ecrire/inc_mots.php3     | 12 +++++-------
 ecrire/inc_mots_edit.php | 28 +++++++++++++---------------
 2 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/ecrire/inc_mots.php3 b/ecrire/inc_mots.php3
index 6fe1c85a82..e9d7ed3e28 100644
--- a/ecrire/inc_mots.php3
+++ b/ecrire/inc_mots.php3
@@ -331,11 +331,8 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
 	
 			// Changer
 			if ($unseul == "oui" AND $flag_groupe) {
-			  $s =  generer_url_post_ecrire($url_base,"$id_table=$id_objet", '', "#mots") .
-			    "<input type='hidden' name='$id_table' VALUE='$id_objet' />";
-				if ($table == 'rubriques') $s .= "<INPUT TYPE='Hidden' NAME='id_rubrique' VALUE='$id_objet'>";
-				$s .= "<select name='nouv_mot' onChange=\"setvisibility('valider_groupe_$id_groupe', 'visible');\" CLASS='fondl' STYLE='font-size:10px; width:90px;'>";
-	
+				$s =  generer_url_post_ecrire($url_base,"$id_table=$id_objet", '', "#mots") . 
+					"<select name='nouv_mot' onChange=\"setvisibility('valider_groupe_$id_groupe', 'visible');\" CLASS='fondl' STYLE='font-size:10px; width:90px;'>";
 				$query_autres_mots = "SELECT * FROM spip_mots WHERE id_groupe = $id_groupe ORDER by titre";
 				$result_autres_mots = spip_query($query_autres_mots);
 				while ($row_autres = spip_fetch_array($result_autres_mots)) {
@@ -344,10 +341,10 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
 	
 					if ($le_mot == $id_mot) $selected = "SELECTED";
 					else $selected = "";
-					$s .= "<option value='$le_mot' $selected> $le_titre_mot";
+					$s .= "<option value='$le_mot' $selected> $le_titre_mot</option>";
 				}
 				$s .= "</select>";
-				$s .= "<INPUT TYPE='Hidden' NAME='supp_mot' VALUE='$id_mot'>";
+				$s .= "<input type='hidden' name='supp_mot' VALUE='$id_mot' />";
 				$s .= "<span class='visible_au_chargement' id='valider_groupe_$id_groupe'>";
 				$s .= " &nbsp; <INPUT TYPE='submit' NAME='Choisir' VALUE='"._T('bouton_changer')."' CLASS='fondo' style='font-size: 10px';>";
 				$s .= "</span>";
@@ -420,6 +417,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
 		}
 
 		// il faudrait rajouter STYLE='margin:1px;' qq part
+
 		$form_mot = generer_url_post_ecrire($url_base,"$id_table=$id_objet", '', "#mots");
 
 		if ($table == 'rubriques') $form_mot .= "<INPUT TYPE='Hidden' NAME='id_rubrique' VALUE='$id_objet' />";
diff --git a/ecrire/inc_mots_edit.php b/ecrire/inc_mots_edit.php
index 7e0ab2a869..d0bfa5f99c 100644
--- a/ecrire/inc_mots_edit.php
+++ b/ecrire/inc_mots_edit.php
@@ -236,18 +236,16 @@ if ($connect_statut =="0minirezo"  AND $connect_toutes_rubriques){
 	echo "<P>";
 	debut_cadre_formulaire();
 
-	echo generer_url_post_ecrire("mots_edit");
 	echo "<div class='serif'>";
-	
-	if ($id_mot)
-		echo "<INPUT TYPE='Hidden' NAME='id_mot' VALUE='$id_mot'>\n";
-	else if ($new=='oui')
-		echo "<INPUT TYPE='Hidden' NAME='new' VALUE='oui' />\n";
-	echo "<INPUT TYPE='Hidden' NAME='redirect' VALUE=\"$redirect\" />\n";
-	echo "<INPUT TYPE='Hidden' NAME='redirect_ok' VALUE='oui' />\n";
-	echo "<INPUT TYPE='Hidden' NAME='table' VALUE='$table' />\n";
-	echo "<INPUT TYPE='Hidden' NAME='id_table' VALUE='$id_table' />\n";
-	echo "<INPUT TYPE='Hidden' NAME='ajouter_id_article' VALUE=\"$ajouter_id_article\" />\n";
+	echo generer_url_post_ecrire("mots_edit", ($id_mot ? "id_mot=$id_mot" : ""));
+
+	if ($new=='oui')
+		echo "<input type='hidden' name='new' VALUE='oui' />\n";
+	echo "<input type='hidden' name='redirect' VALUE=\"$redirect\" />\n";
+	echo "<input type='hidden' name='redirect_ok' VALUE='oui' />\n";
+	echo "<input type='hidden' name='table' VALUE='$table' />\n";
+	echo "<input type='hidden' name='id_table' VALUE='$id_table' />\n";
+	echo "<input type='hidden' name='ajouter_id_article' VALUE=\"$ajouter_id_article\" />\n";
 
 	$titre_mot = entites_html($titre_mot);
 	$descriptif = entites_html($descriptif);
@@ -256,7 +254,7 @@ if ($connect_statut =="0minirezo"  AND $connect_toutes_rubriques){
 	echo "<B>"._T('info_titre_mot_cle')."</B> "._T('info_obligatoire_02');
 	echo aide ("mots");
 
-	echo "<BR><INPUT TYPE='text' NAME='titre_mot' CLASS='formo' VALUE=\"$titre_mot\" SIZE='40' $onfocus />";
+	echo "<BR><input type='text' NAME='titre_mot' CLASS='formo' VALUE=\"$titre_mot\" SIZE='40' $onfocus />";
 
 	// dans le groupe...
 	$query_groupes = "SELECT id_groupe, titre FROM spip_groupes_mots ORDER BY titre";
@@ -294,7 +292,7 @@ if ($connect_statut =="0minirezo"  AND $connect_toutes_rubriques){
 		echo "</TEXTAREA><P>\n";
 	}
 	else
-		echo "<INPUT TYPE='hidden' NAME='descriptif' VALUE=\"$descriptif\">";
+		echo "<input type='hidden' NAME='descriptif' VALUE=\"$descriptif\">";
 
 	if ($options == 'avancees' OR $texte) {
 		echo "<B>"._T('info_texte_explicatif')."</B><BR>";
@@ -303,14 +301,14 @@ if ($connect_statut =="0minirezo"  AND $connect_toutes_rubriques){
 		echo "</TEXTAREA><P>\n";
 	}
 	else
-		echo "<INPUT TYPE='hidden' NAME='texte' VALUE=\"$texte\">";
+		echo "<input type='hidden' NAME='texte' VALUE=\"$texte\">";
 
 	if ($champs_extra) {
 		include_ecrire("inc_extra");
 		extra_saisie($extra, 'mots', $id_groupe);
 	}
 
-	echo "<DIV align='right'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_enregistrer')."' CLASS='fondo'></div>";
+	echo "<DIV align='right'><input type='submit' NAME='Valider' VALUE='"._T('bouton_enregistrer')."' CLASS='fondo'></div>";
 	
 	echo "</div>";
 	echo "</FORM>";
-- 
GitLab