summaryrefslogtreecommitdiff
path: root/modules/pref-labels.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-10-07 15:12:21 +0400
committerAndrew Dolgov <[email protected]>2009-10-07 15:12:21 +0400
commit1638fc4e13e1d71eceb1deefe983c7f48d47b8a1 (patch)
tree1c4910786308b17c713c61d2e49c6570e25d767d /modules/pref-labels.php
parent4b67e71e7d30fc61160a734815a759f6ff7f3060 (diff)
prefs: rudimentary multiple keyword search
Diffstat (limited to 'modules/pref-labels.php')
-rw-r--r--modules/pref-labels.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/pref-labels.php b/modules/pref-labels.php
index 165765b89..336228801 100644
--- a/modules/pref-labels.php
+++ b/modules/pref-labels.php
@@ -138,7 +138,19 @@
value=\"".__('Create label')."\"></div>";
if ($label_search) {
- $label_search_query = "caption LIKE '%$label_search%' AND";
+
+ $label_search = split(" ", $label_search);
+ $tokens = array();
+
+ foreach ($label_search as $token) {
+
+ $token = trim($token);
+ array_push($tokens, "(UPPER(caption) LIKE UPPER('%$token%'))");
+
+ }
+
+ $label_search_query = "(" . join($tokens, " AND ") . ") AND ";
+
} else {
$label_search_query = "";
}