fixed article
This commit is contained in:
parent
8e79f008c7
commit
9449f5af0b
3 changed files with 6 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue