From 4f9c3545617eca2b07bd7c5b92f00effd6b668b8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 29 May 2005 20:43:30 +0000 Subject: [PATCH] * (bug 2262) Hide math preferences when TeX is not enabled --- RELEASE-NOTES | 1 + includes/SpecialPreferences.php | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b110414e6a..083f8617bd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -221,6 +221,7 @@ Various bugfixes, small features, and a few experimental things: * Add validate table and val_ip column through the updater. * Simple rate limiter for edits and page moves; set $wgRateLimits (somewhat experimental; currently needs memcached) +* (bug 2262) Hide math preferences when TeX is not enabled === Caveats === diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 698216b446..46b6d88644 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -204,7 +204,10 @@ class PreferencesForm { $wgUser->setOption( 'nickname', $this->mNick ); $wgUser->setOption( 'quickbar', $this->mQuickbar ); $wgUser->setOption( 'skin', $this->mSkin ); - $wgUser->setOption( 'math', $this->mMath ); + global $wgUseTeX; + if( $wgUseTeX ) { + $wgUser->setOption( 'math', $this->mMath ); + } $wgUser->setOption( 'date', $this->mDate ); $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch ) ); $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) ); @@ -600,12 +603,15 @@ class PreferencesForm { # Math # - $wgOut->addHTML( "
\n" . wfMsg('math') . '' ); - foreach ( $mathopts as $k => $v ) { - $checked = $k == $this->mMath ? ' checked="checked"' : ''; - $wgOut->addHTML( "
\n" ); + global $wgUseTeX; + if( $wgUseTeX ) { + $wgOut->addHTML( "
\n" . wfMsg('math') . '' ); + foreach ( $mathopts as $k => $v ) { + $checked = $k == $this->mMath ? ' checked="checked"' : ''; + $wgOut->addHTML( "
\n" ); + } + $wgOut->addHTML( "
\n\n" ); } - $wgOut->addHTML( "
\n\n" ); # Files # -- 2.20.1