From 001df82cadf9557585592bdccc562fb28a762361 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Mon, 4 Oct 2010 05:38:48 +0000 Subject: [PATCH] Clean up names of my bodyAttr hooks on Brion's recomendation. --- docs/hooks.txt | 2 +- includes/OutputPage.php | 4 ++-- includes/Skin.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 4e27541db1..d4d6bb1dea 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1193,7 +1193,7 @@ the resulting HTML is about to be displayed. $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 +'OutputPageBodyAttributes': 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. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 866b4e5ad0..2a6030d04f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2276,8 +2276,8 @@ class OutputPage { $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 ) ); + $sk->addToBodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need + wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) ); $ret .= Html::openElement( 'body', $bodyAttrs ) . "\n"; diff --git a/includes/Skin.php b/includes/Skin.php index 0ccd2f100b..20125889f1 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -568,13 +568,13 @@ class Skin extends Linker { return "$numeric $type $name"; } - + /** * This will be called by OutputPage::headElement when it is creating the * 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 ) { + function addToBodyAttributes( $out, &$bodyAttrs ) { // does nothing by default } -- 2.20.1