1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/13189] Do not use confirm box for marking all notifications read
This commit is contained in:
Nils Adermann
2014-10-21 09:49:42 -04:00
2 changed files with 16 additions and 28 deletions

View File

@@ -95,35 +95,25 @@ class ucp_notifications
case 'notification_list':
default:
// Mark all items read
if ($request->variable('mark', '') == 'all' && (confirm_box(true) || check_link_hash($request->variable('token', ''), 'mark_all_notifications_read')))
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{
if (confirm_box(true))
$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'];
if ($request->is_ajax())
{
$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'];
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
{
confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array(
'mark' => 'all',
'form_time' => $form_time,
)));
$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);
}
// Mark specific notifications read