array_push($failed, $file); continue; } else { if (!$isFile && !$destDir->moveFolders && $action == 'move') { array_push($failed, $file); continue; } else { if (!$isFile && !$destDir->copyFolders && $action == 'copy') { array_push($failed, $file); continue; } } } } // delete thumbnails in destination if ($fs->fileNameOk($EDITOR->thumbnailFolderName)) { if (is_file($destDirectory . $EDITOR->thumbnailFolderName . '/' . $file)) { $fs->delete($destDirectory . $EDITOR->thumbnailFolderName . '/' . $file); } else { if (is_file($destDirectory . $EDITOR->thumbnailFolderName . '/' . $file . '.png')) { $fs->delete($destDirectory . $EDITOR->thumbnailFolderName . '/' . $file . '.png'); } } } // move files if ($action == 'move') { if ($fs->delete($destDirectory . $file) && $fs->rename($srcDirectory . $file, $destDirectory . $file)) { // move thumbnail to destination if ($fs->fileNameOk($EDITOR->thumbnailFolderName)) { if (is_file($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file)) { $fs->rename($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file, $destDirectory . $EDITOR->thumbnailFolderName . '/' . $file);
function displayFolderDetails($folderId = 0, $folderPath = '', $folder = '') { global $EDITOR, $DIALOG; $response = $DIALOG->createAjaxResponse(); // initial var check... if (!isset($folderId, $folderPath, $folder) || !is_string($folderId) && !is_int($folderId) || !is_string($folderPath) || !is_string($folder)) { return $response; } if ($arr = $this->getFolder($folderId, $folderPath, $response)) { $directory = $arr['directory']; $URL = $arr['URL']; $dir = $arr['directory']; $size = 0; $fs = new wproFilesystem(); if ($fs->fileNameOk($folder)) { $size = $fs->dirSize($directory . $folder); } $response->addAssign('displayFolderSize', 'innerHTML', '<strong>' . $EDITOR->langEngine->get('wproCore_fileBrowser', 'size') . '</strong> ' . $fs->convertByteSize($size)); } return $response; }
// check vars if (!isset($params['folderID']) || !isset($params['folderPath']) || empty($params['file'])) { exit; } ini_set('display_errors', false); $params['folderPath'] = base64_decode($params['folderPath']); // display a dynamic thumbnail... $x = null; if ($arr = $this->getFolder($params['folderID'], $params['folderPath'], $x)) { $directory = $arr['directory']; $file = $params['file']; $fs = new wproFilesystem(); if ($fs->fileNameOK($file)) { if (is_file($directory . $file)) { // if the thumbnail folder exists & is writable lets cache the thumbnail if (file_exists($directory . $EDITOR->thumbnailFolderName) && $fs->fileNameOk($EDITOR->thumbnailFolderName) && is_writable($directory . $EDITOR->thumbnailFolderName)) { $savePath = $directory . $EDITOR->thumbnailFolderName . '/' . $file; // do not create if it already exists if (is_file($savePath)) { $savePath = ''; } } else { $savePath = ''; } require_once WPRO_DIR . 'core/libs/wproImageEditor.class.php'; $imageEditor = new wproImageEditor(); if (!$imageEditor->proportionalResize($directory . $file, '', 94, 94)) { $extension = strrchr(strtolower($file), '.'); $GDExtensions = array('.jpg', '.jpeg', '.gif', '.png'); // filetypes that can be resized with GD if (in_array($extension, $GDExtensions)) {
return false; } $GDExtensions = array('.jpg', '.jpeg', '.gif', '.png'); // filetypes that can be resized with GD $fs = new wproFilesystem(); require_once WPRO_DIR . 'core/libs/wproImageEditor.class.php'; $imageEditor = new wproImageEditor(); //$imageEditor->adjustMemoryLimit = false; // we want to prevent time outs so we won't create thumbnails on huge images. $imageEditor->fileCHMOD = $EDITOR->fileCHMOD; // mode for new thumbnails // initiate variables $dirWritable = is_writable($directory); $thumb_src = ''; $thumbDirExists = false; // create thumb cache folder if (file_exists($directory . $EDITOR->thumbnailFolderName) && $fs->fileNameOk($EDITOR->thumbnailFolderName)) { //$thumbDirCreated = true; $thumbDirExists = true; } else { // create thumb cache dir if (count($files) && $dirWritable && !strstr($url, $EDITOR->thumbnailFolderName) && $fs->fileNameOk($EDITOR->thumbnailFolderName)) { if (!$fs->makeDir($directory . $EDITOR->thumbnailFolderName, $EDITOR->folderCHMOD)) { $dirWritable = false; $thumbDirExists = false; } else { $thumbDirExists = true; //$thumbDirCreated = true; } } else { //$thumbDirCreated = false; $thumbDirExists = false;