From c45f531b0162ea1fa63cf7f840de53a6be57d95e Mon Sep 17 00:00:00 2001 From: Doug Collinge Date: Tue, 7 May 2002 21:24:35 +0000 Subject: [PATCH] Prevent image collision between successive Article widgets when the amount of text is too small to wrap all the way around the entire image. This is done by wrapping the Article in a one-cell table only if the Article contains an image. --- lib/WebGUI/Widget/Article.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Widget/Article.pm b/lib/WebGUI/Widget/Article.pm index 239c290f4..66dd0c3e5 100644 --- a/lib/WebGUI/Widget/Article.pm +++ b/lib/WebGUI/Widget/Article.pm @@ -458,8 +458,12 @@ sub www_view { tie %data, 'Tie::CPHash'; %data = getProperties($namespace,$_[0]); if ($data{startDate}time()) { + $output = ""; + if ($data{image} ne "") { # Images collide on successive articles if there is little text - prevent this. + $output .= '
'; + } if ($data{displayTitle} == 1) { - $output = "

".$data{title}."

"; + $output .= "

".$data{title}."

"; } if ($data{image} ne "") { $image = WebGUI::Attachment->new($data{image},$_[0]); @@ -484,6 +488,9 @@ sub www_view { if ($data{attachment} ne "") { $output .= attachmentBox($data{attachment},$_[0]); } + if ($data{image} ne "") { + $output .= "
"; + } } if ($data{processMacros}) { $output = WebGUI::Macro::process($output); @@ -502,8 +509,5 @@ sub www_view { return $output; } - - - 1;