3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
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 \***************************************************************************/
13 if (!defined('_ECRIRE_INC_VERSION')) return;
15 include_spip('inc/filtres');
17 // http://doc.spip.org/@action_instituer_groupe_mots_dist
18 function action_instituer_groupe_mots_dist()
20 $securiser_action = charger_fonction('securiser_action', 'inc');
21 $arg = $securiser_action();
23 if (preg_match(",^([a-zA-Z_]\w+)$,", $arg, $r))
24 action_instituer_groupe_mots_get($arg);
25 elseif (!preg_match(",^(-?\d+)$,", $arg, $r)) {
26 spip_log("action_instituer_groupe_mots_dist $arg pas compris");
27 } else action_instituer_groupe_mots_post($r[1]);
30 // http://doc.spip.org/@action_instituer_groupe_mots_post
31 function action_instituer_groupe_mots_post($id_groupe)
34 sql_delete("spip_groupes_mots", "id_groupe=" . (0- $id_groupe));
37 spip_log('appel deprecie, rien a faire ici (voir action/edite_groupe_mot)');
40 // http://doc.spip.org/@action_instituer_groupe_mots_get
41 function action_instituer_groupe_mots_get($table)
43 $titre = _T('info_mot_sans_groupe');
44 $id_groupe = sql_insertq("spip_groupes_mots", array(
47 'obligatoire' => 'non',
48 'tables_liees'=>$table,
53 redirige_par_entete(parametre_url(urldecode(_request('redirect')),
54 'id_groupe', $id_groupe, '&'));