Added configurable style support in the ^r; macro.

This commit is contained in:
JT Smith 2002-05-22 05:01:45 +00:00
parent a9b81dc63f
commit 56d30226c4
2 changed files with 11 additions and 3 deletions

View file

@ -14,14 +14,21 @@ use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub _replacement {
my ($temp, @param);
my ($temp, @param, $styleId);
@param = WebGUI::Macro::getParams($_[0]);
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},'makePrintable=1');
if ($param[1] ne "") {
($styleId) = WebGUI::SQL->quickArray("select styleId from style where name=".quote($param[1]));
if ($styleId != 0) {
$temp = WebGUI::URL::append($temp,'style='.$styleId);
}
}
if ($param[0] ne "linkonly") {
$temp = '<a class="makePrintableLink" href="'.$temp.'">';
if ($param[0] ne "") {

View file

@ -18,10 +18,11 @@ use WebGUI::SQL;
#-------------------------------------------------------------------
sub getStyle {
my ($header, $footer, @style, %style);
my ($header, $footer, @style, %style, $styleId);
tie %style, 'Tie::CPHash';
if ($session{form}{makePrintable}) {
%style = WebGUI::SQL->quickHash("select header,footer,styleSheet from style where styleId=3");
$styleId = $session{form}{style} || 3;
%style = WebGUI::SQL->quickHash("select header,footer,styleSheet from style where styleId=$styleId");
$header = '<html><!-- WebGUI '.$session{wg}{version}.' -->'."\n";
$header .= '<head><title>'.$session{page}{title}.' - '.$session{setting}{companyName}.'</title>';
$header .= $style{styleSheet}.'</head>'.$style{header};