Created
January 24, 2014 23:46
-
-
Save xcommerce-gists/8609221 to your computer and use it in GitHub Desktop.
Sample Magento administrative block/grid
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
<?php | |
/** | |
* News List admin grid container | |
* | |
* @author Magento | |
*/ | |
class Magentostudy_News_Block_Adminhtml_News extends Mage_Adminhtml_Block_Widget_Grid_Container | |
{ | |
/** | |
* Block constructor | |
*/ | |
public function __construct() | |
{ | |
$this->_blockGroup = 'magentostudy_news'; | |
$this->_controller = 'adminhtml_news'; | |
$this->_headerText = Mage::helper('magentostudy_news')->__('Manage News'); | |
parent::__construct(); | |
if (Mage::helper('magentostudy_news/admin')->isActionAllowed('save')) { | |
$this->_updateButton('add', 'label', Mage::helper('magentostudy_news')->__('Add New News')); | |
} else { | |
$this->_removeButton('add'); | |
} | |
$this->addButton( | |
'news_flush_images_cache', | |
array( | |
'label' => Mage::helper('magentostudy_news')->__('Flush Images Cache'), | |
'onclick' => 'setLocation(\'' . $this->getUrl('*/*/flush') . '\')', | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment