Class ilCloudPluginUploadGUI.
More...
|
| uploadDirectory ($dir, $parent_id, $file_tree, $keep_structure=true) |
| Recursive Method to upload a directory. More...
|
|
Class ilCloudPluginUploadGUI.
Standard class for uploading files. Can be overwritten if needed.
- Author
- Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
- Version
- $Id:
Definition at line 17 of file class.ilCloudPluginUploadGUI.php.
◆ asyncUploadFile()
ilCloudPluginUploadGUI::asyncUploadFile |
( |
| ) |
|
◆ cancelAll()
ilCloudPluginUploadGUI::cancelAll |
( |
| ) |
|
Definition at line 96 of file class.ilCloudPluginUploadGUI.php.
References exit.
98 echo
"<script language='javascript' type='text/javascript'>window.parent.il.CloudFileList.afterUpload('cancel');</script>";
◆ executeCommand()
ilCloudPluginUploadGUI::executeCommand |
( |
| ) |
|
◆ handleFileUpload()
ilCloudPluginUploadGUI::handleFileUpload |
( |
|
$file_upload | ) |
|
Definition at line 134 of file class.ilCloudPluginUploadGUI.php.
References $_POST, $_SESSION, $response, ilUtil\delDir(), exit, ilCloudFileTree\getFileTreeFromSession(), ilUtil\ilTempnam(), ilUtil\makeDir(), ilFileUtils\processZipFile(), and uploadDirectory().
Referenced by uploadFiles().
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';
170 $file_tree->uploadFileToService(
$_SESSION[
"cld_folder_id"], $file_upload[
"tmp_name"],
$_POST[
"title"]);
static getFileTreeFromSession()
uploadDirectory($dir, $parent_id, $file_tree, $keep_structure=true)
Recursive Method to upload a directory.
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 makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
◆ initUploadForm()
ilCloudPluginUploadGUI::initUploadForm |
( |
| ) |
|
Definition at line 65 of file class.ilCloudPluginUploadGUI.php.
References $DIC, $file, $ilCtrl, $lng, and ilUtil\getImagePath().
Referenced by asyncUploadFile(), and uploadFiles().
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");
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ uploadDirectory()
ilCloudPluginUploadGUI::uploadDirectory |
( |
|
$dir, |
|
|
|
$parent_id, |
|
|
|
$file_tree, |
|
|
|
$keep_structure = true |
|
) |
| |
|
protected |
Recursive Method to upload a directory.
- Parameters
-
string | $dir | path to directory |
int | $parent_id | id of parent folder |
ilCloudFileTree | $file_tree | |
bool | $keep_structure | if false, only files will be extracted, without folder structure |
- Exceptions
-
Definition at line 184 of file class.ilCloudPluginUploadGUI.php.
References ilFileUtilsException\$BROKEN_FILE, $DIC, $file, and $lng.
Referenced by handleFileUpload().
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));
uploadDirectory($dir, $parent_id, $file_tree, $keep_structure=true)
Recursive Method to upload a directory.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ uploadFiles()
ilCloudPluginUploadGUI::uploadFiles |
( |
| ) |
|
Update properties.
Definition at line 106 of file class.ilCloudPluginUploadGUI.php.
References $error, $response, array, ilJsonUtil\encode(), exit, handleFileUpload(), header, initUploadForm(), object, and ilCloudException\UPLOAD_FAILED.
113 if ($this->form->checkInput()) {
115 $fileresult = $this->
handleFileUpload($this->form->getInput(
"upload_files"));
129 header(
'Content-type: text/plain');
static encode($mixed, $suppress_native=false)
Add a drawing to the header
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
handleFileUpload($file_upload)
◆ $form
ilCloudPluginUploadGUI::$form |
|
protected |
The documentation for this class was generated from the following file: