From 917c864bbf51309da4c8bda7ad03e1e00afc0764 Mon Sep 17 00:00:00 2001 From: javiexin Date: Thu, 30 Jul 2015 10:48:39 +0200 Subject: [ticket/14387] Extend avatar-driver by extension in ACP not possible Create two driver methods to provide the driver config name and the driver ACP template name, and use them directly when required. Default driver config name and template name are the same as now. But new drivers are able to override the config name and template name with their own, including @vendor_extension. Simplified manager interface by reducing unneeded methods. PHPBB3-14387 --- phpBB/phpbb/avatar/manager.php | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'phpBB/phpbb/avatar/manager.php') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 5db9ab13fb..26eb17c265 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -246,7 +246,7 @@ class manager */ public function is_enabled($driver) { - $config_name = $this->get_driver_config_name($driver); + $config_name = $driver->get_config_name(); return $this->config["allow_avatar_{$config_name}"]; } @@ -260,37 +260,13 @@ class manager */ public function get_avatar_settings($driver) { - $config_name = $this->get_driver_config_name($driver); + $config_name = $driver->get_config_name(); return array( 'allow_avatar_' . $config_name => array('lang' => 'ALLOW_' . strtoupper(str_replace('\\', '_', $config_name)), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), ); } - /** - * Get the config name of an avatar driver - * - * @param object $driver Avatar driver object - * - * @return string Avatar driver config name - */ - public function get_driver_config_name($driver) - { - return $driver->get_config_name(); - } - - /** - * Get the template name of an avatar driver - * - * @param object $driver Avatar driver object - * - * @return string Avatar driver template name - */ - public function get_driver_template_name($driver) - { - return $driver->get_acp_template_name(); - } - /** * Replace "error" strings with their real, localized form * -- cgit v1.2.1