diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2014-10-22 17:39:13 -0500 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2014-10-22 17:39:13 -0500 |
| commit | 6a0727acdcf8c30b9fdf5df838ab3decc0b1a228 (patch) | |
| tree | e6f9eaf80ee020dd73ff4cbe17f2cf4ef30144fe /phpBB/includes/ucp | |
| parent | d7553893c4c211edb1a42f91276edbcc27bfd330 (diff) | |
| parent | df72846b8945224a431558cfc3cc7e12a463444a (diff) | |
| download | forums-6a0727acdcf8c30b9fdf5df838ab3decc0b1a228.tar forums-6a0727acdcf8c30b9fdf5df838ab3decc0b1a228.tar.gz forums-6a0727acdcf8c30b9fdf5df838ab3decc0b1a228.tar.bz2 forums-6a0727acdcf8c30b9fdf5df838ab3decc0b1a228.tar.xz forums-6a0727acdcf8c30b9fdf5df838ab3decc0b1a228.zip | |
Merge pull request #3058 from naderman/ticket/13205
[ticket/13205] Add a mark all messages read link to PM folders
Diffstat (limited to 'phpBB/includes/ucp')
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 7a8c694870..425a56cf6c 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -45,7 +45,7 @@ class ucp_pm function main($id, $mode) { - global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config; + global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request; if (!$user->data['is_registered']) { @@ -246,6 +246,27 @@ class ucp_pm $folder_id = (int) $row['folder_id']; } + if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read')) + { + mark_folder_read($user->data['user_id'], $folder_id); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PM_MARK_ALL_READ_SUCCESS']; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'success' => true, + )); + } + $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>'); + + trigger_error($message); + } + $message_row = array(); if ($action == 'view_message' && $msg_id) { @@ -332,6 +353,7 @@ class ucp_pm 'U_SENTBOX' => $this->u_action . '&folder=sentbox', 'U_CREATE_FOLDER' => $this->u_action . '&mode=options', 'U_CURRENT_FOLDER' => $this->u_action . '&folder=' . $folder_id, + 'U_MARK_ALL' => $this->u_action . '&folder=' . $folder_id . '&mark=all&token=' . generate_link_hash('mark_all_pms_read'), 'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false, 'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false, |
