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/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 ($table_objet_sql = table_objet_sql($type)
27 AND $d = lister_tables_objets_sql($table_objet_sql)
28 AND isset($d['statut_textes_instituer'])
29 AND $d['statut_textes_instituer']) {
30 $prim = id_table_objet($type);
32 if (isset($d['field']['id_rubrique']))
33 $select = "id_rubrique,statut";
35 $select = "0 as id_rubrique,statut";
36 $r = sql_fetsel($select, $table_objet_sql, "$prim=$id");
37 $statut = $r['statut'];
38 $id_rubrique = $r['id_rubrique'];
41 $id_rubrique = intval($id);
42 $statut = 'prop'; // arbitraire
44 $puce_statut = charger_fonction('puce_statut', 'inc');
45 ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true));