diff --git a/site/plugins/admin/app/Controllers/ToolsController.php b/site/plugins/admin/app/Controllers/ToolsController.php index 4737d2ea..24d91be9 100644 --- a/site/plugins/admin/app/Controllers/ToolsController.php +++ b/site/plugins/admin/app/Controllers/ToolsController.php @@ -109,10 +109,10 @@ class ToolsController extends Controller ], ], 'buttons' => [ - 'settings_clear_cache' => [ + 'tools_clear_cache' => [ 'type' => 'action', - 'id' => 'clear-cache', - 'link' => $this->router->pathFor('admin.settings.clear-cache'), + 'id' => 'clear-cache-all', + 'link' => $this->router->pathFor('admin.tools.clearCacheAllProcess'), 'title' => __('admin_clear_cache_all'), 'attributes' => ['class' => 'float-right btn'] ] @@ -133,6 +133,15 @@ class ToolsController extends Controller return $response->withRedirect($this->router->pathFor('admin.tools.cache')); } + public function clearCacheAllProcess($request, $response) + { + $this->cache->clearAll(); + + $this->flash->addMessage('success', __('admin_message_cache_files_deleted')); + + return $response->withRedirect($this->router->pathFor('admin.tools.cache')); + } + public function getDirectorySize($path) {