WebGUI 3.2.0 release

This commit is contained in:
JT Smith 2002-02-11 04:15:00 +00:00
parent 71cd27d3bc
commit cb88a99e52
60 changed files with 1284 additions and 474 deletions

65
lib/WebGUI/URL.pm Normal file
View file

@ -0,0 +1,65 @@
package WebGUI::URL;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 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;
use WebGUI::Session;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub append {
my ($url);
$url = $_[0];
if ($url =~ /\?/) {
$url .= '&'.$_[1];
} else {
$url .= '?'.$_[1];
}
return $url;
}
#-------------------------------------------------------------------
sub gateway {
my ($url);
$url = $session{config}{scripturl}.'/'.$_[0];
if ($_[1]) {
$url = append($url,$_[1]);
}
if ($session{setting}{preventProxyCache} == 1) {
$url = append($url,randint(0,1000).';'.time());
}
return $url;
}
#-------------------------------------------------------------------
sub page {
my ($url);
$url = $session{page}{url};
if ($_[0]) {
$url = append($url,$_[0]);
}
if ($session{setting}{preventProxyCache} == 1) {
$url = append($url,randint(0,1000).';'.time());
}
return $url;
}
#-------------------------------------------------------------------
sub urlize {
my ($title);
$title = lc($_[0]);
$title =~ s/ /_/g;
$title =~ s/[^a-z0-9\-\.\_]//g;
return $title;
}
1;