From: Andrew Dolgov Date: Mon, 29 Apr 2013 19:12:54 +0000 (+0400) Subject: add clear sql log button X-Git-Tag: 1.7.9~25^2~56 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=52e7b5a096f5d0d7724b6f1731559b237b2c47ae;p=tt-rss.git add clear sql log button --- diff --git a/classes/pref/system.php b/classes/pref/system.php index d2b6cd74..7accb1f9 100644 --- a/classes/pref/system.php +++ b/classes/pref/system.php @@ -19,6 +19,10 @@ class Pref_System extends Handler_Protected { return array_search($method, $csrf_ignored) !== false; } + function clearLog() { + $this->dbh->query("DELETE FROM ttrss_error_log"); + } + function index() { print "
"; @@ -35,6 +39,9 @@ class Pref_System extends Handler_Protected { print " "; + print "  "; + print "

"; print " diff --git a/js/prefs.js b/js/prefs.js index 431a1fe8..4346054e 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -1833,3 +1833,21 @@ function clearPluginData(name) { exception_error("clearPluginData", e); } } + +function clearSqlLog() { + + if (confirm(__("Clear all messages in the error log?"))) { + + notify_progress("Loading, please wait..."); + var query = "?op=pref-system&method=clearLog"; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + updateSystemList(); + } }); + + } +} + +