more bug fixes
This commit is contained in:
parent
1dc555e078
commit
7e0a5b13b9
8 changed files with 37 additions and 14 deletions
|
|
@ -1534,7 +1534,7 @@ sub hasChildren {
|
|||
} elsif (exists $self->{_lastChild}) {
|
||||
$self->{_hasChildren} = 1;
|
||||
} else {
|
||||
my ($hasChildren) = WebGUI::SQL->read("select count(*) from asset where parentId=".quote($self->getId));
|
||||
my ($hasChildren) = WebGUI::SQL->quickArray("select count(*) from asset where parentId=".quote($self->getId));
|
||||
$self->{_hasChildren} = $hasChildren;
|
||||
}
|
||||
}
|
||||
|
|
@ -1832,6 +1832,7 @@ sub processTemplate {
|
|||
if (defined $template) {
|
||||
return $template->process(\%vars);
|
||||
} else {
|
||||
WebGUI::ErrorHandler::warn("Can't instanciate template $templateId for asset ".$self->getId);
|
||||
return "Error: Can't instanciate template ".$templateId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,10 @@ sub duplicate {
|
|||
sub getBox {
|
||||
my $self = shift;
|
||||
my %var;
|
||||
$var{"attachment.icon"} = $self->getFileIcon;
|
||||
$var{"attachment.icon"} = $self->getFileIconUrl;
|
||||
$var{"attachment.url"} = $self->getFileUrl;
|
||||
$var{"attachment.name"} = $self->get("filename");
|
||||
$var{"attachment.size"} = $self->getStorageLocation->getSize;
|
||||
$var{"attachment.size"} = $self->getStorageLocation->getFileSize;
|
||||
$var{"attachment.type"} = $self->getStorageLocation->getFileExtension;
|
||||
return $self->processTemplate(\%var,"PBtmpl0000000000000003");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ sub definition {
|
|||
|
||||
sub DESTROY {
|
||||
my $self = shift;
|
||||
return unless defined $self;
|
||||
$self->{_next}->DESTROY if (exists $self->{_next});
|
||||
$self->{_previous}->DESTROY if (exists $self->{_previous});
|
||||
$self->SUPER::DESTROY;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ sub view {
|
|||
foreach my $child (@{$children}) {
|
||||
if (ref $child eq "WebGUI::Asset::File") {
|
||||
$var{"attachment.box"} = $child->getBox;
|
||||
$var{"attachment.icon"} = $child->getFileIcon;
|
||||
$var{"attachment.icon"} = $child->getFileIconUrl;
|
||||
$var{"attachment.url"} = $child->getFileUrl;
|
||||
$var{"attachment.name"} = $child->get("filename");
|
||||
} elsif (ref $child eq "WebGUI::Asset::File::Image") {
|
||||
|
|
|
|||
|
|
@ -341,11 +341,11 @@ sub view {
|
|||
# these next two variables can be very inefficient, consider getting rid of them
|
||||
my $parentsFirstChild = $parent->getFirstChild;
|
||||
if (defined $parentsFirstChild) {
|
||||
$pageData->{"page.isRankedFirst"} = ($asset->getId == $parentsFirstChild->getId);
|
||||
$pageData->{"page.isRankedFirst"} = ($asset->getId eq $parentsFirstChild->getId);
|
||||
}
|
||||
my $parentsLastChild = $parent->getLastChild;
|
||||
if (defined $parentsLastChild) {
|
||||
$pageData->{"page.isRankedLast"} = ($asset->getId == $parentsLastChild->getId);
|
||||
$pageData->{"page.isRankedLast"} = ($asset->getId eq $parentsLastChild->getId);
|
||||
}
|
||||
}
|
||||
push(@{$var->{page_loop}}, $pageData);
|
||||
|
|
|
|||
|
|
@ -106,6 +106,25 @@ sub generateThumbnail {
|
|||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getFiles ( )
|
||||
|
||||
Returns an array reference of the files in this storage location.
|
||||
|
||||
=cut
|
||||
|
||||
sub getFiles {
|
||||
my $self = shift;
|
||||
my $files = $self->SUPER::getFiles;
|
||||
my @newFiles;
|
||||
foreach my $file (@{$files}) {
|
||||
next if $file =~ /^thumb-/;
|
||||
push (@newFiles,$file);
|
||||
}
|
||||
return \@newFiles;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getThumbnailUrl ( filename )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue