* Allow the "log in / create account" link in the toolbar to have different text...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 18 Apr 2008 15:46:54 +0000 (15:46 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 18 Apr 2008 15:46:54 +0000 (15:46 +0000)
* 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".)

RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index d86171e..af5c250 100644 (file)
@@ -83,6 +83,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * On Special:UserRights, when you can add a group you can't remove or remove
   one you can't add, a notice is printed to warn you
 * (bug 12698) Create PAGESIZE parser function, to return the size of a page
+* 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
 
 === Bug fixes in 1.13 ===
 
index f08cff0..77b215c 100644 (file)
@@ -941,9 +941,12 @@ END;
                                $q = '';
                        } else { $q = "returnto={$rt}"; }
 
+                       $loginlink = $wgUser->isAllowed( 'createaccount' )
+                               ? 'nav-login-createaccount'
+                               : 'login';
                        $s .= "\n<br />" . $this->makeKnownLinkObj(
                                SpecialPage::getTitleFor( 'Userlogin' ),
-                               wfMsg( 'login' ), $q );
+                               wfMsg( $loginlink ), $q );
                } else {
                        $n = $wgUser->getName();
                        $rt = $wgTitle->getPrefixedURL();
index f95b20f..4ba3f21 100644 (file)
@@ -543,6 +543,10 @@ class SkinTemplate extends Skin {
                                'active' => false
                        );
                } else {
+                       global $wgUser;
+                       $loginlink = $wgUser->isAllowed( 'createaccount' )
+                               ? 'nav-login-createaccount'
+                               : 'login';
                        if( $this->showIPinHeader() ) {
                                $href = &$this->userpageUrlDetails['href'];
                                $personal_urls['anonuserpage'] = array(
@@ -560,14 +564,14 @@ class SkinTemplate extends Skin {
                                        'active' => ( $pageurl == $href )
                                );
                                $personal_urls['anonlogin'] = array(
-                                       'text' => wfMsg('userlogin'),
+                                       'text' => wfMsg( $loginlink ),
                                        'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
                                        'active' => $wgTitle->isSpecial( 'Userlogin' )
                                );
                        } else {
 
                                $personal_urls['login'] = array(
-                                       'text' => wfMsg('userlogin'),
+                                       'text' => wfMsg( $loginlink ),
                                        'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
                                        'active' => $wgTitle->isSpecial( 'Userlogin' )
                                );
index c23ab44..83371a2 100644 (file)
@@ -856,6 +856,7 @@ Do not forget to change your {{SITENAME}} preferences.',
 'externaldberror'            => 'There was either an external authentication database error or you are not allowed to update your external account.',
 'loginproblem'               => '<b>There has been a problem with your login.</b><br />Try again!',
 'login'                      => 'Log in',
+'nav-login-createaccount'    => 'Log in / create account',
 'loginprompt'                => 'You must have cookies enabled to log in to {{SITENAME}}.',
 'userlogin'                  => 'Log in / create account',
 'logout'                     => 'Log out',
index ef3aeb1..5f9c58a 100644 (file)
@@ -371,6 +371,7 @@ $wgMessageStructure = array(
                'externaldberror',
                'loginproblem',
                'login',
+               'nav-login-createaccount',
                'loginprompt',
                'userlogin',
                'logout',