aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/profilefields/profilefields.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-15 11:40:03 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-15 12:15:41 +0100
commit5df7f76e6b810f08076b905f189bc7e4c3f8b8b1 (patch)
tree18a7ebc38aeb82b2be79c2f944307bd82c233167 /phpBB/phpbb/profilefields/profilefields.php
parentcd6bdc7b2719bea5c89e96efa5b175ed54a6b496 (diff)
downloadforums-5df7f76e6b810f08076b905f189bc7e4c3f8b8b1.tar
forums-5df7f76e6b810f08076b905f189bc7e4c3f8b8b1.tar.gz
forums-5df7f76e6b810f08076b905f189bc7e4c3f8b8b1.tar.bz2
forums-5df7f76e6b810f08076b905f189bc7e4c3f8b8b1.tar.xz
forums-5df7f76e6b810f08076b905f189bc7e4c3f8b8b1.zip
[ticket/11201] Split language options into a new class
Otherwise we run into a circular dependency PHPBB3-11201
Diffstat (limited to 'phpBB/phpbb/profilefields/profilefields.php')
-rw-r--r--phpBB/phpbb/profilefields/profilefields.php37
1 files changed, 2 insertions, 35 deletions
diff --git a/phpBB/phpbb/profilefields/profilefields.php b/phpBB/phpbb/profilefields/profilefields.php
index e01611460b..0ed63223f5 100644
--- a/phpBB/phpbb/profilefields/profilefields.php
+++ b/phpBB/phpbb/profilefields/profilefields.php
@@ -17,7 +17,6 @@ class profilefields
{
var $profile_types = array(FIELD_INT => 'int', FIELD_STRING => 'string', FIELD_TEXT => 'text', FIELD_BOOL => 'bool', FIELD_DROPDOWN => 'dropdown', FIELD_DATE => 'date');
var $profile_cache = array();
- var $options_lang = array();
/**
*
@@ -111,38 +110,6 @@ class profilefields
}
/**
- * Get language entries for options and store them here for later use
- */
- public function get_option_lang($field_id, $lang_id, $field_type, $preview)
- {
- if ($preview)
- {
- $lang_options = (!is_array($this->vars['lang_options'])) ? explode("\n", $this->vars['lang_options']) : $this->vars['lang_options'];
-
- foreach ($lang_options as $num => $var)
- {
- $this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
- }
- }
- else
- {
- $sql = 'SELECT option_id, lang_value
- FROM ' . PROFILE_FIELDS_LANG_TABLE . "
- WHERE field_id = $field_id
- AND lang_id = $lang_id
- AND field_type = $field_type
- ORDER BY option_id";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- $this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
- }
- $this->db->sql_freeresult($result);
- }
- }
-
- /**
* Submit profile field for validation
*/
public function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
@@ -360,7 +327,7 @@ class profilefields
*/
protected function process_field_row($mode, $profile_row)
{
- $preview = ($mode == 'preview') ? true : false;
+ $preview_options = ($mode == 'preview') ? $this->vars['lang_options'] : false;
// set template filename
$this->template->set_filenames(array(
@@ -375,7 +342,7 @@ class profilefields
// Assign template variables
$profile_field = $this->container->get('profilefields.type.' . $this->profile_types[$profile_row['field_type']]);
- $profile_field->generate_field($profile_row, $preview);
+ $profile_field->generate_field($profile_row, $preview_options);
// Return templated data
return $this->template->assign_display('cp_body');