Version Notes
Stable easy cache cleaner extension
Download this release
Release Info
| Developer | IFlair Web Technologies |
| Extension | IFlair_EasyCacheCleaner |
| Version | 1.0.1 |
| Comparing to | |
| See all releases | |
Version 1.0.1
- app/code/community/IFlair/EasyCacheCleaner/Block/Adminhtml/Page/Header.php +19 -0
- app/code/community/IFlair/EasyCacheCleaner/controllers/Adminhtml/CacheController.php +51 -0
- app/code/community/IFlair/EasyCacheCleaner/etc/config.xml +31 -0
- app/design/adminhtml/default/default/template/easycachecleaner/page/header.phtml +76 -0
- app/etc/modules/IFlair_EasyCacheCleaner.xml +9 -0
- package.xml +18 -0
- skin/adminhtml/default/default/easycachecleaner/images/flash.png +0 -0
app/code/community/IFlair/EasyCacheCleaner/Block/Adminhtml/Page/Header.php
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Copyright © 2016 iFlair Web Technologies. All rights reserved.
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* Adminhtml header block
|
| 8 |
+
*
|
| 9 |
+
* @author iFlair Web Technologies
|
| 10 |
+
*/
|
| 11 |
+
class IFlair_EasyCacheCleaner_Block_Adminhtml_Page_Header extends Mage_Adminhtml_Block_Page_Header
|
| 12 |
+
{
|
| 13 |
+
public function __construct()
|
| 14 |
+
{
|
| 15 |
+
parent::__construct();
|
| 16 |
+
$this->setTemplate('easycachecleaner/page/header.phtml');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
}
|
app/code/community/IFlair/EasyCacheCleaner/controllers/Adminhtml/CacheController.php
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Copyright © 2016 iFlair Web Technologies. All rights reserved.
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* Adminhtml Cache Controller
|
| 8 |
+
*
|
| 9 |
+
* @author iFlair Web Technologies
|
| 10 |
+
*/
|
| 11 |
+
class IFlair_EasyCacheCleaner_Adminhtml_CacheController extends Mage_Adminhtml_Controller_Action
|
| 12 |
+
{
|
| 13 |
+
|
| 14 |
+
/**
|
| 15 |
+
* @variable Cache type ids
|
| 16 |
+
*/
|
| 17 |
+
protected $_types = array('config','layout','block_html','translate','collections','eav','config_api','config_api2');
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Mass Refresh Action
|
| 21 |
+
*
|
| 22 |
+
* @return Json Object
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
public function massRefreshAction()
|
| 26 |
+
{
|
| 27 |
+
$response = array();
|
| 28 |
+
$types = $this->_types;
|
| 29 |
+
$updatedTypes = 0;
|
| 30 |
+
try{
|
| 31 |
+
|
| 32 |
+
if (!empty($types)) {
|
| 33 |
+
foreach ($types as $type) {
|
| 34 |
+
$tags = Mage::app()->getCacheInstance()->cleanType($type);
|
| 35 |
+
Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => $type));
|
| 36 |
+
$updatedTypes++;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
if ($updatedTypes > 0) {
|
| 40 |
+
$response['type'] = 'success';
|
| 41 |
+
$response['success'] = true;
|
| 42 |
+
$response['message'] = Mage::helper('adminhtml')->__("%s cache type(s) refreshed.", $updatedTypes);
|
| 43 |
+
}
|
| 44 |
+
}catch(Exception $e){
|
| 45 |
+
$response['type'] = 'error';
|
| 46 |
+
$response['error'] = true;
|
| 47 |
+
$response['message'] = Mage::helper('adminhtml')->__('An error occurred while refreshing cache.');
|
| 48 |
+
}
|
| 49 |
+
echo json_encode($response);
|
| 50 |
+
}
|
| 51 |
+
}
|
app/code/community/IFlair/EasyCacheCleaner/etc/config.xml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<IFlair_EasyCacheCleaner>
|
| 5 |
+
<version>1.0.1</version>
|
| 6 |
+
</IFlair_EasyCacheCleaner>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<blocks>
|
| 10 |
+
<adminhtml>
|
| 11 |
+
<rewrite>
|
| 12 |
+
<page_header>IFlair_EasyCacheCleaner_Block_Adminhtml_Page_Header</page_header>
|
| 13 |
+
</rewrite>
|
| 14 |
+
</adminhtml>
|
| 15 |
+
<easycachecleaner>
|
| 16 |
+
<class>IFlair_EasyCacheCleaner_Block</class>
|
| 17 |
+
</easycachecleaner>
|
| 18 |
+
</blocks>
|
| 19 |
+
</global>
|
| 20 |
+
<admin>
|
| 21 |
+
<routers>
|
| 22 |
+
<easycachecleaner>
|
| 23 |
+
<use>admin</use>
|
| 24 |
+
<args>
|
| 25 |
+
<module>IFlair_EasyCacheCleaner</module>
|
| 26 |
+
<frontName>easycachecleaner</frontName>
|
| 27 |
+
</args>
|
| 28 |
+
</easycachecleaner>
|
| 29 |
+
</routers>
|
| 30 |
+
</admin>
|
| 31 |
+
</config>
|
app/design/adminhtml/default/default/template/easycachecleaner/page/header.phtml
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Copyright © 2016 iFlair Web Technologies. All rights reserved.
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
/** @var $this IFlair_EasyCacheCleaner_Block_Adminhtml_Page_Header */
|
| 8 |
+
?>
|
| 9 |
+
<div class="header-top">
|
| 10 |
+
<a href="<?php echo $this->getHomeLink() ?>"><img src="<?php echo $this->getSkinUrl('images/logo.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Magento Logo')) ?>" class="logo"/></a>
|
| 11 |
+
<div class="header-right">
|
| 12 |
+
<p class="super">
|
| 13 |
+
<?php echo $this->__("Logged in as %s", $this->escapeHtml($this->getUser()->getUsername())) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>" class="link-logout"><?php echo $this->__('Log Out') ?></a>
|
| 14 |
+
</p>
|
| 15 |
+
<p class="easycachecleaner_wrapper super">
|
| 16 |
+
<a href="javascript:void(0)" title="<?php echo $this->__('Refresh Cache') ?>" onclick="window.removeCache();">
|
| 17 |
+
<img src='<?php echo $this->getSkinUrl('easycachecleaner/images/flash.png');?>' alt="<?php echo $this->__('Refresh Cache') ?>">
|
| 18 |
+
</a>
|
| 19 |
+
</p>
|
| 20 |
+
<script type="text/javascript">
|
| 21 |
+
window.removeCache = function() {
|
| 22 |
+
|
| 23 |
+
var ajaxBlockUrl = '<?php echo $this->getUrl('easycachecleaner/adminhtml_cache/massRefresh', array('_current' => true)) ?>';
|
| 24 |
+
new Ajax.Request(ajaxBlockUrl, {
|
| 25 |
+
parameters: {isAjax: 'true', form_key: FORM_KEY},
|
| 26 |
+
onSuccess: function(transport) {
|
| 27 |
+
|
| 28 |
+
try {
|
| 29 |
+
if (transport.responseText.isJSON()) {
|
| 30 |
+
var response = transport.responseText.evalJSON()
|
| 31 |
+
if (response.error || response.success) {
|
| 32 |
+
var html = '<ul class="messages"><li class="'+response.type+'-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
|
| 33 |
+
$('messages').update(html);
|
| 34 |
+
}
|
| 35 |
+
if(response.ajaxExpired && response.ajaxRedirect) {
|
| 36 |
+
setLocation(response.ajaxRedirect);
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
catch (e) {
|
| 41 |
+
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
</script>
|
| 47 |
+
<?php if ( Mage::getSingleton('admin/session')->isAllowed('admin/global_search') ): ?>
|
| 48 |
+
<fieldset>
|
| 49 |
+
<legend>Search</legend>
|
| 50 |
+
<span id="global_search_indicator" class="autocomplete-indicator" style="display: none">
|
| 51 |
+
<img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading...')) ?>" class="v-middle"/>
|
| 52 |
+
</span>
|
| 53 |
+
<?php $defSearch = $this->__('Global Record Search') ?>
|
| 54 |
+
<input id="global_search" name="query" type="text" class="input-text" value="<?php if(!empty($query)): ?><?php echo $query ?><?php else: ?><?php echo Mage::helper('core')->quoteEscape($defSearch) ?><?php endif ?>" onfocus="if(this.value=='<?php echo Mage::helper('core')->quoteEscape($defSearch, true) ?>')this.value=''; " onblur="if(this.value=='')this.value='<?php echo $defSearch ?>';" />
|
| 55 |
+
<div id="global_search_autocomplete" class="autocomplete"></div>
|
| 56 |
+
<script type="text/javascript">
|
| 57 |
+
new Ajax.Autocompleter(
|
| 58 |
+
'global_search',
|
| 59 |
+
'global_search_autocomplete',
|
| 60 |
+
'<?php echo $this->getUrl('adminhtml/index/globalSearch') ?>',
|
| 61 |
+
{
|
| 62 |
+
paramName:"query",
|
| 63 |
+
minChars:2,
|
| 64 |
+
indicator:"global_search_indicator",
|
| 65 |
+
updateElement:getSelectionId,
|
| 66 |
+
evalJSON:'force'
|
| 67 |
+
}
|
| 68 |
+
);
|
| 69 |
+
function getSelectionId(li) {
|
| 70 |
+
location.href = li.getAttribute('url');
|
| 71 |
+
}
|
| 72 |
+
</script>
|
| 73 |
+
</fieldset>
|
| 74 |
+
<?php endif; ?>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
app/etc/modules/IFlair_EasyCacheCleaner.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<IFlair_EasyCacheCleaner>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</IFlair_EasyCacheCleaner>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>IFlair_EasyCacheCleaner</name>
|
| 4 |
+
<version>1.0.1</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license>GNU General Public License</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Single click cache cleaner</summary>
|
| 10 |
+
<description>No hassle of selecting each cache, easy to use, just click on spark on header to clear all of the caches.</description>
|
| 11 |
+
<notes>Stable easy cache cleaner extension</notes>
|
| 12 |
+
<authors><author><name>IFlair Web Technologies</name><user>iflair_web_tech</user><email>info@iflair.com</email></author></authors>
|
| 13 |
+
<date>2016-12-28</date>
|
| 14 |
+
<time>14:36:23</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="IFlair"><dir name="EasyCacheCleaner"><dir name="Block"><dir name="Adminhtml"><dir name="Page"><file name="Header.php" hash="e4dbe59df3446422e1ac2808674c39b3"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CacheController.php" hash="f7bb5423b5e08b2b05d9881370750427"/></dir></dir><dir name="etc"><file name="config.xml" hash="51503c1de8a71a8ce77b8ca96ddb7120"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="easycachecleaner"><dir name="page"><file name="header.phtml" hash="e5b18022daa96f81d5cd1b06e843c916"/><file name="header.phtml" hash="e5b18022daa96f81d5cd1b06e843c916"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IFlair_EasyCacheCleaner.xml" hash="c03cd1e78a844ee479eb1dcbfd752056"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="easycachecleaner"><dir><dir name="images"><file name="flash.png" hash="82bc3e25ff68c1dca918c1899ebadc47"/></dir></dir><dir name="images"><file name="flash.png" hash="82bc3e25ff68c1dca918c1899ebadc47"/><file name="flash.png" hash="82bc3e25ff68c1dca918c1899ebadc47"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
|
| 18 |
+
</package>
|
skin/adminhtml/default/default/easycachecleaner/images/flash.png
ADDED
|
Binary file
|
