/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php
PHP | 53 lines | 13 code | 4 blank | 36 comment | 1 complexity | 7f9a82d6741d8b25794f165fede85358 MD5 | raw file
- <?php
- /**
- * Magento Enterprise Edition
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Magento Enterprise Edition License
- * that is bundled with this package in the file LICENSE_EE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://www.magentocommerce.com/license/enterprise-edition
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://www.magentocommerce.com/license/enterprise-edition
- */
- /**
- * Sitemap grid link column renderer
- *
- * @category Mage
- * @package Mage_Sitemap
- */
- class Mage_Adminhtml_Block_Sitemap_Grid_Renderer_Link extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
- {
- /**
- * Prepare link to display in grid
- *
- * @param Varien_Object $row
- * @return string
- */
- public function render(Varien_Object $row)
- {
- $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename());
- $url = $this->htmlEscape(Mage::app()->getStore($row->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . $fileName);
- if (file_exists(BP . DS . $fileName)) {
- return sprintf('<a href="%1$s">%1$s</a>', $url);
- }
- return $url;
- }
- }