mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/10954] Modify is_ajax check for consistency
PHPBB3-10954
This commit is contained in:
parent
a57c81481d
commit
7efc37d1f9
2 changed files with 12 additions and 18 deletions
|
@ -61,14 +61,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
{
|
||||
markread('all', false, false, request_var('mark_time', 0));
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
trigger_error(
|
||||
$user->lang['FORUMS_MARKED'] . '<br /><br />' .
|
||||
sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>')
|
||||
);
|
||||
}
|
||||
else
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
// Tell the ajax script what language vars need to be replaced
|
||||
$data = array(
|
||||
|
@ -78,6 +71,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
$json_response = new phpbb_json_response();
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error(
|
||||
$user->lang['FORUMS_MARKED'] . '<br /><br />' .
|
||||
sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>')
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -326,11 +324,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
|
||||
meta_refresh(3, $redirect);
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
|
||||
}
|
||||
else
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
// Tell the ajax script what language vars need to be replaced
|
||||
$data = array(
|
||||
|
@ -340,6 +334,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
$json_response = new phpbb_json_response();
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -181,11 +181,7 @@ if ($mark_read == 'topics')
|
|||
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
|
||||
meta_refresh(3, $redirect_url);
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
else
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
// Tell the ajax script what language vars need to be replaced
|
||||
$data = array(
|
||||
|
@ -195,6 +191,8 @@ if ($mark_read == 'topics')
|
|||
$json_response = new phpbb_json_response();
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
|
||||
// Is a forum specific topic count required?
|
||||
|
|
Loading…
Add table
Reference in a new issue