package WebGUI::Macro::ULFlexMenu; # By Dan Collis Puro, dpuro@mindspring.com # This is just like a FlexMenu, the only difference is that it uses # embedded lists to recreate the hierarchy. The # great thing about this is that these lists will take care of # indenting for you and are VERY browser agnostic. A perfect # fit for a FlexMenu. #Sample CSS entries: # ul.verticalMenu{ # padding-left: 15px; # margin-left: 0px; # width: 100px; # } # This added to your style defs will create an indented list 100px wide # with 15px indentation at each level. use strict; use WebGUI::Macro; use WebGUI::Privilege; use WebGUI::Session; use WebGUI::URL; #------------------------------------------------------------------- sub process { my ($temp, @param); @param = WebGUI::Macro::getParams($_[0]); $temp = ''; return $temp; } #------------------------------------------------------------------- sub _reversePageTree { my ($sth, @data, $output, $parentId); ($parentId) = WebGUI::SQL->quickArray("select parentId from page where pageId='$_[0]'"); $sth = WebGUI::SQL->read("select pageId,parentId,menuTitle,urlizedTitle,hideFromNavigation,newWindow from page where parentId=$_[0] order by sequenceNumber"); while (@data = $sth->array) { if (!($data[4]) && WebGUI::Privilege::canViewPage($data[0])) { $output .= '
  • '; if ($session{page}{pageId} == $data[0]) { $output .= ''.$data[2].''; } else { $output .= $data[2]; } $output .= '
  • '; if ($_[1] == $data[0] && $_[2] ne "") { $output .= ''; } } } $sth->finish; if ($parentId > 0) { $output = _reversePageTree($parentId,$_[0],$output); } return $output; } 1;