summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util/FormHTML.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-11-16 11:40:35 +0100
committerYorhel <git@yorhel.nl>2008-11-16 11:40:35 +0100
commitb4786aa2ef2c3e06e30be93a8d12d6e18c1e8bbf (patch)
tree507025c379f32a6ff729d5f73a30e9f023abb5f4 /lib/VNDB/Util/FormHTML.pm
parent2027a382b5bbf78a28725a425abe78f3f04dcc0e (diff)
Added reply/post edit/new thread functionality
Most of the code, or at least the design, was stolen from 1.X, as those functions were fine. Links to these forms is still pending...
Diffstat (limited to 'lib/VNDB/Util/FormHTML.pm')
-rw-r--r--lib/VNDB/Util/FormHTML.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index 558abda1..221794e0 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -22,6 +22,9 @@ my %formerr_names = (
website => 'Website',
desc => 'Description',
editsum => 'Edit summary',
+ msg => 'Message',
+ title => 'Title',
+ tags => 'Tags'
);
my %formerr_exeptions = (
login_failed => 'Invalid username or password',
@@ -52,11 +55,12 @@ sub htmlFormError {
next;
}
my($field, $type, $rule) = @$e;
- $field = $formerr_names{$field};
+ $field = $formerr_names{$field}||$field;
li sprintf '%s is a required field!', $field if $type eq 'required';
li sprintf '%s should have at least %d characters', $field, $rule if $type eq 'minlength';
li sprintf '%s: only %d characters allowed', $field, $rule if $type eq 'maxlength';
li sprintf '%s must be one of the following: %s', $field, join ', ', @$rule if $type eq 'enum';
+ li sprintf 'Wrong tag: %s', $rule if $type eq 'wrongtag';
li $rule->[1] if $type eq 'func' || $type eq 'regex';
if($type eq 'template') {
li sprintf