[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / cfg / exec / cfg.php
1 <?php
2
3 /**
4 * Plugin générique de configuration pour SPIP
5 *
6 * @license GNU/GPL
7 * @package plugins
8 * @subpackage cfg
9 * @category outils
10 * @copyright (c) toggg, marcimat 2007-2008
11 * @link http://www.spip-contrib.net/
12 * @version $Id: cfg.php 36735 2010-03-28 21:25:09Z gilles.vincent@gmail.com $
13 */
14
15 if (!defined("_ECRIRE_INC_VERSION")) return;
16
17 /**
18 * la fonction appelee par le core, une simple "factory" de la classe cfg
19 *
20 * @param mixed $class # inutilisé
21 */
22 function exec_cfg_dist($class = null)
23 {
24 include_spip('inc/filtres');
25 include_spip('inc/cfg');
26 $config = new cfg(
27 ($nom = sinon(_request('cfg'), '')),
28 ($cfg_id = sinon(_request('cfg_id'),''))
29 );
30
31 // traitements du formulaire poste
32 // seulement s'il provient d'un formulaire CFG
33 // et non d'un formulaire CVT dans un fond CFG
34 if (_request('arg'))
35 $config->traiter();
36
37 //
38 // affichages
39 //
40 include_spip("inc/presentation");
41
42 if (!$config->autoriser()) {
43 echo $config->acces_refuse();
44 exit;
45 }
46
47 pipeline('exec_init',array('args'=>array('exec'=>'cfg'),'data'=>''));
48
49 $commencer_page = charger_fonction('commencer_page', 'inc');
50 echo $commencer_page($config->get_boite(), 'cfg', $config->get_nom());
51 echo "<br /><br /><br />\n";
52
53 echo gros_titre(sinon($config->get_titre(), _T('cfg:configuration_modules')), '', false);
54 echo $config->barre_onglets();
55
56 // colonne gauche
57 echo debut_gauche('', true);
58
59 // si un formulaire cfg est demande
60 if ($s = $config->descriptif()) echo debut_boite_info(true) . $s . fin_boite_info(true);
61
62 // affiche éventuellement une colonne supplémentaire à gauche
63 if ($s = $config->gauche()) echo debut_boite_info(true) . $s . fin_boite_info(true);
64
65 echo pipeline('affiche_gauche',array('args'=>array('exec'=>'cfg'),'data'=>''));
66 echo creer_colonne_droite('', true);
67 echo pipeline('affiche_droite',array('args'=>array('exec'=>'cfg'),'data'=>''));
68
69 // affichage des messages envoyes par cfg
70 if ($s = $config->messages()) echo debut_boite_info(true) . $s . fin_boite_info(true);
71
72 // affichage des liens
73 if ($s = $config->liens()) echo debut_boite_info(true) . $s . fin_boite_info(true);
74 if ($s = $config->liens_multi()) echo debut_boite_info(true) . $s . fin_boite_info(true);
75
76 echo debut_droite("", true);
77
78 // centre de la page
79 if ($config->get_presentation() == 'auto') {
80 echo debut_cadre_trait_couleur('', true, '', $config->get_boite());
81 echo $config->formulaire();
82 echo fin_cadre_trait_couleur(true);
83 } else {
84 echo $config->formulaire();
85 }
86
87 // pied
88 echo fin_gauche() . fin_page();
89 }
90
91 ?>