Improved nextmatch row aoi and added AJAX-actions for createdir and symlink to filemanager_ui

This commit is contained in:
Andreas Stöckel 2011-03-23 20:07:07 +00:00
parent 374b65e0b8
commit 4b380ca119
2 changed files with 37 additions and 2 deletions

View File

@ -54,8 +54,13 @@ function nextmatchRowAOI(_node)
});
$(aoi.checkBox).change(function() {
aoi.updateState(EGW_AO_STATE_SELECTED, this.checked, EGW_AO_SHIFT_STATE_MULTI);
});
aoi.updateState(EGW_AO_STATE_SELECTED, this.checked, EGW_AO_SHIFT_STATE_MULTI);
});
// Don't execute the default action when double clicking on an entry
$(aoi.checkBox).dblclick(function() {
return false;
});
aoi.doSetState = function(_state) {
var selected = egwBitIsSet(_state, EGW_AO_STATE_SELECTED);

View File

@ -1171,6 +1171,36 @@ class filemanager_ui
break;
case "createdir":
$curdir = $selected[0];
$newdir = $selected[1];
$dst = egw_vfs::concat($curdir, $newdir);
if (egw_vfs::mkdir($dst, null, STREAM_MKDIR_RECURSIVE))
{
$arr['msg'] = lang("Directory successfully created.");
}
else
{
$arr['msg'] = lang("Error while creating directory.");
}
break;
case "symlink":
$curdir = $selected[0];
$target = $selected[1];
$link = egw_vfs::concat($curdir, egw_vfs::basename($target));
$abs_target = $target[0] == '/' ? $target : egw_vfs::concat($target, $target);
if (!egw_vfs::stat($abs_target))
{
$arr['msg'] = lang('Link target %1 not found!', egw_vfs::decodePath($abs_target));
break;
}
$arr['msg'] = egw_vfs::symlink($target,$link) ?
lang('Symlink to %1 created.',$target) : lang('Error creating symlink to target %1!',egw_vfs::decodePath($target));
break;
default:
$arr['msg'] = self::action($action,$selected,null,$arr['errs'],$arr['dirs'],$arr['files']);
break;