From 0e317f9d872f538fbf13f81e8a72272ab2c92e84 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 Aug 2006 14:40:03 +0100 Subject: [PATCH] sortable filter list --- backend.php | 16 +++++++++++----- prefs.js | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/backend.php b/backend.php index 9b38303d..d9a4fe72 100644 --- a/backend.php +++ b/backend.php @@ -2101,6 +2101,12 @@ if ($quiet) return; + $sort = db_escape_string($_GET["sort"]); + + if (!$sort || $sort == "undefined") { + $sort = "reg_exp"; + } + // print "
PLACEHOLDER
"; $result = db_query($link, "SELECT id,description @@ -2133,7 +2139,7 @@ filter_type = ttrss_filter_types.id AND ttrss_filter_actions.id = action_id AND ttrss_filters.owner_uid = ".$_SESSION["uid"]." - ORDER by reg_exp"); + ORDER by $sort"); if (db_num_rows($result) != 0) { @@ -2150,10 +2156,10 @@ print "   - Filter expression - Feed - Match - Action"; + Filter expression + Feed + Match + Action"; $lnum = 0; diff --git a/prefs.js b/prefs.js index eabdd301..626d216a 100644 --- a/prefs.js +++ b/prefs.js @@ -1072,7 +1072,7 @@ function validateOpmlImport() { } } -function updateFilterList() { +function updateFilterList(sort_key) { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -1083,7 +1083,7 @@ function updateFilterList() { // p_notify("Loading, please wait..."); - xmlhttp.open("GET", "backend.php?op=pref-filters", true); + xmlhttp.open("GET", "backend.php?op=pref-filters&sort=" + param_escape(sort_key), true); xmlhttp.onreadystatechange=filterlist_callback; xmlhttp.send(null); -- 2.39.2