/** * Render grid column * * @param \Magento\Framework\DataObject $row * @return string */ public function render(\Magento\Framework\DataObject $row) { $actions = []; $actions[] = ['url' => $this->getUrl('adminhtml/*/preview', ['id' => $row->getId()]), 'popup' => true, 'caption' => __('Preview')]; $this->getColumn()->setActions($actions); return parent::render($row); }
/** * Renderer for "Action" column in Newsletter templates grid * * @param \Magento\Framework\Object $row * @return string */ public function render(\Magento\Framework\Object $row) { if ($row->isValidForSend()) { $actions[] = ['url' => $this->getUrl('*/queue/edit', ['template_id' => $row->getId()]), 'caption' => __('Queue Newsletter')]; } $actions[] = ['url' => $this->getUrl('*/*/preview', ['id' => $row->getId()]), 'popup' => true, 'caption' => __('Preview')]; $this->getColumn()->setActions($actions); return parent::render($row); }
/** * Renders column * * @param \Magento\Framework\Object $row * @return string */ public function render(\Magento\Framework\Object $row) { $actions = []; if ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_NEVER) { if (!$row->getQueueStartAt() && $row->getSubscribersTotal()) { $actions[] = ['url' => $this->getUrl('*/*/start', ['id' => $row->getId()]), 'caption' => __('Start')]; } } elseif ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_SENDING) { $actions[] = ['url' => $this->getUrl('*/*/pause', ['id' => $row->getId()]), 'caption' => __('Pause')]; $actions[] = ['url' => $this->getUrl('*/*/cancel', ['id' => $row->getId()]), 'confirm' => __('Do you really want to cancel the queue?'), 'caption' => __('Cancel')]; } elseif ($row->getQueueStatus() == \Magento\Newsletter\Model\Queue::STATUS_PAUSE) { $actions[] = ['url' => $this->getUrl('*/*/resume', ['id' => $row->getId()]), 'caption' => __('Resume')]; } $actions[] = ['url' => $this->getUrl('*/*/preview', ['id' => $row->getId()]), 'caption' => __('Preview'), 'popup' => true]; $this->getColumn()->setActions($actions); return parent::render($row); }
/** * @param \Magento\Framework\DataObject $row * @return string */ public function render(\Magento\Framework\DataObject $row) { $this->getColumn()->setActions([['url' => $this->getUrl('adminhtml/sitemap/generate', ['sitemap_id' => $row->getSitemapId()]), 'caption' => __('Generate')]]); return parent::render($row); }