aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-18 13:08:15 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-18 13:16:18 +0100
commit197e026699e838c087b6d11a16ed6c2d9f15e0b0 (patch)
tree95902e3f08c5faeda73e86d484d56f683d618304 /phpBB/phpbb
parentdf85364baa440e8c244ae90235ad74400981eef5 (diff)
downloadforums-197e026699e838c087b6d11a16ed6c2d9f15e0b0.tar
forums-197e026699e838c087b6d11a16ed6c2d9f15e0b0.tar.gz
forums-197e026699e838c087b6d11a16ed6c2d9f15e0b0.tar.bz2
forums-197e026699e838c087b6d11a16ed6c2d9f15e0b0.tar.xz
forums-197e026699e838c087b6d11a16ed6c2d9f15e0b0.zip
[ticket/11201] Add a method to return the translated full name of the type
PHPBB3-11201
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/profilefields/profilefields.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_base.php10
-rw-r--r--phpBB/phpbb/profilefields/type/type_bool.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_date.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_dropdown.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_int.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_interface.php11
-rw-r--r--phpBB/phpbb/profilefields/type/type_string.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_text.php2
9 files changed, 25 insertions, 10 deletions
diff --git a/phpBB/phpbb/profilefields/profilefields.php b/phpBB/phpbb/profilefields/profilefields.php
index 8b1e10e78d..f63064bd56 100644
--- a/phpBB/phpbb/profilefields/profilefields.php
+++ b/phpBB/phpbb/profilefields/profilefields.php
@@ -322,7 +322,7 @@ class profilefields
// empty previously filled blockvars
foreach ($this->type_collection as $field_key => $field_type)
{
- $this->template->destroy_block_vars($field_type->get_name());
+ $this->template->destroy_block_vars($field_type->get_name_short());
}
// Assign template variables
diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php
index 195186ec86..6961d208e9 100644
--- a/phpBB/phpbb/profilefields/type/type_base.php
+++ b/phpBB/phpbb/profilefields/type/type_base.php
@@ -47,9 +47,17 @@ abstract class type_base implements type_interface
/**
* {@inheritDoc}
*/
+ public function get_name()
+ {
+ return $this->user->lang('FIELD_' . strtoupper($this->get_name_short()));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function get_service_name()
{
- return 'profilefields.type.' . $this->get_name();
+ return 'profilefields.type.' . $this->get_name_short();
}
/**
diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php
index f5f9003e6f..68d17fb4cf 100644
--- a/phpBB/phpbb/profilefields/type/type_bool.php
+++ b/phpBB/phpbb/profilefields/type/type_bool.php
@@ -63,7 +63,7 @@ class type_bool extends type_base
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'bool';
}
diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php
index 9b13cbac2e..f874ff33c3 100644
--- a/phpBB/phpbb/profilefields/type/type_date.php
+++ b/phpBB/phpbb/profilefields/type/type_date.php
@@ -55,7 +55,7 @@ class type_date extends type_base
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'date';
}
diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php
index 6bbd3f0842..5596e8f172 100644
--- a/phpBB/phpbb/profilefields/type/type_dropdown.php
+++ b/phpBB/phpbb/profilefields/type/type_dropdown.php
@@ -63,7 +63,7 @@ class type_dropdown extends type_base
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'dropdown';
}
diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php
index 8e43a6e312..6ffc8fbea0 100644
--- a/phpBB/phpbb/profilefields/type/type_int.php
+++ b/phpBB/phpbb/profilefields/type/type_int.php
@@ -47,7 +47,7 @@ class type_int extends type_base
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'int';
}
diff --git a/phpBB/phpbb/profilefields/type/type_interface.php b/phpBB/phpbb/profilefields/type/type_interface.php
index 5a88200bad..7d0cf7662f 100644
--- a/phpBB/phpbb/profilefields/type/type_interface.php
+++ b/phpBB/phpbb/profilefields/type/type_interface.php
@@ -12,13 +12,20 @@ namespace phpbb\profilefields\type;
interface type_interface
{
/**
- * Get the name of the type, used for error messages and template loops
+ * Get the translated name of the type
*
- * @return string lowercase version of the fields type
+ * @return string Translated name of the field type
*/
public function get_name();
/**
+ * Get the short name of the type, used for error messages and template loops
+ *
+ * @return string lowercase version of the fields type
+ */
+ public function get_name_short();
+
+ /**
* Get the name of service representing the type
*
* @return string lowercase version of the fields type
diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php
index 8b3dd1f73d..12a14d9b83 100644
--- a/phpBB/phpbb/profilefields/type/type_string.php
+++ b/phpBB/phpbb/profilefields/type/type_string.php
@@ -47,7 +47,7 @@ class type_string extends type_string_common
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'string';
}
diff --git a/phpBB/phpbb/profilefields/type/type_text.php b/phpBB/phpbb/profilefields/type/type_text.php
index 26671d2129..660bb20ef8 100644
--- a/phpBB/phpbb/profilefields/type/type_text.php
+++ b/phpBB/phpbb/profilefields/type/type_text.php
@@ -47,7 +47,7 @@ class type_text extends type_string_common
/**
* {@inheritDoc}
*/
- public function get_name()
+ public function get_name_short()
{
return 'text';
}