--- trunk/lib/Frey/Action.pm 2008/11/25 00:26:15 507 +++ trunk/lib/Frey/Action.pm 2008/11/28 17:18:56 595 @@ -125,6 +125,8 @@ my $attr = $class->meta->get_attribute( $name ); $attr_type = $attr->type_constraint->name if $attr->has_type_constraint; + $value = $attr->default( $name ) if ! $value && $attr->has_default; + if ( ref($config_params) eq 'HASH' ) { $value = $config_params->{$name}; } elsif ( ref($config_params) eq 'ARRAY' ) { @@ -135,19 +137,26 @@ } elsif ( $attr_type !~ m{^(Str|Int)$} ) { $value_html = qq||; } - $value = $attr->default( $name ) if ! $value && $attr->has_default; + $label_title = qq| title="| . $attr->documentation . qq|"| if $attr->has_documentation; $default->{$name} = $value unless defined $default->{$name}; - $value_html = qq|| unless $value_html; + if ( ! $value_html ) { + my $suffix = ''; + if ( $attr_type =~ m{^Bool$} ) { + $type = 'checkbox'; + $suffix = ' checked' if $value; + } + $value_html = qq||; + } # warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 ); $form .= qq|| . $value_html; } my $html = qq|

$class params

$form
|; $self->add_status({ - $self->editor( $self->class ) => { + $self->class => { params => $self->params, config_params => $config_params, default => $default