Index: trunk/phase3/includes/specials/SpecialListgrouprights.php |
— | — | @@ -44,10 +44,11 @@ |
45 | 45 | global $wgImplicitGroups; |
46 | 46 | global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups; |
47 | 47 | global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; |
48 | | - $out = $this->getOutput(); |
49 | 48 | |
50 | 49 | $this->setHeaders(); |
51 | 50 | $this->outputHeader(); |
| 51 | + |
| 52 | + $out = $this->getOutput(); |
52 | 53 | $out->addModuleStyles( 'mediawiki.special' ); |
53 | 54 | |
54 | 55 | $out->addHTML( |
— | — | @@ -96,20 +97,16 @@ |
97 | 98 | |
98 | 99 | if ( $group === 'user' ) { |
99 | 100 | // Link to Special:listusers for implicit group 'user' |
100 | | - $grouplink = '<br />' . Linker::link( |
| 101 | + $grouplink = '<br />' . Linker::linkKnown( |
101 | 102 | SpecialPage::getTitleFor( 'Listusers' ), |
102 | | - wfMsgHtml( 'listgrouprights-members' ), |
103 | | - array(), |
104 | | - array(), |
105 | | - array( 'known', 'noclasses' ) |
| 103 | + wfMsgHtml( 'listgrouprights-members' ) |
106 | 104 | ); |
107 | 105 | } elseif ( !in_array( $group, $wgImplicitGroups ) ) { |
108 | | - $grouplink = '<br />' . Linker::link( |
| 106 | + $grouplink = '<br />' . Linker::linkKnown( |
109 | 107 | SpecialPage::getTitleFor( 'Listusers' ), |
110 | 108 | wfMsgHtml( 'listgrouprights-members' ), |
111 | 109 | array(), |
112 | | - array( 'group' => $group ), |
113 | | - array( 'known', 'noclasses' ) |
| 110 | + array( 'group' => $group ) |
114 | 111 | ); |
115 | 112 | } else { |
116 | 113 | // No link to Special:listusers for other implicit groups as they are unlistable |
— | — | @@ -127,7 +124,8 @@ |
128 | 125 | " |
129 | 126 | <td>$grouppage$grouplink</td> |
130 | 127 | <td>" . |
131 | | - self::formatPermissions( $permissions, $revoke, $addgroups, $removegroups, $addgroupsSelf, $removegroupsSelf ) . |
| 128 | + $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups, |
| 129 | + $addgroupsSelf, $removegroupsSelf ) . |
132 | 130 | '</td> |
133 | 131 | ' |
134 | 132 | ) ); |
— | — | @@ -149,9 +147,7 @@ |
150 | 148 | * @param $removeSelf Array of group this group is allowed to remove from self or true |
151 | 149 | * @return string List of all granted permissions, separated by comma separator |
152 | 150 | */ |
153 | | - private static function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { |
154 | | - global $wgLang; |
155 | | - |
| 151 | + private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { |
156 | 152 | $r = array(); |
157 | 153 | foreach( $permissions as $permission => $granted ) { |
158 | 154 | //show as granted only if it isn't revoked to prevent duplicate display of permissions |
— | — | @@ -173,29 +169,42 @@ |
174 | 170 | } |
175 | 171 | } |
176 | 172 | sort( $r ); |
| 173 | + $lang = $this->getLang(); |
177 | 174 | if( $add === true ){ |
178 | 175 | $r[] = wfMsgExt( 'listgrouprights-addgroup-all', array( 'escape' ) ); |
179 | 176 | } elseif( is_array( $add ) && count( $add ) ) { |
180 | 177 | $add = array_values( array_unique( $add ) ); |
181 | | - $r[] = wfMsgExt( 'listgrouprights-addgroup', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ), count( $add ) ); |
| 178 | + $r[] = wfMsgExt( 'listgrouprights-addgroup', array( 'parseinline' ), |
| 179 | + $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ), |
| 180 | + count( $add ) |
| 181 | + ); |
182 | 182 | } |
183 | 183 | if( $remove === true ){ |
184 | 184 | $r[] = wfMsgExt( 'listgrouprights-removegroup-all', array( 'escape' ) ); |
185 | 185 | } elseif( is_array( $remove ) && count( $remove ) ) { |
186 | 186 | $remove = array_values( array_unique( $remove ) ); |
187 | | - $r[] = wfMsgExt( 'listgrouprights-removegroup', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ), count( $remove ) ); |
| 187 | + $r[] = wfMsgExt( 'listgrouprights-removegroup', array( 'parseinline' ), |
| 188 | + $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ), |
| 189 | + count( $remove ) |
| 190 | + ); |
188 | 191 | } |
189 | 192 | if( $addSelf === true ){ |
190 | 193 | $r[] = wfMsgExt( 'listgrouprights-addgroup-self-all', array( 'escape' ) ); |
191 | 194 | } elseif( is_array( $addSelf ) && count( $addSelf ) ) { |
192 | 195 | $addSelf = array_values( array_unique( $addSelf ) ); |
193 | | - $r[] = wfMsgExt( 'listgrouprights-addgroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ), count( $addSelf ) ); |
| 196 | + $r[] = wfMsgExt( 'listgrouprights-addgroup-self', array( 'parseinline' ), |
| 197 | + $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ), |
| 198 | + count( $addSelf ) |
| 199 | + ); |
194 | 200 | } |
195 | 201 | if( $removeSelf === true ){ |
196 | 202 | $r[] = wfMsgExt( 'listgrouprights-removegroup-self-all', array( 'escape' ) ); |
197 | 203 | } elseif( is_array( $removeSelf ) && count( $removeSelf ) ) { |
198 | 204 | $removeSelf = array_values( array_unique( $removeSelf ) ); |
199 | | - $r[] = wfMsgExt( 'listgrouprights-removegroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ), count( $removeSelf ) ); |
| 205 | + $r[] = wfMsgExt( 'listgrouprights-removegroup-self', array( 'parseinline' ), |
| 206 | + $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ), |
| 207 | + count( $removeSelf ) |
| 208 | + ); |
200 | 209 | } |
201 | 210 | if( empty( $r ) ) { |
202 | 211 | return ''; |