/** * Prepares action data for html render * * @param array $action * @param string $actionCaption * @param Core_Object $row * @return Core_DataGrid_Column_Renderer_Action */ protected function _transformActionData(&$action, &$actionCaption, $row) { foreach ($action as $attibute => $value) { if (isset($action[$attibute]) && !is_array($action[$attibute])) { $this->getColumn()->setFormat($action[$attibute]); $action[$attibute] = parent::render($row); } else { $this->getColumn()->setFormat(null); } switch ($attibute) { case 'caption': $actionCaption = $action['caption']; unset($action['caption']); break; case 'url': $action['href'] = $action['url']; unset($action['url']); break; case 'popup': $action['onclick'] = 'popWin(this.href, \'windth=800,height=700,resizable=1,scrollbars=1\');return false;'; break; } } return $this; }
/** * Format variables pattern * * @var string */ public function render($row) { $links = $this->getColumn()->getLinks(); if (empty($links)) { return parent::render($row); } $text = parent::render($row); $this->getColumn()->setFormat($links); $action = parent::render($row); $this->getColumn()->setFormat(null); return '<a href="' . $action . '" title="' . $text . '">' . $text . '</a>'; }