From 63b22dc5028507a9507902c874bd0edb8e4fb95c Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 11 Jul 2006 20:08:30 +0000 Subject: [PATCH] - fix: Style Wizard - fix: content-type - fix: Two cookies and incorrect Last-Modified date in HTTP header - fix: HTTP status code 404 broken - fix: Add missing page on Problem With Request - fix: Avatar/photo upload not working - fix: Shortcut with content lock fails (Thanks to Michelle Lamar) --- docs/changelog/7.x.x.txt | 7 +++ lib/WebGUI.pm | 9 ++- lib/WebGUI/Asset/Shortcut.pm | 4 +- lib/WebGUI/Asset/Template.pm | 105 +++++++++++++++++------------------ lib/WebGUI/Session/Http.pm | 5 +- lib/WebGUI/Storage/Image.pm | 2 +- 6 files changed, 73 insertions(+), 59 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 794dc89db..b987b0977 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,13 @@ - fix: Post Subject HTML - fix: Matrix: can't instantiate template - fix: Session id (Martin Kamerbeek / Procolix) + - fix: Style Wizard + - fix: content-type + - fix: Two cookies and incorrect Last-Modified date in HTTP header + - fix: HTTP status code 404 broken + - fix: Add missing page on Problem With Request + - fix: Avatar/photo upload not working + - fix: Shortcut with content lock fails (Thanks to Michelle Lamar) 7.0.0 diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 7279dbc50..71c68f03d 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,5 +1,5 @@ package WebGUI; -our $VERSION = "7.0.0"; +our $VERSION = "7.0.1"; our $STATUS = "stable"; #------------------------------------------------------------------- @@ -371,7 +371,12 @@ sub tryAssetMethod { my $output = eval{$asset->$methodToTry()}; if ($@) { $session->errorHandler->warn("Couldn't call method ".$method." on asset for url: ".$session->url->getRequestedUrl." Root cause: ".$@); - $output = tryAssetMethod($session,$asset,'view') if ($method ne "view"); + if ($method ne "view") { + $output = tryAssetMethod($session,$asset,'view'); + } else { + # fatals return chunked + $output = 'chunked'; + } } return $output; } diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index 28fffb26d..2ff3e01c6 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -467,7 +467,9 @@ sub getShortcutByCriteria { if ($assetId) { $scratchId = "Shortcut_" . $assetId; if($self->session->scratch->get($scratchId) && !$self->getValue("disableContentLock")) { - return $self->session->scratch->get($scratchId) unless ($self->session->var->get("adminOn")); + unless ($self->session->var->get("adminOn") { + return WebGUI::Asset->newByDynamicClass($self->session, $self->session->scratch->get($scratchId)); + } } } diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 09d0d601e..b562791e7 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -452,6 +452,7 @@ sub www_styleWizard { } elsif ($form->get("step") == 3) { my $storageId = $form->get("logo","file"); my $logo; + my $logoContent = ''; if ($storageId) { my $storage = WebGUI::Storage::Image->get($self->session,$storageId); $logo = $self->addChild({ @@ -464,8 +465,48 @@ sub www_styleWizard { templateId=>"PBtmpl0000000000000088" }); $logo->generateThumbnail; + $logoContent = ''; } -my $style = ' + my $customHead = ''; + if ($form->get("layout") eq "1") { + $customHead .= ' + .bodyContent { + background-color: '.$form->get("bodyBackgroundColor","color").'; + color: '.$form->get("bodyForegroundColor","color").'; + width: 70%; + float: left; + } + .menu { + width: 30%; + float: left; + } + .wrapper { + width: 80%; + margin-right: 10%; + margin-left: 10%; + background-color: '.$form->get("menuBackgroundColor","color").'; + } + '; + } else { + $customHead .= ' + .bodyContent { + background-color: '.$form->get("bodyBackgroundColor","color").'; + color: '.$form->get("bodyForegroundColor","color").'; + width: 100%; + } + .menu { + background-color: '.$form->get("menuBackgroundColor","color").'; + width: 100%; + text-align: center; + } + .wrapper { + width: 80%; + margin-right: 10%; + margin-left: 10%; + } + '; + } + my $style = ' ^Page(title); - ^c; @@ -504,44 +545,7 @@ my $style = ' .padding { padding: 5px; } - .bodyContent { - background-color: '.$form->get("bodyBackgroundColor","color").'; - color: '.$form->get("bodyForegroundColor","color").'; - width: 55%; '; -if ($form->get("layout") == 1) { - $style .= ' - float: left; - height: 75%; - margin-right: 10%; - '; -} else { - $style .= ' - width: 80%; - margin-left: 10%; - margin-right: 10%; - '; -} - $style .= ' - } - .menu { - background-color: '.$form->get("menuBackgroundColor","color").'; - width: 25%; '; -if ($form->get("layout") == 1) { - $style .= ' - margin-left: 10%; - height: 75%; - float: left; - '; -} else { - $style .= ' - width: 80%; - text-align: center; - margin-left: 10%; - margin-right: 10%; - '; -} - $style .= ' - } + '.$customHead.' a { color: '.$form->get("linkColor","color").'; } @@ -554,25 +558,20 @@ if ($form->get("layout") == 1) { ^AdminBar;
-'; - if (defined $logo) { - $style .= ''; - } - $style .= ' + '.$logoContent.' '.$form->get("heading").'
-