package WebGUI::Macro::PreviousDropMenu; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2003 Plain Black LLC. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use WebGUI::Macro; use WebGUI::Navigation; use WebGUI::Session; use WebGUI::SQL; #------------------------------------------------------------------- sub _draw { my ($output, $i, $padding, $pageId); my ($tree, $indent, $maxDepth, $currentDepth) = @_; unless ($currentDepth >= $maxDepth) { for ($i=1;$i<=$indent;$i++) { $padding .= "  "; } foreach $pageId (keys %{$tree}) { $output .= ''; $output .= _draw($tree->{$pageId}{sub}, ($indent+1), $maxDepth, ($currentDepth+1)); } } return $output; } #------------------------------------------------------------------- sub process { my ($temp, @param, $tree); @param = WebGUI::Macro::getParams($_[0]); $param[2] = 99 unless ($param[2]); if ($param[0] ne "") { $tree = WebGUI::Navigation::tree($session{page}{parentId},$param[0]); } else { $tree = WebGUI::Navigation::tree($session{page}{parentId},1); } $temp = ''; $temp .= '
'; return $temp; } 1;