various patches added

This commit is contained in:
JT Smith 2004-07-12 04:45:38 +00:00
parent 2e791c9dd5
commit c0bf7e46f0
16 changed files with 136 additions and 108 deletions

View file

@ -66,8 +66,8 @@
the master database. This will have no effect on single database users, but the master database. This will have no effect on single database users, but
can add a tremendous amount of scalability on large WebGUI sites that use can add a tremendous amount of scalability on large WebGUI sites that use
database replication. database replication.
- Templated the EditableToggle, a, and AdminToggle macros. Thanks to Colin - Templated the EditableToggle, a, GroupAdd, GroupDelete, H, LoginToggle, r,
Kuskie. and AdminToggle macros. Thanks to Colin Kuskie.
- bugfix [ 933881 ] Forms not compliant (solution). Thanks to Nicklous - bugfix [ 933881 ] Forms not compliant (solution). Thanks to Nicklous
Roberts. Roberts.
- bugfix [ 934410 ] non-compliant HTML (solution). Thanks to Nicklous - bugfix [ 934410 ] non-compliant HTML (solution). Thanks to Nicklous
@ -82,7 +82,7 @@
scalability a lot. Thanks to Martin Kamerbeek / Procolix scalability a lot. Thanks to Martin Kamerbeek / Procolix
- bugfix [ 977201 ] ws client bug - bugfix [ 977201 ] ws client bug
- bugfix [ 969740 ] Messageboard: Deleting of postings - bugfix [ 969740 ] Messageboard: Deleting of postings
- Added an option to sort a select list by its values. Thanks to Roy Johnson.
6.0.3 6.0.3

View file

@ -23,6 +23,7 @@ Contributing Developers..............Peter Beardsley / Appropriate Solutions
Chris Gebhardt / OpenServe Chris Gebhardt / OpenServe
Andy Grundman Andy Grundman
Chris Jackson Chris Jackson
Roy Johnson
Koen de Jonge / ProcoliX Koen de Jonge / ProcoliX
Martin Kamerbeek / ProcoliX Martin Kamerbeek / ProcoliX
Christian Kocourek Christian Kocourek

View file

@ -36,6 +36,9 @@ save you many hours of grief.
sure you have extrasPath and extrasURL defined in your config sure you have extrasPath and extrasURL defined in your config
file. file.
* The ThumbnailLinker macro has been removed. You can now use the
Thumbnail macro because it is templated.
6.0.2 6.0.2
-------------------------------------------------------------------- --------------------------------------------------------------------

View file

@ -18,6 +18,29 @@ GetOptions(
WebGUI::Session::open("../..",$configFile); WebGUI::Session::open("../..",$configFile);
#--------------------------------------------
print "\tUpdating config file.\n" unless ($quiet);
my $pathToConfig = '../../etc/'.$configFile;
my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig);
$conf->set("templateCacheType"=>"file");
my $macros = $conf->get("macros");
delete $macros->{"\\"};
$macros->{"\\\\"} = "Backslash_pageUrl";
$macros->{"Navigation"} = "Navigation";
my %newMacros;
foreach my $macro (keys %{$macros}) {
unless (
$macros->{$macro} eq "ThumbnailLinker"
) {
$newMacros{$macro} = $macros->{$macro};
}
}
$conf->set("macros"=>\%newMacros);
$conf->write;
#-------------------------------------------- #--------------------------------------------
print "\tRemoving unneeded files and directories.\n" unless ($quiet); print "\tRemoving unneeded files and directories.\n" unless ($quiet);
unlink("../../lib/WebGUI/Operation/International.pm"); unlink("../../lib/WebGUI/Operation/International.pm");
@ -25,6 +48,7 @@ unlink("../../lib/WebGUI/Wobject/Item.pm");
unlink("../../lib/WebGUI/Wobject/LinkList.pm"); unlink("../../lib/WebGUI/Wobject/LinkList.pm");
unlink("../../lib/WebGUI/Wobject/FAQ.pm"); unlink("../../lib/WebGUI/Wobject/FAQ.pm");
unlink("../../lib/WebGUI/Wobject/ExtraColumn.pm"); unlink("../../lib/WebGUI/Wobject/ExtraColumn.pm");
unlink("../../lib/WebGUI/Macro/ThumbnailLinker.pm");
unlink("../../lib/WebGUI/Macro/m_currentMenuHorizontal.pm"); unlink("../../lib/WebGUI/Macro/m_currentMenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/M_currentMenuVertical.pm"); unlink("../../lib/WebGUI/Macro/M_currentMenuVertical.pm");
unlink("../../lib/WebGUI/Macro/s_specificMenuHorizontal.pm"); unlink("../../lib/WebGUI/Macro/s_specificMenuHorizontal.pm");
@ -44,6 +68,7 @@ unlink("../../lib/WebGUI/Macro/TopDropMenu.pm");
unlink("../../lib/WebGUI/Macro/Question_search.pm"); unlink("../../lib/WebGUI/Macro/Question_search.pm");
#--------------------------------------------
print "\tResetting user languages.\n" unless ($quiet); print "\tResetting user languages.\n" unless ($quiet);
my ($defaultLangId) = WebGUI::SQL->quickArray("select dataDefault from userProfileField where fieldName='language'"); my ($defaultLangId) = WebGUI::SQL->quickArray("select dataDefault from userProfileField where fieldName='language'");
$defaultLangId =~ s/\[//; $defaultLangId =~ s/\[//;
@ -75,6 +100,7 @@ foreach my $key (keys %{$langs}) {
WebGUI::SQL->write("update page set languageId=".quote($langs->{$key})." where languageId=".$key); WebGUI::SQL->write("update page set languageId=".quote($langs->{$key})." where languageId=".$key);
} }
#--------------------------------------------
print "\tConverting page tree to the Nested Set model.\n"; print "\tConverting page tree to the Nested Set model.\n";
sub walk_down { sub walk_down {
my($pageId, $o) = @_[0,1]; my($pageId, $o) = @_[0,1];

View file

@ -4,7 +4,16 @@ drop table international;
drop table help; drop table help;
alter table WSClient add sharedCache tinyint unsigned not null default '0'; alter table WSClient add sharedCache tinyint unsigned not null default '0';
alter table WSClient add cacheTTL smallint(5) unsigned NOT NULL default '60'; alter table WSClient add cacheTTL smallint(5) unsigned NOT NULL default '60';
INSERT INTO template VALUES (1,'Default Account','<a class="myAccountLink" href="<tmpl_var account.url>"><tmpl_var account.text></a>','Macro/a_account',1,1); INSERT INTO template VALUES (1,'Default Account Macro','<a class="myAccountLink" href="<tmpl_var account.url>"><tmpl_var account.text></a>','Macro/a_account',1,1);
INSERT INTO template VALUES (1,'Default Editable Toggle','<a href="<tmpl_var toggle.url>"><tmpl_var toggle.text></a>','Macro/EditableToggle',1,1); INSERT INTO template VALUES (1,'Default Editable Toggle Macro','<a href="<tmpl_var toggle.url>"><tmpl_var toggle.text></a>','Macro/EditableToggle',1,1);
INSERT INTO template VALUES (1,'Default Admin Toggle','<a href="<tmpl_var toggle.url>"><tmpl_var toggle.text></a>','Macro/AdminToggle',1,1); INSERT INTO template VALUES (1,'Default Admin Toggle Macro','<a href="<tmpl_var toggle.url>"><tmpl_var toggle.text></a>','Macro/AdminToggle',1,1);
INSERT INTO template VALUES (1,'Default File Macro','<a href="<tmpl_var file.url>"><img src="<tmpl_var file.icon>" align="middle" border="0" /><tmpl_var file.name></a>','Macro/File',1,1);
INSERT INTO template VALUES (2,'File no icon','<a href="<tmpl_var file.url>"><tmpl_var file.name></a>','Macro/File',1,1);
INSERT INTO template VALUES (3,'File with size','<a href="<tmpl_var file.url>"><img src="<tmpl_var file.icon>" align="middle" border="0" /><tmpl_var file.name></a>(<tmpl_var file.size>)','Macro/File',1,1);
INSERT INTO template VALUES (1,'Default Group Add Macro','<a href="<tmpl_var group.url>"><tmpl_var group.text></a>','Macro/GroupAdd',1,1);
INSERT INTO template VALUES (1,'Default Group Delete Macro','<a href="<tmpl_var group.url>"><tmpl_var group.text></a>','Macro/GroupDelete',1,1);
INSERT INTO template VALUES (1,'Default Homelink','<a class="homeLink" href="<tmpl_var homeLink.url>"><tmpl_var homeLink.text></a>','Macro/H_homeLink',1,1);
INSERT INTO template VALUES (1,'Default Make Printable','<a class="makePrintableLink" href="<tmpl_var printable.url>"><tmpl_var printable.text></a>','Macro/r_printable',1,1);
INSERT INTO template VALUES (1,'Default LoginToggle','<a class="loginToggleLink" href="<tmpl_var toggle.url>"><tmpl_var toggle.text></a>','Macro/LoginToggle',1,1);

View file

@ -16,6 +16,7 @@ package WebGUI::Form;
use strict; use strict;
use HTTP::BrowserDetect; use HTTP::BrowserDetect;
use Tie::IxHash;
use WebGUI::DateTime; use WebGUI::DateTime;
use WebGUI::International; use WebGUI::International;
use WebGUI::Session; use WebGUI::Session;
@ -1314,6 +1315,10 @@ If you want to add anything special to this form element like javascript actions
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item sortByValue
A boolean value for whether or not the values in the options hash should be sorted.
=back =back
=cut =cut
@ -1322,20 +1327,30 @@ sub selectList {
my ($output, $key, $item, $size, $multiple); my ($output, $key, $item, $size, $multiple);
$size = $_[0]->{size} || 1; $size = $_[0]->{size} || 1;
$multiple = ' multiple="1"' if ($_[0]->{multiple}); $multiple = ' multiple="1"' if ($_[0]->{multiple});
$output = '<select name="'.$_[0]->{name}.'" size="'.$size.'" '.$_[0]->{extras}.$multiple.'>'; $output = '<select name="'.$_[0]->{name}.'" size="'.$size.'" '.$_[0]->{extras}.$multiple.'>';
foreach $key (keys %{$_[0]->{options}}) { my %options;
$output .= '<option value="'.$key.'"'; if ($_[0]->{sortByValue}) {
foreach $item (@{$_[0]->{value}}) { tie %options, 'Tie::IxHash';
if ($item eq $key) { foreach my $optionKey (sort {"\L${$_[0]->{options}}{$a}" cmp "\L${$_[0]->{options}}{$b}" } keys %{$_[0]->{options}}) {
$output .= ' selected="1"'; $options{$optionKey} = ${$_[0]->{options}}{$optionKey};
} }
} } else {
$output .= '>'.${$_[0]->{options}}{$key}.'</option>'; %options = %{$_[0]->{options}};
}
foreach $key (keys %options) {
$output .= '<option value="'.$key.'"';
foreach $item (@{$_[0]->{value}}) {
if ($item eq $key) {
$output .= ' selected="1"';
}
}
$output .= '>'.${$_[0]->{options}}{$key}.'</option>';
} }
$output .= '</select>'; $output .= '</select>';
return $output; return $output;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 submit ( hashRef ) =head2 submit ( hashRef )

View file

@ -1834,6 +1834,10 @@ Extra text to describe this form element or to provide special instructions.
The UI level for this field. See the WebGUI developer's site for details. Defaults to "0". The UI level for this field. See the WebGUI developer's site for details. Defaults to "0".
=item sortByValue
A boolean value for whether the values in the options hash should be sorted.
=back =back
=cut =cut
@ -1841,8 +1845,8 @@ The UI level for this field. See the WebGUI developer's site for details. Defaul
sub selectList { sub selectList {
my ($output); my ($output);
my ($self, @p) = @_; my ($self, @p) = @_;
my ($name, $options, $label, $value, $size, $multiple, $extras, $subtext, $uiLevel) = my ($name, $options, $label, $value, $size, $multiple, $extras, $subtext, $uiLevel, $sortByValue) =
rearrange([qw(name options label value size multiple extras subtext uiLevel)], @p); rearrange([qw(name options label value size multiple extras subtext uiLevel sortByValue)], @p);
if (_uiLevelChecksOut($uiLevel)) { if (_uiLevelChecksOut($uiLevel)) {
$output = WebGUI::Form::selectList({ $output = WebGUI::Form::selectList({
"name"=>$name, "name"=>$name,
@ -1850,7 +1854,8 @@ sub selectList {
"value"=>$value, "value"=>$value,
"multiple"=>$multiple, "multiple"=>$multiple,
"size"=>$size, "size"=>$size,
"extras"=>$extras "extras"=>$extras,
"sortByValue"=>$sortByValue
}); });
$output .= _subtext($subtext); $output .= _subtext($subtext);
$output = $self->_tableFormRow($label,$output); $output = $self->_tableFormRow($label,$output);

View file

@ -23,21 +23,8 @@ sub process {
if (WebGUI::Grouping::isInGroup(12)) { if (WebGUI::Grouping::isInGroup(12)) {
my %var; my %var;
my @param = WebGUI::Macro::getParams($_[0]); my @param = WebGUI::Macro::getParams($_[0]);
my $templateId = 1; ##Set default template in the namespace my $turnOn = $param[0] || WebGUI::International::get(516);
##1 param means use my template with default text my $turnOff = $param[1] || WebGUI::International::get(517);
my ($turnOff, $turnOn) = (WebGUI::International::get(517),WebGUI::International::get(516));
if (@param == 1) {
$templateId = WebGUI::Template::getIdByName($param[0],"Macro/AdminToggle");
}
##2 params means use my text with the default template
elsif (@param == 2) {
($turnOff, $turnOn) = @param;
}
##3 or more params means use my text and template, other args ignored
elsif (@param >= 3) {
($turnOff, $turnOn) = @param[1,2];
$templateId = WebGUI::Template::getIdByName($param[0],"Macro/AdminToggle");
}
if ($session{var}{adminOn}) { if ($session{var}{adminOn}) {
$var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin'); $var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin');
$var{'toggle.text'} = $turnOff; $var{'toggle.text'} = $turnOff;
@ -45,8 +32,7 @@ sub process {
$var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin'); $var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin');
$var{'toggle.text'} = $turnOn; $var{'toggle.text'} = $turnOn;
} }
$templateId = 1 if $templateId == 0; return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/AdminToggle"),"Macro/AdminToggle",\%var);
return WebGUI::Template::process($templateId,"Macro/AdminToggle",\%var);
} }
return ""; return "";
} }

View file

@ -24,20 +24,8 @@ sub process {
if (WebGUI::Page::canEdit() && WebGUI::Grouping::isInGroup(12)) { if (WebGUI::Page::canEdit() && WebGUI::Grouping::isInGroup(12)) {
my %var; my %var;
my @param = WebGUI::Macro::getParams($_[0]); my @param = WebGUI::Macro::getParams($_[0]);
my $templateId = 1; ##Set default template in the namespace my $turnOn = $param[0] || WebGUI::International::get(516);
my ($turnOff, $turnOn) = (WebGUI::International::get(517),WebGUI::International::get(516)); my $turnOff = $param[1] || WebGUI::International::get(517);
##1 param means use my template with default text
if (@param == 1) {
$templateId = WebGUI::Template::getIdByName($param[0],"Macro/EditableToggle");
}
##2 params means use my text with the default template
elsif (@param == 2) {
($turnOff, $turnOn) = @param;
}
##3 or more params means use my text and template, other args ignored
elsif (@param >= 3) {
($turnOff, $turnOn) = @param[1,2];
}
if ($session{var}{adminOn}) { if ($session{var}{adminOn}) {
$var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin'); $var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin');
$var{'toggle.text'} = $turnOff; $var{'toggle.text'} = $turnOff;
@ -45,8 +33,7 @@ sub process {
$var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin'); $var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin');
$var{'toggle.text'} = $turnOn; $var{'toggle.text'} = $turnOn;
} }
$templateId = 1 if $templateId == 0; return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/EditableToggle"),"Macro/EditableToggle",\%var);
return WebGUI::Template::process($templateId,"Macro/EditableToggle",\%var);
} }
return ""; return "";
} }

View file

@ -14,24 +14,18 @@ use strict;
use WebGUI::Collateral; use WebGUI::Collateral;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Template;
#------------------------------------------------------------------- #-------------------------------------------------------------------
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])) {
$var{'file.url'} = $collateral->getURL;
# include default icon unless a second param $var{'file.icon'} = $collateral->getIcon;
if ( ! $param[1] ) { $var{'file.name'} = $param[0];
return '<a href="' . $collateral->getURL . $var{'file.size'} = $collateral->getSize;
'"><img src="' . $collateral->getIcon . $var{'file.thumbnail'} = $collateral->getThumbnail;
'" align="middle" border="0" /> ' . return WebGUI::Template::process(WebGUI::Template::getIdByName($param[1],"Macro/File"),"Macro/File", \%var);
$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;
} }

View file

@ -15,6 +15,7 @@ use WebGUI::Group;
use WebGUI::Grouping; use WebGUI::Grouping;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Template;
use WebGUI::URL; use WebGUI::URL;
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -25,7 +26,10 @@ sub process {
return "" if ($g->groupId eq ""); return "" if ($g->groupId eq "");
return "" unless ($g->autoAdd); return "" unless ($g->autoAdd);
return "" if (WebGUI::Grouping::isInGroup($g->groupId)); return "" if (WebGUI::Grouping::isInGroup($g->groupId));
return '<a href="'.WebGUI::URL::page("op=autoAddToGroup&groupId=".$g->groupId).'">'.$param[1].'</a>'; my %var = ();
$var{'group.url'} = WebGUI::URL::page("op=autoAddToGroup&groupId=".$g->groupId);
$var{'group.text'} = $param[1];
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/GroupAdd"), "Macro/GroupAdd", \%var);
} }

View file

@ -15,6 +15,7 @@ use WebGUI::Group;
use WebGUI::Grouping; use WebGUI::Grouping;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Template;
use WebGUI::URL; use WebGUI::URL;
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -25,7 +26,10 @@ sub process {
return "" if ($g->groupId eq ""); return "" if ($g->groupId eq "");
return "" unless ($g->autoDelete); return "" unless ($g->autoDelete);
return "" unless (WebGUI::Grouping::isInGroup($g->groupId)); return "" unless (WebGUI::Grouping::isInGroup($g->groupId));
return '<a href="'.WebGUI::URL::page("op=autoDeleteFromGroup&groupId=".$g->groupId).'">'.$param[1].'</a>'; my %var = ();
$var{'group.url'} = WebGUI::URL::page("op=autoDeleteFromGroup&groupId=".$g->groupId);
$var{'group.text'} = $param[1];
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/GroupDelete"),"Macro/GroupDelete", \%var);
} }

View file

@ -27,13 +27,14 @@ sub process {
} }
$temp = WebGUI::URL::gateway($temp); $temp = WebGUI::URL::gateway($temp);
if ($param[0] ne "linkonly") { if ($param[0] ne "linkonly") {
$temp = '<a class="homeLink" href="'.$temp.'">'; my %var;
if ($param[0] ne "") { $var{'homelink.url'} = WebGUI::URL::gateway($temp);
$temp .= $param[0]; if ($param[0] ne "") {
} else { $var{'homeLink.text'} = $param[0];
$temp .= WebGUI::International::get(47); } else {
} $var{'homeLink.text'} = WebGUI::International::get(47);
$temp .= '</a>'; }
$temp = WebGUI::Template::process(WebGUI::Template::getIdByName($param[1],"Macro/H_homeLink"), "Macro/H_homeLink", \%var);
} }
return $temp; return $temp;
} }

View file

@ -14,26 +14,25 @@ use strict;
use WebGUI::International; use WebGUI::International;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Template;
use WebGUI::URL; use WebGUI::URL;
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub process { sub process {
my (@param, $temp, $login, $logout); my @param = WebGUI::Macro::getParams($_[0]);
@param = WebGUI::Macro::getParams($_[0]); my $login = $param[0] || WebGUI::International::get(716);
if ($session{user}{userId} == 1) { my $logout = $param[1] || WebGUI::International::get(717);
if ($param[0] eq "linkonly") { my %var;
return WebGUI::URL::page('op=displayLogin'); if ($session{user}{userId} == 1) {
} return WebGUI::URL::page("op=displayLogin") if ($param[0] eq "linkonly");
$login = $param[0] || WebGUI::International::get(716); $var{'toggle.url'} = WebGUI::URL::page('op=displayLogin');
$temp = '<a class="loginToggleLink" href="'.WebGUI::URL::page('op=displayLogin').'">'.$login.'</a>'; $var{'toggle.text'} = $login;
} else { } else {
if ($param[0] eq "linkonly") { return WebGUI::URL::page("op=logout") if ($param[0] eq "linkonly");
return WebGUI::URL::page('op=logout'); $var{'toggle.url'} = WebGUI::URL::page('op=logout');
} $var{'toggle.text'} = $logout;
$logout = $param[1] || WebGUI::International::get(717); }
$temp = '<a class="loginToggleLink" href="'.WebGUI::URL::page('op=logout').'">'.$logout.'</a>'; return WebGUI::Template::process(WebGUI::Template::getIdByName($param[3],"Macro/LoginToggle"), "Macro/LoginToggle", \%var);
}
return $temp;
} }

View file

@ -21,18 +21,10 @@ use WebGUI::URL;
sub process { sub process {
my %var; my %var;
my @param = WebGUI::Macro::getParams($_[0]); my @param = WebGUI::Macro::getParams($_[0]);
return WebGUI::URL::page("op=displayAccount") if ($param[0] eq "linkonly");
$var{'account.url'} = WebGUI::URL::page('op=displayAccount'); $var{'account.url'} = WebGUI::URL::page('op=displayAccount');
my $templateId = 1; ##Set default template in the namespace $var{'account.text'} = $param[0] || WebGUI::International::get(46);
$var{'account.text'} = WebGUI::International::get(46); return WebGUI::Template::process(WebGUI::Template::getIdByName($param[1],"Macro/a_account"),"Macro/a_account",\%var);
if (@param == 1) {
$var{'account.text'} = $param[0] if $param[0];
}
elsif (@param == 2) {
$var{'account.text'} = $param[0] if $param[0];
$templateId = WebGUI::Template::getIdByName($param[1],"Macro/a_account");
$templateId = 1 if $templateId == 0;
}
return WebGUI::Template::process($templateId,"Macro/a_account",\%var);
} }

View file

@ -15,6 +15,7 @@ use WebGUI::International;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::SQL; use WebGUI::SQL;
use WebGUI::Template;
use WebGUI::URL; use WebGUI::URL;
use WebGUI::Utility; use WebGUI::Utility;
@ -28,19 +29,20 @@ sub process {
} }
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append); $temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append);
if ($param[1] ne "") { if ($param[1] ne "") {
($styleId) = WebGUI::SQL->quickArray("select styleId from style where name=".quote($param[1]),WebGUI::SQL->getSlave); ($styleId) = WebGUI::Template::getIdByName($param[1],"style");
if ($styleId != 0) { if ($styleId != 0) {
$temp = WebGUI::URL::append($temp,'styleId='.$styleId); $temp = WebGUI::URL::append($temp,'styleId='.$styleId);
} }
} }
if ($param[0] ne "linkonly") { if ($param[0] ne "linkonly") {
$temp = '<a class="makePrintableLink" href="'.$temp.'">'; my %var;
if ($param[0] ne "") { $var{'printable.url'} = $temp;
$temp .= $param[0]; if ($param[0] ne "") {
} else { $var{'printable.text'} = $param[0];
$temp .= WebGUI::International::get(53); } else {
} $var{'printable.text'} = WebGUI::International::get(53);
$temp .= '</a>'; }
$temp = WebGUI::Template::process(WebGUI::Template::getByName($param[2],"Macro/r_printable"), "Macro/r_printable", \%var);
} }
return $temp; return $temp;
} }