getSkin() should get a Title as parameter.
authorPlatonides <platonides@users.mediawiki.org>
Wed, 11 Aug 2010 17:11:24 +0000 (17:11 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 11 Aug 2010 17:11:24 +0000 (17:11 +0000)
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/ParserOptions.php

index 5379d17..aacbaff 100644 (file)
@@ -132,7 +132,7 @@ class LinkHolderArray {
                global $wgContLang;
 
                $colours = array();
-               $sk = $this->parent->getOptions()->getSkin();
+               $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle );
                $linkCache = LinkCache::singleton();
                $output = $this->parent->getOutput();
 
@@ -269,7 +269,7 @@ class LinkHolderArray {
 
                wfProfileIn( __METHOD__ );
                # Make interwiki link HTML
-               $sk = $this->parent->getOptions()->getSkin();
+               $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle );
                $output = $this->parent->getOutput();
                $replacePairs = array();
                foreach( $this->interwikis as $key => $link ) {
@@ -294,7 +294,7 @@ class LinkHolderArray {
                $variantMap = array(); // maps $pdbkey_Variant => $keys (of link holders)
                $output = $this->parent->getOutput();
                $linkCache = LinkCache::singleton();
-               $sk = $this->parent->getOptions()->getSkin();
+               $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle );
                $threshold = $this->getStubThreshold();
                $titlesToBeConverted = '';
                $titlesAttrs = array();
index 44bc614..8f50799 100644 (file)
@@ -1145,7 +1145,7 @@ class Parser {
                                        substr( $m[0], 0, 20 ) . '"' );
                        }
                        $url = wfMsg( $urlmsg, $id);
-                       $sk = $this->mOptions->getSkin();
+                       $sk = $this->mOptions->getSkin( $this->mTitle );
                        $la = $sk->getExternalLinkAttributes( "external $CssClass" );
                        return "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
                } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
@@ -1174,7 +1174,7 @@ class Parser {
                global $wgContLang;
                wfProfileIn( __METHOD__ );
 
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
                $trail = '';
 
                # The characters '<' and '>' (which were escaped by
@@ -1423,7 +1423,7 @@ class Parser {
                global $wgContLang;
                wfProfileIn( __METHOD__ );
 
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
 
                $bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
                $s = array_shift( $bits );
@@ -1572,7 +1572,7 @@ class Parser {
         * @private
         */
        function maybeMakeExternalImage( $url ) {
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
                $imagesfrom = $this->mOptions->getAllowExternalImagesFrom();
                $imagesexception = !empty( $imagesfrom );
                $text = false;
@@ -1648,7 +1648,7 @@ class Parser {
                        $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD";
                }
 
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
                $holders = new LinkHolderArray( $this );
 
                # split the entire text string on occurences of [[
@@ -1991,7 +1991,7 @@ class Parser {
         */
        function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                list( $inside, $trail ) = Linker::splitTrail( $trail );
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
                # FIXME: use link() instead of deprecated makeKnownLinkObj()
                $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix );
                return $this->armorLinks( $link ) . $trail;
@@ -3743,7 +3743,7 @@ class Parser {
                }
 
                # We need this to perform operations on the HTML
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
 
                # headline counter
                $headlineCount = 0;
@@ -4480,7 +4480,7 @@ class Parser {
                $ig->setParser( $this );
                $ig->setHideBadImages();
                $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) );
-               $ig->useSkin( $this->mOptions->getSkin() );
+               $ig->useSkin( $this->mOptions->getSkin( $this->mTitle ) );
                $ig->mRevisionId = $this->mRevisionId;
 
                if ( isset( $params['showfilename'] ) ) {
@@ -4618,7 +4618,7 @@ class Parser {
                #  * text-bottom
 
                $parts = StringUtils::explode( "|", $options );
-               $sk = $this->mOptions->getSkin();
+               $sk = $this->mOptions->getSkin( $this->mTitle );
 
                # Give extensions a chance to select the file revision for us
                $skip = $time = $descQuery = false;
index bdff54c..6f6e2df 100644 (file)
@@ -74,9 +74,9 @@ class ParserOptions {
        function getIsPrintable()                   { $this->accessedOptions['printable'] = true;
                                                      return $this->mIsPrintable; }
 
-       function getSkin() {
+       function getSkin( $title = null ) {
                if ( !isset( $this->mSkin ) ) {
-                       $this->mSkin = $this->mUser->getSkin();
+                       $this->mSkin = $this->mUser->getSkin( $title );
                }
                return $this->mSkin;
        }