$parserOutput: the parserOutput (object) that corresponds to the page
$text: the text that will be displayed, in HTML (string)
+'OutputPageBodyAttrs': called when OutputPage::headElement is creating the body
+tag to allow for extensions to add attributes to the body of the page they might
+need. Or to allow building extensions to add body classes that aren't of high
+enough demand to be included in core.
+$out: The OutputPage which called the hook, can be used to get the real title
+$sk: The Skin that called OutputPage::headElement
+&$bodyAttrs: An array of attributes for the body tag passed to Html::openElement
+
'OutputPageCheckLastModified': when checking if the page has been modified
since the last visit
&$modifiedTimes: array of timestamps.
$bodyAttrs['class'] .= ' ' . Sanitizer::escapeClass( 'page-' . $this->getTitle()->getPrefixedText() );
$bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $wgUser->getSkin()->getSkinName() );
+ $sk->bodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need
+ wfRunHooks( 'OutputPageBodyAttrs', array( $this, $sk, &$bodyAttrs ) );
+
$ret .= Html::openElement( 'body', $bodyAttrs ) . "\n";
return $ret;
return "$numeric $type $name";
}
+
+ /**
+ * This will be called by OutputPage::headElement when it is creating the
+ * <body> tag, skins can override it if they have a need to add in any
+ * body attributes or classes of their own.
+ */
+ function bodyAttributes( $out, &$bodyAttrs ) {
+ // does nothing by default
+ }
/**
* URL to the logo