]> git.wh0rd.org - tt-rss.git/commitdiff
add clear sql log button
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 29 Apr 2013 19:12:54 +0000 (23:12 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 29 Apr 2013 19:12:54 +0000 (23:12 +0400)
classes/pref/system.php
js/prefs.js

index d2b6cd7461ff8240a4cbfabd87f3670a13204b41..7accb1f912e870ec9d4c7b5bbb8049b755f388d8 100644 (file)
@@ -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 "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
@@ -35,6 +39,9 @@ class Pref_System extends Handler_Protected {
                        print "<button dojoType=\"dijit.form.Button\"
                                onclick=\"updateSystemList()\">".__('Refresh')."</button> ";
 
+                       print "&nbsp;<button dojoType=\"dijit.form.Button\"
+                               onclick=\"clearSqlLog()\">".__('Clear log')."</button> ";
+
                        print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">";
 
                        print "<tr class=\"title\">
index 431a1fe84907040b30c2d0ce39beb63d2c6b3cd8..4346054ef68e3c3374cf36f16f8ac526acc368e8 100644 (file)
@@ -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();
+                       } });
+
+       }
+}
+
+