formulaire et des pages gamutable pour gerer des configurations de facons semi automatique
39 lines
682 B
PHP
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;
|
|
}
|