From cd6bdc7b2719bea5c89e96efa5b175ed54a6b496 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jan 2014 15:08:33 +0100 Subject: [ticket/11201] Remove remaining type depending code to type class PHPBB3-11201 --- phpBB/phpbb/profilefields/profilefields.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb/profilefields/profilefields.php') diff --git a/phpBB/phpbb/profilefields/profilefields.php b/phpBB/phpbb/profilefields/profilefields.php index 78b408ba56..e01611460b 100644 --- a/phpBB/phpbb/profilefields/profilefields.php +++ b/phpBB/phpbb/profilefields/profilefields.php @@ -72,17 +72,15 @@ class profilefields { // Return templated field $tpl_snippet = $this->process_field_row('change', $row); - - // Some types are multivalue, we can't give them a field_id as we would not know which to pick - $type = (int) $row['field_type']; + $profile_field = $this->container->get('profilefields.type.' . $this->profile_types[$row['field_type']]); $this->template->assign_block_vars('profile_fields', array( 'LANG_NAME' => $row['lang_name'], 'LANG_EXPLAIN' => $row['lang_explain'], 'FIELD' => $tpl_snippet, - 'FIELD_ID' => ($type == FIELD_DATE || ($type == FIELD_BOOL && $row['field_length'] == '1')) ? '' : 'pf_' . $row['field_ident'], - 'S_REQUIRED' => ($row['field_required']) ? true : false) - ); + 'FIELD_ID' => $profile_field->get_field_ident($row), + 'S_REQUIRED' => ($row['field_required']) ? true : false, + )); } $this->db->sql_freeresult($result); } -- cgit v1.2.1