Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I18n the RSS tab for the RSS Feed role. Provide a way for additional …
…tabs to be i18n'ed, like Subscribable.
  • Loading branch information
perlDreamer committed Nov 24, 2011
1 parent 288adcf commit ce15690
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
28 changes: 23 additions & 5 deletions lib/WebGUI/Asset.pm
Expand Up @@ -504,6 +504,28 @@ sub addEditSaveButtons {
return $form->addFieldAt( $buttonGroup, 0 );
}

#----------------------------------------------------------------------------

=head2 addEditSaveTabs ( form )
Add the tabs to the form for editing or saving the asset's properties.
This is broken out so that additional tabs with i18n'ed labels can be
added by subclasses or by Roles.
=cut

sub addEditSaveTabs {
my ( $self, $form ) = @_;
my $session = $self->session;
my $i18n = WebGUI::International->new($session, "Asset");
# Not using loop to maintain correct order
$form->addTab( name => "properties", label => $i18n->get("properties") );
$form->addTab( name => "display", label => $i18n->get(105) );
$form->addTab( name => "security", label => $i18n->get(107) );
$form->addTab( name => "meta", label => $i18n->get("Metadata") );
return $form;
}

#-------------------------------------------------------------------

=head2 addMissing ( url )
Expand Down Expand Up @@ -1085,11 +1107,7 @@ sub getEditForm {

###
# Create the main tabset
# Not using loop to maintain correct order
$f->addTab( name => "properties", label => $i18n->get("properties") );
$f->addTab( name => "display", label => $i18n->get(105) );
$f->addTab( name => "security", label => $i18n->get(107) );
$f->addTab( name => "meta", label => $i18n->get("Metadata") );
$self->addEditSaveTabs($f);

###
# Asset ID and class name
Expand Down
18 changes: 17 additions & 1 deletion lib/WebGUI/Role/Asset/RssFeed.pm
Expand Up @@ -121,7 +121,23 @@ These methods are available from this class:
=cut

#-------------------------------------------------------------------
#----------------------------------------------------------------------------

=head2 addEditSaveTabs ( form )
Add the tab for the RSS feed configuration data.
=cut

override addEditSaveTabs => sub {
my ( $self, $form ) = @_;
$form = super();
my $i18n = WebGUI::International->new($self->session, 'Role_RssFeed');
$form->addTab( name => "rss", label => $i18n->get("RSS tab") );
return $form;
};

#-------------------------------------------------------------------

=head2 dispatch ( )
Expand Down

0 comments on commit ce15690

Please sign in to comment.