reverted stuff for type "text"

This commit is contained in:
Ralf Becker 2014-04-08 12:06:49 +00:00
parent 8a529cc4af
commit bd7b014c7b

View File

@ -386,7 +386,7 @@ class etemplate extends boetemplate
* @param string $cname=null name-prefix, which need to be ignored, default self::$name_vars
* @return boolean true if there are not ignored validation errors, false otherwise
*/
function validation_errors($ignore_validation='',$cname=null)
static function validation_errors($ignore_validation='',$cname=null)
{
if (is_null($cname)) $cname = self::$name_vars;
//echo "<p>uietemplate::validation_errors('$ignore_validation','$cname') validation_error="; _debug_array(self::$validation_errors);
@ -1295,8 +1295,6 @@ class etemplate extends boetemplate
case 'hidden':
case 'passwd':
case 'text': // size: [length][,maxLength[,preg[,html5type]]]
$autocompletion_off='';
if ($type == 'passwd') $autocompletion_off='autocomplete="off"';
$cell_opts = $c = self::csv_split($cell_options); // allows to enclose preg in quote to allow comma
// fix preg, in case it contains a comma (html5type is only letters and always last option!)
if (count($cell_opts) > 3 && ($cell_opts2 = explode(',',$cell_options)) && $cell_opts2[2][0] != '"')
@ -1316,9 +1314,19 @@ class etemplate extends boetemplate
}
else
{
if ($cell_opts[0] < 0) $cell_opts[0] = abs($cell_opts[0]);
if ($cell_opts[0] < 0)
{
$cell_opts[0] = abs($cell_opts[0]);
$options .= ' readonly="readonly"';
}
// only add html5 required attribute, if validation is NOT ignored
if ($cell['needed'] && self::ignore_validation_match($form_name, self::$request->ignore_validation, $cname))
{
$required = ' required';
}
$html .= html::input($form_name,$value,$type == 'passwd' ? 'password' : ($type == 'hidden' ? 'hidden' : $cell_opts[3]),
$options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH').($cell['needed']?' required="required"':'').($autocompletion_off?' '.$autocompletion_off:''));
$options.html::formatOptions($cell_opts,'SIZE,MAXLENGTH').
$required.($type == 'passwd'?' autocomplete="off"':''));
if (!$readonly)
{