Changed default behavior to return nothing instead of the macro tag when no
matching collateral is found.
This commit is contained in:
parent
e8c305d919
commit
47015a8b26
6 changed files with 37 additions and 16 deletions
|
|
@ -18,12 +18,15 @@ use WebGUI::Session;
|
|||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
my $collateral = WebGUI::Collateral->find($param[0]);
|
||||
my $output = '<a href="'.$collateral->getURL.'"';
|
||||
$output .= ' target="_blank"' if ($param[1]);
|
||||
$output .= '><img src="'.$collateral->getThumbnail.
|
||||
'" border="0"></a><br><b>'.$param[0].'</b><p>';
|
||||
return $output;
|
||||
if (my $collateral = WebGUI::Collateral->find($param[0])) {
|
||||
my $output = '<a href="'.$collateral->getURL.'"';
|
||||
$output .= ' target="_blank"' if ($param[1]);
|
||||
$output .= '><img src="' . $collateral->getThumbnail;
|
||||
$output .= '" border="0"></a><br><b>'.$param[0].'</b><p>';
|
||||
return $output;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue