.'/'. substr($this->hash, 2, 1);
}
- public static function renderMath( $tex, $params=array() ) {
- global $wgUser;
+ public static function renderMath( $tex, $params=array(), ParserOptions $parserOptions = null ) {
$math = new MathRenderer( $tex, $params );
- $math->setOutputMode( $wgUser->getOption('math'));
+ if ( $parserOptions )
+ $math->setOutputMode( $parserOptions->getMath() );
return $math->render();
}
}
static function math( $content, $attributes, $parser ) {
global $wgContLang;
- return $wgContLang->armourMath( MathRenderer::renderMath( $content, $attributes ) );
+ return $wgContLang->armourMath( MathRenderer::renderMath( $content, $attributes, $parser->mOptions ) );
}
static function gallery( $content, $attributes, $parser ) {
function getEnableLimitReport() { return $this->mEnableLimitReport; }
function getCleanSignatures() { return $this->mCleanSignatures; }
function getExternalLinkTarget() { return $this->mExternalLinkTarget; }
+ function getMath() { return $this->mMath; }
+
function getIsPreview() { return $this->mIsPreview; }
function getIsSectionPreview() { return $this->mIsSectionPreview; }
function getIsPrintable() { return $this->mIsPrintable; }
}
function getDateFormat() {
+ if ( !$this->getUseDynamicDates() ) {
+ throw new MWException( 'Getting DateFormat option without UseDynamicDates.' );
+ }
+
if ( !isset( $this->mDateFormat ) ) {
$this->mDateFormat = $this->mUser->getDatePreference();
}
function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); }
function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
+ function setMath( $x ) { return wfSetVar( $this->mMath, $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 ); }
$this->mEnableLimitReport = false;
$this->mCleanSignatures = $wgCleanSignatures;
$this->mExternalLinkTarget = $wgExternalLinkTarget;
+ $this->mMath = $user->getOption( 'math' );
+
$this->mIsPreview = false;
$this->mIsSectionPreview = false;
$this->mIsPrintable = false;