1
0
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:
Igor Wiedler
2012-06-27 21:02:07 +02:00
parent 13f4bfabbe
commit df16bd1c49
9 changed files with 68 additions and 38 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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();
}