X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialListgrouprights.php;h=d64306beab26bb2afd15a95aa0267d03d5757a1d;hb=771d4b49bc9e99cf7f7b28eced8773a2da5f85cd;hp=828a93b9b9c976b4e752e7912b155c25e7e6835e;hpb=8b1a78fa5e62923d6dea1f9fe578c46b2910155e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 828a93b9b9..d64306beab 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -47,7 +47,7 @@ class SpecialListGroupRights extends SpecialPage { $out->wrapWikiMsg( "
\n$1\n
", 'listgrouprights-key' ); $out->addHTML( - Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) . + Xml::openElement( 'table', [ 'class' => 'wikitable mw-listgrouprights-table' ] ) . '' . Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) . Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) . @@ -74,7 +74,7 @@ class SpecialListGroupRights extends SpecialPage { foreach ( $allGroups as $group ) { $permissions = isset( $groupPermissions[$group] ) ? $groupPermissions[$group] - : array(); + : []; $groupname = ( $group == '*' ) // Replace * with a more descriptive groupname ? 'all' : $group; @@ -108,24 +108,24 @@ class SpecialListGroupRights extends SpecialPage { $grouplink = '
' . Linker::linkKnown( SpecialPage::getTitleFor( 'Listusers' ), $this->msg( 'listgrouprights-members' )->escaped(), - array(), - array( 'group' => $group ) + [], + [ 'group' => $group ] ); } else { // No link to Special:listusers for other implicit groups as they are unlistable $grouplink = ''; } - $revoke = isset( $revokePermissions[$group] ) ? $revokePermissions[$group] : array(); - $addgroups = isset( $addGroups[$group] ) ? $addGroups[$group] : array(); - $removegroups = isset( $removeGroups[$group] ) ? $removeGroups[$group] : array(); - $addgroupsSelf = isset( $groupsAddToSelf[$group] ) ? $groupsAddToSelf[$group] : array(); + $revoke = isset( $revokePermissions[$group] ) ? $revokePermissions[$group] : []; + $addgroups = isset( $addGroups[$group] ) ? $addGroups[$group] : []; + $removegroups = isset( $removeGroups[$group] ) ? $removeGroups[$group] : []; + $addgroupsSelf = isset( $groupsAddToSelf[$group] ) ? $groupsAddToSelf[$group] : []; $removegroupsSelf = isset( $groupsRemoveFromSelf[$group] ) ? $groupsRemoveFromSelf[$group] - : array(); + : []; $id = $group == '*' ? false : Sanitizer::escapeId( $group ); - $out->addHTML( Html::rawElement( 'tr', array( 'id' => $id ), " + $out->addHTML( Html::rawElement( 'tr', [ 'id' => $id ], " $grouppage$grouplink " . $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups, @@ -149,19 +149,19 @@ class SpecialListGroupRights extends SpecialPage { $header = $this->msg( 'listgrouprights-namespaceprotection-header' )->parse(); $out->addHTML( - Html::rawElement( 'h2', array(), Html::element( 'span', array( + Html::rawElement( 'h2', [], Html::element( 'span', [ 'class' => 'mw-headline', 'id' => $wgParser->guessSectionNameFromWikiText( $header ) - ), $header ) ) . - Xml::openElement( 'table', array( 'class' => 'wikitable' ) ) . + ], $header ) ) . + Xml::openElement( 'table', [ 'class' => 'wikitable' ] ) . Html::element( 'th', - array(), + [], $this->msg( 'listgrouprights-namespaceprotection-namespace' )->text() ) . Html::element( 'th', - array(), + [], $this->msg( 'listgrouprights-namespaceprotection-restrictedto' )->text() ) ); @@ -182,29 +182,29 @@ class SpecialListGroupRights extends SpecialPage { Xml::openElement( 'tr' ) . Html::rawElement( 'td', - array(), + [], Linker::link( SpecialPage::getTitleFor( 'Allpages' ), - $namespaceText, - array(), - array( 'namespace' => $namespace ) + htmlspecialchars( $namespaceText ), + [], + [ 'namespace' => $namespace ] ) ) . Xml::openElement( 'td' ) . Xml::openElement( 'ul' ) ); if ( !is_array( $rights ) ) { - $rights = array( $rights ); + $rights = [ $rights ]; } foreach ( $rights as $right ) { $out->addHTML( - Html::rawElement( 'li', array(), $this->msg( + Html::rawElement( 'li', [], $this->msg( 'listgrouprights-right-display', User::getRightDescription( $right ), Html::element( 'span', - array( 'class' => 'mw-listgrouprights-right-name' ), + [ 'class' => 'mw-listgrouprights-right-name' ], $right ) )->parse() ) @@ -232,9 +232,9 @@ class SpecialListGroupRights extends SpecialPage { * @return string List of all granted permissions, separated by comma separator */ private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { - $r = array(); + $r = []; foreach ( $permissions as $permission => $granted ) { - //show as granted only if it isn't revoked to prevent duplicate display of permissions + // show as granted only if it isn't revoked to prevent duplicate display of permissions if ( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) { $r[] = $this->msg( 'listgrouprights-right-display', User::getRightDescription( $permission ), @@ -256,12 +256,12 @@ class SpecialListGroupRights extends SpecialPage { $lang = $this->getLanguage(); $allGroups = User::getAllGroups(); - $changeGroups = array( + $changeGroups = [ 'addgroup' => $add, 'removegroup' => $remove, 'addgroup-self' => $addSelf, 'removegroup-self' => $removeSelf - ); + ]; foreach ( $changeGroups as $messageKey => $changeGroup ) { if ( $changeGroup === true ) { @@ -274,7 +274,7 @@ class SpecialListGroupRights extends SpecialPage { // For grep: listgrouprights-addgroup, listgrouprights-removegroup, // listgrouprights-addgroup-self, listgrouprights-removegroup-self $r[] = $this->msg( 'listgrouprights-' . $messageKey, - $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $changeGroup ) ), + $lang->listToText( array_map( [ 'User', 'makeGroupLinkWiki' ], $changeGroup ) ), count( $changeGroup ) )->parse(); }