mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Admin-UI: Make sure data is returned as an array when stored as one. Attention: @SecretR
This commit is contained in:
parent
4c1cbab300
commit
6e598c9430
@ -1103,8 +1103,8 @@ class e_form
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "<span class='form-inline'>".$text.$gen."</span>".vartrue($addon);
|
return "<span class='form-inline'>".$text.$gen."</span>".vartrue($addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1679,15 +1679,15 @@ class e_form
|
|||||||
{
|
{
|
||||||
|
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
return e107::getUserClass()->uc_checkboxes($name,$curval,$options,null,true);
|
return e107::getUserClass()->uc_checkboxes($name,$curval,$options,null,true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'dropdown':
|
case 'dropdown':
|
||||||
default:
|
default:
|
||||||
return e107::getUserClass()->uc_dropdown($name,$curval,$options);
|
return e107::getUserClass()->uc_dropdown($name,$curval,$options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3418,6 +3418,12 @@ class e_form
|
|||||||
case 'method': // Custom Function
|
case 'method': // Custom Function
|
||||||
$method = $attributes['field']; // prevents table alias in method names. ie. u.my_method.
|
$method = $attributes['field']; // prevents table alias in method names. ie. u.my_method.
|
||||||
$_value = $value;
|
$_value = $value;
|
||||||
|
|
||||||
|
if($attributes['data'] == 'array') // FIXME @SecretR - please move this to where it should be.
|
||||||
|
{
|
||||||
|
$value = e107::unserialize($value); // (saved as array, return it as an array)
|
||||||
|
}
|
||||||
|
|
||||||
$value = call_user_func_array(array($this, $method), array($value, 'read', $parms));
|
$value = call_user_func_array(array($this, $method), array($value, 'read', $parms));
|
||||||
|
|
||||||
// print_a($attributes);
|
// print_a($attributes);
|
||||||
@ -3432,9 +3438,9 @@ class e_form
|
|||||||
{
|
{
|
||||||
switch ($attributes['inline'])
|
switch ($attributes['inline'])
|
||||||
{
|
{
|
||||||
|
|
||||||
case 'checklist':
|
case 'checklist':
|
||||||
$xtype = 'checklist';
|
$xtype = 'checklist';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
@ -3443,13 +3449,13 @@ class e_form
|
|||||||
|
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
$xtype = 'textarea';
|
$xtype = 'textarea';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$xtype = 'text';
|
$xtype = 'text';
|
||||||
$methodParms = null;
|
$methodParms = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3643,8 +3649,8 @@ class e_form
|
|||||||
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']);
|
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
$ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user