mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Merge remote-tracking branch 'prototech/ticket/11672' into develop
* prototech/ticket/11672: [ticket/11672] Move the reapply_sid() call before meta_refresh() is called. [ticket/11672] Remove duplicate $request global. [ticket/11672] The json response call exits so the else is not necessary. [ticket/11672] Remove the messages for lock/unlock/change topic type. [ticket/11672] Clean up the logic in mcp_queue.php. [ticket/11672] Remove some messages that were missed in mcp_queue.php. [ticket/11672] Replace sprintf() usage with $user->lang(). [ticket/11672] Removed unnecessary text from alerts.
This commit is contained in:
@@ -1167,7 +1167,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode)
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
$message = $user->lang['ERR_UNWATCHING'];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
@@ -1177,8 +1182,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$db->sql_query($sql);
|
||||
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />';
|
||||
$message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
meta_refresh(3, $redirect_url);
|
||||
trigger_error($message);
|
||||
}
|
||||
@@ -1232,7 +1241,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode)
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
$message = $user->lang['ERR_WATCHING'];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
@@ -1243,7 +1257,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$db->sql_query($sql);
|
||||
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
meta_refresh(3, $redirect_url);
|
||||
trigger_error($message);
|
||||
}
|
||||
|
@@ -219,7 +219,7 @@ class mcp_main
|
||||
*/
|
||||
function lock_unlock($action, $ids)
|
||||
{
|
||||
global $auth, $user, $db, $phpEx, $phpbb_root_path;
|
||||
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;
|
||||
|
||||
if ($action == 'lock' || $action == 'unlock')
|
||||
{
|
||||
@@ -256,6 +256,7 @@ function lock_unlock($action, $ids)
|
||||
unset($orig_ids);
|
||||
|
||||
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
$s_hidden_fields = build_hidden_fields(array(
|
||||
$sql_id . '_list' => $ids,
|
||||
@@ -279,24 +280,22 @@ function lock_unlock($action, $ids)
|
||||
}
|
||||
|
||||
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
|
||||
|
||||
meta_refresh(2, $redirect);
|
||||
$message = $user->lang[$success_msg];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
|
||||
}
|
||||
|
||||
$redirect = request_var('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
redirect($redirect);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(2, $redirect);
|
||||
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
|
||||
}
|
||||
redirect($redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +303,7 @@ function lock_unlock($action, $ids)
|
||||
*/
|
||||
function change_topic_type($action, $topic_ids)
|
||||
{
|
||||
global $auth, $user, $db, $phpEx, $phpbb_root_path;
|
||||
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
@@ -341,6 +340,7 @@ function change_topic_type($action, $topic_ids)
|
||||
}
|
||||
|
||||
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
$s_hidden_fields = array(
|
||||
'topic_id_list' => $topic_ids,
|
||||
@@ -381,24 +381,22 @@ function change_topic_type($action, $topic_ids)
|
||||
add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']);
|
||||
}
|
||||
}
|
||||
|
||||
meta_refresh(2, $redirect);
|
||||
$message = $user->lang[$success_msg];
|
||||
|
||||
if (!$request->is_ajax())
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));
|
||||
}
|
||||
|
||||
$redirect = request_var('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
redirect($redirect);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(2, $redirect);
|
||||
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
|
||||
}
|
||||
redirect($redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -576,6 +576,7 @@ class mcp_queue
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', build_url(array('quickmod')));
|
||||
$redirect = reapply_sid($redirect);
|
||||
$success_msg = $post_url = '';
|
||||
$approve_log = array();
|
||||
|
||||
@@ -678,6 +679,28 @@ class mcp_queue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
$message = $user->lang[$success_msg];
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => true,
|
||||
));
|
||||
}
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
|
||||
|
||||
// If approving one post, also give links back to post...
|
||||
if (sizeof($post_info) == 1 && $post_url)
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -707,39 +730,7 @@ class mcp_queue
|
||||
confirm_box(false, strtoupper($action) . '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
redirect($redirect);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(3, $redirect);
|
||||
|
||||
// If approving one post, also give links back to post...
|
||||
$add_message = '';
|
||||
if (sizeof($post_info) == 1 && $post_url)
|
||||
{
|
||||
$add_message = '<br /><br />' . sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>');
|
||||
}
|
||||
|
||||
$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . $add_message;
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => true,
|
||||
));
|
||||
}
|
||||
|
||||
trigger_error($message);
|
||||
}
|
||||
redirect($redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -762,6 +753,7 @@ class mcp_queue
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', build_url(array('quickmod')));
|
||||
$redirect = reapply_sid($redirect);
|
||||
$success_msg = $topic_url = '';
|
||||
$approve_log = array();
|
||||
|
||||
@@ -826,6 +818,28 @@ class mcp_queue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
$message = $user->lang[$success_msg];
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => true,
|
||||
));
|
||||
}
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
|
||||
|
||||
// If approving one topic, also give links back to topic...
|
||||
if (sizeof($topic_info) == 1 && $topic_url)
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>');
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -855,39 +869,7 @@ class mcp_queue
|
||||
confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
redirect($redirect);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(3, $redirect);
|
||||
|
||||
// If approving one topic, also give links back to topic...
|
||||
$add_message = '';
|
||||
if (sizeof($topic_info) == 1 && $topic_url)
|
||||
{
|
||||
$add_message = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $topic_url . '">', '</a>');
|
||||
}
|
||||
|
||||
$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . $add_message;
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => true,
|
||||
));
|
||||
}
|
||||
|
||||
trigger_error($message);
|
||||
}
|
||||
redirect($redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -909,6 +891,7 @@ class mcp_queue
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', build_url(array('t', 'mode', 'quickmod')) . "&mode=$mode");
|
||||
$redirect = reapply_sid($redirect);
|
||||
$reason = $request->variable('reason', '', true);
|
||||
$reason_id = $request->variable('reason_id', 0);
|
||||
$success_msg = $additional_msg = '';
|
||||
@@ -1151,6 +1134,22 @@ class mcp_queue
|
||||
{
|
||||
$success_msg .= '_DELETED_SUCCESS';
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
$message = $user->lang[$success_msg];
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => false,
|
||||
));
|
||||
}
|
||||
$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1199,30 +1198,6 @@ class mcp_queue
|
||||
confirm_box(false, $l_confirm_msg, $s_hidden_fields, $confirm_template);
|
||||
}
|
||||
|
||||
$redirect = $request->variable('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
redirect($redirect);
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
|
||||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
'REFRESH_DATA' => null,
|
||||
'visible' => false,
|
||||
));
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($message);
|
||||
}
|
||||
redirect($redirect);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user