/** * render row * * @access public * @param Varien_Object $row * @return string * @author Marius Strajeru <*****@*****.**> */ public function render(Varien_Object $row) { /** @var string $what */ $what = $this->getColumn()->getWhat(); /** @var string $id */ $id = $row->getSafeId(); $packageName = base64_decode(strtr($id, '-_,', '+/=')); /** @var Ultimate_ModuleCreator_Helper_Data $helper */ $helper = Mage::helper('modulecreator'); $path = $helper->getLocalModulesDir(); switch ($what) { case 'config': $file = $path . 'package' . DS . $packageName . '.xml'; break; case 'list': $file = $path . 'package' . DS . $packageName . DS . 'files.log'; break; case 'uninstall': $file = $path . 'package' . DS . $packageName . DS . 'uninstall.sql'; break; default: $file = $path . $packageName . '.tgz'; break; } if (file_exists($file) && is_readable($file)) { return '<a href="' . $this->getUrl('*/*/download', array('type' => $what, 'id' => $id)) . '">' . $this->_getLabel() . '</a>'; } return '<span style="color:red;">' . Mage::helper('modulecreator')->__('File does not exist or is not readable') . '</span>'; }