_renderStore($params['store'], $id))) { $params['store'] = $params['store']['store']; if ($this->_useProgrammatic()) { unset($params['store']); } if (is_string($store)) { $html .= $store; } $html .= $this->_createFormElement($id, $value, $params, $attribs); return $html; } unset($params['store']); } elseif (array_key_exists('store', $params)) { if (array_key_exists('storeType', $params)) { $storeParams = array( 'store' => $params['store'], 'type' => $params['storeType'], ); unset($params['storeType']); if (array_key_exists('storeParams', $params)) { $storeParams['params'] = $params['storeParams']; unset($params['storeParams']); } if (false !== ($store = $this->_renderStore($storeParams, $id))) { if (is_string($store)) { $html .= $store; } } } if ($this->_useProgrammatic()) { unset($params['store']); } $html .= $this->_createFormElement($id, $value, $params, $attribs); return $html; } // do as normal select $attribs = $this->_prepareDijit($attribs, $params, 'element'); return $this->view->formSelect($id, $value, $attribs, $options); } /** * Render data store element * * Renders to dojo view helper * * @param array $params * @return string|false */ protected function _renderStore(array $params, $id) { if (!array_key_exists('store', $params) || !array_key_exists('type', $params)) { return false; } $this->dojo->requireModule($params['type']); $extraParams = array(); $storeParams = array( 'dojoType' => $params['type'], 'jsId' => $params['store'], ); if (array_key_exists('params', $params)) { $storeParams = array_merge($storeParams, $params['params']); $extraParams = $params['params']; } if ($this->_useProgrammatic()) { if (!$this->_useProgrammaticNoScript()) { require_once 'Zend/Json.php'; $js = 'var ' . $storeParams['jsId'] . ' = ' . 'new ' . $storeParams['dojoType'] . '(' . Zend_Json::encode($extraParams) . ");\n" . 'dijit.byId("' . $this->_normalizeId($id) . '").attr("store", ' . $storeParams['jsId'] . ');'; $js = "function() {\n$js\n}"; $this->dojo->prependOnLoad($js); } return true; } return '