set('cachestatus', 1) ->save(false); } if(!is_writable(e_CACHE_CONTENT)) { $mes->addError(CACLAN_10." (".e_CACHE.")"); e107::getRender()->tablerender(CACLAN_3, $mes->render()); require_once("footer.php"); exit; } if (isset($_POST['submit_cache'])) { e107::getConfig()->set('cachestatus', intval($_POST['cachestatus'])) ->set('syscachestatus', intval($_POST['syscachestatus'])) ->set('jscsscachestatus', intval($_POST['jscsscachestatus'])) ->save(false); } if (isset($_POST['trigger_empty_cache'])) { e107::getLog()->addSuccess(CACLAN_6); $triggerName = $_POST['option_clear_cache']; switch ($_POST['option_clear_cache']) { case 'empty_contentcache': e107::getCache()->clearAll('content'); e107::getLog()->flushMessages(CACLAN_5); break; case 'empty_syscache': e107::getCache()->clearAll('system'); e107::getLog()->flushMessages(CACLAN_16); e107::getSession()->clear('addons-update-status'); break; case 'empty_dbcache': e107::getCache()->clearAll('db'); e107::getLog()->flushMessages(CACLAN_24); break; case 'empty_imgcache': e107::getCache()->clearAll('image'); e107::getLog()->flushMessages(CACLAN_25); break; // used in standard page output and internal JS includes case 'empty_browsercache': e107::getCache()->clearAll('browser'); e107::getLog()->flushMessages(CACLAN_25); break; case 'empty_jscss': e107::getCache()->clearAll('js'); e107::getCache()->clearAll('css'); // e107::getAdminLog()->flushMessages(CACLAN_5); break; // all default: e107::getCache()->clearAll('content'); e107::getCache()->clearAll('system'); e107::getCache()->clearAll('db'); e107::getCache()->clearAll('image'); e107::getCache()->clearAll('browser'); e107::getCache()->clearAll('js'); e107::getCache()->clearAll('css'); e107::getSession()->clear('addons-update-status'); e107::getLog()->flushMessages(CACLAN_26); $triggerName = 'default'; break; } e107::getEvent()->trigger('admin_after_clear_cache', $triggerName); } $syscache_files = glob(e_CACHE_CONTENT.'S_*.*'); $cache_files = glob(e_CACHE_CONTENT.'C_*.*'); $imgcache_files = glob(e_CACHE_IMAGE.'*.cache.bin'); $dbcache_files = glob(e_CACHE_DB.'*.php'); $jscsscache_files = glob(e_WEB.'cache/*.{css,js}',GLOB_BRACE); $syscache_files_num = count($syscache_files); $cache_files_num = count($cache_files); $imgcache_files_num = count($imgcache_files); $dbcache_files_num = count($dbcache_files); $jscsscache_files_num = count($jscsscache_files); $syscache_label = $syscache_files_num.' '.($syscache_files_num != 1 ? CACLAN_19 : CACLAN_18); $contentcache_label = $cache_files_num.' '.($cache_files_num != 1 ? CACLAN_19 : CACLAN_18); $imgcache_label = $imgcache_files_num.' '.($imgcache_files_num != 1 ? CACLAN_19 : CACLAN_18); $dbcache_label = $dbcache_files_num.' '.($dbcache_files_num != 1 ? CACLAN_19 : CACLAN_18); $jscsscache_label = $jscsscache_files_num.' '.($jscsscache_files_num != 1 ? CACLAN_19 : CACLAN_18); $text = "
".CACLAN_3."
".CACLAN_17." ".CACLAN_1."
".CACLAN_11." ".$frm->help(CACLAN_13)." {$contentcache_label} ".$frm->radio_switch('cachestatus', e107::getPref('cachestatus'))."
".CACLAN_12." ".$frm->help(CACLAN_14)." {$syscache_label} ".$frm->radio_switch('syscachestatus', e107::getPref('syscachestatus'))."
".CACLAN_28."".$frm->help(CACLAN_29)." {$jscsscache_label} ".$frm->radio_switch('jscsscachestatus', e107::getPref('jscsscachestatus'))."
".CACLAN_20."".$frm->help(CACLAN_21)." {$dbcache_label} ".LAN_ENABLED."
".CACLAN_22."".$frm->help(CACLAN_23)." {$imgcache_label} ".LAN_ENABLED."
".$frm->admin_button('submit_cache', CACLAN_2, 'update')."
".$frm->select('option_clear_cache', array( 'empty_all' => CACLAN_26, 'empty_contentcache' => CACLAN_5, 'empty_syscache' => CACLAN_16, 'empty_jscss' => CACLAN_30, 'empty_dbcache' => CACLAN_24, 'empty_imgcache' => CACLAN_25, 'empty_browsercache' => CACLAN_27, ))." ".$frm->admin_button('trigger_empty_cache', LAN_DELETE, 'delete')."
"; e107::getRender()->tablerender(CACLAN_3, $mes->render().$text); require_once("footer.php"); ?>