aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2012-10-16 10:51:07 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2012-10-16 10:51:07 -0500
commitc8b66a26ef4f6ac2a71980c75a13356dcda72dd6 (patch)
tree2139ad7b5a0af15e712029c7df1d3466c9344dfd /phpBB
parenta2d6e40f1b7e359b0be87452a01eb3e46b4694e8 (diff)
downloadforums-c8b66a26ef4f6ac2a71980c75a13356dcda72dd6.tar
forums-c8b66a26ef4f6ac2a71980c75a13356dcda72dd6.tar.gz
forums-c8b66a26ef4f6ac2a71980c75a13356dcda72dd6.tar.bz2
forums-c8b66a26ef4f6ac2a71980c75a13356dcda72dd6.tar.xz
forums-c8b66a26ef4f6ac2a71980c75a13356dcda72dd6.zip
[ticket/11103] Mark read link if notification has no URL to view it
Other style stuff PHPBB3-11103
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/notification/type/base.php13
-rw-r--r--phpBB/index.php5
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html7
-rw-r--r--phpBB/styles/prosilver/template/ucp_notifications.html9
-rw-r--r--phpBB/styles/prosilver/theme/common.css10
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html13
-rw-r--r--phpBB/styles/subsilver2/template/ucp_notifications.html10
7 files changed, 53 insertions, 14 deletions
diff --git a/phpBB/includes/notification/type/base.php b/phpBB/includes/notification/type/base.php
index 9ef0e71009..afd6a9fc9b 100644
--- a/phpBB/includes/notification/type/base.php
+++ b/phpBB/includes/notification/type/base.php
@@ -126,6 +126,17 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
*/
public function prepare_for_display()
{
+ if ($this->get_url())
+ {
+ $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id);
+ }
+ else
+ {
+ $redirect = (($this->user->page['page_dir']) ? $this->user->page['page_dir'] . '/' : '') . $this->user->page['page_name'] . (($this->user->page['query_string']) ? '?' . $this->user->page['query_string'] : '');
+
+ $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&amp;redirect=' . urlencode($redirect));
+ }
+
return array(
'NOTIFICATION_ID' => $this->notification_id,
@@ -138,7 +149,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
'UNREAD' => $this->unread,
- 'U_MARK_READ' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id),
+ 'U_MARK_READ' => ($this->unread) ? $u_mark_read : '',
);
}
diff --git a/phpBB/index.php b/phpBB/index.php
index 7f85879d23..3cb49f1a28 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -36,6 +36,11 @@ if (($mark_notification = request_var('mark_notification', 0)))
$notification->mark_read();
+ if (($redirect = request_var('redirect', '')))
+ {
+ redirect(append_sid($phpbb_root_path . $redirect));
+ }
+
redirect($notification->get_url());
}
}
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index f6bc57fa4b..8fcd595972 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -137,7 +137,7 @@
<ul class="topiclist forums">
<!-- BEGIN notifications -->
<li class="row<!-- IF notifications.UNREAD --> bg2<!-- ENDIF -->">
- <!-- IF notifications.URL or notifications.U_MARK_READ --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ <!-- IF notifications.URL --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
<span>
{notifications.AVATAR}
<span class="notification_title">
@@ -146,6 +146,11 @@
</span>
</span>
<!-- IF notifications.URL --></a><!-- ENDIF -->
+ <!-- IF not notifications.URL and notifications.UNREAD -->
+ <span class="mark_notification_read">
+ <a href="{notifications.U_MARK_READ}">{L_MARK_READ}</a>
+ </span>
+ <!-- ENDIF -->
</li>
<!-- END notifications -->
</ul>
diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html
index f71d8698b9..08b5396827 100644
--- a/phpBB/styles/prosilver/template/ucp_notifications.html
+++ b/phpBB/styles/prosilver/template/ucp_notifications.html
@@ -77,7 +77,7 @@
<li class="row<!-- IF notification_list.UNREAD --> bg3<!-- ELSE --><!-- IF notification_list.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- ENDIF -->">
<dl>
<dt>
- <!-- IF notification_list.URL or notification_list.U_MARK_READ --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ <!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
<span>
{notification_list.AVATAR}
<span class="notification_title">
@@ -86,9 +86,14 @@
</span>
</span>
<!-- IF notification_list.URL --></a><!-- ENDIF -->
+ <!-- IF not notifications.URL and notifications.UNREAD -->
+ <span class="mark_notification_read">
+ <a href="{notifications.U_MARK_READ}">{L_MARK_READ}</a>
+ </span>
+ <!-- ENDIF -->
</dt>
- <dd class="mark"><!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /> <dfn>{L_MARK_READ}</dfn><!-- ENDIF --></dd>
+ <dd class="mark">&nbsp;<!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /> <dfn>{L_MARK_READ}</dfn><!-- ENDIF -->&nbsp;</dd>
</dl>
</li>
<!-- END notification_list -->
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index c82fa5b7c8..6e825f82ce 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -683,6 +683,10 @@ p.rules a {
line-height: 1.5em;
}
+.notification_list ul.topiclist dt {
+ width: 70%;
+}
+
.notification_list ul li a span img {
float: left;
max-width: 50px;
@@ -706,3 +710,9 @@ p.rules a {
.notification_time {
margin-top: 0.5em;
}
+
+.mark_notification_read {
+ clear: both;
+ float: left;
+ margin-top: 0.5em;
+}
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index e41095ad38..560f6a32b3 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -154,19 +154,22 @@ function marklist(id, name, state)
<div id="notification_list" class="notification_list">
<table class="tablebg" width="310px" cellspacing="1">
<!-- BEGIN notifications -->
- <tr>
+ <tr class="row<!-- IF notifications.UNREAD -->2<!-- ELSE -->1<!-- ENDIF -->">
<!-- IF notifications.AVATAR -->
- <td class="row1" width="50px">
+ <td width="50px">
{notifications.AVATAR}
</td>
- <td class="row1" valign="top">
+ <td valign="top">
<!-- ELSE -->
- <td class="row1" colspan="2" valign="top">
+ <td colspan="2" valign="top">
<!-- ENDIF -->
- <!-- IF notifications.URL or notifications.U_MARK_READ --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ <!-- IF notifications.URL --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
{notifications.FORMATTED_TITLE}
<!-- IF notifications.URL --></a><!-- ENDIF --><br />
{notifications.TIME}
+ <!-- IF not notifications.URL and notifications.UNREAD -->
+ <br /><a href="{notifications.U_MARK_READ}">{L_MARK_READ}</a>
+ <!-- ENDIF -->
</td>
</tr>
<!-- END notifications -->
diff --git a/phpBB/styles/subsilver2/template/ucp_notifications.html b/phpBB/styles/subsilver2/template/ucp_notifications.html
index 7c3a516521..a2dc90c9f3 100644
--- a/phpBB/styles/subsilver2/template/ucp_notifications.html
+++ b/phpBB/styles/subsilver2/template/ucp_notifications.html
@@ -88,22 +88,22 @@
<th width="15%">{L_MARK_READ}</th>
</tr>
<!-- BEGIN notification_list -->
- <!-- IF notification_list.UNREAD --><tr class="row3"><!-- ELSEIF notification_list.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr class="row<!-- IF notification_list.UNREAD -->3<!-- ELSEIF notification_list.S_ROW_COUNT is even -->1<!-- ELSE -->2<!-- ENDIF -->">
<!-- IF notification_list.AVATAR -->
- <td width="50px">
+ <td width="50px">
{notification_list.AVATAR}
</td>
<td valign="top">
<!-- ELSE -->
- <td colspan="2" valign="top">
+ <td colspan="2" valign="top" height="50px">
<!-- ENDIF -->
- <!-- IF notification_list.URL or notification_list.U_MARK_READ --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ <!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
{notification_list.FORMATTED_TITLE}
<!-- IF notification_list.URL --></a><!-- ENDIF --><br />
{notification_list.TIME}
</td>
<td align="center">
- <!-- IF not notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /><!-- ENDIF -->
+ <!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /><!-- ENDIF -->
</td>
</tr>
<!-- END notification_list -->