From 55e164c4e3bdd5a20900a7bc952dfe9230bf0013 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Wed, 18 Aug 2004 20:12:04 +0000 Subject: [PATCH] RFE [ 1004098 ] Additional navigation Template Parameters added. --- docs/changelog/6.x.x.txt | 3 ++- lib/WebGUI/Navigation.pm | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index cd6b1c479..9b3b24d46 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -43,7 +43,7 @@ they were in the past. - BugFix: [ 999799 ] Fixed Package deletion/copy bug in 6.1.1 - BugFix: [ 997885 ] Root move left bug. - - Changed 'lft' and 'rgt' database field names to 'nestedSetLeft' and 'nestedSetRight'. (Martin Kamerbeek) + - Changed 'lft' and 'rgt' database field names to 'nestedSetLeft' and 'nestedSetRight'. (Martin Kamerbeek / Procolix) - Added WebGUI::Session::getScratch(). - bugfix [ 996169 ] message log && uss not working - bugfix [ 1000944 ] WebGUI::MessageLog::addInternationalizedEntry error @@ -57,6 +57,7 @@ Kranendonk) - RFE [ 806332 ] Force SSL, a new page property "Encrypt page" is added. (Len Kranendonk) + - RFE [ 1004098 ] Additional navigation Template Parameters added. (Martin Kamerbeek / Procolix, code thanks to Opentech) 6.1.1 - bugfix [ 991313 ] Manage Translations doesn't work diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index ecf850926..4189df67b 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -307,12 +307,12 @@ sub build { (($page->{'nestedSetLeft'} > $currentPage->get('nestedSetLeft')) && ($page->{'nestedSetRight'} < $currentPage->get('nestedSetRight'))) || (($page->{'nestedSetLeft'} < $currentPage->get('nestedSetLeft')) && ($page->{'nestedSetRight'} > $currentPage->get('nestedSetRight'))); - # Anchestor info + # Anchestor info foreach my $ancestor ($currentPage->ancestors) { $pageData->{"page.isMyAncestor"} += ($ancestor->{'pageId'} == $page->{'pageId'}); } - # Some information about my mother + # Some information about my mother my $mother = WebGUI::Page->getPage($page->{parentId}); if ($page->{parentId} > 0) { foreach (qw(title urlizedTitle parentId pageId)) { @@ -370,7 +370,11 @@ sub build { # Configure button $var->{'config.button'} = $self->_getEditButton(); - + + # Some properties of the page the user's viewing. + $var->{"page.current.hasDaughter"} = ($currentPage->get('nestedSetRight') - $currentPage->get('nestedSetLeft') > 1); + $var->{"page.current.isHome"} = ($currentPage->get('pageId') == 1); + if ($self->{_template}) { return WebGUI::Template::processRaw($self->{_template}, $var); } else {