r110335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110334‎ | r110335 | r110336 >
Date:22:37, 30 January 2012
Author:rsterbin
Status:ok
Tags:aft 
Comment:
Updated the language for abuse flagging so that users who don't have hiding
privileges can't see the abuse count until they've flagged that comment as
abuse. The count remains if they toggle their flag off.
- ArticleFeedbackv5.i18n.php:
- New message 'articlefeedbackv5-form-abuse-masked' for the flag
without the count
- Added documentation for this and for 'articlefeedbackv5-form-abuse'
- api/ApiViewFeedbackArticleFeedbackv5.php:
- Updated to send the appropriate link text depending on the user's
privileges
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -82,6 +82,7 @@
8383 'articlefeedbackv5-form-unhide' => 'Show this post',
8484 'articlefeedbackv5-form-helpful' => 'Mark as helpful ($1)',
8585 'articlefeedbackv5-form-abuse' => 'Flag as abuse ($1)',
 86+ 'articlefeedbackv5-form-abuse-masked' => 'Flag as abuse',
8687 'articlefeedbackv5-form-delete' => 'Delete (oversight)',
8788 'articlefeedbackv5-form-oversight' => 'Request oversight',
8889 'articlefeedbackv5-form-unoversight' => 'Unmark for oversight',
@@ -334,6 +335,8 @@
335336 * $1 is the title of the article for which we show the feedback',
336337 'articlefeedbackv5-hidden' => '{{Identical|Hidden}}',
337338 'articlefeedbackv5-deleted' => 'The marker that appears on a comment if it has been deleted by an oversighter.',
 339+ 'articlefeedbackv5-form-abuse' => 'Link text allowing the user to flag feedback as abuse. $1 is the number of times the feedback has been flagged previously.',
 340+ 'articlefeedbackv5-form-abuse-masked' => 'Link text allowing the user to flag feedback as abuse, without the count included in {{msg-mw|articlefeedbackv5-form-abuse}}',
338341 'articlefeedbackv5-form-delete' => '{{Identical|Delete}}',
339342 'articlefeedbackv5-form-oversight' => 'Request that an oversighter review this feedback',
340343 'articlefeedbackv5-form-unoversight' => 'Remove request for oversight',
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -198,24 +198,24 @@
199199 __METHOD__,
200200 array( 'ORDER BY' => $order ),
201201 array(
202 - 'rating' => array(
203 - 'LEFT JOIN',
204 - 'rating.aa_feedback_id = af_id AND rating.aa_field_id = '.intval( $ratingField )
 202+ 'rating' => array(
 203+ 'LEFT JOIN',
 204+ 'rating.aa_feedback_id = af_id AND rating.aa_field_id = ' . intval( $ratingField )
205205 ),
206 - 'answer' => array(
 206+ 'answer' => array(
207207 'LEFT JOIN', 'af_id = answer.aa_feedback_id'
208208 ),
209 - 'aft_article_field' => array(
 209+ 'aft_article_field' => array(
210210 'LEFT JOIN', 'afi_id = answer.aa_field_id'
211211 ),
212212 'aft_article_field_option' => array(
213213 'LEFT JOIN',
214214 'answer.aa_response_option_id = afo_option_id'
215215 ),
216 - 'user' => array(
 216+ 'user' => array(
217217 'LEFT JOIN', 'user_id = af_user_id'
218218 ),
219 - 'page' => array(
 219+ 'page' => array(
220220 'JOIN', 'page_id = af_page_id'
221221 )
222222 )
@@ -258,7 +258,7 @@
259259 $where['af_is_deleted'] = 0;
260260 }
261261
262 - switch( $filter ) {
 262+ switch ( $filter ) {
263263 case 'needsoversight':
264264 $where[] = 'af_needs_oversight IS TRUE';
265265 break;
@@ -361,11 +361,13 @@
362362 if ( $record[0]->af_abuse_count >= $wgArticleFeedbackv5AbusiveThreshold ) {
363363 $aclass .= ' abusive';
364364 }
 365+ // Count masked if user cannot hide comments (as per Fabrice)
 366+ $msg = $can_hide ? 'articlefeedbackv5-form-abuse' : 'articlefeedbackv5-form-abuse-masked';
365367 $footer_links .= Html::element( 'a', array(
366368 'id' => "articleFeedbackv5-abuse-link-$id",
367369 'class' => $aclass,
368370 'rel' => $record[0]->af_abuse_count
369 - ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() );
 371+ ), wfMessage( $msg, $record[0]->af_abuse_count )->text() );
370372 }
371373 $footer_links .= $details . Html::closeElement( 'div' );
372374

Status & tagging log