Optional second parameter can be a boolean value to turn off file icons.
This commit is contained in:
parent
7c853a309f
commit
1408a69813
1 changed files with 13 additions and 4 deletions
|
|
@ -19,10 +19,19 @@ use WebGUI::Session;
|
||||||
sub process {
|
sub process {
|
||||||
my @param = WebGUI::Macro::getParams($_[0]);
|
my @param = WebGUI::Macro::getParams($_[0]);
|
||||||
if (my $collateral = WebGUI::Collateral->find($param[0])) {
|
if (my $collateral = WebGUI::Collateral->find($param[0])) {
|
||||||
return '<a href="' . $collateral->getURL .
|
|
||||||
'"><img src="' . $collateral->getIcon .
|
# include default icon unless a second param
|
||||||
'" align="middle" border="0" /> ' .
|
if ( ! $param[1] ) {
|
||||||
$collateral->get("name") . '</a>';
|
return '<a href="' . $collateral->getURL .
|
||||||
|
'"><img src="' . $collateral->getIcon .
|
||||||
|
'" align="middle" border="0" /> ' .
|
||||||
|
$collateral->get("name") . '</a>';
|
||||||
|
|
||||||
|
# second param was flag, so no accompanying image
|
||||||
|
} else {
|
||||||
|
return '<a href="' . $collateral->getURL .
|
||||||
|
'">' . $collateral->get("name") . '</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue