addColumn('no', 'no', array('orderBy' => 'sorter')); $this->addColumn( 'text', 'typeTitle', array('title' => 'Type', 'orderBy' => 'type') ); $this->addColumn('text', 'title', array('title' => 'Title', 'orderBy' => 'title')); $this->addColumn( 'image', 'image', array( 'title' => 'Slide/Background Image', 'imageAttribs' => array('width' => 190, 'height' => 90), ) ); $this->addColumn( 'link_enum', 'show', array( 'title' => 'Show', 'orderBy' => 'show', 'values' => array('y' => 'Yes', 'n' => 'No'), ) ); $this->_addOptionsColumn(); return $this; } protected function _addOptionsColumn() { $actions = array( 'edit' => array(), 'hotspot' => array( 'title' => "Manage hot spots", 'linkTitle' => "Manage Slide's hot spots", 'formattedLink' => constant('CURRENT_PAGE') . '/hotspot?slideId=%d', ), 'delete' => array() ); if (true !== $this->_getDataObj()->getConfig('hasHotSpots')) { unset($actions['hotspot']); } $this->addColumn('options', 'options', array('actions' => $actions)); return $this; } protected function _getDataObj() { if (null === $this->_dataObj) { $this->_dataObj = new App_Slide_Admin_Obj(); } return $this->_dataObj; } }