aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-01-08 15:34:20 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-01-08 15:34:20 +0100
commit8778c9c945e388c2b727f1b7cd057dd67a091441 (patch)
treeb92c7f4615a249ed24137246de747eb3290a62bb
parent023d7a972dd5c279e0b0b24801f9e53e7865d39a (diff)
downloadforums-8778c9c945e388c2b727f1b7cd057dd67a091441.tar
forums-8778c9c945e388c2b727f1b7cd057dd67a091441.tar.gz
forums-8778c9c945e388c2b727f1b7cd057dd67a091441.tar.bz2
forums-8778c9c945e388c2b727f1b7cd057dd67a091441.tar.xz
forums-8778c9c945e388c2b727f1b7cd057dd67a091441.zip
[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
-rw-r--r--phpBB/includes/avatar/driver/driver.php2
-rw-r--r--phpBB/includes/avatar/driver/gravatar.php2
-rw-r--r--phpBB/includes/avatar/driver/interface.php5
-rw-r--r--phpBB/includes/functions_display.php2
4 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/includes/avatar/driver/driver.php b/phpBB/includes/avatar/driver/driver.php
index d4f9139c18..cb6dbd7d68 100644
--- a/phpBB/includes/avatar/driver/driver.php
+++ b/phpBB/includes/avatar/driver/driver.php
@@ -71,7 +71,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/**
* @inheritdoc
*/
- public function get_custom_html($row, $alt = '')
+ public function get_custom_html($user, $row, $alt = '')
{
return '';
}
diff --git a/phpBB/includes/avatar/driver/gravatar.php b/phpBB/includes/avatar/driver/gravatar.php
index c574e23836..79cac75e28 100644
--- a/phpBB/includes/avatar/driver/gravatar.php
+++ b/phpBB/includes/avatar/driver/gravatar.php
@@ -41,7 +41,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
/**
* @inheritdoc
*/
- public function get_custom_html($row, $alt = '')
+ public function get_custom_html($user, $row, $alt = '')
{
return '<img src="' . $this->get_gravatar_url($row) . '" ' .
($row['avatar_width'] ? ('width="' . $row['avatar_width'] . '" ') : '') .
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
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 0a288127a4..9854cd6d70 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1400,7 +1400,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false)
if ($driver)
{
- $html = $driver->get_custom_html($row, $ignore_config, $alt);
+ $html = $driver->get_custom_html($user, $row, $alt);
if (!empty($html))
{
return $html;