* Show a more specific message when an anonymous user tries to access Special:Watchlist
authorRob Church <robchurch@users.mediawiki.org>
Wed, 28 Jun 2006 15:09:21 +0000 (15:09 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 28 Jun 2006 15:09:21 +0000 (15:09 +0000)
* Tweak the default watchlist subtitle text

RELEASE-NOTES
includes/SpecialWatchlist.php
languages/Messages.php

index 8f25e35..bbfd878 100644 (file)
@@ -586,6 +586,7 @@ Some default configuration options have changed:
 * Fix transwiki import of pages with space in name
 * Save null edit when importing pages through Special:Import
 * Update to Korean translation (ko)
+* Show a more specific message when an anonymous user tries to access Special:Watchlist
 
 == Compatibility ==
 
index dc1277a..5b1e289 100644 (file)
@@ -22,16 +22,19 @@ function wfSpecialWatchlist( $par ) {
        global $wgEnotifWatchlist;
        $fname = 'wfSpecialWatchlist';
 
-       $wgOut->setPagetitle( wfMsg( 'watchlist' ) );
-       $sub = htmlspecialchars( wfMsg( 'watchlistsub', $wgUser->getName() ) );
-       $wgOut->setSubtitle( $sub );
-       $wgOut->setRobotpolicy( 'noindex,nofollow' );
-
+       $skin =& $wgUser->getSkin();
        $specialTitle = Title::makeTitle( NS_SPECIAL, 'Watchlist' );
+       $wgOut->setRobotPolicy( 'noindex,nofollow' );
 
+       # Anons don't get a watchlist
        if( $wgUser->isAnon() ) {
-               $wgOut->addWikiText( wfMsg( 'nowatchlist' ) );
+               $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
+               $llink = $skin->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
+               $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
                return;
+       } else {
+               $wgOut->setPageTitle( wfMsg( 'watchlist' ) );
+               $wgOut->setSubtitle( wfMsgWikiHtml( 'watchlistfor', htmlspecialchars( $wgUser->getName() ) ) );
        }
 
        if( wlHandleClear( $wgOut, $wgRequest, $par ) ) {
index e8a729c..007f4c3 100644 (file)
@@ -1045,10 +1045,10 @@ or has chosen not to receive e-mail from other users.',
 'emailsenttext' => 'Your e-mail message has been sent.',
 
 # Watchlist
-#
 'watchlist'                    => 'My watchlist',
-'watchlistsub'         => "(for user \"$1\")",
+'watchlistfor' => "(for '''$1''')",
 'nowatchlist'          => 'You have no items on your watchlist.',
+'watchlistanontext' => 'Please $1 to view or edit items on your watchlist.',
 'watchlistcount'       => "'''You have $1 items on your watchlist, including talk pages.'''",
 'clearwatchlist'       => 'Clear watchlist',
 'watchlistcleartext' => 'Are you sure you wish to remove them?',