From f7c3539c55cfd83dd38649773d21b9889762f7ea Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 29 Dec 2006 12:43:01 +0000 Subject: [PATCH] * (bug 5827) Use full text for option link labels on Special:Watchlist * Clean up the option links code in SpecialWatchlist.php * Clean up the namespace form code in SpecialWatchlist.php --- RELEASE-NOTES | 1 + includes/SpecialWatchlist.php | 47 +++++++++++++++---------------- languages/messages/MessagesEn.php | 6 ++-- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bc5a5925e8..9d62ef8809 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -427,6 +427,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN a page using {{DEFAULTSORT}} * (bug 6449) Throw a more definitive error message when installation fails due to an invalid database name +* (bug 5827) Use full text for option link labels on Special:Watchlist == Languages updated == diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 1f75a8da3f..0a3cb9e337 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -306,36 +306,35 @@ function wfSpecialWatchlist( $par ) { $thisTitle = SpecialPage::getTitleFor( 'Watchlist' ); $skin = $wgUser->getSkin(); - # Problems encountered using the fancier method - $label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ); + # Hide/show bot edits + $label = $hideBots ? wfMsgHtml( 'watchlist-show-bots' ) : wfMsgHtml( 'watchlist-hide-bots' ); $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults ); - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); - $links[] = wfMsgHtml( 'wlhideshowbots', $link ); - - $label = $hideOwn ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ); + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + + # Hide/show own edits + $label = $hideOwn ? wfMsgHtml( 'watchlist-show-own' ) : wfMsgHtml( 'watchlist-hide-own' ); $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults ); - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); - $links[] = wfMsgHtml( 'wlhideshowown', $link ); + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); $wgOut->addHTML( implode( ' | ', $links ) ); # Form for namespace filtering - $wgOut->addHTML( "\n" . - wfOpenElement( 'form', array( - 'method' => 'post', - 'action' => $thisTitle->getLocalURL(), - ) ) . - wfMsgExt( 'namespace', array( 'parseinline') ) . - HTMLnamespaceselector( $nameSpace, '' ) . "\n" . - ( $hideOwn ? wfHidden('hideown', 1)."\n" : '' ) . - ( $hideBots ? wfHidden('hidebots', 1)."\n" : '' ) . - wfHidden( 'days', $days ) . "\n" . - wfSubmitButton( wfMsgExt( 'allpagessubmit', array( 'escape') ) ) . "\n" . - wfCloseElement( 'form' ) . "\n" - ); - - if ( $numRows == 0 ) { - $wgOut->addWikitext( "
" . wfMsg( 'watchnochange' ), false ); + $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl() ) ); + $form .= '

'; + $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '; + $form .= Xml::namespaceSelector( $nameSpace, '' ) . ' '; + $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '

'; + $form .= Xml::hidden( 'days', $days ); + if( $hideOwn ) + $form .= Xml::hidden( 'hideOwn', 1 ); + if( $hideBots ) + $form .= Xml::hidden( 'hideBots', 1 ); + $form .= Xml::closeElement( 'form' ); + $wgOut->addHtml( $form ); + + # If there's nothing to show, stop here + if( $numRows == 0 ) { + $wgOut->addWikiText( wfMsgNoTrans( 'watchnochange' ) ); return; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f597086613..5b3732e160 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1631,8 +1631,10 @@ at the bottom of the screen (deleting a content page also deletes the accompanyi 'wlnote' => 'Below are the last $1 changes in the last $2 hours.', 'wlshowlast' => 'Show last $1 hours $2 days $3', 'wlsaved' => 'This is a saved version of your watchlist.', -'wlhideshowown' => '$1 my edits', -'wlhideshowbots' => '$1 bot edits', +'watchlist-show-bots' => 'Show bot edits', +'watchlist-hide-bots' => 'Hide bot edits', +'watchlist-show-own' => 'Show my edits', +'watchlist-hide-own' => 'Hide my edits', 'wldone' => 'Done.', # Displayed when you click the "watch" button and it's in the process of watching 'watching' => 'Watching...', -- 2.20.1