amélioration ergo
This commit is contained in:
parent
62f02552f8
commit
5f14275fb3
4 changed files with 28 additions and 14 deletions
|
@ -1,10 +1,12 @@
|
|||
#CACHE{0}
|
||||
[(#AUTORISER{voir,#ENV{objet}}|sinon_interdire_acces)]
|
||||
|
||||
<div class="conf-inner">
|
||||
<h2 class="text-center">Configuration des #ENV{objet}</h2>
|
||||
<h2 class="text-center">Configuration des [ (#ENV{objet}|gamuform_nom_objet)]</h2>
|
||||
<div class="tableau">
|
||||
[(#SET{lien,<a class="modalbox btn--osdve" href="[(#URL_PAGE{editer_gamuform}|parametre_url{objet,#ENV{objet}}|parametre_url{redirect,#SELF})]"><i class="osdve-plus-circle"></i> Nouveau</a>})]
|
||||
|
||||
[(#AUTORISER{creer,#ENV{objet}}|oui)
|
||||
[(#SET{lien,<a class="modalbox btn--osdve" href="[(#URL_PAGE{editer_gamuform}|parametre_url{objet,#ENV{objet}}|parametre_url{redirect,#SELF})]"><i class="osdve-plus-circle"></i> Nouveau</a>})]
|
||||
]
|
||||
#SET{url,spip.php?page=json_gamuform.json&objet=}
|
||||
#SET{url,#GET{url}|concat{#ENV{objet}}}
|
||||
<INCLURE{fond=inclure/gamutable,
|
||||
|
|
|
@ -17,13 +17,21 @@ function gamuform_objet_autoriser(string $objet):bool {
|
|||
if (
|
||||
!empty($GLOBALS['gamuform_objets'])
|
||||
and !empty($objet)
|
||||
and in_array($objet, $GLOBALS['gamuform_objets'])
|
||||
and in_array($objet, array_keys($GLOBALS['gamuform_objets']))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function gamuform_nom_objet($objet):string {
|
||||
$nom = '';
|
||||
if (gamuform_objet_autoriser($objet)) {
|
||||
$nom = $GLOBALS['gamuform_objets'][$objet];
|
||||
}
|
||||
return $nom;
|
||||
}
|
||||
|
||||
function gamuform_recup_champ($objet) {
|
||||
$c = [];
|
||||
|
||||
|
@ -31,7 +39,7 @@ function gamuform_recup_champ($objet) {
|
|||
$T = $GLOBALS['gamuform_'.$objet];
|
||||
if (!empty($T)) {
|
||||
foreach ($T as $s) {
|
||||
$c[] = $s['options']['nom'];
|
||||
$c[$s['options']['nom']] = $s['options']['libelle'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +51,7 @@ function gamuform_recup_valeurs($objet, $id_objet = 0):array {
|
|||
if (gamuform_objet_autoriser($objet)) {
|
||||
$table = table_objet_sql($objet);
|
||||
$id = id_table_objet($objet);
|
||||
$s = gamuform_recup_champ($objet);
|
||||
$s = array_keys(gamuform_recup_champ($objet));
|
||||
|
||||
$s[] = $id;
|
||||
if (intval($id_objet)) {
|
||||
|
@ -63,5 +71,6 @@ function gamuform_recup_valeurs($objet, $id_objet = 0):array {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
|
|
@ -14,15 +14,16 @@ if (!defined('_ECRIRE_INC_VERSION')) {
|
|||
}
|
||||
|
||||
|
||||
$GLOBALS['gamuform_objets'] = [ 'auteur'];
|
||||
$GLOBALS['gamuform_objets'] = [ 'auteur' => 'Auteurs'];
|
||||
|
||||
|
||||
$GLOBALS['gamuform_auteur'] = [
|
||||
[
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom' => 'nom',
|
||||
'label' => 'Votre Nom',
|
||||
'nom' => 'nom',
|
||||
'libelle' => 'Nom',
|
||||
'label' => 'Votre Nom',
|
||||
'obligatoire' => 'oui',
|
||||
//'fonction' => 'ma_super_fonction'
|
||||
//'modifier' => 'ma_super_fonction_pour_modifier'
|
||||
|
@ -32,6 +33,7 @@ $GLOBALS['gamuform_auteur'] = [
|
|||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom' => 'bio',
|
||||
'libelle' => 'Biographie',
|
||||
'label' => 'Votre BIO',
|
||||
'obligatoire' => 'oui',
|
||||
//'fonction' => 'ma_super_fonction'
|
||||
|
@ -40,8 +42,9 @@ $GLOBALS['gamuform_auteur'] = [
|
|||
[
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom' => 'nom_site',
|
||||
'label' => 'Votre site perso',
|
||||
'nom' => 'nom_site',
|
||||
'libelle' => 'Site Internet',
|
||||
'label' => 'Votre site perso',
|
||||
)
|
||||
]
|
||||
];
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"id": "id",
|
||||
"edit": "",
|
||||
<BOUCLE_header(DATA){source table,#GET{header}}{','}>
|
||||
"#VALEUR" : "#VALEUR"
|
||||
[(#CLE|json_encode)] : [(#VALEUR|json_encode)]
|
||||
</BOUCLE_header>
|
||||
},
|
||||
"crayons":{
|
||||
|
@ -34,14 +34,14 @@
|
|||
"id": #GET{ligne/id},
|
||||
"edit": [(#GET{edit}|json_encode)],
|
||||
<BOUCLE_headerB(DATA){source table,#GET{header}}{','}>
|
||||
"#VALEUR" : [(#GET{ligne/#VALEUR}|json_encode)]
|
||||
[(#CLE|json_encode)] : [(#GET{ligne/#CLE}|json_encode)]
|
||||
</BOUCLE_headerB>
|
||||
},
|
||||
"search": {
|
||||
"id": #GET{ligne/id},
|
||||
"edit": "",
|
||||
<BOUCLE_headerC(DATA){source table,#GET{header}}{','}>
|
||||
"#VALEUR" : [(#GET{ligne/#VALEUR}|textebrut|json_encode)]
|
||||
[(#CLE|json_encode)] : [(#GET{ligne/#CLE}|textebrut|json_encode)]
|
||||
</BOUCLE_headerC>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue