'date DESC'); protected $_imageWidth = 240; protected $_imageHeight = 150; protected function _bindListColumns(Qs_ViewController_List $list) { $list->addColumn('no', 'no') ->addColumn('date', 'date', array('orderBy' => 'date')) ->addColumn('image', 'image') ->addColumn('item', 'item', array('attribs' => array('width' => 500, 'valign' => 'top'))) ->addColumn( 'options', 'options', array( 'actions' => array('edit', 'delete'), ) ); return $this; } protected function _bindFormFields(Qs_Form $form) { $form->addElement('date', 'date', array('label' => 'Publication Date', 'required' => true)); $form->addElement('text', 'title', array('label' => 'News Title', 'required' => true)); $form->addElement( 'textarea', 'metaDescription', array('label' => 'Meta Description', 'rows' => 3, 'required' => false) ); $form->addElement( 'textarea', 'metaKeywords', array('label' => 'Meta Keywords', 'rows' => 3, 'required' => false) ); $form->addElement( 'extendedImage', 'image', array( 'label' => 'Image', 'required' => false, 'resize' => $this->_imageWidth . 'x' . $this->_imageHeight, ) ); $form->addElement( 'textarea', 'introduction', array('label' => 'Introduction', 'rows' => 5, 'required' => true) ); $form->addElement( 'htmlEditor', 'content', array('label' => 'Content', 'required' => true, 'hasMsWordNote' => true) ); $form->image->addValidator('File_IsImage'); return $this; } protected function _doNew() { $form = $this->_getNewForm(); $data = array('date' => date('Y-m-d'), 'linkType' => 'none'); $form->setDefaults($data); $this->_renderMainForm($form); } protected function _renderMainForm($form) { $this->doc->addStylesheet('css/admin-news.css'); return parent::_renderMainForm($form); } }