X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHTMLForm.php;h=e1bb1234b3e66b74bd872107f2075e427451db05;hb=60610e24efff81cdd510b27b5e97c04b993ea323;hp=e7f0bd00f025233a68ceb49445bac6b232fca89b;hpb=aa487fcf9742f6990ddd58ce35cec2b76c2ef4a2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index e7f0bd00f0..e1bb1234b3 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1,45 +1,154 @@ ".wfMsg($name)."\n" . + /** name of our form. Used as prefix for labels */ + var $mName; + + /** + * @access private + * @param string $name Name of the fieldset. + * @param string $content HTML content to put in. + * @return string HTML fieldset + */ + function fieldset( $name, $content ) { + return "
".wfMsg($this->mName.'-'.$name)."\n" . $content . "\n
\n"; } - /* private */ function checkbox( $varname, $checked=false ) { - $checked = isset( $GLOBALS[$varname] ) && $GLOBALS[$varname] ; + /** + * @access private + * @param string $varname Name of the checkbox. + * @param boolean $checked Set true to check the box (default False). + */ + function checkbox( $varname, $checked=false ) { + $checked = isset( $_POST[$varname] ) && $_POST[$varname] ; return "
\n"; } - /* private */ function textbox( $varname, $value='', $size=20 ) { - $value = isset( $GLOBALS[$varname] ) ? $GLOBALS[$varname] : ''; - return "
\n"; + /** + * @access private + * @param string $varname Name of the textbox. + * @param string $value Optional value (default empty) + * @param integer $size Optional size of the textbox (default 20) + */ + function textbox( $varname, $value='', $size=20 ) { + $value = isset( $_POST[$varname] ) ? $_POST[$varname] : $value; + return "
\n"; } - /* private */ function radiobox( $varname, $fields ) { + + /** + * @access private + * @param string $varname Name of the radiobox. + * @param array $fields Various fields. + */ + function radiobox( $varname, $fields ) { foreach ( $fields as $value => $checked ) { - $s .= "