protected function checkCanExecute( User $user ) {
// Must be logged in
if ( $user->isAnon() ) {
- throw new ErrorPageError( 'watchnologin', 'watchnologintext' );
+ $loginreqlink = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Userlogin' ),
+ $this->msg( 'loginreqlink' )->escaped(),
+ array(),
+ array( 'returnto' => $this->getPageTitle(), 'returntoquery' => 'action=' . $this->getName() )
+ );
+ $reasonMsg = $this->msg( 'watchlistanontext' )->rawParams( $loginreqlink );
+ throw new UserNotLoggedIn( $reasonMsg, 'watchnologin' );
}
return parent::checkCanExecute( $user );
"nowatchlist": "You have no items on your watchlist.",
"watchlistanontext": "Please $1 to view or edit items on your watchlist.",
"watchnologin": "Not logged in",
- "watchnologintext": "You must be [[Special:UserLogin|logged in]] to modify your watchlist.",
"addwatch": "Add to watchlist",
"addedwatchtext": "The page \"[[:$1]]\" has been added to your [[Special:Watchlist|watchlist]].\nFuture changes to this page and its associated talk page will be listed there.",
"removewatch": "Remove from watchlist",
"nowatchlist": "Displayed when there is no pages in the watchlist.",
"watchlistanontext": "Parameters:\n* $1 - a link to [[Special:UserLogin]] with {{msg-mw|loginreqlink}} as link description",
"watchnologin": "Used as error page title.\n\nThe error message for this title is:\n* {{msg-mw|Watchnologintext}}\n{{Identical|Not logged in}}",
- "watchnologintext": "Used as error message.\n\nThe title for this error is {{msg-mw|Watchnologin}}.",
"addwatch": "Link to a dialog box, displayed at the end of the list of categories at the foot of each page.\n\nSee also:\n* {{msg-mw|Removewatch}}",
"addedwatchtext": "Explanation shown when clicking on the {{msg-mw|Watch}} tab. Parameters:\n* $1 - page title\nSee also:\n* {{msg-mw|Addedwatch}}",
"removewatch": "Link to a dialog box, displayed at the end of the list of categories at the foot of each page.\n\nSee also:\n* {{msg-mw|Addwatch}}",