From 79a10f5b87f1b1a1322f370054c4c860c657acc8 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 1 Jul 2003 01:12:10 +0000 Subject: [PATCH] roottab allows a root starting point --- lib/WebGUI/Macro/RootTab.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Macro/RootTab.pm b/lib/WebGUI/Macro/RootTab.pm index 228b509bc..0e3b638c5 100644 --- a/lib/WebGUI/Macro/RootTab.pm +++ b/lib/WebGUI/Macro/RootTab.pm @@ -11,6 +11,7 @@ package WebGUI::Macro::RootTab; #------------------------------------------------------------------- use strict; +use WebGUI::Macro; use WebGUI::Navigation; use WebGUI::Session; use WebGUI::SQL; @@ -39,7 +40,7 @@ sub _draw { #------------------------------------------------------------------- sub _findRoot { my ($pageId,$parentId) = WebGUI::SQL->quickArray("select pageId,parentId from page where pageId=$_[0]"); - if ($parentId == 0) { + if ($parentId == $_[1]) { return $pageId; } else { return _findRoot($parentId); @@ -49,8 +50,9 @@ sub _findRoot { #------------------------------------------------------------------- sub process { - my $root = _findRoot($session{page}{pageId}); - my $tree = WebGUI::Navigation::tree(0,1); + my @param = WebGUI::Macro::getParams($_[0]); + my $root = _findRoot($session{page}{pageId},$param[0]); + my $tree = WebGUI::Navigation::tree($param[0],1); return _draw($tree,$root); }