r24618 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24617‎ | r24618 | r24619 >
Date:11:30, 6 August 2007
Author:raymond
Status:old
Tags:
Comment:
* Tweaking Werdnas new functions 'showPermissionsErrorPage' and 'formatPermissionsErrorMessage' a bit:
** 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
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -816,7 +816,12 @@
817817 $this->returnToMain( false );
818818 }
819819
820 - public function showPermissionsErrorPage( $title, $errors )
 820+ /**
 821+ * Output a standard permission error page
 822+ *
 823+ * @param array $errors Error message keys
 824+ */
 825+ public function showPermissionsErrorPage( $errors )
821826 {
822827 global $wgTitle;
823828
@@ -829,8 +834,6 @@
830835 $this->enableClientCache( false );
831836 $this->mRedirect = '';
832837 $this->mBodytext = '';
833 -
834 - $this->addWikiText( wfMsg('permissionserrorstext') );
835838 $this->addWikitext( $this->formatPermissionsErrorMessage( $errors ) );
836839 }
837840
@@ -956,7 +959,7 @@
957960 public function formatPermissionsErrorMessage( $errors ) {
958961 $text = '';
959962
960 - $text .= wfMsg('permissionserrorstext')."\n";
 963+ $text .= wfMsgExt( 'permissionserrorstext', array( 'parse' ), count( $errors ) ) . "\n";
961964 $text .= '<ul class="permissions-errors">' . "\n";
962965
963966 foreach( $errors as $error )
Index: trunk/phase3/includes/SpecialMovepage.php
@@ -12,7 +12,7 @@
1313
1414 # Check rights
1515 if ( !$wgUser->isAllowed( 'move' ) ) {
16 - $wgOut->showErrorPage( 'movenologin', 'movenologintext' );
 16+ $wgOut->showPermissionsErrorPage( array( $wgUser->isAnon() ? 'movenologintext' : 'movenotallowed' ) );
1717 return;
1818 }
1919
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -791,7 +791,7 @@
792792 $2",
793793 'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.",
794794 'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
795 -'ns-specialprotected' => "Pages in the special namespace cannot be edited.",
 795+'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
796796
797797 # Login and logout pages
798798 'logouttitle' => 'User logout',
@@ -966,7 +966,7 @@
967967 '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
968968 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.
969969 Your current IP address is $3, and the block ID is #$5. Please include either or both of these in any queries.",
970 -'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
 970+'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
971971 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
972972 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.",
973973 'blockedoriginalsource' => "The source of '''$1''' is
@@ -2012,14 +2012,13 @@
20132013 'ipb-blocklist-addr' => 'View existing blocks for $1',
20142014 'ipb-blocklist' => 'View existing blocks',
20152015 'unblockip' => 'Unblock user',
2016 -'unblockiptext' => 'Use the form below to restore write access
2017 -to a previously blocked IP address or username.',
 2016+'unblockiptext' => 'Use the form below to restore write access to a previously blocked IP address or username.',
20182017 'ipusubmit' => 'Unblock this address',
20192018 'unblocked' => '[[User:$1|$1]] has been unblocked',
20202019 'unblocked-id' => 'Block $1 has been removed',
20212020 'ipblocklist' => 'List of blocked IP addresses and usernames',
2022 -'ipblocklist-legend' => 'Find a blocked user',
2023 -'ipblocklist-username' => 'Username or IP address:',
 2021+'ipblocklist-legend' => 'Find a blocked user',
 2022+'ipblocklist-username' => 'Username or IP address:',
20242023 'ipblocklist-summary' => '', # only translate this message to other languages if you have to change it
20252024 'ipblocklist-submit' => 'Search',
20262025 'blocklistline' => '$1, $2 blocked $3 ($4)',
@@ -2109,9 +2108,8 @@
21102109 In those cases, you will have to move or merge the page manually if desired.",
21112110 'movearticle' => 'Move page:',
21122111 'movenologin' => 'Not logged in',
2113 -'movenologintext' => 'You must be a registered user and [[Special:Userlogin|logged in]]
2114 -to move a page.',
2115 -'movenotallowed' => 'You do not have permission to move pages on this wiki.',
 2112+'movenologintext' => 'You must be a registered user and [[Special:Userlogin|logged in]] to move a page.',
 2113+'movenotallowed' => 'You do not have permission to move pages on this wiki.',
21162114 'newtitle' => 'To new title:',
21172115 'move-watch' => 'Watch this page',
21182116 'movepagebtn' => 'Move page',

Follow-up revisions

RevisionCommit summaryAuthorDate
r24632Merged revisions 24601-24631 via svnmerge from...david18:44, 6 August 2007

Status & tagging log