/** * Constructs a new dropdown list object. * * @param string name The name of the dropdown list. * @param string value The initial selected item. * @param array items List of items to choose from * @param string caption The caption to display by the dropdown list. * @param bool multiple Dropdown list allows multiple selection. */ function input_dropdown($name, $value = NULL, $items = NULL, $caption = NULL, $multiple = FALSE) { $this->items = $items; $this->caption = $caption; $this->multiple = $multiple; parent::input_base($name, NULL, $value); }
/** * Constructs a new radio group. * * @param string name The name of the radio. * @param int value The initial value. * @param array buttons The buttons in the radio object. */ function input_radio($name, $value = NULL, $buttons = NULL) { $this->buttons = $buttons; parent::input_base($name, NULL, $value); }
/** * Constructs a new querystring object. * * @param string name The name of the querystring object. * @param string regex The validation regular expression. * @param string value The initial contents value. */ function input_querystring($name, $regex = NULL, $value = NULL) { parent::input_base($name, $regex, $value, FALSE, SQ_GET); }
/** * Sets the value of the cookie object. * * @param string value The value to set the cookie to. * @return bool TRUE on success. */ function set($value) { if (parent::set($value)) { if ($this->expire == 0) { $expire = 0; } else { $expire = time() + $this->expire; } return setcookie($this->name, $this->value, $expire, $this->path, $this->domain, $this->secure); } return FALSE; }
/** * Reset value to default, set default value into session */ function reset() { $this->remove(); parent::reset(); }
/** * Constructs a new textbox object. * * @param string name The name of the textbox. * @param string regex The validation regular expression. * @param string value The initial contents value. * @param string caption The caption to display by the textbox. * @param bool required Whether the texbox is allowed to contain no value. */ function input_textbox($name, $regex = NULL, $value = NULL, $caption = NULL, $required = TRUE) { $this->type = 'text'; $this->caption = $caption; parent::input_base($name, $regex, $value, $required); }