Esempio n. 1
0
 $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;
     }
 }
 $i = 0;
 $limit = 0;
 $failed = 0;
 foreach ($files as $file) {
Esempio n. 2
0
             }
         }
         array_push($succeeded, $file);
     } else {
         array_push($failed, $file);
     }
     // copy files
 } else {
     if ($action == 'copy') {
         if ($fs->delete($destDirectory . $file) && $fs->copy($srcDirectory . $file, $destDirectory . $file)) {
             // copy thumbnail to destination
             if ($fs->fileNameOk($EDITOR->thumbnailFolderName)) {
                 if (is_file($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file)) {
                     // create folder
                     if (!file_exists($destDirectory . $EDITOR->thumbnailFolderName)) {
                         $fs->makeDir($destDirectory . $EDITOR->thumbnailFolderName, $EDITOR->folderCHMOD);
                     }
                     $fs->copy($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file, $destDirectory . $EDITOR->thumbnailFolderName . '/' . $file);
                 } else {
                     if (is_file($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file . '.png')) {
                         // create folder
                         if (!file_exists($destDirectory . $EDITOR->thumbnailFolderName)) {
                             $fs->makeDir($destDirectory . $EDITOR->thumbnailFolderName, $EDITOR->folderCHMOD);
                         }
                         $fs->copy($srcDirectory . $EDITOR->thumbnailFolderName . '/' . $file . '.png', $destDirectory . $EDITOR->thumbnailFolderName . '/' . $file . '.png');
                     }
                 }
             }
             array_push($succeeded, $file);
         } else {
             array_push($failed, $file);
Esempio n. 3
0
    if ($fs->filterMatch($name, $dir->filters)) {
        $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response);
        $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSReservedNameError'));
        $response->addScriptCall("document.dialogForm.newFolderName.focus", '');
        $response->addScriptCall("dialog.hideLoadMessage", '');
        return $response;
    }
    $exists = file_exists($directory . $name);
    if ($exists) {
        $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response);
        $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSFolderExistsError'));
        $response->addScriptCall("document.dialogForm.newFolderName.focus", '');
        $response->addScriptCall("dialog.hideLoadMessage", '');
        return $response;
    }
    if ($fs->makeDir($directory . $name, $EDITOR->folderCHMOD)) {
        $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array($name), $history, $response);
        $response->addScriptCall("dialog.hideLoadMessage", '');
        $response->addScriptCall("hideMessageBox", '');
        // trigger editor event
        $EDITOR->triggerEvent('onNewFolder', array('directory' => $directory, 'directoryURL' => $URL, 'directoryObject' => $dir, 'name' => $name));
    } else {
        $this->displayFolderList($folderId, $folderPath, $page, $sortBy, $sortDir, $view, array(), $history, $response);
        $response->addAlert($DIALOG->langEngine->get('wproCore_fileBrowser', 'JSNewFolderActionError'));
        $response->addScriptCall("hideMessageBox", '');
        $response->addScriptCall("dialog.hideLoadMessage", '');
    }
} else {
    $response->addScriptCall("FB.onFolderNotFound", "");
}
return $response;