From 7d4abe8f7b098d272d4aed4c21f0739e508d4243 Mon Sep 17 00:00:00 2001 From: pate Date: Thu, 25 Apr 2002 20:16:50 +0000 Subject: [PATCH] refactored &mkformnotable to use foreach and ifels instead of while and many ifs --- C4/Output.pm | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 2755b02997..0e0b58089a 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -266,25 +266,26 @@ sub mkform3{ sub mkformnotable{ my ($action,@inputs)=@_; my $string="
\n"; - my $count=@inputs; - for (my $i=0; $i<$count; $i++){ - if ($inputs[$i][0] eq 'hidden'){ - $string=$string."\n"; - } - if ($inputs[$i][0] eq 'radio') { - $string.="$inputs[$i][2]"; - } - if ($inputs[$i][0] eq 'text') { - $string.=""; - } - if ($inputs[$i][0] eq 'textarea') { - $string.=""; - } - if ($inputs[$i][0] eq 'reset'){ - $string.=""; - } - if ($inputs[$i][0] eq 'submit'){ - $string.=""; + foreach my $input (@inputs){ + if ($$input[0] eq 'hidden'){ + $string .= + "\n"; + } elsif ($$input[0] eq 'radio') { + $string .= + "$$input[2]"; + } elsif ($$input[0] eq 'text') { + $string .= + ""; + } elsif ($$input[0] eq 'textarea') { + $string .= + ""; + } elsif ($$input[0] eq 'reset'){ + $string .= + ""; + } elsif ($$input[0] eq 'submit'){ + $string.=""; } } $string=$string."
"; -- 2.39.5