[30] | 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 | |
---|
| 17 | // http://doc.spip.org/@exec_mots_type_dist |
---|
| 18 | function exec_mots_type_dist() |
---|
| 19 | { |
---|
| 20 | global $connect_statut, $descriptif, $id_groupe, $new, $options, $texte, $titre; |
---|
| 21 | |
---|
| 22 | if ($new == "oui") { |
---|
| 23 | $id_groupe = 0; |
---|
| 24 | $type = filtrer_entites(_T('titre_nouveau_groupe')); |
---|
| 25 | $onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\""; |
---|
| 26 | $ancien_type = ''; |
---|
| 27 | $unseul = 'non'; |
---|
| 28 | $obligatoire = 'non'; |
---|
| 29 | $articles = 'oui'; |
---|
| 30 | $breves = 'oui'; |
---|
| 31 | $rubriques = 'non'; |
---|
| 32 | $syndic = 'oui'; |
---|
| 33 | $acces_minirezo = 'oui'; |
---|
| 34 | $acces_comite = 'oui'; |
---|
| 35 | $acces_forum = 'non'; |
---|
| 36 | } else { |
---|
| 37 | $id_groupe= intval($id_groupe); |
---|
| 38 | $result_groupes = spip_query("SELECT * FROM spip_groupes_mots WHERE id_groupe=$id_groupe"); |
---|
| 39 | |
---|
| 40 | while($row = spip_fetch_array($result_groupes)) { |
---|
| 41 | $id_groupe = $row['id_groupe']; |
---|
| 42 | $type = $row['titre']; |
---|
| 43 | $titre = typo($type); |
---|
| 44 | $descriptif = $row['descriptif']; |
---|
| 45 | $texte = $row['texte']; |
---|
| 46 | $unseul = $row['unseul']; |
---|
| 47 | $obligatoire = $row['obligatoire']; |
---|
| 48 | $articles = $row['articles']; |
---|
| 49 | $breves = $row['breves']; |
---|
| 50 | $rubriques = $row['rubriques']; |
---|
| 51 | $syndic = $row['syndic']; |
---|
| 52 | if (isset($row['evenements'])) |
---|
| 53 | $evenements = $row['evenements']; |
---|
| 54 | if (isset($row['pim_agenda'])) |
---|
| 55 | $pim_agenda = $row['pim_agenda']; |
---|
| 56 | $acces_minirezo = $row['minirezo']; |
---|
| 57 | $acces_comite = $row['comite']; |
---|
| 58 | $acces_forum = $row['forum']; |
---|
| 59 | $onfocus =""; |
---|
| 60 | } |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | pipeline('exec_init',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>'')); |
---|
| 64 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
| 65 | echo $commencer_page("« $titre »", "naviguer", "mots"); |
---|
| 66 | |
---|
| 67 | debut_gauche(); |
---|
| 68 | |
---|
| 69 | echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>'')); |
---|
| 70 | creer_colonne_droite(); |
---|
| 71 | echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>'')); |
---|
| 72 | debut_droite(); |
---|
| 73 | |
---|
| 74 | if ($connect_statut != "0minirezo") { |
---|
| 75 | echo "<h3>"._T('avis_non_acces_page')."</h3>"; |
---|
| 76 | exit; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | $type = entites_html(rawurldecode($type)); |
---|
| 81 | |
---|
| 82 | $res = debut_cadre_relief("groupe-mot-24.gif", true) |
---|
| 83 | . "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>" |
---|
| 84 | . "<tr>" |
---|
| 85 | . "<td align='right' valign='top'>" |
---|
| 86 | . icone(_T('icone_retour'), generer_url_ecrire("mots_tous",""), "mot-cle-24.gif", "rien.gif",'', false) |
---|
| 87 | . "</td>" |
---|
| 88 | . "<td>". http_img_pack('rien.gif', " ", "width='5'") . "</td>\n" |
---|
| 89 | . "<td style='width: 100%' valign='top'>" |
---|
| 90 | . "<span class='verdana1 spip_x-small'><b>". _T('titre_groupe_mots') . "</b></span><br />" |
---|
| 91 | . gros_titre($titre,'',false) |
---|
| 92 | . aide("motsgroupes") |
---|
| 93 | . "<div class='verdana1'>" |
---|
| 94 | . debut_cadre_formulaire('',true) |
---|
| 95 | . "<b>"._T('info_changer_nom_groupe')."</b><br />\n" |
---|
| 96 | . "<input type='text' size='40' class='formo' name='change_type' value=\"$type\" $onfocus />\n"; |
---|
| 97 | |
---|
| 98 | if ($options == 'avancees' OR $descriptif) { |
---|
| 99 | $res .= "<br /><b>"._T('texte_descriptif_rapide') |
---|
| 100 | . "</b><br />" |
---|
| 101 | . "<textarea name='descriptif' class='forml' rows='4' cols='40'>" |
---|
| 102 | . entites_html($descriptif) |
---|
| 103 | . "</textarea>\n"; |
---|
| 104 | } else |
---|
| 105 | $res .= "<input type='hidden' name='descriptif' value=\"$descriptif\" />"; |
---|
| 106 | |
---|
| 107 | if ($options == 'avancees' OR $texte) { |
---|
| 108 | $res .= "<br /><b>"._T('info_texte_explicatif')."</b><br />"; |
---|
| 109 | $res .= "<textarea name='texte' rows='8' class='forml' cols='40'>"; |
---|
| 110 | $res .= entites_html($texte); |
---|
| 111 | $res .= "</textarea>\n"; |
---|
| 112 | } else |
---|
| 113 | $res .= "<input type='hidden' name='texte' value=\"$texte\" />"; |
---|
| 114 | |
---|
| 115 | $res .= "<div align='right'><input type='submit' class='fondo' value='" |
---|
| 116 | . _T('bouton_valider') |
---|
| 117 | . "' /></div>" |
---|
| 118 | . fin_cadre_formulaire(true) |
---|
| 119 | . "</div>" |
---|
| 120 | . "</td></tr></table>" |
---|
| 121 | . fin_cadre_relief(true) |
---|
| 122 | . "<br />\n<div class='verdana1'>" |
---|
| 123 | . debut_cadre_formulaire('',true) |
---|
| 124 | . "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>" |
---|
| 125 | . "<b>"._T('info_mots_cles_association')."</b>" |
---|
| 126 | . "<br />"; |
---|
| 127 | |
---|
| 128 | $checked = ($articles == "oui") ? "checked='checked'" : ''; |
---|
| 129 | $res .= "<input type='checkbox' name='articles' value='oui' $checked id='articles' /> <label for='articles'>"._T('item_mots_cles_association_articles')."</label><br />"; |
---|
| 130 | $activer_breves = $GLOBALS['meta']["activer_breves"]; |
---|
| 131 | |
---|
| 132 | if ($activer_breves != "non"){ |
---|
| 133 | $checked = ($breves == "oui") ? "checked='checked'" : ''; |
---|
| 134 | |
---|
| 135 | $res .= "<input type='checkbox' name='breves' value='oui' $checked id='breves' /> <label for='breves'>"._T('item_mots_cles_association_breves')."</label><br />"; |
---|
| 136 | } else { |
---|
| 137 | $res .= "<input type='hidden' name='breves' value='non' />"; |
---|
| 138 | } |
---|
| 139 | $checked = ($rubriques == "oui") ? "checked='checked'" : ''; |
---|
| 140 | |
---|
| 141 | $res .= "<input type='checkbox' name='rubriques' value='oui' $checked id='rubriques' /> <label for='rubriques'>"._T('item_mots_cles_association_rubriques')."</label><br />"; |
---|
| 142 | |
---|
| 143 | $checked = ($syndic == "oui") ? "checked='checked'" : ''; |
---|
| 144 | $res .= "<input type='checkbox' name='syndic' value='oui' $checked id='syndic' /> <label for='syndic'>"._T('item_mots_cles_association_sites')."</label>"; |
---|
| 145 | |
---|
| 146 | if (isset($GLOBALS['tables_principales']['spip_evenements'])){ |
---|
| 147 | $res .= "<br />"; |
---|
| 148 | if ($evenements == "oui") $checked = "checked"; |
---|
| 149 | else $checked = ""; |
---|
| 150 | $res .= "<input type='checkbox' name='evenements' value='oui' $checked id='evenements'> <label for='evenements'>"._T('agenda:item_mots_cles_association_evenements')."</label>"; |
---|
| 151 | } |
---|
| 152 | if (isset($GLOBALS['tables_principales']['spip_pim_agenda'])){ |
---|
| 153 | $res .= "<br />"; |
---|
| 154 | if ($pim_agenda == "oui") $checked = "checked"; |
---|
| 155 | else $checked = ""; |
---|
| 156 | $res.= "<input type='checkbox' name='pim_agenda' value='oui' $checked id='pim_agenda'> <label for='pim_agenda'>"._T('pimagenda:item_mots_cles_association_evenements')."</label>"; |
---|
| 157 | } |
---|
| 158 | $res .= "</div>"; |
---|
| 159 | |
---|
| 160 | if ($GLOBALS['meta']["config_precise_groupes"] == "oui" OR $unseul == "oui" OR $obligatoire == "oui"){ |
---|
| 161 | $res .= "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>"; |
---|
| 162 | |
---|
| 163 | $checked = ($unseul == "oui") ? "checked='checked'" : ''; |
---|
| 164 | $res .= "<input type='checkbox' name='unseul' value='oui' $checked id='unseul' /> <label for='unseul'>"._T('info_selection_un_seul_mot_cle')."</label>"; |
---|
| 165 | $res .= "<br />"; |
---|
| 166 | |
---|
| 167 | $checked = ($obligatoire == "oui") ? "checked='checked'" : ''; |
---|
| 168 | $res .= "<input type='checkbox' name='obligatoire' value='oui' $checked id='obligatoire' /> <label for='obligatoire'>"._T('avis_conseil_selection_mot_cle')."</label>"; |
---|
| 169 | $res .= "</div>"; |
---|
| 170 | } else { |
---|
| 171 | $res .= "<input type='hidden' name='unseul' value='non' />"; |
---|
| 172 | $res .= "<input type='hidden' name='obligatoire' value='non' />"; |
---|
| 173 | } |
---|
| 174 | |
---|
| 175 | $res .= "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>" |
---|
| 176 | . "<b>"._T('info_qui_attribue_mot_cle')."</b>" |
---|
| 177 | . "<br />"; |
---|
| 178 | |
---|
| 179 | $checked = ($acces_minirezo == "oui") ? "checked='checked'" : ''; |
---|
| 180 | $res .= "<input type='checkbox' name='acces_minirezo' value='oui' $checked id='administrateurs' /> <label for='administrateurs'>" |
---|
| 181 | . _T('bouton_checkbox_qui_attribue_mot_cle_administrateurs') |
---|
| 182 | . "</label><br />"; |
---|
| 183 | |
---|
| 184 | $checked = ($acces_comite == "oui") ? "checked='checked'" : ''; |
---|
| 185 | $res .= "<input type='checkbox' name='acces_comite' value='oui' $checked id='comite' /> <label for='comite'>"._T('bouton_checkbox_qui_attribue_mot_cle_redacteurs')."</label><br />"; |
---|
| 186 | |
---|
| 187 | $mots_cles_forums = $GLOBALS['meta']["mots_cles_forums"]; |
---|
| 188 | $forums_publics=$GLOBALS['meta']["forums_publics"]; |
---|
| 189 | |
---|
| 190 | if (($mots_cles_forums == "oui" OR $acces_forum == "oui") AND $forums_publics != "non"){ |
---|
| 191 | $checked = ($acces_forum == "oui") ? "checked='checked'" : ''; |
---|
| 192 | $res .= "<input type='checkbox' name='acces_forum' value='oui' $checked id='forum' /> <label for='forum'>"._T('bouton_checkbox_qui_attribue_mot_cle_visiteurs')."</label>"; |
---|
| 193 | } |
---|
| 194 | else { |
---|
| 195 | $res .= "<input type='hidden' name='acces_forum' value='non' />"; |
---|
| 196 | } |
---|
| 197 | |
---|
| 198 | $res .= "<br /></div><div align='right'><input type='submit' class='fondo' value='" |
---|
| 199 | . _T('bouton_valider') |
---|
| 200 | . "' /></div>" |
---|
| 201 | . fin_cadre_formulaire(true) |
---|
| 202 | . "</div>"; |
---|
| 203 | |
---|
| 204 | $res .= pipeline('affiche_milieu',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>'')); |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | echo redirige_action_auteur('instituer_groupe_mots', $id_groupe, "mots_tous", "id_groupe=$id_groupe", $res), |
---|
| 208 | fin_gauche(), |
---|
| 209 | fin_page(); |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | ?> |
---|