* Tweaking Werdnas new functions 'showPermissionsErrorPage' and 'formatPermissionsErr...
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 6 Aug 2007 11:30:40 +0000 (11:30 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 6 Aug 2007 11:30:40 +0000 (11:30 +0000)
** Removing parameter $title from 'showPermissionsErrorPage', seems unused
** The message 'permissionserrorstext' uses {{PLURAL:}}, so pass the number of errors to the message.
** Show message 'permissionserrorstext' only once.
** Documentation
* First use of 'showPermissionsErrorPage' in SpecialMovepage.php
* Formatting MessagesEn.php a bit

includes/OutputPage.php
includes/SpecialMovepage.php
languages/messages/MessagesEn.php

index ee53f93..efa0092 100644 (file)
@@ -816,7 +816,12 @@ class OutputPage {
                $this->returnToMain( false );
        }
 
-       public function showPermissionsErrorPage( $title, $errors )
+       /**
+        * Output a standard permission error page
+        *
+        * @param array $errors Error message keys
+        */
+       public function showPermissionsErrorPage( $errors )
        {
                global $wgTitle;
 
@@ -829,8 +834,6 @@ class OutputPage {
                $this->enableClientCache( false );
                $this->mRedirect = '';
                $this->mBodytext = '';
-
-               $this->addWikiText( wfMsg('permissionserrorstext') );
                $this->addWikitext( $this->formatPermissionsErrorMessage( $errors ) );
        }
 
@@ -956,7 +959,7 @@ class OutputPage {
        public function formatPermissionsErrorMessage( $errors ) {
                $text = '';
 
-               $text .= wfMsg('permissionserrorstext')."\n";
+               $text .= wfMsgExt( 'permissionserrorstext', array( 'parse' ), count( $errors ) ) . "\n";
                $text .= '<ul class="permissions-errors">' . "\n";
 
                foreach( $errors as $error )
index e318bc6..22b1a91 100644 (file)
@@ -12,7 +12,7 @@ function wfSpecialMovepage( $par = null ) {
 
        # Check rights
        if ( !$wgUser->isAllowed( 'move' ) ) {
-               $wgOut->showErrorPage( 'movenologin', 'movenologintext' );
+               $wgOut->showPermissionsErrorPage( array( $wgUser->isAnon() ? 'movenologintext' : 'movenotallowed' ) );
                return;
        }
 
index bdd08a2..c703bb9 100644 (file)
@@ -791,7 +791,7 @@ Query: $2',
 $2",
 'namespaceprotected'   => "You do not have permission to edit pages in the '''$1''' namespace.",
 'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
-'ns-specialprotected'  => "Pages in the special namespace cannot be edited.",
+'ns-specialprotected'  => "Pages in the {{ns:special}} namespace cannot be edited.",
 
 # Login and logout pages
 'logouttitle'                => 'User logout',
@@ -966,7 +966,7 @@ Your block ID is $5. Please include this ID in any queries you make.',
 'blockedtext-concise'       => "$7, which matches your username or IP address, has been blocked by $1. The reason given was $2. The expiry time of this block is $6. To discuss the block, you can 
 contact $1, or another administrator. You cannot use the 'email this user' feature unless a valid email address is specified in your account preferences and you have not been blocked from using it. 
 Your current IP address is $3, and the block ID is #$5. Please include either or both of these in any queries.",
-'autoblockedtext-concise'       => "Your IP address has recently been used by a user who was blocked. The block was made by $1. The reason given was $2. The expiry time of this block is $6. To 
+'autoblockedtext-concise'   => "Your IP address has recently been used by a user who was blocked. The block was made by $1. The reason given was $2. The expiry time of this block is $6. To 
 discuss the block, you can contact $1, or another administrator. You cannot use the 'email this user' feature unless a valid email address is specified in your account preferences and you have not 
 been blocked from using it. Your current IP address is $3, and the block ID is #$5. Please include either or both of these in any queries.",
 'blockedoriginalsource'     => "The source of '''$1''' is 
@@ -2012,14 +2012,13 @@ pages that were vandalized).',
 'ipb-blocklist-addr'          => 'View existing blocks for $1',
 'ipb-blocklist'               => 'View existing blocks',
 'unblockip'                   => 'Unblock user',
-'unblockiptext'               => 'Use the form below to restore write access
-to a previously blocked IP address or username.',
+'unblockiptext'               => 'Use the form below to restore write access to a previously blocked IP address or username.',
 'ipusubmit'                   => 'Unblock this address',
 'unblocked'                   => '[[User:$1|$1]] has been unblocked',
 'unblocked-id'                => 'Block $1 has been removed',
 'ipblocklist'                 => 'List of blocked IP addresses and usernames',
-'ipblocklist-legend' => 'Find a blocked user',
-'ipblocklist-username' => 'Username or IP address:',
+'ipblocklist-legend'          => 'Find a blocked user',
+'ipblocklist-username'        => 'Username or IP address:',
 'ipblocklist-summary'         => '', # only translate this message to other languages if you have to change it
 'ipblocklist-submit'          => 'Search',
 'blocklistline'               => '$1, $2 blocked $3 ($4)',
@@ -2109,9 +2108,8 @@ proceeding.",
 In those cases, you will have to move or merge the page manually if desired.",
 'movearticle'             => 'Move page:',
 'movenologin'             => 'Not logged in',
-'movenologintext'         => 'You must be a registered user and [[Special:Userlogin|logged in]]
-to move a page.',
-'movenotallowed'         => 'You do not have permission to move pages on this wiki.',
+'movenologintext'         => 'You must be a registered user and [[Special:Userlogin|logged in]] to move a page.',
+'movenotallowed'          => 'You do not have permission to move pages on this wiki.',
 'newtitle'                => 'To new title:',
 'move-watch'              => 'Watch this page',
 'movepagebtn'             => 'Move page',