Added the new Navigation core component and updated the navigation macros.

This commit is contained in:
JT Smith 2002-08-11 23:44:16 +00:00
parent afcad66b68
commit 1c3094af19
11 changed files with 240 additions and 190 deletions

View file

@ -12,39 +12,16 @@ package WebGUI::Macro::t_topMenuHorizontal;
use strict;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Navigation;
use WebGUI::Session;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub _replacement {
my ($temp, @data, $sth, $first, @param, $delimeter);
my ($temp, $tree, @param);
@param = WebGUI::Macro::getParams($_[0]);
if ($param[0] eq "") {
$delimeter = " · ";
} else {
$delimeter = " ".$param[0]." ";
}
$tree = WebGUI::Navigation::tree(1,1);
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select menuTitle,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
$first = 0;
} else {
$temp .= $delimeter;
}
$temp .= '<a class="horizontalMenu" href="'.WebGUI::URL::gateway($data[1]).'">';
if ($session{page}{pageId} == $data[2]) {
$temp .= '<span class="selectedMenuItem">'.$data[0].'</span>';
} else {
$temp .= $data[0];
}
$temp .= '</a>';
}
}
$sth->finish;
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[0]);
$temp .= '</span>';
return $temp;
}