mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
[feature/avatars] Rewrite drivers to use full class name
* Use full driver class name as avatar_type value * Move avatar drivers to core namespace * Make avatars installable through extensions PHPBB3-10018
This commit is contained in:
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
|
||||
* Handles avatars selected from the board gallery
|
||||
* @package avatars
|
||||
*/
|
||||
class phpbb_avatar_driver_local extends phpbb_avatar_driver
|
||||
class phpbb_avatar_driver_core_local extends phpbb_avatar_driver
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
|
||||
* Handles avatars hosted remotely
|
||||
* @package avatars
|
||||
*/
|
||||
class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||
class phpbb_avatar_driver_core_remote extends phpbb_avatar_driver
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
|
||||
* Handles avatars uploaded to the board
|
||||
* @package avatars
|
||||
*/
|
||||
class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||
class phpbb_avatar_driver_core_upload extends phpbb_avatar_driver
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
@@ -119,4 +119,25 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function is_enabled()
|
||||
{
|
||||
$driver = preg_replace('#^phpbb_avatar_driver_core_#', '', get_class($this));
|
||||
|
||||
return $this->config["allow_avatar_$driver"];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function get_template_name()
|
||||
{
|
||||
$driver = preg_replace('#^phpbb_avatar_driver_core_#', '', get_class($this));
|
||||
$template = "ucp_avatar_options_$driver.html";
|
||||
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
|
@@ -57,4 +57,14 @@ interface phpbb_avatar_driver_interface
|
||||
* @TODO
|
||||
**/
|
||||
public function delete($row);
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
**/
|
||||
public function is_enabled();
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
**/
|
||||
public function get_template_name();
|
||||
}
|
||||
|
Reference in New Issue
Block a user