From 3ac572698587542c23d17cbd4fcb9f1220aaa334 Mon Sep 17 00:00:00 2001 From: Leo Koppelkamm Date: Mon, 11 Jul 2011 10:57:01 +0000 Subject: [PATCH] Add action-* class to body. Bug 4438. Based on patch by Subfader --- includes/Skin.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 2f2cc5cf94..639d8d456e 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -473,6 +473,7 @@ abstract class Skin { * @return String */ function getPageClasses( $title ) { + global $wgRequest; $numeric = 'ns-' . $title->getNamespace(); if ( $title->getNamespace() == NS_SPECIAL ) { @@ -491,8 +492,13 @@ abstract class Skin { } $name = Sanitizer::escapeClass( 'page-' . $title->getPrefixedText() ); - - return "$numeric $type $name"; + + if ( $wgRequest->getVal('action') ) { + $action = 'action-' . $wgRequest->getVal('action'); + } else { + $action = 'action-view'; + } + return "$numeric $type $name $action"; } /** -- 2.20.1