Drop the $out params I added before I added context to Skin, as well deprecate some...
authorDaniel Friesen <dantman@users.mediawiki.org>
Wed, 4 May 2011 10:43:40 +0000 (10:43 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Wed, 4 May 2011 10:43:40 +0000 (10:43 +0000)
includes/Skin.php
includes/SkinTemplate.php
includes/api/ApiParse.php

index eeb71cf..cd9b453 100644 (file)
@@ -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<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">" .
                                $listInternals . "</ul>\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 = '';
 
index bc86944..9404c6b 100644 (file)
@@ -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 ) ?
                        '<span class="subpages">' . $subpagestr . '</span>' . $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 ) ) ) {
index d154a2d..d5522c5 100644 (file)
@@ -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();
        }
 
        /**