You are here

function webfm_move in Web File Manager 5.2

Same name and namespace in other branches
  1. 5 webfm_file.inc \webfm_move()

Move a directory or file and update database

@ret bool -true if any directory change (used to switch client cache)

Parameters

string $source - the source directory path:

string $dest - the destination directory name:

bool $uid - uid of user making move request:

string &$err_arr - ref to error array for client feedback:

1 call to webfm_move()
webfm_ajax in ./webfm.module
Ajax post requests

File

./webfm_file.inc, line 219

Code

function webfm_move($source, $dest, $uid, &$err_arr) {
  if (is_dir($source) && $uid == 1) {
    return webfm_move_dir_recur($source, $dest, $uid, FALSE, $err_arr);
  }
  elseif (is_file($source)) {
    $dest .= '/' . strrev(substr(strrev($source), 0, strpos(strrev($source), '/')));
    return webfm_move_file($source, $dest, $uid, $err_arr);
  }
  return FALSE;
}