lots of changes

This commit is contained in:
Frank Dillon 2008-11-12 23:03:42 +00:00
parent 93df39d6f6
commit 615e0e3746
28 changed files with 2883 additions and 212 deletions

View file

@ -174,6 +174,11 @@ deleting the file if it was specified.
sub getValue {
my $self = shift;
my $value = $self->get("value");
my $log = $self->session->log;
$log->warn("file is: ".$self->session->form->get($self->get("name")."_file"));
$log->warn("value is: ".$value);
$log->warn("action is: ".$self->session->form->param($self->privateName('action')));
my $storage = WebGUI::Storage->get($self->session,$value);
if (defined $storage) {
foreach my $file (@{$storage->getFiles}) {
@ -195,6 +200,8 @@ sub getValue {
}
$storage->addFileFromFormPost($self->get("name")."_file",1000);
my @files = @{ $storage->getFiles };
$log->warn("storageId: ".$storage->getId);
$log->warn("number of files: ".scalar(@files));
if (scalar(@files) < 1) {
$storage->delete;
return undef;
@ -205,6 +212,7 @@ sub getValue {
return $id;
}
}
$log->warn("returning: ".$value);
return $value;
}

View file

@ -181,11 +181,12 @@ Displays the image using an img tag.
=cut
sub getValueAsHtml {
my ($self) = @_;
my $value = $self->getOriginalValue;
my ($self) = @_;
my $value = $self->getOriginalValue;
return '' unless $value;
my $location = WebGUI::Storage::Image->get($self->session, $value);
my $file = shift @{ $location->getFiles };
return '' unless $file;
my $fileValue = sprintf qq|<img src="%s" />&nbsp;%s|, $location->getUrl($file), $file;
return $fileValue;
}