/** * Move/rename a file * * @param string $file * @param string $path * @param string $cabin */ protected function commonMoveFile(string $file, string $path, string $cabin) { if (!$this->permCheck()) { \Airship\redirect($this->airship_cabin_prefix); } list($publicPath, $root) = $this->loadCommonData($path, $cabin); if (empty($root)) { $fileInfo = $this->files->getFileInfo($cabin, null, $file); } else { $fileInfo = $this->files->getFileInfo($cabin, $root, $file); } $post = $this->post(new MoveFileFilter()); if (!empty($post)) { $this->files->moveFile($fileInfo, $post, $cabin); \Airship\redirect($this->airship_cabin_prefix . '/' . $this->path_middle . '/' . $cabin, ['dir' => $path]); } $this->lens('files/move', ['cabins' => $this->getCabinNamespaces(), 'file' => $fileInfo, 'root_dir' => $this->root_dir, 'all_dirs' => $this->files->getDirectoryTree($cabin, $this->root_dir), 'dir' => $path, 'cabin' => $cabin, 'pathinfo' => $publicPath]); }