removed all the old nav macros

This commit is contained in:
JT Smith 2004-02-28 19:27:59 +00:00
parent 2b82d714ea
commit 314d8daacb
22 changed files with 63 additions and 913 deletions

View file

@ -1,51 +0,0 @@
package WebGUI::Macro::C_crumbTrail;
#-------------------------------------------------------------------
# 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 Tie::CPHash;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
#-------------------------------------------------------------------
sub _recurseCrumbTrail {
my ($sth, %data, $output);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select pageId,parentId,menuTitle,urlizedTitle from page where pageId=$_[0]");
if ($data{pageId} > 1) {
$output .= _recurseCrumbTrail($data{parentId},$_[1]);
}
if ($data{menuTitle} ne "") {
$output .= '<a class="crumbTrail" href="'.WebGUI::URL::gateway($data{urlizedTitle})
.'">'.$data{menuTitle}.'</a>'.$_[1];
}
return $output;
}
#-------------------------------------------------------------------
sub process {
my (@param, $temp, $delimeter);
@param = WebGUI::Macro::getParams($_[0]);
if ($param[0] eq "") {
$delimeter = " &gt; ";
} else {
$delimeter = " ".$param[0]." ";
}
$temp = '<span class="crumbTrail">'._recurseCrumbTrail($session{page}{parentId},$delimeter).
'<a class="crumbTrail" href="'.WebGUI::URL::page().'">'.$session{page}{menuTitle}.'</a></span>';
return $temp;
}
1;

View file

@ -1,59 +0,0 @@
package WebGUI::Macro::FlexMenu;
#-------------------------------------------------------------------
# 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::Privilege;
use WebGUI::Session;
use WebGUI::URL;
#-------------------------------------------------------------------
sub process {
my ($temp, @param);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<span class="verticalMenu">';
$temp .= _reversePageTree($session{page}{pageId});
$temp .= '</span>';
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 .= '<a class="verticalMenu" ';
$output .= ' target="_blank"' if ($data[5]);
$output .= 'href="'.WebGUI::URL::gateway($data[3]).'">';
if ($session{page}{pageId} == $data[0]) {
$output .= '<span class="selectedMenuItem">'.$data[2].'</span>';
} else {
$output .= $data[2];
}
$output .= '</a><br>';
if ($_[1] == $data[0] && $_[2] ne "") {
$output .= '<table cellpadding=0 cellspacing=0 border=0 class="verticalMenu"><tr><td class="verticalMenu">&nbsp;&nbsp;&nbsp;</td><td class="verticalMenu">'.$_[2].'</td></tr></table>';
}
}
}
$sth->finish;
if ($parentId > 0) {
$output = _reversePageTree($parentId,$_[0],$output);
}
return $output;
}
1;

View file

@ -1,35 +0,0 @@
package WebGUI::Macro::M_currentMenuVertical;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($tree, $temp, @param);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<div class="verticalMenu">';
if ($param[0] ne "") {
$tree = WebGUI::Navigation::tree($session{page}{pageId},$param[0]);
} else {
$tree = WebGUI::Navigation::tree($session{page}{pageId},1);
}
$temp .= WebGUI::Navigation::drawVertical($tree);
$temp .= '</div>';
return $temp;
}
1;

View file

@ -1,35 +0,0 @@
package WebGUI::Macro::P_previousMenuVertical;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($temp, @param, $tree);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<span class="verticalMenu">';
if ($param[0] ne "") {
$tree = WebGUI::Navigation::tree($session{page}{parentId},$param[0]);
} else {
$tree = WebGUI::Navigation::tree($session{page}{parentId},1);
}
$temp .= WebGUI::Navigation::drawVertical($tree);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,64 +0,0 @@
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 .= "&nbsp;&nbsp;";
}
foreach $pageId (keys %{$tree}) {
$output .= '<option value="'.$tree->{$pageId}{url}.'">';
$output .= $padding."- ".$tree->{$pageId}{title};
$output .= '</option>';
$output .= _draw($tree->{$pageId}{sub}, ($indent+1), $maxDepth, ($currentDepth+1));
}
}
return $output;
}
#-------------------------------------------------------------------
sub process {
my ($temp, @param, $tree);
@param = WebGUI::Macro::getParams($_[0]);
$param[1] = 99 unless ($param[1]);
if ($param[0] ne "") {
$tree = WebGUI::Navigation::tree($session{page}{parentId},$param[0]);
} else {
$tree = WebGUI::Navigation::tree($session{page}{parentId},1);
}
$temp = '<script language="JavaScript" type="text/javascript">
function go(formObj){
if (formObj.chooser.options[formObj.chooser.selectedIndex].value != "none") {
location = formObj.chooser.options[formObj.chooser.selectedIndex].value
}
}
</script>';
$temp .= '<form><select name="chooser" size=1 onChange="go(this.form)">';
$temp .= '<option value=none>Where do you want to go?';
$temp .= _draw($tree,0,$param[1]);
$temp .= '</select></form>';
return $temp;
}
1;

View file

@ -1,61 +0,0 @@
package WebGUI::Macro::RootTab;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 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 ($tree, $root) = @_;
#my $output;# = '<table class="rootTab"><tr>';
my $output;# = '<div class="rootTabs">';
foreach my $key (keys %{$tree}) {
$output .= ' <span class="';
if ($root == $key) {
$output .= "rootTabOn";
} else {
$output .= "rootTabOff";
}
$output .= '">';
$output .= '<a href="'.$tree->{$key}{url}.'">'.$tree->{$key}{title}.'</a>';
$output .= '</span> ';
}
#$output .= '</div>';
#$output .= '</tr></table>';
return $output;
}
#-------------------------------------------------------------------
sub _findRoot {
my ($pageId,$parentId) = WebGUI::SQL->quickArray("select pageId,parentId from page where pageId=$_[0]");
if ($parentId == $_[1]) {
return $pageId;
} else {
return _findRoot($parentId);
}
}
#-------------------------------------------------------------------
sub process {
my @param = WebGUI::Macro::getParams($_[0]);
my $root = _findRoot($session{page}{pageId},$param[0]);
my $tree = WebGUI::Navigation::tree($param[0],1);
return _draw($tree,$root);
}
1;

View file

@ -1,39 +0,0 @@
package WebGUI::Macro::S_specificMenuVertical;
#-------------------------------------------------------------------
# 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 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) {
$temp = '<span class="verticalMenu">';
if ($param[1] ne "") {
$tree = WebGUI::Navigation::tree($pageId,$param[1]);
} else {
$tree = WebGUI::Navigation::tree($pageId,1);
}
$temp .= WebGUI::Navigation::drawVertical($tree);
$temp .= '</span>';
}
return $temp;
}
1;

View file

@ -1,69 +0,0 @@
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 .= "&nbsp;&nbsp;";
}
foreach $pageId (keys %{$tree}) {
$output .= '<option value="'.$tree->{$pageId}{url}.'">';
$output .= $padding."- ".$tree->{$pageId}{title};
$output .= '</option>';
$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 = '<script language="JavaScript" type="text/javascript">
function go(formObj){
if (formObj.chooser.options[formObj.chooser.selectedIndex].value != "none") {
location = formObj.chooser.options[formObj.chooser.selectedIndex].value
}
}
</script>';
$temp .= '<form><select name="chooser" size=1 onChange="go(this.form)">';
$temp .= '<option value=none>Where do you want to go?';
$temp .= _draw($tree,0,$param[2]);
$temp .= '</select></form>';
} else {
$temp = "No page specified.";
}
return $temp;
}
1;

View file

@ -1,64 +0,0 @@
package WebGUI::Macro::Synopsis;
#-------------------------------------------------------------------
# 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::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
#-------------------------------------------------------------------
sub traversePageTreeSynopsis {
my ($sth, $output, $parent_id, $current_level, $max_level);
($parent_id, $current_level, $max_level) = @_;
$max_level = 99 unless ($max_level);
if ($max_level && ($current_level >= $max_level)) {
return;
}
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, pageId, synopsis from page where parentId='$parent_id' order by sequenceNumber");
while (my ($urltitle, $menutitle, $pageid, $synopsis) = $sth->array) {
if (!WebGUI::Privilege::canViewPage($pageid)) {
next;
}
$urltitle = WebGUI::URL::gateway($urltitle);
my $subsynopsis = traversePageTreeSynopsis($pageid,$current_level+1,$max_level);
$output .= qq{
<div class="synopsis">
<div class="synopsis_title">
<a href="$urltitle">$menutitle</a>
</div>
<div class="synopsis_summary">
$synopsis
</div>
<div class="synopsis_sub">
$subsynopsis
</div>
</div>
};
}
$sth->finish;
return $output;
}
#-------------------------------------------------------------------
sub process {
if ($_[0]) {
return traversePageTreeSynopsis($session{page}{pageId},0,$_[0]);
} else {
return $session{page}{synopsis};
}
}
1;

View file

@ -1,34 +0,0 @@
package WebGUI::Macro::T_topMenuVertical;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($temp, @param, $tree);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<span class="verticalMenu">';
if ($param[0] ne "") {
$tree = WebGUI::Navigation::tree(1,$param[0]);
} else {
$tree = WebGUI::Navigation::tree(1,1);
}
$temp .= WebGUI::Navigation::drawVertical($tree);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,40 +0,0 @@
package WebGUI::Macro::TopDropMenu;
#-------------------------------------------------------------------
# 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::Navigation;
use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($temp, $tree, $pageId);
$tree = WebGUI::Navigation::tree(1,1);
$temp = '<script language="JavaScript" type="text/javascript">
function go(formObj){
if (formObj.chooser.options[formObj.chooser.selectedIndex].value != "none") {
location = formObj.chooser.options[formObj.chooser.selectedIndex].value
}
}
</script>';
$temp .= '<form><select name="chooser" size=1 onChange="go(this.form)">';
$temp .= '<option value=none>Where do you want to go?';
foreach $pageId (keys %{$tree}) {
$temp .= '<option value="'.$tree->{$pageId}{url}.'">'.$tree->{$pageId}{title};
}
$temp .= '</select></form>';
return $temp;
}
1;

View file

@ -1,31 +0,0 @@
package WebGUI::Macro::m_currentMenuHorizontal;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($temp, @param, $tree);
@param = WebGUI::Macro::getParams($_[0]);
$tree = WebGUI::Navigation::tree($session{page}{pageId},1);
$temp = '<span class="horizontalMenu">';
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[0]);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,32 +0,0 @@
package WebGUI::Macro::p_previousMenuHorizontal;
#-------------------------------------------------------------------
# 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 process {
my ($temp, $tree, @param);
@param = WebGUI::Macro::getParams($_[0]);
$tree = WebGUI::Navigation::tree($session{page}{parentId},1);
$temp = '<span class="horizontalMenu">';
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[0]);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,30 +0,0 @@
package WebGUI::Macro::rootmenuHorizontal;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my @param = WebGUI::Macro::getParams($_[0]);
my $tree = WebGUI::Navigation::tree(0,1);
my $temp = '<span class="horizontalMenu">';
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[0]);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,32 +0,0 @@
package WebGUI::Macro::s_specificMenuHorizontal;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($temp, $tree, $parentId, @param);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<span class="horizontalMenu">';
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$param[0]'");
$tree = WebGUI::Navigation::tree($parentId,1);
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[1]);
$temp .= '</span>';
return $temp;
}
1;

View file

@ -1,41 +0,0 @@
package WebGUI::Macro::t_topMenuHorizontal;
#-------------------------------------------------------------------
# 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;
#-------------------------------------------------------------------
sub process {
my ($temp, $tree, @param);
@param = WebGUI::Macro::getParams($_[0]);
my $root = _findRoot($session{page}{pageId});
$tree = WebGUI::Navigation::tree($root,1);
$temp = '<span class="horizontalMenu">';
$temp .= WebGUI::Navigation::drawHorizontal($tree,$param[0]);
$temp .= '</span>';
return $temp;
}
sub _findRoot {
my ($pageId,$parentId) = WebGUI::SQL->quickArray("select pageId,parentId from page where pageId=$_[0]");
if ($parentId == $_[1]) {
return $pageId;
} else {
return _findRoot($parentId);
}
}
1;