From 4f30a2c62ae26aedeba454844a504f949a6d8577 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Wed, 30 Jul 2014 17:44:50 +1000 Subject: [PATCH] Add empty log links --- modules/system/controllers/EventLogs.php | 8 ++++++++ modules/system/controllers/RequestLogs.php | 8 ++++++++ modules/system/controllers/eventlogs/_list_toolbar.htm | 8 +++++--- modules/system/controllers/requestlogs/_list_toolbar.htm | 8 +++++--- modules/system/lang/en/lang.php | 8 ++++++-- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/modules/system/controllers/EventLogs.php b/modules/system/controllers/EventLogs.php index 4b2c5538f..8e30a8e8d 100644 --- a/modules/system/controllers/EventLogs.php +++ b/modules/system/controllers/EventLogs.php @@ -10,6 +10,7 @@ use BackendMenu; use Backend\Classes\Controller; use System\Classes\ApplicationException; use System\Classes\SettingsManager; +use System\Models\EventLog; use Exception; /** @@ -41,4 +42,11 @@ class EventLogs extends Controller SettingsManager::setContext('October.System', 'event_logs'); } + public function onEmptyLog() + { + EventLog::truncate(); + Flash::success(Lang::get('system::lang.event_log.empty_success')); + return $this->listRefresh(); + } + } \ No newline at end of file diff --git a/modules/system/controllers/RequestLogs.php b/modules/system/controllers/RequestLogs.php index 59b365610..f7a78f18e 100644 --- a/modules/system/controllers/RequestLogs.php +++ b/modules/system/controllers/RequestLogs.php @@ -10,6 +10,7 @@ use BackendMenu; use Backend\Classes\Controller; use System\Classes\ApplicationException; use System\Classes\SettingsManager; +use System\Models\RequestLog; use Exception; /** @@ -41,4 +42,11 @@ class RequestLogs extends Controller SettingsManager::setContext('October.System', 'request_logs'); } + public function onEmptyLog() + { + RequestLog::truncate(); + Flash::success(Lang::get('system::lang.event_log.empty_success')); + return $this->listRefresh(); + } + } \ No newline at end of file diff --git a/modules/system/controllers/eventlogs/_list_toolbar.htm b/modules/system/controllers/eventlogs/_list_toolbar.htm index c916630a1..1207b2ce3 100644 --- a/modules/system/controllers/eventlogs/_list_toolbar.htm +++ b/modules/system/controllers/eventlogs/_list_toolbar.htm @@ -1,7 +1,9 @@ -
+ \ No newline at end of file diff --git a/modules/system/controllers/requestlogs/_list_toolbar.htm b/modules/system/controllers/requestlogs/_list_toolbar.htm index f5f0b0dc0..389a5e3c3 100644 --- a/modules/system/controllers/requestlogs/_list_toolbar.htm +++ b/modules/system/controllers/requestlogs/_list_toolbar.htm @@ -1,7 +1,9 @@ -
+ \ No newline at end of file diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index a16bb28a1..877c5324b 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -179,11 +179,15 @@ return [ 'event_log' => [ 'menu_label' => 'Event Log', 'menu_description' => 'View system log messages with their recorded time and details.', - 'empty' => 'Empty event log', + 'empty_link' => 'Empty event log', + 'empty_loading' => 'Emptying event log...', + 'empty_success' => 'Successfully emptied the event log.', ], 'request_log' => [ 'menu_label' => 'Request Log', 'menu_description' => 'View bad or redirected requests, such as Page not found (404).', - 'empty' => 'Empty request log', + 'empty_link' => 'Empty request log', + 'empty_loading' => 'Emptying request log...', + 'empty_success' => 'Successfully emptied the request log.', ], ];