From e46f634c49aa4e174d6cc351b25a60d33c251b25 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Tue, 25 Jan 2011 16:45:45 +0100 Subject: 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. --- lib/VNDB/Handler/VNBrowse.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/VNDB/Handler/VNBrowse.pm') 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]; -- cgit v1.2.3