From: Aryeh Gregor Date: Wed, 2 Jan 2008 01:13:41 +0000 (+0000) Subject: Fix whitespace, brace style X-Git-Tag: 1.31.0-rc.0~50190 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=618ab1abc370d9b0fa9776e57ce617cab903aca1;p=lhc%2Fweb%2Fwiklou.git Fix whitespace, brace style --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 0c691ab82b..faf533af8e 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -981,14 +981,14 @@ class OutputPage { /** * @param array $errors An array of arrays returned by Title::getUserPermissionsErrors - * @return string The error-messages, formatted into a list. + * @return string The wikitext error-messages, formatted into a list. */ public function formatPermissionsErrorMessage( $errors ) { - $text = ''; - - if (sizeof( $errors ) > 1) { + global $wgParser; + + $text = wfMsgExt( 'permissionserrorstext', array( 'parsemag' ), count( $errors ) ) . "\n\n"; - $text .= wfMsgExt( 'permissionserrorstext', array( 'parse' ), count( $errors ) ) . "\n"; + if (count( $errors ) > 1) { $text .= ''; } else { - $text .= call_user_func_array( 'wfMsg', $errors[0]); + $text .= '' . call_user_func_array( 'wfMsg', $errors[0]) . ''; } return $text; diff --git a/includes/Title.php b/includes/Title.php index c78870762c..4afa47f241 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1188,8 +1188,7 @@ class Title { } } - if ($action == 'protect') - { + if ($action == 'protect') { if ($this->getUserPermissionsErrors('edit', $user) != array()) { $errors[] = array( 'protect-cantedit' ); // If they can't edit, they shouldn't protect. } @@ -1218,32 +1217,32 @@ class Title { } } elseif( $action == 'move' && !( $this->isMovable() && $user->isAllowed( 'move' ) ) ) { $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed'); - } else if ( !$user->isAllowed( $action ) ) { + } else if ( !$user->isAllowed( $action ) ) { $return = null; $groups = array(); global $wgGroupPermissions; - foreach( $wgGroupPermissions as $key => $value ) { - if( isset( $value[$action] ) && $value[$action] == true ) { - $groupName = User::getGroupName( $key ); - $groupPage = User::getGroupPage( $key ); - if( $groupPage ) { - $groups[] = '[['.$groupPage->getPrefixedText().'|'.$groupName.']]'; - } else { - $groups[] = $groupName; - } - } - } - $n = count( $groups ); - $groups = implode( ', ', $groups ); - switch( $n ) { - case 0: - case 1: - case 2: - $return = array( "badaccess-group$n", $groups ); - break; - default: - $return = array( 'badaccess-groups', $groups ); - } + foreach( $wgGroupPermissions as $key => $value ) { + if( isset( $value[$action] ) && $value[$action] == true ) { + $groupName = User::getGroupName( $key ); + $groupPage = User::getGroupPage( $key ); + if( $groupPage ) { + $groups[] = '[['.$groupPage->getPrefixedText().'|'.$groupName.']]'; + } else { + $groups[] = $groupName; + } + } + } + $n = count( $groups ); + $groups = implode( ', ', $groups ); + switch( $n ) { + case 0: + case 1: + case 2: + $return = array( "badaccess-group$n", $groups ); + break; + default: + $return = array( 'badaccess-groups', $groups ); + } $errors[] = $return; }