<?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() {
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;
$this->checkbox( 'wgUseDatabaseMessages' ) .
$this->checkbox( 'wgUseCategoryMagic' ) .
$this->checkbox( 'wgUseCategoryBrowser' ) .
+ $this->checkbox( 'wgDisableLangConversion' ).
$this->textbox( 'wgHitcounterUpdateFreq' ) .
$this->textbox( 'wgExtraSubtitle' ).
$this->textbox( 'wgSiteSupportPage' ) .
$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' ) .
$this->checkbox( 'wgDebugComments' ) .
$this->checkbox( 'wgLogQueries' ) .
$this->checkbox( 'wgDebugDumpSql' ) .
- $this->checkbox( 'wgIgnoreSQLErrors' ) .
$this->fieldset( 'sitesettings-debugging-profiling',
$this->checkbox( 'wgProfiling' ) .
$this->textbox( 'wgProfileLimit' ) .