aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/avatar/driver/interface.php
blob: dcec5811bb920fa4f77aa206349691afe2f7fd4b (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
<?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
{
	/**
	* @TODO
	*/
	const FROM_USER = 0;
	const FROM_GROUP = 1;

	/**
	* 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 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);
}