specified a filename without extension.
* (bug 26851) Special:UserRights now allows to prefill the reason field
* New maintenance script to fix double redirects (maintenance/fixDoubleRedirects.php)
+* (bug 23315) New body classes to allow easier styling of special pages
=== Bug fixes in 1.18 ===
* (bug 23119) WikiError class and subclasses are now marked as deprecated
# A <body> class is probably not the best way to do this . . .
$bodyAttrs['class'] .= ' capitalize-all-nouns';
}
- $bodyAttrs['class'] .= ' ns-' . $this->getTitle()->getNamespace();
- if ( $this->getTitle()->getNamespace() == NS_SPECIAL ) {
- $bodyAttrs['class'] .= ' ns-special';
- } elseif ( $this->getTitle()->isTalkPage() ) {
- $bodyAttrs['class'] .= ' ns-talk';
- } else {
- $bodyAttrs['class'] .= ' ns-subject';
- }
- $bodyAttrs['class'] .= ' ' . Sanitizer::escapeClass( 'page-' . $this->getTitle()->getPrefixedText() );
- $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $wgUser->getSkin()->getSkinName() );
+ $bodyAttrs['class'] .= ' ' . $sk->getPageClasses( $this->getTitle() );
+ $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $sk->getSkinName() );
$sk->addToBodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need
wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
if ( $title->getNamespace() == NS_SPECIAL ) {
$type = 'ns-special';
+ // bug 23315: provide a class based on the canonical special page name without subpages
+ list( $canonicalName ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );
+ if ( $canonicalName ) {
+ $type .= ' ' . Sanitizer::escapeClass( "special-$canonicalName" );
+ } else {
+ $type .= ' mw-invalidspecialpage';
+ }
} elseif ( $title->isTalkPage() ) {
$type = 'ns-talk';
} else {