public function set_select($field = '', $value = '', $default = FALSE)
{
if (!isset($this->_field_data[$field], $this->_field_data[$field]['postdata'])) {
return $default === TRUE && count($this->_field_data) === 0 ? ' selected="selected"' : '';
}
$field = $this->_field_data[$field]['postdata'];
$value = (string) $value;
if (is_array($field)) {
// Note: in_array('', array(0)) returns TRUE, do not use it
foreach ($field as &$v) {
if ($value === $v) {
return ' selected="selected"';
}
}
return '';
} elseif ($field === '' or $value === '' or $field !== $value) {
return '';
}
return ' selected="selected"';
}