* (bug 5827) Use full text for option link labels on Special:Watchlist
authorRob Church <robchurch@users.mediawiki.org>
Fri, 29 Dec 2006 12:43:01 +0000 (12:43 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 29 Dec 2006 12:43:01 +0000 (12:43 +0000)
* Clean up the option links code in SpecialWatchlist.php
* Clean up the namespace form code in SpecialWatchlist.php

RELEASE-NOTES
includes/SpecialWatchlist.php
languages/messages/MessagesEn.php

index bc5a592..9d62ef8 100644 (file)
@@ -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 ==
 
index 1f75a8d..0a3cb9e 100644 (file)
@@ -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( "<br />" . wfMsg( 'watchnochange' ), false );
+       $form  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl() ) );
+       $form .= '<p>';
+       $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&nbsp;';
+       $form .= Xml::namespaceSelector( $nameSpace, '' ) . '&nbsp;';
+       $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
+       $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;
        }
 
index f597086..5b3732e 100644 (file)
@@ -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 <b>$2</b> 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...',