'date DESC'); protected $imageWidth = 200; protected $imageHeight = 130; protected function _bindListColumns($list) { $list->addColumn('no', 'no') ->addColumn( 'date', 'date', array('orderBy' => 'date')) ->addColumn('newimage', 'image') ->addColumn( 'item', 'item', array( 'title' => 'Title/Introduction', 'orderBy' => 'title', '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', 'required' => false, 'resize' => $this->imageWidth . 'x' . $this->imageHeight) ); $form->addElement( 'textarea', 'introduction', array('label' => 'Introduction', 'rows' => 5) ); $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')); $form->setDefaults($data); $this->_renderMainForm($form); } protected function _renderMainForm($form) { $this->doc->addStylesheet('css/admin-news.css'); return parent::_renderMainForm($form); } }