addColumn('date', 'added', ['title' => 'Date Added', 'orderBy' => 'added']); $this->addColumn('text', 'typeTitle', ['title' => 'Listing Type', 'orderBy' => 'type']); $this->addColumn('text', 'days', ['title' => 'Days Remaining', 'orderBy' => 'days']); $this->_addOptionsColumn(); return $this; } protected function _addOptionsColumn() { $options = array(); $itemName = $this->getConfig('itemName'); if (($url = Qs_SiteMap::find(null, ['type' => 'Classified\\User\\'], null, 'url'))) { $options['actions']['renew'] = [ 'title' => 'Renew', 'linkTitle' => 'Renew this ' . $itemName . ' to increase its Expiration Date by ' . (int) \App_Settings_Obj::get('classifiedDays') . ' days more', 'formattedLink' => $url . '?action=renew&id=%d' ]; } $options['actions']['edit'] = [ 'title' => 'Edit', 'linkTitle' => 'Edit this ' . $itemName ]; $options['actions']['delete'] = [ 'title' => 'Delete', 'linkTitle' => 'Delete this ' . $itemName ]; $this->addColumn('options', 'options', $options); return $this; } }