added fieldsets around form controls with multiple elements

This commit is contained in:
Graham Knop 2008-09-16 16:27:15 +00:00
parent d41625dc40
commit 98bfd9ac1d
5 changed files with 36 additions and 24 deletions

View file

@ -1,4 +1,5 @@
7.6.0 7.6.0
- added fieldsets around form controls with multiple elements
- rfe: Town Hall: Menu title in search results - rfe: Town Hall: Menu title in search results
- rfe: Process Macros in HTTP Proxy's URL - rfe: Process Macros in HTTP Proxy's URL
- rfe: TimeZone for the User Profiles displays incorrectly after installation - rfe: TimeZone for the User Profiles displays incorrectly after installation

View file

@ -137,7 +137,7 @@ Renders a series of checkboxes.
sub toHtml { sub toHtml {
my $self = shift; my $self = shift;
my $output; my $output = '<fieldset style="border:none;margin:0;padding:0">';
my $alignment = $self->alignmentSeparator; my $alignment = $self->alignmentSeparator;
# Add the select all button # Add the select all button
@ -164,7 +164,7 @@ sub toHtml {
. $alignment . $alignment
; ;
} }
$output .= "</fieldset>";
return $output; return $output;
} }

View file

@ -59,6 +59,9 @@ sub definition {
push(@{$definition}, { push(@{$definition}, {
checked=>{ checked=>{
defaultValue=> 0 defaultValue=> 0
},
label => {
defaultValue => undef,
}, },
}); });
return $class->SUPER::definition($session, $definition); return $class->SUPER::definition($session, $definition);
@ -104,7 +107,11 @@ sub toHtml {
$value = defined $value ? $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($value))) : ''; $value = defined $value ? $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($value))) : '';
my $checkedText = $self->get("checked") ? ' checked="checked"' : ''; my $checkedText = $self->get("checked") ? ' checked="checked"' : '';
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : ''; my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
return '<input type="radio" name="'.$self->get("name").'" value="'.$value.'"'.$idText.$checkedText.' '.($self->get("extras")||'').' />'; my $control = '<input type="radio" name="'.$self->get("name").'" value="'.$value.'"'.$idText.$checkedText.' '.($self->get("extras")||'').' />';
if ($self->get('label')) {
return "<label>" . $control . $self->get('label') . "</label>";
}
return $control;
} }

View file

@ -143,7 +143,7 @@ Renders a series of radio buttons.
sub toHtml { sub toHtml {
my $self = shift; my $self = shift;
my $output; my $output = '<fieldset style="border:none;margin:0;padding:0">';
my $alignment = $self->alignmentSeparator; my $alignment = $self->alignmentSeparator;
my $i=0; my $i=0;
my $options = $self->getOptions; my $options = $self->getOptions;
@ -162,6 +162,7 @@ sub toHtml {
})->toHtml; })->toHtml;
$output .= '<label for="'.$self->get('name').$i.'">'.$options->{$key}."</label>" . $alignment; $output .= '<label for="'.$self->get('name').$i.'">'.$options->{$key}."</label>" . $alignment;
} }
$output .= "</fieldset>";
return $output; return $output;
} }

View file

@ -154,21 +154,24 @@ sub toHtml {
} else { } else {
$checkNo = 1; $checkNo = 1;
} }
my $output = WebGUI::Form::Radio->new($self->session, my $output = '<fieldset style="border:none;margin:0;padding:0">'
. WebGUI::Form::Radio->new($self->session,
checked => $checkYes, checked => $checkYes,
name => $self->get("name"), name => $self->get("name"),
value => 1, value => 1,
extras=>$self->get("extras") extras => $self->get("extras"),
)->toHtml; label => $i18n->get(138),
$output .= $i18n->get(138); )->toHtml
$output .= '&nbsp;&nbsp;&nbsp;'; . '&nbsp;&nbsp;&nbsp;'
$output .= WebGUI::Form::Radio->new($self->session, . WebGUI::Form::Radio->new($self->session,
checked => $checkNo, checked => $checkNo,
name => $self->get("name"), name => $self->get("name"),
value => 0, value => 0,
extras=>$self->get("extras") extras => $self->get("extras"),
)->toHtml; label => $i18n->get(139),
$output .= $i18n->get(139); )->toHtml
. '</fieldset>'
;
return $output; return $output;
} }