-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
adam ling
committed
May 10, 2018
1 parent
f530805
commit 5df032b
Showing
5 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Image.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* 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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Grid column widget for rendering action grid cells | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Image | ||
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text | ||
{ | ||
|
||
/** | ||
* Renders column | ||
* | ||
* @param Varien_Object $row | ||
* @return string | ||
*/ | ||
public function render(Varien_Object $row) | ||
{ | ||
$actions = $this->getColumn()->getActions(); | ||
$src = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$row->getImage(); | ||
return '<img width="80" height="80" src="'.$src.'" />'; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Recommendurl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* 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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Grid column widget for rendering action grid cells | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Recommendurl | ||
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text | ||
{ | ||
|
||
/** | ||
* Renders column | ||
* | ||
* @param Varien_Object $row | ||
* @return string | ||
*/ | ||
public function render(Varien_Object $row) | ||
{ | ||
$actions = $this->getColumn()->getActions(); | ||
$url = $row->getUrl().'?re='.$row->getRecommendId(); | ||
return '<a target="_blank" href="'.$url.'">'.$this->getColumn()->getHeader().'</a>'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters