mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
git-svn-id: file:///svn/phpbb/trunk@5923 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
760d0a66d4
commit
545bf57cb3
1 changed files with 18 additions and 8 deletions
|
@ -318,23 +318,31 @@ class acp_profile
|
||||||
$cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true);
|
$cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true);
|
||||||
$cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true);
|
$cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true);
|
||||||
|
|
||||||
|
// A boolean field expects an array as the lang options
|
||||||
|
if ($field_type == FIELD_BOOL)
|
||||||
|
{
|
||||||
|
$options = request_var('lang_options', array(''), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$options = request_var('lang_options', '', true);
|
$options = request_var('lang_options', '', true);
|
||||||
|
}
|
||||||
|
|
||||||
// If the user has submitted a form with options (i.e. dropdown field)
|
// If the user has submitted a form with options (i.e. dropdown field)
|
||||||
if ($options)
|
if ($options)
|
||||||
{
|
{
|
||||||
$exploded_options = explode("\n", $options);
|
$exploded_options = (is_array($options)) ? $options : explode("\n", $options);
|
||||||
|
|
||||||
if (sizeof($exploded_options) == sizeof($lang_options) || $action == 'create')
|
if (sizeof($exploded_options) == sizeof($lang_options) || $action == 'create')
|
||||||
{
|
{
|
||||||
// The number of options in the field is equal to the number of options already in the database
|
// The number of options in the field is equal to the number of options already in the database
|
||||||
// Or we are creating a new dropdown list.
|
// Or we are creating a new dropdown list.
|
||||||
$cp->vars['lang_options'] = explode("\n", $options);
|
$cp->vars['lang_options'] = $exploded_options;
|
||||||
}
|
}
|
||||||
else if ($action == 'edit')
|
else if ($action == 'edit')
|
||||||
{
|
{
|
||||||
// Changing the number of options? (We remove and re-create the option fields)
|
// Changing the number of options? (We remove and re-create the option fields)
|
||||||
$cp->vars['lang_options'] = explode("\n", $options);
|
$cp->vars['lang_options'] = $exploded_options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -526,11 +534,13 @@ class acp_profile
|
||||||
|
|
||||||
foreach ($key_ary as $key)
|
foreach ($key_ary as $key)
|
||||||
{
|
{
|
||||||
$var = isset($_REQUEST[$key]) ? request_var($key, '', true) : false;
|
if (!isset($_REQUEST[$key]))
|
||||||
|
|
||||||
if ($var !== false)
|
|
||||||
{
|
{
|
||||||
$_new_key_ary[$key] = $var;
|
$var = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? request_var($key, array(''), true) : request_var($key, '', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue