From: Antoine Musso Date: Thu, 30 Sep 2004 22:49:26 +0000 (+0000) Subject: class to build forms (c) JeLuF X-Git-Tag: 1.5.0alpha1~1720 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=aa487fcf9742f6990ddd58ce35cec2b76c2ef4a2;p=lhc%2Fweb%2Fwiklou.git class to build forms (c) JeLuF --- 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 "