gamuform/gamuform_fonctions.php
tofulm 36622355fb refonte de ce plugin jamais utiliser pour essayer de fabriquer des
formulaire et des pages gamutable pour gerer des configurations de
facons semi automatique
2022-03-30 15:15:01 +02:00

39 lines
682 B
PHP

<?php
/**
* Fonctions utiles au plugin GamuForm
*
* @plugin GamuForm
* @copyright 2020
* @author tofulm
* @licence GNU/GPL
* @package SPIP\Gamuform\Fonctions
*/
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function gamuform_objet_autoriser(string $objet):bool {
if (
!empty($GLOBALS['gamuform_objets'])
and !empty($objet)
and in_array($objet, $GLOBALS['gamuform_objets'])
) {
return true;
}
return false;
}
function gamuform_recup_champ($objet) {
$c = [];
if (gamuform_objet_autoriser($objet)) {
$T = $GLOBALS['gamuform_'.$objet];
if (!empty($T)) {
foreach ($T as $s) {
$c[] = $s['options']['nom'];
}
}
}
return $c;
}