WebGUI 2.4.0 release

This commit is contained in:
JT Smith 2001-11-20 03:49:00 +00:00
parent 2a61818564
commit 6286f9bfaf
74 changed files with 2332 additions and 548 deletions

View file

@ -17,7 +17,10 @@ use WebGUI::Session;
sub process {
my ($output);
$output = $_[0];
#---username---
while ($output =~ /\^\@(.*?)\;/) {
$output =~ s/\^\@(.*?)\;/$session{user}{username}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^\@/) {
$output =~ s/\^\@/$session{user}{username}/g;
}

View file

@ -17,7 +17,10 @@ use WebGUI::Session;
sub process {
my ($output);
$output = $_[0];
#---page url---
while ($output =~ /\^\\(.*?)\;/) {
$output =~ s/\^\\(.*?)\;/$session{page}{url}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^\\/) {
$output =~ s/\^\\/$session{page}{url}/g;
}

View file

@ -35,7 +35,11 @@ sub _recurseCrumbTrail {
sub process {
my ($output, $temp);
$output = $_[0];
#---crumb trail---
while ($output =~ /\^C(.*?)\;/) {
$temp = '<span class="crumbTrail">'._recurseCrumbTrail($session{page}{parentId}).'<a href="'.$session{page}{url}.'">'.$session{page}{title}.'</a></span>';
$output =~ s/\^C(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^C/) {
$temp = '<span class="crumbTrail">'._recurseCrumbTrail($session{page}{parentId}).'<a href="'.$session{page}{url}.'">'.$session{page}{title}.'</a></span>';
$output =~ s/\^C/$temp/g;

View file

@ -1,27 +0,0 @@
package WebGUI::Macro::Carat_carat;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
#-------------------------------------------------------------------
# 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;
sub process {
my ($output);
$output = $_[0];
#---carrot ^---
if ($output =~ /\^\^/) {
$output =~ s/\^\^/\^/g;
}
return $output;
}
1;

View file

@ -12,12 +12,22 @@ package WebGUI::Macro::D_date;
use strict;
use WebGUI::DateTime;
use WebGUI::Macro;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---date---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^D(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
if ($param[0] ne "") {
$temp = epochToHuman(time(),$param[0]);
} else {
$temp = localtime(time());
}
$output =~ s/\^D(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^D(.*)\^\/D/) {
$temp = epochToHuman(time(),$1);
$output =~ s/\^D(.*)\^\/D/$temp/g;

View file

@ -12,13 +12,25 @@ package WebGUI::Macro::H_homeLink;
use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---home link---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^H(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = '<a class="homeLink" href="'.$session{env}{SCRIPT_NAME}.'/home">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(47);
}
$temp .= '</a>';
$output =~ s/\^H(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^H(.*)\^\/H/) {
$temp = '<a class="homeLink" href="'.$session{env}{SCRIPT_NAME}.'/home">'.$1.'</a>';
$output =~ s/\^H(.*)\^\/H/$temp/g;

View file

@ -16,8 +16,11 @@ use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($output);
#---uid---
$output = $_[0];
while ($output =~ /\^\#(.*?)\;/) {
$output =~ s/\^\#(.*?)\;/$session{user}{userId}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^\#/) {
$output =~ s/\^\#/$session{user}{userId}/g;
}

View file

@ -20,7 +20,30 @@ use WebGUI::Session;
sub process {
my ($output, $temp);
$output = $_[0];
#---login box---
while ($output =~ /\^L(.*?)\;/) {
$temp = '<div class="loginBox">';
if ($session{var}{sessionId}) {
$temp .= WebGUI::International::get(48);
$temp .= ' <a href="'.$session{page}{url}.'?op=displayAccount">'.$session{user}{username}.'</a>. ';
$temp .= WebGUI::International::get(49);
$temp = WebGUI::Macro::Backslash_pageUrl::process($temp);
} else {
$temp .= '<form method="post" action="'.$session{page}{url}.'"> ';
$temp .= WebGUI::Form::hidden("op","login").'<span class="formSubtext">';
$temp .= WebGUI::International::get(50);
$temp .= '<br></span>';
$temp .= WebGUI::Form::text("username",12,30).'<span class="formSubtext"><br>';
$temp .= WebGUI::International::get(51);
$temp .= '<br></span>';
$temp .= WebGUI::Form::password("identifier",12,30).'<span class="formSubtext"><br></span>';
$temp .= WebGUI::Form::submit(WebGUI::International::get(52));
$temp .= '</form>';
$temp .= '<a href="'.$session{page}{url}.'?op=createAccount">Click here to register.</a>';
}
$temp .= '</div>';
$output =~ s/\^L(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^L/) {
$temp = '<div class="loginBox">';
if ($session{var}{sessionId}) {

View file

@ -11,14 +11,26 @@ package WebGUI::Macro::M_currentMenuVertical;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Macro::Shared;
use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---current menu vertical---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^M(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = '<span class="verticalMenu">';
if ($param[0] ne "") {
$temp .= traversePageTree($session{page}{pageId},0,$param[0]);
} else {
$temp .= traversePageTree($session{page}{pageId},0,1);
}
$temp .= '</span>';
$output =~ s/\^M(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^M(.*)\^\/M/) {
$temp = '<span class="verticalMenu">';
$temp .= traversePageTree($session{page}{pageId},0,$1);

View file

@ -11,14 +11,26 @@ package WebGUI::Macro::P_previousMenuVertical;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Macro::Shared;
use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---previous menu vertical---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^P(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = '<span class="verticalMenu">';
if ($param[0] ne "") {
$temp .= traversePageTree($session{page}{parentId},0,$param[0]);
} else {
$temp .= traversePageTree($session{page}{parentId},0,1);
}
$temp .= '</span>';
$output =~ s/\^P(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^P(.*)\^\/P/) {
$temp = '<span class="verticalMenu">';
$temp .= traversePageTree($session{page}{parentId},0,$1);

View file

@ -11,6 +11,7 @@ package WebGUI::Macro::S_specificMenuVertical;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Macro::Shared;
use WebGUI::Privilege;
use WebGUI::Session;
@ -18,9 +19,23 @@ use WebGUI::SQL;
#-------------------------------------------------------------------
sub process {
my ($output, $temp, $pageTitle, $depth, @data);
$output = $_[0];
#---any page sub menu vertical---
my ($output, $temp, @param, @data);
$output = $_[0];
while ($output =~ /\^S(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
if ($param[1] eq "") {
$param[1] = 0;
}
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$param[0]'",$session{dbh});
$temp = '<span class="verticalMenu">';
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
$temp .= traversePageTree($data[0],1,$param[1]);
}
$temp .= '</span>';
$output =~ s/\^S(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
my ($pageTitle, $depth);
if ($output =~ /\^S(.*)\^\/S/) {
($pageTitle,$depth) = split(/,/,$1);
if ($depth eq "") {
@ -29,7 +44,6 @@ sub process {
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$pageTitle'",$session{dbh});
$temp = '<span class="verticalMenu">';
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
#$temp .= '<a href="'.$session{env}{SCRIPT_URL}.'/'.$data[2].'">'.$data[1].'</a><br>';
$temp .= traversePageTree($data[0],1,$depth);
}
$temp .= '</span>';

View file

@ -11,13 +11,23 @@ package WebGUI::Macro::Splat_random;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---random number---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^\*(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
if ($param[0] ne "") {
$temp = round(rand()*$1);
} else {
$temp = round(rand()*1000000000);
}
$output =~ s/\^\*(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^\*(.*)\^\/\*/) {
$temp = round(rand()*$1);
$output =~ s/\^\*(.*)\^\/\*/$temp/g;

View file

@ -11,13 +11,25 @@ package WebGUI::Macro::T_topMenuVertical;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Macro::Shared;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---top menu vertical---
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^T(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = '<span class="verticalMenu">';
if ($param[0] ne "") {
$temp .= traversePageTree(1,0,$param[0]);
} else {
$temp .= traversePageTree(1,0,1);
}
$temp .= '</span>';
$output =~ s/\^T(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^T(.*)\^\/T/) {
$temp = '<span class="verticalMenu">';
$temp .= traversePageTree(1,0,$1);

View file

@ -12,13 +12,25 @@ package WebGUI::Macro::a_account;
use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
my ($output, $temp, @param);
$output = $_[0];
#---account link---
while ($output =~ /\^a(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = '<a class="myAccountLink" href="'.$session{page}{url}.'?op=displayAccount">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(46);
}
$temp .= '</a>';
$output =~ s/\^a(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^a(.*)\^\/a/) {
$temp = '<a class="myAccountLink" href="'.$session{page}{url}.'?op=displayAccount">'.$1.'</a>';
$output =~ s/\^a(.*)\^\/a/$temp/g;

View file

@ -17,7 +17,10 @@ use WebGUI::Session;
sub process {
my ($output);
$output = $_[0];
#---company name---
while ($output =~ /\^c(.*?)\;/) {
$output =~ s/\^c(.*?)\;/$session{setting}{companyName}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^c/) {
$output =~ s/\^c/$session{setting}{companyName}/g;
}

View file

@ -17,7 +17,10 @@ use WebGUI::Session;
sub process {
my ($output);
$output = $_[0];
#---company email---
while ($output =~ /\^e(.*?)\;/) {
$output =~ s/\^e(.*?)\;/$session{setting}{companyEmail}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^e/) {
$output =~ s/\^e/$session{setting}{companyEmail}/g;
}

View file

@ -19,7 +19,25 @@ use WebGUI::SQL;
sub process {
my ($output, $temp, @data, $sth, $first);
$output = $_[0];
#---current menu horizontal ---
while ($output =~ /\^m(.*?)\;/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber",$session{dbh});
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
$first = 0;
} else {
$temp .= " &middot; ";
}
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
}
}
$sth->finish;
$temp .= '</span>';
$output =~ s/\^m(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^m/) {
$temp = '<span class="horizontalMenu">';
$first = 1;

View file

@ -11,6 +11,7 @@ package WebGUI::Macro::p_previousMenuHorizontal;
#-------------------------------------------------------------------
use strict;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
@ -19,7 +20,25 @@ use WebGUI::SQL;
sub process {
my ($output, $temp, @data, $sth, $first);
$output = $_[0];
#---previous menu horizontal ---
while ($output =~ /\^p(.*?)\;/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber",$session{dbh});
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
$first = 0;
} else {
$temp .= " &middot; ";
}
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
}
}
$sth->finish;
$temp .= '</span>';
$output =~ s/\^p(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^p/) {
$temp = '<span class="horizontalMenu">';
$first = 1;

View file

@ -12,30 +12,34 @@ package WebGUI::Macro::r_printable;
use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
#---remove style for printing link---
if ($output =~ /\^r(.*)\^\/r/) {
$temp = $session{env}{REQUEST_URI};
if ($temp =~ /\?/) {
$temp .= '&makePrintable=1';
my ($output, $temp, @param);
$output = $_[0];
while ($output =~ /\^r(.*?)\;/) {
@param = WebGUI::Macro::getParams($1);
$temp = appendToUrl($session{env}{REQUEST_URI},'makePrintable=1');
$temp = '<a class="makePrintableLink" href="'.$temp.'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= '?makePrintable=1';
$temp .= WebGUI::International::get(53);
}
$temp = '<a class="makePrintable" href="'.$temp.'">'.$1.'</a>';
$temp .= '</a>';
$output =~ s/\^r(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^r(.*)\^\/r/) {
$temp = appendToUrl($session{env}{REQUEST_URI},'makePrintable=1');
$temp = '<a class="makePrintableLink" href="'.$temp.'">'.$1.'</a>';
$output =~ s/\^r(.*)\^\/r/$temp/g;
} elsif ($output =~ /\^r/) {
$temp = $session{env}{REQUEST_URI};
if ($temp =~ /\?/) {
$temp .= '&makePrintable=1';
} else {
$temp .= '?makePrintable=1';
}
$temp = '<a class="makePrintable" href="'.$temp.'">';
$temp = appendToUrl($session{env}{REQUEST_URI},'makePrintable=1');
$temp = '<a class="makePrintableLink" href="'.$temp.'">';
$temp .= WebGUI::International::get(53);
$temp .= '</a>';
$output =~ s/\^r/$temp/g;

View file

@ -20,7 +20,27 @@ use WebGUI::SQL;
sub process {
my ($output, $temp, @data, $pageTitle, $parentId, $sth, $first);
$output = $_[0];
#---any page sub menu vertical---
while ($output =~ /\^s(.*?)\;/) {
$pageTitle = $1;
$temp = '<span class="horizontalMenu">';
$first = 1;
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber",$session{dbh});
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
$first = 0;
} else {
$temp .= " &middot; ";
}
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
}
}
$sth->finish;
$temp .= '</span>';
$output =~ s/\^s(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^s(.*)\^\/s/) {
$pageTitle = $1;
$temp = '<span class="horizontalMenu">';

View file

@ -19,7 +19,25 @@ use WebGUI::SQL;
sub process {
my ($output, $temp, @data, $sth, $first);
$output = $_[0];
#---top menu horizontal---
while ($output =~ /\^t(.*?)\;/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber",$session{dbh});
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
$first = 0;
} else {
$temp .= " &middot; ";
}
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
}
}
$sth->finish;
$temp .= '</span>';
$output =~ s/\^t(.*?)\;/$temp/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^t/) {
$temp = '<span class="horizontalMenu">';
$first = 1;

View file

@ -17,7 +17,10 @@ use WebGUI::Session;
sub process {
my ($output, $temp, @data, $sth, $first);
$output = $_[0];
#---company URL---
while ($output =~ /\^u(.*?)\;/) {
$output =~ s/\^u(.*?)\;/$session{setting}{companyURL}/;
}
#---everything below this line will go away in a later rev.
if ($output =~ /\^u/) {
$output =~ s/\^u/$session{setting}{companyURL}/g;
}