tag) * @param $action the action to be performed by this form or empty for link to self * @param $name form name (optional) * @param $method the method used for the action (defaults to 'post') * @param $target Target frame of the form (optional) */ function it_html_form($action='*', $name='', $method='post', $target='') { if ($action == '*') $action = $_SERVER['PHP_SELF']; $this->name = $name; echo '
'; } /** * Close the form (echo
tag) */ function close() { echo ""; } /** * Add a parameter (as a hidden field) * @param $name parameter name * @param $value default (?) value * @param $return_output if true, output will be returned instaed of echoed */ function hidden($name, $value="", $return_output=false) { $output = ""; if ($return_output) return $output; else echo $output; } /** * Create a text field or a textarea if size is width:height * @param $name text field name * @param $size textfield width[:height] in chars * @param $maxlength maximum length of input * @param $value text field value */ function text($name, $size=8, $maxlength=255, $value="") { if (strchr($size, ":")) { list($cols, $rows) = explode(":", $size); echo ""; } else echo ""; } /** * Create a password field (masked characters) * @param $name text field name * @param $size textfield width[:height] in chars * @param $maxlength maximum length of input * @param $value text field value */ function password($name, $size=8, $maxlength=255, $value="") { echo ""; } /** * Create a dropdown menu object * @param $name dropdown field name * @param $options array (value => text) of available options or * string key:val{,key:val} where key will be rawurldecoded so it may contain %2C as comma * @param $selected currently selected value */ function select($name, $options, $selected='') { if (!is_array($options)) { $opts = explode(',', $options); $options = array(); foreach($opts as $opt) { list($key, $value) = explode(':', $opt); $options[rawurldecode($key)] = $value; } } echo ''; } /** * Create a filename field with browse button * @param $name file field name * @param $label label to be echoed before the field * @param $size file field width in chars * @param $maxlength maximum length of input * @param $value text field value */ function file($name, $label="", $size=16, $maxlength=255, $value="filename") { echo $label.""; } /** * Create a Submit button * @param $label button label * @param $name button name */ function submit($label="", $name="") { if (!$label) $label = T('Button-Save'); echo ""; } } /* End class html_form */ ?>