From aa487fcf9742f6990ddd58ce35cec2b76c2ef4a2 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 30 Sep 2004 22:49:26 +0000 Subject: [PATCH] class to build forms (c) JeLuF --- includes/HTMLForm.php | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 includes/HTMLForm.php diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php new file mode 100644 index 0000000000..e7f0bd00f0 --- /dev/null +++ b/includes/HTMLForm.php @@ -0,0 +1,45 @@ +".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 "