Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1068,25 +1068,15 @@ |
1069 | 1069 | $this->setArticleRelated( false ); |
1070 | 1070 | $this->mBodytext = ''; |
1071 | 1071 | |
1072 | | - $groups = array(); |
1073 | | - foreach( User::getGroupsWithPermission( $permission ) as $key ) { |
1074 | | - $groupName = User::getGroupName( $key ); |
1075 | | - $groupPage = User::getGroupPage( $key ); |
1076 | | - if( $groupPage ) { |
1077 | | - $skin = $wgUser->getSkin(); |
1078 | | - $groups[] = $skin->makeLinkObj( $groupPage, $groupName ); |
1079 | | - } else { |
1080 | | - $groups[] = $groupName; |
1081 | | - } |
| 1072 | + $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), |
| 1073 | + User::getGroupsWithPermission( $permission ) ); |
| 1074 | + if( $groups ) { |
| 1075 | + $this->addWikiMsg( 'badaccess-groups', |
| 1076 | + implode( ', ', $groups ), |
| 1077 | + count( $groups) ); |
| 1078 | + } else { |
| 1079 | + $this->addWikiMsg( 'badaccess-group0' ); |
1082 | 1080 | } |
1083 | | - $n = count( $groups ); |
1084 | | - if ( $count > 0 ) { |
1085 | | - $message = wfMsgHtml( 'badaccess-groups', array( $groups, $n ) ); |
1086 | | - } |
1087 | | - else { |
1088 | | - $message = wfMsgHtml( "badaccess-group0", $groups ); |
1089 | | - } |
1090 | | - $this->addHtml( $message ); |
1091 | 1081 | $this->returnToMain(); |
1092 | 1082 | } |
1093 | 1083 | |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1307,23 +1307,16 @@ |
1308 | 1308 | $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed'); |
1309 | 1309 | } elseif ( !$user->isAllowed( $action ) ) { |
1310 | 1310 | $return = null; |
1311 | | - $groups = array(); |
1312 | | - foreach( User::getGroupsWithPermission( $action ) as $key ) { |
1313 | | - $groupName = User::getGroupName( $key ); |
1314 | | - $groupPage = User::getGroupPage( $key ); |
1315 | | - if( $groupPage ) { |
1316 | | - $groups[] = '[['.$groupPage->getPrefixedText().'|'.$groupName.']]'; |
1317 | | - } else { |
1318 | | - $groups[] = $groupName; |
1319 | | - } |
| 1311 | + $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), |
| 1312 | + User::getGroupsWithPermission( $action ) ); |
| 1313 | + if ( $groups ) { |
| 1314 | + $return = array( 'badaccess-groups', |
| 1315 | + array( |
| 1316 | + implode( ', ', $groups ), |
| 1317 | + count( $groups ) ) ); |
1320 | 1318 | } |
1321 | | - $n = count( $groups ); |
1322 | | - if ( $n > 0 ) { |
1323 | | - $groups = implode( ', ', $groups ); |
1324 | | - $return = array( 'badaccess-groups', array( $groups, $n ) ); |
1325 | | - } |
1326 | 1319 | else { |
1327 | | - $return = array( "badaccess-group0", $groups ); |
| 1320 | + $return = array( "badaccess-group0" ); |
1328 | 1321 | } |
1329 | 1322 | $errors[] = $return; |
1330 | 1323 | } |