From 157d631d6777c4a18217916839aa8167ae0401c8 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 17 Apr 2006 21:27:07 +0000 Subject: [PATCH] adding page.hasViewableChildren variable --- lib/WebGUI/Asset/Wobject/Navigation.pm | 3 +++ lib/WebGUI/i18n/English/Asset_Navigation.pm | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index f81090a60..2052c359d 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -366,6 +366,7 @@ sub view { my $lineageToSkip = "noskip"; my $absoluteDepthOfLastPage; my %lastChildren; + my $previousPageData = undef; foreach my $asset (@{$assets}) { # skip pages we shouldn't see my $pageLineage = $asset->get("lineage"); @@ -450,7 +451,9 @@ sub view { $pageData->{"page.isRankedFirst"} = 1 unless exists $lastChildren{$parent->getId}; $lastChildren{$parent->getId} = $asset->getId; } + $previousPageData->{"page.hasViewableChildren"} = ($previousPageData->{"page.assetId"} eq $pageData->{"page.parentId"}); push(@{$var->{page_loop}}, $pageData); + $previousPageData = $pageData; } my $counter; for($counter=0 ; $counter < scalar( @{$var->{page_loop}} ) ; $counter++) { diff --git a/lib/WebGUI/i18n/English/Asset_Navigation.pm b/lib/WebGUI/i18n/English/Asset_Navigation.pm index 7e88a9e18..a146e8bdc 100644 --- a/lib/WebGUI/i18n/English/Asset_Navigation.pm +++ b/lib/WebGUI/i18n/English/Asset_Navigation.pm @@ -264,12 +264,13 @@ a Google sitemap of your site.

page.isSibling
A conditional indicating whether this page is the sister of the base page.

page.inBranch
A conditional that is the logical OR of isAncestor, isSister, isBasepage and isDescendent.

page.hasChild
A conditional indicating whether this page has a daughter. In other words, it evaluates to true if this page is a mother.

+

page.hasViewableChildren
A conditional indicating whether this page has a viewable child.

page.depthIs1 , page.depthIs2 , page.depthIs3 , page.depthIs4 , page.depthIsN
A conditional indicating whether the depth of this page is N. This variable is useful if you want to style a certain level.

<tmpl_if page.depthIs1>
   <img src="level1.gif">
<tmpl_else>
   <img src="defaultBullet.gif">
</tmpl_if>

page.relativeDepthIs1 , page.relativeDepthIs2 , page.relativeDepthIs3 , page.relativeDepthIsN
A conditional indicating whether the depth of this page is N, relative to the starting page.

page.depthDiff
The difference in depth between the previous page and this page, parent.absDepth - page.absDepth, although parent.absDepth is not a template variable.

page.depthDiffIs1, page.depthDiffIs2, page.depthDiffIs3, page.depthDiffIsN
True if the page.depthDiff variable is N. N can be positive or negative.

-

page.depthDiff_loop
A loop that runs page.depthDiff times, if page.depthDiff > 0. This loop contains no loop variables.

+

page.depthDiff_loop
A loop that runs page.depthDiff times, if page.depthDiff > 0. This loop contains no loop variables.

page.isRankedFirst
This property is true if this page is the first within this level. ie. has no left sister.

page.isRankedLast
This property is true if this page is the last within this level. ie. has no right sister.

page.parent.*
These variables will be undefined if the page is a root.