[SPIP] v3.2.1-->v3.2.2
[lhc/web/www.git] / www / prive / objets / liste / objets-trad_fonctions.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2019 *
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')) {
14 return;
15 }
16
17 function lister_traductions($id_trad, $objet) {
18 $table_objet_sql = table_objet_sql($objet);
19 $primary = id_table_objet($objet);
20
21 $select = "$primary as id,lang";
22 $where = 'id_trad=' . intval($id_trad);
23 $trouver_table = charger_fonction('trouver_table','base');
24 $desc = $trouver_table($table_objet_sql);
25 if (isset($desc['field']['statut'])) {
26 $select .= ',statut';
27 $where .= ' AND statut!='.sql_quote('poubelle');
28 }
29
30 $rows = sql_allfetsel($select, $table_objet_sql, $where);
31 lang_select();
32
33 return $rows;
34 }