Last change
on this file since 90946 was
87651,
checked in by marcimat@…, 6 years ago
|
- PHPDoc en plus à certains endroits
- Pas de fermeture de php sur les fichiers php
- Le phpdoc nécessite 2 étoiles
- Les pipelines simplement déclarés (et non utilisés dans saisis) le sont dans paquet.xml directement
|
File size:
982 bytes
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | // Sécurité |
---|
4 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
5 | |
---|
6 | function construire_configuration_saisie($saisie, $avec_nom='non'){ |
---|
7 | include_spip('inc/yaml'); |
---|
8 | $configuration_saisie = yaml_decode_file(find_in_path('saisies/'.$saisie.'.yaml')); |
---|
9 | |
---|
10 | if (is_array($configuration_saisie)){ |
---|
11 | $configuration_saisie = $configuration_saisie['options']; |
---|
12 | // On ne met le premier champ permettant de configurer le "name" seulement si on le demande explicitement |
---|
13 | if ($avec_nom == 'oui') |
---|
14 | array_unshift($configuration_saisie[0]['contenu'], |
---|
15 | array( |
---|
16 | 'saisie' => 'input', |
---|
17 | 'options' => array( |
---|
18 | 'nom' => 'nom', |
---|
19 | 'label' => '<:saisies:option_nom_label:>', |
---|
20 | 'explication' => '<:saisies:option_nom_explication:>', |
---|
21 | 'obligatoire' => 'oui' |
---|
22 | ), |
---|
23 | 'verifier' => array( |
---|
24 | 'type' => 'regex', |
---|
25 | 'options' => array( |
---|
26 | 'modele' => '/^[\w]+$/' |
---|
27 | ) |
---|
28 | ) |
---|
29 | ) |
---|
30 | ); |
---|
31 | } |
---|
32 | else |
---|
33 | $configuration_saisie = array(); |
---|
34 | |
---|
35 | return $configuration_saisie; |
---|
36 | } |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.