X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHTMLForm.php;h=a13831f7a27688d24cb76d4cd54f2ecee19422df;hb=37b73a88820fda845e73f6a03f7406bad1e1d3b6;hp=9a041399460d3e5535370a5ef215ea209f2487ff;hpb=514120660ab6516d5c0e267b5084ddf105fd3f5c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 9a04139946..a13831f7a2 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1,48 +1,90 @@ ".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] : ''; + /* + * @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"; + "\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 .= "
\n"; } return $this->fieldset( $this->mName.'-'.$varname, $s ); } + + /* + * @access private + * @param string $varname Name of the textareabox. + * @param string $value Optional value (default empty) + * @param integer $size Optional size of the textarea (default 20) + */ + function textareabox ( $varname, $value='', $size=20 ) { + $value = isset( $_POST[$varname] ) ? $_POST[$varname] : $value; + return '
\n"; + } - /* private */ function arraybox( $varname , $size=20 ) { + /* + * @access private + * @param string $varname Name of the arraybox. + * @param integer $size Optional size of the textarea (default 20) + */ + function arraybox( $varname , $size=20 ) { $s = ''; - if ( isset( $GLOBALS[$varname] ) && is_array( $GLOBALS[$varname] ) ) { - foreach ( $GLOBALS[$varname] as $index=>$element ) { + if ( isset( $_POST[$varname] ) && is_array( $_POST[$varname] ) ) { + foreach ( $_POST[$varname] as $index=>$element ) { $s .= $element."\n"; } } return "