From ce156905236bc893761a77a4f02991b80873bff0 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 23 Nov 2011 17:21:58 -0800 Subject: [PATCH] I18n the RSS tab for the RSS Feed role. Provide a way for additional tabs to be i18n'ed, like Subscribable. --- lib/WebGUI/Asset.pm | 28 +++++++++++++++++++++++----- lib/WebGUI/Role/Asset/RssFeed.pm | 18 +++++++++++++++++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 51f58aa4d..1649f046a 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -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 ) @@ -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 diff --git a/lib/WebGUI/Role/Asset/RssFeed.pm b/lib/WebGUI/Role/Asset/RssFeed.pm index 54395003f..b9ceed796 100644 --- a/lib/WebGUI/Role/Asset/RssFeed.pm +++ b/lib/WebGUI/Role/Asset/RssFeed.pm @@ -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 ( )