[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / prive / formulaires / configurer_articles.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
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')) return;
14
15 function formulaires_configurer_articles_charger_dist(){
16 foreach(array(
17 "articles_surtitre",
18 "articles_soustitre",
19 "articles_descriptif",
20 "articles_chapeau",
21 "articles_texte",
22 "articles_ps",
23 "articles_redac",
24 "articles_urlref",
25 "post_dates",
26 "articles_redirection",
27 ) as $m)
28 $valeurs[$m] = $GLOBALS['meta'][$m];
29
30 return $valeurs;
31 }
32
33
34 function formulaires_configurer_articles_traiter_dist(){
35 $res = array('editable'=>true);
36 $purger_skel = false;
37 // Purger les squelettes si un changement de meta les affecte
38 if ($i = _request('post_dates') AND ($i != $GLOBALS['meta']["post_dates"]))
39 $purger_skel = true;
40
41 foreach(array(
42 "articles_surtitre",
43 "articles_soustitre",
44 "articles_descriptif",
45 "articles_chapeau",
46 "articles_texte",
47 "articles_ps",
48 "articles_redac",
49 "articles_urlref",
50 "post_dates",
51 "articles_redirection",
52 ) as $m)
53 if (!is_null($v=_request($m)))
54 ecrire_meta($m, $v=='oui'?'oui':'non');
55
56 if ($purger_skel) {
57 include_spip('inc/invalideur');
58 purger_repertoire(_DIR_SKELS);
59 }
60
61 $res['message_ok'] = _T('config_info_enregistree');
62 return $res;
63 }
64