* (bug 1938) Fix normalization of character references in link text and
[lhc/web/wiklou.git] / includes / SpecialSitesettings.php
index ecc97a9..87f5559 100644 (file)
@@ -1,19 +1,24 @@
 <?php
+/**
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+require_once('HTMLForm.php');
 
-function wfSpecialSiteSettings()
-{
+function wfSpecialSiteSettings() {
        global $wgRequest;
 
        $form = new SiteSettingsForm( $wgRequest );
        $form->execute();
 }
 
-class SiteSettingsForm {
+class SiteSettingsForm extends HTMLForm {
        var $mPosted, $mRequest, $mReset, $mSaveprefs;
        
        function SiteSettingsForm ( &$request ) {
                $this->mPosted = $request->wasPosted();
                $this->mRequest = $request;
+               $this->mName = 'sitesettings';
        }
 
        function execute() {
@@ -36,44 +41,6 @@ class SiteSettingsForm {
                return;
        }
 
-       /* private */ function fieldset( $name, $content ) {
-               return "<fieldset><legend>".wfMsg($name)."</legend>\n" .
-                       $content . "\n</fieldset>\n";
-       }
-
-       /* private */ function checkbox( $varname, $checked=false ) {
-               $checked = isset( $GLOBALS[$varname] ) && $GLOBALS[$varname] ;
-               return "<div><input type='checkbox' value=\"1\" id=\"{$varname}\" name=\"wpOp{$varname}\"" .
-                       ( $checked ? ' checked="checked"' : '' ) .
-                       " /><label for=\"{$varname}\">". wfMsg( "sitesettings-".$varname ) .
-                       "</label></div>\n";
-       }
-
-       /* private */ function textbox( $varname, $value='', $size=20 ) {
-               $value = isset( $GLOBALS[$varname] ) ? $GLOBALS[$varname] : '';
-               return "<div><label>". wfMsg( "sitesettings-".$varname ) .
-                       "<input type='text' name=\"wpOp{$varname}\" value=\"{$value}\" size=\"{$size}\" /></label></div>\n";
-       }
-       /* private */ function radiobox( $varname, $fields ) {
-               foreach ( $fields as $value => $checked ) {
-                       $s .= "<div><label><input type='radio' name=\"wpOp{$varname}\" value=\"{$value}\"" .
-                               ( $checked ? ' checked="checked"' : '' ) . " />" . wfMsg( 'sitesettings-'.$varname.'-'.$value ) .
-                               "</label></div>\n";
-               }
-               return $this->fieldset( 'sitesettings-'.$varname, $s );
-       }
-
-       /* private */ function arraybox( $varname , $size=20 ) {
-               $s = '';
-               if ( isset( $GLOBALS[$varname] ) && is_array( $GLOBALS[$varname] ) ) {
-                       foreach ( $GLOBALS[$varname] as $index=>$element ) {
-                               $s .= $element."\n";
-                       }
-               }
-               return "<div><label>".wfMsg( 'sitesettings-'.$varname ).
-                       "<textarea name=\"wpOp{$varname}\" rows=\"5\" cols=\"{$size}\">{$s}</textarea>\n";
-       }
-
        /* private */ function mainPrefsForm( $err ) {
                global $wgOut;
 
@@ -95,6 +62,7 @@ class SiteSettingsForm {
                        $this->checkbox( 'wgUseDatabaseMessages' ) .
                        $this->checkbox( 'wgUseCategoryMagic' ) .
                        $this->checkbox( 'wgUseCategoryBrowser' ) .
+                       $this->checkbox( 'wgDisableLangConversion' ).
                        $this->textbox( 'wgHitcounterUpdateFreq' ) .
                        $this->textbox( 'wgExtraSubtitle' ).
                        $this->textbox( 'wgSiteSupportPage' ) .
@@ -141,7 +109,7 @@ class SiteSettingsForm {
                $wgOut->addHTML( $this->fieldset( "sitesettings-images" ,
                        $this->checkbox( 'wgAllowExternalImages' ) .
                        $this->fieldset( 'sitesettings-images-upload' ,
-                               $this->checkbox( 'wgDisableUploads' ) .
+                               $this->checkbox( 'wgEnableUploads' ) .
                                $this->checkbox( 'wgRemoteUploads' ) .
                                $this->arraybox( 'wgFileExtensions' ) .
                                $this->arraybox( 'wgFileBlacklist' ) .
@@ -202,7 +170,6 @@ class SiteSettingsForm {
                        $this->checkbox( 'wgDebugComments' ) .
                        $this->checkbox( 'wgLogQueries' ) .
                        $this->checkbox( 'wgDebugDumpSql' ) .
-                       $this->checkbox( 'wgIgnoreSQLErrors' ) .
                        $this->fieldset( 'sitesettings-debugging-profiling',
                                $this->checkbox( 'wgProfiling' ) .
                                $this->textbox( 'wgProfileLimit' ) .