diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index 177feff19..279d92c10 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -343,7 +343,7 @@ are authorized to see them. =cut -sub getCurrentRevisionDate { +override getCurrentRevisionDate => sub { my $class = shift; my $session = shift; my $assetId = shift; @@ -366,9 +366,9 @@ sub getCurrentRevisionDate { return $revisionDate; } else { - return $class->SUPER::getCurrentRevisionDate( $session, $assetId ); + return super(); } -} +}; #---------------------------------------------------------------------------- @@ -395,9 +395,9 @@ Get the parent GalleryAlbum. If the only revision of the GalleryAlbum is =cut -sub getParent { +override getParent => sub { my $self = shift; - if ( my $album = $self->SUPER::getParent ) { + if ( my $album = super() ) { return $album; } # Only get the pending version if we're allowed to see this photo in its pending status @@ -411,7 +411,7 @@ sub getParent { } )->[ 0 ]; return $album; } -} +}; #---------------------------------------------------------------------------- @@ -615,11 +615,11 @@ sub processCommentEditForm { =cut -sub processPropertiesFromFormPost { +override processPropertiesFromFormPost => sub { my $self = shift; my $i18n = WebGUI::International->new( $self->session,'Asset_Photo' ); my $form = $self->session->form; - my $errors = $self->SUPER::processPropertiesFromFormPost || []; + my $errors = super() || []; # Make sure we have the disk space for this if ( !$self->getGallery->hasSpaceAvailable( $self->assetSize ) ) { @@ -639,7 +639,7 @@ sub processPropertiesFromFormPost { } return; -} +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index 10e5b5f53..6330bbae5 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -85,7 +85,7 @@ C is a hash reference of options and is currently not used. =cut -sub applyConstraints { +override applyConstraints => sub { my $self = shift; my $options = shift; my $gallery = $self->getGallery; @@ -108,8 +108,8 @@ sub applyConstraints { $self->generateThumbnail; $self->setSize; $self->updateExifDataFromFile; - $self->SUPER::applyConstraints( $options ); -} + super(); +}; #------------------------------------------------------------------- @@ -247,10 +247,10 @@ Get a hash reference of template variables shared by all views of this asset. =cut -sub getTemplateVars { +override getTemplateVars => sub { my $self = shift; my $session = $self->session; - my $var = $self->SUPER::getTemplateVars; + my $var = super(); ### Download resolutions for my $resolution ( @{ $self->getResolutions } ) { @@ -275,7 +275,7 @@ sub getTemplateVars { } return $var; -} +}; #---------------------------------------------------------------------------- @@ -338,10 +338,10 @@ Make the default title into the file name minus the extention. =cut -sub processPropertiesFromFormPost { +override processPropertiesFromFormPost => sub { my $self = shift; my $form = $self->session->form; - my $errors = $self->SUPER::processPropertiesFromFormPost || []; + my $errors = super() || []; # Return if errors return $errors if @$errors; @@ -366,7 +366,7 @@ sub processPropertiesFromFormPost { } return undef; -} +}; #---------------------------------------------------------------------------- @@ -376,11 +376,11 @@ Extend the superclass setFile to automatically generate thumbnails. =cut -sub setFile { +override setFile => sub { my $self = shift; - $self->SUPER::setFile(@_); + super(); $self->generateThumbnail; -} +}; #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index ce50ac00c..3c89df355 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -89,10 +89,10 @@ An integer (in pixels) representing the longest edge a thumbnail may have. =cut -sub applyConstraints { +override applyConstraints => sub { my $self = shift; my $options = shift; - $self->SUPER::applyConstraints($options); + super(); my $maxImageSize = $options->{maxImageSize} || $self->maxImageSize || $self->session->setting->get("maxImageSize"); my $thumbnailSize = $options->{thumbnailSize} || $self->thumbnailSize || $self->session->setting->get("thumbnailSize"); my $parameters = $self->parameters; @@ -104,7 +104,7 @@ sub applyConstraints { $storage->adjustMaxImageSize($file, $maxImageSize); $self->generateThumbnail($thumbnailSize); $self->setSize; -} +}; @@ -138,9 +138,9 @@ Returns the TabForm object that will be used in generating the edit page for thi =cut -sub getEditForm { +override getEditForm => sub { my $self = shift; - my $tabform = $self->SUPER::getEditForm(); + my $tabform = super(); my $i18n = WebGUI::International->new($self->session,"Asset_Image"); $tabform->getTab("properties")->integer( -name=>"thumbnailSize", @@ -167,7 +167,7 @@ sub getEditForm { ); } return $tabform; -} +}; #------------------------------------------------------------------- @@ -190,11 +190,11 @@ Returns a toolbar with a set of icons that hyperlink to functions that delete, e =cut -sub getToolbar { +override getToolbar => sub { my $self = shift; return undef if ($self->getToolbarState); - return $self->SUPER::getToolbar(); -} + return super(); +}; #------------------------------------------------------------------- @@ -246,11 +246,11 @@ Extend the superclass setFile to automatically generate thumbnails. =cut -sub setFile { +override setFile => sub { my $self = shift; - $self->SUPER::setFile(@_); + super(); $self->generateThumbnail; -} +}; #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File/ZipArchive.pm b/lib/WebGUI/Asset/File/ZipArchive.pm index 4b52c5579..08f6f79c1 100644 --- a/lib/WebGUI/Asset/File/ZipArchive.pm +++ b/lib/WebGUI/Asset/File/ZipArchive.pm @@ -142,10 +142,10 @@ this method to deflate the zip file into the proper folder =cut -sub processPropertiesFromFormPost { +override processPropertiesFromFormPost => sub { my $self = shift; #File should be saved here by the superclass - $self->SUPER::processPropertiesFromFormPost; + super(); my $storage = $self->getStorageLocation(); my $file = $self->filename; @@ -169,7 +169,7 @@ sub processPropertiesFromFormPost { unless ($self->unzip($storage,$self->filename)) { $self->session->errorHandler->warn($i18n->get("unzip_error")); } -} +}; #-------------------------------------------------------------------