aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/profilefields/manager.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-02-11 02:18:16 +0100
committerNils Adermann <naderman@naderman.de>2014-02-11 02:18:16 +0100
commit0b2b76f9514fed54c92e439eadbef6dc80290cd3 (patch)
tree779a80bc5d106afaff20a28675ba7e69771a7262 /phpBB/phpbb/profilefields/manager.php
parentb088bf864bf5827c1801c53c0af1b5a2f89f5b16 (diff)
parent5550f0fa870d531879d53d1bfdd76dcd29a16ce6 (diff)
downloadforums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar
forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.gz
forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.bz2
forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.xz
forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.zip
Merge pull request #2010 from nickvergessen/ticket/12169
Ticket/12169 Convert location user field to profile field
Diffstat (limited to 'phpBB/phpbb/profilefields/manager.php')
-rw-r--r--phpBB/phpbb/profilefields/manager.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php
index ead978374c..6a8d32f150 100644
--- a/phpBB/phpbb/profilefields/manager.php
+++ b/phpBB/phpbb/profilefields/manager.php
@@ -243,6 +243,39 @@ class manager
}
/**
+ * Generate the template arrays in order to display the column names
+ *
+ * @param string $restrict_option Restrict the published fields to a certain profile field option
+ * @return array Returns an array with the template variables type, name and explain for the fields to display
+ */
+ public function generate_profile_fields_template_headlines($restrict_option = '')
+ {
+ if (!sizeof($this->profile_cache))
+ {
+ $this->build_cache();
+ }
+
+ // Go through the fields in correct order
+ foreach ($this->profile_cache as $field_ident => $field_data)
+ {
+ if ($restrict_option && !$field_data[$restrict_option])
+ {
+ continue;
+ }
+
+ $profile_field = $this->type_collection[$field_data['field_type']];
+
+ $tpl_fields[] = array(
+ 'PROFILE_FIELD_TYPE' => $field_data['field_type'],
+ 'PROFILE_FIELD_NAME' => $profile_field->get_field_name($field_data['lang_name']),
+ 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($field_data['lang_explain']),
+ );
+ }
+
+ return $tpl_fields;
+ }
+
+ /**
* Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled)
* This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template
*/