aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authormarcosbc <marcosbc>2014-04-12 15:40:56 +0200
committermarcosbc <marcosbc>2014-05-03 20:31:32 +0200
commit46c658bdbf87826b003640da26b613320e91e9ec (patch)
treed8250a702937a2d33bd3f2ecfbc21ddbc7fa9237 /phpBB
parent1fec5e6967f4cc1278aead9959aa0c8f8ac36a56 (diff)
downloadforums-46c658bdbf87826b003640da26b613320e91e9ec.tar
forums-46c658bdbf87826b003640da26b613320e91e9ec.tar.gz
forums-46c658bdbf87826b003640da26b613320e91e9ec.tar.bz2
forums-46c658bdbf87826b003640da26b613320e91e9ec.tar.xz
forums-46c658bdbf87826b003640da26b613320e91e9ec.zip
[ticket/12270] Correct confirm approval message for topics
When clicking on approving a topic's first post in the MCP to approve the topic itself, the confirm box dialog asks whether to approve the post or not, instead of asking to approve the topic. To achieve this fix, we just need to count the topics to be approved and check if it's greater than zero. PHPBB3-12270
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index fd22a866bb..a3e6e62b07 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -732,20 +732,21 @@ class mcp_queue
}
else
{
+ $num_topics = 0;
$show_notify = false;
if ($action == 'approve')
{
foreach ($post_info as $post_data)
{
- if ($post_data['poster_id'] == ANONYMOUS)
+ if (!$post_data['topic_posts_approved'])
{
- continue;
+ $num_topics++;
}
- else
+
+ if (!$show_notify && $post_data['poster_id'] != ANONYMOUS)
{
$show_notify = true;
- break;
}
}
}
@@ -755,7 +756,18 @@ class mcp_queue
'S_' . strtoupper($action) => true,
));
- confirm_box(false, strtoupper($action) . '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
+ // Create the confirm box message
+ $action_msg = strtoupper($action);
+ $num_posts = sizeof($post_id_list) - $num_topics;
+ if ($num_topics > 0 && $num_posts <= 0)
+ {
+ $action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S');
+ }
+ else
+ {
+ $action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S');
+ }
+ confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html');
}
redirect($redirect);