Merge "Show protection log on creation-protected pages"
[lhc/web/wiklou.git] / includes / specials / SpecialListgrants.php
index c5eea3f..1a04eec 100644 (file)
@@ -45,7 +45,7 @@ class SpecialListGrants extends SpecialPage {
 
                $out->addHTML(
                        \Html::openElement( 'table',
-                               array( 'class' => 'wikitable mw-listgrouprights-table' ) ) .
+                               [ 'class' => 'wikitable mw-listgrouprights-table' ] ) .
                                '<tr>' .
                                \Html::element( 'th', null, $this->msg( 'listgrants-grant' )->text() ) .
                                \Html::element( 'th', null, $this->msg( 'listgrants-rights' )->text() ) .
@@ -53,7 +53,7 @@ class SpecialListGrants extends SpecialPage {
                );
 
                foreach ( $this->getConfig()->get( 'GrantPermissions' ) as $grant => $rights ) {
-                       $descs = array();
+                       $descs = [];
                        $rights = array_filter( $rights ); // remove ones with 'false'
                        foreach ( $rights as $permission => $granted ) {
                                $descs[] = $this->msg(
@@ -69,10 +69,16 @@ class SpecialListGrants extends SpecialPage {
                                $grantCellHtml = '<ul><li>' . implode( "</li>\n<li>", $descs ) . '</li></ul>';
                        }
 
-                       $id = \Sanitizer::escapeId( $grant );
-                       $out->addHTML( \Html::rawElement( 'tr', array( 'id' => $id ),
-                               "<td>" . $this->msg( "grant-$grant" )->escaped() . "</td>" .
-                               "<td>" . $grantCellHtml . '</td>'
+                       $id = Sanitizer::escapeIdForAttribute( $grant );
+                       $out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ],
+                               "<td>" .
+                               $this->msg(
+                                       "listgrants-grant-display",
+                                       \User::getGrantName( $grant ),
+                                       "<span class='mw-listgrants-grant-name'>" . $id . "</span>"
+                               )->parse() .
+                               "</td>" .
+                               "<td>" . $grantCellHtml . "</td>"
                        ) );
                }