52 lines
1.7 KiB
Perl
52 lines
1.7 KiB
Perl
package WebGUI::Macro::r_printable;
|
|
|
|
#-------------------------------------------------------------------
|
|
# WebGUI is Copyright 2001-2005 Plain Black Corporation.
|
|
#-------------------------------------------------------------------
|
|
# 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 WebGUI::International;
|
|
use WebGUI::Macro;
|
|
use WebGUI::Session;
|
|
use WebGUI::Asset::Template;
|
|
use WebGUI::URL;
|
|
use WebGUI::Utility;
|
|
|
|
#-------------------------------------------------------------------
|
|
sub process {
|
|
my ($temp, @param, $styleId);
|
|
@param = WebGUI::Macro::getParams($_[0]);
|
|
my $append = 'op=makePrintable';
|
|
if ($session{env}{REQUEST_URI} =~ /op\=/) {
|
|
$append = 'op2='.WebGUI::URL::escape($append);
|
|
}
|
|
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append);
|
|
if ($param[1] ne "") {
|
|
$temp = WebGUI::URL::append($temp,'styleId='.$param[1]);
|
|
}
|
|
if ($param[0] ne "linkonly") {
|
|
my %var;
|
|
$var{'printable.url'} = $temp;
|
|
if ($param[0] ne "") {
|
|
$var{'printable.text'} = $param[0];
|
|
} else {
|
|
$var{'printable.text'} = WebGUI::International::get(53);
|
|
}
|
|
if ($param[2]) {
|
|
$temp = WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
|
} else {
|
|
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000109")->process(\%var);
|
|
}
|
|
}
|
|
return $temp;
|
|
}
|
|
|
|
|
|
1;
|
|
|