source: trunk/spip/esqueleto-redcta/plugins/agenda/1_9_1/exec/mots_type.php @ 30

Last change on this file since 30 was 30, checked in by sebas, 17 years ago

nueva importacion del codigo del esqueleto de redcta con los plugins

File size: 8.9 KB
Line 
1<?php
2
3/***************************************************************************\
4 *  SPIP, Systeme de publication pour l'internet                           *
5 *                                                                         *
6 *  Copyright (c) 2001-2006                                                *
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
13if (!defined("_ECRIRE_INC_VERSION")) return;
14
15include_spip('inc/presentation');
16include_spip('base/agenda_evenements'); // si le plugin existe
17include_spip('base/pim_agenda'); // si le plugin existe
18
19// http://doc.spip.org/@exec_mots_type_dist
20function exec_mots_type_dist()
21{
22  global $connect_statut, $descriptif, $id_groupe, $new, $options, $texte, $titre;
23  global $tables_principales;
24
25  $id_groupe= intval($id_groupe);
26
27if ($connect_statut == '0minirezo' AND $new == "oui") {
28        $id_groupe = '';
29        $type = filtrer_entites(_T('titre_nouveau_groupe'));
30        $onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
31        $ancien_type = '';
32        $unseul = 'non';
33        $obligatoire = 'non';
34        $articles = 'oui';
35        $breves = 'oui';
36        $rubriques = 'non';
37        $syndic = 'oui';
38        $evenements = 'non';
39        $pim_agenda = 'non';
40        $acces_minirezo = 'oui';
41        $acces_comite = 'oui';
42        $acces_forum = 'non';
43} else {
44        $result_groupes = spip_query("SELECT * FROM spip_groupes_mots WHERE id_groupe=$id_groupe");
45
46        while($row = spip_fetch_array($result_groupes)) {
47                $id_groupe = $row['id_groupe'];
48                $type = $row['titre'];
49                $titre = typo($type);
50                $descriptif = $row['descriptif'];
51                $texte = $row['texte'];
52                $unseul = $row['unseul'];
53                $obligatoire = $row['obligatoire'];
54                $articles = $row['articles'];
55                $breves = $row['breves'];
56                $rubriques = $row['rubriques'];
57                $syndic = $row['syndic'];
58                if (isset($row['evenements']))
59                        $evenements = $row['evenements'];
60                if (isset($row['pim_agenda']))
61                        $pim_agenda = $row['pim_agenda'];
62                $acces_minirezo = $row['minirezo'];
63                $acces_comite = $row['comite'];
64                $acces_forum = $row['forum'];
65                $onfocus ="";
66                $new = '';
67        }
68}
69
70pipeline('exec_init',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
71debut_page("&laquo; $titre &raquo;", "naviguer", "mots");
72
73debut_gauche();
74
75
76
77echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
78creer_colonne_droite();
79echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
80debut_droite();
81
82debut_cadre_relief("groupe-mot-24.gif");
83
84
85
86echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
87echo "<tr width='100%'>";
88
89        echo "<td  align='right' valign='top'>";
90        icone(_T('icone_retour'), generer_url_ecrire("mots_tous",""), "mot-cle-24.gif", "rien.gif");
91        echo "</td>";
92        echo "<td>". http_img_pack('rien.gif', " ", "width='5'") . "</td>\n";
93
94echo "<td width='100%' valign='top'>";
95echo "<font face='Verdana,Arial,Sans,sans-serif' size=1><b>"._T('titre_groupe_mots')."</b><br></font>";
96gros_titre($titre);
97echo aide("motsgroupes");
98
99if ($connect_statut =="0minirezo"){
100        $type=entites_html(rawurldecode($type));
101        echo "<p><font face='Verdana,Arial,Sans,sans-serif'>";
102        echo generer_url_post_ecrire("mots_tous", "id_groupe=$id_groupe");
103        echo "<input type='hidden' name='modifier_groupe' value='oui' />\n";
104        echo "<input type='hidden' name='new' value='$new' />\n";
105        debut_cadre_formulaire();
106        echo "<b>"._T('info_changer_nom_groupe')."</b><br />\n";
107        echo "<INPUT TYPE='Text' SIZE=40 CLASS='formo' NAME='change_type' VALUE=\"$type\" $onfocus />\n";
108
109        if ($options == 'avancees' OR $descriptif) {
110                echo "<B>"._T('texte_descriptif_rapide')."</B><BR>";
111                echo "<TEXTAREA NAME='descriptif' CLASS='forml' ROWS='4' COLS='40' wrap=soft>";
112                echo entites_html($descriptif);
113                echo "</TEXTAREA><P>\n";
114        }
115        else
116                echo "<INPUT TYPE='hidden' NAME='descriptif' VALUE=\"$descriptif\">";
117
118        if ($options == 'avancees' OR $texte) {
119                echo "<B>"._T('info_texte_explicatif')."</B><BR>";
120                echo "<TEXTAREA NAME='texte' ROWS='8' CLASS='forml' COLS='40' wrap=soft>";
121                echo entites_html($texte);
122                echo "</TEXTAREA><P>\n";
123        }
124        else
125                echo "<INPUT TYPE='hidden' NAME='texte' VALUE=\"$texte\">";
126
127
128        echo "<p><div align='right'><INPUT TYPE='submit' CLASS='fondo' NAME='Valider' VALUE='"._T('bouton_valider')."'></div>";
129        fin_cadre_formulaire();
130}
131
132
133echo "</td></tr></table>";
134
135
136
137fin_cadre_relief();
138
139if ($connect_statut =="0minirezo"){
140        echo "<p>";
141        debut_cadre_formulaire();
142        echo "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>";
143                echo "<b>"._T('info_mots_cles_association')."</b>";
144                echo "<ul>";
145               
146                if ($articles == "oui") $checked = "checked";
147                else $checked = "";
148                echo "<input type='checkbox' name='articles' value='oui' $checked id='articles'> <label for='articles'>"._T('item_mots_cles_association_articles')."</label><br>";
149                $activer_breves = $GLOBALS['meta']["activer_breves"];
150                if ($activer_breves != "non"){
151                        if ($breves == "oui") $checked = "checked";
152                        else $checked = "";
153                        echo "<input type='checkbox' name='breves' value='oui' $checked id='breves'> <label for='breves'>"._T('item_mots_cles_association_breves')."</label><br>";
154                } else {
155                        echo "<input type='hidden' name='breves' value='non'>";
156                }
157                if ($rubriques == "oui") $checked = "checked";
158                else $checked = "";
159                echo "<input type='checkbox' name='rubriques' value='oui' $checked id='rubriques'> <label for='rubriques'>"._T('item_mots_cles_association_rubriques')."</label><br>";
160                if ($syndic == "oui") $checked = "checked";
161                else $checked = "";
162                echo "<input type='checkbox' name='syndic' value='oui' $checked id='syndic'> <label for='syndic'>"._T('item_mots_cles_association_sites')."</label>";
163               
164                if (isset($tables_principales['spip_evenements'])){
165                        echo "<br>";
166                        if ($evenements == "oui") $checked = "checked";
167                        else $checked = "";
168                        echo "<input type='checkbox' name='evenements' value='oui' $checked id='evenements'> <label for='evenements'>"._T('agenda:item_mots_cles_association_evenements')."</label>";
169                }
170                if (isset($tables_principales['spip_pim_agenda'])){
171                        echo "<br>";
172                        if ($pim_agenda == "oui") $checked = "checked";
173                        else $checked = "";
174                        echo "<input type='checkbox' name='pim_agenda' value='oui' $checked id='pim_agenda'> <label for='pim_agenda'>"._T('pimagenda:item_mots_cles_association_evenements')."</label>";
175                }
176       
177                echo "</ul>";
178        echo "</div>";
179
180
181        $config_precise_groupes = $GLOBALS['meta']["config_precise_groupes"];
182        if ($config_precise_groupes == "oui" OR $unseul == "oui" OR $obligatoire == "oui"){
183                echo "<p><div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>";
184
185                if ($unseul == "oui")
186                        $checked = "checked";
187                else
188                        $checked = "";
189                echo "<input type='checkbox' name='unseul' value='oui' $checked id='unseul'> <label for='unseul'>"._T('info_selection_un_seul_mot_cle')."</label>";
190                echo "<br>";
191
192                if ($obligatoire == "oui")
193                        $checked = "checked";
194                else $checked = "";
195                echo "<input type='checkbox' name='obligatoire' value='oui' $checked id='obligatoire'> <label for='obligatoire'>"._T('avis_conseil_selection_mot_cle')."</label>";
196
197                echo "</div>";
198        } else {
199                echo "<input type='hidden' name='unseul' value='non'>";
200                echo "<input type='hidden' name='obligatoire' value='non'>";
201        }
202
203
204       
205        echo "<p>";
206        echo "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>";
207                echo "<b>"._T('info_qui_attribue_mot_cle')."</b>";
208                echo "<ul>";
209               
210                if ($acces_minirezo == "oui") $checked = "checked";
211                else $checked = "";
212                echo "<input type='checkbox' name='acces_minirezo' value='oui' $checked id='administrateurs'> <label for='administrateurs'>"._T('bouton_checkbox_qui_attribue_mot_cle_administrateurs')."</label><br>";
213                if ($acces_comite == "oui") $checked = "checked";
214                else $checked = "";
215                echo "<input type='checkbox' name='acces_comite' value='oui' $checked id='comite'> <label for='comite'>"._T('bouton_checkbox_qui_attribue_mot_cle_redacteurs')."</label><br>";
216       
217                $mots_cles_forums = $GLOBALS['meta']["mots_cles_forums"];
218                $forums_publics=$GLOBALS['meta']["forums_publics"];
219               
220                if (($mots_cles_forums == "oui" OR $acces_forum == "oui") AND $forums_publics != "non"){
221                        if ($acces_forum == "oui") $checked = "checked";
222                        else $checked = "";
223                        echo "<input type='checkbox' name='acces_forum' value='oui' $checked id='forum'> <label for='forum'>"._T('bouton_checkbox_qui_attribue_mot_cle_visiteurs')."</label>";
224                }
225                else {
226                        echo "<input type='hidden' name='acces_forum' value='non'>";
227                }
228                       
229                echo "</ul>";
230        echo "</div>";
231       
232       
233       
234
235        echo "<p><div align='right'><INPUT TYPE='submit' CLASS='fondo' NAME='Valider' VALUE='"._T('bouton_valider')."'></div>";
236        echo "</FORM><P>";
237        fin_cadre_formulaire();
238        echo "</font>";
239
240
241}else{
242
243        echo "<H3>"._T('avis_non_acces_page')."</H3>";
244
245}
246
247
248fin_page();
249}
250
251?>
Note: See TracBrowser for help on using the repository browser.