1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

CSS BC, default form URL enhancement

This commit is contained in:
SecretR
2012-12-03 13:23:46 +02:00
parent f276b698a4
commit 8e62d55970

View File

@@ -88,7 +88,7 @@ class e_form
* Open a new form * Open a new form
* @param string name * @param string name
* @param $method - post|get default is post * @param $method - post|get default is post
* @param @target - e_SELF by default * @param @target - e_REQUEST_URI by default
* @param $other - unused at the moment. * @param $other - unused at the moment.
*/ */
@@ -96,7 +96,7 @@ class e_form
{ {
if($target == null) if($target == null)
{ {
$target = e_SELF . (e_QUERY ? "?".e_QUERY : ""); $target = e_REQUEST_URI;
} }
if($method == null) if($method == null)
@@ -175,10 +175,9 @@ class e_form
* @param $maxlength * @param $maxlength
* @param $options * @param $options
*/ */
function text($name, $value, $maxlength = 80, $options= null) function text($name, $value, $maxlength = 80, $options= array())
{ {
if(is_string($options))
if(vartrue($options) && is_string($options))
{ {
parse_str($options,$options); parse_str($options,$options);
} }
@@ -187,21 +186,24 @@ class e_form
{ {
if($maxlength < 10) if($maxlength < 10)
{ {
$options['class'] = 'tbox span3'; $options['class'] = 'tbox input-text span3';
} }
if($maxlength < 50) elseif($maxlength < 50)
{ {
$options['class'] = 'tbox span7'; $options['class'] = 'tbox input-text span7';
} }
if($maxlength > 99) elseif($maxlength > 99)
{ {
$options['class'] = 'tbox span7'; $options['class'] = 'tbox input-text span7';
}
else
{
$options['class'] = 'tbox input-text';
} }
} }
$options = $this->format_options('text', $name, $options); $options = $this->format_options('text', $name, $options);
//never allow id in format name-value for text fields //never allow id in format name-value for text fields
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />"; return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
@@ -218,8 +220,6 @@ class e_form
return $this->text($key, $value, $maxlength, $parms); return $this->text($key, $value, $maxlength, $parms);
} }
function email($name, $value, $maxlength = 200, $options = array()) function email($name, $value, $maxlength = 200, $options = array())
{ {
$options = $this->format_options('text', $name, $options); $options = $this->format_options('text', $name, $options);