diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index a3595b696..f10c4f06d 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -50,7 +50,7 @@ sub definition { my $class = shift; my $session = shift; my $definition = shift; - my $i18n = __PACKAGE__->i18n($session); + my $i18n = WebGUI::International->new($session,'Asset_Photo'); tie my %properties, 'Tie::IxHash', ( views => { @@ -508,23 +508,6 @@ sub getTemplateVars { } -#---------------------------------------------------------------------------- - -=head2 i18n ( session ) - -Get the i18n object for this class. This sub must not be inherited, so always -call it using C<__PACKAGE__>, not C<$self>. - -=cut - -sub i18n { - my $self = shift; - my $session = shift; - # TODO: Make a migration script to move the appropriate parts from - # Asset_Photo to Asset_GalleryFile - return WebGUI::International->new( $session, "Asset_Photo" ); -} - #---------------------------------------------------------------------------- =head2 isFriendsOnly ( ) @@ -610,7 +593,7 @@ sub processCommentEditForm { my $session = $self->session; my $form = $self->session->form; my $now = WebGUI::DateTime->new( $session, time ); - my $i18n = __PACKAGE__->i18n( $session ); + my $i18n = WebGUI::International->new( $session,'Asset_Photo' ); # Using die here to suppress line number and file path info die $i18n->get("commentForm error no commentId") . "\n" @@ -649,7 +632,7 @@ sub processCommentEditForm { sub processPropertiesFromFormPost { my $self = shift; - my $i18n = __PACKAGE__->i18n( $self->session ); + my $i18n = WebGUI::International->new( $self->session,'Asset_Photo' ); my $form = $self->session->form; my $errors = $self->SUPER::processPropertiesFromFormPost || []; @@ -871,7 +854,7 @@ sub www_deleteComment { return $session->privilege->insufficient unless $self->canEdit; - my $i18n = __PACKAGE__->i18n( $session ); + my $i18n = WebGUI::International->new( $session,'Asset_Photo' ); my $commentId = $session->form->get('commentId'); $self->deleteComment( $commentId ); @@ -893,7 +876,7 @@ sub www_deleteConfirm { return $self->session->privilege->insufficient unless $self->canEdit; - my $i18n = __PACKAGE__->i18n( $self->session ); + my $i18n = WebGUI::International->new( $self->session,'Asset_Photo' ); $self->purge; @@ -965,7 +948,7 @@ Save a comment being edited sub www_editCommentSave { my $self = shift; my $session = $self->session; - my $i18n = __PACKAGE__->i18n( $session ); + my $i18n = WebGUI::International->new( $session,'Asset_Photo' ); # Process the form first, so we can know how to check permissions my $comment = eval { $self->processCommentEditForm }; diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index 0bcdfb544..d21c501ce 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -70,7 +70,7 @@ sub definition { my $class = shift; my $session = shift; my $definition = shift; - my $i18n = __PACKAGE__->i18n($session); + my $i18n = WebGUI::International->new($session, 'Asset_Photo'); tie my %properties, 'Tie::IxHash', ( exifData => { @@ -317,27 +317,6 @@ sub getThumbnailUrl { #---------------------------------------------------------------------------- -=head2 i18n ( [ session ] ) - -Get a WebGUI::International object for this class. - -Can be called as a class method, in which case a WebGUI::Session object -must be passed in. - -NOTE: This method can NOT be inherited, due to a current limitation -in the i18n system. You must ALWAYS call this with C<__PACKAGE__> - -=cut - -sub i18n { - my $self = shift; - my $session = shift; - - return WebGUI::International->new($session, "Asset_Photo"); -} - -#---------------------------------------------------------------------------- - =head2 makeResolutions ( [resolutions] ) Create the specified resolutions for this Photo. If resolutions is not @@ -617,7 +596,7 @@ Provides links to view the photo and add more photos. sub www_showConfirmation { my $self = shift; - my $i18n = __PACKAGE__->i18n( $self->session ); + my $i18n = WebGUI::International->new( $self->session, 'Asset_Photo' ); return $self->processStyle( sprintf( $i18n->get('save message'), diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index ec417a85c..e3fc6bef8 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -44,7 +44,7 @@ sub definition { my $class = shift; my $session = shift; my $definition = shift; - my $i18n = __PACKAGE__->i18n($session); + my $i18n = WebGUI::International->new($session, 'Asset_GalleryAlbum'); tie my %properties, 'Tie::IxHash', ( allowComments => { @@ -352,27 +352,6 @@ sub DESTROY { #---------------------------------------------------------------------------- -=head2 i18n ( session ) - -Get a WebGUI::International object for this class. - -Can be called as a class method, in which case a WebGUI::Session object -must be passed in. - -NOTE: This method can NOT be inherited, due to a current limitation -in the i18n system. You must ALWAYS call this with C<__PACKAGE__> - -=cut - -sub i18n { - my $self = shift; - my $session = shift; - - return WebGUI::International->new($session, "Asset_GalleryAlbum"); -} - -#---------------------------------------------------------------------------- - =head2 getAutoCommitWorkflowId ( ) Returns the workflowId of the Gallery's approval workflow. @@ -937,7 +916,7 @@ sub www_addArchiveSave { my $session = $self->session; my $form = $self->session->form; - my $i18n = __PACKAGE__->i18n( $session ); + my $i18n = WebGUI::International->new( $session, 'Asset_GalleryAlbum' ); my $properties = { keywords => $form->get("keywords"), friendsOnly => $form->get("friendsOnly"), @@ -1093,7 +1072,7 @@ sub www_deleteConfirm { return $self->session->privilege->insufficient unless $self->canEdit; my $gallery = $self->getParent; - my $i18n = __PACKAGE__->i18n( $self->session ); + my $i18n = WebGUI::International->new( $self->session, 'Asset_GalleryAlbum' ); $self->purge; @@ -1119,7 +1098,7 @@ sub www_edit { my $session = $self->session; my $form = $self->session->form; my $var = $self->getTemplateVars; - my $i18n = __PACKAGE__->i18n($session); + my $i18n = WebGUI::International->new($session, 'Asset_GalleryAlbum'); return $session->privilege->insufficient unless $self->canEdit; @@ -1299,7 +1278,7 @@ Provides links to view the album. sub www_showConfirmation { my $self = shift; - my $i18n = __PACKAGE__->i18n( $self->session ); + my $i18n = WebGUI::International->new( $self->session, 'Asset_GalleryAlbum' ); my $output = '
' . sprintf( $i18n->get('save message'), $self->getUrl ) . '
' . '' . $i18n->get('what next') . '
'