diff --git a/config/filter.php b/config/filter.php index 5c651142b1..c1d66224d4 100755 --- a/config/filter.php +++ b/config/filter.php @@ -21,6 +21,7 @@ $filter->default->paramValue = 'reg::paramValue'; $filter->default->get['onlybody'] = 'equal::yes'; $filter->default->get['_single'] = 'equal::1'; +$filter->default->get['_nocache'] = 'equal::1'; $filter->default->get['tid'] = 'reg::word'; $filter->default->get['HTTP_X_REQUESTED_WITH'] = 'equal::XMLHttpRequest'; diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 5799fba03f..dcafc52d19 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2266,7 +2266,7 @@ class baseRouter { $cacheEnable = $this->config->cache->enableFullPage; /* If caching is not turned on, pages that do not need to be cached, or when searching, they are not cached. */ - if(!$cacheEnable || !in_array("{$this->moduleName}|{$this->methodName}", $this->config->cache->fullPages) || stripos($this->server->request_uri, 'search') !== false) + if(!$cacheEnable || !in_array("{$this->moduleName}|{$this->methodName}", $this->config->cache->fullPages) || stripos($this->server->request_uri, 'search') !== false || isset($_GET['_nocache']) || $this->server->http_x_zt_refresh) { $this->loadModule(); return helper::removeUTF8Bom(ob_get_clean()); diff --git a/module/block/js/dashboard.js b/module/block/js/dashboard.js index 63f476ff44..4cea7405c6 100644 --- a/module/block/js/dashboard.js +++ b/module/block/js/dashboard.js @@ -58,14 +58,17 @@ function resizeBlock(blockID, width, callback) * * @param object $panel * @param function afterRefresh + * @param number forceRefresh * @access public * @return void */ -function refreshBlock($panel, afterRefresh) +function refreshBlock($panel, afterRefresh, forceRefresh = 0) { var url = $panel.data('url'); + var headers = {}; + if(forceRefresh) headers['X-Zt-Refresh'] = forceRefresh; $panel.addClass('load-indicator loading'); - $.ajax({url: url, dataType: 'html'}).done(function(data) + $.ajax({url: url, dataType: 'html', headers: headers}).done(function(data) { var $data = $(data); if($data.hasClass('panel')) $panel.empty().append($data.children()); @@ -284,7 +287,7 @@ $(function() always: function(){sortMessager.isShow && sortMessager.hide();} }).on('click', '.refresh-panel', function() { - refreshBlock($(this).closest('.panel')); + refreshBlock($(this).closest('.panel'), null, 1); }); });