r13870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13869‎ | r13870 | r13871 >
Date:09:30, 26 April 2006
Author:robchurch
Status:old
Tags:
Comment:
Pass login link to "whitelistedittext" containing 'returnto' parameter
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/languages/Messages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1313,13 +1313,16 @@
13141314 * @todo document
13151315 */
13161316 function userNotLoggedInPage() {
1317 - global $wgOut;
1318 -
 1317+ global $wgUser, $wgOut;
 1318+ $skin = $wgUser->getSkin();
 1319+ $loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
 1320+ $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedText() );
 1321+
13191322 $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
13201323 $wgOut->setRobotpolicy( 'noindex,nofollow' );
13211324 $wgOut->setArticleRelated( false );
1322 -
1323 - $wgOut->addWikiText( wfMsg( 'whitelistedittext' ) );
 1325+
 1326+ $wgOut->addHtml( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
13241327 $wgOut->returnToMain( false );
13251328 }
13261329
Index: trunk/phase3/languages/Messages.php
@@ -371,6 +371,7 @@
372372 'alreadyloggedin' => "<strong>User $1, you are already logged in!</strong><br />",
373373
374374 'login' => 'Log in',
 375+'loginshort' => 'log in',
375376 'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.',
376377 'userlogin' => 'Log in / create account',
377378 'logout' => 'Log out',
@@ -481,7 +482,7 @@
482483
483484 Your IP address is $3. Please include this address in any queries you make.',
484485 'whitelistedittitle' => 'Login required to edit',
485 -'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to edit pages.',
 486+'whitelistedittext' => 'You have to $1 to edit pages.',
486487 'whitelistreadtitle' => 'Login required to read',
487488 'whitelistreadtext' => 'You have to [[Special:Userlogin|login]] to read pages.',
488489 'whitelistacctitle' => 'You are not allowed to create an account',
@@ -489,7 +490,7 @@
490491 'confirmedittitle' => 'E-mail confirmation required to edit',
491492 'confirmedittext' => 'You must confirm your e-mail address before editing pages. Please set and validate your e-mail address through your [[Special:Preferences|user preferences]].',
492493 'loginreqtitle' => 'Login Required',
493 -'loginreqlink' => 'login',
 494+'loginreqlink' => 'log in',
494495 'loginreqpagetext' => 'You must $1 to view other pages.',
495496 'accmailtitle' => 'Password sent.',
496497 'accmailtext' => 'The password for "$1" has been sent to $2.',

Status & tagging log