summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-02-22 21:38:39 +0100
committerYorhel <git@yorhel.nl>2009-02-22 21:38:39 +0100
commitfe3f588b873346789de148dda832fa19e8f10d07 (patch)
treea7dafc781abbc99118de697dfe2368d7a2adfa36 /lib/VNDB/DB/Tags.pm
parente0390c46122dd2d4d14b7b7f2eeee27b679c133e (diff)
vntagmod: Adding tags using dropdown search
The usual: it's still pretty much useless and unfinished, will polish up things later.
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r--lib/VNDB/DB/Tags.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm
index fb8ebca5..aca87677 100644
--- a/lib/VNDB/DB/Tags.pm
+++ b/lib/VNDB/DB/Tags.pm
@@ -8,7 +8,7 @@ use Exporter 'import';
our @EXPORT = qw|dbTagGet dbTagEdit dbTagAdd dbTagDel dbTagLinks dbVNTags|;
-# %options->{ id name page results order what }
+# %options->{ id name search page results order what }
# what: parents childs(n)
sub dbTagGet {
my $self = shift;
@@ -20,11 +20,15 @@ sub dbTagGet {
@_
);
+ $o{search} =~ s/%//g if $o{search};
+
my %where = (
$o{id} ? (
't.id = ?' => $o{id} ) : (),
$o{name} ? (
'lower(t.name) = ?' => lc $o{name} ) : (),
+ $o{search} ? (
+ '(t.name ILIKE ? OR t.alias ILIKE ?)' => [ "%$o{search}%", "%$o{search}%" ] ) : (),
);
my($r, $np) = $self->dbPage(\%o, q|