r108857 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108856‎ | r108857 | r108858 >
Date:21:57, 13 January 2012
Author:rmoen
Status:ok
Tags:
Comment:
reverted r108850 as patch should be introduced after code freeze
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/ChangeTags.php (modified) (history)
  • /trunk/phase3/includes/actions/HistoryAction.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -119,7 +119,6 @@
120120 * mediawiki.js Message object constructor is now publicly available as mw.Message.
121121 * (bug 29309) allow CSS class per tooltip (tipsy)
122122 * (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
124123
125124 === Bug fixes in 1.19 ===
126125 * $wgUploadNavigationUrl should be used for file redlinks if.
Index: trunk/phase3/includes/ChangeTags.php
@@ -26,7 +26,7 @@
2727
2828 static function tagDescription( $tag ) {
2929 $msg = wfMessage( "tag-$tag" );
30 - return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag );
 30+ return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag );
3131 }
3232
3333 ## Basic utility method to add tags to a particular change, given its rc_id, rev_id and/or log_id.
@@ -109,10 +109,7 @@
110110 global $wgRequest, $wgUseTagFilter;
111111
112112 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' );
117114 }
118115
119116 // Figure out which conditions can be done.
@@ -181,45 +178,6 @@
182179 }
183180
184181 /**
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 - /**
224182 *Basically lists defined tags which count even if they aren't applied to anything
225183 *
226184 * @return array
Index: trunk/phase3/includes/actions/HistoryAction.php
@@ -136,13 +136,7 @@
137137 $year = $request->getInt( 'year' );
138138 $month = $request->getInt( 'month' );
139139 $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 );
147141
148142 /**
149143 * Option to show only revisions that have been (partially) hidden via RevisionDelete
@@ -167,26 +161,14 @@
168162 Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" .
169163 Html::hidden( 'action', 'history' ) . "\n" .
170164 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 .
181167 Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" .
182168 '</fieldset></form>'
183169 );
184170
185171 wfRunHooks( 'PageHistoryBeforeList', array( &$this->page ) );
186172
187 - if ( $tagFilterDropdown !== '' && $tagFilterDropdown !== 'other' ) {
188 - $tagFilter = $tagFilterDropdown;
189 - }
190 -
191173 // Create and output the list.
192174 $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
193175 $out->addHTML(
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -59,7 +59,6 @@
6060 $opts->add( 'username', '' );
6161 $opts->add( 'feed', '' );
6262 $opts->add( 'tagfilter', '' );
63 - $opts->add( 'tagfilterdropdown', '' );
6463
6564 $this->customFilters = array();
6665 wfRunHooks( 'SpecialNewPagesFilters', array( $this, &$this->customFilters ) );
@@ -212,7 +211,6 @@
213212 $namespace = $this->opts->consumeValue( 'namespace' );
214213 $username = $this->opts->consumeValue( 'username' );
215214 $tagFilterVal = $this->opts->consumeValue( 'tagfilter' );
216 - $tagFilterDropdownVal = $this->opts->consumeValue( 'tagfilterdropdown' );
217215
218216 // Check username input validity
219217 $ut = Title::makeTitleSafe( NS_USER, $username );
@@ -225,14 +223,9 @@
226224 }
227225 $hidden = implode( "\n", $hidden );
228226
229 - $tagFilter = ChangeTags::buildTagFilterWithDropdown(
230 - 'tag-filter-newpages-dropdown-list',
231 - $tagFilterVal,
232 - $tagFilterDropdownVal
233 - );
 227+ $tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal );
234228 if ( $tagFilter ) {
235 - $tagFilterLabel = array_shift( $tagFilter );
236 - $tagFilterSelector = implode( '&#160;', $tagFilter );
 229+ list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter;
237230 }
238231
239232 $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
@@ -540,7 +533,8 @@
541534 $fields,
542535 $info['conds'],
543536 $info['join_conds'],
544 - $info['options']
 537+ $info['options'],
 538+ $this->opts['tagfilter']
545539 );
546540
547541 return $info;
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -60,7 +60,6 @@
6161 $opts->add( 'categories', '' );
6262 $opts->add( 'categories_any', false );
6363 $opts->add( 'tagfilter', '' );
64 - $opts->add( 'tagfilterdropdown', '' );
6564 return $opts;
6665 }
6766
@@ -401,7 +400,8 @@
402401 // Tag stuff.
403402 // Doesn't work when transcluding. See bug 23293
404403 ChangeTags::modifyDisplayQuery(
405 - $tables, $fields, $conds, $join_conds, $query_options
 404+ $tables, $fields, $conds, $join_conds, $query_options,
 405+ $opts['tagfilter']
406406 );
407407 }
408408
@@ -554,7 +554,7 @@
555555 $nondefaults = $opts->getChangedValues();
556556 $opts->consumeValues( array(
557557 'namespace', 'invert', 'associated', 'tagfilter',
558 - 'categories', 'categories_any', 'tagfilterdropdown'
 558+ 'categories', 'categories_any'
559559 ) );
560560
561561 $panel = array();
@@ -616,10 +616,9 @@
617617 $extraOpts['category'] = $this->categoryFilterForm( $opts );
618618 }
619619
620 - $tagFilter = ChangeTags::buildTagFilterWithDropdown( 'tag-filter-dropdown-list',
621 - $opts['tagfilter'], $opts['tagfilterdropdown'] );
 620+ $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
622621 if ( count( $tagFilter ) ) {
623 - $extraOpts['tagfilter'] = implode( '&#160;', $tagFilter );
 622+ $extraOpts['tagfilter'] = $tagFilter;
624623 }
625624
626625 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -103,7 +103,6 @@
104104 $this->opts['nsInvert'] = (bool) $request->getVal( 'nsInvert' );
105105
106106 $this->opts['tagfilter'] = (string) $request->getVal( 'tagfilter' );
107 - $this->opts['tagfilterdropdown'] = (string) $request->getVal( 'tagfilterdropdown' );
108107
109108 // Allows reverts to have the bot flag in recent changes. It is just here to
110109 // be passed in the form at the top of the page
@@ -139,9 +138,6 @@
140139 if ( $this->opts['tagfilter'] !== '' ) {
141140 $apiParams['tagfilter'] = $this->opts['tagfilter'];
142141 }
143 - if ( $this->opts['tagfilterdropdown'] !== '' && $this->opts['tagfilterdropdown'] !== 'other' ) {
144 - $apiParams['tagfilter'] = $this->opts['tagfilterdropdown'];
145 - }
146142 if ( $this->opts['namespace'] !== '' ) {
147143 $apiParams['namespace'] = $this->opts['namespace'];
148144 }
@@ -403,11 +399,7 @@
404400 $form .= "\t" . Html::hidden( $name, $value ) . "\n";
405401 }
406402
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'] );
412404
413405 if ( $tagFilter ) {
414406 $filterSelection =
Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -4428,13 +4428,7 @@
44294429 'tags-hitcount' => 'Shown in the “Tagged changes” column in [[Special:Tags]]. For more information on tags see [//www.mediawiki.org/wiki/Manual:Tags Mediawiki].
44304430
44314431 * <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.
44354432
4436 -{{Identical|Other}}
4437 -',
4438 -
44394433 # Special:ComparePages
44404434 'comparepages' => 'The title of [[Special:ComparePages]]',
44414435 'compare-selector' => 'Header of the form on [[Special:ComparePages]]',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4634,9 +4634,6 @@
46354635 'tags-hitcount-header' => 'Tagged changes',
46364636 'tags-edit' => 'edit',
46374637 'tags-hitcount' => '$1 {{PLURAL:$1|change|changes}}',
4638 -'tag-filter-dropdown-other' => 'Other:',
4639 -'tag-filter-dropdown-list' => '',
4640 -'tag-filter-newpages-dropdown-list' => '',
46414638
46424639 # Special:ComparePages
46434640 'comparepages' => 'Compare pages',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108850patch from MrBlueSky, resloves bug 25909. Add dropdown list for tags in recen...rmoen21:24, 13 January 2012

Status & tagging log