*/
class Varien_Data_Form_Element_Multiselect extends Varien_Data_Form_Element_Abstract
{
public function __construct($attributes=array())
{
parent::__construct($attributes);
$this->setType('select');
$this->setExtType('multiple');
$this->setSize(10);
}
public function getName()
{
$name = parent::getName();
if (strpos($name, '[]') === false) {
$name.= '[]';
}
return $name;
}
public function getElementHtml()
{
$this->addClass('select multiselect');
$html = '';
if ($this->getCanBeEmpty()) {
$html .= '';
}
$html .= ''."\n";
$html.= $this->getAfterElementHtml();
return $html;
}
public function getHtmlAttributes()
{
return array('title', 'class', 'style', 'onclick', 'onchange', 'disabled', 'size', 'tabindex');
}
public function getDefaultHtml()
{
$result = ( $this->getNoSpan() === true ) ? '' : ''."\n";
$result.= $this->getLabelHtml();
$result.= $this->getElementHtml();
if($this->getSelectAll() && $this->getDeselectAll()) {
$result.= '' . $this->getSelectAll() . ' | ';
$result.= '' . $this->getDeselectAll() . '';
}
$result.= ( $this->getNoSpan() === true ) ? '' : ''."\n";
$result.= '";
return $result;
}
public function getJsObjectName() {
return $this->getHtmlId() . 'ElementControl';
}
protected function _optionToHtml($option, $selected)
{
$html = ''."\n";
return $html;
}
}