diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2012-10-16 10:51:07 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2012-10-16 10:51:07 -0500 |
commit | c8b66a26ef4f6ac2a71980c75a13356dcda72dd6 (patch) | |
tree | 2139ad7b5a0af15e712029c7df1d3466c9344dfd /phpBB/includes | |
parent | a2d6e40f1b7e359b0be87452a01eb3e46b4694e8 (diff) | |
download | forums-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/includes')
-rw-r--r-- | phpBB/includes/notification/type/base.php | 13 |
1 files changed, 12 insertions, 1 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 . '&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 : '', ); } |