4include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
    5include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
 
   43        $ilTabs = 
$DIC[
'ilTabs'];
 
   45        $ilTabs->activateTab(
"content");
 
   47        echo $this->form->getHTML();
 
   51        $options->dropZone = 
"#ilFileUploadDropZone_1";
 
   52        $options->fileInput = 
"#ilFileUploadInput_1";
 
   53        $options->submitButton = 
"uploadFiles";
 
   54        $options->cancelButton = 
"cancelAll";
 
   55        $options->dropArea = 
"#ilFileUploadDropArea_1";
 
   56        $options->fileList = 
"#ilFileUploadList_1";
 
   57        $options->fileSelectButton = 
"#ilFileUploadFileSelect_1";
 
   58        echo 
"<script language='javascript' type='text/javascript'>var fileUpload1 = new ilFileUpload(1, " . 
ilJsonUtil::encode(
$options) . 
");</script>";
 
   71        include_once(
"./Services/Form/classes/class.ilDragDropFileInputGUI.php");
 
   72        include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
   75        $this->form->setId(
"upload");
 
   76        $this->form->setMultipart(
true);
 
   77        $this->form->setHideLabels();
 
   80        $file->setRequired(
true);
 
   81        $this->form->addItem($file);
 
   83        $this->form->addCommandButton(
"uploadFiles", 
$lng->txt(
"upload"));
 
   84        $this->form->addCommandButton(
"cancelAll", 
$lng->txt(
"cancel"));
 
   86        $this->form->setTableWidth(
"100%");
 
   87        $this->form->setTitle(
$lng->txt(
"upload_files_title"));
 
   91        $this->form->setTitle(
$lng->txt(
"upload_files"));
 
   92        $this->form->setFormAction(
$ilCtrl->getFormAction($this, 
"uploadFiles"));
 
   93        $this->form->setTarget(
"cld_blank_target");
 
   98        echo 
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterUpload('cancel');</script>";
 
  113        if ($this->form->checkInput()) {
 
  115                $fileresult = $this->
handleFileUpload($this->form->getInput(
"upload_files"));
 
  128        header(
'Vary: Accept');
 
  129        header(
'Content-type: text/plain');
 
  139        $response->fileSize = intval($file_upload[
"size"]);
 
  140        $response->fileType = $file_upload[
"type"];
 
  141        $response->fileUnzipped = $file_upload[
"extract"];
 
  146        if ($file_upload[
"extract"]) {
 
  150            include_once 
'./Services/Utilities/classes/class.ilFileUtils.php';
 
  153            } 
catch (Exception $e) {
 
  161            } 
catch (Exception $e) {
 
  170            $file_tree->uploadFileToService(
$_SESSION[
"cld_folder_id"], $file_upload[
"tmp_name"], 
$_POST[
"title"]);
 
  184    protected function uploadDirectory($dir, $parent_id, $file_tree, $keep_structure = 
true)
 
  186        $dirlist = opendir($dir);
 
  188        while (
false !== ($file = readdir($dirlist))) {
 
  189            if (!is_file($dir . 
"/" . $file) && !is_dir($dir . 
"/" . $file)) {
 
  194            if ($file != 
'.' && $file != 
'..') {
 
  195                $newpath = $dir . 
'/' . $file;
 
  196                if (is_dir($newpath)) {
 
  197                    if ($keep_structure) {
 
  198                        $newnode = $file_tree->addFolderToService($parent_id, basename($newpath));
 
  204                    $file_tree->uploadFileToService($parent_id, $newpath, basename($newpath));
 
An exception for terminatinating execution or to throw for unit testing.
static getFileTreeFromSession()
Class ilCloudPluginUploadGUI.
uploadFiles()
Update properties.
handleFileUpload($file_upload)
executeCommand()
execute command
uploadDirectory($dir, $parent_id, $file_tree, $keep_structure=true)
Recursive Method to upload a directory.
Base class for ILIAS Exception handling.
static processZipFile($a_directory, $a_file, $structure, $ref_id=null, $containerType=null, $tree=null, $access_handler=null)
unzips in given directory and processes uploaded zip for use as single files
static encode($mixed, $suppress_native=false)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...