From: Jens Frank Date: Thu, 30 Sep 2004 21:33:34 +0000 (+0000) Subject: Admin interface to site parameters, UI part. X-Git-Tag: 1.5.0alpha1~1724 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=414079a69fc7901511bdec1593c21e2e5a52ccdb;p=lhc%2Fweb%2Fwiklou.git Admin interface to site parameters, UI part. No way to save settings, yet. Might be a starting point for Hashar's efforts --- diff --git a/includes/SpecialSitesettings.php b/includes/SpecialSitesettings.php new file mode 100644 index 0000000000..ecc97a9706 --- /dev/null +++ b/includes/SpecialSitesettings.php @@ -0,0 +1,222 @@ +execute(); +} + +class SiteSettingsForm { + var $mPosted, $mRequest, $mReset, $mSaveprefs; + + function SiteSettingsForm ( &$request ) { + $this->mPosted = $request->wasPosted(); + $this->mRequest = $request; + } + + function execute() { + if ( wfReadOnly() ) { + $wgOut->readOnlyPage(); + return; + } + if ( $this->mReset ) { + $this->resetPrefs(); + $this->mainPrefsForm( wfMsg( "prefsreset" ) ); + } else if ( $this->mSaveprefs ) { + $this->savePreferences(); + } else { + $this->resetPrefs(); + $this->mainPrefsForm( "" ); + } + } + + /* private */ function resetPrefs() { + return; + } + + /* private */ function fieldset( $name, $content ) { + return "
".wfMsg($name)."\n" . + $content . "\n
\n"; + } + + /* private */ function checkbox( $varname, $checked=false ) { + $checked = isset( $GLOBALS[$varname] ) && $GLOBALS[$varname] ; + return "
\n"; + } + + /* private */ function textbox( $varname, $value='', $size=20 ) { + $value = isset( $GLOBALS[$varname] ) ? $GLOBALS[$varname] : ''; + return "
\n"; + } + /* private */ function radiobox( $varname, $fields ) { + foreach ( $fields as $value => $checked ) { + $s .= "
\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 "