diff --git a/ecrire/inc_mots.php3 b/ecrire/inc_mots.php3 index 27b6a6f5fda70f32cce21141e3bd8dadbe60dcb6..8371c5e9561e4a179bf09b028960f37f66e36f87 100644 --- a/ecrire/inc_mots.php3 +++ b/ecrire/inc_mots.php3 @@ -146,7 +146,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, echo "<a name='mots'></a>"; if ($flag_editable){ - if ($nouv_mot.$cherche_mot.$supp_mot) + if ($nouv_mot||$cherche_mot||$supp_mot) $bouton = bouton_block_visible("lesmots"); else $bouton = bouton_block_invisible("lesmots"); @@ -158,7 +158,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, // if ($nouv_mot) - $nouveaux_mots[] = $nouv_mot; + $nouveaux_mots = array($nouv_mot); $tous_les_mots = split(" *[,;] *", $cherche_mot); while ((list(,$cherche_mot) = each ($tous_les_mots)) AND $cherche_mot) { @@ -244,7 +244,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, fin_boite_info(); echo "<P>"; - } + } // fin de la boucle sur la recherche de mots ////////////////////////////////////////////////////// @@ -283,10 +283,6 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, // Afficher les mots-cles // - $query = "SELECT DISTINCT type FROM spip_mots"; - $result = spip_query($query); - $plusieurs_types = (spip_num_rows($result) > 1); - unset($les_mots); $query = "SELECT mots.* FROM spip_mots AS mots, spip_mots_$table AS lien WHERE lien.$id_table=$id_objet AND mots.id_mot=lien.id_mot ORDER BY mots.type, mots.titre"; @@ -369,12 +365,12 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, $vals[] = "$type_mot"; if ($flag_editable){ - $s = ""; if ($flag_groupe) - $s .= "<A HREF=\"$url_base&supp_mot=$id_mot#mots\">"._T('info_retirer_mot')." " . http_img_pack('croix-rouge.gif', "X", "width='7' height='7' border='0' align='middle'") ."</A>"; - else $s .= " "; - } - $vals[] = $s; + $s = "<A HREF=\"$url_base&supp_mot=$id_mot#mots\">"._T('info_retirer_mot')." " . http_img_pack('croix-rouge.gif', "X", "width='7' height='7' border='0' align='middle'") ."</A>"; + else $s = " "; + $vals[] = $s; + } else $vals[]= ""; + $tableau[] = $vals; @@ -545,7 +541,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, } function afficher_groupe_mots($id_groupe) { - global $connect_id_auteur, $connect_statut; + global $connect_id_auteur, $connect_statut, $connect_toutes_rubriques; global $spip_lang_right; $query = "SELECT id_mot, titre, ".creer_objet_multi ("titre", "$spip_lang")." FROM spip_mots WHERE id_groupe = '$id_groupe' ORDER BY multi"; @@ -635,7 +631,7 @@ function afficher_groupe_mots($id_groupe) { $vals[] = $texte_lie; - if ($connect_statut=="0minirezo") { + if ($connect_statut=="0minirezo" AND $connect_toutes_rubriques) { $vals[] = "<div style='text-align:right;'><a href='mots_tous.php3?conf_mot=$id_mot'>"._T('info_supprimer_mot')." <img src='" . _DIR_IMG_PACK . "croix-rouge.gif' alt='X' width='7' height='7' border='0' align='bottom' /></a></div>"; } diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3 index a48420c0e7095a7c49d37f84a07db91ee433458f..7947c906e3009312e8b226740cf469e59654a094 100644 --- a/ecrire/inc_presentation.php3 +++ b/ecrire/inc_presentation.php3 @@ -659,8 +659,8 @@ function puce_statut_article($id, $statut, $id_rubrique) { return $inser_puce; } -function puce_statut_breve($id, $statut, $type, $id_rubrique=0) { - global $spip_lang_left, $dir_lang, $connect_statut, $options; +function puce_statut_breve($id, $statut, $type, $droit) { + global $spip_lang_left, $dir_lang; $puces = array( 0 => 'puce-orange-breve.gif', @@ -693,8 +693,7 @@ function puce_statut_breve($id, $statut, $type, $id_rubrique=0) { $type1 = "statut$type$id"; $inser_puce = http_img_pack($puce, "", "id='img$type1' border='0' style='margin: 1px;'"); - if (!($connect_statut == '0minirezo' AND $options == 'avancees' AND acces_rubrique($id_rubrique))) - return $inser_puce; + if (!$droit) return $inser_puce; $type2 = "statutdecal$type$id"; $action = "onmouseover=\"montrer('$type2');\"\n"; @@ -1187,8 +1186,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals function afficher_breves($titre_table, $requete, $affrub=false) { global $connect_id_auteur, $spip_lang_right, $spip_lang_left, $dir_lang, $couleur_claire, $couleur_foncee; - global $options; - + global $connect_statut, $options; if ((lire_meta('multi_rubriques') == 'oui' AND $GLOBALS['id_rubrique'] == 0) OR lire_meta('multi_articles') == 'oui') { @@ -1219,6 +1217,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) { $result = spip_query($requete); $table = ''; + $droit = ($connect_statut == '0minirezo' && $options == 'avancees'); while ($row = spip_fetch_array($result)) { $vals = ''; @@ -1230,7 +1229,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) { if ($lang = $row['lang']) changer_typo($lang); $id_rubrique = $row['id_rubrique']; - $vals[] = puce_statut_breve($id_breve, $statut, 'breve', $id_rubrique); + $vals[] = puce_statut_breve($id_breve, $statut, 'breve', ($droit && acces_rubrique($id_rubrique)), $id_rubrique); $s = "<div>"; $s .= "<a href='breves_voir.php3?id_breve=$id_breve'$dir_lang style=\"display:block;\">"; diff --git a/ecrire/mots_edit.php3 b/ecrire/mots_edit.php3 index 2f9687d9112b069e7c01bea84f18e64c6bbf84e2..0ea3c2895d00238d842c006a26335b1794cb39df 100644 --- a/ecrire/mots_edit.php3 +++ b/ecrire/mots_edit.php3 @@ -20,7 +20,7 @@ include_ecrire ("inc_abstract_sql.php3"); // // modifications mot // -if ($connect_statut == '0minirezo') { +if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) { if ($supp_mot) { $query = "DELETE FROM spip_mots WHERE id_mot=$supp_mot"; $result = spip_query($query); @@ -123,7 +123,7 @@ echo "</center>"; // Logos du mot-clef // -if ($id_mot > 0 AND $connect_statut == '0minirezo') +if ($id_mot > 0 AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques) afficher_boite_logo('mot', 'id_mot', $id_mot, _T('logo_mot_cle').aide("breveslogo"), _T('logo_survol')); @@ -135,7 +135,7 @@ debut_raccourcis(); icone_horizontale(_T('icone_voir_tous_mots_cles'), "mots_tous.php3", "mot-cle-24.gif", "rien.gif"); -if ($connect_statut == '0minirezo') +if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) icone_horizontale(_T('icone_creation_mots_cles'), "mots_edit.php3?new=oui&redirect=mots_tous.php3&id_groupe=$id_groupe", "mot-cle-24.gif", "creer.gif"); fin_raccourcis(); @@ -202,7 +202,7 @@ fin_cadre_relief(); -if ($connect_statut =="0minirezo"){ +if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques){ echo "<P>"; debut_cadre_formulaire(); diff --git a/ecrire/mots_tous.php3 b/ecrire/mots_tous.php3 index 61cfe2a9cd4ebc4385e8e33e443451f64847cc9a..1b1eaea2972107146b9372bceb94f4417e35ee44 100644 --- a/ecrire/mots_tous.php3 +++ b/ecrire/mots_tous.php3 @@ -14,6 +14,10 @@ include ("inc.php3"); include_ecrire("inc_mots.php3"); +// secure +if (!($connect_statut == '0minirezo' AND $connect_toutes_rubriques)) + $conf_mot = ""; + // suppression d'un mot ? if ($conf_mot = intval($conf_mot)) { $query = "SELECT * FROM spip_mots WHERE id_mot='$conf_mot'"; @@ -56,7 +60,7 @@ if ($conf_mot = intval($conf_mot)) { } -if ($connect_statut == '0minirezo') { +if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) { if ($modifier_groupe == "oui") { $change_type = addslashes(corriger_caracteres($change_type)); $ancien_type = addslashes(corriger_caracteres($ancien_type)); @@ -82,7 +86,7 @@ if ($connect_statut == '0minirezo') { $query="DELETE FROM spip_groupes_mots WHERE id_groupe='$supp_group'"; $result=spip_query($query); } -} + } debut_page(_T('titre_page_mots_tous'), "documents", "mots"); @@ -91,7 +95,10 @@ debut_gauche(); debut_droite(); gros_titre(_T('titre_mots_tous')); -echo typo(_T('info_creation_mots_cles')) . aide ("mots") . "<br><br>"; +if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) { + echo typo(_T('info_creation_mots_cles')) . aide ("mots") ; + } +echo "<br><br>"; ///// @@ -242,7 +249,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) { // $supprimer_groupe = afficher_groupe_mots($id_groupe); - if ($connect_statut =="0minirezo" AND !$conf_mot){ + if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques AND !$conf_mot){ echo "\n<table cellpadding=0 cellspacing=0 border=0 width=100%>"; echo "<tr>"; echo "<td>"; @@ -264,7 +271,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) { fin_cadre_enfonce(); } -if ($connect_statut =="0minirezo" AND !$conf_mot){ +if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques AND !$conf_mot){ echo "<p> </p><div align='right'>"; icone(_T('icone_creation_groupe_mots'), "mots_type.php3?new=oui", "groupe-mot-24.gif", "creer.gif"); echo "</div>"; diff --git a/ecrire/naviguer.php3 b/ecrire/naviguer.php3 index bc4e3a2cd202d61ae63e4212a51cef3908495a3e..20f0c3d0790e5569834386844014741b10a2348d 100644 --- a/ecrire/naviguer.php3 +++ b/ecrire/naviguer.php3 @@ -244,7 +244,7 @@ echo "</table>\n"; /// Mots-cles -if ($flag_mots!= 'non' AND $flag_editable AND $options == 'avancees' AND $id_rubrique > 0) { +if ($flag_mots!= 'non' AND $id_rubrique > 0) { echo "\n<p>"; formulaire_mots('rubriques', $id_rubrique, $nouv_mot, $supp_mot, $cherche_mot, $flag_editable); }