Added new collateral management system.
This commit is contained in:
parent
0903f05a8f
commit
82b6bd33f8
13 changed files with 654 additions and 437 deletions
|
|
@ -75,6 +75,7 @@ sub _replacement {
|
|||
'http://validator.w3.org/check?uri=http%3A%2F%2F'.$session{env}{SERVER_NAME}.
|
||||
WebGUI::URL::page()=>WebGUI::International::get(399),
|
||||
WebGUI::URL::page('op=viewPageTree')=>WebGUI::International::get(447),
|
||||
WebGUI::URL::page('op=listCollateral')=>WebGUI::International::get(394),
|
||||
%hash
|
||||
);
|
||||
}
|
||||
|
|
@ -96,12 +97,6 @@ sub _replacement {
|
|||
%hash
|
||||
);
|
||||
}
|
||||
if (WebGUI::Privilege::isInGroup($session{setting}{imageManagersGroup},$session{user}{userId})) {
|
||||
%hash = (
|
||||
WebGUI::URL::page('op=listImages')=>WebGUI::International::get(394),
|
||||
%hash
|
||||
);
|
||||
}
|
||||
%hash = (
|
||||
WebGUI::URL::page('op=viewHelpIndex')=>WebGUI::International::get(13),
|
||||
%hash
|
||||
|
|
|
|||
41
lib/WebGUI/Macro/File.pm
Normal file
41
lib/WebGUI/Macro/File.pm
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package WebGUI::Macro::File;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Attachment;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp, %data, $file);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select collateralId,filename,name from collateral where name=".quote($param[0]));
|
||||
$file = WebGUI::Attachment->new($data{filename},"images",$data{collateralId});
|
||||
$temp = '<a href="'.$file->getURL.'"><img src="'.$file->getIcon.'" align="middle" border="0" /> '.$data{name}.'</a>';
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^File\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -22,9 +22,9 @@ sub _replacement {
|
|||
my (@param, $temp, %data, $image);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select * from images where name=".quote($param[0]));
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
|
||||
$temp = '<img src="'.$image->getURL.'" '.$data{parameters}.'>';
|
||||
%data = WebGUI::SQL->quickHash("select filename,parameters,collateralId from collateral where name=".quote($param[0]));
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{collateralId});
|
||||
$temp = '<img src="'.$image->getURL.'" '.$data{parameters}.' />';
|
||||
return $temp;
|
||||
}
|
||||
|
||||
|
|
|
|||
37
lib/WebGUI/Macro/Snippet.pm
Normal file
37
lib/WebGUI/Macro/Snippet.pm
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
package WebGUI::Macro::Snippet;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
($temp) = WebGUI::SQL->quickArray("select parameters from collateral where name=".quote($param[0]));
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^Snippet\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -22,8 +22,8 @@ sub _replacement {
|
|||
my (@param, %data, $image);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
|
||||
%data = WebGUI::SQL->quickHash("select filename,collateralId from collateral where name='$param[0]'");
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{collateralId});
|
||||
return $image->getThumbnail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ sub _replacement {
|
|||
my (@param, $image, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select * from images where name=".quote($param[0]));
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
|
||||
%data = WebGUI::SQL->quickHash("select collateralId,filename from collateral where name=".quote($param[0]));
|
||||
$image = WebGUI::Attachment->new($data{filename},"images",$data{collateralId});
|
||||
return $image->getURL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue