aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/avatar/driver/interface.php
blob: d2f25a989f1c95d4e6e148ec321561c98b629858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/**
*
* @package avatar
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Interface for avatar drivers
* @package avatars
*/
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
	*
	* @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 array Avatar data, must have keys src, width and height, e.g.
	*         ['src' => '', 'width' => 0, 'height' => 0]
	*/
	public function get_data($row, $ignore_config = false);

	/**
	* 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.
	* @return string HTML
	*/
	public function get_custom_html($row, $ignore_config = false, $alt = '');

	/**
	* Prepare form for changing the settings of this avatar
	*
	* @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 Reference to an error array
	*
	* @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 Array containing the acp settings
	*/
	public function prepare_form_acp();

	/**
	* Process form data
	*
	* @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 Reference to an error array
	*
	* @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 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 Avatar's template name
	*/
	public function get_template_name();
}