From 4d3c8cc5a3be15c9cbf88fe81e96d22a8fef5473 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 4 Nov 2002 04:30:21 +0000 Subject: [PATCH] Fixed some problems where special characters could be used where they shouldn't be. Also fixed a couple of template inconsistencies. --- docs/upgrades/upgrade_4.6.9-4.7.0.sql | 37 +++++++++------ lib/WebGUI/Discussion.pm | 17 ++----- lib/WebGUI/Operation/Account.pm | 3 ++ lib/WebGUI/Wobject/FAQ.pm | 15 ++---- lib/WebGUI/Wobject/MessageBoard.pm | 1 - lib/WebGUI/Wobject/Product.pm | 67 ++++++++++++++++----------- 6 files changed, 74 insertions(+), 66 deletions(-) diff --git a/docs/upgrades/upgrade_4.6.9-4.7.0.sql b/docs/upgrades/upgrade_4.6.9-4.7.0.sql index 8d6256ea1..6686b942d 100644 --- a/docs/upgrades/upgrade_4.6.9-4.7.0.sql +++ b/docs/upgrades/upgrade_4.6.9-4.7.0.sql @@ -83,17 +83,6 @@ alter table template drop primary key; alter table template add primary key (templateId,namespace); delete from template where templateId<25; drop table Product_template; -INSERT INTO template VALUES (1,'Default Page','\r\n\r\n\r\n\r\n
\r\n','Page'); -INSERT INTO template VALUES (2,'News','\r\n\r\n \r\n\r\n \r\n \r\n\r\n\r\n \r\n\r\n
\r\n','Page'); -INSERT INTO template VALUES (3,'One Over Three','\r\n\r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n
','Page'); -INSERT INTO template VALUES (4,'Three Over One','\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n\r\n
','Page'); -INSERT INTO template VALUES (5,'Left Column','\r\n\r\n \r\n \r\n\r\n
','Page'); -INSERT INTO template VALUES (6,'Right Column','\r\n\r\n \r\n \r\n\r\n
\r\n','Page'); -INSERT INTO template VALUES (7,'Side By Side','\r\n\r\n \r\n \r\n\r\n
\r\n','Page'); -INSERT INTO template VALUES (1,'Default Product','\r\n\r\n\r\n \r\n \r\n\r\n
\r\n\r\n

\r\n\r\n\r\n Price:
\r\n
\r\n\r\n Product Number:
\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n

\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
Features
\r\n

\r\n\r\n·
\r\n
\r\n

Benefits
\r\n

\r\n\r\n·
\r\n
\r\n\r\n\r\n

Specifications
\r\n\r\n

\r\n\r\n·:
\r\n
\r\n\r\n\r\n

Accessories
\r\n

\r\n\r\n·\">
\r\n
\r\n\r\n

Related Products
\r\n

\r\n\r\n·\">
\r\n
\r\n

\r\n\r\n','Product'); -INSERT INTO template VALUES (2,'Benefits Showcase','\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n

\r\n\r\n\r\n Benefits
\r\n

\r\n\r\n·
\r\n
\r\n

\r\n\r\n

\r\n\r\nSpecifications
\r\n

\r\n\r\n·:
\r\n
\r\nOptions
\r\n

\r\n\r\n·\">
\r\n
\r\nOther Products
\r\n

\r\n\r\n·\">
\r\n
\r\n

\r\n\r\n','Product'); -INSERT INTO template VALUES (3,'Three Columns','\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n
\r\n\r\n\r\n \r\n \r\n \r\n\r\n
\r\nFeatures

\r\n\r\n·
\r\n
\r\n

\r\nBenefits

\r\n\r\n·
\r\n
\r\n

\r\n

\r\nSpecifications

\r\n\r\n·:
\r\n
\r\n

\r\nAccessories

\r\n\r\n·\">
\r\n
\r\n

\r\nRelated Products

\r\n\r\n·\">
\r\n
\r\n

\r\n

\r\n \r\n Price:
\r\n
\r\n\r\n\r\n Product Number:
\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n','Product'); -INSERT INTO template VALUES (4,'Left Column Collateral','\r\n\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n
\r\n\r\n

\r\n\r\nSpecs:
\r\n

\r\n\r\n·:
\r\n
\r\nFeatures:
\r\n

\r\n\r\n·
\r\n
\r\nOptions:
\r\n

\r\n\r\n·\">
\r\n
\r\n

\r\n','Product'); INSERT INTO language VALUES (11,'Arabic','ISO-8859-6'); INSERT INTO international VALUES (106,'WebGUI',11,'\"انقر \"\"نعم\"\" لتحويل جميع الصفحات التي تحتويها هذه الصفحة إلى هذا التصميم\"',1031514049); INSERT INTO international VALUES (105,'WebGUI',11,'تصميم. هيئة',1031514049); @@ -1038,13 +1027,9 @@ alter table FAQ add column templateId int not null default 1; delete from international where namespace='FAQ' and internationalId=1; insert into international (internationalId,languageId,namespace,message,lastUpdated) values (75,1,'FAQ','Add a question.', 1036260753); insert into international (internationalId,languageId,namespace,message,lastUpdated) values (74,1,'FAQ','Template', 1036260684); -INSERT INTO template VALUES (1,'Default FAQ','\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n

    \r\n\r\n
  • \">\r\n\r\n
\r\n\r\n\r\n\">
\r\n\r\n

[top]

\r\n\r\n\r\n','FAQ'); -INSERT INTO template VALUES (2,'Q and A','\r\n

\r\n\r\n\r\n

\r\n\r\n\r\nQ:
\r\nA: \r\n

\r\n\r\n\r\n','FAQ'); -INSERT INTO template VALUES (3,'Topics','\r\n

\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n\r\n\r\n','FAQ'); INSERT INTO style VALUES (-7,'Smooth Blues','\r\n','^AdminBar;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
Home\r\n
\r\n
\r\n \r\n \r\n
Print!\r\n
\r\n
\r\n \r\n \r\n
My Account\r\n
\r\n
\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n
^C;^?;
\r\n\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n
\r\n \r\n
\r\n

Site Navigation

\r\n
\r\n \r\n \r\n \r\n \r\n
^T(0);
^L;
\r\n
\r\n\r\n \r\n\r\n \r\n
\r\n \r\n\r\n^-;\r\n\r\n\r\n
\r\n
\r\n\r\n\r\n


This Design ©2002 OpenServe
\r\n\r\n
\r\n\r\n'); alter table Item add column templateId int not null default 1; insert into international (internationalId,languageId,namespace,message,lastUpdated) values (72,1,'Item','Template', 1036267550); -INSERT INTO template VALUES (1,'Default Item','\r\n \r\n \">\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n - \r\n \">\" border=0 alt=\"\" width=16 height=16 border=0 align=\"middle\">\r\n\r\n\r\n\r\n - \r\n','Item'); alter table USS add column templateId int not null default 1; update USS set templateId=2 where layout='traditional' and displayThumbnails=1; update USS set templateId=3 where layout='weblog'; @@ -1061,6 +1046,28 @@ delete from international where namespace='USS' and internationalId=22; delete from international where namespace='USS' and internationalId=23; delete from international where namespace='USS' and internationalId=40; +INSERT INTO template VALUES (1,'Default Page','\r\n\r\n\r\n\r\n
\r\n','Page'); +INSERT INTO template VALUES (2,'News','\r\n\r\n \r\n\r\n \r\n \r\n\r\n\r\n \r\n\r\n
\r\n','Page'); +INSERT INTO template VALUES (3,'One Over Three','\r\n\r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n
','Page'); +INSERT INTO template VALUES (4,'Three Over One','\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n\r\n
','Page'); +INSERT INTO template VALUES (5,'Left Column','\r\n\r\n \r\n \r\n\r\n
','Page'); +INSERT INTO template VALUES (6,'Right Column','\r\n\r\n \r\n \r\n\r\n
\r\n','Page'); +INSERT INTO template VALUES (7,'Side By Side','\r\n\r\n \r\n \r\n\r\n
\r\n','Page'); +INSERT INTO template VALUES (1,'Default Product','\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n Price:
\r\n
\r\n\r\n\r\n Product Number:
\r\n
\r\n\r\n
\r\n\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n

\r\n\r\n \">\" border=\"0\" />

\r\n\r\n\r\n \">\" border=\"0\" />

\r\n\r\n\r\n \">\" border=\"0\" />

\r\n\r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n\r\n
Features
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n

\r\n

Benefits
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n

Specifications
\r\n\r\n

\r\n\r\n\r\n ·:
\r\n
\r\n

Accessories
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n

Related Products
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n

\r\n\r\n','Product'); +INSERT INTO template VALUES (2,'Benefits Showcase','\r\n\r\n\r\n \" border=\"0\" />

\r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n

\r\n\r\n\r\n Benefits
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n\r\n

\r\n\r\n\r\n \">\" border=\"0\" />

\r\n\r\n\r\nSpecifications
\r\n\r\n

\r\n\r\n\r\n ·:
\r\n
\r\n\r\nOptions
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n\r\nOther Products
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n\r\n

\r\n\r\n','Product'); +INSERT INTO template VALUES (3,'Three Columns','\r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\n \">\" border=\"0\" />\r\n\r\n\r\n\r\n \">\" border=\"0\" />\r\n\r\n\r\n\r\n \">\" border=\"0\" />\r\n\r\n
\r\n\r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\nFeatures
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n

\r\n\r\nBenefits
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n

\r\n\r\n

\r\n\r\nSpecifications
\r\n\r\n

\r\n\r\n\r\n ·:
\r\n
\r\n

\r\n\r\nAccessories
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n

\r\n\r\nRelated Products
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n

\r\n

\r\n \r\n Price:
\r\n
\r\n\r\n\r\n Product Number:
\r\n
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n
\r\n\r\n\r\n','Product'); +INSERT INTO template VALUES (4,'Left Column Collateral','\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n\r\n \">\" border=0 align=\"absmiddle\">
\r\n
\r\n
\r\n
\r\n\r\n \">\" border=\"0\" />

\r\n\r\n\r\n \">\" border=\"0\" />

\r\n\r\n\r\n \">\" border=\"0\" />

\r\n\r\n

\r\n
\r\n\r\n

\r\n\r\n\r\nSpecs:
\r\n\r\n

\r\n\r\n\r\n ·:
\r\n
\r\n

\r\n\r\nFeatures:
\r\n\r\n

\r\n\r\n\r\n ·
\r\n
\r\n

\r\n\r\nOptions:
\r\n\r\n

\r\n\r\n\r\n ·\">
\r\n
\r\n\r\n

\r\n','Product'); +INSERT INTO template VALUES (1,'Default FAQ','\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n\r\n

    \r\n\r\n
  • \">\r\n\r\n
\r\n

\r\n\r\n\r\n\r\n \">
\r\n \r\n

[top]

\r\n\r\n\r\n','FAQ'); +INSERT INTO template VALUES (2,'Q and A','\r\n

\r\n\r\n\r\n

\r\n\r\n\r\nQ:
\r\nA: \r\n

\r\n\r\n\r\n','FAQ'); +INSERT INTO template VALUES (3,'Topics','\r\n

\r\n\r\n\r\n

\r\n\r\n\r\n\r\n

\r\n\r\n

\r\n\r\n\r\n','FAQ'); +INSERT INTO template VALUES (1,'Default Item','\r\n \r\n \">\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n - \r\n \">\" border=0 alt=\"\" width=16 height=16 border=0 align=\"middle\">\r\n\r\n\r\n\r\n - \r\n','Item'); +INSERT INTO template VALUES (1,'Default USS','\r\n\r\n\r\n
\r\n\r\n\r\n ·\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \"> \r\n \r\n ()\r\n \r\n\">
\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n','USS'); +INSERT INTO template VALUES (1,'Default Submission','

\r\n\r\n\r\n
\r\n: \">
\r\n:
\r\n:
\r\n:
\r\n
\r\n\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n \" border=\"0\">

\r\n\r\n

\r\n
\r\n\r\n

','USS/Submission'); +INSERT INTO template VALUES (2,'Traditional with Thumbnails','\r\n\r\n\r\n\r\n
\r\n\r\n\r\n ·\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \"> \r\n \r\n ()\r\n \r\n\r\n \r\n \">\" border=\"0\">\r\n \r\n \">
\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n','USS'); +INSERT INTO template VALUES (3,'Weblog','\r\n\r\n\r\n

\r\n\r\n\r\n\r\n ·\r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \r\n ()\r\n \r\n
\r\n \r\n \">\" border=\"0\" align=\"right\"/>\r\n \r\n \"> -
\r\n\r\n

( \">\r\n \r\n | \r\n \r\n )

\r\n

\r\n\r\n\r\n

\r\n · \r\n
\r\n
\r\n','USS'); +INSERT INTO template VALUES (4,'Photo Gallery','\r\n\r\n\r\n ·\r\n\r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n
\r\n \r\n \r\n \">\" border=\"0\"/>
\r\n
\r\n \">\r\n \r\n ()\r\n \r\n
\r\n\r\n\r\n

\r\n · · \r\n
\r\n\r\n','USS'); +INSERT INTO template VALUES (2,'Item w/pop-up Links','\r\n \r\n \">\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n - \r\n \" target=\"_blank\">\" border=0 alt=\"\" width=16 height=16 border=0 align=\"middle\">\r\n\r\n\r\n\r\n - \r\n','Item'); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (747,1,'WebGUI','Usernames must contain only alpha-numeric characters.', 1036384261); diff --git a/lib/WebGUI/Discussion.pm b/lib/WebGUI/Discussion.pm index 16a9e39de..298f7b22a 100644 --- a/lib/WebGUI/Discussion.pm +++ b/lib/WebGUI/Discussion.pm @@ -180,7 +180,7 @@ sub deleteMessageConfirm { #------------------------------------------------------------------- sub formatHeader { my ($output, $subject); - $subject = formatSubject($_[0]); + $subject = $_[0]; if ($_[5] ne "") { $subject = ''.$subject.''; } @@ -204,14 +204,6 @@ sub formatMessage { return $output; } -#------------------------------------------------------------------- -sub formatSubject { - my $output; - $output = $_[0]; - $output = WebGUI::HTML::filter($output,'all'); - return $output; -} - #------------------------------------------------------------------- sub getMessage { my (%message); @@ -239,7 +231,7 @@ sub post { '',$message{status}) .'

'.formatMessage($message{message}); $message{message} = ""; - $message{subject} = formatSubject("Re: ".$message{subject}) unless ($message{subject} =~ /^Re:/); + $message{subject} = "Re: ".$message{subject} unless ($message{subject} =~ /^Re:/); $session{form}{mid} = "new"; $f->hidden("replyTo",$session{form}{replyTo}); if ($session{user}{userId} == 1) { @@ -256,7 +248,6 @@ sub post { $footer = formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views}, '',$message{status}) .'

'.formatMessage($message{message}); - $message{subject} = formatSubject($message{subject}); } $f->hidden("func","postSave"); $f->hidden("wid",$session{form}{wid}); @@ -276,7 +267,9 @@ sub postSave { my ($u, $rid, $status, $username, $pid); if ($session{form}{subject} eq "") { $session{form}{subject} = WebGUI::International::get(232); - } + } else { + $session{form}{subject} = WebGUI::HTML::filter($session{form}{subject},'all'); + } if ($session{form}{message} eq "") { $session{form}{subject} .= ' '.WebGUI::International::get(233); } diff --git a/lib/WebGUI/Operation/Account.pm b/lib/WebGUI/Operation/Account.pm index aaa8fcb14..f7d2b5ec6 100644 --- a/lib/WebGUI/Operation/Account.pm +++ b/lib/WebGUI/Operation/Account.pm @@ -96,6 +96,9 @@ sub _hasBadUsername { if ($_[0] eq "") { $error .= '

  • '.WebGUI::International::get(725); } + unless ($_[0] =~ /^[A-Za-z0-9\-\_\.\,\@]+$/) { + $error .= '
  • '.WebGUI::International::get(747); + } ($otherUser) = WebGUI::SQL->quickArray("select username from users where username='$_[0]'"); if ($otherUser ne "" && $otherUser ne $session{user}{username}) { $error .= '
  • '.WebGUI::International::get(77).' "'.$_[0].'too", "'.$_[0].'2", ' diff --git a/lib/WebGUI/Wobject/FAQ.pm b/lib/WebGUI/Wobject/FAQ.pm index 43a150f8e..1194c7855 100644 --- a/lib/WebGUI/Wobject/FAQ.pm +++ b/lib/WebGUI/Wobject/FAQ.pm @@ -177,7 +177,7 @@ sub www_moveQuestionUp { #------------------------------------------------------------------- sub www_view { - my (%question, $controls, $sth, %var, @qa, @toc); + my (%question, $controls, $sth, %var, @qa); tie %question,'Tie::CPHash'; if ($session{var}{adminOn}) { $var{addquestion} .= '' @@ -185,10 +185,6 @@ sub www_view { } $sth = WebGUI::SQL->read("select * from FAQ_question where wobjectId=".$_[0]->get("wobjectId")." order by sequenceNumber"); while (%question = $sth->hash) { - push(@toc,{ - questionId=>$question{FAQ_questionId}, - question=>$question{question} - }); if ($session{var}{adminOn}) { $controls = deleteIcon('func=deleteQuestion&wid='.$_[0]->get("wobjectId").'&qid='.$question{FAQ_questionId}) .editIcon('func=editQuestion&wid='.$_[0]->get("wobjectId").'&qid='.$question{FAQ_questionId}) @@ -197,14 +193,13 @@ sub www_view { .' '; } push(@qa,{ - questionId=>$question{FAQ_questionId}, - answer=>$question{answer}, - question=>$question{question}, - controls=>$controls + "qa.Id"=>$question{FAQ_questionId}, + "qa.answer"=>$question{answer}, + "qa.question"=>$question{question}, + "qa.controls"=>$controls }); } $sth->finish; - $var{toc_loop} = \@toc; $var{qa_loop} = \@qa; return $_[0]->processMacros($_[0]->displayTitle.$_[0]->processTemplate($_[0]->get("templateId"),\%var)); } diff --git a/lib/WebGUI/Wobject/MessageBoard.pm b/lib/WebGUI/Wobject/MessageBoard.pm index 8c45c7806..8eba8cde0 100644 --- a/lib/WebGUI/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Wobject/MessageBoard.pm @@ -110,7 +110,6 @@ sub www_view { from discussion where wobjectId=".$_[0]->get("wobjectId")." and pid=0 and (status='Approved' or userId=$session{user}{userId}) order by messageId desc"); while (%data = $sth->hash) { - $data{subject} = WebGUI::Discussion::formatSubject($data{subject}); if ($i >= ($_[0]->get("messagesPerPage")*$pn) && $i < ($_[0]->get("messagesPerPage")*($pn+1))) { @last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId from discussion where wobjectId=".$_[0]->get("wobjectId")." and rid=$data{messageId} diff --git a/lib/WebGUI/Wobject/Product.pm b/lib/WebGUI/Wobject/Product.pm index 448cd6e9e..3a52567b5 100644 --- a/lib/WebGUI/Wobject/Product.pm +++ b/lib/WebGUI/Wobject/Product.pm @@ -510,44 +510,41 @@ sub www_view { #---brochure if ($_[0]->get("brochure")) { $file = WebGUI::Attachment->new($_[0]->get("brochure"),$_[0]->get("wobjectId")); - $var{brochure} = ' ' - .WebGUI::International::get(13,$namespace).''; - $var{brochureURL} = $file->getURL; + $var{"brochure.icon"} = $file->getIcon; + $var{"brochure.label"} = WebGUI::International::get(13,$namespace); + $var{"brochure.URL"} = $file->getURL; } #---manual if ($_[0]->get("manual")) { $file = WebGUI::Attachment->new($_[0]->get("manual"),$_[0]->get("wobjectId")); - $var{manual} = ' ' - .WebGUI::International::get(14,$namespace).''; - $var{manualURL} = $file->getURL; + $var{"manual.icon"} = $file->getIcon; + $var{"manual.label"} = WebGUI::International::get(14,$namespace); + $var{"manual.URL"} = $file->getURL; } #---warranty if ($_[0]->get("warranty")) { $file = WebGUI::Attachment->new($_[0]->get("warranty"),$_[0]->get("wobjectId")); - $var{warranty} = ' ' - .WebGUI::International::get(15,$namespace).''; - $var{warrantyURL} = $file->getURL; + $var{"warranty.icon"} = $file->getIcon; + $var{"warranty.label"} = WebGUI::International::get(15,$namespace); + $var{"warranty.URL"} = $file->getURL; } #---image1 if ($_[0]->get("image1")) { $file = WebGUI::Attachment->new($_[0]->get("image1"),$_[0]->get("wobjectId")); - $var{image1} = ''; - $var{image1thumbnail} = ''; - $var{image1url} = $file->getURL; + $var{thumbnail1} = $file->getThumbnail; + $var{image1} = $file->getURL; } #---image2 if ($_[0]->get("image2")) { $file = WebGUI::Attachment->new($_[0]->get("image2"),$_[0]->get("wobjectId")); - $var{image2} = ''; - $var{image2thumbnail} = ''; - $var{image2url} = $file->getURL; + $var{thumbnail2} = $file->getThumbnail; + $var{image2} = $file->getURL; } #---image3 if ($_[0]->get("image3")) { $file = WebGUI::Attachment->new($_[0]->get("image3"),$_[0]->get("wobjectId")); - $var{image3} = ''; - $var{image3thumbnail} = ''; - $var{image3url} = $file->getURL; + $var{thumbnail3} = $file->getThumbnail; + $var{image3} = $file->getURL; } #---features @@ -564,7 +561,10 @@ sub www_view { .moveUpIcon('func=moveFeatureUp&wid='.$_[0]->get("wobjectId").'&fid='.$data{Product_featureId}) .moveDownIcon('func=moveFeatureDown&wid='.$_[0]->get("wobjectId").'&fid='.$data{Product_featureId}); } - push(@featureloop,{feature=>$data{feature},featureId=>$data{Product_featureId},controls=>$segment}); + push(@featureloop,{ + "feature.feature"=>$data{feature}, + "feature.controls"=>$segment + }); } $sth->finish; $var{feature_loop} = \@featureloop; @@ -583,7 +583,10 @@ sub www_view { .moveUpIcon('func=moveBenefitUp&wid='.$_[0]->get("wobjectId").'&bid='.$data{Product_benefitId}) .moveDownIcon('func=moveBenefitDown&wid='.$_[0]->get("wobjectId").'&bid='.$data{Product_benefitId}); } - push(@benefitloop,{benefit=>$data{benefit},benefitId=>$data{Product_benefitId},controls=>$segment}); + push(@benefitloop,{ + "benefit.benefit"=>$data{benefit}, + "benefit.controls"=>$segment + }); } $sth->finish; $var{benefit_loop} = \@benefitloop; @@ -602,8 +605,12 @@ sub www_view { .moveUpIcon('func=moveSpecificationUp&wid='.$_[0]->get("wobjectId").'&sid='.$data{Product_specificationId}) .moveDownIcon('func=moveSpecificationDown&wid='.$_[0]->get("wobjectId").'&sid='.$data{Product_specificationId}); } - push(@specificationloop,{specificationId=>$data{Product_specificationId}, - controls=>$segment,specification=>$data{value},units=>$data{units},label=>$data{name}}); + push(@specificationloop,{ + "specification.controls"=>$segment, + "specification.specification"=>$data{value}, + "specification.units"=>$data{units}, + "specification.label"=>$data{name} + }); } $sth->finish; $var{specification_loop} = \@specificationloop; @@ -624,9 +631,11 @@ sub www_view { .moveUpIcon('func=moveAccessoryUp&wid='.$_[0]->get("wobjectId").'&aid='.$data{accessoryWobjectId}) .moveDownIcon('func=moveAccessoryDown&wid='.$_[0]->get("wobjectId").'&aid='.$data{accessoryWobjectId}); } - push(@accessoryloop,{URL=>WebGUI::URL::gateway($data{urlizedTitle}),title=>$data{title}, - accessory=>''.$data{title}.'', - controls=>$segment}); + push(@accessoryloop,{ + "accessory.URL"=>WebGUI::URL::gateway($data{urlizedTitle}), + "accessory.title"=>$data{title}, + "accessory.controls"=>$segment + }); } $sth->finish; $var{accessory_loop} = \@accessoryloop; @@ -648,9 +657,11 @@ sub www_view { .moveDownIcon('func=moveRelatedDown&wid='.$_[0]->get("wobjectId").'&rid='.$data{relatedWobjectId}); } $segment .= '·'.$data{title}.'
    '; - push(@relatedloop,{URL=>WebGUI::URL::gateway($data{urlizedTitle}),title=>$data{title}, - specification=>''.$data{title}.'', - controls=>$segment}); + push(@relatedloop,{ + "relatedproduct.URL"=>WebGUI::URL::gateway($data{urlizedTitle}), + "relatedproduct.title"=>$data{title}, + "relatedproduct.controls"=>$segment + }); } $sth->finish; $var{relatedproduct_loop} = \@relatedloop;