diff --git a/content/voir_gamutable.html b/content/voir_gamutable.html
new file mode 100644
index 0000000..cfc1d48
--- /dev/null
+++ b/content/voir_gamutable.html
@@ -0,0 +1,17 @@
+#CACHE{0}
+
+
+
Configuration de #ENV{objet}
+
+ [(#SET{lien,
Nouveau})]
+
+ #SET{url,spip.php?page=json_gamuform.json&objet=}
+ #SET{url,#GET{url}|concat{#ENV{objet}}}
+
+
+
+
diff --git a/gamuform_fonctions.php b/gamuform_fonctions.php
index 540e92d..d19406b 100644
--- a/gamuform_fonctions.php
+++ b/gamuform_fonctions.php
@@ -37,3 +37,31 @@ function gamuform_recup_champ($objet) {
}
return $c;
}
+
+function gamuform_recup_valeurs($objet, $id_objet = 0):array {
+ $r = [];
+ if (gamuform_objet_autoriser($objet)) {
+ $table = table_objet_sql($objet);
+ $id = id_table_objet($objet);
+ $s = gamuform_recup_champ($objet);
+
+ $s[] = $id;
+ if (intval($id_objet)) {
+ $valeurs = sql_fetsel($s, $table, "$id=".intval($id_objet));
+ $valeurs['id'] = $valeurs[$id];
+ if (!empty($valeurs)) {
+ $r[0] = $valeurs;
+ }
+ } else {
+ $T = sql_allfetsel($s, $table, 1);
+ if (!empty($T)) {
+ foreach ($T as $t) {
+ $t['id'] = $t[$id];
+ $r[] = $t;
+ }
+ }
+ }
+ }
+
+ return $r;
+}
diff --git a/inclure/editer_gamuform.html b/inclure/editer_gamuform.html
index 774d3b3..f1ffee0 100644
--- a/inclure/editer_gamuform.html
+++ b/inclure/editer_gamuform.html
@@ -3,6 +3,6 @@
- [(#FORMULAIRE_EDITER_GAMUFORM{#ENV{id}, #ENV{objet}, #ENV{redirect}})]
+ [(#FORMULAIRE_EDITER_GAMUFORM{#ENV{id_objet}, #ENV{objet}, #ENV{redirect}})]
diff --git a/json_gamuform.json.html b/json_gamuform.json.html
new file mode 100644
index 0000000..4f9581f
--- /dev/null
+++ b/json_gamuform.json.html
@@ -0,0 +1,50 @@
+#HTTP_HEADER{Content-Type: application/json; charset=#CHARSET}
+
+#SET{header,#ENV{objet}|gamuform_recup_champ}
+[{
+"header":{
+"id": "id",
+"edit": "",
+
+"#VALEUR" : "#VALEUR"
+
+},
+"crayons":{
+},
+"filtreCol" : {
+},
+"classes" : {
+ "id": "w80p",
+ "edit": "w80p"
+}
+}
+
+,
+
+ #SET{ligne,#VALEUR}
+ [(#SET{edit,
+
+ })]
+{
+"html": {
+ "id": #GET{ligne/id},
+ "edit": [(#GET{edit}|json_encode)],
+
+ "#VALEUR" : [(#GET{ligne/#VALEUR}|json_encode)]
+
+},
+"search": {
+ "id": #GET{ligne/id},
+ "edit": "",
+
+ "#VALEUR" : [(#GET{ligne/#VALEUR}|textebrut|json_encode)]
+
+}
+}
+
+]
+