From 112d2aec273278dae9ff0f715af836df09163a91 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 May 2008 04:07:39 +0100 Subject: label prefs: add search --- modules/pref-filters.php | 3 ++- modules/pref-labels.php | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/pref-filters.php b/modules/pref-filters.php index 9d39258a4..60fec2174 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -232,7 +232,8 @@ + onclick=\"javascript:updateFilterList()\" value=\"".__('Search')."\"> +

"; diff --git a/modules/pref-labels.php b/modules/pref-labels.php index 3582f42eb..7cdde4832 100644 --- a/modules/pref-labels.php +++ b/modules/pref-labels.php @@ -216,8 +216,22 @@ $sort = "description"; } - print " - "; + $label_search = db_escape_string($_GET["search"]); + + if (array_key_exists("search", $_GET)) { + $_SESSION["prefs_label_search"] = $label_search; + } else { + $label_search = $_SESSION["prefs_label_search"]; + } + + print "
+ + +

+

+
"; print "
"; @@ -226,11 +240,19 @@ onclick=\"return displayDlg('quickAddLabel', false)\" value=\"".__('Create label')."\">
"; + if ($label_search) { + $label_search_query = "(sql_exp LIKE '%$label_search%' OR + description LIKE '%$label_search%') AND"; + } else { + $label_search_query = ""; + } + $result = db_query($link, "SELECT id,sql_exp,description FROM ttrss_labels WHERE + $label_search_query owner_uid = ".$_SESSION["uid"]." ORDER BY $sort"); -- cgit v1.2.3