3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2012 *
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 // http://doc.spip.org/@action_instituer_langue_rubrique_dist
16 function action_instituer_langue_rubrique_dist() {
18 $securiser_action = charger_fonction('securiser_action', 'inc');
19 $arg = $securiser_action();
20 $changer_lang = _request('changer_lang');
22 list($id_rubrique, $id_parent) = preg_split('/\W/', $arg);
26 AND $GLOBALS['meta']['multi_rubriques'] == 'oui'
27 AND ($GLOBALS['meta']['multi_secteurs'] == 'non' OR $id_parent == 0)) {
28 if ($changer_lang != "herit")
29 sql_updateq('spip_rubriques', array('lang'=>$changer_lang, 'langue_choisie'=>'oui'), "id_rubrique=$id_rubrique");
32 $langue_parent = $GLOBALS['meta']['langue_site'];
34 $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent");
36 sql_updateq('spip_rubriques', array('lang'=>$langue_parent, 'langue_choisie'=>'non'), "id_rubrique=$id_rubrique");
38 include_spip('inc/rubriques');
39 calculer_langues_rubriques();
41 // invalider les caches marques de cette rubrique
42 include_spip('inc/invalideur');
43 suivre_invalideur("id='rubrique/$id_rubrique'");