diff options
Diffstat (limited to 'phpBB/includes/ucp/ucp_notifications.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_notifications.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 63dbe79666..c5963a1ebc 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -31,6 +31,7 @@ class ucp_notifications $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time; $phpbb_notifications = $phpbb_container->get('notification_manager'); + $pagination = $phpbb_container->get('pagination'); switch ($mode) { @@ -97,7 +98,19 @@ class ucp_notifications $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time); meta_refresh(3, $this->u_action); - $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); + $message = $user->lang['NOTIFICATIONS_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); } else @@ -137,10 +150,11 @@ class ucp_notifications } $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=ucp_notifications&mode=notification_list"); - phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $notifications['total_count'], $config['topics_per_page'], $start); + $start = $pagination->validate_start($start, $config['topics_per_page'], $notifications['total_count']); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $notifications['total_count'], $config['topics_per_page'], $start); $template->assign_vars(array( - 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $notifications['total_count'], $config['topics_per_page'], $start), + 'PAGE_NUMBER' => $pagination->on_page($base_url, $notifications['total_count'], $config['topics_per_page'], $start), 'TOTAL_COUNT' => $notifications['total_count'], 'U_MARK_ALL' => $base_url . '&mark=all&token=' . generate_link_hash('mark_all_notifications_read'), )); |