Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -966,22 +966,28 @@ |
967 | 967 | } |
968 | 968 | |
969 | 969 | /** |
970 | | - * @param array $errors An array returned by Title::getUserPermissionsErrors |
| 970 | + * @param array $errors An array of arrays returned by Title::getUserPermissionsErrors |
971 | 971 | * @return string The error-messages, formatted into a list. |
972 | 972 | */ |
973 | 973 | public function formatPermissionsErrorMessage( $errors ) { |
974 | 974 | $text = ''; |
975 | 975 | |
976 | | - $text .= wfMsgExt( 'permissionserrorstext', array( 'parse' ), count( $errors ) ) . "\n"; |
977 | | - $text .= '<ul class="permissions-errors">' . "\n"; |
| 976 | + if (sizeof( $errors ) > 1) { |
978 | 977 | |
979 | | - foreach( $errors as $error ) |
980 | | - { |
981 | | - $text .= '<li>'; |
982 | | - $text .= call_user_func_array( 'wfMsg', $error ); |
983 | | - $text .= "</li>\n"; |
| 978 | + $text .= wfMsgExt( 'permissionserrorstext', array( 'parse' ), count( $errors ) ) . "\n"; |
| 979 | + $text .= '<ul class="permissions-errors">' . "\n"; |
| 980 | + |
| 981 | + foreach( $errors as $error ) |
| 982 | + { |
| 983 | + $text .= '<li>'; |
| 984 | + foreach ($error as $e) echo $e; |
| 985 | + $text .= call_user_func_array( 'wfMsg', $error ); |
| 986 | + $text .= "</li>\n"; |
| 987 | + } |
| 988 | + $text .= '</ul>'; |
| 989 | + } else { |
| 990 | + $text .= call_user_func_array( 'wfMsg', $errors[0]); |
984 | 991 | } |
985 | | - $text .= '</ul>'; |
986 | 992 | |
987 | 993 | return $text; |
988 | 994 | } |
— | — | @@ -1322,4 +1328,4 @@ |
1323 | 1329 | } |
1324 | 1330 | } |
1325 | 1331 | |
1326 | | -} |
\ No newline at end of file |
| 1332 | +} |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1096,7 +1096,6 @@ |
1097 | 1097 | * @return array Array of arrays of the arguments to wfMsg to explain permissions problems. |
1098 | 1098 | */ |
1099 | 1099 | private function getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries = true ) { |
1100 | | - global $wgContLang; |
1101 | 1100 | $fname = 'Title::userCan'; |
1102 | 1101 | wfProfileIn( $fname ); |
1103 | 1102 | |
— | — | @@ -1111,7 +1110,12 @@ |
1112 | 1111 | } |
1113 | 1112 | |
1114 | 1113 | if ( $this->isNamespaceProtected() ) { |
1115 | | - $errors[] = (NS_MEDIAWIKI == $this->mNamespace ? array('protectedinterface') : array( 'namespaceprotected', $wgContLang->getNSText( $this->mNamespace ) ) ); |
| 1114 | + $ns = $this->getNamespace() == NS_MAIN |
| 1115 | + ? wfMsg( 'nstab-main' ) |
| 1116 | + : $this->getNsText(); |
| 1117 | + $errors[] = (NS_MEDIAWIKI == $this->mNamespace |
| 1118 | + ? array('protectedinterface') |
| 1119 | + : array( 'namespaceprotected', $ns ) ); |
1116 | 1120 | } |
1117 | 1121 | |
1118 | 1122 | if( $this->mDbkeyform == '_' ) { |