[SPIP] v3.2.1-->v3.2.2
[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-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 formulaires_configurer_articles_charger_dist() {
18 $valeurs = array();
19 foreach (array(
20 'articles_surtitre',
21 'articles_soustitre',
22 'articles_descriptif',
23 'articles_chapeau',
24 'articles_texte',
25 'articles_ps',
26 'articles_redac',
27 'articles_urlref',
28 'post_dates',
29 'articles_redirection',
30 ) as $m) {
31 $valeurs[$m] = $GLOBALS['meta'][$m];
32 }
33
34 return $valeurs;
35 }
36
37
38 function formulaires_configurer_articles_traiter_dist() {
39 $res = array('editable' => true);
40 $purger_skel = false;
41 // Purger les squelettes si un changement de meta les affecte
42 if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) {
43 $purger_skel = true;
44 }
45
46 foreach (array(
47 'articles_surtitre',
48 'articles_soustitre',
49 'articles_descriptif',
50 'articles_chapeau',
51 'articles_texte',
52 'articles_ps',
53 'articles_redac',
54 'articles_urlref',
55 'post_dates',
56 'articles_redirection',
57 ) as $m) {
58 if (!is_null($v = _request($m))) {
59 ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
60 }
61 }
62
63 if ($purger_skel) {
64 include_spip('inc/invalideur');
65 purger_repertoire(_DIR_SKELS);
66 }
67
68 $res['message_ok'] = _T('config_info_enregistree');
69
70 return $res;
71 }