1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/10631] Use display name if available

PHPBB3-10631
This commit is contained in:
Nathan Guse
2012-07-23 14:01:13 -05:00
committed by Unknown Bliss
parent 28ca2d6a5f
commit 74492b3cdd
2 changed files with 11 additions and 14 deletions

View File

@@ -55,7 +55,7 @@ class phpbb_extension_metadata_manager
* Processes and gets the metadata requested
*
* @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term.
* @param boolean $template_output True if you want the requested metadata assigned to template vars
* @param boolean $template_output True if you want the requested metadata assigned to template vars (only works on the 'all" case
* @return array Contains all of the requested metadata
*/
public function get_metadata($element = 'all', $template_output = false)
@@ -89,20 +89,17 @@ class phpbb_extension_metadata_manager
break;
case 'name':
if ($this->validate_name())
return ($this->validate_name()) ? $this->metadata['name'] : false;
break;
case 'display-name':
if ($this->validate_extra_display_name())
{
if ($template_output)
{
$template->assign_vars(array(
'MD_NAME' => htmlspecialchars($this->metadata['name']),
));
}
return $this->metadata['name'];
return $this->metadata['extra']['display-name'];
}
else
{
return false;
return ($this->validate_name()) ? $this->metadata['name'] : false;
}
break;
// TODO: Add remaining cases as needed