From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/specials/SpecialListgrouprights.php | 51 +++++++++++++++------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'includes/specials/SpecialListgrouprights.php') diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 7cccf887..82a4f70f 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -29,7 +29,6 @@ * @author Petr Kadlec */ class SpecialListGroupRights extends SpecialPage { - /** * Constructor */ @@ -51,11 +50,13 @@ class SpecialListGroupRights extends SpecialPage { $out = $this->getOutput(); $out->addModuleStyles( 'mediawiki.special' ); + $out->wrapWikiMsg( "
\n$1\n
", 'listgrouprights-key' ); + $out->addHTML( Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) . '' . - Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) . - Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) . + Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) . + Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) . '' ); @@ -85,7 +86,7 @@ class SpecialListGroupRights extends SpecialPage { $msg->text() : MWNamespace::getCanonicalName( NS_PROJECT ) . ':' . $groupname; - if( $group == '*' ) { + if ( $group == '*' ) { // Do not make a link for the generic * group $grouppage = htmlspecialchars( $groupnameLocalized ); } else { @@ -124,16 +125,13 @@ class SpecialListGroupRights extends SpecialPage { " $grouppage$grouplink " . - $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups, - $addgroupsSelf, $removegroupsSelf ) . + $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups, + $addgroupsSelf, $removegroupsSelf ) . ' ' ) ); } - $out->addHTML( - Xml::closeElement( 'table' ) . "\n

\n" - ); - $out->wrapWikiMsg( "
\n$1\n
", 'listgrouprights-key' ); + $out->addHTML( Xml::closeElement( 'table' ) ); } /** @@ -149,9 +147,9 @@ class SpecialListGroupRights extends SpecialPage { */ private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { $r = array(); - foreach( $permissions as $permission => $granted ) { + foreach ( $permissions as $permission => $granted ) { //show as granted only if it isn't revoked to prevent duplicate display of permissions - if( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) { + if ( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) { $description = $this->msg( 'listgrouprights-right-display', User::getRightDescription( $permission ), '' . $permission . '' @@ -159,8 +157,8 @@ class SpecialListGroupRights extends SpecialPage { $r[] = $description; } } - foreach( $revoke as $permission => $revoked ) { - if( $revoked ) { + foreach ( $revoke as $permission => $revoked ) { + if ( $revoked ) { $description = $this->msg( 'listgrouprights-right-revoked', User::getRightDescription( $permission ), '' . $permission . '' @@ -168,45 +166,52 @@ class SpecialListGroupRights extends SpecialPage { $r[] = $description; } } + sort( $r ); + $lang = $this->getLanguage(); - if( $add === true ) { + + if ( $add === true ) { $r[] = $this->msg( 'listgrouprights-addgroup-all' )->escaped(); - } elseif( is_array( $add ) && count( $add ) ) { + } elseif ( is_array( $add ) && count( $add ) ) { $add = array_values( array_unique( $add ) ); $r[] = $this->msg( 'listgrouprights-addgroup', $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ), count( $add ) )->parse(); } - if( $remove === true ) { + + if ( $remove === true ) { $r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped(); - } elseif( is_array( $remove ) && count( $remove ) ) { + } elseif ( is_array( $remove ) && count( $remove ) ) { $remove = array_values( array_unique( $remove ) ); $r[] = $this->msg( 'listgrouprights-removegroup', $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ), count( $remove ) )->parse(); } - if( $addSelf === true ) { + + if ( $addSelf === true ) { $r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped(); - } elseif( is_array( $addSelf ) && count( $addSelf ) ) { + } elseif ( is_array( $addSelf ) && count( $addSelf ) ) { $addSelf = array_values( array_unique( $addSelf ) ); $r[] = $this->msg( 'listgrouprights-addgroup-self', $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ), count( $addSelf ) )->parse(); } - if( $removeSelf === true ) { + + if ( $removeSelf === true ) { $r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse(); - } elseif( is_array( $removeSelf ) && count( $removeSelf ) ) { + } elseif ( is_array( $removeSelf ) && count( $removeSelf ) ) { $removeSelf = array_values( array_unique( $removeSelf ) ); $r[] = $this->msg( 'listgrouprights-removegroup-self', $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ), count( $removeSelf ) )->parse(); } - if( empty( $r ) ) { + + if ( empty( $r ) ) { return ''; } else { return ''; -- cgit v1.2.2