Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'articlefeedbackv5-special-filter-invisible' => 'Invisible ($1)', |
57 | 57 | 'articlefeedbackv5-special-sort-newest' => 'Newest first', |
58 | 58 | 'articlefeedbackv5-special-sort-oldest' => 'Oldest first', |
59 | | - 'articlefeedbackv5-special-sort-label-before' => 'Order by:', |
| 59 | + 'articlefeedbackv5-special-sort-label-before' => 'Sort by:', |
60 | 60 | 'articlefeedbackv5-special-sort-label-after' => '', |
61 | 61 | 'articlefeedbackv5-special-filter-label-before' => 'Show only:', |
62 | 62 | 'articlefeedbackv5-special-filter-label-after' => '', |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | # load feedback record, bail if we don't have one |
36 | 36 | $record = $dbr->selectRow( |
37 | 37 | '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' ), |
39 | 39 | array( 'af_id' => $params['feedbackid'] ) |
40 | 40 | ); |
41 | 41 | |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -58,9 +58,8 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | public function fetchFeedbackCount( $pageId, $filter ) { |
62 | | - $dbr = wfGetDB( DB_SLAVE ); |
63 | | - |
64 | | - return $dbr->selectField( |
| 62 | + $dbr = wfGetDB( DB_SLAVE ); |
| 63 | + $count = $dbr->selectField( |
65 | 64 | array( 'aft_article_filter_count' ), |
66 | 65 | array( 'afc_filter_count' ), |
67 | 66 | array( |
— | — | @@ -69,6 +68,8 @@ |
70 | 69 | ), |
71 | 70 | __METHOD__ |
72 | 71 | ); |
| 72 | + // selectField returns false if there's no row, so make that 0 |
| 73 | + return $count ? $count : 0; |
73 | 74 | } |
74 | 75 | |
75 | 76 | public function fetchFeedback( $pageId, |
— | — | @@ -218,10 +219,6 @@ |
219 | 220 | 'id' => "articleFeedbackv5-helpful-link-$id", |
220 | 221 | 'class' => 'articleFeedbackv5-helpful-link' |
221 | 222 | ), 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() ) ) : '' ) |
226 | 223 | . Html::closeElement( 'ul' ) |
227 | 224 | . Html::closeElement( 'p' ); |
228 | 225 | |
— | — | @@ -241,6 +238,10 @@ |
242 | 239 | 'id' => "articleFeedbackv5-delete-link-$id", |
243 | 240 | 'class' => 'articleFeedbackv5-delete-link' |
244 | 241 | ), 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() ) ) : '' ) |
245 | 246 | . Html::closeElement( 'ul' ) |
246 | 247 | . Html::closeElement( 'div' ); |
247 | 248 | |
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php |
— | — | @@ -100,6 +100,14 @@ |
101 | 101 | ) |
102 | 102 | . $this->msg( 'articlefeedbackv5-percent-found', $found )->escaped() |
103 | 103 | . 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 | + ) |
104 | 112 | ); |
105 | 113 | } |
106 | 114 | |
— | — | @@ -142,22 +150,26 @@ |
143 | 151 | 'div', |
144 | 152 | array( 'id' => 'articleFeedbackv5-sort-filter-controls' ) |
145 | 153 | ) |
| 154 | + . Html::openElement( |
| 155 | + 'div', |
| 156 | + array( 'id' => 'articleFeedbackv5-sort' ) |
| 157 | + ) |
146 | 158 | . $this->msg( 'articlefeedbackv5-special-sort-label-before' )->escaped() |
147 | 159 | . implode( $this->msg( 'pipe-separator' )->escaped(), $sortLabels ) |
| 160 | + |
148 | 161 | . $this->msg( 'articlefeedbackv5-special-sort-label-after' )->escaped() |
149 | | - |
| 162 | + . Html::closeElement( 'div' ) |
| 163 | + . Html::openElement( |
| 164 | + 'div', |
| 165 | + array( 'id' => 'articleFeedbackv5-sort' ) |
| 166 | + ) |
150 | 167 | . $this->msg( 'articlefeedbackv5-special-filter-label-before' )->escaped() |
151 | 168 | . $filterSelect->getHTML() |
152 | 169 | . $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 | | - ) |
161 | 170 | . Html::closeElement( 'div' ) |
| 171 | + |
| 172 | + |
| 173 | + . Html::closeElement( 'div' ) |
162 | 174 | ); |
163 | 175 | |
164 | 176 | $out->addHTML( |