fixed some bugs in URL/Content handlers. fixed some bugs in Gallery.
This commit is contained in:
parent
4c70aa4c71
commit
30f22c9b7a
10 changed files with 96 additions and 67 deletions
|
|
@ -564,14 +564,18 @@ sub view_thumbnails {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_addArchive ( )
|
||||
=head2 www_addArchive ( params )
|
||||
|
||||
Show the form to add an archive of files to this gallery.
|
||||
Show the form to add an archive of files to this gallery. C<params> is a hash
|
||||
reference of parameters with the following keys:
|
||||
|
||||
error => An error message to show to the user.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_addArchive {
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canAddFile;
|
||||
|
||||
|
|
@ -579,6 +583,8 @@ sub www_addArchive {
|
|||
my $form = $self->session->form;
|
||||
my $var = $self->getTemplateVars;
|
||||
|
||||
$var->{ error } = $params->{ error };
|
||||
|
||||
$var->{ form_start }
|
||||
= WebGUI::Form::formHeader( $session, {
|
||||
action => $self->getUrl('func=addArchiveSave'),
|
||||
|
|
@ -639,6 +645,11 @@ sub www_addArchiveSave {
|
|||
|
||||
my $storageId = $form->get("archive", "File");
|
||||
my $storage = WebGUI::Storage->get( $session, $storageId );
|
||||
if (!$storage) {
|
||||
return $self->www_addArchive({
|
||||
error => sprintf $i18n->get('addArchive error too big'),
|
||||
});
|
||||
}
|
||||
my $filename = $storage->getPath( $storage->getFiles->[0] );
|
||||
|
||||
$self->addArchive( $filename, $properties );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue