mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/12608] Add styling (CSS class) options to notifications
This will allow different notifications to have different styles PHPBB3-12608
This commit is contained in:
@@ -309,6 +309,8 @@ abstract class base implements \phpbb\notification\type\type_interface
|
||||
return array(
|
||||
'NOTIFICATION_ID' => $this->notification_id,
|
||||
|
||||
'STYLING' => $this->get_styling(),
|
||||
|
||||
'AVATAR' => $this->get_avatar(),
|
||||
|
||||
'FORMATTED_TITLE' => $this->get_title(),
|
||||
@@ -342,6 +344,16 @@ abstract class base implements \phpbb\notification\type\type_interface
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the styling of the notification (fall back)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_styling()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user's avatar (fall back)
|
||||
*
|
||||
|
@@ -30,6 +30,16 @@ class report_pm extends \phpbb\notification\type\pm
|
||||
return 'report_pm';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the styling of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_styling()
|
||||
{
|
||||
return 'reported';
|
||||
}
|
||||
|
||||
/**
|
||||
* Language key used to output the text
|
||||
*
|
||||
|
@@ -29,6 +29,16 @@ class report_post extends \phpbb\notification\type\post_in_queue
|
||||
return 'report_post';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the styling of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_styling()
|
||||
{
|
||||
return 'reported';
|
||||
}
|
||||
|
||||
/**
|
||||
* Language key used to output the text
|
||||
*
|
||||
|
@@ -87,6 +87,13 @@ interface type_interface
|
||||
*/
|
||||
public function load_special($data, $notifications);
|
||||
|
||||
/**
|
||||
* Get the styling of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_styling();
|
||||
|
||||
/**
|
||||
* Get the HTML formatted title of this notification
|
||||
*
|
||||
|
Reference in New Issue
Block a user