From f16193e9ff636c8c5977d579c0ba4bb9c14a1e25 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 May 2011 13:47:37 +0000 Subject: [PATCH] Todo: no GET or POST in class file, use a param --- htdocs/core/class/html.form.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6fb85c3363d..a07ce5246c8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -33,7 +33,6 @@ * \brief File of class with all html predefined components * \version $Id$ */ - $action = GETPOST("action"); /** @@ -75,6 +74,7 @@ class Form * @param perm Permission to allow button to edit parameter * @param typeofdata Type of data (string by default, email, ...) * @return string HTML edit field + * TODO no GET or POST in class file, use a param */ function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string') { @@ -83,7 +83,7 @@ class Form $ret.=''; - if ($action != 'edit'.$htmlname && $perm) $ret.=''; + if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; $ret.='
'; $ret.=$langs->trans($text); $ret.=''.img_edit($langs->trans('Edit'),1).''.img_edit($langs->trans('Edit'),1).'
'; return $ret; } @@ -97,12 +97,13 @@ class Form * @param perm Permission to allow button to edit parameter * @param typeofdata Type of data ('string' by default, 'email', 'text', ...) * @return string HTML edit field + * TODO no GET or POST in class file, use a param */ function editfieldval($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string') { global $langs; $ret=''; - if ($action == 'edit'.$htmlname) + if (GETPOST('action') == 'edit'.$htmlname) { $ret.="\n"; $ret.='
';