require_once WPRO_DIR . 'core/libs/wproMessageExit.class.php'; $msg = new wproMessageExit(); $msg->msgCode = WPRO_CRITICAL; $msg->msg = 'Upload failed due to an unknown error.'; $msg->alert(); } } } } else { header("Connection: close", true); // no upload sent, show regular dialog $fs = new wproFilesystem(); // check disk quota $quota = $fs->returnBytes($dir->diskQuota); if ($quota > 0) { $dirSize = intval($fs->dirSize($dir->dir)); if ($quota <= $dirSize) { require_once WPRO_DIR . 'core/libs/wproMessageExit.class.php'; $msg = new wproMessageExit(); $msg->msgCode = WPRO_WARNING; $msg->msg = $DIALOG->langEngine->get('wproCore_fileBrowser', 'quotaExceeded'); $msg->alert(); } } $uploadID = md5(uniqid(rand(), true)); //exit($uploadID); if (!isset($WPRO_SESS->data['uploads'])) { $WPRO_SESS->data['uploads'] = array(); } $WPRO_SESS->data['uploads'][$uploadID] = array(); $WPRO_SESS->doSave = true;
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; }