summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/VNBrowse.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-25 16:45:45 +0100
committerYorhel <git@yorhel.nl>2011-01-25 17:07:06 +0100
commite46f634c49aa4e174d6cc351b25a60d33c251b25 (patch)
tree7bf39676260b9c266c083f63ad2522faf79c4b0f /lib/VNDB/Handler/VNBrowse.pm
parente23b49f3bd6fddca80076f1dc19e5f913400ff48 (diff)
TUWF: Initial convert from YAWF to TUWF
There may still be some bugs present and I've only converted the points where TUWF is incompatible with YAWF. The new TUWF features are not in use yet, I'll do that later on. Note that, in order to run the new code, TUWF must be installed on your system. The configuration for the TransAdmin plugin has also changed. Other than that there shouldn't be any issues.
Diffstat (limited to 'lib/VNDB/Handler/VNBrowse.pm')
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index 8a63b79b..16a7edfb 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -3,11 +3,11 @@ package VNDB::Handler::VNBrowse;
use strict;
use warnings;
-use YAWF ':html';
+use TUWF ':html';
use VNDB::Func;
-YAWF::register(
+TUWF::register(
qr{v/([a-z0]|all)} => \&list,
);
@@ -16,14 +16,14 @@ sub list {
my($self, $char) = @_;
my $f = $self->formValidate(
- { name => 's', required => 0, default => 'tagscore', enum => [ qw|title rel pop tagscore rating| ] },
- { name => 'o', required => 0, enum => [ 'a','d' ] },
- { name => 'p', required => 0, default => 1, template => 'int' },
- { name => 'q', required => 0, default => '' },
- { name => 'sq', required => 0, default => '' },
- { name => 'fil',required => 0, default => '' },
+ { get => 's', required => 0, default => 'tagscore', enum => [ qw|title rel pop tagscore rating| ] },
+ { get => 'o', required => 0, enum => [ 'a','d' ] },
+ { get => 'p', required => 0, default => 1, template => 'int' },
+ { get => 'q', required => 0, default => '' },
+ { get => 'sq', required => 0, default => '' },
+ { get => 'fil',required => 0, default => '' },
);
- return 404 if $f->{_err};
+ return $self->resNotFound if $f->{_err};
$f->{q} ||= $f->{sq};
$f->{fil} = $self->authPref('filter_vn') if !grep $_ eq 'fil', $self->reqParam();
my %compat = _fil_compat($self);
@@ -75,9 +75,9 @@ sub _fil_compat {
my $self = shift;
my %c;
my $f = $self->formValidate(
- { name => 'ln', required => 0, multi => 1, enum => $self->{languages}, default => '' },
- { name => 'pl', required => 0, multi => 1, enum => $self->{platforms}, default => '' },
- { name => 'sp', required => 0, default => $self->reqCookie($self->{cookie_prefix}.'tagspoil') =~ /^([0-2])$/ ? $1 : 0, enum => [0..2] },
+ { get => 'ln', required => 0, multi => 1, enum => $self->{languages}, default => '' },
+ { get => 'pl', required => 0, multi => 1, enum => $self->{platforms}, default => '' },
+ { get => 'sp', required => 0, default => $self->reqCookie($self->{cookie_prefix}.'tagspoil') =~ /^([0-2])$/ ? $1 : 0, enum => [0..2] },
);
return () if $f->{_err};
$c{lang} //= $f->{ln} if $f->{ln}[0];