From 5ff4858a5c773875863c2ca856ad99f4b2a3450f Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 22 Jun 2019 10:27:06 +0300 Subject: [PATCH] Admin Panel: Tools #170 #165 - next round of implementation --- .../admin/app/Controllers/ToolsController.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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) {