Changed default behavior to return nothing instead of the macro tag when no

matching collateral is found.
This commit is contained in:
Alan Ritari 2003-12-29 20:35:52 +00:00
parent e8c305d919
commit 47015a8b26
6 changed files with 37 additions and 16 deletions

View file

@ -18,8 +18,14 @@ use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my @param = WebGUI::Macro::getParams($_[0]);
my $collateral = WebGUI::Collateral->find($param[0]);
return '<a href="'.$collateral->getURL.'"><img src="'.$collateral->getIcon.'" align="middle" border="0" /> '.$collateral->get("name").'</a>';
if (my $collateral = WebGUI::Collateral->find($param[0])) {
return '<a href="' . $collateral->getURL .
'"><img src="' . $collateral->getIcon .
'" align="middle" border="0" /> ' .
$collateral->get("name") . '</a>';
} else {
return undef;
}
}
1;