I'm trying to add a button on the cache page, next to the "Flush Cache Storage" button. My approach is to overwrite the block "Mage_Adminhtml_Block_Cache". But I can't get it to work. Does anyone know what I'm doing wrong?
Mymodule/FlushImages/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Mymodule_FlushImages>
<version>1.0.0</version>
</Mymodule_FlushImages>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<cache>Mymodule_FlushImages_Block_Adminhtml_Cache</cache>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
Mymodule/FlushImages/Block/Adminhtml/Cache.php
<?php
class Mymodule_FlushImages_Block_Adminhtml_Cache extends Mage_Adminhtml_Block_Cache
{
/**
* Class constructor
*/
public function __construct()
{
$this->_addButton('flush_magento', array(
'label' => Mage::helper('core')->__('Flush Images'),
'onclick' => 'setLocation(\'' . $this->getFlushImagesUrl() .'\')',
'class' => 'delete',
));
parent::__construct();
}
/**
* Get url for delete Images
*/
public function getFlushImagesUrl()
{
return $this->getUrl('*/*/flushImages');
}
}
Note: I did create the module config file in app/etc/modules.
Help is highly appreciated.