[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / exec / puce_statut.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 include_spip('inc/presentation');
16
17 // http://doc.spip.org/@exec_puce_statut_dist
18 function exec_puce_statut_dist()
19 {
20 exec_puce_statut_args(_request('id'), _request('type'));
21 }
22
23 // http://doc.spip.org/@exec_puce_statut_args
24 function exec_puce_statut_args($id, $type)
25 {
26 if (in_array($type,array('article','breve','site'))) {
27 $table = table_objet_sql($type);
28 $prim = id_table_objet($type);
29 $id = intval($id);
30 $r = sql_fetsel("id_rubrique,statut", "$table", "$prim=$id");
31 $statut = $r['statut'];
32 $id_rubrique = $r['id_rubrique'];
33 } else {
34 $id_rubrique = intval($id);
35 $statut = 'prop'; // arbitraire
36 }
37 $puce_statut = charger_fonction('puce_statut', 'inc');
38 ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true));
39 }
40 ?>