[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / action / instituer_rubrique_breves.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
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 // http://doc.spip.org/@action_instituer_rubrique_breves_dist
16 function action_instituer_rubrique_breves_dist() {
17
18 $securiser_action = charger_fonction('securiser_action', 'inc');
19 $arg = $securiser_action();
20
21 list($id, $statut) = preg_split('/\W/', $arg);
22 $id = intval($id);
23
24 include_spip('action/editer_breve');
25
26 $table = 'articles';
27 $key = 'id_article';
28
29 $voss = sql_select("$key AS id", "spip_$table", "id_rubrique=$id AND (statut = 'publie' OR statut = 'prop')");
30
31 while($row = sql_fetch($voss)) {
32 set_request('statut', $statut);
33 revisions_breves($row['id']);
34 }
35
36 redirige_url_ecrire('meme_rubrique', "id=$id&type=breve&order=date_heure");
37 }
38 ?>