setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$out->addModuleStyles( 'mediawiki.special' );
$out->addHTML(
\Html::openElement( 'table',
[ 'class' => 'wikitable mw-listgrouprights-table' ] ) .
'
' .
\Html::element( 'th', null, $this->msg( 'listgrants-grant' )->text() ) .
\Html::element( 'th', null, $this->msg( 'listgrants-rights' )->text() ) .
'
'
);
foreach ( $this->getConfig()->get( 'GrantPermissions' ) as $grant => $rights ) {
$descs = [];
$rights = array_filter( $rights ); // remove ones with 'false'
foreach ( $rights as $permission => $granted ) {
$descs[] = $this->msg(
'listgrouprights-right-display',
\User::getRightDescription( $permission ),
'' . $permission . ''
)->parse();
}
if ( $descs === [] ) {
$grantCellHtml = '';
} else {
sort( $descs );
$grantCellHtml = '- ' . implode( "
\n- ", $descs ) . '
';
}
$id = Sanitizer::escapeIdForAttribute( $grant );
$out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ],
"" .
$this->msg(
"listgrants-grant-display",
\User::getGrantName( $grant ),
"" . $id . ""
)->parse() .
" | " .
"" . $grantCellHtml . " | "
) );
}
$out->addHTML( \Html::closeElement( 'table' ) );
}
protected function getGroupName() {
return 'users';
}
}