From: Rotem Liss Date: Tue, 20 Jun 2006 16:08:38 +0000 (+0000) Subject: * Using the "returnto" in the login link in additional messages, and creating a funct... X-Git-Tag: 1.31.0-rc.0~56720 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=1fb3d373a9e32f3110027adbd0291efbb83c0fbc;p=lhc%2Fweb%2Fwiklou.git * Using the "returnto" in the login link in additional messages, and creating a function (Linker::loginLink) to create it. * 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. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index a3c98d676f..be999a9c9c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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() ); } } diff --git a/includes/Linker.php b/includes/Linker.php index 416a940d73..142bda6ea0 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 69e8521292..4336d94c03 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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" ); - $this->returnToMain(); + $this->returnToMain( false ); } /** @obsolete */ diff --git a/languages/Messages.php b/languages/Messages.php index 789945732a..25036a2d1a 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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.', 'edittools' => '', '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 # diff --git a/languages/MessagesHe.php b/languages/MessagesHe.php index 6f89bf63ff..2d36cf6fd8 100644 --- a/languages/MessagesHe.php +++ b/languages/MessagesHe.php @@ -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" => "כניסה לחשבון", -"loginreqpagetext" => "עליכם לבצע $1 כדי לצפות בדפים אחרים.", +"loginreqtitle" => "כניסה לחשבון נדרשת לצפייה", +"loginreqlink" => "להיכנס לחשבון", +"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" => "היסטוריית שינויים",