definition method for ShipDriver, with tests
This commit is contained in:
parent
40b432da40
commit
a89c507ed6
3 changed files with 122 additions and 11 deletions
|
|
@ -4,6 +4,8 @@ use strict;
|
|||
|
||||
use Class::InsideOut qw{ :std };
|
||||
use Carp qw(croak);
|
||||
use Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -63,6 +65,42 @@ sub create {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( $session )
|
||||
|
||||
Constructor for new WebGUI::Shop::ShipperDriver objects. Returns a WebGUI::Shop::ShipperDriver object.
|
||||
To access driver objects that have already been configured, use C<new>.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift || [];
|
||||
my $i18n = WebGUI::International->new($session, 'ShipDriver');
|
||||
tie my %properties, 'Tie::IxHash';
|
||||
%properties = (
|
||||
name => 'Shipper Driver',
|
||||
fields => {
|
||||
label => {
|
||||
fieldType => 'text',
|
||||
label => $i18n->get('label'),
|
||||
hoverHelp => $i18n->get('label help'),
|
||||
defaultValue => undef,
|
||||
},
|
||||
enabled => {
|
||||
fieldType => 'yesNo',
|
||||
label => $i18n->get('enabled'),
|
||||
hoverHelp => $i18n->get('enabled help'),
|
||||
defaultValue => 1,
|
||||
},
|
||||
},
|
||||
);
|
||||
push @{ $definition }, \%properties;
|
||||
return $definition;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 label ( )
|
||||
|
||||
Accessor for the label property. This is the name assigned to this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue