* (bug 2262) Hide math preferences when TeX is not enabled
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 29 May 2005 20:43:30 +0000 (20:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 29 May 2005 20:43:30 +0000 (20:43 +0000)
RELEASE-NOTES
includes/SpecialPreferences.php

index b110414..083f861 100644 (file)
@@ -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 ===
index 698216b..46b6d88 100644 (file)
@@ -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( "<fieldset>\n<legend>" . wfMsg('math') . '</legend>' );
-               foreach ( $mathopts as $k => $v ) {
-                       $checked = $k == $this->mMath ? ' checked="checked"' : '';
-                       $wgOut->addHTML( "<div><label><input type='radio' name='wpMath' value=\"$k\"$checked /> ".wfMsg($v)."</label></div>\n" );
+               global $wgUseTeX;
+               if( $wgUseTeX ) {
+                       $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg('math') . '</legend>' );
+                       foreach ( $mathopts as $k => $v ) {
+                               $checked = $k == $this->mMath ? ' checked="checked"' : '';
+                               $wgOut->addHTML( "<div><label><input type='radio' name='wpMath' value=\"$k\"$checked /> ".wfMsg($v)."</label></div>\n" );
+                       }
+                       $wgOut->addHTML( "</fieldset>\n\n" );
                }
-               $wgOut->addHTML( "</fieldset>\n\n" );
 
                # Files
                #