3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2011 *
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/presentation');
17 // http://doc.spip.org/@exec_puce_statut_dist
18 function exec_puce_statut_dist()
20 exec_puce_statut_args(_request('id'), _request('type'));
23 // http://doc.spip.org/@exec_puce_statut_args
24 function exec_puce_statut_args($id, $type)
26 if (in_array($type,array('article','breve','site'))) {
27 $table = table_objet_sql($type);
28 $prim = id_table_objet($type);
30 $r = sql_fetsel("id_rubrique,statut", "$table", "$prim=$id");
31 $statut = $r['statut'];
32 $id_rubrique = $r['id_rubrique'];
34 $id_rubrique = intval($id);
35 $statut = 'prop'; // arbitraire
37 $puce_statut = charger_fonction('puce_statut', 'inc');
38 ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true));