) );
}
$out->addHTML( Xml::closeElement( 'table' ) );
+ $this->outputNamespaceProtectionInfo();
+ }
+
+ private function outputNamespaceProtectionInfo() {
+ global $wgNamespaceProtection, $wgParser, $wgContLang;
+ $out = $this->getOutput();
+
+ if ( count( $wgNamespaceProtection ) == 0 ) {
+ return;
+ }
+
+ $header = $this->msg( 'listgrouprights-namespaceprotection-header' )->parse();
+ $out->addHTML(
+ Html::rawElement( 'h2', array(), Html::element( 'span', array(
+ 'class' => 'mw-headline',
+ 'id' => $wgParser->guessSectionNameFromWikiText( $header )
+ ), $header ) ) .
+ Xml::openElement( 'table', array( 'class' => 'wikitable' ) ) .
+ Html::element(
+ 'th',
+ array(),
+ $this->msg( 'listgrouprights-namespaceprotection-namespace' )->text()
+ ) .
+ Html::element(
+ 'th',
+ array(),
+ $this->msg( 'listgrouprights-namespaceprotection-restrictedto' )->text()
+ )
+ );
+
+ ksort( $wgNamespaceProtection );
+ foreach ( $wgNamespaceProtection as $namespace => $rights ) {
+ if ( !in_array( $namespace, MWNamespace::getValidNamespaces() ) ) {
+ continue;
+ }
+
+ if ( $namespace == NS_MAIN ) {
+ $namespaceText = $this->msg( 'blanknamespace' )->text();
+ } else {
+ $namespaceText = $wgContLang->convertNamespace( $namespace );
+ }
+
+ $out->addHTML(
+ Xml::openElement( 'tr' ) .
+ Html::rawElement(
+ 'td',
+ array(),
+ Linker::link(
+ SpecialPage::getTitleFor( 'Allpages' ),
+ $namespaceText,
+ array(),
+ array( 'namespace' => $namespace )
+ )
+ ) .
+ Xml::openElement( 'td' ) . Xml::openElement( 'ul' )
+ );
+
+ if ( !is_array( $rights ) ) {
+ $rights = array( $rights );
+ }
+
+ foreach ( $rights as $right ) {
+ $out->addHTML(
+ Html::rawElement( 'li', array(), $this->msg(
+ 'listgrouprights-right-display',
+ User::getRightDescription( $right ),
+ Html::element(
+ 'span',
+ array( 'class' => 'mw-listgrouprights-right-name' ),
+ $right
+ )
+ )->parse() )
+ );
+ }
+
+ $out->addHTML(
+ Xml::closeElement( 'ul' ) .
+ Xml::closeElement( 'td' ) .
+ Xml::closeElement( 'tr' )
+ );
+ }
+ $out->addHTML( Xml::closeElement( 'table' ) );
}
/**
"listgrouprights-removegroup-self": "Remove {{PLURAL:$2|group|groups}} from own account: $1",
"listgrouprights-addgroup-self-all": "Add all groups to own account",
"listgrouprights-removegroup-self-all": "Remove all groups from own account",
+ "listgrouprights-namespaceprotection-header": "Namespace restrictions",
+ "listgrouprights-namespaceprotection-namespace": "Namespace",
+ "listgrouprights-namespaceprotection-restrictedto": "Right(s) allowing user to edit",
"trackingcategories": "Tracking categories",
"trackingcategories-summary": "This page lists tracking categories which are automatically populated by the MediaWiki software. Their names can be changed by altering the relevant system messages in the {{ns:8}} namespace.",
"trackingcategories-msg": "Tracking category",
"listgrouprights-removegroup-self": "This is an individual right for groups, used on [[Special:ListGroupRights]].\n* $1 - the group names\n* $2 - the number of group names in $1",
"listgrouprights-addgroup-self-all": "Used on [[Special:ListGroupRights]].\n{{Related|Listgrouprights}}",
"listgrouprights-removegroup-self-all": "Used on [[Special:ListGroupRights]].\n{{Related|Listgrouprights}}",
+ "listgrouprights-namespaceprotection-header": "Shown on [[Special:ListGroupRights]] as the header for the namespace restrictions table.",
+ "listgrouprights-namespaceprotection-namespace": "Shown on [[Special:ListGroupRights]] as the 'namespace' column header for the namespace restrictions table.",
+ "listgrouprights-namespaceprotection-restrictedto": "Shown on [[Special:ListGroupRights]] as the 'right(s) allowing user to edit' column header for the namespace restrictions table.",
"trackingcategories": "[[Special:TrackingCategories]] page implementing list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]].\n{{Identical|Tracking category}}",
"trackingcategories-summary": "Description for [[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking category]]",
"trackingcategories-msg": "Header for the message column of the table on [[Special:TrackingCategories]]. This column lists the mediawiki message that controls the tracking category in question.\n{{Identical|Tracking category}}",