gamuContact/inc/gamucontact.php

67 lines
1.4 KiB
PHP

<?php
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function inc_gamucontact_dist(){
$saisies = [
[
'saisie' => 'input',
'options' => [
'nom' => 'nom',
'label' => '<:gamucontact:votre_nom:>',
'obligatoire' => 'oui',
'class' => 'w100',
//'fonction' => 'ma_super_fonction'
]
],
[
'saisie' => 'email',
'options' => [
'nom' => 'email_contact',
'type' => 'email',
'label' => '<:gamucontact:votre_email:>',
'class' => 'w100',
'obligatoire' => 'oui',
]
],
];
// intégrer ou pas le téléphone selon la config
$telephone_contact = lire_config('gamucontact/telephone_contact');
if ($telephone_contact === 'oui') {
$saisies[] = [
'saisie' => 'input',
'options' => [
'nom' => 'telephone',
'type' => 'tel',
'label' => '<:gamucontact:votre_telephone:>',
'obligatoire' => lire_config('gamucontact/telephone_obligatoire') === 'oui' ? 'oui' : 'non',
]
];
}
$saisies[] = [
'saisie' => 'input',
'options' => [
'nom' => 'objet',
'label' => '<:gamucontact:objet:>',
'obligatoire' => 'oui',
'class' => 'w100'
//'fonction' => 'ma_super_fonction'
]
];
$saisies[] = [
'saisie' => 'textarea',
'options' => [
'nom' => 'texte',
'label' => '<:gamucontact:message:>',
'obligatoire' => 'oui',
'class' => 'w100',
'rows' => 4
//'fonction' => 'ma_super_fonction'
]
];
return $saisies;
}