From 03f8af0961707e01f0957bab9ded309661407ca3 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 12 Aug 2002 01:19:16 +0000 Subject: [PATCH] Redirect option added to pages. --- docs/upgrades/upgrade_4.4.1-4.5.0.sql | 3 ++- lib/WebGUI.pm | 2 ++ lib/WebGUI/HTMLForm.pm | 2 +- lib/WebGUI/Operation/Package.pm | 6 ++++-- lib/WebGUI/Operation/Page.pm | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/upgrades/upgrade_4.4.1-4.5.0.sql b/docs/upgrades/upgrade_4.4.1-4.5.0.sql index 0be72765f..55aa454ca 100644 --- a/docs/upgrades/upgrade_4.4.1-4.5.0.sql +++ b/docs/upgrades/upgrade_4.4.1-4.5.0.sql @@ -62,7 +62,8 @@ INSERT INTO Product_template VALUES (1,'Default','\r\n\r\n^Product_Image1;\r\n\r\n\r\n \r\n \r\n\r\n
^Product_Description;

\r\n Benefits
\r\n^Product_Benefits;\r\n

\r\n^Product_Thumbnail2;

\r\nSpecifications
\r\n^Product_Specifications;

\r\nOptions
\r\n^Product_Accessories;

\r\nOther Products
\r\n^Product_Related;

\r\n

\r\n\r\n'); INSERT INTO Product_template VALUES (3,'Three Columns','\r\n^Product_Description;

\r\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n
^Product_Thumbnail1;^Product_Thumbnail2;^Product_Thumbnail3;
\r\n\r\n\r\n \r\n \r\n \r\n\r\n
\r\nFeatures
^Product_Features;

\r\nBenefits
^Product_Benefits;

\r\n

\r\nSpecifications
^Product_Specifications;

\r\nAccessories
^Product_Accessories;

\r\nRelated Products
^Product_Related;

\r\n

\r\n Price: ^Product_Price;
\r\n Product Number: ^Product_Number;

\r\n ^Product_Brochure;
\r\n ^Product_Manual;
\r\n ^Product_Warranty;
\r\n

\r\n\r\n'); INSERT INTO Product_template VALUES (4,'Left Column Collateral','\r\n\r\n\r\n
\r\n
\r\n^Product_Brochure;
\r\n^Product_Manual;
\r\n^Product_Warranty;
\r\n
\r\n
\r\n^Product_Thumbnail1;

\r\n^Product_Thumbnail2;

\r\n^Product_Thumbnail3;

\r\n

\r\n
\r\n^Product_Description;

\r\nSpecs:
\r\n^Product_Specifications;

\r\nFeatures:
\r\n^Product_Features;

\r\nOptions:
\r\n^Product_Accessories;

\r\n

'); - +alter table page add column redirectURL text; +insert into international values (715,'WebGUI',1,'Redirect URL'); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index f14ceba10..56acc3f10 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -86,6 +86,8 @@ sub page { } elsif ($wobjectOutput ne "") { $contentHash{0} = $wobjectOutput; $content = WebGUI::Template::generate(\%contentHash,1); + } elsif ($session{page}{redirectURL}) { + $session{header}{redirect} = WebGUI::Session::httpRedirect($session{page}{redirectURL}) } else { if (WebGUI::Privilege::canViewPage()) { if ($session{var}{adminOn}) { diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index 99afedf84..e0bab6dc4 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -1306,7 +1306,7 @@ sub url { $subtext = shift; $size = shift || $session{setting}{textBoxSize} || 30; $output = ''; $output .= ''; diff --git a/lib/WebGUI/Operation/Package.pm b/lib/WebGUI/Operation/Package.pm index 006cf837b..4420f03b1 100644 --- a/lib/WebGUI/Operation/Package.pm +++ b/lib/WebGUI/Operation/Package.pm @@ -71,7 +71,8 @@ sub _recursePageTree { synopsis, templateId, startDate, - endDate + endDate, + redirectURL ) values ( $newPageId, $_[1], @@ -93,7 +94,8 @@ sub _recursePageTree { ".quote($package{synopsis}).", ".quote($package{templateId}).", $newParent{startDate}, - $newParent{endDate} + $newParent{endDate}, + $newParent{redirectURL} )"); _recursePageTree($package{pageId},$newPageId); } diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index 377e4f065..fc5f05538 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -171,6 +171,7 @@ sub www_editPage { $f->text("title",WebGUI::International::get(99),$page{title}); $f->text("menuTitle",WebGUI::International::get(411),$page{menuTitle}); $f->text("urlizedTitle",WebGUI::International::get(104),$page{urlizedTitle}); + $f->url("redirectURL",WebGUI::International::get(715),$page{redirectURL}); $f->readOnly(WebGUI::Template::selectTemplate($page{templateId}),WebGUI::International::get(356)); $f->textarea("synopsis",WebGUI::International::get(412),$page{synopsis}); $f->textarea("metaTags",WebGUI::International::get(100),$page{metaTags}); @@ -242,6 +243,7 @@ sub www_editPageSave { endDate=$session{form}{endDate}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$session{form}{urlizedTitle}', + redirectURL='$session{form}{redirectURL}', defaultMetaTags='$session{form}{defaultMetaTags}', templateId='$session{form}{templateId}', menuTitle=".quote($session{form}{menuTitle}).",