4 * Class to build various forms
7 /* private */ function fieldset( $name, $content ) {
8 return "<fieldset><legend>".wfMsg($name)."</legend>\n" .
9 $content . "\n</fieldset>\n";
12 /* private */ function checkbox( $varname, $checked=false ) {
13 $checked = isset( $GLOBALS[$varname] ) && $GLOBALS[$varname] ;
14 return "<div><input type='checkbox' value=\"1\" id=\"{$varname}\" name=\"wpOp{$varname}\"" .
15 ( $checked ?
' checked="checked"' : '' ) .
16 " /><label for=\"{$varname}\">". wfMsg( "sitesettings-".$varname ) .
20 /* private */ function textbox( $varname, $value='', $size=20 ) {
21 $value = isset( $GLOBALS[$varname] ) ?
$GLOBALS[$varname] : '';
22 return "<div><label>". wfMsg( "sitesettings-".$varname ) .
23 "<input type='text' name=\"wpOp{$varname}\" value=\"{$value}\" size=\"{$size}\" /></label></div>\n";
25 /* private */ function radiobox( $varname, $fields ) {
26 foreach ( $fields as $value => $checked ) {
27 $s .= "<div><label><input type='radio' name=\"wpOp{$varname}\" value=\"{$value}\"" .
28 ( $checked ?
' checked="checked"' : '' ) . " />" . wfMsg( 'sitesettings-'.$varname.'-'.$value ) .
31 return $this->fieldset( 'sitesettings-'.$varname, $s );
34 /* private */ function arraybox( $varname , $size=20 ) {
36 if ( isset( $GLOBALS[$varname] ) && is_array( $GLOBALS[$varname] ) ) {
37 foreach ( $GLOBALS[$varname] as $index=>$element ) {
41 return "<div><label>".wfMsg( 'sitesettings-'.$varname ).
42 "<textarea name=\"wpOp{$varname}\" rows=\"5\" cols=\"{$size}\">{$s}</textarea>\n";