diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 16ed80bcc..22ea16cf3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -99,6 +99,7 @@ - fixed: Gallery Search now correctly limits by class name - added: A template variable to distinguish between Files and Albums in the Gallery Search + - added: A thumbnail for Photo edit screen 7.5.10 - fix: Syntax error in GetCsMail diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index c158dc2f4..acc6822e7 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -164,6 +164,40 @@ sub getDownloadFileUrl { return $self->getStorageLocation->getUrl( $resolution . ".jpg" ); } +#---------------------------------------------------------------------------- + +=head2 getEditFormUploadControl + +Returns the HTML to render the upload box and link to delete the existing +file, if necessary. + +=cut + +sub getEditFormUploadControl { + my $self = shift; + my $session = $self->session; + my $i18n = WebGUI::International->new($session, 'Asset_File'); + my $html = ''; + + if ($self->get("filename") ne "") { + $html .= WebGUI::Form::readOnly( $session, { + label => $i18n->get('current file'), + hoverHelp => $i18n->get('current file description'), + value => '

'.$self->get( '.$self->get("filename").'

' + }); + } + + # Control to upload a new file + $html .= WebGUI::Form::file( $session, { + name => 'newFile', + label => $i18n->get('new file'), + hoverHelp => $i18n->get('new file description'), + }); + + return $html; +} + + #---------------------------------------------------------------------------- =head2 getExifData ( )