tag. * @package forms * @subpackage fields-basic */ class ListboxField extends DropdownField { /** * The size of the field in rows. * @var int */ protected $size; /** * Should the user be able to select multiple * items on this dropdown field? * * @var boolean */ protected $multiple = false; /** * Creates a new dropdown field. * * @param string $name The field name * @param string $title The field title * @param array $source An map of the dropdown items * @param string|array $value You can pass an array of values or a single value like a drop down to be selected * @param int $size Optional size of the select element * @param form The parent form */ function __construct($name, $title = '', $source = array(), $value = '', $size = null, $multiple = false, $form = null) { if($size) $this->size = $size; if($multiple) $this->multiple = $multiple; parent::__construct($name, $title, $source, $value, $form); } /** * Returns a name\" id=\"$id\">$options"; } /** * Sets the size of this dropdown in rows. * @param int $size The height in rows (e.g. 3) */ function setSize($size) { $this->size = $size; } /** * Sets this field to have a muliple select attribute * @param boolean $bool */ function setMultiple($bool) { $this->multiple = $bool; } } ?>