From 14dc274e9e3568a276c654b0845252019525fb6f Mon Sep 17 00:00:00 2001 From: javiexin Date: Thu, 16 Jul 2015 10:47:04 +0200 Subject: [ticket/14387] Extend avatar-driver by extension in ACP not possible Create a driver method to provide the driver config name, and use it within the manager method. Default driver config name is the same as now. But new drivers are able to override the config name with their own. PHPBB3-14387 --- phpBB/phpbb/avatar/driver/driver.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb/avatar/driver/driver.php') diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index b3ced7edf7..a23b626e50 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -119,6 +119,14 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface return $this->name; } + /** + * {@inheritdoc} + */ + public function get_config_name() + { + return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this)); + } + /** * Sets the name of the driver. * -- cgit v1.2.1 From 06f4b6926baaf27897b2f57f7938eed4acf5dedb Mon Sep 17 00:00:00 2001 From: javiexin Date: Thu, 30 Jul 2015 01:43:18 +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 within the manager method. 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. PHPBB3-14387 --- phpBB/phpbb/avatar/driver/driver.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb/avatar/driver/driver.php') diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index a23b626e50..ad186635f2 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -127,6 +127,14 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this)); } + /** + * {@inheritdoc} + */ + public function get_acp_template_name() + { + return 'acp_avatar_options_' . $this->get_config_name() . '.html'; + } + /** * Sets the name of the driver. * -- cgit v1.2.1