more asset stuff

This commit is contained in:
JT Smith 2004-12-23 04:28:54 +00:00
parent 4149d8eb5c
commit 30234369ab
5 changed files with 31 additions and 7 deletions

View file

@ -159,6 +159,19 @@ sub purge {
sub view {
my $self = shift;
my $storage = WebGUI::Storage->get($self->get("storageId"));
use WebGUI::Utility;
if (isIn($storage->getFileExtension($self->get("filename")),qw("jpg","png","gif"))) {
return '<a href="'.$storage->getUrl($self->get("filename")).'"><img src="'.$storage->getUrl($self->get("filename")).'" alt="test" border="0" /></a>';
} else {
return '<a href="'.$storage->getUrl($self->get("filename")).'"><img src="'.$storage->getFileIconUrl($self->get("filename")).'" alt="test" border="0" />'.$self->get("filename").'</a>';
}
}
sub view2 {
my $self = shift;
if ($session{var}{adminOn}) {
return $self->www_edit;

View file

@ -137,7 +137,6 @@ sub view {
["descendants"],
{
returnObjects=>1,
excludeClasses=>["WebGUI::Asset::Wobject::Layout"],
endingLineageLength=>$self->getLineageLength+1
}
);
@ -163,11 +162,19 @@ sub view {
}
# deal with unplaced children
foreach my $child (@{$children}) {
unless (isIn($child->getId, @found)) {
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>$child->view
if (ref $child eq "WebGUI::Asset::Wobject::Layout") {
push(@{$vars{"sublayout_loop"}}, {
id => $child->getId,
url => $child->getUrl,
title => $child->get("title")
});
} else {
unless (isIn($child->getId, @found)) {
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>$child->view
});
}
}
}
$vars{showAdmin} = ($session{var}{adminOn} && $self->canEdit);

View file

@ -77,7 +77,10 @@ sub process {
});
$i++;
}
$var{'contenttypes_loop'} = \@addcontent;
# $var{'contenttypes_loop'} = \@addcontent;
foreach my $link (@{$session{asset}->getAssetAdderLinks}) {
push(@{$var{'contenttypes_loop'}},{'contenttype.url'=>$link->{url},'contenttype.label'=>$link->{label}});
}
$var{'addpage.url'} = WebGUI::URL::page('op=editPage&npp='.$session{page}{pageId});
$var{'addpage.label'} = WebGUI::International::get(2);
#--clipboard paster