added fieldsets around form controls with multiple elements
This commit is contained in:
parent
d41625dc40
commit
98bfd9ac1d
5 changed files with 36 additions and 24 deletions
|
|
@ -59,7 +59,10 @@ sub definition {
|
|||
push(@{$definition}, {
|
||||
checked=>{
|
||||
defaultValue=> 0
|
||||
},
|
||||
},
|
||||
label => {
|
||||
defaultValue => undef,
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
|
@ -99,12 +102,16 @@ Renders and input tag of type radio.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my$self = shift;
|
||||
my $self = shift;
|
||||
my $value = $self->getOriginalValue();
|
||||
$value = defined $value ? $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($value))) : '';
|
||||
my $checkedText = $self->get("checked") ? ' checked="checked"' : '';
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue