\n") { $doc = Zend_Registry::get('doc'); $doc->addScript('js/lib/form-order-select.js'); $doc->addInitFunction('initFormOrderSelect', array($name)); $hiddenName = ($attribs['multiple']) ? $name . '[]' : $name; $hiddenId = $name . '-hidden'; $selectName = '_' . $name; $values = array(); foreach ($options as $optionKey => $option) { if (is_array($option)) { // is optgroup $values = array_merge($values, array_keys($option)); } else { $values[] = $optionKey; } } $html = $this->formSelect( $hiddenName, $values, array('style' => 'visibility:hidden; width:1px; height:1px; margin:0; padding:0;', 'id' => $hiddenId), $options ); $html .= $this->formSelect($selectName, $value, $attribs, $options, $listsep); $html .='
'; return $html; } protected function _translate($text) { $translator = Qs_Translate::getTranslator(); if ($translator) { $text = $translator->translate($text); } return $text; } }