From: Rob Moen Date: Fri, 13 Jan 2012 21:57:52 +0000 (+0000) Subject: reverted r108850 as patch should be introduced after code freeze X-Git-Tag: 1.31.0-rc.0~25295 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=4206e23d19e257ec94001dcfdd5ff18fc22d0e7b;p=lhc%2Fweb%2Fwiklou.git reverted r108850 as patch should be introduced after code freeze --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 66e854f6b5..4b005bd470 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -119,7 +119,6 @@ production. * mediawiki.js Message object constructor is now publicly available as mw.Message. * (bug 29309) allow CSS class per tooltip (tipsy) * (bug 33565) Add accesskey/tooltip to submit buttons on Special:EditWatchlist. -* (bug 25909) Add a drop-down list for the tags in Recentchanges and Newpages === Bug fixes in 1.19 === * $wgUploadNavigationUrl should be used for file redlinks if. diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index 97d12a4237..c8e522dfec 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -26,7 +26,7 @@ class ChangeTags { static function tagDescription( $tag ) { $msg = wfMessage( "tag-$tag" ); - return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag ); + return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag ); } ## Basic utility method to add tags to a particular change, given its rc_id, rev_id and/or log_id. @@ -109,10 +109,7 @@ class ChangeTags { global $wgRequest, $wgUseTagFilter; if( $filter_tag === false ) { - $filter_tag = $wgRequest->getVal( 'tagfilterdropdown', '' ); - if ( $filter_tag === '' || $filter_tag === 'other' ) { - $filter_tag = $wgRequest->getVal( 'tagfilter' ); - } + $filter_tag = $wgRequest->getVal( 'tagfilter' ); } // Figure out which conditions can be done. @@ -180,45 +177,6 @@ class ChangeTags { return $html; } - /** - * Build a text box and a dropdown list to select a change tag - * - * @param $msgkey String: message key for the message where a (newline delimited) - * list of tags can be specified. These tags will be put in the dropdown list. - * If the specified message is empty, only the text field will be returned. - * @param $selectedtxt String: tag to put in text box - * @param $selecteddropdown String: tag to select in dropdown - * @return Array of html fragments of which the first element is the label - * If $wgUseTagFilter is false or there are no defined tags, an empty array is returned - */ - public static function buildTagFilterWithDropdown( $msgkey, $selectedtxt = '', $selecteddropdown = 'other' ) { - - global $wgUseTagFilter; - - $definedtags = self::listDefinedTags(); - - if ( !$wgUseTagFilter || !count( $definedtags ) ) { - // no tag filter if there are no tags defined or $wgUseTagFilter is false - return array(); - } - - // Extract tags from message: one tag per line - $tags = preg_split( "/\n/", wfMsgForContent( $msgkey ), -1, PREG_SPLIT_NO_EMPTY); - - $data[] = Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMsgExt( 'tag-filter', 'parseinline' ) ); - - if ( count( $tags ) ) { - // Add dropdown list only when message $msgkey contains at least one tag - $data[] = Xml::listDropDown( 'tagfilterdropdown', implode( "\n", $tags ), - wfMsgForContent( 'tag-filter-dropdown-other' ), $selecteddropdown ); - } - - $data[] = Xml::input( 'tagfilter', 20, $selectedtxt ); - - return $data; - - } - /** *Basically lists defined tags which count even if they aren't applied to anything * diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 29b4eb93db..c463eed248 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -136,13 +136,7 @@ class HistoryAction extends FormlessAction { $year = $request->getInt( 'year' ); $month = $request->getInt( 'month' ); $tagFilter = $request->getVal( 'tagfilter' ); - $tagFilterDropdown = $request->getVal( 'tagfilterdropdown' ); - $tagSelector = ChangeTags::buildTagFilterWithDropdown( - 'tag-filter-dropdown-list', - $tagFilter, - $tagFilterDropdown - ); - $tagSelector = implode( ' ', $tagSelector ); + $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); /** * Option to show only revisions that have been (partially) hidden via RevisionDelete @@ -167,26 +161,14 @@ class HistoryAction extends FormlessAction { Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" . Html::hidden( 'action', 'history' ) . "\n" . Xml::dateMenu( $year, $month ) . ' ' . - Html::rawElement( - 'span', - array( 'style' => 'white-space: nowrap' ), - ( $tagSelector ? ( $tagSelector . ' ' ) : '' ) - ) . - Html::rawElement( - 'span', - array( 'style' => 'white-space: nowrap' ), - $checkDeleted - ) . + ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . + $checkDeleted . Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" . '' ); wfRunHooks( 'PageHistoryBeforeList', array( &$this->page ) ); - if ( $tagFilterDropdown !== '' && $tagFilterDropdown !== 'other' ) { - $tagFilter = $tagFilterDropdown; - } - // Create and output the list. $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds ); $out->addHTML( diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index a0482045e6..865295bfff 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -103,7 +103,6 @@ class SpecialContributions extends SpecialPage { $this->opts['nsInvert'] = (bool) $request->getVal( 'nsInvert' ); $this->opts['tagfilter'] = (string) $request->getVal( 'tagfilter' ); - $this->opts['tagfilterdropdown'] = (string) $request->getVal( 'tagfilterdropdown' ); // Allows reverts to have the bot flag in recent changes. It is just here to // be passed in the form at the top of the page @@ -139,9 +138,6 @@ class SpecialContributions extends SpecialPage { if ( $this->opts['tagfilter'] !== '' ) { $apiParams['tagfilter'] = $this->opts['tagfilter']; } - if ( $this->opts['tagfilterdropdown'] !== '' && $this->opts['tagfilterdropdown'] !== 'other' ) { - $apiParams['tagfilter'] = $this->opts['tagfilterdropdown']; - } if ( $this->opts['namespace'] !== '' ) { $apiParams['namespace'] = $this->opts['namespace']; } @@ -403,11 +399,7 @@ class SpecialContributions extends SpecialPage { $form .= "\t" . Html::hidden( $name, $value ) . "\n"; } - $tagFilter = ChangeTags::buildTagFilterWithDropdown( - 'tag-filter-dropdown-list', - $this->opts['tagfilter'], - $this->opts['tagfilterdropdown'] - ); + $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); if ( $tagFilter ) { $filterSelection = diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 8fa0501835..ecec87de53 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -59,7 +59,6 @@ class SpecialNewpages extends IncludableSpecialPage { $opts->add( 'username', '' ); $opts->add( 'feed', '' ); $opts->add( 'tagfilter', '' ); - $opts->add( 'tagfilterdropdown', '' ); $this->customFilters = array(); wfRunHooks( 'SpecialNewPagesFilters', array( $this, &$this->customFilters ) ); @@ -212,7 +211,6 @@ class SpecialNewpages extends IncludableSpecialPage { $namespace = $this->opts->consumeValue( 'namespace' ); $username = $this->opts->consumeValue( 'username' ); $tagFilterVal = $this->opts->consumeValue( 'tagfilter' ); - $tagFilterDropdownVal = $this->opts->consumeValue( 'tagfilterdropdown' ); // Check username input validity $ut = Title::makeTitleSafe( NS_USER, $username ); @@ -225,14 +223,9 @@ class SpecialNewpages extends IncludableSpecialPage { } $hidden = implode( "\n", $hidden ); - $tagFilter = ChangeTags::buildTagFilterWithDropdown( - 'tag-filter-newpages-dropdown-list', - $tagFilterVal, - $tagFilterDropdownVal - ); + $tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal ); if ( $tagFilter ) { - $tagFilterLabel = array_shift( $tagFilter ); - $tagFilterSelector = implode( ' ', $tagFilter ); + list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter; } $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . @@ -540,7 +533,8 @@ class NewPagesPager extends ReverseChronologicalPager { $fields, $info['conds'], $info['join_conds'], - $info['options'] + $info['options'], + $this->opts['tagfilter'] ); return $info; diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 19c1bd93f5..067a95644f 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -60,7 +60,6 @@ class SpecialRecentChanges extends IncludableSpecialPage { $opts->add( 'categories', '' ); $opts->add( 'categories_any', false ); $opts->add( 'tagfilter', '' ); - $opts->add( 'tagfilterdropdown', '' ); return $opts; } @@ -401,7 +400,8 @@ class SpecialRecentChanges extends IncludableSpecialPage { // Tag stuff. // Doesn't work when transcluding. See bug 23293 ChangeTags::modifyDisplayQuery( - $tables, $fields, $conds, $join_conds, $query_options + $tables, $fields, $conds, $join_conds, $query_options, + $opts['tagfilter'] ); } @@ -554,7 +554,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $nondefaults = $opts->getChangedValues(); $opts->consumeValues( array( 'namespace', 'invert', 'associated', 'tagfilter', - 'categories', 'categories_any', 'tagfilterdropdown' + 'categories', 'categories_any' ) ); $panel = array(); @@ -616,10 +616,9 @@ class SpecialRecentChanges extends IncludableSpecialPage { $extraOpts['category'] = $this->categoryFilterForm( $opts ); } - $tagFilter = ChangeTags::buildTagFilterWithDropdown( 'tag-filter-dropdown-list', - $opts['tagfilter'], $opts['tagfilterdropdown'] ); + $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] ); if ( count( $tagFilter ) ) { - $extraOpts['tagfilter'] = implode( ' ', $tagFilter ); + $extraOpts['tagfilter'] = $tagFilter; } wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 64fb8291ff..68f60cd61b 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4634,9 +4634,6 @@ Images are shown in full resolution, other file types are started with their ass 'tags-hitcount-header' => 'Tagged changes', 'tags-edit' => 'edit', 'tags-hitcount' => '$1 {{PLURAL:$1|change|changes}}', -'tag-filter-dropdown-other' => 'Other:', -'tag-filter-dropdown-list' => '', -'tag-filter-newpages-dropdown-list' => '', # Special:ComparePages 'comparepages' => 'Compare pages', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index afe8df16f8..c1e574454c 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -4428,12 +4428,6 @@ Used on [[Special:Tags]]. Verb. Used as display text on a link to create/edit a 'tags-hitcount' => 'Shown in the “Tagged changes” column in [[Special:Tags]]. For more information on tags see [//www.mediawiki.org/wiki/Manual:Tags Mediawiki]. * $1 is the number of changes marked with the tag', -'tag-filter-dropdown-list' => 'A list of change tags to put in a dropdown list for selecting a tag to filter by.', -'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]].', -'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. - -{{Identical|Other}} -', # Special:ComparePages 'comparepages' => 'The title of [[Special:ComparePages]]',