Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2145,7 +2145,13 @@ |
2146 | 2146 | 'watchlistedit-raw-done', |
2147 | 2147 | 'watchlistedit-raw-added', |
2148 | 2148 | 'watchlistedit-raw-removed', |
2149 | | - ), |
| 2149 | + ), |
| 2150 | + 'watchlisttools' => array( |
| 2151 | + 'watchlisttools-view', |
| 2152 | + 'watchlisttools-edit', |
| 2153 | + 'watchlisttools-raw', |
| 2154 | + 'watchlisttools-clear', |
| 2155 | + ), |
2150 | 2156 | ); |
2151 | 2157 | /** Comments for each block */ |
2152 | 2158 | $wgBlockComments = array( |
— | — | @@ -2313,6 +2319,7 @@ |
2314 | 2320 | 'livepreview' => 'Live preview', |
2315 | 2321 | 'lagwarning' => 'Friendlier slave lag warnings', |
2316 | 2322 | 'watchlisteditor' => 'Watchlist editor', |
| 2323 | + 'watchlisttools' => 'Watchlist editing tools', |
2317 | 2324 | ); |
2318 | 2325 | |
2319 | 2326 | /** Short comments for standalone messages */ |
Index: trunk/phase3/includes/WatchlistEditor.php |
— | — | @@ -467,5 +467,23 @@ |
468 | 468 | return false; |
469 | 469 | } |
470 | 470 | } |
| 471 | + |
| 472 | + /** |
| 473 | + * Build a set of links for convenient navigation |
| 474 | + * between watchlist viewing and editing modes |
| 475 | + * |
| 476 | + * @param Skin $skin Skin to use |
| 477 | + * @return string |
| 478 | + */ |
| 479 | + public static function buildTools( $skin ) { |
| 480 | + $tools = array(); |
| 481 | + $self = SpecialPage::getTitleFor( 'Watchlist' ); |
| 482 | + $modes = array( 'view' => '', 'edit' => 'edit', 'raw' => 'raw', 'clear' => 'clear' ); |
| 483 | + foreach( $modes as $mode => $action ) { |
| 484 | + $action = $action ? "action={$action}" : ''; |
| 485 | + $tools[] = $skin->makeKnownLinkObj( $self, wfMsgHtml( "watchlisttools-{$mode}" ), $action ); |
| 486 | + } |
| 487 | + return implode( ' | ', $tools ); |
| 488 | + } |
471 | 489 | |
472 | 490 | } |
Index: trunk/phase3/includes/SpecialWatchlist.php |
— | — | @@ -30,17 +30,20 @@ |
31 | 31 | $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() ); |
32 | 32 | $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) ); |
33 | 33 | return; |
34 | | - } else { |
35 | | - $wgOut->setPageTitle( wfMsg( 'watchlist' ) ); |
36 | | - $wgOut->setSubtitle( wfMsgWikiHtml( 'watchlistfor', htmlspecialchars( $wgUser->getName() ) ) ); |
37 | 34 | } |
| 35 | + |
| 36 | + $wgOut->setPageTitle( wfMsg( 'watchlist' ) ); |
| 37 | + |
| 38 | + $sub = wfMsgExt( 'watchlistfor', 'parseinline', $wgUser->getName() ); |
| 39 | + $sub .= '<br />' . WatchlistEditor::buildTools( $wgUser->getSkin() ); |
| 40 | + $wgOut->setSubtitle( $sub ); |
38 | 41 | |
39 | 42 | if( ( $mode = WatchlistEditor::getMode( $wgRequest, $par ) ) !== false ) { |
40 | 43 | $editor = new WatchlistEditor(); |
41 | 44 | $editor->execute( $wgUser, $wgOut, $wgRequest, $mode ); |
42 | 45 | return; |
43 | 46 | } |
44 | | - |
| 47 | + |
45 | 48 | $uid = $wgUser->getId(); |
46 | 49 | if( $wgEnotifWatchlist && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) { |
47 | 50 | $wgUser->clearAllNotifications( $uid ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2914,4 +2914,10 @@ |
2915 | 2915 | 'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} added:', |
2916 | 2916 | 'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} removed:', |
2917 | 2917 | |
| 2918 | +# Watchlist editing tools |
| 2919 | +'watchlisttools-view' => 'View watchlist', |
| 2920 | +'watchlisttools-edit' => 'Edit watchlist', |
| 2921 | +'watchlisttools-raw' => 'Edit raw watchlist', |
| 2922 | +'watchlisttools-clear' => 'Clear watchlist', |
| 2923 | + |
2918 | 2924 | ); |