4 include_once(
"./Modules/Cloud/exceptions/class.ilCloudException.php");
5 include_once(
"class.ilCloudFileNode.php");
6 include_once(
"class.ilCloudConnector.php");
7 include_once(
"class.ilCloudUtil.php");
156 $this->item_list[$node->getPath()] = $node;
157 $this->id_to_path_map[$node->getId()] = $node->getPath();
158 $node->setIsDir($is_dir);
188 $node->setParentId($node_parent->getId());
189 $node_parent->addChild($node->getPath());
192 $node->setSize(
$size);
193 $node->setModified($modified);
206 $parent->removeChild(
$path);
207 unset($this->item_list[$node->getPath()]);
208 unset($this->id_to_path_map[$node->getId()]);
227 return $this->item_list[
$path];
230 foreach (array_keys($this->item_list) as $item)
232 if (strtolower($item) == strtolower($path))
234 return $this->item_list[$item];
247 return $this->item_list[$this->id_to_path_map[
$id]];
261 $node->setLoadingComplete(
true);
276 if (!$node->getLoadingComplete())
297 $service->addToFileTree($this, $node->getPath());
317 if ($folder_name == null)
330 $current_node->setLoadingComplete(
false);
334 $service->createFolder(
$path, $this);
361 $max_file_size = $plugin->getMaxFileSize();
363 if($max_file_size >= filesize($tmp_name)/(1024 * 1024))
367 $current_node->setLoadingComplete(
false);
373 $service->putFile($tmp_name, $file_name, $current_node->getPath(), $this);
401 $service->deleteItem($item_node->getPath(), $this);
424 $service->getFile($node->getPath(), $this);
438 $_SESSION[
'ilCloudFileTree'] = serialize($this);
448 return unserialize(
$_SESSION[
'ilCloudFileTree']);
471 if ($node1->getIsDir() != $node2->getIsDir())
473 return $node2->getIsDir() ? +1 : -1;
475 $nameNode1 = strtolower(basename($node1->getPath()));
476 $nameNode2 = strtolower(basename($node2->getPath()));
477 return ($nameNode1 > $nameNode2) ? +1 : -1;
487 usort($children,
array(
"ilCloudFileTree",
"orderListAlphabet"));
499 $list[$node->getId()] = $node->getJSONEncode();
const PATH_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
uploadFileToService($current_id, $tmp_name, $file_name)
getNodeFromPath($path="/")
updateFileTree($current_path)
addNode($path, $id, $is_Dir, $modified=null, $size=0)
setServiceName($service_name)
addFolderToService($id, $folder_name)
static getFileTreeFromSession()
orderListAlphabet($path1, $path2)
static clearFileTreeSession()
const ADD_ITEMS_FROM_SERVICE_FAILED
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
setLoadingOfFolderComplete($path)
$id_to_path_map
Only for better performance.
createNode($path="/", $id, $is_dir=false)
const FOLDER_CREATION_FAILED
static getPluginClass($service_name, $obj_id)
static joinPaths($path1, $path2)
Create styles array
The data for the language used.
getSortedListOfChildren(ilCloudFileNode $node)
const ID_ALREADY_EXISTS_IN_FILE_TREE_IN_SESSION
static getServiceClass($service_name, $obj_id, $connect=true)
addItemsFromService($folder_id)
__construct($root_path="/", $root_id="root", $id, $service_name)
static normalizePath($path)
const FOLDER_ALREADY_EXISTING_ON_SERVICE
const UPLOAD_FAILED_MAX_FILESIZE
setCaseSensitive($case_sensitive)