r110409 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110408‎ | r110409 | r110410 >
Date:17:12, 31 January 2012
Author:gregchiasson
Status:ok
Tags:aft 
Comment:
AFT5 - fixes half of the issues with r109565. Calls text() on messages where it was missed, and formatNum() on numerical params.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -294,7 +294,7 @@
295295 }
296296
297297 protected function renderFeedback( $record ) {
298 - global $wgUser;
 298+ global $wgUser, $wgLang;
299299 $id = $record[0]->af_id;
300300
301301 switch( $record[0]->af_bucket_id ) {
@@ -339,20 +339,24 @@
340340 if ( $can_vote ) {
341341 $footer_links .= Html::element( 'span', array(
342342 'class' => 'articleFeedbackv5-helpful-caption'
343 - ), wfMessage( 'articlefeedbackv5-form-helpful-label', ( $record[0]->af_helpful_count + $record[0]->af_unhelpful_count ) ) )
 343+ ), wfMessage( 'articlefeedbackv5-form-helpful-label' )->text()
 344+ )
344345 . Html::element( 'a', array(
345346 'id' => "articleFeedbackv5-helpful-link-$id",
346347 'class' => 'articleFeedbackv5-helpful-link'
347 - ), wfMessage( 'articlefeedbackv5-form-helpful-yes-label', $record[0]->af_helpful_count )->text() )
 348+ ), wfMessage( 'articlefeedbackv5-form-helpful-yes-label' )->text() )
348349 . Html::element( 'a', array(
349350 'id' => "articleFeedbackv5-unhelpful-link-$id",
350351 'class' => 'articleFeedbackv5-unhelpful-link'
351 - ), wfMessage( 'articlefeedbackv5-form-helpful-no-label', $record[0]->af_unhelpful_count )->text() );
 352+ ), wfMessage( 'articlefeedbackv5-form-helpful-no-label' )->text() );
352353 }
353354 $footer_links .= Html::element( 'span', array(
354355 'class' => 'articleFeedbackv5-helpful-votes',
355356 'id' => "articleFeedbackv5-helpful-votes-$id"
356 - ), wfMessage( 'articlefeedbackv5-form-helpful-votes', $record[0]->af_helpful_count, $record[0]->af_unhelpful_count ) );
 357+ ), wfMessage( 'articlefeedbackv5-form-helpful-votes',
 358+ $wgLang->formatNum( $record[0]->af_helpful_count ),
 359+ $wgLang->formatNum( $record[0]->af_unhelpful_count )
 360+ )->text() );
357361 $footer_links .= Html::closeElement( 'div' );
358362 if ( $can_flag ) {
359363 $aclass = 'articleFeedbackv5-abuse-link';
@@ -366,7 +370,7 @@
367371 'id' => "articleFeedbackv5-abuse-link-$id",
368372 'class' => $aclass,
369373 'rel' => $record[0]->af_abuse_count
370 - ), wfMessage( $msg, $record[0]->af_abuse_count )->text() );
 374+ ), wfMessage( $msg, $wgLang->formatNum( $record[0]->af_abuse_count ) )->text() );
371375 }
372376 $footer_links .= $details . Html::closeElement( 'div' );
373377

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109565AFT5 feedback page - allow sorting by helpfulness, and add unhelpful flag, pe...gregchiasson20:49, 19 January 2012

Status & tagging log