1 | <?php |
---|
2 | |
---|
3 | /***************************************************************************\ |
---|
4 | * SPIP, Systeme de publication pour l'internet * |
---|
5 | * * |
---|
6 | * Copyright (c) 2001-2007 * |
---|
7 | * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
---|
8 | * * |
---|
9 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
---|
10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
---|
11 | \***************************************************************************/ |
---|
12 | |
---|
13 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
14 | |
---|
15 | include_spip('inc/presentation'); |
---|
16 | include_spip('inc/actions'); |
---|
17 | include_spip('inc/agenda_gestion'); |
---|
18 | include_spip('inc/pim_agenda_gestion'); |
---|
19 | |
---|
20 | // http://doc.spip.org/@exec_mots_tous_dist |
---|
21 | function exec_mots_tous_dist() |
---|
22 | { |
---|
23 | global $conf_mot, $spip_lang, $spip_lang_right, $son_groupe; |
---|
24 | global $evenements, $pim_agenda; |
---|
25 | |
---|
26 | $conf_mot = intval($conf_mot); |
---|
27 | |
---|
28 | pipeline('exec_init',array('args'=>array('exec'=>'mots_tous'),'data'=>'')); |
---|
29 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
30 | echo $commencer_page(_T('titre_page_mots_tous'), "naviguer", "mots"); |
---|
31 | debut_gauche(); |
---|
32 | |
---|
33 | if (autoriser('modifier','groupemots',$id_groupe) AND !$conf_mot){ |
---|
34 | $res = icone_horizontale(_T('icone_creation_groupe_mots'), generer_url_ecrire("mots_type","new=oui"), "groupe-mot-24.gif", "creer.gif",false); |
---|
35 | |
---|
36 | echo bloc_des_raccourcis($res); |
---|
37 | } |
---|
38 | |
---|
39 | echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_tous'),'data'=>'')); |
---|
40 | |
---|
41 | creer_colonne_droite(); |
---|
42 | echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_tous'),'data'=>'')); |
---|
43 | debut_droite(); |
---|
44 | |
---|
45 | gros_titre(_T('titre_mots_tous')); |
---|
46 | if (autoriser('modifier','groupemots',$id_groupe)) { |
---|
47 | echo typo(_T('info_creation_mots_cles')) . aide ("mots") ; |
---|
48 | } |
---|
49 | echo "<br /><br />"; |
---|
50 | |
---|
51 | // |
---|
52 | // On boucle d'abord sur les groupes de mots |
---|
53 | // |
---|
54 | |
---|
55 | $result_groupes = spip_query($q="SELECT *, ".creer_objet_multi ("titre", "$spip_lang")." FROM spip_groupes_mots ORDER BY multi"); |
---|
56 | |
---|
57 | while ($row_groupes = spip_fetch_array($result_groupes)) { |
---|
58 | $id_groupe = $row_groupes['id_groupe']; |
---|
59 | $titre_groupe = typo($row_groupes['titre']); |
---|
60 | $descriptif = $row_groupes['descriptif']; |
---|
61 | $texte = $row_groupes['texte']; |
---|
62 | $unseul = $row_groupes['unseul']; |
---|
63 | $obligatoire = $row_groupes['obligatoire']; |
---|
64 | $articles = $row_groupes['articles']; |
---|
65 | $breves = $row_groupes['breves']; |
---|
66 | $rubriques = $row_groupes['rubriques']; |
---|
67 | $syndic = $row_groupes['syndic']; |
---|
68 | $evenements = 'non'; |
---|
69 | $pim_agenda = 'non'; |
---|
70 | if (isset($GLOBALS['tables_principales']['spip_evenements'])) $evenements = $row_groupes['evenements']; |
---|
71 | if (isset($GLOBALS['tables_principales']['spip_pim_agenda'])) $pim_agenda = $row_groupes['pim_agenda']; |
---|
72 | $acces_minirezo = $row_groupes['minirezo']; |
---|
73 | $acces_comite = $row_groupes['comite']; |
---|
74 | $acces_forum = $row_groupes['forum']; |
---|
75 | |
---|
76 | // Afficher le titre du groupe |
---|
77 | echo "<a id='mots_tous-$id_groupe'></a>"; |
---|
78 | |
---|
79 | debut_cadre_enfonce("groupe-mot-24.gif", false, '', $titre_groupe); |
---|
80 | // Affichage des options du groupe (types d'elements, permissions...) |
---|
81 | echo "<font face='Verdana,Arial,Sans,sans-serif' size='1'>"; |
---|
82 | if ($articles == "oui") echo "> "._T('info_articles_2')." "; |
---|
83 | if ($breves == "oui") echo "> "._T('info_breves_02')." "; |
---|
84 | if ($rubriques == "oui") echo "> "._T('info_rubriques')." "; |
---|
85 | if ($syndic == "oui") echo "> "._T('icone_sites_references')." "; |
---|
86 | if ($evenements == "oui") echo "> "._T('agenda:info_evenements')." "; |
---|
87 | if ($pim_agenda == "oui") echo "> "._T('pimagenda:info_evenements')." "; |
---|
88 | |
---|
89 | if ($unseul == "oui" OR $obligatoire == "oui") echo "<br />"; |
---|
90 | if ($unseul == "oui") echo "> "._T('info_un_mot')." "; |
---|
91 | if ($obligatoire == "oui") echo "> "._T('info_groupe_important')." "; |
---|
92 | |
---|
93 | echo "<br />"; |
---|
94 | if ($acces_minirezo == "oui") echo "> "._T('info_administrateurs')." "; |
---|
95 | if ($acces_comite == "oui") echo "> "._T('info_redacteurs')." "; |
---|
96 | if ($acces_forum == "oui") echo "> "._T('info_visiteurs_02')." "; |
---|
97 | |
---|
98 | echo "</font>"; |
---|
99 | if ($descriptif) { |
---|
100 | echo "<div style='border: 1px dashed #aaaaaa;'>"; |
---|
101 | echo "<font size='2' face='Verdana,Arial,Sans,sans-serif'>"; |
---|
102 | echo "<b>",_T('info_descriptif'),"</b> "; |
---|
103 | echo propre($descriptif); |
---|
104 | echo " "; |
---|
105 | echo "</font>"; |
---|
106 | echo "</div>"; |
---|
107 | } |
---|
108 | |
---|
109 | if (strlen($texte)>0){ |
---|
110 | echo "<font face='Verdana,Arial,Sans,sans-serif'>"; |
---|
111 | echo propre($texte); |
---|
112 | echo "</font>"; |
---|
113 | } |
---|
114 | |
---|
115 | // |
---|
116 | // Afficher les mots-cles du groupe |
---|
117 | // |
---|
118 | |
---|
119 | $groupe = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_mots WHERE id_groupe=$id_groupe")); |
---|
120 | $groupe = $groupe['n']; |
---|
121 | |
---|
122 | echo "<div\nid='editer_mot-$id_groupe' style='position: relative;'>"; |
---|
123 | |
---|
124 | // Preliminaire: confirmation de suppression d'un mot lie ï¿œqqch |
---|
125 | // (cf fin de afficher_groupe_mots_boucle executee a l'appel precedent) |
---|
126 | if ($conf_mot AND $son_groupe==$id_groupe) { |
---|
127 | include_spip('inc/grouper_mots'); |
---|
128 | echo confirmer_mot($conf_mot, $id_groupe, $groupe); |
---|
129 | } |
---|
130 | if ($groupe) { |
---|
131 | $grouper_mots = charger_fonction('grouper_mots', 'inc'); |
---|
132 | echo $grouper_mots($id_groupe, $groupe); |
---|
133 | } |
---|
134 | |
---|
135 | echo "</div>"; |
---|
136 | |
---|
137 | if (autoriser('modifier','groupemots',$id_groupe)){ |
---|
138 | echo "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>"; |
---|
139 | echo "<tr>"; |
---|
140 | echo "<td>"; |
---|
141 | icone(_T('icone_modif_groupe_mots'), generer_url_ecrire("mots_type","id_groupe=$id_groupe"), "groupe-mot-24.gif", "edit.gif"); |
---|
142 | echo "</td>"; |
---|
143 | echo "\n<td id='editer_mot-$id_groupe-supprimer'", |
---|
144 | (!$groupe ? '' : " style='visibility: hidden'"), |
---|
145 | ">"; |
---|
146 | icone(_T('icone_supprimer_groupe_mots'), redirige_action_auteur('instituer_groupe_mots', "-$id_groupe", "mots_tous"), "groupe-mot-24.gif", "supprimer.gif"); |
---|
147 | echo "</td>"; |
---|
148 | echo "<td>"; |
---|
149 | echo "<div align='$spip_lang_right'>"; |
---|
150 | icone(_T('icone_creation_mots_cles'), generer_url_ecrire("mots_edit","new=oui&id_groupe=$id_groupe&redirect=" . generer_url_retour('mots_tous', "#mots_tous-$id_groupe")), "mot-cle-24.gif", "creer.gif"); |
---|
151 | echo "</div>"; |
---|
152 | echo "</td></tr></table>"; |
---|
153 | } |
---|
154 | |
---|
155 | fin_cadre_enfonce(); |
---|
156 | } |
---|
157 | |
---|
158 | |
---|
159 | echo fin_gauche(), fin_page(); |
---|
160 | } |
---|
161 | |
---|
162 | // http://doc.spip.org/@confirmer_mot |
---|
163 | function confirmer_mot ($conf_mot, $son_groupe, $total) |
---|
164 | { |
---|
165 | $row = spip_fetch_array(spip_query("SELECT * FROM spip_mots WHERE id_mot=$conf_mot")); |
---|
166 | if (!$row) return ""; // deja detruit (acces concurrent etc) |
---|
167 | |
---|
168 | $id_mot = $row['id_mot']; |
---|
169 | $titre_mot = typo($row['titre']); |
---|
170 | $type_mot = typo($row['type']); |
---|
171 | |
---|
172 | if (($na = intval(_request('na'))) == 1) { |
---|
173 | $texte_lie = _T('info_un_article')." "; |
---|
174 | } else if ($na > 1) { |
---|
175 | $texte_lie = _T('info_nombre_articles', array('nb_articles' => $na)) ." "; |
---|
176 | } |
---|
177 | if (($nb = intval(_request('nb'))) == 1) { |
---|
178 | $texte_lie .= _T('info_une_breve')." "; |
---|
179 | } else if ($nb > 1) { |
---|
180 | $texte_lie .= _T('info_nombre_breves', array('nb_breves' => $nb))." "; |
---|
181 | } |
---|
182 | if (($ns = intval(_request('ns'))) == 1) { |
---|
183 | $texte_lie .= _T('info_un_site')." "; |
---|
184 | } else if ($ns > 1) { |
---|
185 | $texte_lie .= _T('info_nombre_sites', array('nb_sites' => $ns))." "; |
---|
186 | } |
---|
187 | if (($nr = intval(_request('nr'))) == 1) { |
---|
188 | $texte_lie .= _T('info_une_rubrique')." "; |
---|
189 | } else if ($nr > 1) { |
---|
190 | $texte_lie .= _T('info_nombre_rubriques', array('nb_rubriques' => $nr))." "; |
---|
191 | } |
---|
192 | if (($ne = intval(_request('ne'))) == 1) { |
---|
193 | $texte_lie .= _T('agenda:info_un_evenement')." "; |
---|
194 | } else if ($ne > 1) { |
---|
195 | $texte_lie .= _T('agenda:info_nombre_evenements', array('nb_evenements' => $ne))." "; |
---|
196 | } |
---|
197 | |
---|
198 | return debut_boite_info(true) |
---|
199 | . "<div class='serif'>" |
---|
200 | . _T('info_delet_mots_cles', array('titre_mot' => $titre_mot, 'type_mot' => $type_mot, 'texte_lie' => $texte_lie)) |
---|
201 | . "<p style='text-align: right'>" |
---|
202 | . generer_supprimer_mot($id_mot, $son_groupe, ("<b>" . _T('item_oui') . "</b>"), $total) |
---|
203 | . "<br />\n" |
---|
204 | . _T('info_oui_suppression_mot_cle') |
---|
205 | . '</p>' |
---|
206 | /* troublant. A refaire avec une visibility |
---|
207 | . "<li><b><a href='" |
---|
208 | . generer_url_ecrire("mots_tous") |
---|
209 | . "#editer_mot-$son_groupe" |
---|
210 | . "'>" |
---|
211 | . _T('item_non') |
---|
212 | . "</a>,</b> " |
---|
213 | . _T('info_non_suppression_mot_cle') |
---|
214 | . "</ul>" */ |
---|
215 | . "</div>" |
---|
216 | . fin_boite_info(true); |
---|
217 | } |
---|
218 | ?> |
---|