From b81613e5e57fd208e832637b6886abf9ec806c4b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 14 Jul 2013 12:25:28 -0400 Subject: [ticket/11700] With namespaces interface will no longer be a valid classname PHPBB3-11700 --- phpBB/phpbb/avatar/driver/driver_interface.php | 116 +++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 phpBB/phpbb/avatar/driver/driver_interface.php (limited to 'phpBB/phpbb/avatar/driver/driver_interface.php') diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php new file mode 100644 index 0000000000..0a44a7a1fe --- /dev/null +++ b/phpBB/phpbb/avatar/driver/driver_interface.php @@ -0,0 +1,116 @@ + '', 'width' => 0, 'height' => 0] + */ + public function get_data($row); + + /** + * 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($user, $row, $alt = ''); + + /** + * Prepare form for changing the settings of this avatar + * + * @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 + * 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 + */ + public function prepare_form($request, $template, $user, $row, &$error); + + /** + * 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($user); + + /** + * Process form data + * + * @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 + * 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'] + */ + public function process_form($request, $template, $user, $row, &$error); + + /** + * Delete avatar + * + * @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, + * i.e. when the avatar is not hosted locally. + */ + public function delete($row); + + /** + * Get the avatar driver's template name + * + * @return string Avatar driver's template name + */ + public function get_template_name(); +} -- cgit v1.2.1 From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- phpBB/phpbb/avatar/driver/driver_interface.php | 30 ++++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'phpBB/phpbb/avatar/driver/driver_interface.php') diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php index 0a44a7a1fe..d9540c19db 100644 --- a/phpBB/phpbb/avatar/driver/driver_interface.php +++ b/phpBB/phpbb/avatar/driver/driver_interface.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\avatar\driver; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Interface for avatar drivers * @package phpBB3 */ -interface phpbb_avatar_driver_driver_interface +interface driver_interface { /** * Returns the name of the driver. @@ -32,7 +34,7 @@ interface phpbb_avatar_driver_driver_interface * Get the avatar url and dimensions * * @param array $row User data or group data that has been cleaned with - * phpbb_avatar_manager::clean_row + * \phpbb\avatar\manager::clean_row * @return array Avatar data, must have keys src, width and height, e.g. * ['src' => '', 'width' => 0, 'height' => 0] */ @@ -41,9 +43,9 @@ interface phpbb_avatar_driver_driver_interface /** * Returns custom html if it is needed for displaying this avatar * - * @param phpbb_user $user phpBB user object + * @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 + * \phpbb\avatar\manager::clean_row * @param string $alt Alternate text for avatar image * * @return string HTML @@ -53,11 +55,11 @@ interface phpbb_avatar_driver_driver_interface /** * Prepare form for changing the settings of this avatar * - * @param phpbb_request $request Request object - * @param phpbb_template $template Template object - * @param phpbb_user $user User object + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\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 + * \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 * an array that will be passed to vsprintf() with the language key in @@ -70,7 +72,7 @@ interface phpbb_avatar_driver_driver_interface /** * Prepare form for changing the acp settings of this avatar * - * @param phpbb_user $user phpBB user object + * @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 @@ -81,11 +83,11 @@ interface phpbb_avatar_driver_driver_interface /** * Process form data * - * @param phpbb_request $request Request object - * @param phpbb_template $template Template object - * @param phpbb_user $user User object + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\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 + * \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 * an array that will be passed to vsprintf() with the language key in @@ -100,7 +102,7 @@ interface phpbb_avatar_driver_driver_interface * Delete avatar * * @param array $row User data or group data that has been cleaned with - * phpbb_avatar_manager::clean_row + * \phpbb\avatar\manager::clean_row * * @return bool True if avatar has been deleted or there is no need to delete, * i.e. when the avatar is not hosted locally. -- cgit v1.2.1