From f52f327bace0514d1fe8825a1194c0506608b7c3 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 14 Mar 2020 02:38:07 +0100 Subject: [PATCH] =?UTF-8?q?On=20cr=C3=A9e=20une=20fonction=20"info=5Fparam?= =?UTF-8?q?($objet,=20$id=5Fobjet,$param)"=20permettant=20de=20cr=C3=A9er?= =?UTF-8?q?=20un=20squelette=20g=C3=A9n=C3=A9rique=20toggle=5Fparam=20et?= =?UTF-8?q?=20une=20action=20de=20m=C3=AAme=20nom=20qui=20active=20ou=20d?= =?UTF-8?q?=C3=A9sactive=20en=20ajax=20n'importe=20quel=20champ=20bool?= =?UTF-8?q?=C3=A9en=20d'un=20objet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action/toggle_param.php | 35 +++++++++++++++++++++++++++++++++++ balint_fonctions.php | 5 +++++ content/gerer_auteurs.html | 14 ++++++++------ inclure/toggle_param.html | 4 ++++ 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 action/toggle_param.php create mode 100644 inclure/toggle_param.html diff --git a/action/toggle_param.php b/action/toggle_param.php new file mode 100644 index 0000000..429e3ea --- /dev/null +++ b/action/toggle_param.php @@ -0,0 +1,35 @@ + ''); + } + else{ + $set = array($param => 'on'); + } + + sql_updateq($table, $set, $where); + include_spip('inc/invalideur'); + suivre_invalideur("id='$objet/$id_objet'"); + } + // redirection sur la page courante + include_spip('inc/headers'); + redirige_par_entete(_request('redirect')); +} + diff --git a/balint_fonctions.php b/balint_fonctions.php index 3f552f6..b047ce4 100644 --- a/balint_fonctions.php +++ b/balint_fonctions.php @@ -76,3 +76,8 @@ if (!function_exists('array_column')) { return $result; } } + +function info_param($arg){ + list($objet,$id_objet,$param)=explode('/',$arg); + return sql_getfetsel($param,'spip_' .$objet. 's',"id_$objet=$id_objet"); +} \ No newline at end of file diff --git a/content/gerer_auteurs.html b/content/gerer_auteurs.html index 473a5a9..5488d03 100644 --- a/content/gerer_auteurs.html +++ b/content/gerer_auteurs.html @@ -11,10 +11,10 @@ Nom Statut + Bureau Animateur Email Téléphone - Téléphone 2 Actions @@ -25,17 +25,19 @@ #NOM [(#STATUT|=={0minirezo}|oui) Administrateur] - [(#STATUT|=={1comite}|oui) Rédacteur] + [(#STATUT|=={1comite}|oui) Membre] [(#STATUT|=={6forum}|oui) Inscrit] - - [(#SURTITRE|unique)] + + + + + #SURTITRE #EMAIL - #TELEPHONE - #TELEPHONE2 + #TELEPHONE
#TELEPHONE2 diff --git a/inclure/toggle_param.html b/inclure/toggle_param.html new file mode 100644 index 0000000..8142b65 --- /dev/null +++ b/inclure/toggle_param.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file