Skip to content

Commit ce15690

Browse files
committedNov 24, 2011
I18n the RSS tab for the RSS Feed role. Provide a way for additional tabs to be i18n'ed, like Subscribable.
1 parent 288adcf commit ce15690

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed
 

‎lib/WebGUI/Asset.pm

+23-5
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,28 @@ sub addEditSaveButtons {
504504
return $form->addFieldAt( $buttonGroup, 0 );
505505
}
506506

507+
#----------------------------------------------------------------------------
508+
509+
=head2 addEditSaveTabs ( form )
510+
511+
Add the tabs to the form for editing or saving the asset's properties.
512+
This is broken out so that additional tabs with i18n'ed labels can be
513+
added by subclasses or by Roles.
514+
515+
=cut
516+
517+
sub addEditSaveTabs {
518+
my ( $self, $form ) = @_;
519+
my $session = $self->session;
520+
my $i18n = WebGUI::International->new($session, "Asset");
521+
# Not using loop to maintain correct order
522+
$form->addTab( name => "properties", label => $i18n->get("properties") );
523+
$form->addTab( name => "display", label => $i18n->get(105) );
524+
$form->addTab( name => "security", label => $i18n->get(107) );
525+
$form->addTab( name => "meta", label => $i18n->get("Metadata") );
526+
return $form;
527+
}
528+
507529
#-------------------------------------------------------------------
508530

509531
=head2 addMissing ( url )
@@ -1085,11 +1107,7 @@ sub getEditForm {
10851107

10861108
###
10871109
# Create the main tabset
1088-
# Not using loop to maintain correct order
1089-
$f->addTab( name => "properties", label => $i18n->get("properties") );
1090-
$f->addTab( name => "display", label => $i18n->get(105) );
1091-
$f->addTab( name => "security", label => $i18n->get(107) );
1092-
$f->addTab( name => "meta", label => $i18n->get("Metadata") );
1110+
$self->addEditSaveTabs($f);
10931111

10941112
###
10951113
# Asset ID and class name

‎lib/WebGUI/Role/Asset/RssFeed.pm

+17-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,23 @@ These methods are available from this class:
121121
122122
=cut
123123

124-
#-------------------------------------------------------------------
124+
#----------------------------------------------------------------------------
125+
126+
=head2 addEditSaveTabs ( form )
127+
128+
Add the tab for the RSS feed configuration data.
129+
130+
=cut
131+
132+
override addEditSaveTabs => sub {
133+
my ( $self, $form ) = @_;
134+
$form = super();
135+
my $i18n = WebGUI::International->new($self->session, 'Role_RssFeed');
136+
$form->addTab( name => "rss", label => $i18n->get("RSS tab") );
137+
return $form;
138+
};
139+
140+
#-------------------------------------------------------------------
125141

126142
=head2 dispatch ( )
127143

0 commit comments

Comments
 (0)
Please sign in to comment.