[PLUGINS] +set de base
[lhc/web/www.git] / www / plugins / formidable_1_0 / formidable_options.php
1 <?php
2
3 /**
4 * Options globales chargées à chaque hit
5 *
6 * @package SPIP\Formidable\Options
7 **/
8
9 // Sécurité
10 if (!defined("_ECRIRE_INC_VERSION")) return;
11
12 // On déclare le formulaire pour éditer un formulaire
13 $GLOBALS['formulaires']['editer_formulaire'] = array(
14 array(
15 'saisie' => 'input',
16 'options' => array(
17 'nom' => 'titre',
18 'label' => '<:formidable:editer_titre:>',
19 'obligatoire' => 'oui',
20 'class' => 'multilang'
21 )
22 ),
23 array(
24 'saisie' => 'input',
25 'options' => array(
26 'nom' => 'identifiant',
27 'label' => '<:formidable:editer_identifiant:>',
28 'explication' => '<:formidable:editer_identifiant_explication:>',
29 'obligatoire' => 'oui'
30 ),
31 'verifier' => array(
32 'type' => 'regex',
33 'options' => array(
34 'modele' => '/^[\w]+$/'
35 )
36 )
37 ),
38 array(
39 'saisie' => 'textarea',
40 'options' => array(
41 'nom' => 'message_retour',
42 'label' => '<:formidable:editer_message_ok:>',
43 'explication' => '<:formidable:editer_message_ok_explication:>',
44 'rows' => 5,
45 'li_class' => 'editer_texte',
46 'class' => 'multilang'
47 )
48 ),
49 array(
50 'saisie' => 'textarea',
51 'options' => array(
52 'nom' => 'descriptif',
53 'label' => '<:formidable:editer_descriptif:>',
54 'explication' => '<:formidable:editer_descriptif_explication:>',
55 'rows' => 5,
56 'class' => 'multilang'
57 )
58 ),
59 array(
60 'saisie' => 'selection',
61 'options' => array(
62 'nom' => 'apres',
63 'label' => '<:formidable:editer_apres_label:>',
64 'explication' => '<:formidable:editer_apres_explication:>',
65 'datas' => array(
66 'formulaire' => _T('formidable:editer_apres_choix_formulaire'),
67 'valeurs' => _T('formidable:editer_apres_choix_valeurs'),
68 'stats' => _T('formidable:editer_apres_choix_stats'),
69 'rien' => _T('formidable:editer_apres_choix_rien'),
70 'redirige' => _T('formidable:editer_apres_choix_redirige'),
71 ),
72 'defaut' => 'formulaire',
73 'cacher_option_intro' => 'on'
74 )
75 ),
76 array(
77 'saisie' => 'input',
78 'options' => array(
79 'nom' => 'url_redirect',
80 'label' => '<:formidable:editer_redirige_url:>',
81 'explication' => '<:formidable:editer_redirige_url_explication:>',
82 'obligatoire' => 'non'
83 )
84 )
85 );
86
87 /* déclaration des différentes variables utilisées pour effectuer l'anonymisation */
88 $GLOBALS['formulaires']['variables_anonymisation'] = array(
89 'remote_user' => '$_SERVER["REMOTE_USER"]',
90 'php_auth_user' => '$_SERVER["PHP_AUTH_USER"]',
91 );
92
93 /*
94 * on se contente d'initialiser si ces variable si elles ne
95 * le sont pas dans mes_options.php de l'instance
96 */
97 if (isset($GLOBALS['formulaires']['passwd']) == false) {
98 $GLOBALS['formulaires']['passwd'] = array(
99 'interne' => 'palabresecreta',
100 );
101 }
102
103 if (isset($GLOBALS['formulaires']['autoriser_admin_restreint']) == false) {
104 $GLOBALS['formulaires']['autoriser_admin_restreint'] = false;
105 }
106
107 if (!function_exists('array_fill_keys')) {
108 /**
109 * Remplit un tableau avec des valeurs, en spécifiant les clés
110 *
111 * Fonction dans PHP 5.2+
112 * @see http://php.net/manual/fr/function.array-fill-keys.php
113 *
114 * @param array $keys
115 * Tableau de valeurs qui sera utilisé comme clés.
116 * @param mixed $value
117 * Valeur à utiliser pour remplir le tableau.
118 * @return array
119 * Le tableau rempli.
120 **/
121 function array_fill_keys($keys, $value){
122 array_combine($keys,array_fill(0,count($keys),$value));
123 }
124 }
125
126 ?>