1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Admin-UI: Make sure data is returned as an array when stored as one. Attention: @SecretR

This commit is contained in:
Cameron 2015-02-14 12:22:07 -08:00
parent 4c1cbab300
commit 6e598c9430

View File

@ -1103,8 +1103,8 @@ class e_form
return $text;
}
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)
{
case 'checkbox':
return e107::getUserClass()->uc_checkboxes($name,$curval,$options,null,true);
break;
{
case 'checkbox':
return e107::getUserClass()->uc_checkboxes($name,$curval,$options,null,true);
break;
case 'dropdown':
default:
return e107::getUserClass()->uc_dropdown($name,$curval,$options);
break;
case 'dropdown':
default:
return e107::getUserClass()->uc_dropdown($name,$curval,$options);
break;
}
}
@ -3418,6 +3418,12 @@ class e_form
case 'method': // Custom Function
$method = $attributes['field']; // prevents table alias in method names. ie. u.my_method.
$_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));
// print_a($attributes);
@ -3432,9 +3438,9 @@ class e_form
{
switch ($attributes['inline'])
{
case 'checklist':
$xtype = 'checklist';
case 'checklist':
$xtype = 'checklist';
break;
case 'select':
@ -3443,13 +3449,13 @@ class e_form
case 'textarea':
$xtype = 'textarea';
break;
break;
default:
default:
$xtype = 'text';
$methodParms = null;
break;
$methodParms = null;
break;
}
}
@ -3643,8 +3649,8 @@ class e_form
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']);
}
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;