copyFile() public static method

Copies a file using the current Gollem session settings.
public static copyFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir )
$backend_f string The backend to copy the file from.
$dir string The directory name of the original file.
$name string The original filename.
$backend_t string The backend to copy the file to.
$newdir string The directory to copy the file to.
Esempio n. 1
0
             $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]);
             }
         }
         $session->set('gollem', 'clipboard', array_values($clipboard));
     }