$llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
$wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
return;
- } else {
- $wgOut->setPageTitle( wfMsg( 'watchlist' ) );
- $wgOut->setSubtitle( wfMsgWikiHtml( 'watchlistfor', htmlspecialchars( $wgUser->getName() ) ) );
}
+
+ $wgOut->setPageTitle( wfMsg( 'watchlist' ) );
+
+ $sub = wfMsgExt( 'watchlistfor', 'parseinline', $wgUser->getName() );
+ $sub .= '<br />' . WatchlistEditor::buildTools( $wgUser->getSkin() );
+ $wgOut->setSubtitle( $sub );
if( ( $mode = WatchlistEditor::getMode( $wgRequest, $par ) ) !== false ) {
$editor = new WatchlistEditor();
$editor->execute( $wgUser, $wgOut, $wgRequest, $mode );
return;
}
-
+
$uid = $wgUser->getId();
if( $wgEnotifWatchlist && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
$wgUser->clearAllNotifications( $uid );
return false;
}
}
+
+ /**
+ * Build a set of links for convenient navigation
+ * between watchlist viewing and editing modes
+ *
+ * @param Skin $skin Skin to use
+ * @return string
+ */
+ public static function buildTools( $skin ) {
+ $tools = array();
+ $self = SpecialPage::getTitleFor( 'Watchlist' );
+ $modes = array( 'view' => '', 'edit' => 'edit', 'raw' => 'raw', 'clear' => 'clear' );
+ foreach( $modes as $mode => $action ) {
+ $action = $action ? "action={$action}" : '';
+ $tools[] = $skin->makeKnownLinkObj( $self, wfMsgHtml( "watchlisttools-{$mode}" ), $action );
+ }
+ return implode( ' | ', $tools );
+ }
}
'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} added:',
'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} removed:',
+# Watchlist editing tools
+'watchlisttools-view' => 'View watchlist',
+'watchlisttools-edit' => 'Edit watchlist',
+'watchlisttools-raw' => 'Edit raw watchlist',
+'watchlisttools-clear' => 'Clear watchlist',
+
);
'watchlistedit-raw-done',
'watchlistedit-raw-added',
'watchlistedit-raw-removed',
- ),
+ ),
+ 'watchlisttools' => array(
+ 'watchlisttools-view',
+ 'watchlisttools-edit',
+ 'watchlisttools-raw',
+ 'watchlisttools-clear',
+ ),
);
/** Comments for each block */
$wgBlockComments = array(
'livepreview' => 'Live preview',
'lagwarning' => 'Friendlier slave lag warnings',
'watchlisteditor' => 'Watchlist editor',
+ 'watchlisttools' => 'Watchlist editing tools',
);
/** Short comments for standalone messages */