Author: WillNorris
Date: 2005-05-25 02:18:19 -0700 (Wed, 25 May 2005)
New Revision: 4314
Modified:
twiki/branches/DEVELOP/lib/TWiki/UI.pm
Log:
CodeRefactor: removed duplicated code from form list generation
Modified: twiki/branches/DEVELOP/lib/TWiki/UI.pm
===================================================================
--- twiki/branches/DEVELOP/lib/TWiki/UI.pm 2005-05-24 19:02:16 UTC (rev 4313)
+++ twiki/branches/DEVELOP/lib/TWiki/UI.pm 2005-05-25 09:18:19 UTC (rev 4314)
@@ -346,20 +346,13 @@
my $formList = '';
foreach my $form ( @forms ) {
$formList .= CGI::br() if( $formList );
- if ( $form eq $formName ) {
- $formList .= CGI::input( {
+ $formList .= CGI::input( {
type => 'radio',
name => 'formtemplate',
value => $form,
- checked => 'checked',
- }, ' '.$form.' ' );
- } else {
- $formList .= CGI::input( {
- type => 'radio',
- name => 'formtemplate',
- value => $form,
- }, ' '.$form.' ' );
- }
+ checked => $form eq $formName ? 'checked' : '',
+ }, ' '.$form.' ' );
+ );
}
$page =~ s/%FORMLIST%/$formList/go;
|