- return @result ? ' ' . join(' ', @result) : '';
-}
-
-sub html_tag {
- my ($self, $tag, $content, @slurp) = @_;
- my $attributes = $self->attributes(@slurp);
-
- return "<${tag}${attributes}/>" unless defined($content);
- return "<${tag}${attributes}>${content}</${tag}>";
-}
-
-sub select_tag {
- my $self = shift;
- my $name = shift;
- my $options_str = shift;
- my %attributes = _hashify(@_);
-
- $attributes{id} ||= $self->name_to_id($name);
- $options_str = $self->options_for_select($options_str) if ref $options_str;
-
- return $self->html_tag('select', $options_str, %attributes, name => $name);
-}
-
-sub textarea_tag {
- my ($self, $name, $content, @slurp) = @_;
- my %attributes = _hashify(@slurp);
-
- $attributes{id} ||= $self->name_to_id($name);
- $content = $content ? _H($content) : '';
-
- return $self->html_tag('textarea', $content, %attributes, name => $name);
-}
-
-sub checkbox_tag {
- my ($self, $name, @slurp) = @_;
- my %attributes = _hashify(@slurp);
-
- $attributes{id} ||= $self->name_to_id($name);
- $attributes{value} = 1 unless defined $attributes{value};
- my $label = delete $attributes{label};
- my $checkall = delete $attributes{checkall};
-
- if ($attributes{checked}) {
- $attributes{checked} = 'checked';
- } else {
- delete $attributes{checked};
- }
-
- my $code = $self->html_tag('input', undef, %attributes, name => $name, type => 'checkbox');
- $code .= $self->html_tag('label', $label, for => $attributes{id}) if $label;
- $code .= $self->javascript(qq|\$('#$attributes{id}').checkall('$checkall');|) if $checkall;
-
- return $code;
-}
-
-sub radio_button_tag {
- my $self = shift;
- my $name = shift;
- my %attributes = _hashify(@_);
-
- $attributes{value} = 1 unless defined $attributes{value};
- $attributes{id} ||= $self->name_to_id($name . "_" . $attributes{value});
- my $label = delete $attributes{label};
-
- if ($attributes{checked}) {
- $attributes{checked} = 'checked';
- } else {
- delete $attributes{checked};