Parcourir la source

// Need to make sure to only show this when ignoring

Signed-off-by: Suki <[email protected]>
Suki il y a 11 ans
Parent
commit
a02c6705d2
2 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 6 3
      Sources/ReportedPosts.php
  2. 2 2
      Themes/default/ReportedPosts.template.php

+ 6 - 3
Sources/ReportedPosts.php

@@ -111,7 +111,10 @@ function ShowReports()
 	if (!$context['view_closed'])
 		addInlineJavascript('
 	$(\'.report_ignore\').on(\'click\', function(){
-		return confirm('. JavaScriptEscape($txt['mc_reportedp_ignore_confirm']) .');
+		// Need to make sure to only show this when ignoring.
+		if ($(this).data(\'ignore\') == \'1\'){
+			return confirm('. JavaScriptEscape($txt['mc_reportedp_ignore_confirm']) .');
+		}
 	});', true);
 }
 
@@ -362,14 +365,14 @@ function HandleReport()
 	checkSession('get');
 
 	// We need to do something!
-	if (empty($_GET['rid']) && (!isset($_GET['ignore']) || !isset($_GET['close'])))
+	if (empty($_GET['rid']) && (!isset($_GET['ignore']) || !isset($_GET['closed'])))
 		fatal_lang_error('mc_reportedp_none_found');
 
 	// Integers only please.
 	$report_id = (int) $_REQUEST['rid'];
 
 	// What are we gonna do?
-	$action = isset($_GET['ignore']) ? 'ignore' : 'close';
+	$action = isset($_GET['ignore']) ? 'ignore' : 'closed';
 
 	// Are we disregarding or "un-disregarding"? "un-disregarding" thats a funny word!
 	$value = (int) $_GET[$action];

+ 2 - 2
Themes/default/ReportedPosts.template.php

@@ -63,8 +63,8 @@ function template_reported_posts()
 				<br>
 				<ul class="quickbuttons">
 					<li><a href="', $report['report_href'], '">', $details_button, '</a></li>
-					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" class="report_ignore">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
-					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;close=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a></li>';
+					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" class="report_ignore" data-ignore="', (int) !$report['ignore'], '">', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li>
+					<li><a href="', $scripturl, '?action=moderate;area=reports;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a></li>';
 
 		// Delete message button.
 		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))