fixed article

This commit is contained in:
JT Smith 2004-05-31 17:52:56 +00:00
parent 8e79f008c7
commit 9449f5af0b
3 changed files with 6 additions and 6 deletions

View file

@ -7,7 +7,8 @@
over 100% in CGI mode, 10% in mod_perl mode, and less memory usage in
mod_perl mode.
- Changed the privileges API significantly. See docs/migration.txt for details.
- Fixed a bug in articles where articles with no content would fail to
display their images.
6.0.3

View file

@ -105,7 +105,7 @@ sub _levels {
my $p = WebGUI::Page->getPage;
my @ancestors = reverse $p->ancestors;
if(scalar(@ancestors) == 1) { # I am WebGUI root. I have one ancestor, which
return $p # is nameless root. Return myself
return $p; # is nameless root. Return myself
} elsif(scalar(@ancestors) > 1) { # I am a page under WebGUI root.
return $ancestors[1]; # 1st element of ancestors is WebGUI root
} else {

View file

@ -155,17 +155,16 @@ sub www_view {
$var{"description.first.2sentences"} =~ s/^((.*?\.){2}).*/$1/s;
$var{"description.first.sentence"} = $var{"description.first.2sentences"};
$var{"description.first.sentence"} =~ s/^(.*?\.).*/$1/s;
my $p = WebGUI::Paginator->new(WebGUI::URL::page("wid=".$_[0]->get("wobjectId")."&func=view"),1);
if ($session{form}{makePrintable} || $var{description} eq "") {
$var{description} =~ s/\^\-\;//g;
$var{isFirstPage} = 1;
$var{isLastPage} = 1;
$p->setDataByArrayRef([$var{description}]);
} else {
my @pages = split(/\^\-\;/,$var{description});
my $p = WebGUI::Paginator->new(WebGUI::URL::page("wid=".$_[0]->get("wobjectId")."&func=view"),1);
$p->setDataByArrayRef(\@pages);
$var{description} = $p->getPage;
$p->appendTemplateVars(\%var);
}
$p->appendTemplateVars(\%var);
if ($_[0]->get("attachment") ne "") {
$file = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId"));
$var{"attachment.box"} = $file->box;