From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/parser/ParserOptions.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'includes/parser/ParserOptions.php') diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index e6a9f3a7..985bba28 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -5,10 +5,8 @@ * @todo document * @ingroup Parser */ -class ParserOptions -{ +class ParserOptions { # All variables are supposed to be private in theory, although in practise this is not the case. - var $mUseTeX; # Use texvc to expand tags var $mUseDynamicDates; # Use DateFormatter to format dates var $mInterwikiMagic; # Interlanguage links are removed and returned in an array var $mAllowExternalImages; # Allow external images inline @@ -35,9 +33,8 @@ class ParserOptions var $mUser; # Stored user object, just used to initialise the skin var $mIsPreview; # Parsing the page for a "preview" operation var $mIsSectionPreview; # Parsing the page for a "preview" operation on a single section - var $mIsPrintable; # Parsing the printable version of the page + var $mIsPrintable; # Parsing the printable version of the page - function getUseTeX() { return $this->mUseTeX; } function getUseDynamicDates() { return $this->mUseDynamicDates; } function getInterwikiMagic() { return $this->mInterwikiMagic; } function getAllowExternalImages() { return $this->mAllowExternalImages; } @@ -59,8 +56,8 @@ class ParserOptions function getExternalLinkTarget() { return $this->mExternalLinkTarget; } function getIsPreview() { return $this->mIsPreview; } function getIsSectionPreview() { return $this->mIsSectionPreview; } - function getIsPrintable() { return $this->mIsPrintable; } - + function getIsPrintable() { return $this->mIsPrintable; } + function getSkin() { if ( !isset( $this->mSkin ) ) { $this->mSkin = $this->mUser->getSkin(); @@ -82,7 +79,6 @@ class ParserOptions return $this->mTimestamp; } - function setUseTeX( $x ) { return wfSetVar( $this->mUseTeX, $x ); } function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); } function setInterwikiMagic( $x ) { return wfSetVar( $this->mInterwikiMagic, $x ); } function setAllowExternalImages( $x ) { return wfSetVar( $this->mAllowExternalImages, $x ); } @@ -107,8 +103,8 @@ class ParserOptions function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); } function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); } function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); } - function setIsPrintable( $x ) { return wfSetVar( $this->mIsPrintable, $x ); } - + function setIsPrintable( $x ) { return wfSetVar( $this->mIsPrintable, $x ); } + function __construct( $user = null ) { $this->initialiseFromUser( $user ); } @@ -123,12 +119,13 @@ class ParserOptions /** Get user options */ function initialiseFromUser( $userInput ) { - global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; + global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize; global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures; global $wgExternalLinkTarget; - $fname = 'ParserOptions::initialiseFromUser'; - wfProfileIn( $fname ); + + wfProfileIn( __METHOD__ ); + if ( !$userInput ) { global $wgUser; if ( isset( $wgUser ) ) { @@ -142,7 +139,6 @@ class ParserOptions $this->mUser = $user; - $this->mUseTeX = $wgUseTeX; $this->mUseDynamicDates = $wgUseDynamicDates; $this->mInterwikiMagic = $wgInterwikiMagic; $this->mAllowExternalImages = $wgAllowExternalImages; @@ -167,6 +163,7 @@ class ParserOptions $this->mExternalLinkTarget = $wgExternalLinkTarget; $this->mIsPreview = false; $this->mIsSectionPreview = false; - wfProfileOut( $fname ); + + wfProfileOut( __METHOD__ ); } } -- cgit v1.2.3-54-g00ecf