'sorter', 'defaultIpp' => 20); protected $_formDefaults = array( 'typePage' => 'all', 'color' => 'blue' ); protected function _bindListColumns($list) { $list->addColumn('no', 'no') ->addColumn('text', 'title', array('orderBy' => 'title', 'title' => 'Header')) ->addColumn('html', 'content', array('attribs' => array('width' => 400))) ->addColumn('page_list', 'pageList', array('title' => 'Show on pages', 'attribs' => array('width' => 400, 'valign' => 'top'))) ->addColumn('options', 'options'); return $this; } protected function _bindFormFields($form) { $pagesType4Select = array('all' => 'All Pages', 'custom' => 'Custom Pages'); $pageType = $this->_getData('typePage', $this->getFormDefaults('typePage')); $form->addElement('text', 'title', array('label' => 'Header', 'required' => true)); $form->addElement('htmlEditor', 'content', array('label' => 'Content', 'required' => true, 'height' => 235)); $form->addElement( 'select', 'colorClass', array( 'label' => 'Color', 'multiOptions' => array('blue' => 'Blue', 'red' => 'Red') ) ); $form->addElement( 'select', 'typePage', array( 'label' => 'Show on Pages', 'multiOptions' => $pagesType4Select, 'onchange' => "$('#" . $form->getAttrib('id') . ">dl:first').attr('class', 'rightblock-form_elements ' + this.value);" ) ); $form->addElement( 'multiCheckbox', 'idPage', array( 'columns' => 3, 'multiOptions' => $this->dataObj->getSitePage(0) ) ); if ($pageType == 'custom') { $form->idPage->setRequired(); } $form->getDecorator('HtmlTag')->setOption('class', 'rightblock-form_elements ' . $pageType); return $this; } public function getFormDefaults($field = false) { return Qs_Array::get($this->_formDefaults, $field); } }