* Using the "returnto" in the login link in additional messages, and creating a funct...
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 20 Jun 2006 16:08:38 +0000 (16:08 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 20 Jun 2006 16:08:38 +0000 (16:08 +0000)
* Removing "whitelistreadtitle" and "whitelistreadtext", which seem to be unused.
* Removing the self login link in the create account not allowed screen, as it is not useful.
* Fixing "loginreqlink" in Hebrew.
* Fixing various small bugs about these error pages.

includes/EditPage.php
includes/Linker.php
includes/OutputPage.php
languages/Messages.php
languages/MessagesHe.php

index a3c98d6..be999a9 100644 (file)
@@ -1353,15 +1353,12 @@ END
                global $wgUser, $wgOut;
                $skin = $wgUser->getSkin();
                
-               $loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
-               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() );
-       
                $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
                
-               $wgOut->addHtml( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
-               $wgOut->returnToMain( false, $this->mTitle->getPrefixedUrl() );
+               $wgOut->addHtml( wfMsgWikiHtml( 'whitelistedittext', $skin->loginLink( $this->mTitle ) ) );
+               $wgOut->returnToMain( false, $this->mTitle->getPrefixedText() );
        }
 
        /**
@@ -1773,9 +1770,15 @@ END
        }
 
        function noCreatePermission() {
-               global $wgOut;
+               global $wgUser, $wgOut;
+               $skin = $wgUser->getSkin();
+               
                $wgOut->setPageTitle( wfMsg( 'nocreatetitle' ) );
-               $wgOut->addWikiText( wfMsg( 'nocreatetext' ) );
+               $wgOut->setRobotPolicy( 'noindex,nofollow' );
+               $wgOut->setArticleRelated( false );
+               
+               $wgOut->addHtml( wfMsgWikiHtml( 'nocreatetext', $skin->loginLink( $this->mTitle ) ) );
+               $wgOut->returnToMain( false, $this->mTitle->getPrefixedText() );
        }
 
 }
index 416a940..142bda6 100644 (file)
@@ -826,7 +826,21 @@ class Linker {
                        wfMsgHtml( 'blocklink' ), 'ip=' . urlencode( $userText ) );
                return $blockLink;
        }
-       
+
+       /**
+        * @param string the title to return to
+        *
+        * @return string of the link to the login page, returning to the specified title.
+       */
+       function loginLink( $returnto = null ) {
+               if( !isset( $returnto ) ) {
+                       global $wgTitle;
+                       $returnto = &$wgTitle;
+               }
+               $loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
+               return $this->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $returnto->getPrefixedUrl() );
+       }
+
        /**
         * Generate a user link if the current user is allowed to view it
         * @param $rev Revision object.
index 69e8521..4336d94 100644 (file)
@@ -776,12 +776,10 @@ class OutputPage {
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleFlag( false );
                
-               $loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
-               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
-               $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
+               $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $skin->loginLink() ) );
                $this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
                
-               $this->returnToMain();
+               $this->returnToMain( false );
        }
 
        /** @obsolete */
index 7899457..25036a2 100644 (file)
@@ -477,15 +477,13 @@ Note that you may not use the "e-mail this user" feature unless you have a valid
 Your IP address is $3. Please include this address in any queries you make.',
 'whitelistedittitle' => 'Login required to edit',
 'whitelistedittext' => 'You have to $1 to edit pages.',
-'whitelistreadtitle' => 'Login required to read',
-'whitelistreadtext' => 'You have to [[Special:Userlogin|login]] to read pages.',
 'whitelistacctitle' => 'You are not allowed to create an account',
-'whitelistacctext' => 'To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions.',
+'whitelistacctext' => 'To be allowed to create accounts in this Wiki you have to log in and have the appropriate permissions.',
 'confirmedittitle' => 'E-mail confirmation required to edit',
 '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]].',
-'loginreqtitle'        => 'Login Required',
+'loginreqtitle'        => 'Login required to view',
 'loginreqlink' => 'log in',
-'loginreqpagetext'     => 'You must $1 to view other pages.',
+'loginreqpagetext'     => 'You must $1 to view pages.',
 'accmailtitle' => 'Password sent.',
 'accmailtext' => 'The password for "$1" has been sent to $2.',
 'newarticle'   => '(New)',
@@ -554,7 +552,7 @@ the text into a text file and save it for later.</strong>',
 'edittools' => '<!-- Text here will be shown below edit and upload forms. -->',
 'nocreatetitle' => 'Page creation limited',
 'nocreatetext' => 'This site has restricted the ability to create new pages.
-You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].',
+You can go back and edit an existing page, or $1.',
 
 # History pages
 #
index 6f89bf6..2d36cf6 100644 (file)
@@ -442,16 +442,14 @@ $wgAllMessagesHe = array(
 
 כתובת ה-IP שלך כרגע היא \'\'\'$3\'\'\', ויש לציין עובדה זו בכל פנייה למפעילי המערכת.',
 "whitelistedittitle"        => "כניסה לחשבון נדרשת לעריכה",
-"whitelistedittext"         => "עליכם לבצע $1 כדי לערוך דפים.",
-"whitelistreadtitle"        => "כניסה לחשבון נדרשת לקריאה",
-"whitelistreadtext"         => "עליכם [[{{ns:special}}:Userlogin|להיכנס לחשבון]] כדי לקרוא דפים.",
+"whitelistedittext"         => "עליכם $1 כדי לערוך דפים.",
 "whitelistacctitle"         => "אינכם מורשים ליצור חשבון",
-"whitelistacctext"          => "עליכם [[{{ns:special}}:Userlogin|להיכנס לחשבון]] שיש לו את ההרשאה ליצור חשבונות כדי ליצור חשבון.",
+"whitelistacctext"          => "עליכם להיכנס לחשבון שיש לו את ההרשאה ליצור חשבונות כדי ליצור חשבון.",
 "confirmedittitle"          => 'הנכם חייבים לאמת את כתובת הדוא"ל שלכם כדי לערוך',
 "confirmedittext"           => 'עליכם לאמת את כתובת הדוא"ל שלכם לפני שתוכלו לערוך דפים. אנא הגדירו ואמתו את כתובת הדוא"ל שלכם באמצעות [[{{ns:special}}:Preferences|העדפות המשתמש]] לשכם.',
-"loginreqtitle"             => "כניסה לחשבון נדרשת",
-"loginreqlink"              => "×\9b× ×\99ס×\94 לחשבון",
-"loginreqpagetext"          => "עליכם לבצע $1 כדי לצפות בדפים אחרים.",
+"loginreqtitle"             => "כניסה לחשבון נדרשת לצפייה",
+"loginreqlink"              => "×\9c×\94×\99×\9bנס לחשבון",
+"loginreqpagetext"          => "עליכם $1 כדי לצפות בדפים.",
 "accmailtitle"              => "הסיסמה נשלחה",
 "accmailtext"               => 'הסיסמה עבור "$1" נשלחה אל $2.',
 "newarticle"                => "(חדש)",
@@ -512,7 +510,7 @@ $wgAllMessagesHe = array(
 "templatesused"             => "תבניות המופיעות בדף זה:",
 "edittools"                 => "<!-- הטקסט הנכתב כאן יוצג מתחת לטפסי עריכת דפים והעלאת קבצים, ולפיכך ניתן לכתוב להציג בו תווים קשים לכתיבה, קטעים מוכנים של טקסט ועוד. -->",
 "nocreatetitle"             => "יצירת הדפים הוגבלה",
-"nocreatetext"              => "אתר זה מגביל את האפשרות ליצור דפים חדשים. באפשרותכם לחזור אחורה ולערוך דף קיים, או [[{{ns:special}}:Userlogin|להיכנס לחשבון]].",
+"nocreatetext"              => "אתר זה מגביל את האפשרות ליצור דפים חדשים. באפשרותכם לחזור אחורה ולערוך דף קיים, או $1.",
 
 # History pages
 "revhistory"                  => "היסטוריית שינויים",