WebGUI 0.11.0 release
This commit is contained in:
parent
1b82634d23
commit
f0d80bbfb3
19 changed files with 207 additions and 98 deletions
|
|
@ -28,6 +28,30 @@ sub _recurseCrumbTrail {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _traversePageTree {
|
||||
my ($sth, @data, $output, $depth, $i, $toLevel);
|
||||
if ($_[2] > 0) {
|
||||
$toLevel = $_[2];
|
||||
} else {
|
||||
$toLevel = 99;
|
||||
}
|
||||
for ($i=0;$i<=$_[1];$i++) {
|
||||
$depth .= " ";
|
||||
}
|
||||
if ($_[1] < $toLevel) {
|
||||
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$output .= $depth.'<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a><br>';
|
||||
$output .= _traversePageTree($data[2],$_[1]+1,$_[2]);
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $sth, $first);
|
||||
|
|
@ -38,7 +62,7 @@ sub process {
|
|||
}
|
||||
#---page url---
|
||||
if ($output =~ /\^\//) {
|
||||
$output =~ s/\^\//\$session{env}{SCRIPT_NAME}/g;
|
||||
$output =~ s/\^\//$session{env}{SCRIPT_NAME}/g;
|
||||
}
|
||||
#---username---
|
||||
if ($output =~ /\^\@/) {
|
||||
|
|
@ -46,7 +70,7 @@ sub process {
|
|||
}
|
||||
#---uid---
|
||||
if ($output =~ /\^\#/) {
|
||||
$output =~ s/\^\#/$session{page}{userId}/g;
|
||||
$output =~ s/\^\#/$session{user}{userId}/g;
|
||||
}
|
||||
#---random number---
|
||||
if ($output =~ /\^\*/) {
|
||||
|
|
@ -76,6 +100,21 @@ sub process {
|
|||
if ($output =~ /\^e/) {
|
||||
$output =~ s/\^e/$session{setting}{companyEmail}/g;
|
||||
}
|
||||
#---full menu (vertical)---
|
||||
if ($output =~ /\^f/) {
|
||||
$temp = _traversePageTree(1,0);
|
||||
$output =~ s/\^f/$temp/g;
|
||||
}
|
||||
#---2 level menu (vertical)---
|
||||
if ($output =~ /\^F/) {
|
||||
$temp = _traversePageTree(1,0,2);
|
||||
$output =~ s/\^F/$temp/g;
|
||||
}
|
||||
#---3 level menu (vertical)---
|
||||
if ($output =~ /\^h/) {
|
||||
$temp = _traversePageTree(1,0,3);
|
||||
$output =~ s/\^h/$temp/g;
|
||||
}
|
||||
#---home link---
|
||||
if ($output =~ /\^H/) {
|
||||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">Home</a>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue