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