Merge branch 'WebGUI8' into psgi
Conflicts: sbin/testEnvironment.pl
This commit is contained in:
commit
f16ba76b86
109 changed files with 1546 additions and 2197 deletions
|
|
@ -48,11 +48,11 @@ sub process {
|
|||
if (Exception::Class->caught()) {
|
||||
return $i18n->get('invalid url');
|
||||
}
|
||||
my $storageId = $asset->storageId;
|
||||
my $storageId = $asset->can('storageId') ? $asset->storageId : undef;
|
||||
if (not defined $storageId) {
|
||||
return $i18n->get('no storage');
|
||||
}
|
||||
my $filename = $asset->filename;
|
||||
my $filename = $asset->can('filename') ? $asset->filename : undef;
|
||||
if (not defined $filename) {
|
||||
return $i18n->get('no filename');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,10 @@ This macro takes a templateId to show the links
|
|||
sub process {
|
||||
my $session = shift;
|
||||
my $templateId = shift || "_aE16Rr1-bXBf8SIaLZjCg";
|
||||
my $template = WebGUI::Asset::Template->new($session, $templateId);
|
||||
my $template = eval { WebGUI::Asset::Template->newById($session, $templateId); };
|
||||
if (Exception::Class->caught()) {
|
||||
return "Could not instanciate template with id [$templateId]" unless $template;
|
||||
}
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
my $languages = $i18n->getLanguages();
|
||||
my @lang_loop = ();
|
||||
|
|
|
|||
|
|
@ -32,13 +32,15 @@ Image Asset can be found with that URL, then undef will be returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $url = shift;
|
||||
if (my $image = WebGUI::Asset::File::Image->newByUrl($session,$url)) {
|
||||
return $image->getThumbnailUrl;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
my $session = shift;
|
||||
my $url = shift;
|
||||
my $image = eval { WebGUI::Asset::File::Image->newByUrl($session,$url) };
|
||||
if (Exception::Class->caught()) {
|
||||
return undef;
|
||||
}
|
||||
else {
|
||||
return $image->getThumbnailUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue