mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/11859] Make avatar drivers return template filename
The service name might not follow the expected naming scheme which would cause abnormally long filenames and confusion for authors that might add more avatar drivers. PHPBB3-11859
This commit is contained in:
parent
125e76f9aa
commit
6618f0ea24
5 changed files with 32 additions and 11 deletions
|
@ -109,17 +109,6 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_template_name()
|
||||
{
|
||||
$driver = preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
|
||||
$template = "ucp_avatar_options_$driver.html";
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
|
@ -146,6 +146,14 @@ class gravatar extends \phpbb\avatar\driver\driver
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_template_name()
|
||||
{
|
||||
return 'ucp_avatar_options_gravatar.html';
|
||||
}
|
||||
|
||||
/**
|
||||
* Build gravatar URL for output on page
|
||||
*
|
||||
|
|
|
@ -134,6 +134,14 @@ class local extends \phpbb\avatar\driver\driver
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_template_name()
|
||||
{
|
||||
return 'ucp_avatar_options_local.html';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of avatars that are locally available
|
||||
* Results get cached for 24 hours (86400 seconds)
|
||||
|
|
|
@ -186,4 +186,12 @@ class remote extends \phpbb\avatar\driver\driver
|
|||
'avatar_height' => $height,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_template_name()
|
||||
{
|
||||
return 'ucp_avatar_options_remote.html';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,6 +167,14 @@ class upload extends \phpbb\avatar\driver\driver
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_template_name()
|
||||
{
|
||||
return 'ucp_avatar_options_upload.html';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is able to upload an avatar
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue