move admin console links into asset helpers

This commit is contained in:
Doug Bell 2011-03-28 16:36:16 -05:00
parent aee00bfad1
commit fbd573c9d6

View file

@ -277,7 +277,9 @@ a shelf. Override master class to add different form.
sub getAddToCartForm {
my $self = shift;
my $session = $self->session;
:cn
:cn
my $i18n = WebGUI::International->new($session, 'Asset_Subscription');
return
WebGUI::Form::formHeader($session, {action => $self->getUrl})
@ -289,27 +291,6 @@ sub getAddToCartForm {
#-------------------------------------------------------------------
=head2 getAdminConsoleWithSubmenu ( )
Returns an admin console with management links added to the submenu.
=cut
sub getAdminConsoleWithSubmenu {
my $self = shift;
my $session = $self->session;
my $ac = $self->getAdminConsole;
my $i18n = WebGUI::International->new( $session, 'Asset_Subscription' );
$ac->addSubmenuItem( $self->getUrl('func=createSubscriptionCodeBatch'), $i18n->get('generate batch'));
$ac->addSubmenuItem( $self->getUrl('func=listSubscriptionCodes;selection=dc'), $i18n->get('manage codes') );
$ac->addSubmenuItem( $self->getUrl('func=listSubscriptionCodeBatches'), $i18n->get('manage batches'));
return $ac;
}
#-------------------------------------------------------------------
=head2 getCode ( code )
Returns a hashref with the properties of the passed code.
@ -415,6 +396,35 @@ sub getExpirationOffset {
#-------------------------------------------------------------------
=head2 getHelpers ( )
Get the some links to manage subscription codes
=cut
override getHelpers => sub {
my ( $self ) = @_;
my $helpers = super();
my $i18n = WebGUI::International->new( $session, 'Asset_Subscription' );
$helpers->{createSubscriptionCodeBatch} = {
url => $self->getUrl('func=createSubscriptionCodeBatch'),
label => $i18n->get('generate batch'),
};
$helpers->{listSubscriptionCodes} = {
url => $self->getUrl('func=listSubscriptionCodes;selection=dc'),
label => $i18n->get('manage codes'),
};
$helpers->{listSubscriptionCodeBatches} = {
url => $self->getUrl('func=listSubscriptionCodeBatches'),
label => $i18n->get('manage batches'),
};
return $helpers;
}
#-------------------------------------------------------------------
=head2 getPrice
Returns configured price, 0.00 if neither of those are available.