mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/12608] Improve notifications drop-down menu styling in header
PHPBB3-12608
This commit is contained in:
@@ -312,6 +312,12 @@ abstract class base implements \phpbb\notification\type\type_interface
|
||||
'AVATAR' => $this->get_avatar(),
|
||||
|
||||
'FORMATTED_TITLE' => $this->get_title(),
|
||||
|
||||
'REFERENCE' => $this->get_reference(),
|
||||
|
||||
'FORUM' => $this->get_forum(),
|
||||
|
||||
'REASON' => $this->get_reason(),
|
||||
|
||||
'URL' => $this->get_url(),
|
||||
'TIME' => $this->user->format_date($this->notification_time),
|
||||
@@ -346,6 +352,36 @@ abstract class base implements \phpbb\notification\type\type_interface
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reference of the notifcation (fall back)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the forum of the notification reference (fall back)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_forum()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason for the notifcation (fall back)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reason()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the special items to load (fall back)
|
||||
*
|
||||
|
@@ -62,10 +62,32 @@ class disapprove_post extends \phpbb\notification\type\approve_post
|
||||
* @return string
|
||||
*/
|
||||
public function get_title()
|
||||
{
|
||||
return $this->user->lang($this->language_key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
censor_text($this->get_data('topic_title')),
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('topic_title'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason for the disapproval notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reason()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('disapprove_reason')
|
||||
);
|
||||
}
|
||||
|
@@ -62,10 +62,32 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
|
||||
* @return string
|
||||
*/
|
||||
public function get_title()
|
||||
{
|
||||
return $this->user->lang($this->language_key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
censor_text($this->get_data('topic_title')),
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('topic_title'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason for the disapproval notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reason()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('disapprove_reason')
|
||||
);
|
||||
}
|
||||
|
@@ -111,7 +111,20 @@ class pm extends \phpbb\notification\type\base
|
||||
{
|
||||
$username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile');
|
||||
|
||||
return $this->user->lang('NOTIFICATION_PM', $username, $this->get_data('message_subject'));
|
||||
return $this->user->lang('NOTIFICATION_PM', $username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
$this->get_data('message_subject')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -225,11 +225,23 @@ class post extends \phpbb\notification\type\base
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
phpbb_generate_string_list($usernames, $this->user),
|
||||
censor_text($this->get_data('topic_title')),
|
||||
$responders_cnt
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('topic_title'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email template
|
||||
*
|
||||
|
@@ -159,12 +159,36 @@ class report_pm extends \phpbb\notification\type\pm
|
||||
|
||||
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('message_subject'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason for the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reason()
|
||||
{
|
||||
if ($this->get_data('report_text'))
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('message_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('report_text')
|
||||
);
|
||||
}
|
||||
@@ -172,17 +196,13 @@ class report_pm extends \phpbb\notification\type\pm
|
||||
if (isset($this->user->lang[$this->get_data('reason_title')]))
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('message_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->user->lang[$this->get_data('reason_title')]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('message_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('reason_description')
|
||||
);
|
||||
}
|
||||
|
@@ -107,7 +107,19 @@ class report_pm_closed extends \phpbb\notification\type\pm
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
$username
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('message_subject'))
|
||||
);
|
||||
}
|
||||
|
@@ -132,12 +132,36 @@ class report_post extends \phpbb\notification\type\post_in_queue
|
||||
|
||||
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('post_subject'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason for the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reason()
|
||||
{
|
||||
if ($this->get_data('report_text'))
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('post_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('report_text')
|
||||
);
|
||||
}
|
||||
@@ -145,17 +169,13 @@ class report_post extends \phpbb\notification\type\post_in_queue
|
||||
if (isset($this->user->lang[$this->get_data('reason_title')]))
|
||||
{
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('post_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->user->lang[$this->get_data('reason_title')]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('post_subject')),
|
||||
'NOTIFICATION_REASON',
|
||||
$this->get_data('reason_description')
|
||||
);
|
||||
}
|
||||
|
@@ -114,7 +114,19 @@ class report_post_closed extends \phpbb\notification\type\post
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
$username
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('post_subject'))
|
||||
);
|
||||
}
|
||||
|
@@ -151,8 +151,32 @@ class topic extends \phpbb\notification\type\base
|
||||
|
||||
return $this->user->lang(
|
||||
$this->language_key,
|
||||
$username,
|
||||
censor_text($this->get_data('topic_title')),
|
||||
$username
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_REFERENCE',
|
||||
censor_text($this->get_data('topic_title'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the forum of the notification reference
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_forum()
|
||||
{
|
||||
return $this->user->lang(
|
||||
'NOTIFICATION_FORUM',
|
||||
$this->get_data('forum_name')
|
||||
);
|
||||
}
|
||||
|
@@ -94,6 +94,20 @@ interface type_interface
|
||||
*/
|
||||
public function get_title();
|
||||
|
||||
/**
|
||||
* Get the HTML formatted reference of the notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_reference();
|
||||
|
||||
/**
|
||||
* Get the forum of the notification reference
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_forum();
|
||||
|
||||
/**
|
||||
* Get the url to this item
|
||||
*
|
||||
|
Reference in New Issue
Block a user