From: Daniel Friesen Date: Wed, 4 May 2011 10:43:40 +0000 (+0000) Subject: Drop the $out params I added before I added context to Skin, as well deprecate some... X-Git-Tag: 1.31.0-rc.0~30418 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=8569cc6203486063d1285d7593104ce7204210b4;p=lhc%2Fweb%2Fwiklou.git Drop the $out params I added before I added context to Skin, as well deprecate some of the $out params in other methods. --- diff --git a/includes/Skin.php b/includes/Skin.php index eeb71cf030..cd9b45367a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -455,6 +455,9 @@ abstract class Skin { /** * Add skin specific stylesheets + * Calling this method with an $out of anything but the same OutputPage + * inside ->getContext()->getOutput() is deprecated. The $out arg is kept + * for compatibility purposes with skins. * @param $out OutputPage * @delete */ @@ -505,15 +508,10 @@ abstract class Skin { return $wgLogo; } - /** - * The format without an explicit $out argument is deprecated - */ - function getCategoryLinks( OutputPage $out=null ) { + function getCategoryLinks() { global $wgUseCategoryBrowser, $wgContLang; - if( $out === null ){ - $out = $this->getContext()->output; - } + $out = $this->getContext()->output; if ( count( $out->mCategoryLinks ) == 0 ) { return ''; @@ -602,17 +600,10 @@ abstract class Skin { return $return; } - /** - * The ->getCategories() form is deprecated, please instead use - * the ->getCategories( $out ) form with whatout OutputPage is on hand - */ - function getCategories( OutputPage $out=null ) { + function getCategories() { + $out = $this->getContext()->output; - if( $out === null ){ - $out = $this->getContext()->output; - } - - $catlinks = $this->getCategoryLinks( $out ); + $catlinks = $this->getCategoryLinks(); $classes = 'catlinks'; @@ -668,11 +659,11 @@ abstract class Skin { * area. * @return String HTML containing debug data, if enabled (otherwise empty). */ - protected function generateDebugHTML( OutputPage $out ) { + protected function generateDebugHTML() { global $wgShowDebug; if ( $wgShowDebug ) { - $listInternals = $this->formatDebugHTML( $out->mDebugtext ); + $listInternals = $this->formatDebugHTML( $this->getContext()->getOutput()->mDebugtext ); return "\n
\nDebug data:\n"; } @@ -781,10 +772,7 @@ abstract class Skin { return ''; } - /** - * The format without an explicit $out argument is deprecated - */ - function subPageSubtitle( OutputPage $out=null ) { + function subPageSubtitle() { $out = $this->getContext()->getOutput(); $subpages = ''; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index bc86944846..9404c6b5c2 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -245,7 +245,7 @@ class SkinTemplate extends Skin { $tpl->set( 'isarticle', $out->isArticle() ); $tpl->setRef( 'thispage', $this->thispage ); - $subpagestr = $this->subPageSubtitle( $out ); + $subpagestr = $this->subPageSubtitle(); $tpl->set( 'subtitle', !empty( $subpagestr ) ? '' . $subpagestr . '' . $out->getSubtitle() : @@ -258,7 +258,7 @@ class SkinTemplate extends Skin { '' ); - $tpl->set( 'catlinks', $this->getCategories( $out ) ); + $tpl->set( 'catlinks', $this->getCategories() ); if( $out->isSyndicated() ) { $feeds = array(); foreach( $out->getSyndicationLinks() as $format => $link ) { @@ -506,7 +506,7 @@ class SkinTemplate extends Skin { $tpl->set( 'headscripts', $out->getScript() ); } - $tpl->set( 'debughtml', $this->generateDebugHTML( $out ) ); + $tpl->set( 'debughtml', $this->generateDebugHTML() ); // original version by hansm if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index d154a2de23..d5522c5af7 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -373,7 +373,7 @@ class ApiParse extends ApiBase { private function categoriesHtml( $categories ) { global $wgOut, $wgUser; $wgOut->addCategoryLinks( $categories ); - return $wgUser->getSkin()->getCategories( $wgOut ); + return $wgUser->getSkin()->getCategories(); } /**