Server : Apache System : Linux webd348.cluster026.gra.hosting.ovh.net 5.15.148-ovh-vps-grsec-zfs-classid #1 SMP Thu Feb 8 09:41:04 UTC 2024 x86_64 User : hednacluml ( 122243) PHP Version : 8.3.9 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/hednacluml/info/plugins/auto/saisies/inclure/ |
<?php // Sécurité if (!defined('_ECRIRE_INC_VERSION')) { return; } function construire_configuration_saisie($saisie, $avec_nom = 'non') { include_spip('inc/yaml'); $configuration_saisie = yaml_decode_file(find_in_path('saisies/' . $saisie . '.yaml')); if (is_array($configuration_saisie)) { $configuration_saisie = $configuration_saisie['options']; // On ne met le premier champ permettant de configurer le "name" seulement si on le demande explicitement if ($avec_nom == 'oui') { array_unshift( $configuration_saisie[0]['contenu'], [ 'saisie' => 'input', 'options' => [ 'nom' => 'nom', 'label' => '<:saisies:option_nom_label:>', 'explication' => '<:saisies:option_nom_explication:>', 'obligatoire' => 'oui' ], 'verifier' => [ 'type' => 'regex', 'options' => [ 'modele' => '/^[\w]+$/' ] ] ] ); } } else { $configuration_saisie = []; } return $configuration_saisie; }