mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[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
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
|
@@ -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'] . '" ') : '') .
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user