r109251 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109250‎ | r109251 | r109252 >
Date:23:55, 17 January 2012
Author:gregchiasson
Status:ok
Tags:aft 
Comment:
AFT5 HTML changes per our designer. Bug fixes for rollup counts on feedback page
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -55,7 +55,7 @@
5656 'articlefeedbackv5-special-filter-invisible' => 'Invisible ($1)',
5757 'articlefeedbackv5-special-sort-newest' => 'Newest first',
5858 'articlefeedbackv5-special-sort-oldest' => 'Oldest first',
59 - 'articlefeedbackv5-special-sort-label-before' => 'Order by:',
 59+ 'articlefeedbackv5-special-sort-label-before' => 'Sort by:',
6060 'articlefeedbackv5-special-sort-label-after' => '',
6161 'articlefeedbackv5-special-filter-label-before' => 'Show only:',
6262 'articlefeedbackv5-special-filter-label-after' => '',
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php
@@ -34,7 +34,7 @@
3535 # load feedback record, bail if we don't have one
3636 $record = $dbr->selectRow(
3737 'aft_article_feedback',
38 - array( 'af_id', 'af_abuse_count', 'af_hide_count' ),
 38+ array( 'af_id', 'af_abuse_count', 'af_hide_count', 'af_helpful_count', 'af_delete_count' ),
3939 array( 'af_id' => $params['feedbackid'] )
4040 );
4141
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -58,9 +58,8 @@
5959 }
6060
6161 public function fetchFeedbackCount( $pageId, $filter ) {
62 - $dbr = wfGetDB( DB_SLAVE );
63 -
64 - return $dbr->selectField(
 62+ $dbr = wfGetDB( DB_SLAVE );
 63+ $count = $dbr->selectField(
6564 array( 'aft_article_filter_count' ),
6665 array( 'afc_filter_count' ),
6766 array(
@@ -69,6 +68,8 @@
7069 ),
7170 __METHOD__
7271 );
 72+ // selectField returns false if there's no row, so make that 0
 73+ return $count ? $count : 0;
7374 }
7475
7576 public function fetchFeedback( $pageId,
@@ -218,10 +219,6 @@
219220 'id' => "articleFeedbackv5-helpful-link-$id",
220221 'class' => 'articleFeedbackv5-helpful-link'
221222 ), wfMessage( 'articlefeedbackv5-form-helpful', $record[0]->af_helpful_count )->text() ) ) : '' )
222 - . ( $can_flag ? Html::rawElement( 'li', array(), Html::element( 'a', array(
223 - 'id' => "articleFeedbackv5-abuse-link-$id",
224 - 'class' => 'articleFeedbackv5-abuse-link'
225 - ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() ) ) : '' )
226223 . Html::closeElement( 'ul' )
227224 . Html::closeElement( 'p' );
228225
@@ -241,6 +238,10 @@
242239 'id' => "articleFeedbackv5-delete-link-$id",
243240 'class' => 'articleFeedbackv5-delete-link'
244241 ), wfMessage( 'articlefeedbackv5-form-delete' )->text() ) ) : '' )
 242+ . ( $can_flag ? Html::rawElement( 'li', array(), Html::element( 'a', array(
 243+ 'id' => "articleFeedbackv5-abuse-link-$id",
 244+ 'class' => 'articleFeedbackv5-abuse-link'
 245+ ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() ) ) : '' )
245246 . Html::closeElement( 'ul' )
246247 . Html::closeElement( 'div' );
247248
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php
@@ -100,6 +100,14 @@
101101 )
102102 . $this->msg( 'articlefeedbackv5-percent-found', $found )->escaped()
103103 . Html::closeElement( 'div' )
 104+ . Html::element(
 105+ 'a',
 106+ array(
 107+ 'href' => '#',
 108+ 'id' => 'articleFeedbackv5-special-add-feedback',
 109+ ),
 110+ $this->msg( 'articlefeedbackv5-special-add-feedback' )->text()
 111+ )
104112 );
105113 }
106114
@@ -142,22 +150,26 @@
143151 'div',
144152 array( 'id' => 'articleFeedbackv5-sort-filter-controls' )
145153 )
 154+ . Html::openElement(
 155+ 'div',
 156+ array( 'id' => 'articleFeedbackv5-sort' )
 157+ )
146158 . $this->msg( 'articlefeedbackv5-special-sort-label-before' )->escaped()
147159 . implode( $this->msg( 'pipe-separator' )->escaped(), $sortLabels )
 160+
148161 . $this->msg( 'articlefeedbackv5-special-sort-label-after' )->escaped()
149 -
 162+ . Html::closeElement( 'div' )
 163+ . Html::openElement(
 164+ 'div',
 165+ array( 'id' => 'articleFeedbackv5-sort' )
 166+ )
150167 . $this->msg( 'articlefeedbackv5-special-filter-label-before' )->escaped()
151168 . $filterSelect->getHTML()
152169 . $this->msg( 'articlefeedbackv5-special-filter-label-after' )->escaped()
153 - . Html::element(
154 - 'a',
155 - array(
156 - 'href' => '#',
157 - 'id' => 'articleFeedbackv5-special-add-feedback',
158 - ),
159 - $this->msg( 'articlefeedbackv5-special-add-feedback' )->text()
160 - )
161170 . Html::closeElement( 'div' )
 171+
 172+
 173+ . Html::closeElement( 'div' )
162174 );
163175
164176 $out->addHTML(

Status & tagging log