Todo: no GET or POST in class file, use a param
This commit is contained in:
parent
2e992b8f24
commit
f16193e9ff
@ -33,7 +33,6 @@
|
|||||||
* \brief File of class with all html predefined components
|
* \brief File of class with all html predefined components
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
$action = GETPOST("action");
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,6 +74,7 @@ class Form
|
|||||||
* @param perm Permission to allow button to edit parameter
|
* @param perm Permission to allow button to edit parameter
|
||||||
* @param typeofdata Type of data (string by default, email, ...)
|
* @param typeofdata Type of data (string by default, email, ...)
|
||||||
* @return string HTML edit field
|
* @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')
|
function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string')
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ class Form
|
|||||||
$ret.='<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
$ret.='<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||||
$ret.=$langs->trans($text);
|
$ret.=$langs->trans($text);
|
||||||
$ret.='</td>';
|
$ret.='</td>';
|
||||||
if ($action != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&'.$paramkey.'='.$paramvalue.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&'.$paramkey.'='.$paramvalue.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
||||||
$ret.='</tr></table>';
|
$ret.='</tr></table>';
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -97,12 +97,13 @@ class Form
|
|||||||
* @param perm Permission to allow button to edit parameter
|
* @param perm Permission to allow button to edit parameter
|
||||||
* @param typeofdata Type of data ('string' by default, 'email', 'text', ...)
|
* @param typeofdata Type of data ('string' by default, 'email', 'text', ...)
|
||||||
* @return string HTML edit field
|
* @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')
|
function editfieldval($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$ret='';
|
$ret='';
|
||||||
if ($action == 'edit'.$htmlname)
|
if (GETPOST('action') == 'edit'.$htmlname)
|
||||||
{
|
{
|
||||||
$ret.="\n";
|
$ret.="\n";
|
||||||
$ret.='<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
$ret.='<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user