r87389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87388‎ | r87389 | r87390 >
Date:10:43, 4 May 2011
Author:dantman
Status:ok
Tags:
Comment:
Drop the $out params I added before I added context to Skin, as well deprecate some of the $out params in other methods.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -373,7 +373,7 @@
374374 private function categoriesHtml( $categories ) {
375375 global $wgOut, $wgUser;
376376 $wgOut->addCategoryLinks( $categories );
377 - return $wgUser->getSkin()->getCategories( $wgOut );
 377+ return $wgUser->getSkin()->getCategories();
378378 }
379379
380380 /**
Index: trunk/phase3/includes/SkinTemplate.php
@@ -245,7 +245,7 @@
246246 $tpl->set( 'isarticle', $out->isArticle() );
247247
248248 $tpl->setRef( 'thispage', $this->thispage );
249 - $subpagestr = $this->subPageSubtitle( $out );
 249+ $subpagestr = $this->subPageSubtitle();
250250 $tpl->set(
251251 'subtitle', !empty( $subpagestr ) ?
252252 '<span class="subpages">' . $subpagestr . '</span>' . $out->getSubtitle() :
@@ -258,7 +258,7 @@
259259 ''
260260 );
261261
262 - $tpl->set( 'catlinks', $this->getCategories( $out ) );
 262+ $tpl->set( 'catlinks', $this->getCategories() );
263263 if( $out->isSyndicated() ) {
264264 $feeds = array();
265265 foreach( $out->getSyndicationLinks() as $format => $link ) {
@@ -506,7 +506,7 @@
507507 $tpl->set( 'headscripts', $out->getScript() );
508508 }
509509
510 - $tpl->set( 'debughtml', $this->generateDebugHTML( $out ) );
 510+ $tpl->set( 'debughtml', $this->generateDebugHTML() );
511511
512512 // original version by hansm
513513 if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
Index: trunk/phase3/includes/Skin.php
@@ -455,6 +455,9 @@
456456
457457 /**
458458 * Add skin specific stylesheets
 459+ * Calling this method with an $out of anything but the same OutputPage
 460+ * inside ->getContext()->getOutput() is deprecated. The $out arg is kept
 461+ * for compatibility purposes with skins.
459462 * @param $out OutputPage
460463 * @delete
461464 */
@@ -505,15 +508,10 @@
506509 return $wgLogo;
507510 }
508511
509 - /**
510 - * The format without an explicit $out argument is deprecated
511 - */
512 - function getCategoryLinks( OutputPage $out=null ) {
 512+ function getCategoryLinks() {
513513 global $wgUseCategoryBrowser, $wgContLang;
514514
515 - if( $out === null ){
516 - $out = $this->getContext()->output;
517 - }
 515+ $out = $this->getContext()->output;
518516
519517 if ( count( $out->mCategoryLinks ) == 0 ) {
520518 return '';
@@ -602,18 +600,11 @@
603601 return $return;
604602 }
605603
606 - /**
607 - * The ->getCategories() form is deprecated, please instead use
608 - * the ->getCategories( $out ) form with whatout OutputPage is on hand
609 - */
610 - function getCategories( OutputPage $out=null ) {
 604+ function getCategories() {
 605+ $out = $this->getContext()->output;
611606
612 - if( $out === null ){
613 - $out = $this->getContext()->output;
614 - }
 607+ $catlinks = $this->getCategoryLinks();
615608
616 - $catlinks = $this->getCategoryLinks( $out );
617 -
618609 $classes = 'catlinks';
619610
620611 // Check what we're showing
@@ -668,11 +659,11 @@
669660 * area.
670661 * @return String HTML containing debug data, if enabled (otherwise empty).
671662 */
672 - protected function generateDebugHTML( OutputPage $out ) {
 663+ protected function generateDebugHTML() {
673664 global $wgShowDebug;
674665
675666 if ( $wgShowDebug ) {
676 - $listInternals = $this->formatDebugHTML( $out->mDebugtext );
 667+ $listInternals = $this->formatDebugHTML( $this->getContext()->getOutput()->mDebugtext );
677668 return "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">" .
678669 $listInternals . "</ul>\n";
679670 }
@@ -781,10 +772,7 @@
782773 return '';
783774 }
784775
785 - /**
786 - * The format without an explicit $out argument is deprecated
787 - */
788 - function subPageSubtitle( OutputPage $out=null ) {
 776+ function subPageSubtitle() {
789777 $out = $this->getContext()->getOutput();
790778 $subpages = '';
791779

Status & tagging log