aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorPayBas <contact@paybas.com>2014-05-28 21:33:17 +0200
committerPayBas <contact@paybas.com>2014-06-15 10:02:08 +0200
commitd5f4d288e92499b64e96aeafe673ed05708cc8da (patch)
treedbffc7117e7d3412fa2a4c01a0e00247d653b5f9 /phpBB/phpbb
parent3a96c5b753cbbde459f9835e952b2cb75008a9fc (diff)
downloadforums-d5f4d288e92499b64e96aeafe673ed05708cc8da.tar
forums-d5f4d288e92499b64e96aeafe673ed05708cc8da.tar.gz
forums-d5f4d288e92499b64e96aeafe673ed05708cc8da.tar.bz2
forums-d5f4d288e92499b64e96aeafe673ed05708cc8da.tar.xz
forums-d5f4d288e92499b64e96aeafe673ed05708cc8da.zip
[ticket/12608] Improve notifications drop-down menu styling in header
PHPBB3-12608
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/notification/type/base.php36
-rw-r--r--phpBB/phpbb/notification/type/disapprove_post.php26
-rw-r--r--phpBB/phpbb/notification/type/disapprove_topic.php26
-rw-r--r--phpBB/phpbb/notification/type/pm.php15
-rw-r--r--phpBB/phpbb/notification/type/post.php14
-rw-r--r--phpBB/phpbb/notification/type/report_pm.php38
-rw-r--r--phpBB/phpbb/notification/type/report_pm_closed.php14
-rw-r--r--phpBB/phpbb/notification/type/report_post.php38
-rw-r--r--phpBB/phpbb/notification/type/report_post_closed.php14
-rw-r--r--phpBB/phpbb/notification/type/topic.php28
-rw-r--r--phpBB/phpbb/notification/type/type_interface.php14
11 files changed, 235 insertions, 28 deletions
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index c1d4d0e257..7e881d0c55 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -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),
@@ -347,6 +353,36 @@ abstract class base implements \phpbb\notification\type\type_interface
}
/**
+ * 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)
*
* @return array
diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php
index b5f94f404f..c3dbe4e91d 100644
--- a/phpBB/phpbb/notification/type/disapprove_post.php
+++ b/phpBB/phpbb/notification/type/disapprove_post.php
@@ -63,9 +63,31 @@ class disapprove_post extends \phpbb\notification\type\approve_post
*/
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(
+ '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(
- $this->language_key,
- censor_text($this->get_data('topic_title')),
+ '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..2f29bb271e 100644
--- a/phpBB/phpbb/notification/type/disapprove_topic.php
+++ b/phpBB/phpbb/notification/type/disapprove_topic.php
@@ -63,9 +63,31 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
*/
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(
+ '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(
- $this->language_key,
- censor_text($this->get_data('topic_title')),
+ '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,12 +225,24 @@ 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
*
* @return string|bool
diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php
index 03e89dd28e..2bf13d4aa6 100644
--- a/phpBB/phpbb/notification/type/report_pm.php
+++ b/phpBB/phpbb/notification/type/report_pm.php
@@ -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')
);
}
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..1a4682eb62 100644
--- a/phpBB/phpbb/notification/type/report_post.php
+++ b/phpBB/phpbb/notification/type/report_post.php
@@ -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')
);
}
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..5e139b797e 100644
--- a/phpBB/phpbb/notification/type/type_interface.php
+++ b/phpBB/phpbb/notification/type/type_interface.php
@@ -95,6 +95,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
*
* @return string URL