r109931 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109930‎ | r109931 | r109932 >
Date:16:06, 24 January 2012
Author:gregchiasson
Status:ok (Comments)
Tags:aft 
Comment:
AFT5 feedbackpage - Fix a fixme in the internationalization file. Change default filter on feedback list. Properly increment filter rollup counts when flagging feedback. Do permissions checks properly for hide/delte functionality. Default filter is now 'whatever you asked for, and also non-hidden and non-deleted' unless you specifically want deleted/hidden feedback. Disable rendering of an empty tools section, for normal readers. Restrict AFT5 feedback page to pages with AFT5 enabled.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-ascending.png (added) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-descending.png (added) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -69,7 +69,7 @@
7070 'articlefeedbackv5-special-sort-label-after' => '',
7171 'articlefeedbackv5-special-filter-label-before' => 'Showing:',
7272 'articlefeedbackv5-special-filter-label-after' => '',
73 - 'articlefeedbackv5-special-showing' => '$1 feedback posts on this page', // FIXME: Needs plural support on $1.
 73+ 'articlefeedbackv5-special-showing' => '{{PLURAL:$1|1 feedback post|$1 feedback posts }} on this article',
7474 'articlefeedbackv5-comment-link' => 'Permalink',
7575 'articlefeedbackv5-updates-since' => '{{PLURAL:$1|1 edit|$1 edits}} since post',
7676 'articlefeedbackv5-special-more' => 'More',
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-ascending.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-ascending.png
___________________________________________________________________
Added: svn:mime-type
7777 + image/png
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-descending.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/images/sort-descending.png
___________________________________________________________________
Added: svn:mime-type
7878 + image/png
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -40,7 +40,7 @@
4141 /**
4242 * The name of the filter used to select feedback
4343 */
44 - $.articleFeedbackv5special.filter = 'visible';
 44+ $.articleFeedbackv5special.filter = 'comment';
4545
4646 /**
4747 * Some fitlers have values they need tobe passed (eg, permalinks)
@@ -143,10 +143,10 @@
144144 $( '.articleFeedbackv5-sort-arrow' ).hide();
145145 $( '.articleFeedbackv5-sort-link' ).removeClass( 'sort-active' );
146146
147 - $( '#articleFeedbackv5-sort-arrow-' + id ).text(
148 - mw.msg( 'articlefeedbackv5-special-sort-' + dir )
 147+ $( '#articleFeedbackv5-sort-arrow-' + id ).show();
 148+ $( '#articleFeedbackv5-sort-arrow-' + id ).attr(
 149+ 'src', 'images/sort ' + dir + 'ending.png'
149150 );
150 - $( '#articleFeedbackv5-sort-arrow-' + id ).show();
151151 $( '#articleFeedbackv5-special-sort-' + id).addClass( 'sort-active' );
152152 }
153153
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php
@@ -284,3 +284,8 @@
285285 // Special Page
286286 $wgSpecialPages['ArticleFeedbackv5'] = 'SpecialArticleFeedbackv5';
287287 $wgSpecialPageGroups['ArticleFeedbackv5'] = 'other';
 288+
 289+$wgAvailableRights[] = 'aftv5-hide-feedback';
 290+$wgAvailableRights[] = 'aftv5-delete-feedback';
 291+$wgAvailableRights[] = 'aftv5-see-deleted-feedback';
 292+$wgAvailableRights[] = 'aftv5-see-hidden-feedback';
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php
@@ -25,7 +25,7 @@
2626 $params = $this->extractRequestParams();
2727 $error = null;
2828 $dbr = wfGetDB( DB_SLAVE );
29 -
 29+ $counts = array( 'increment' => array(), 'decrement' => array() );
3030 # load feedback record, bail if we don't have one
3131 $record = $dbr->selectRow(
3232 'aft_article_feedback',
@@ -34,6 +34,8 @@
3535 );
3636
3737 $flags = array( 'abuse', 'hide', 'helpful', 'unhelpful', 'delete' );
 38+ $flag = $params['flagtype'];
 39+
3840 if ( !$record->af_id ) {
3941 // no-op, because this is already broken
4042 $error = 'articlefeedbackv5-invalid-feedback-id';
@@ -41,19 +43,51 @@
4244 // Probably this doesn't need validation, since the API
4345 // will handle it, but if it's getting interpolated into
4446 // the SQL, I'm really wary not re-validating it.
45 - $flag = 'af_'.$params['flagtype'].'_count';
46 - $update[] = "$flag = $flag + 1";
 47+ $field = 'af_'.$params['flagtype'].'_count';
 48+ $update[] = "$field = $field + 1";
4749 } else {
4850 $error = 'articlefeedbackv5-invalid-feedback-flag';
4951 }
5052
 53+
 54+ // Newly abusive record
 55+ if( $flag == 'abuse' && $record->af_abuse_count == 0 ) {
 56+ $counts['increment'][] = 'abuse';
 57+ }
 58+
 59+ // Newly hidden record
 60+ if( $flag == 'hide' && $record->af_hide_count == 0 ) {
 61+ $counts['increment'][] = 'invisible';
 62+ $counts['decrement'][] = 'visible';
 63+ }
 64+
 65+ // Newly deleted record
 66+ if( $flag == 'delete' && $record->af_delete_count == 0 ) {
 67+ $counts['increment'][] = 'deleted';
 68+ $counts['decrement'][] = 'visible';
 69+ }
 70+
 71+ // Newly helpful record
 72+ if( $flag == 'helpful' && $record->af_helpful_count == 0 ) {
 73+ $counts['increment'][] = 'helpful';
 74+ }
 75+
 76+ // Newly unhelpful record (IE, unhelpful has overtaken helpful)
 77+ if( $flag == 'unhelpful'
 78+ && ( $record->af_helpful_count - $record->af_unhelpful_count ) == 1 ) {
 79+ $counts['decrement'][] = 'helpful';
 80+ }
 81+
5182 if ( !$error ) {
5283 $dbw = wfGetDB( DB_MASTER );
5384 $dbw->update(
5485 'aft_article_feedback',
5586 $update,
56 - array( 'af_id' => $params['feedbackid'] )
 87+ array( 'af_id' => $params['feedbackid'] ),
 88+ __METHOD__
5789 );
 90+
 91+ $this->updateFilterCounts( $counts, $params['pageid'] );
5892 }
5993
6094 if ( $error ) {
@@ -74,6 +108,46 @@
75109 );
76110 }
77111
 112+ public function updateFilterCounts( $counts, $pageId ) {
 113+ $dbw = wfGetDB( DB_MASTER );
 114+ $rows = array();
 115+
 116+ foreach( array_merge( $counts['increment'], $counts['decrement'] ) as $filter ) {
 117+ $rows[] = array(
 118+ 'afc_page_id' => $pageId,
 119+ 'afc_filter_name' => $filter,
 120+ 'afc_filter_count' => 0
 121+ );
 122+ }
 123+
 124+ // Make sure the rows are inserted.
 125+ $dbw->insert(
 126+ 'aft_article_filter_count',
 127+ $rows,
 128+ __METHOD__,
 129+ array( 'IGNORE' )
 130+ );
 131+
 132+ // Update the filter counts
 133+ foreach( $counts['increment'] as $count ) {
 134+ $dbw->update(
 135+ 'aft_article_filter_count',
 136+ array( 'afc_filter_count = afc_filter_count + 1' ),
 137+ array( 'afc_filter_name' => $count ),
 138+ __METHOD__
 139+ );
 140+ }
 141+
 142+ foreach( $counts['decrement'] as $count ) {
 143+ $dbw->update(
 144+ 'aft_article_filter_count',
 145+ array( 'afc_filter_count = afc_filter_count - 1' ),
 146+ array( 'afc_filter_name' => $count ),
 147+ __METHOD__
 148+ );
 149+ }
 150+ }
 151+
78152 /**
79153 * Gets the allowed parameters
80154 *
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -14,13 +14,11 @@
1515 * @subpackage Api
1616 */
1717 class ApiViewFeedbackArticleFeedbackv5 extends ApiQueryBase {
18 - private $access = array();
1918 /**
2019 * Constructor
2120 */
2221 public function __construct( $query, $moduleName ) {
2322 parent::__construct( $query, $moduleName, 'afvf' );
24 - $this->access = ApiArticleFeedbackv5Utils::initializeAccess();
2523 }
2624
2725 /**
@@ -87,22 +85,23 @@
8886 $continueDirection = ( $direction == 'ASC' ? '>' : '<' );
8987 $order;
9088 $continue;
 89+ $sortField;
9190
9291 switch( $sort ) {
9392 case 'helpful':
94 - $order = "net_helpfulness $direction";
95 - $continueSql = "net_helpfulness $continueDirection";
 93+ $sortField = 'net_helpfulness';
9694 break;
9795 case 'rating':
98 - # For now, just fall through. Not specced out.
 96+ $sortField = 'rating';
9997 break;
10098 case 'age':
101 - # Default sort is by age.
 99+ # Default field, fall through
102100 default:
103 - $order = "af_id $direction";
104 - $continueSql = "af_id $continueDirection";
 101+ $sortField = 'af_id';
105102 break;
106 - }
 103+ }
 104+ $order = "$sortField $direction";
 105+ $continueSql = "$sortField $continueDirection";
107106
108107 $where['af_page_id'] = $pageId;
109108 # This join is needed for the comment filter.
@@ -214,40 +213,60 @@
215214 }
216215
217216 private function getFilterCriteria( $filter, $filterValue = null ) {
 217+ global $wgUser;
218218 $where = array();
219219
220220 // Permissions check
221 - if(
222 - ( $filter == 'invisible' && !$this->access[ 'rollbackers' ] )
223 - || ( $filter == 'deleted' && !$this->access[ 'oversight' ] )
224 -
 221+ if(
 222+ ( $filter == 'invisible'
 223+ && !$wgUser->isAllowed( 'aftv5-see-hidden-feedback' ) )
 224+ ||
 225+ ( $filter == 'deleted'
 226+ && !$wgUser->isAllowed( 'aftv5-ssee-deleted-feedback' ) )
225227 ) {
226228 $filter = null;
227229 }
228230
 231+ // Always limit this to non-hidden records, unless they
 232+ // specifically ask to see them.
 233+ if( $filter != 'invisible' ) {
 234+ $where[ 'af_hide_count' ] = 0;
 235+ }
 236+
 237+ // Same, but for deleted/supressed/oversight-only records.
 238+ if( $filter != 'deleted' ) {
 239+ $where[ 'af_delete_count' ] = 0;
 240+ }
 241+
229242 switch( $filter ) {
230243 case 'all':
231 - $where = array();
 244+ # no op
232245 break;
233246 case 'invisible':
234 - $where = array( 'af_hide_count > 0' );
 247+ $where[] = 'af_hide_count > 0';
235248 break;
236249 case 'comment':
237 - $where = array( 'aa_response_text IS NOT NULL');
 250+ $where[] = 'aa_response_text IS NOT NULL';
238251 break;
239252 case 'id':
240 - $where = array( 'af_id' => $filterValue );
 253+ $where[ 'af_id' ] = $filterValue;
241254 break;
242255 case 'visible':
 256+ $where[ 'af_hide_count' ] = 0;
 257+ break;
 258+ case 'deleted':
 259+ $where[ 'af_delete_count' ] = 0;
 260+ break;
243261 default:
244 - $where = array( 'af_hide_count' => 0 );
245262 break;
246263 }
247264 return $where;
248265 }
249266
250267 protected function renderFeedback( $record ) {
251 - global $wgArticlePath;
 268+ global $wgArticlePath, $wgUser;
 269+ $id = $record[0]->af_id;
 270+
252271 switch( $record[0]->af_bucket_id ) {
253272 case 1: $content .= $this->renderBucket1( $record ); break;
254273 case 2: $content .= $this->renderBucket2( $record ); break;
@@ -257,18 +276,13 @@
258277 case 6: $content .= $this->renderBucket6( $record ); break;
259278 default: $content .= $this->renderNoBucket( $record ); break;
260279 }
261 - $can_flag = !$this->access[ 'blocked' ];
262 - $can_vote = !$this->access[ 'blocked' ];
263 - $can_hide = $this->access[ 'rollbackers' ];
264 - $can_delete = $this->access[ 'oversight' ];
265 - $id = $record[0]->af_id;
266280
267 -# $header_links = Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-head' ) )
268 -# . Html::element( 'a', array( 'class' => 'articleFeedbackv5-comment-name', 'href' => 'profilepage or whatever' ), $id )
269 -# . Html::openElement( 'div', array(
270 -# . Html::element( 'span', array( 'class' => 'articleFeedbackv5-comment-timestamp' ), $record[0]->af_created )
271 -# . wfMessage( 'articlefeedbackv5-form-optionid', $record[0]->af_bucket_id )->escaped()
272 -# . Html::closeElement( 'p' );
 281+ // These two are the same for now, but may now always be,
 282+ // so set them each separately.
 283+ $can_flag = !$wgUser->isBlocked();
 284+ $can_vote = !$wgUser->isBlocked();
 285+ $can_hide = $wgUser->isAllowed( 'aftv5-hide-feedback' );
 286+ $can_delete = $wgUser->isAllowed( 'aftv5-delete-feedback' );
273287
274288 $details = Html::openElement( 'div', array(
275289 'class' => 'articleFeedbackv5-comment-details'
@@ -302,7 +316,6 @@
303317 'oldid' => $record[0]->af_revision_id
304318 )
305319 )
306 -# ), wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ) )
307320 . Html::closeElement( 'div' )
308321 . Html::closeElement( 'div' );
309322 ;
@@ -326,42 +339,41 @@
327340 $footer_links .= Html::element( 'span', array(
328341 'class' => 'articleFeedbackv5-helpful-votes'
329342 ), wfMessage( 'articlefeedbackv5-form-helpful-votes', ( $record[0]->af_helpful_count + $record[0]->af_unhelpful_count ), $record[0]->af_helpful_count, $record[0]->af_unhelpful_count ) )
330 - . Html::closeElement( 'p' );
331 -
332 -
333 -# $rate = Html::openElement( 'div', array( 'class' => 'articleFeedbackv5-feedback-rate' ) )
334 -# . wfMessage( 'articlefeedbackv5-form-helpful-label' )->escaped()
335 -# . Html::closeElement( 'div' );
336 -
337 -
338 - $tools = Html::openElement( 'div', array(
339 - 'class' => 'articleFeedbackv5-feedback-tools',
340 - 'id' => 'articleFeedbackv5-feedback-tools-'.$id
341 - ) )
342 - . Html::element( 'h3', array(
343 - 'id' => 'articleFeedbackv5-feedback-tools-header-'.$id
344 - ), wfMessage( 'articlefeedbackv5-form-tools-label' )->text() )
345 - . Html::openElement( 'ul', array(
346 - 'id' => 'articleFeedbackv5-feedback-tools-list-'.$id
347 - ) )
348 - # TODO: unhide hidden posts
349 - . ( $can_hide ? Html::rawElement( 'li', array(), Html::element( 'a', array(
350 - 'id' => "articleFeedbackv5-hide-link-$id",
351 - 'class' => 'articleFeedbackv5-hide-link'
352 - ), wfMessage( 'articlefeedbackv5-form-hide', $record[0]->af_hide_count )->text() ) ) : '' )
353 - . ( $can_flag ? Html::rawElement( 'li', array(), Html::element( 'a', array(
 343+ . ( $can_flag ? Html::rawElement( 'div', array(
 344+ 'class' => 'articleFeedbackv5-abuse-link-wrap'
 345+ ), Html::element( 'a', array(
354346 'id' => "articleFeedbackv5-abuse-link-$id",
355347 'class' => 'articleFeedbackv5-abuse-link'
356348 ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() ) ) : '' )
357 - # TODO: nonoversight can mark for oversight, oversight can
358 - # either delete or un-delete, based on deletion status
359 - . ( $can_delete ? Html::rawElement( 'li', array(), Html::element( 'a', array(
360 - 'id' => "articleFeedbackv5-delete-link-$id",
361 - 'class' => 'articleFeedbackv5-delete-link'
362 - ), wfMessage( 'articlefeedbackv5-form-delete' )->text() ) ) : '' )
363 - . Html::closeElement( 'ul' )
364 - . Html::closeElement( 'div' );
 349+ . Html::closeElement( 'p' );
365350
 351+ // Don't render the toolbox if they can't do anything with it.
 352+ if( $can_hide || $can_delete ) {
 353+ $tools = Html::openElement( 'div', array(
 354+ 'class' => 'articleFeedbackv5-feedback-tools',
 355+ 'id' => 'articleFeedbackv5-feedback-tools-'.$id
 356+ ) )
 357+ . Html::element( 'h3', array(
 358+ 'id' => 'articleFeedbackv5-feedback-tools-header-'.$id
 359+ ), wfMessage( 'articlefeedbackv5-form-tools-label' )->text() )
 360+ . Html::openElement( 'ul', array(
 361+ 'id' => 'articleFeedbackv5-feedback-tools-list-'.$id
 362+ ) )
 363+ # TODO: unhide hidden posts
 364+ . ( $can_hide ? Html::rawElement( 'li', array(), Html::element( 'a', array(
 365+ 'id' => "articleFeedbackv5-hide-link-$id",
 366+ 'class' => 'articleFeedbackv5-hide-link'
 367+ ), wfMessage( 'articlefeedbackv5-form-hide', $record[0]->af_hide_count )->text() ) ) : '' )
 368+ # TODO: nonoversight can mark for oversight, oversight can
 369+ # either delete or un-delete, based on deletion status
 370+ . ( $can_delete ? Html::rawElement( 'li', array(), Html::element( 'a', array(
 371+ 'id' => "articleFeedbackv5-delete-link-$id",
 372+ 'class' => 'articleFeedbackv5-delete-link'
 373+ ), wfMessage( 'articlefeedbackv5-form-delete' )->text() ) ) : '' )
 374+ . Html::closeElement( 'ul' )
 375+ . Html::closeElement( 'div' );
 376+ }
 377+
366378 return Html::openElement( 'div', array( 'class' => 'articleFeedbackv5-feedback' ) )
367379 . Html::openElement( 'div', array(
368380 'class' => "articleFeedbackv5-comment-wrap"
@@ -371,7 +383,6 @@
372384 . Html::closeElement( 'div' )
373385 . $details
374386 . $tools
375 - . $rate
376387 . Html::closeElement( 'div' );
377388 }
378389
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php
@@ -190,31 +190,4 @@
191191
192192 $dbw->commit();
193193 }
194 -
195 - public function initializeAccess() {
196 - global $wgUser;
197 - $permissions = array(
198 - 'blocked' => $wgUser->isBlocked(),
199 - 'anon' => $wgUser->isAnon(),
200 - 'registered' => !$wgUser->isAnon() && !$wgUser->isBlocked(),
201 - 'autoconfirmed' => in_array('autoconfirmed', $wgUser->getEffectiveGroups()),
202 - 'rollbackers' => in_array('rollbacker', $wgUser->getEffectiveGroups()),
203 - 'admins' => false,
204 - 'oversight' => false
205 - );
206 -
207 - if( in_array('sysop', $wgUser->getEffectiveGroups() ) ) {
208 - $permissions['admins'] = true;
209 - $permissions['rollbackers'] = true;
210 - }
211 -
212 - if( in_array('oversight ', $wgUser->getEffectiveGroups() ) ) {
213 - $permissions['oversight'] = true;
214 - $permissions['rollbackers'] = true;
215 - $permissions['admins'] = true;
216 - }
217 -
218 - return $permissions;
219 - }
220194 }
221 -
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php
@@ -15,10 +15,9 @@
1616 * @subpackage Special
1717 */
1818 class SpecialArticleFeedbackv5 extends SpecialPage {
19 - private $access;
2019 private $filters = array(
21 - 'visible',
22 - 'comment'
 20+ 'comment',
 21+ 'visible'
2322 );
2423 private $sorts = array(
2524 'age',
@@ -30,14 +29,15 @@
3130 * Constructor
3231 */
3332 public function __construct() {
 33+ global $wgUser;
3434 parent::__construct( 'ArticleFeedbackv5' );
35 - $this->access = ApiArticleFeedbackv5Utils::initializeAccess();
3635
37 - if( $this->access[ 'rollbackers' ] ) {
 36+ if( $wgUser->isAllowed( 'aftv5-see-hidden-feedback' ) ) {
3837 $this->filters[] = 'invisible';
3938 $this->filters[] = 'all';
4039 }
41 - if( $this->access[ 'oversight' ] ) {
 40+
 41+ if( $wgUser->isAllowed( 'aftv5-see-deleted-feedback' ) ) {
4242 $this->filters[] = 'deleted';
4343 }
4444 }
@@ -48,16 +48,36 @@
4949 * @param $param string the parameter passed in the url
5050 */
5151 public function execute( $param ) {
 52+ global $wgArticleFeedbackv5DashboardCategory;
5253 $out = $this->getOutput();
5354 $title = Title::newFromText( $param );
5455
55 - if ( $title ) {
56 - $pageId = $title->getArticleID();
57 - } else {
 56+ // Page does not exist.
 57+ if( !$title->exists() ) {
5858 $out->addWikiMsg( 'articlefeedbackv5-invalid-page-id' );
5959 return;
6060 }
6161
 62+ $pageId = $title->getArticleID();
 63+ $dbr = wfGetDB( DB_SLAVE );
 64+ $t = $dbr->select(
 65+ 'categorylinks',
 66+ 'cl_from',
 67+ array(
 68+ 'cl_from' => $pageId,
 69+ 'cl_to' => $wgArticleFeedbackv5DashboardCategory
 70+ ),
 71+ __METHOD__,
 72+ array( 'LIMIT' => 1 )
 73+ );
 74+
 75+ // Page exists, but feedback is disabled.
 76+ if( $dbr->numRows( $t ) == 0 ) {
 77+ $out->addWikiMsg( 'articlefeedbackv5-page-disabled' );
 78+ return;
 79+ }
 80+
 81+ // Success!
6282 $ratings = $this->fetchOverallRating( $pageId );
6383 $found = isset( $ratings['found'] ) ? $ratings['found'] : null;
6484 $rating = isset( $ratings['rating'] ) ? $ratings['rating'] : null;
@@ -141,11 +161,10 @@
142162
143163 $sortLabels = array();
144164 foreach ( $this->sorts as $sort ) {
145 - $sortLabels[] = Html::element( 'span',
 165+ $sortLabels[] = Html::element( 'img',
146166 array(
147167 'id' => 'articleFeedbackv5-sort-arrow-' . $sort,
148168 'class' => 'articleFeedbackv5-sort-arrow'
149 -
150169 ), '' )
151170 . Html::element(
152171 'a',

Comments

#Comment by Catrope (talk | contribs)   06:33, 31 January 2012
+		$( '#articleFeedbackv5-sort-arrow-' + id ).attr(
+			'src', 'images/sort ' + dir + 'ending.png'
 		);

Instead of using img tags, you should put your sort arrow images in CSS as background images. You can take advantage of data URI embedding that way.

+$wgAvailableRights[] = 'aftv5-hide-feedback';
+$wgAvailableRights[] = 'aftv5-delete-feedback';
+$wgAvailableRights[] = 'aftv5-see-deleted-feedback';
+$wgAvailableRights[] = 'aftv5-see-hidden-feedback';

Forgot to mention earlier that these should have description messages, see [[Special:Code/MediaWiki/109582#c30265|r109582 CR]].

+			 && !$wgUser->isAllowed( 'aftv5-ssee-deleted-feedback' ) )

Typo apparently fixed in a later revision.

Status & tagging log