From e78acdc3f14234a4408ec0a29c15dad8a630ef89 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 22 Jul 2011 10:45:07 +0000 Subject: [PATCH] Reduce a bit the coupling between Skin and OutputPage: * Removed Skin::setupUserCss() and merged it in OutputPage::buildCssLinks() and OutputPage::buildCssLinksArray(), also removed its call from ApiParse.php * Moved Skin::userCanPreview() to OutputPage since two of the three calls to that function are made from there and the last one in SkinTemplate.php is in a somewhat deprecated function * Removed the Skin parameter from OutputPage::buildCssLinks(), OutputPage::getHeadScripts(), OutputPage::getBottomScripts() and OutputPage::makeResourceLoaderLink() since we now have a context Also made ApiParse.php call createContext() instead of create a new RequestContext manually and set its Title so so that it does not rely on $wgRequest and $wgTitle to get that member objects --- includes/OutputPage.php | 114 ++++++++++++++++++++++++++++---------- includes/Skin.php | 68 +---------------------- includes/SkinTemplate.php | 6 +- includes/api/ApiParse.php | 6 +- 4 files changed, 92 insertions(+), 102 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2ce48f4b6f..aa80c2ddcc 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2269,7 +2269,6 @@ $templates if ( $sk->commonPrintStylesheet() ) { $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); } - $sk->setupUserCss( $this ); $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $userdir ) ); @@ -2286,9 +2285,9 @@ $templates $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; $ret .= implode( "\n", array( - $this->getHeadLinks( $sk, true ), - $this->buildCssLinks( $sk ), - $this->getHeadScripts( $sk ), + $this->getHeadLinks( null, true ), + $this->buildCssLinks(), + $this->getHeadScripts(), $this->getHeadItems() ) ); @@ -2397,13 +2396,12 @@ $templates /** * TODO: Document - * @param $skin Skin * @param $modules Array/string with the module name * @param $only String ResourceLoaderModule TYPE_ class constant * @param $useESI boolean * @return string html