'date DESC'); protected function _bindListColumns($list) { $list->addColumn('no', 'no') ->addColumn('date', 'date', array('orderBy' => 'date')) ->addColumn('image', 'image') ->addColumn( 'item', 'title', array('title' => 'News Title & Introduction', 'attribs' => array('width' => 400, 'valign' => 'top'))) ->addColumn('options', 'options'); return $this; } protected function _bindFormFields($form) { $form->addElement( 'date', 'date', array( 'label' => 'Publication Date', 'required' => true) ); $form->addElement( 'text', 'title', array( 'label' => 'News Title', 'required' => true) ); $form->addElement( 'extendedImage', 'image', array( 'label' => 'Image', 'resize' => '400x300', 'required' => false) ); $form->addElement( 'textarea', 'introduction', array( 'label' => 'Introduction', 'required' => true, 'rows'=> 5, 'description' => 'Please note: only the first 200 symbols will be shown on the home page') ); $form->addElement( 'htmlEditor', 'content', array( 'label' => 'Content', 'required' => 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); } }