diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 757b9d7251..68b8b594c4 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -442,29 +442,32 @@ $lang = array_merge($lang, array( // A, B, C and 2 others replied... // A, B, C and others replied... 'NOTIFICATION_BOOKMARK' => array( - 1 => '%1$s replied to the topic “%2$s” you have bookmarked.', + 1 => 'Reply from %1$s in bookmarked topic:', ), - 'NOTIFICATION_GROUP_REQUEST' => '%1$s is requesting to join the group %2$s.', - 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Your request to join the group %1$s has been approved.', - 'NOTIFICATION_PM' => '%1$s sent you a Private Message "%2$s".', + 'NOTIFICATION_FORUM' => 'Forum: %1$s', + 'NOTIFICATION_GROUP_REQUEST' => 'Group request from %1$s to join the group %2$s.', + 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Group request approved to join the group %1$s.', + 'NOTIFICATION_PM' => 'Private Message from %1$s:', 'NOTIFICATION_POST' => array( - 1 => '%1$s replied to the topic “%2$s”.', + 1 => 'Reply from %1$s in topic:', ), - 'NOTIFICATION_POST_APPROVED' => 'Your post was approved "%2$s".', - 'NOTIFICATION_POST_DISAPPROVED' => 'Your post "%1$s" was disapproved for reason: "%2$s".', - 'NOTIFICATION_POST_IN_QUEUE' => 'A new post titled "%2$s" was posted by %1$s and needs approval.', + 'NOTIFICATION_POST_APPROVED' => 'Post approved:', + 'NOTIFICATION_POST_DISAPPROVED' => 'Post disapproved:', + 'NOTIFICATION_POST_IN_QUEUE' => 'Post approval request by %1$s:', 'NOTIFICATION_QUOTE' => array( - 1 => '%1$s quoted you in the post “%2$s”.', + 1 => 'Quoted by %1$s in:', ), - 'NOTIFICATION_REPORT_PM' => '%1$s reported a Private Message "%2$s" for reason: "%3$s".', - 'NOTIFICATION_REPORT_POST' => '%1$s reported a post "%2$s" for reason: "%3$s".', - 'NOTIFICATION_REPORT_CLOSED' => '%1$s closed the report you made for "%2$s".', - 'NOTIFICATION_TOPIC' => '%1$s posted a new topic "%2$s" in the forum "%3$s".', - 'NOTIFICATION_TOPIC_APPROVED' => 'Your topic "%2$s" in the forum "%3$s" was approved.', - 'NOTIFICATION_TOPIC_DISAPPROVED' => 'Your topic "%1$s" was disapproved for reason: "%2$s".', - 'NOTIFICATION_TOPIC_IN_QUEUE' => 'A new topic titled "%2$s" was posted by %1$s and needs approval.', + 'NOTIFICATION_REFERENCE' => '"%1$s"', + 'NOTIFICATION_REASON' => 'Reason: %1$s.', + 'NOTIFICATION_REPORT_PM' => 'Private Message reported by %1$s:', + 'NOTIFICATION_REPORT_POST' => 'Post reported by %1$s:', + 'NOTIFICATION_REPORT_CLOSED' => 'Report closed by %1$s for:', + 'NOTIFICATION_TOPIC' => 'New topic by %1$s:', + 'NOTIFICATION_TOPIC_APPROVED' => 'Topic approved:', + 'NOTIFICATION_TOPIC_DISAPPROVED' => 'Topic disapproved:', + 'NOTIFICATION_TOPIC_IN_QUEUE' => 'Topic approval request by %1$s:', 'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.', - 'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'The user “%1$s” is newly registered and requires activation.', + 'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'Activation required for newly registered user: “%1$s”', // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST. 'NOTIFICATION_MANY_OTHERS' => 'others', 'NOTIFICATION_X_OTHERS' => array( diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index c1d4d0e257..910f51b3a6 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -308,16 +308,15 @@ abstract class base implements \phpbb\notification\type\type_interface return array( '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(), + 'REASON' => $this->get_reason(), 'URL' => $this->get_url(), 'TIME' => $this->user->format_date($this->notification_time), - 'UNREAD' => !$this->notification_read, - 'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '', ); } @@ -336,6 +335,16 @@ abstract class base implements \phpbb\notification\type\type_interface return false; } + /** + * Get the CSS style class of the notification (fall back) + * + * @return string + */ + public function get_style_class() + { + return ''; + } + /** * Get the user's avatar (fall back) * @@ -346,6 +355,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) * diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index b5f94f404f..7b18ed70ea 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -30,6 +30,16 @@ class disapprove_post extends \phpbb\notification\type\approve_post return 'disapprove_post'; } + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-disapproved'; + } + /** * Language key used to output the text * @@ -62,10 +72,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') ); } diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index 8883c53294..3f87741807 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -30,6 +30,16 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic return 'disapprove_topic'; } + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-disapproved'; + } + /** * Language key used to output the text * @@ -62,10 +72,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') ); } diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index 955d121cc6..4f54e93e06 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -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') + ); } /** diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index c8760f904e..ee3a253e0f 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -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 * diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 03e89dd28e..2eb802eb4b 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -30,6 +30,16 @@ class report_pm extends \phpbb\notification\type\pm return 'report_pm'; } + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-reported'; + } + /** * Language key used to output the text * @@ -159,12 +169,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 +206,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') ); } diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php index a646996f75..ed40df67f3 100644 --- a/phpBB/phpbb/notification/type/report_pm_closed.php +++ b/phpBB/phpbb/notification/type/report_pm_closed.php @@ -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')) ); } diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index d5589a6756..024c8d9d42 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -29,6 +29,16 @@ class report_post extends \phpbb\notification\type\post_in_queue return 'report_post'; } + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-reported'; + } + /** * Language key used to output the text * @@ -132,12 +142,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 +179,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') ); } diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php index e76fa57036..a979af1fb0 100644 --- a/phpBB/phpbb/notification/type/report_post_closed.php +++ b/phpBB/phpbb/notification/type/report_post_closed.php @@ -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')) ); } diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 144c4e58a0..a512a12f20 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -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') ); } diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index c91c7078ad..5c5a110836 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -87,6 +87,13 @@ interface type_interface */ public function load_special($data, $notifications); + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class(); + /** * Get the HTML formatted title of this notification * @@ -94,6 +101,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 * diff --git a/phpBB/styles/prosilver/template/notification_dropdown.html b/phpBB/styles/prosilver/template/notification_dropdown.html index db4d5bade7..13d90a9d38 100644 --- a/phpBB/styles/prosilver/template/notification_dropdown.html +++ b/phpBB/styles/prosilver/template/notification_dropdown.html @@ -18,14 +18,17 @@ -
  • +
  • - + {notifications.AVATAR}
    -

    {notifications.FORMATTED_TITLE}

    -

    » {notifications.TIME}

    +

    {notifications.FORMATTED_TITLE}

    +

    {notifications.REFERENCE}

    +

    {notifications.FORUM}

    +

    {notifications.REASON}

    +

    {notifications.TIME}

    diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 8910769cce..500bae0c47 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -65,19 +65,18 @@