r74245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74244‎ | r74245 | r74246 >
Date:05:38, 4 October 2010
Author:dantman
Status:ok
Tags:
Comment:
Clean up names of my bodyAttr hooks on Brion's recomendation.
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1193,7 +1193,7 @@
11941194 $parserOutput: the parserOutput (object) that corresponds to the page
11951195 $text: the text that will be displayed, in HTML (string)
11961196
1197 -'OutputPageBodyAttrs': called when OutputPage::headElement is creating the body
 1197+'OutputPageBodyAttributes': called when OutputPage::headElement is creating the body
11981198 tag to allow for extensions to add attributes to the body of the page they might
11991199 need. Or to allow building extensions to add body classes that aren't of high
12001200 enough demand to be included in core.
Index: trunk/phase3/includes/OutputPage.php
@@ -2276,8 +2276,8 @@
22772277 $bodyAttrs['class'] .= ' ' . Sanitizer::escapeClass( 'page-' . $this->getTitle()->getPrefixedText() );
22782278 $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $wgUser->getSkin()->getSkinName() );
22792279
2280 - $sk->bodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need
2281 - wfRunHooks( 'OutputPageBodyAttrs', array( $this, $sk, &$bodyAttrs ) );
 2280+ $sk->addToBodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need
 2281+ wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
22822282
22832283 $ret .= Html::openElement( 'body', $bodyAttrs ) . "\n";
22842284
Index: trunk/phase3/includes/Skin.php
@@ -568,13 +568,13 @@
569569
570570 return "$numeric $type $name";
571571 }
572 -
 572+
573573 /**
574574 * This will be called by OutputPage::headElement when it is creating the
575575 * <body> tag, skins can override it if they have a need to add in any
576576 * body attributes or classes of their own.
577577 */
578 - function bodyAttributes( $out, &$bodyAttrs ) {
 578+ function addToBodyAttributes( $out, &$bodyAttrs ) {
579579 // does nothing by default
580580 }
581581

Status & tagging log