aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-15 18:25:28 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-15 18:25:28 +0100
commit78603bb96d0afa0695b296013dec17485d74ea45 (patch)
treee0b34560bdd7618968b87621779ef0ace14093a2 /phpBB/includes
parentbd1425d07561345b7f92977f81bb1fb9e9cda927 (diff)
downloadforums-78603bb96d0afa0695b296013dec17485d74ea45.tar
forums-78603bb96d0afa0695b296013dec17485d74ea45.tar.gz
forums-78603bb96d0afa0695b296013dec17485d74ea45.tar.bz2
forums-78603bb96d0afa0695b296013dec17485d74ea45.tar.xz
forums-78603bb96d0afa0695b296013dec17485d74ea45.zip
[ticket/11201] Move language option determination into type class
PHPBB3-11201
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_profile.php30
1 files changed, 4 insertions, 26 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 2d4097d526..6ee051e37b 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -942,7 +942,7 @@ class acp_profile
*/
function build_language_options(&$cp, $field_type, $action = 'create')
{
- global $user, $config, $db;
+ global $user, $config, $db, $phpbb_container;
$default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']];
@@ -959,31 +959,9 @@ class acp_profile
}
$db->sql_freeresult($result);
- $options = array();
- $options['lang_name'] = 'string';
- if ($cp->vars['lang_explain'])
- {
- $options['lang_explain'] = 'text';
- }
-
- switch ($field_type)
- {
- case FIELD_BOOL:
- $options['lang_options'] = 'two_options';
- break;
-
- case FIELD_DROPDOWN:
- $options['lang_options'] = 'optionfield';
- break;
-
- case FIELD_TEXT:
- case FIELD_STRING:
- if (strlen($cp->vars['lang_default_value']))
- {
- $options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text';
- }
- break;
- }
+ $type_collection = $phpbb_container->get('profilefields.type_collection');
+ $profile_type = $type_collection['profilefields.type.' . $cp->profile_types[$field_type]];
+ $options = $profile_type->get_language_options($cp->vars);
$lang_options = array();