--- trunk/lib/Frey/Web/Item.pm 2008/07/16 23:17:59 152 +++ trunk/lib/Frey/Web/Item.pm 2008/07/16 23:21:19 153 @@ -7,6 +7,7 @@ extends 'Frey'; with 'Frey::Web::Field'; with 'Frey::Web::Layout'; +with 'Frey::Storage'; #with 'BonusTypes'; use Moose::Util::TypeConstraints; @@ -32,6 +33,16 @@ lazy_build => 1, ); +has 'labels' => ( + is => 'rw', + isa => 'HashRef[Str]', + default => sub { + my $self = shift; + $self->load( 'var/design/' . $self->fey_class . '-labels' ) || {} + }, +); + + sub set_from_hash { my ($self, $f) = @_; my $attrmap = $self->fey->meta->get_attribute_map if $self->fey; @@ -85,7 +96,9 @@ sub field_label { my ( $self, $name ) = @_; - my $label = ucfirst($name); + my $new_labels = $self->reload( 'var/design/' . $self->fey_class . '-labels' ); + $self->labels( $new_labels ) if $new_labels; + my $label = $self->labels->{$name} || ucfirst($name); return $label; }