r18632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18631‎ | r18632 | r18633 >
Date:12:43, 29 December 2006
Author:robchurch
Status:old
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -306,36 +306,35 @@
307307 $thisTitle = SpecialPage::getTitleFor( 'Watchlist' );
308308 $skin = $wgUser->getSkin();
309309
310 - # Problems encountered using the fancier method
311 - $label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
 310+ # Hide/show bot edits
 311+ $label = $hideBots ? wfMsgHtml( 'watchlist-show-bots' ) : wfMsgHtml( 'watchlist-hide-bots' );
312312 $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
313 - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
314 - $links[] = wfMsgHtml( 'wlhideshowbots', $link );
315 -
316 - $label = $hideOwn ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
 313+ $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
 314+
 315+ # Hide/show own edits
 316+ $label = $hideOwn ? wfMsgHtml( 'watchlist-show-own' ) : wfMsgHtml( 'watchlist-hide-own' );
317317 $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
318 - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
319 - $links[] = wfMsgHtml( 'wlhideshowown', $link );
 318+ $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
320319
321320 $wgOut->addHTML( implode( ' | ', $links ) );
322321
323322 # Form for namespace filtering
324 - $wgOut->addHTML( "\n" .
325 - wfOpenElement( 'form', array(
326 - 'method' => 'post',
327 - 'action' => $thisTitle->getLocalURL(),
328 - ) ) .
329 - wfMsgExt( 'namespace', array( 'parseinline') ) .
330 - HTMLnamespaceselector( $nameSpace, '' ) . "\n" .
331 - ( $hideOwn ? wfHidden('hideown', 1)."\n" : '' ) .
332 - ( $hideBots ? wfHidden('hidebots', 1)."\n" : '' ) .
333 - wfHidden( 'days', $days ) . "\n" .
334 - wfSubmitButton( wfMsgExt( 'allpagessubmit', array( 'escape') ) ) . "\n" .
335 - wfCloseElement( 'form' ) . "\n"
336 - );
 323+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl() ) );
 324+ $form .= '<p>';
 325+ $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&nbsp;';
 326+ $form .= Xml::namespaceSelector( $nameSpace, '' ) . '&nbsp;';
 327+ $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
 328+ $form .= Xml::hidden( 'days', $days );
 329+ if( $hideOwn )
 330+ $form .= Xml::hidden( 'hideOwn', 1 );
 331+ if( $hideBots )
 332+ $form .= Xml::hidden( 'hideBots', 1 );
 333+ $form .= Xml::closeElement( 'form' );
 334+ $wgOut->addHtml( $form );
337335
338 - if ( $numRows == 0 ) {
339 - $wgOut->addWikitext( "<br />" . wfMsg( 'watchnochange' ), false );
 336+ # If there's nothing to show, stop here
 337+ if( $numRows == 0 ) {
 338+ $wgOut->addWikiText( wfMsgNoTrans( 'watchnochange' ) );
340339 return;
341340 }
342341
Index: trunk/phase3/RELEASE-NOTES
@@ -427,6 +427,7 @@
428428 a page using {{DEFAULTSORT}}
429429 * (bug 6449) Throw a more definitive error message when installation fails
430430 due to an invalid database name
 431+* (bug 5827) Use full text for option link labels on Special:Watchlist
431432
432433 == Languages updated ==
433434
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1631,8 +1631,10 @@
16321632 'wlnote' => 'Below are the last $1 changes in the last <b>$2</b> hours.',
16331633 'wlshowlast' => 'Show last $1 hours $2 days $3',
16341634 'wlsaved' => 'This is a saved version of your watchlist.',
1635 -'wlhideshowown' => '$1 my edits',
1636 -'wlhideshowbots' => '$1 bot edits',
 1635+'watchlist-show-bots' => 'Show bot edits',
 1636+'watchlist-hide-bots' => 'Hide bot edits',
 1637+'watchlist-show-own' => 'Show my edits',
 1638+'watchlist-hide-own' => 'Hide my edits',
16371639 'wldone' => 'Done.',
16381640 # Displayed when you click the "watch" button and it's in the process of watching
16391641 'watching' => 'Watching...',

Follow-up revisions

RevisionCommit summaryAuthorDate
r18633French and German updates for r18632robchurch12:54, 29 December 2006
r18634Spanish for r18632robchurch12:59, 29 December 2006