tag. * @package forms * @subpackage fields-basic */ class DropdownField extends FormField { protected $source; protected $isSelected, $disabled; /** * Creates a new dropdown field. * @param $name The field name * @param $title The field title * @param $source An map of the dropdown items * @param $value The current value * @param $form The parent form * @param $emptyString mixed Add an empty selection on to of the {source}-Array * (can also be boolean, which results in an empty string) */ function __construct($name, $title = null, $source = array(), $value = "", $form = null, $emptyString = null) { if(is_string($emptyString)) { $source = is_array($source) ? array(""=>$emptyString) + $source : array(""=>$emptyString); } elseif($emptyString === true) { $source = is_array($source) ? array(""=>"") + $source : array(""=>""); } $this->source = $source; parent::__construct($name, ($title===null) ? $name : $title, $value, $form); } /** * Returns a * tag and option elements inside is as the content of the tag containing all the appropriate