public function render(Varien_Object $row) { $actions = array(); $curWebsite = $this->getRequest()->getParam('website'); $curStore = $this->getRequest()->getParam('store'); $aParams = array(); if ($curWebsite) { $aParams['website'] = $curWebsite; } if ($curStore) { $aParams['store'] = $curStore; } if (!$aParams) { list($aParams['scope'], $aParams['scopeid']) = Mage::getModel('aitemails/aitemails')->getCurrentScope(); } $aParams['fromaitemails'] = 1; if ($row->getCustomTemplate()) { $aParams['id'] = $row->getCustomTemplateId(); $actions[] = array('url' => $this->getUrl('adminhtml/system_email_template/edit', $aParams), 'caption' => $this->__('Edit Custom Template')); } else { $aParams['templatecode'] = $row->getCode(); $aParams['localecode'] = Mage::registry('aitemails_email_template_scope_locale'); $aParams['scope'] = $row->getScope(); $aParams['scopeid'] = $row->getScopeId(); $actions[] = array('url' => $this->getUrl('adminhtml/system_email_template/new', $aParams), 'caption' => $this->__('Create Custom Template')); } $this->getColumn()->setActions($actions); return parent::render($row); }