Gollem::moveFile PHP Method

moveFile() public static method

Moves a file using the current Gollem session settings.
public static moveFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir )
$backend_f string The backend to move the file from.
$dir string The directory name of the original file.
$name string The original filename.
$backend_t string The backend to move the file to.
$newdir string The directory to move the file to.
    public static function moveFile($backend_f, $dir, $name, $backend_t, $newdir)
    {
        self::_copyFile('move', $backend_f, $dir, $name, $backend_t, $newdir);
    }

Usage Example

Ejemplo n.º 1
0
             $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]);
             }
         }