package WebGUI::Macro::SpecificDropMenu; #------------------------------------------------------------------- # 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, $pageId, $tree); @param = WebGUI::Macro::getParams($_[0]); ($pageId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$param[0]'"); if (defined $pageId) { $param[2] = 99 unless ($param[2]); if ($param[1] ne "") { $tree = WebGUI::Navigation::tree($pageId,$param[1]); } else { $tree = WebGUI::Navigation::tree($pageId,1); } $temp = ''; $temp .= '
'; } else { $temp = "No page specified."; } return $temp; } 1;