Added support for purge in cache dropdown

This commit is contained in:
Andy Miller
2018-09-20 11:25:04 -06:00
parent 1a50e35bd7
commit b6c2dc6186
7 changed files with 33 additions and 12 deletions

View File

@@ -1273,19 +1273,29 @@ class AdminController extends AdminBaseController
$clear = 'standard';
}
$results = Cache::clearCache($clear);
if (count($results) > 0) {
if ($clear === 'purge') {
$msg = Cache::purgeJob();
$this->admin->json_response = [
'status' => 'success',
'message' => $this->admin->translate('PLUGIN_ADMIN.CACHE_CLEARED') . ' <br />' . $this->admin->translate('PLUGIN_ADMIN.METHOD') . ': ' . $clear . ''
'message' => $msg,
];
} else {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin->translate('PLUGIN_ADMIN.ERROR_CLEARING_CACHE')
];
$results = Cache::clearCache($clear);
if (count($results) > 0) {
$this->admin->json_response = [
'status' => 'success',
'message' => $this->admin->translate('PLUGIN_ADMIN.CACHE_CLEARED') . ' <br />' . $this->admin->translate('PLUGIN_ADMIN.METHOD') . ': ' . $clear . ''
];
} else {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin->translate('PLUGIN_ADMIN.ERROR_CLEARING_CACHE')
];
}
}
return true;
}