From 81fb4268cd141259fe5b3bc9ad51adf2e29e0772 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 8 Apr 2012 16:40:19 +0200 Subject: [feature/avatars] Introduce an avatar driver interface PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 phpBB/includes/avatar/driver/interface.php (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php new file mode 100644 index 0000000000..dcec5811bb --- /dev/null +++ b/phpBB/includes/avatar/driver/interface.php @@ -0,0 +1,71 @@ + '', 'width' => 0, 'height' => 0] + */ + public function get_data($row, $ignore_config = false); + + /** + * Returns custom html for displaying this avatar. + * Only called if $custom_html is true. + * + * @param $ignore_config Whether this function should respect the users prefs + * and board configuration configuration option, or should just render + * the avatar anyways. Useful for the ACP. + * @return string HTML + */ + public function get_custom_html($row, $ignore_config = false); + + /** + * @TODO + **/ + public function prepare_form($template, $row, &$error, &$override_focus); + + /** + * @TODO + **/ + public function process_form($template, $row, &$error); + + /** + * @TODO + **/ + public function delete($row); + + /** + * @TODO + **/ + public static function clean_row($row, $src = phpbb_avatar_driver_interface::FROM_USER); +} -- cgit v1.2.1 From 3b71e81cfba726043063b05cb793e18186143252 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 8 Apr 2012 21:29:52 +0200 Subject: [feature/avatars] Simplify clean_row, move it to avatar manager PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index dcec5811bb..8c8a067d13 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -21,12 +21,6 @@ if (!defined('IN_PHPBB')) */ interface phpbb_avatar_driver_interface { - /** - * @TODO - */ - const FROM_USER = 0; - const FROM_GROUP = 1; - /** * Get the avatar url and dimensions * @@ -63,9 +57,4 @@ interface phpbb_avatar_driver_interface * @TODO **/ public function delete($row); - - /** - * @TODO - **/ - public static function clean_row($row, $src = phpbb_avatar_driver_interface::FROM_USER); } -- cgit v1.2.1 From d10486699273b896fffe86f05f66a6d542843f5b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 27 Jun 2012 16:59:06 +0200 Subject: [feature/avatars] Remove unneeded argument for driver prepare_form() PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 8c8a067d13..d3b764e275 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -46,7 +46,7 @@ interface phpbb_avatar_driver_interface /** * @TODO **/ - public function prepare_form($template, $row, &$error, &$override_focus); + public function prepare_form($template, $row, &$error); /** * @TODO -- cgit v1.2.1 From df16bd1c49e6e970b147f15e752825dd3186fb87 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 27 Jun 2012 21:02:07 +0200 Subject: [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 --- phpBB/includes/avatar/driver/interface.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index d3b764e275..4f1c1f73cf 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -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(); } -- cgit v1.2.1 From 076785d76a1412394636095f0b296964419e2a4f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 14 Nov 2012 20:04:02 +0100 Subject: [feature/avatars] Add support for custom avatar HTML code PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 4f1c1f73cf..16fef58e7a 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -41,7 +41,7 @@ interface phpbb_avatar_driver_interface * the avatar anyways. Useful for the ACP. * @return string HTML */ - public function get_custom_html($row, $ignore_config = false); + public function get_custom_html($row, $ignore_config = false, $alt = ''); /** * @TODO -- cgit v1.2.1 From 60b4c907b292a46b40cad1c0330e76b897a2309b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 14 Nov 2012 23:14:41 +0100 Subject: [feature/avatars] Add service containers for avatars PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 16fef58e7a..f066470174 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -21,6 +21,13 @@ if (!defined('IN_PHPBB')) */ interface phpbb_avatar_driver_interface { + /** + * Returns the name of the driver. + * + * @return string Name of wrapped driver. + */ + public function get_name(); + /** * Get the avatar url and dimensions * -- cgit v1.2.1 From 8d0c667dcec08fb506dcf19203ded3c699339d6e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 19 Nov 2012 00:30:18 +0100 Subject: [feature/avatars] Fix the docs and small naming fixes PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index f066470174..11dbffa65d 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -51,27 +51,51 @@ interface phpbb_avatar_driver_interface public function get_custom_html($row, $ignore_config = false, $alt = ''); /** - * @TODO + * Prepare form for changing the settings of this avatar + * + * @param object $template The template object + * @param array $row The user data or group data that has been cleaned with + * phpbb_avatar_manager::clean_row + * @param array &$error The reference to an error array + * + * @return bool Returns true if form has been successfully prepared **/ public function prepare_form($template, $row, &$error); /** - * @TODO + * Process form data + * + * @param object $template The template object + * @param array $row The user data or group data that has been cleaned with + * phpbb_avatar_manager::clean_row + * @param array &$error The reference to an error array + * + * @return array An array containing the avatar data as follows: + * ['avatar'], ['avatar_width'], ['avatar_height'] **/ public function process_form($template, $row, &$error); /** - * @TODO + * Delete avatar + * + * @param array $row The user data or group data that has been cleaned with + * phpbb_avatar_manager::clean_row + * + * @return bool True if avatar has been deleted or there is no need to delete **/ public function delete($row); /** - * @TODO + * Check if avatar is enabled + * + * @return bool True if avatar is enabled, false if it's disabled **/ public function is_enabled(); /** - * @TODO + * Get the avatars template name + * + * @return string The avatars template name **/ public function get_template_name(); } -- cgit v1.2.1 From 726d1a16d704630a9a028010c7420bea837738d4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 21 Nov 2012 17:15:35 +0100 Subject: [feature/avatars] Move avatar specific settings to drivers PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 11dbffa65d..28220d79f2 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -62,6 +62,13 @@ interface phpbb_avatar_driver_interface **/ public function prepare_form($template, $row, &$error); + /** + * Prepare form for changing the acp settings of this avatar + * + * @return array Return the array containing the acp settings + **/ + public function prepare_form_acp(); + /** * Process form data * -- cgit v1.2.1 From f851d763f9997b896219d1068dd23f6de7dbfc36 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 25 Nov 2012 21:14:05 +0100 Subject: [feature/avatars] Even more fixes to docblocks PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 28220d79f2..cc6b7edd17 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -24,7 +24,7 @@ interface phpbb_avatar_driver_interface /** * Returns the name of the driver. * - * @return string Name of wrapped driver. + * @return string Name of wrapped driver. */ public function get_name(); @@ -43,7 +43,7 @@ interface phpbb_avatar_driver_interface * Returns custom html for displaying this avatar. * Only called if $custom_html is true. * - * @param $ignore_config Whether this function should respect the users prefs + * @param bool $ignore_config Whether this function should respect the users prefs * and board configuration configuration option, or should just render * the avatar anyways. Useful for the ACP. * @return string HTML @@ -53,56 +53,56 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the settings of this avatar * - * @param object $template The template object - * @param array $row The user data or group data that has been cleaned with + * @param object $template Template object + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row - * @param array &$error The reference to an error array + * @param array &$error Reference to an error array * - * @return bool Returns true if form has been successfully prepared - **/ + * @return bool True if form has been successfully prepared + */ public function prepare_form($template, $row, &$error); /** * Prepare form for changing the acp settings of this avatar * - * @return array Return the array containing the acp settings - **/ + * @return array Array containing the acp settings + */ public function prepare_form_acp(); /** * Process form data * - * @param object $template The template object - * @param array $row The user data or group data that has been cleaned with + * @param object $template Template object + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row - * @param array &$error The reference to an error array + * @param array &$error Reference to an error array * - * @return array An array containing the avatar data as follows: + * @return array Array containing the avatar data as follows: * ['avatar'], ['avatar_width'], ['avatar_height'] - **/ + */ public function process_form($template, $row, &$error); /** * Delete avatar * - * @param array $row The user data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * * @return bool True if avatar has been deleted or there is no need to delete - **/ + */ public function delete($row); /** * Check if avatar is enabled * * @return bool True if avatar is enabled, false if it's disabled - **/ + */ public function is_enabled(); /** * Get the avatars template name * - * @return string The avatars template name - **/ + * @return string Avatar's template name + */ public function get_template_name(); } -- cgit v1.2.1 From 81a1a21185abfc230097a355216d6c6b99511b20 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 29 Nov 2012 23:08:29 +0100 Subject: [feature/avatars] Properly implement custom HTML in the interface Previously the driver class added a variable that defined wether an avatar driver would return custom HTML. The existence of this variable was implied in the interface. It's also not needed which is why it has been removed. PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index cc6b7edd17..d2f25a989f 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -40,8 +40,7 @@ interface phpbb_avatar_driver_interface public function get_data($row, $ignore_config = false); /** - * Returns custom html for displaying this avatar. - * Only called if $custom_html is true. + * Returns custom html if it is needed for displaying this avatar * * @param bool $ignore_config Whether this function should respect the users prefs * and board configuration configuration option, or should just render -- cgit v1.2.1 From f4ad60e2cf18771200d99bc953449d6229a74818 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 29 Nov 2012 23:50:17 +0100 Subject: [feature/avatars] Get list of enabled drivers from avatar manager This shouldn't be done in the avatar drivers. We need to force the display all avatar drivers in the ACP or it won't be possible to enable avatars after they have been disabled. PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index d2f25a989f..7a58a40b0c 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -91,13 +91,6 @@ interface phpbb_avatar_driver_interface */ public function delete($row); - /** - * Check if avatar is enabled - * - * @return bool True if avatar is enabled, false if it's disabled - */ - public function is_enabled(); - /** * Get the avatars template name * -- cgit v1.2.1 From d5cbedaaa28312c107ec562c78ffaa034595f336 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 30 Nov 2012 15:12:34 +0100 Subject: [feature/avatars] Let avatar manager handle $ignore_config The avatar manager already handles if avatars are enabled. It should also handle ignoring the config settings. PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 7a58a40b0c..bba4bd102e 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -31,23 +31,21 @@ interface phpbb_avatar_driver_interface /** * Get the avatar url and dimensions * - * @param $ignore_config Whether this function should respect the users prefs - * and board configuration configuration option, or should just render - * the avatar anyways. Useful for the ACP. + * @param array $row User data or group data that has been cleaned with + * phpbb_avatar_manager::clean_row * @return array Avatar data, must have keys src, width and height, e.g. - * ['src' => '', 'width' => 0, 'height' => 0] + * ['src' => '', 'width' => 0, 'height' => 0] */ - public function get_data($row, $ignore_config = false); + public function get_data($row); /** * Returns custom html if it is needed for displaying this avatar * - * @param bool $ignore_config Whether this function should respect the users prefs - * and board configuration configuration option, or should just render - * the avatar anyways. Useful for the ACP. + * @param string $alt Alternate text for avatar image + * * @return string HTML */ - public function get_custom_html($row, $ignore_config = false, $alt = ''); + public function get_custom_html($row, $alt = ''); /** * Prepare form for changing the settings of this avatar -- cgit v1.2.1 From d439f477105903ceb29652f23bcb7812d0f34d4d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 1 Dec 2012 00:27:52 +0100 Subject: [feature/avatars] Fix docblocks and minor cosmetic issues PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index bba4bd102e..e8f529f3c4 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -24,7 +24,7 @@ interface phpbb_avatar_driver_interface /** * Returns the name of the driver. * - * @return string Name of wrapped driver. + * @return string Name of driver. */ public function get_name(); @@ -50,10 +50,13 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the settings of this avatar * - * @param object $template Template object + * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row - * @param array &$error Reference to an error array + * @param array &$error Reference to an error array that is filled by this + * function. Key values can either be a string with a language key or + * an array that will be passed to vsprintf() with the language key in + * the first array key. * * @return bool True if form has been successfully prepared */ @@ -62,17 +65,22 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the acp settings of this avatar * - * @return array Array containing the acp settings + * @return array Array of configuration options as consumed by acp_board. + * The setting for enabling/disabling the avatar will be handled by + * the avatar manager. */ public function prepare_form_acp(); /** * Process form data * - * @param object $template Template object + * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row - * @param array &$error Reference to an error array + * @param array &$error Reference to an error array that is filled by this + * function. Key values can either be a string with a language key or + * an array that will be passed to vsprintf() with the language key in + * the first array key. * * @return array Array containing the avatar data as follows: * ['avatar'], ['avatar_width'], ['avatar_height'] @@ -85,14 +93,15 @@ interface phpbb_avatar_driver_interface * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * - * @return bool True if avatar has been deleted or there is no need to delete + * @return bool True if avatar has been deleted or there is no need to delete, + * i.e. when the avatar is not hosted locally. */ public function delete($row); /** - * Get the avatars template name + * Get the avatar driver's template name * - * @return string Avatar's template name + * @return string Avatar driver's template name */ public function get_template_name(); } -- cgit v1.2.1 From 023d7a972dd5c279e0b0b24801f9e53e7865d39a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 7 Jan 2013 22:49:48 +0100 Subject: [feature/avatars] Remove $request property and pass as argument if needed Remove the $request property from the phpbb_avatar_driver class and rather pass it as function argument if it's needed in a function. Currently this is only the case for the class methods prepare_form() and process_form(). PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index e8f529f3c4..3c1db019f0 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -50,6 +50,7 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the settings of this avatar * + * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row @@ -60,7 +61,7 @@ interface phpbb_avatar_driver_interface * * @return bool True if form has been successfully prepared */ - public function prepare_form($template, $row, &$error); + public function prepare_form($request, $template, $row, &$error); /** * Prepare form for changing the acp settings of this avatar @@ -74,6 +75,7 @@ interface phpbb_avatar_driver_interface /** * Process form data * + * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row @@ -85,7 +87,7 @@ interface phpbb_avatar_driver_interface * @return array Array containing the avatar data as follows: * ['avatar'], ['avatar_width'], ['avatar_height'] */ - public function process_form($template, $row, &$error); + public function process_form($request, $template, $row, &$error); /** * Delete avatar -- cgit v1.2.1 From 8778c9c945e388c2b727f1b7cd057dd67a091441 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 8 Jan 2013 15:34:20 +0100 Subject: [feature/avatars] Pass phpbb_user object to get_custom_html() Pass the phpbb_user object to function get_custom_html(). This object is used in that method. Also fixed incorrect arguments to get_custom_html() in phpbb_get_avatar(). PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 3c1db019f0..836c45b49f 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -41,11 +41,14 @@ interface phpbb_avatar_driver_interface /** * Returns custom html if it is needed for displaying this avatar * + * @param phpbb_user $user phpBB user object + * @param array $row User data or group data that has been cleaned with + * phpbb_avatar_manager::clean_row * @param string $alt Alternate text for avatar image * * @return string HTML */ - public function get_custom_html($row, $alt = ''); + public function get_custom_html($user, $row, $alt = ''); /** * Prepare form for changing the settings of this avatar -- cgit v1.2.1 From 9e001153d6a64a90353207c4da8b01329f8e39e5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 8 Jan 2013 15:42:30 +0100 Subject: [feature/avatars] Pass phpbb_user object to prepare_form_acp() The phpbb_user object might be used for language variables. Pass it as a function argument to prepare_form_acp() instead of using globals. PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 836c45b49f..5d6d6b10ac 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -69,11 +69,13 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the acp settings of this avatar * + * @param phpbb_user $user phpBB user object + * * @return array Array of configuration options as consumed by acp_board. * The setting for enabling/disabling the avatar will be handled by * the avatar manager. */ - public function prepare_form_acp(); + public function prepare_form_acp($user); /** * Process form data -- cgit v1.2.1 From f322f4eac923a960e6b6ff44c27783000affb3ee Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 3 Feb 2013 23:02:35 +0100 Subject: [feature/avatars] Correct license, copyright and package info PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 5d6d6b10ac..9364699b5f 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -1,9 +1,9 @@ Date: Tue, 19 Feb 2013 12:24:21 +0100 Subject: [feature/avatars] Pass phpbb_user to prepare and process form functions The phpbb_user object might be used for language variables and other things. PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 9364699b5f..6ceb48ad10 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -55,6 +55,7 @@ interface phpbb_avatar_driver_interface * * @param phpbb_request $request Request object * @param phpbb_template $template Template object + * @param phpbb_user $user User object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @param array &$error Reference to an error array that is filled by this @@ -64,7 +65,7 @@ interface phpbb_avatar_driver_interface * * @return bool True if form has been successfully prepared */ - public function prepare_form($request, $template, $row, &$error); + public function prepare_form($request, $template, $user, $row, &$error); /** * Prepare form for changing the acp settings of this avatar @@ -82,6 +83,7 @@ interface phpbb_avatar_driver_interface * * @param phpbb_request $request Request object * @param phpbb_template $template Template object + * @param phpbb_user $user User object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @param array &$error Reference to an error array that is filled by this @@ -92,7 +94,7 @@ interface phpbb_avatar_driver_interface * @return array Array containing the avatar data as follows: * ['avatar'], ['avatar_width'], ['avatar_height'] */ - public function process_form($request, $template, $row, &$error); + public function process_form($request, $template, $user, $row, &$error); /** * Delete avatar -- cgit v1.2.1 From a9e0aea4b1587ac5ff6c94d2dc7e4d05c304423d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 19 Feb 2013 12:30:14 +0100 Subject: [feature/avatars] Remove trailing whitespace from avatar code PHPBB3-10018 --- phpBB/includes/avatar/driver/interface.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/avatar/driver/interface.php') diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index 6ceb48ad10..3d62969aef 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -31,7 +31,7 @@ interface phpbb_avatar_driver_interface /** * Get the avatar url and dimensions * - * @param array $row User data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @return array Avatar data, must have keys src, width and height, e.g. * ['src' => '', 'width' => 0, 'height' => 0] @@ -42,7 +42,7 @@ interface phpbb_avatar_driver_interface * Returns custom html if it is needed for displaying this avatar * * @param phpbb_user $user phpBB user object - * @param array $row User data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @param string $alt Alternate text for avatar image * @@ -56,7 +56,7 @@ interface phpbb_avatar_driver_interface * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param phpbb_user $user User object - * @param array $row User data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @param array &$error Reference to an error array that is filled by this * function. Key values can either be a string with a language key or @@ -84,7 +84,7 @@ interface phpbb_avatar_driver_interface * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param phpbb_user $user User object - * @param array $row User data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * @param array &$error Reference to an error array that is filled by this * function. Key values can either be a string with a language key or @@ -99,7 +99,7 @@ interface phpbb_avatar_driver_interface /** * Delete avatar * - * @param array $row User data or group data that has been cleaned with + * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row * * @return bool True if avatar has been deleted or there is no need to delete, -- cgit v1.2.1