From a34259f37413c01275abd5107c8b4ec53e17a004 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Sat, 9 Jul 2005 21:42:03 +0000 Subject: [PATCH] =?UTF-8?q?ajout=20du=20#TEXTE=20et=20#DESCRIPTIF=20dans?= =?UTF-8?q?=20les=20groupes=20de=20mots-cl=C3=A9s=20(Jacques)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/mot.html | 10 +++++----- ecrire/inc_majbase.php3 | 7 +++++++ ecrire/inc_serialbase.php3 | 2 ++ ecrire/inc_version.php3 | 2 +- ecrire/mots_tous.php3 | 23 +++++++++++++++++++++-- ecrire/mots_type.php3 | 22 ++++++++++++++++++++++ 6 files changed, 58 insertions(+), 8 deletions(-) diff --git a/dist/mot.html b/dist/mot.html index 8441c1c20f..be14d80699 100644 --- a/dist/mot.html +++ b/dist/mot.html @@ -54,10 +54,10 @@ <div class="menu"> <div class="divers"> -<div class="menu-titre"><BOUCLE_groupe(GROUPES_MOTS) {id_groupe} {doublons}>#TITRE</BOUCLE_groupe></div> - <ul class="menu-liste"> -<BOUCLE_mots_freres(MOTS) {type} {doublons} {par titre}> - <li class="menu-item"><a href="#URL_MOT" title="[(#DESCRIPTIF|textebrut|entites_html)]">#TITRE</a></li> +<BOUCLE_groupe(GROUPES_MOTS) {id_groupe} {doublons}><div class="menu-titre"[ title="(#DESCRIPTIF|attribut_html)"]>#TITRE</div></BOUCLE_groupe> +<ul class="menu-liste"> +<BOUCLE_mots_freres(MOTS) {type} {par titre}> + <li class="menu-item"><a [(#EXPOSE{name,href})]="#URL_MOT" title="[(#DESCRIPTIF|textebrut|entites_html)]">#TITRE</a></li> </BOUCLE_mots_freres> </ul> </div> @@ -76,7 +76,7 @@ <ul class="menu-liste"> <BOUCLE_groupes_freres(GROUPES_MOTS) {par titre} {doublons}> <BOUCLE_mot_cousin(MOTS) {id_groupe} {par titre} {0,1}> - <li class="menu-item"><a href="#URL_MOT">#TYPE</a></li> + <li class="menu-item"[ title="(#_groupes_freres:DESCRIPTIF|attribut_html)"]><a href="#URL_MOT">#TYPE</a></li> </BOUCLE_mot_cousin> </BOUCLE_groupes_freres> </ul> diff --git a/ecrire/inc_majbase.php3 b/ecrire/inc_majbase.php3 index e0d2da2614..2f89d25f0f 100644 --- a/ecrire/inc_majbase.php3 +++ b/ecrire/inc_majbase.php3 @@ -994,6 +994,13 @@ function maj_base() { if ($version_installee < 1.816) { maj_version(1.816); } + if ($version_installee < 1.817) { + spip_query("ALTER TABLE spip_groupes_mots + ADD descriptif text NOT NULL AFTER titre"); + spip_query("ALTER TABLE spip_groupes_mots + ADD COLUMN texte longblob NOT NULL AFTER descriptif"); + maj_version(1.817); + } return true; diff --git a/ecrire/inc_serialbase.php3 b/ecrire/inc_serialbase.php3 index a4e07f9ec8..410de10012 100644 --- a/ecrire/inc_serialbase.php3 +++ b/ecrire/inc_serialbase.php3 @@ -154,6 +154,8 @@ $spip_mots_key = array( $spip_groupes_mots = array( "id_groupe" => "bigint(21) NOT NULL", "titre" => "text NOT NULL", + "descriptif" => "text NOT NULL", + "texte" => "longblob NOT NULL", "unseul" => "varchar(3) NOT NULL", "obligatoire" => "varchar(3) NOT NULL", "articles" => "varchar(3) NOT NULL", diff --git a/ecrire/inc_version.php3 b/ecrire/inc_version.php3 index 2c200fa209..771a080d9d 100644 --- a/ecrire/inc_version.php3 +++ b/ecrire/inc_version.php3 @@ -412,7 +412,7 @@ define_once('_AUTH_USER_FILE', '.htpasswd'); // (utilise pour les modifs de la base de donnees) // version de la base -$spip_version = 1.816; +$spip_version = 1.817; // version de spip $spip_version_affichee = "1.8.2 CVS beta 1"; diff --git a/ecrire/mots_tous.php3 b/ecrire/mots_tous.php3 index 04907a5208..af4c2c967b 100644 --- a/ecrire/mots_tous.php3 +++ b/ecrire/mots_tous.php3 @@ -57,18 +57,20 @@ if ($connect_statut == '0minirezo') { if ($modifier_groupe == "oui") { $change_type = addslashes(corriger_caracteres($change_type)); $ancien_type = addslashes(corriger_caracteres($ancien_type)); + $texte = addslashes(corriger_caracteres($texte)); + $descriptif = addslashes(corriger_caracteres($descriptif)); if ($ancien_type) { // modif groupe $query = "UPDATE spip_mots SET type='$change_type' WHERE id_groupe='$id_groupe'"; spip_query($query); - $query = "UPDATE spip_groupes_mots SET titre='$change_type', unseul='$unseul', obligatoire='$obligatoire', + $query = "UPDATE spip_groupes_mots SET titre='$change_type', texte='$texte', descriptif='$descriptif', unseul='$unseul', obligatoire='$obligatoire', articles='$articles', breves='$breves', rubriques='$rubriques', syndic='$syndic', 0minirezo='$acces_minirezo', 1comite='$acces_comite', 6forum='$acces_forum' WHERE id_groupe='$id_groupe'"; spip_query($query); } else { // creation groupe - $query = "INSERT INTO spip_groupes_mots SET titre='$change_type', unseul='$unseul', obligatoire='$obligatoire', + $query = "INSERT INTO spip_groupes_mots SET titre='$change_type', texte='$texte', descriptif='$descriptif', unseul='$unseul', obligatoire='$obligatoire', articles='$articles', breves='$breves', rubriques='$rubriques', syndic='$syndic', 0minirezo='$acces_minirezo', 1comite='$acces_comite', 6forum='$acces_forum'"; spip_query($query); @@ -188,6 +190,8 @@ $result_groupes = spip_query($query_groupes); while ($row_groupes = spip_fetch_array($result_groupes)) { $id_groupe = $row_groupes['id_groupe']; $titre_groupe = typo($row_groupes['titre']); + $descriptif = $row_groupes['descriptif']; + $texte = $row_groupes['texte']; $unseul = $row_groupes['unseul']; $obligatoire = $row_groupes['obligatoire']; $articles = $row_groupes['articles']; @@ -217,6 +221,21 @@ while ($row_groupes = spip_fetch_array($result_groupes)) { if ($acces_forum == "oui") echo "> "._T('info_visiteurs_02')." "; echo "</font>"; + if ($descriptif) { + echo "<p><div align='left' border: 1px dashed #aaaaaa;'>"; + echo "<font size=2 face='Verdana,Arial,Sans,sans-serif'>"; + echo "<b>"._T('info_descriptif')."</b> "; + echo propre($descriptif); + echo " "; + echo "</font>"; + echo "</div>"; + } + + if (strlen($texte)>0){ + echo "<FONT FACE='Verdana,Arial,Sans,sans-serif'>"; + echo "<P>".propre($texte); + echo "</FONT>"; + } // // Afficher les mots-cles du groupe diff --git a/ecrire/mots_type.php3 b/ecrire/mots_type.php3 index 98a6821ba0..5bfc129701 100644 --- a/ecrire/mots_type.php3 +++ b/ecrire/mots_type.php3 @@ -36,6 +36,8 @@ if ($connect_statut == '0minirezo' AND $new == "oui") { $type = $row['titre']; $ancien_type = $type; $titre = typo($type); + $descriptif = $row['descriptif']; + $texte = $row['texte']; $unseul = $row['unseul']; $obligatoire = $row['obligatoire']; $articles = $row['articles']; @@ -83,6 +85,26 @@ if ($connect_statut =="0minirezo"){ debut_cadre_formulaire(); echo "<b>"._T('info_changer_nom_groupe')."</b><br>\n"; echo "<INPUT TYPE='Text' SIZE=40 CLASS='formo' NAME='change_type' VALUE=\"$type\" $onfocus>\n"; + + if ($options == 'avancees' OR $descriptif) { + echo "<B>"._T('texte_descriptif_rapide')."</B><BR>"; + echo "<TEXTAREA NAME='descriptif' CLASS='forml' ROWS='4' COLS='40' wrap=soft>"; + echo $descriptif; + echo "</TEXTAREA><P>\n"; + } + else + echo "<INPUT TYPE='hidden' NAME='descriptif' VALUE=\"$descriptif\">"; + + if ($options == 'avancees' OR $texte) { + echo "<B>"._T('info_texte_explicatif')."</B><BR>"; + echo "<TEXTAREA NAME='texte' ROWS='8' CLASS='forml' COLS='40' wrap=soft>"; + echo $texte; + echo "</TEXTAREA><P>\n"; + } + else + echo "<INPUT TYPE='hidden' NAME='texte' VALUE=\"$texte\">"; + + echo "<p><div align='right'><INPUT TYPE='submit' CLASS='fondo' NAME='Valider' VALUE='"._T('bouton_valider')."'></div>"; fin_cadre_formulaire(); } -- GitLab