diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 16:40:19 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 16:40:19 +0200 |
commit | 81fb4268cd141259fe5b3bc9ad51adf2e29e0772 (patch) | |
tree | b7853d742aeb04980f6de619560db3e9667245e8 /phpBB/includes/avatar/driver/interface.php | |
parent | eea2ec50521e274b928d23f710108f37797cb22c (diff) | |
download | forums-81fb4268cd141259fe5b3bc9ad51adf2e29e0772.tar forums-81fb4268cd141259fe5b3bc9ad51adf2e29e0772.tar.gz forums-81fb4268cd141259fe5b3bc9ad51adf2e29e0772.tar.bz2 forums-81fb4268cd141259fe5b3bc9ad51adf2e29e0772.tar.xz forums-81fb4268cd141259fe5b3bc9ad51adf2e29e0772.zip |
[feature/avatars] Introduce an avatar driver interface
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/avatar/driver/interface.php')
-rw-r--r-- | phpBB/includes/avatar/driver/interface.php | 71 |
1 files changed, 71 insertions, 0 deletions
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 @@ +<?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); +} |