'published DESC'); protected $_actions = array('list', 'cancel', 'new', 'insert', 'edit', 'update', 'delete', 'changeOption', 'back'); protected function _bindListColumns(Qs_ViewController_List $list) { $list->addColumn('no', 'no') ->addColumn( 'date', 'published', array( 'orderBy' => 'published', 'format' => '%b %Y', 'title' => 'Date of News' ) ) ->addColumn( 'text', 'headline', array( 'orderBy' => 'headline', 'title' => 'News Headline' ) ) ->addColumn( 'link_enum', 'show', array( 'orderBy' => 'show', 'values' => array('y' => 'Yes', 'n' => 'No') ) ) ->addColumn( 'options', 'options', array( 'actions' => 'edit;delete', 'attribs' => array('width' => 140) ) ); return $list; } protected function _bindFormFields(Qs_Form $form) { $form->addElement('date', 'published', array('label' => 'Date of News:', 'required' => true)); $form->addElement('text', 'headline', array('label' => 'News Headline:', 'required' => true)); $form->addElement('ExtendedFile', 'file', array('label' => 'PDF', 'required' => true)); $form->file->addValidator('MimeType', false, array('application/acrobat', 'application/x-pdf', 'applications/vnd.pdf', 'text/pdf', 'text/x-pdf', 'application/pdf')); $form->addElement('checkbox', 'show', array('label' => 'Show', 'decoration' => 'simple')); $form->setDefaults(array('date' => date('Y-m-d'), 'show' => 'y')); return $this; } protected function _bindFilterFields(Qs_Form $form) { $years = $this->dataObj->getYearsList(false); if (!empty($years)) { $form->addElement( 'select', 'year', array( 'label' => 'Filter by year', 'multiOptions' => array('' => 'All') + array_combine($years, $years), 'onchange' => 'this.form.submit();' ) ); } $form->addElement( 'text', 'query', array( 'label' => 'Search by newsletter headline', 'size' => 40, 'filters' => array(new Zend_Filter_StringTrim()) ) ); return $this; } }