public function formJQueryMultiselect($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n") { if (array_key_exists('jQueryParams', $attribs)) { $jQueryParams = $attribs['jQueryParams']; $jQueryParams = ZendX_JQuery::encodeJson($jQueryParams); unset($attribs['jQueryParams']); } else { $jQueryParams = array(); } $js = sprintf('%s("#%s").multiselect(%s);', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $jQueryParams); $this->view->headScript()->appendFile($this->view->baseUrl('/scripts/jquery-plugins/multiselect/src/jquery.multiselect.js', false)); $this->view->headLink()->prependStylesheet($this->view->baseUrl('/scripts/jquery-plugins/multiselect/jquery.multiselect.css', false), 'screen'); $this->view->jQuery()->enable()->uiEnable()->addOnLoad($js); return parent::formSelect($name, $value, $attribs, $options, $listsep); }
public function formImageSelect($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n") { $info = $this->_getInfo($name, $value, $attribs, $options, $listsep); $id = $this->view->escape($info['id']); /** add plugin libraries */ $this->view->plugins()->imageSelect(); $comboOptions = array(); if (!empty($attribs['combo'])) { $comboOptions = array_merge($comboOptions, $attribs['combo']); unset($attribs['combo']); } /** init plugin */ $comboOptions = Zend_Json::encode($comboOptions, Zend_Json::TYPE_OBJECT); $this->view->headScript()->appendScript('(function($){$(function(){$("#' . $id . '").combobox(' . $comboOptions . ');});})(jQuery)'); return parent::formSelect($name, $value, $attribs, $options, $listsep); }
/** * Generates 'select' list of options. * * @access public * * @param string|array $name If a string, the element name. If an * array, all other parameters are ignored, and the array elements * are extracted in place of added parameters. * * @param mixed $value The option value to mark as 'selected'; if an * array, will mark all values in the array as 'selected' (used for * multiple-select elements). * * @param array|string $attribs Attributes added to the 'select' tag. * * @param array $options An array of key-value pairs where the array * key is the radio value, and the array value is the radio text. * * @param string $listsep When disabled, use this list separator string * between list values. * * @return string The select tag and options XHTML. */ public function formSelectHtml($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n") { return parent::formSelect($name, $value, $attribs, $options, $listsep); }