$notification->push(_("Cannot copy items onto clipboard."), 'horde.error');
} else {
$notification->push(_("Cannot cut items onto clipboard."), 'horde.error');
}
}
break;
case 'clear_items':
case 'paste_items':
if ($edit_perms && is_array($vars->items) && count($vars->items)) {
foreach ($vars->items as $val) {
if (isset($clipboard[$val])) {
$file = $clipboard[$val];
if ($vars->actionID == 'paste_items') {
try {
if ($file['action'] == 'cut') {
Gollem::moveFile($file['backend'], $file['path'], $file['name'], $backkey, $old_dir);
} else {
Gollem::copyFile($file['backend'], $file['path'], $file['name'], $backkey, $old_dir);
}
Gollem::expireCache($old_dir);
if ($file['action'] == 'cut') {
Gollem::expireCache($file['path']);
}
$notification->push(sprintf(_("%s was successfully pasted."), $file['name'], $old_dir), 'horde.success');
} catch (Horde_Vfs_Exception $e) {
$notification->push(sprintf(_("Cannot paste \"%s\" (file cleared from clipboard): %s"), $file['name'], $e->getMessage()), 'horde.error');
}
}
unset($clipboard[$val]);
}
}