_attributes['multiple'] = 'multiple';
$this->_value = $value;
$this->_values = $values;
}
protected function _getInput()
{
$element = parent::_getInput();
$options = '';
foreach ($this->_values as $value => $name)
{
// Things can get wierd if we have mixed types
$sval = $this->_value;
if( (gettype($value) == "integer") && (gettype($sval) == "string") )
$value = strval($value);
if (isset($this->_attributes['multiple']))
$selected = in_array($value, (array)$sval);
else {
$selected = ($sval == $value);
}
if (!empty(trim($name)) || is_numeric($name)) {
$name_str = htmlspecialchars(gettext($name));
} else {
// Fixes HTML5 validation: Element option without attribute label must not be empty
$name_str = " ";
}
$options .= '';
}
return <<
EOT;
}
}