'year DESC'); protected $_actions = array('list', 'cancel', 'new', 'insert', 'edit', 'update', 'delete', 'changeOption', 'back'); public function __construct($options = array()) { $this->_formDefaults = array('year' => date('Y')); parent::__construct($options); } protected function _bindListColumns(Qs_ViewController_List $list) { $list->addColumn('text', 'year', array('orderBy' => 'year', 'attribs' => array('width' => 100))) ->addColumn('image', 'image', array('attribs' => array('width' => 145))) ->addColumn('html', 'description') ->addColumn('options', 'options',array('attribs' => array('width' => 120))); return $this; } protected function _bindFormFields(Qs_Form $form) { $years = range(self::START_YEAR, (int) date('Y') + 1); $form->addElement( 'select', 'year', array('label' => 'Year', 'required' => true, 'multiOptions' => array('' => 'Select Year') + array_combine($years, $years)) ); $resize = App_History_AbstractObj::IMAGE_WIDTH . 'x' . App_History_AbstractObj::IMAGE_HEIGHT . 'cc'; $form->addElement( 'extendedImage', 'image', array('label' => 'Image', 'required' => true, 'resize' => $resize, 'validators' => array(array( 'ImageSize', false, array( 'minwidth' => App_History_AbstractObj::IMAGE_WIDTH, 'minheight' => App_History_AbstractObj::IMAGE_HEIGHT, ) )) ) ); $form->image->addValidator('File_IsImage'); $form->addElement( 'htmlEditor', 'description', array('label' => 'Description', 'required' => true, 'ToolbarSet' => 'Flash') ); return $this; } }