4 if (!defined('_ECRIRE_INC_VERSION')) {
8 function construire_configuration_saisie($saisie, $avec_nom = 'non') {
9 include_spip('inc/yaml');
10 $configuration_saisie = yaml_decode_file(find_in_path('saisies/'.$saisie.'.yaml'));
12 if (is_array($configuration_saisie)) {
13 $configuration_saisie = $configuration_saisie['options'];
14 // On ne met le premier champ permettant de configurer le "name" seulement si on le demande explicitement
15 if ($avec_nom == 'oui') {
17 $configuration_saisie[0]['contenu'],
22 'label' => '<:saisies:option_nom_label:>',
23 'explication' => '<:saisies:option_nom_explication:>',
24 'obligatoire' => 'oui'
29 'modele' => '/^[\w]+$/'
36 $configuration_saisie = array();
38 return $configuration_saisie;