mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[ticket/11201] Add a method to return the translated full name of the type
PHPBB3-11201
This commit is contained in:
@@ -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
|
||||
|
@@ -44,12 +44,20 @@ abstract class type_base implements type_interface
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -63,7 +63,7 @@ class type_bool extends type_base
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'bool';
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ class type_date extends type_base
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'date';
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ class type_dropdown extends type_base
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'dropdown';
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ class type_int extends type_base
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'int';
|
||||
}
|
||||
|
@@ -12,11 +12,18 @@ 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 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();
|
||||
public function get_name_short();
|
||||
|
||||
/**
|
||||
* Get the name of service representing the type
|
||||
|
@@ -47,7 +47,7 @@ class type_string extends type_string_common
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ class type_text extends type_string_common
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function get_name()
|
||||
public function get_name_short()
|
||||
{
|
||||
return 'text';
|
||||
}
|
||||
|
Reference in New Issue
Block a user