diff options
author | Yorhel <git@yorhel.nl> | 2009-08-18 09:23:11 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-18 09:23:11 +0200 |
commit | 6be3db128ffa7c16ff4967ddf08a8577d9f25eaf (patch) | |
tree | 385184908592f267fe5e44e01f0d99353c18df66 /lib/VNDB/Util/FormHTML.pm | |
parent | e7a73f04525ad18b0bd2be8996431ecaf8eff330 (diff) |
htmlForm(): Don't generate subform id from the title
The subform id is now passed to htmlForm() as first formpart item. This
way the id won't change even if the title does, which will be the case
with the interface translation.
Diffstat (limited to 'lib/VNDB/Util/FormHTML.pm')
-rw-r--r-- | lib/VNDB/Util/FormHTML.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm index 473f8e7d..7e3b6f67 100644 --- a/lib/VNDB/Util/FormHTML.pm +++ b/lib/VNDB/Util/FormHTML.pm @@ -246,9 +246,8 @@ sub htmlForm { if(@subs > 2) { ul class => 'maintabs notfirst', id => 'jt_select'; for (0..$#subs/2) { - (my $short = lc $subs[$_*2]) =~ s/[^\w\d]+/_/g; li class => 'left'; - a href => "#$short", id => "jt_sel_$short", $subs[$_*2]; + a href => "#$subs[$_*2]", id => "jt_sel_$subs[$_*2]", $subs[$_*2+1][0]; end; } li class => 'left'; @@ -258,9 +257,9 @@ sub htmlForm { } # form subs - while(my($name, $parts) = (shift(@subs), shift(@subs))) { - last if !$name || !$parts; - (my $short = lc $name) =~ s/[^\w\d]+/_/g; + while(my($short, $parts) = (shift(@subs), shift(@subs))) { + last if !$short || !$parts; + my $name = shift @$parts; div class => 'mainbox', id => 'jt_box_'.$short; h1 $name; fieldset; |