public function render() { $res = parent::render(); if (!function_exists('to_array')) { function to_array(&$obj) { if ($obj instanceof data) { $obj = $obj->to_array(); } if (is_array($obj)) { foreach ($obj as &$el) { to_array($el); } } } } if (@$this->markitup) { $opt = clone $this->markitup->opt; to_array($opt); $this->view->messify->append('css', '/' . DIR_KERNEL . '/ctl/markitup/skins/' . $this->markitup->skin . '/style.css')->append('css', $this->markitup->set_style)->append('js', '/' . DIR_KERNEL . '/ctl/markitup/jquery.markitup.js')->append_inline('js', '$("textarea[name=\'' . $this->name . '\']").markItUp(' . Zend\Json\Json::encode($opt, false, array('enableJsonExprFinder' => true)) . ');'); if ($this->markitup->class) { $res = '<div class="' . $this->markitup->class . '">' . $res . '</div>'; } } if (@$this->ckeditor) { $opt = clone $this->ckeditor->opt; to_array($opt); $this->view->messify->append('js', '/' . DIR_KERNEL . '/ctl/ckeditor/ckeditor.js')->append('js', '/' . DIR_KERNEL . '/ctl/ckfinder/ckfinder.js')->append_inline('js', 'var editor_' . $this->name . ' = CKEDITOR.replace("' . $this->name . '", ' . Zend\Json\Json::encode($opt, false, array('enableJsonExprFinder' => true)) . ');CKFinder.setupCKEditor(editor_' . $this->name . ', "/' . DIR_KERNEL . '/ctl/ckfinder/");'); if ($this->ckeditor->class) { $res = '<div class="' . $this->ckeditor->class . '">' . $res . '</div>'; } } return $res; }
public function render() { if ($this->chosen) { $opt = array('no_results_text' => $this->view->translate('form_element_select_no_results_text'), 'placeholder_text' => $this->view->translate('form_element_select_placeholder_text'), 'placeholder_text_multiple' => $this->view->translate('form_element_select_placeholder_text_multiple')); $this->view->messify->append('js', '/' . DIR_KERNEL . '/ctl/chosen/chosen.jquery.js')->append_inline('js', '$("select[name=\'' . $this->name . ($this->multiple ? '\\[\\]' : '') . '\']").chosen(' . Zend\Json\Json::encode($opt, false, array('enableJsonExprFinder' => true)) . ');'); if ($this->chosen->css) { $this->view->messify->append('css', '/' . DIR_KERNEL . '/ctl/chosen/chosen.css'); } } if ($this->uniform) { $opt = array(); $this->view->messify->append('js', '/' . DIR_KERNEL . '/ctl/uniform/jquery.uniform.js')->append_inline('js', '$("select[name=\'' . $this->name . '\']").uniform(' . Zend\Json\Json::encode($opt, false, array('enableJsonExprFinder' => true)) . ');'); if ($this->chosen->css) { $this->view->messify->append('css', '/' . DIR_KERNEL . '/ctl/uniform/themes/default/css/uniform.default.css'); } } return parent::render(); }