Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -119,7 +119,6 @@ |
120 | 120 | * mediawiki.js Message object constructor is now publicly available as mw.Message. |
121 | 121 | * (bug 29309) allow CSS class per tooltip (tipsy) |
122 | 122 | * (bug 33565) Add accesskey/tooltip to submit buttons on Special:EditWatchlist. |
123 | | -* (bug 25909) Add a drop-down list for the tags in Recentchanges and Newpages |
124 | 123 | |
125 | 124 | === Bug fixes in 1.19 === |
126 | 125 | * $wgUploadNavigationUrl should be used for file redlinks if. |
Index: trunk/phase3/includes/ChangeTags.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | static function tagDescription( $tag ) { |
29 | 29 | $msg = wfMessage( "tag-$tag" ); |
30 | | - return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag ); |
| 30 | + return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag ); |
31 | 31 | } |
32 | 32 | |
33 | 33 | ## Basic utility method to add tags to a particular change, given its rc_id, rev_id and/or log_id. |
— | — | @@ -109,10 +109,7 @@ |
110 | 110 | global $wgRequest, $wgUseTagFilter; |
111 | 111 | |
112 | 112 | if( $filter_tag === false ) { |
113 | | - $filter_tag = $wgRequest->getVal( 'tagfilterdropdown', '' ); |
114 | | - if ( $filter_tag === '' || $filter_tag === 'other' ) { |
115 | | - $filter_tag = $wgRequest->getVal( 'tagfilter' ); |
116 | | - } |
| 113 | + $filter_tag = $wgRequest->getVal( 'tagfilter' ); |
117 | 114 | } |
118 | 115 | |
119 | 116 | // Figure out which conditions can be done. |
— | — | @@ -181,45 +178,6 @@ |
182 | 179 | } |
183 | 180 | |
184 | 181 | /** |
185 | | - * Build a text box and a dropdown list to select a change tag |
186 | | - * |
187 | | - * @param $msgkey String: message key for the message where a (newline delimited) |
188 | | - * list of tags can be specified. These tags will be put in the dropdown list. |
189 | | - * If the specified message is empty, only the text field will be returned. |
190 | | - * @param $selectedtxt String: tag to put in text box |
191 | | - * @param $selecteddropdown String: tag to select in dropdown |
192 | | - * @return Array of html fragments of which the first element is the label |
193 | | - * If $wgUseTagFilter is false or there are no defined tags, an empty array is returned |
194 | | - */ |
195 | | - public static function buildTagFilterWithDropdown( $msgkey, $selectedtxt = '', $selecteddropdown = 'other' ) { |
196 | | - |
197 | | - global $wgUseTagFilter; |
198 | | - |
199 | | - $definedtags = self::listDefinedTags(); |
200 | | - |
201 | | - if ( !$wgUseTagFilter || !count( $definedtags ) ) { |
202 | | - // no tag filter if there are no tags defined or $wgUseTagFilter is false |
203 | | - return array(); |
204 | | - } |
205 | | - |
206 | | - // Extract tags from message: one tag per line |
207 | | - $tags = preg_split( "/\n/", wfMsgForContent( $msgkey ), -1, PREG_SPLIT_NO_EMPTY); |
208 | | - |
209 | | - $data[] = Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMsgExt( 'tag-filter', 'parseinline' ) ); |
210 | | - |
211 | | - if ( count( $tags ) ) { |
212 | | - // Add dropdown list only when message $msgkey contains at least one tag |
213 | | - $data[] = Xml::listDropDown( 'tagfilterdropdown', implode( "\n", $tags ), |
214 | | - wfMsgForContent( 'tag-filter-dropdown-other' ), $selecteddropdown ); |
215 | | - } |
216 | | - |
217 | | - $data[] = Xml::input( 'tagfilter', 20, $selectedtxt ); |
218 | | - |
219 | | - return $data; |
220 | | - |
221 | | - } |
222 | | - |
223 | | - /** |
224 | 182 | *Basically lists defined tags which count even if they aren't applied to anything |
225 | 183 | * |
226 | 184 | * @return array |
Index: trunk/phase3/includes/actions/HistoryAction.php |
— | — | @@ -136,13 +136,7 @@ |
137 | 137 | $year = $request->getInt( 'year' ); |
138 | 138 | $month = $request->getInt( 'month' ); |
139 | 139 | $tagFilter = $request->getVal( 'tagfilter' ); |
140 | | - $tagFilterDropdown = $request->getVal( 'tagfilterdropdown' ); |
141 | | - $tagSelector = ChangeTags::buildTagFilterWithDropdown( |
142 | | - 'tag-filter-dropdown-list', |
143 | | - $tagFilter, |
144 | | - $tagFilterDropdown |
145 | | - ); |
146 | | - $tagSelector = implode( ' ', $tagSelector ); |
| 140 | + $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); |
147 | 141 | |
148 | 142 | /** |
149 | 143 | * Option to show only revisions that have been (partially) hidden via RevisionDelete |
— | — | @@ -167,26 +161,14 @@ |
168 | 162 | Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" . |
169 | 163 | Html::hidden( 'action', 'history' ) . "\n" . |
170 | 164 | Xml::dateMenu( $year, $month ) . ' ' . |
171 | | - Html::rawElement( |
172 | | - 'span', |
173 | | - array( 'style' => 'white-space: nowrap' ), |
174 | | - ( $tagSelector ? ( $tagSelector . ' ' ) : '' ) |
175 | | - ) . |
176 | | - Html::rawElement( |
177 | | - 'span', |
178 | | - array( 'style' => 'white-space: nowrap' ), |
179 | | - $checkDeleted |
180 | | - ) . |
| 165 | + ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . |
| 166 | + $checkDeleted . |
181 | 167 | Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" . |
182 | 168 | '</fieldset></form>' |
183 | 169 | ); |
184 | 170 | |
185 | 171 | wfRunHooks( 'PageHistoryBeforeList', array( &$this->page ) ); |
186 | 172 | |
187 | | - if ( $tagFilterDropdown !== '' && $tagFilterDropdown !== 'other' ) { |
188 | | - $tagFilter = $tagFilterDropdown; |
189 | | - } |
190 | | - |
191 | 173 | // Create and output the list. |
192 | 174 | $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds ); |
193 | 175 | $out->addHTML( |
Index: trunk/phase3/includes/specials/SpecialNewpages.php |
— | — | @@ -59,7 +59,6 @@ |
60 | 60 | $opts->add( 'username', '' ); |
61 | 61 | $opts->add( 'feed', '' ); |
62 | 62 | $opts->add( 'tagfilter', '' ); |
63 | | - $opts->add( 'tagfilterdropdown', '' ); |
64 | 63 | |
65 | 64 | $this->customFilters = array(); |
66 | 65 | wfRunHooks( 'SpecialNewPagesFilters', array( $this, &$this->customFilters ) ); |
— | — | @@ -212,7 +211,6 @@ |
213 | 212 | $namespace = $this->opts->consumeValue( 'namespace' ); |
214 | 213 | $username = $this->opts->consumeValue( 'username' ); |
215 | 214 | $tagFilterVal = $this->opts->consumeValue( 'tagfilter' ); |
216 | | - $tagFilterDropdownVal = $this->opts->consumeValue( 'tagfilterdropdown' ); |
217 | 215 | |
218 | 216 | // Check username input validity |
219 | 217 | $ut = Title::makeTitleSafe( NS_USER, $username ); |
— | — | @@ -225,14 +223,9 @@ |
226 | 224 | } |
227 | 225 | $hidden = implode( "\n", $hidden ); |
228 | 226 | |
229 | | - $tagFilter = ChangeTags::buildTagFilterWithDropdown( |
230 | | - 'tag-filter-newpages-dropdown-list', |
231 | | - $tagFilterVal, |
232 | | - $tagFilterDropdownVal |
233 | | - ); |
| 227 | + $tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal ); |
234 | 228 | if ( $tagFilter ) { |
235 | | - $tagFilterLabel = array_shift( $tagFilter ); |
236 | | - $tagFilterSelector = implode( ' ', $tagFilter ); |
| 229 | + list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter; |
237 | 230 | } |
238 | 231 | |
239 | 232 | $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . |
— | — | @@ -540,7 +533,8 @@ |
541 | 534 | $fields, |
542 | 535 | $info['conds'], |
543 | 536 | $info['join_conds'], |
544 | | - $info['options'] |
| 537 | + $info['options'], |
| 538 | + $this->opts['tagfilter'] |
545 | 539 | ); |
546 | 540 | |
547 | 541 | return $info; |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -60,7 +60,6 @@ |
61 | 61 | $opts->add( 'categories', '' ); |
62 | 62 | $opts->add( 'categories_any', false ); |
63 | 63 | $opts->add( 'tagfilter', '' ); |
64 | | - $opts->add( 'tagfilterdropdown', '' ); |
65 | 64 | return $opts; |
66 | 65 | } |
67 | 66 | |
— | — | @@ -401,7 +400,8 @@ |
402 | 401 | // Tag stuff. |
403 | 402 | // Doesn't work when transcluding. See bug 23293 |
404 | 403 | ChangeTags::modifyDisplayQuery( |
405 | | - $tables, $fields, $conds, $join_conds, $query_options |
| 404 | + $tables, $fields, $conds, $join_conds, $query_options, |
| 405 | + $opts['tagfilter'] |
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
— | — | @@ -554,7 +554,7 @@ |
555 | 555 | $nondefaults = $opts->getChangedValues(); |
556 | 556 | $opts->consumeValues( array( |
557 | 557 | 'namespace', 'invert', 'associated', 'tagfilter', |
558 | | - 'categories', 'categories_any', 'tagfilterdropdown' |
| 558 | + 'categories', 'categories_any' |
559 | 559 | ) ); |
560 | 560 | |
561 | 561 | $panel = array(); |
— | — | @@ -616,10 +616,9 @@ |
617 | 617 | $extraOpts['category'] = $this->categoryFilterForm( $opts ); |
618 | 618 | } |
619 | 619 | |
620 | | - $tagFilter = ChangeTags::buildTagFilterWithDropdown( 'tag-filter-dropdown-list', |
621 | | - $opts['tagfilter'], $opts['tagfilterdropdown'] ); |
| 620 | + $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] ); |
622 | 621 | if ( count( $tagFilter ) ) { |
623 | | - $extraOpts['tagfilter'] = implode( ' ', $tagFilter ); |
| 622 | + $extraOpts['tagfilter'] = $tagFilter; |
624 | 623 | } |
625 | 624 | |
626 | 625 | wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) ); |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -103,7 +103,6 @@ |
104 | 104 | $this->opts['nsInvert'] = (bool) $request->getVal( 'nsInvert' ); |
105 | 105 | |
106 | 106 | $this->opts['tagfilter'] = (string) $request->getVal( 'tagfilter' ); |
107 | | - $this->opts['tagfilterdropdown'] = (string) $request->getVal( 'tagfilterdropdown' ); |
108 | 107 | |
109 | 108 | // Allows reverts to have the bot flag in recent changes. It is just here to |
110 | 109 | // be passed in the form at the top of the page |
— | — | @@ -139,9 +138,6 @@ |
140 | 139 | if ( $this->opts['tagfilter'] !== '' ) { |
141 | 140 | $apiParams['tagfilter'] = $this->opts['tagfilter']; |
142 | 141 | } |
143 | | - if ( $this->opts['tagfilterdropdown'] !== '' && $this->opts['tagfilterdropdown'] !== 'other' ) { |
144 | | - $apiParams['tagfilter'] = $this->opts['tagfilterdropdown']; |
145 | | - } |
146 | 142 | if ( $this->opts['namespace'] !== '' ) { |
147 | 143 | $apiParams['namespace'] = $this->opts['namespace']; |
148 | 144 | } |
— | — | @@ -403,11 +399,7 @@ |
404 | 400 | $form .= "\t" . Html::hidden( $name, $value ) . "\n"; |
405 | 401 | } |
406 | 402 | |
407 | | - $tagFilter = ChangeTags::buildTagFilterWithDropdown( |
408 | | - 'tag-filter-dropdown-list', |
409 | | - $this->opts['tagfilter'], |
410 | | - $this->opts['tagfilterdropdown'] |
411 | | - ); |
| 403 | + $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); |
412 | 404 | |
413 | 405 | if ( $tagFilter ) { |
414 | 406 | $filterSelection = |
Index: trunk/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -4428,13 +4428,7 @@ |
4429 | 4429 | 'tags-hitcount' => 'Shown in the “Tagged changes” column in [[Special:Tags]]. For more information on tags see [//www.mediawiki.org/wiki/Manual:Tags Mediawiki]. |
4430 | 4430 | |
4431 | 4431 | * <code>$1</code> is the number of changes marked with the tag', |
4432 | | -'tag-filter-dropdown-list' => 'A list of change tags to put in a dropdown list for selecting a tag to filter by.', |
4433 | | -'tag-filter-newpages-dropdown-list' => 'A list of change tags to put in a dropdown list for selecting a tag to filter by on [[Special:NewPages]].', |
4434 | | -'tag-filter-dropdown-other' => 'The "other" option in the dropdown list for selecting a tag to filter by. When a user selects this, he can type any tag in the text field next to it. |
4435 | 4432 | |
4436 | | -{{Identical|Other}} |
4437 | | -', |
4438 | | - |
4439 | 4433 | # Special:ComparePages |
4440 | 4434 | 'comparepages' => 'The title of [[Special:ComparePages]]', |
4441 | 4435 | 'compare-selector' => 'Header of the form on [[Special:ComparePages]]', |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4634,9 +4634,6 @@ |
4635 | 4635 | 'tags-hitcount-header' => 'Tagged changes', |
4636 | 4636 | 'tags-edit' => 'edit', |
4637 | 4637 | 'tags-hitcount' => '$1 {{PLURAL:$1|change|changes}}', |
4638 | | -'tag-filter-dropdown-other' => 'Other:', |
4639 | | -'tag-filter-dropdown-list' => '', |
4640 | | -'tag-filter-newpages-dropdown-list' => '', |
4641 | 4638 | |
4642 | 4639 | # Special:ComparePages |
4643 | 4640 | 'comparepages' => 'Compare pages', |