r33554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33553‎ | r33554 | r33555 >
Date:15:46, 18 April 2008
Author:simetrical
Status:old
Tags:
Comment:
* Allow the "log in / create account" link in the toolbar to have different text from Special:UserLogin title (new message 'nav-login-createaccount')
* Say "log in / create account" if an anonymous user can create an account, otherwise just "log in", consistently across skins. (Currently Monobook always says "log in / create account " and non-Monobook always says "log in".)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -371,6 +371,7 @@
372372 'externaldberror',
373373 'loginproblem',
374374 'login',
 375+ 'nav-login-createaccount',
375376 'loginprompt',
376377 'userlogin',
377378 'logout',
Index: trunk/phase3/includes/SkinTemplate.php
@@ -543,6 +543,10 @@
544544 'active' => false
545545 );
546546 } else {
 547+ global $wgUser;
 548+ $loginlink = $wgUser->isAllowed( 'createaccount' )
 549+ ? 'nav-login-createaccount'
 550+ : 'login';
547551 if( $this->showIPinHeader() ) {
548552 $href = &$this->userpageUrlDetails['href'];
549553 $personal_urls['anonuserpage'] = array(
@@ -560,14 +564,14 @@
561565 'active' => ( $pageurl == $href )
562566 );
563567 $personal_urls['anonlogin'] = array(
564 - 'text' => wfMsg('userlogin'),
 568+ 'text' => wfMsg( $loginlink ),
565569 'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
566570 'active' => $wgTitle->isSpecial( 'Userlogin' )
567571 );
568572 } else {
569573
570574 $personal_urls['login'] = array(
571 - 'text' => wfMsg('userlogin'),
 575+ 'text' => wfMsg( $loginlink ),
572576 'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
573577 'active' => $wgTitle->isSpecial( 'Userlogin' )
574578 );
Index: trunk/phase3/includes/Skin.php
@@ -941,9 +941,12 @@
942942 $q = '';
943943 } else { $q = "returnto={$rt}"; }
944944
 945+ $loginlink = $wgUser->isAllowed( 'createaccount' )
 946+ ? 'nav-login-createaccount'
 947+ : 'login';
945948 $s .= "\n<br />" . $this->makeKnownLinkObj(
946949 SpecialPage::getTitleFor( 'Userlogin' ),
947 - wfMsg( 'login' ), $q );
 950+ wfMsg( $loginlink ), $q );
948951 } else {
949952 $n = $wgUser->getName();
950953 $rt = $wgTitle->getPrefixedURL();
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -856,6 +856,7 @@
857857 'externaldberror' => 'There was either an external authentication database error or you are not allowed to update your external account.',
858858 'loginproblem' => '<b>There has been a problem with your login.</b><br />Try again!',
859859 'login' => 'Log in',
 860+'nav-login-createaccount' => 'Log in / create account',
860861 'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.',
861862 'userlogin' => 'Log in / create account',
862863 'logout' => 'Log out',
Index: trunk/phase3/RELEASE-NOTES
@@ -83,6 +83,10 @@
8484 * On Special:UserRights, when you can add a group you can't remove or remove
8585 one you can't add, a notice is printed to warn you
8686 * (bug 12698) Create PAGESIZE parser function, to return the size of a page
 87+* Allow the "log in / create account" link in the toolbar to have different
 88+ text from Special:UserLogin title (new message 'nav-login-createaccount')
 89+* Say "log in / create account" if an anonymous user can create an account,
 90+ otherwise just "log in", consistently across skins
8791
8892 === Bug fixes in 1.13 ===
8993

Status & tagging log