1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

Various bug fixes

This commit is contained in:
SecretR
2013-10-14 15:38:57 +03:00
parent 37ee3f132a
commit 2bdcceab9c
9 changed files with 20 additions and 43 deletions

View File

@@ -687,30 +687,14 @@ class e_form
{
if(!is_array($options)) parse_str($options, $options);
$default_name = vartrue($default_name, '');
$default_id = vartrue($default_id, 0);
$default_name = vartrue($default_name,USERNAME);
$default_id = vartrue($default_id,USERID);
//TODO Auto-calculate $name_fld from $id_fld ie. append "_usersearch" here ?
$fldid = $this->name2id($name_fld);
$hidden_fldid = $this->name2id($id_fld);
$ret = $this->text($name_fld,$default_name,20, "class=e-tip&title=Type name of user&typeahead=users&readonly=".vartrue($options['readonly']))
.$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# <span id='{$fldid}-id'>".$default_id.'</span>';
$ret .= " <a href='#' id='{$fldid}-reset'>reset</a>";
return $this->text($name_fld,$default_name,20, "class=e-tip&title=Type name of user&typeahead=users&readonly=".vartrue($options['readonly']))
.$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# ".$default_id;
e107::getJs()->footerInline("
\$('#{$fldid}').blur(function () {
\$('#{$fldid}-id').html(\$('#{$hidden_fldid}').val());
});
\$('#{$fldid}-reset').click(function () {
\$('#{$fldid}-id').html('0');
\$('#{$hidden_fldid}').val(0);
\$('#{$fldid}').val('');
});
");
return $ret;
/*
$label_fld = str_replace('_', '-', $name_fld).'-upicker-lable';