/[Frey]/trunk/lib/Frey/Action.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Action.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 508 by dpavlin, Tue Nov 25 00:26:15 2008 UTC revision 509 by dpavlin, Tue Nov 25 01:00:16 2008 UTC
# Line 135  sub params_form { Line 135  sub params_form {
135                  } elsif ( $attr_type !~ m{^(Str|Int)$} ) {                  } elsif ( $attr_type !~ m{^(Str|Int)$} ) {
136                                  $value_html = qq|<textarea name="$name" title="$attr_type">$value</textarea>|;                                  $value_html = qq|<textarea name="$name" title="$attr_type">$value</textarea>|;
137                  }                  }
138                    
139                  $value = $attr->default( $name ) if ! $value && $attr->has_default;                  $value = $attr->default( $name ) if ! $value && $attr->has_default;
140                  $label_title = qq| title="| . $attr->documentation . qq|"| if $attr->has_documentation;                  $label_title = qq| title="| . $attr->documentation . qq|"| if $attr->has_documentation;
141    
142                  $default->{$name} = $value unless defined $default->{$name};                  $default->{$name} = $value unless defined $default->{$name};
143    
144                  $value_html = qq|<input type="$type" name="$name" title="$attr_type" value="$value">| unless $value_html;                  if ( ! $value_html ) {
145                            my $suffix = '';
146                            if ( $attr_type =~ m{^Bool$} ) {
147                                    $type = 'checkbox';
148                                    $suffix = ' checked' if $value;
149                            }
150                            $value_html = qq|<input type="$type" name="$name" title="$attr_type" value="$value"$suffix>|;
151                    }
152    
153  #               warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 );  #               warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 );
154                  $form .= qq|<label for="$name"$label_title>$label</label>| . $value_html;                  $form .= qq|<label for="$name"$label_title>$label</label>| . $value_html;

Legend:
Removed from v.508  
changed lines
  Added in v.509

  ViewVC Help
Powered by ViewVC 1.1.26