Added the RootTab, RandomSnippet, RandomImage, CanEditText, If, Spacer, SpecificDropMenu, TopDropMenu, LastModified, PreviousDropMenu, and SI (scaled image) macros.

This commit is contained in:
JT Smith 2003-04-25 03:38:30 +00:00
parent ff6a6e45ea
commit 6d234e929d
15 changed files with 564 additions and 6 deletions

View file

@ -20,8 +20,15 @@ use WebGUI::SQL;
#-------------------------------------------------------------------
sub process {
my @param = WebGUI::Macro::getParams($_[0]);
my ($collateralFolderId) = WebGUI::SQL->quickArray("select collateralFolderId from collateralFolder where name=".quote($param[0]));
my @images = WebGUI::SQL->buildArray("select collateralId from collateral where collateralType='image' and collateralFolderId=".$collateralFolderId);
my $collateralFolderId;
if ($param[0] ne "") {
($collateralFolderId) = WebGUI::SQL->quickArray("select collateralFolderId from collateralFolder
where name=".quote($param[0]));
} else {
$collateralFolderId = 0; #Root
}
my @images = WebGUI::SQL->buildArray("select collateralId from collateral
where collateralType='image' and collateralFolderId=".$collateralFolderId);
my $collateral = WebGUI::Collateral->new($images[rand($#images+1)]);
return '<img src="'.$collateral->getURL.'" '.$collateral->get("parameters").' />';
}