From 0ba9bbf172f3bb862e0eefb372f0584d3beb3864 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 28 Jun 2006 15:09:21 +0000 Subject: [PATCH] * Show a more specific message when an anonymous user tries to access Special:Watchlist * Tweak the default watchlist subtitle text --- RELEASE-NOTES | 1 + includes/SpecialWatchlist.php | 15 +++++++++------ languages/Messages.php | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8f25e35c75..bbfd8787e9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index dc1277ad64..5b1e2890d3 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -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 ) ) { diff --git a/languages/Messages.php b/languages/Messages.php index e8a729c736..007f4c3dd2 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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?', -- 2.20.1