1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

[ticket/15233] Standardize avatar output variables

PHPBB3-15233
This commit is contained in:
mrgoldy
2019-12-16 20:23:45 +01:00
committed by Marc Alexander
parent 3137070d50
commit 7e3d22063a
16 changed files with 182 additions and 50 deletions

View File

@@ -284,10 +284,11 @@ abstract class base implements \phpbb\notification\type\type_interface
$u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&hash=' . $mark_hash . '&redirect=' . urlencode($redirect));
}
return array(
$avatar = $this->get_avatar();
return [
'NOTIFICATION_ID' => $this->notification_id,
'STYLING' => $this->get_style_class(),
'AVATAR' => $this->get_avatar(),
'FORMATTED_TITLE' => $this->get_title(),
'REFERENCE' => $this->get_reference(),
'FORUM' => $this->get_forum(),
@@ -295,8 +296,17 @@ abstract class base implements \phpbb\notification\type\type_interface
'URL' => $this->get_url(),
'TIME' => $this->user->format_date($this->notification_time),
'UNREAD' => !$this->notification_read,
'AVATAR' => $avatar ? $avatar['html'] : '',
'AVATAR_LAZY' => $avatar ? $avatar['lazy'] : true,
'AVATAR_SRC' => $avatar ? $avatar['src'] : '',
'AVATAR_TITLE' => $avatar ? $avatar['title'] : '',
'AVATAR_TYPE' => $avatar ? $avatar['type'] : '',
'AVATAR_WIDTH' => $avatar ? $avatar['width'] : 0,
'AVATAR_HEIGHT' => $avatar ? $avatar['height'] : 0,
'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '',
);
];
}
/**
@@ -327,11 +337,11 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Get the user's avatar (fall back)
*
* @return string
* @return array
*/
public function get_avatar()
{
return '';
return [];
}
/**