\n")
{
$info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
extract($info); // name, id, value, attribs, options, listsep, disable
// force $value to array so we can compare multiple values
// to multiple options.
settype($value, 'array');
// check for multiple attrib and change name if needed
if (isset($attribs['multiple']) &&
$attribs['multiple'] == 'multiple' &&
substr($name, -2) != '[]') {
$name .= '[]';
}
// check for multiple implied by the name and set attrib if
// needed
if (substr($name, -2) == '[]') {
$attribs['multiple'] = 'multiple';
}
// now start building the XHTML.
if ($disable) {
// disabled.
// generate a plain list of selected options.
// show the label, not the value, of the option.
$list = array();
foreach ($options as $opt_value => $opt_label) {
if (in_array($opt_value, $value)) {
// add the hidden value
$opt = $this->_hidden($name, $opt_value);
// add the display label
$opt .= $this->view->escape($opt_label);
// add to the list
$list[] = $opt;
}
}
$xhtml = implode($listsep, $list);
} else {
// enabled.
// the surrounding select element first.
$xhtml = '";
}
return $xhtml;
}
/**
* Builds the actual ";
return $opt;
}
}