more bug fixes

This commit is contained in:
JT Smith 2005-08-12 16:37:23 +00:00
parent b21461d50c
commit 469950a1ef
4 changed files with 12 additions and 3 deletions

View file

@ -298,6 +298,7 @@ sub addAssetVersioning {
$sth = WebGUI::SQL->read("select olderVersions from FileAsset");
while (my ($old) = $sth->array) {
foreach my $storageId (split("\n",$old)) {
next unless ($storageId);
WebGUI::Storage->get($storageId)->delete;
}
}

View file

@ -352,7 +352,8 @@ Deletes this storage location and its contents (if any) from the filesystem and
sub delete {
my $self = shift;
rmtree($self->getPath);
my $path = $self->getPath;
rmtree($path) if ($path);
undef $self;
}
@ -390,6 +391,7 @@ The unique identifier for this file system storage location.
sub get {
my $class = shift;
my $id = shift;
return undef unless $id;
$id =~ m/^(.{2})(.{2})/;
my $self = {_id => $id, _part1 => $1, _part2 => $2};
bless $self, ref($class)||$class;
@ -587,6 +589,10 @@ If specified, we'll return a path to the file rather than the storage location.
sub getPath {
my $self = shift;
my $file = shift;
unless ($session{config}{uploadsPath} && $self->{_part1} && $self->{_part2} && $self->getId) {
$self->_addError("storage object malformed");
return undef;
}
my $path = $session{config}{uploadsPath}
.$session{os}{slash}.$self->{_part1}
.$session{os}{slash}.$self->{_part2}

View file

@ -471,7 +471,8 @@ function AssetManager_addAssetMetaData(url, rank,title) {
//********Event Handlers***********
function AssetManager_initializeDragEventHandlers() {
document.onmousedown=AssetManager_documentMouseDown;
var old = (document.onmousedown) ? document.onmousedown : function () {};
document.onmousedown= function () {old();AssetManager_documentMouseDown();};
document.onmouseup=AssetManager_documentMouseUp;
document.onmousemove=AssetManager_documentMouseMove;
}

View file

@ -1,7 +1,8 @@
var ie5=document.all&&document.getElementById
var contextMenu_items = new Array();
document.onmousedown=contextMenu_hide;
var contextMenu_old = (document.onmousedown) ? document.onmousdown : function () {};
document.onmousedown= function () {contextMenu_old();contextMenu_hide();};
function contextMenu_renderLeftClick(menuId,e) {
contextMenu_hide(e);