value - default is empty array var $method; // default is POST function PlcForm ($full_url, $values, $method="POST") { // so we can use the various l_* functions: // we parse the url to extract var-values pairs, // and add them to the 'values' argument if any // extract var=value settings from url if any $split=split_url($full_url); $this->url=$split['url']; $url_values=$split['values']; if ( ! $values ) $values = array(); if ( $url_values ) $values=array_merge($values,$url_values); $this->values=$values; $this->method=$method; } function start () { print $this->start_html(); } function start_html () { $html="
method action='$this->url' enctype='multipart/form-data'>"; if ($this->values) foreach ($this->values as $key=>$value) $html .= $this->hidden_html($key,$value); return $html; } function end() { print $this->end_html(); } function end_html() { return "
"; } static function hidden_html ($key,$value) { return ""; } static function checkbox_html ($name,$value,$selected=false) { if ($selected) $xtra=" selected=selected"; return ""; } static function submit_html ($name,$display) { return ""; } static function file_html ($name,$size) { return ""; } static function label_html ($name,$display) { return ""; } static function radio_html ($id, $name, $value, $checked) { $html="20); if ( ! $options) $options=array(); $options = array_merge($default_options,$options); $html="$value"; } // selectors is an array of hashes with the following keys // (*) display // (*) value : the value that the 'name' variable will be assigned // (*) optional 'selected': the entry selected initially // (*) optional 'disabled': the entry is displayed but not selectable // optional label is inserted as the first option, with no value attached // autosubmit: onchange=submit() static function select_html ($name,$selectors,$label=NULL,$autosubmit=false) { $html=""; $html.="