mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-01 21:30:41 +01:00
Added support for purge in cache dropdown
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user