WebGUI 2.5.0 release
This commit is contained in:
parent
6286f9bfaf
commit
00aec56a04
65 changed files with 3006 additions and 369 deletions
|
|
@ -14,12 +14,13 @@ use CGI;
|
|||
use Exporter;
|
||||
use FileHandle;
|
||||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&paginate &appendToUrl &randint &getNextId &saveAttachment &round &urlize "e);
|
||||
our @EXPORT = qw(&sortHashDescending &sortHash &paginate &appendToUrl &randint &getNextId &saveAttachment &round &urlize "e);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub appendToUrl {
|
||||
|
|
@ -111,8 +112,8 @@ sub saveAttachment {
|
|||
mkdir ($path,0755);
|
||||
}
|
||||
$file = FileHandle->new(">".$path.$urlizedFilename);
|
||||
binmode $file;
|
||||
if (defined $file) {
|
||||
binmode $file;
|
||||
while ($bytesread=read($filename,$buffer,1024)) {
|
||||
print $file $buffer;
|
||||
}
|
||||
|
|
@ -126,6 +127,36 @@ sub saveAttachment {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub sortHash {
|
||||
my (%hash, %reversedHash, %newHash, $key);
|
||||
tie %hash, "Tie::IxHash";
|
||||
tie %reversedHash, "Tie::IxHash";
|
||||
tie %newHash, "Tie::IxHash";
|
||||
%hash = @_;
|
||||
%reversedHash = reverse %hash;
|
||||
foreach $key (sort {$b cmp $a} keys %reversedHash) {
|
||||
$newHash{$key}=$reversedHash{$key};
|
||||
}
|
||||
%reversedHash = reverse %newHash;
|
||||
return %reversedHash;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub sortHashDescending {
|
||||
my (%hash, %reversedHash, %newHash, $key);
|
||||
tie %hash, "Tie::IxHash";
|
||||
tie %reversedHash, "Tie::IxHash";
|
||||
tie %newHash, "Tie::IxHash";
|
||||
%hash = @_;
|
||||
%reversedHash = reverse %hash;
|
||||
foreach $key (sort {$a cmp $b} keys %reversedHash) {
|
||||
$newHash{$key}=$reversedHash{$key};
|
||||
}
|
||||
%reversedHash = reverse %newHash;
|
||||
return %reversedHash;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub urlize {
|
||||
my ($title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue