3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2019 *
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 \***************************************************************************/
14 * Action des changements de langue des rubriques
16 * @package SPIP\Core\Edition
19 if (!defined('_ECRIRE_INC_VERSION')) {
24 * Modifie la langue d'une rubrique
26 function action_instituer_langue_rubrique_dist() {
28 $securiser_action = charger_fonction('securiser_action', 'inc');
29 $arg = $securiser_action();
30 $changer_lang = _request('changer_lang');
32 list($id_rubrique, $id_parent) = preg_split('/\W/', $arg);
36 and $GLOBALS['meta']['multi_rubriques'] == 'oui'
37 and ($GLOBALS['meta']['multi_secteurs'] == 'non' or $id_parent == 0)
39 if ($changer_lang != "herit") {
40 sql_updateq('spip_rubriques', array('lang' => $changer_lang, 'langue_choisie' => 'oui'),
41 "id_rubrique=$id_rubrique");
43 if ($id_parent == 0) {
44 $langue_parent = $GLOBALS['meta']['langue_site'];
46 $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent");
48 sql_updateq('spip_rubriques', array('lang' => $langue_parent, 'langue_choisie' => 'non'),
49 "id_rubrique=$id_rubrique");
51 include_spip('inc/rubriques');
52 calculer_langues_rubriques();
54 // invalider les caches marques de cette rubrique
55 include_spip('inc/invalideur');
56 suivre_invalideur("id='rubrique/$id_rubrique'");