4 include_once(
"class.ilObjCloudGUI.php");
5 include_once(
"class.ilCloudFileNode.php");
6 include_once(
"class.ilCloudFileTree.php");
7 include_once(
"class.ilCloudConnector.php");
33 parent::__construct($plugin_service_class);
70 public function getFolderHtml(
ilObjCloudGUI $gui_class,
$id, $delete_files =
false, $delete_folder =
false, $download =
false, $files_visible =
false, $folders_visible =
false)
81 $tree_tpl =
new ilTemplate(
"tpl.cloud_block.html",
true,
true,
"Modules/Cloud/");
83 if ($files_visible || $folders_visible) {
84 $tree_tpl->setVariable(
"NODE_ID", $node->getId());
86 $block =
new ilTemplate(
"tpl.container_list_block.html",
true,
true,
"Services/Container/");
88 if ($node->hasChildren()) {
89 $block->setVariable(
"BLOCK_HEADER_CONTENT",
$lng->txt(
"content"));
91 $children = $this->
getFileTree()->getSortedListOfChildren($node);
92 foreach ($children as
$path) {
93 $child_node = $this->
getFileTree()->getNodeFromPath($path);
94 if (($child_node->getIsDir() && $folders_visible) || (!$child_node->getIsDir() && $files_visible)) {
95 $block->setCurrentBlock(
"container_standard_row");
96 if ($child_node->getIsDir()) {
97 $block->setVariable(
"ROW_ID",
"id=xcld_folder_" . $child_node->getId());
99 $block->setVariable(
"ROW_ID",
"id=xcld_file_" . $child_node->getId());
101 $block->setVariable(
"BLOCK_ROW_CONTENT", $this->
getItemHtml($child_node, $gui_class, $delete_files, $delete_folder, $download));
102 $block->parseCurrentBlock();
107 $tree_tpl->setVariable(
"CONTENT", $block->get());
112 $this->
setTreeVariablePlugin($tree_tpl, $gui_class,
$id, $delete_files, $delete_folder, $download, $files_visible, $folders_visible);
114 return $tree_tpl->get();
154 $item =
new ilTemplate(
"tpl.container_list_item.html",
true,
true,
"Services/Container/");
157 $item->setVariable(
"COMMAND_SELECTION_LIST", $action_list_gui->getSelectionListItemsHTML($delete_files, $delete_folder, $node));
159 $item->setVariable(
"DIV_CLASS",
"ilContainerListItemOuter");
160 $item->touchBlock(
"d_1");
162 include_once(
'./Services/Calendar/classes/class.ilDate.php');
166 $item->setVariable(
"SRC_ICON", $node->
getIconPath());
175 $item->setVariable(
"TXT_TITLE_LINKED", basename($node->
getPath()));
176 $item->setVariable(
"HREF_TITLE_LINKED", $this->
getLinkToFolder($node));
189 $item->setVariable(
"TXT_TITLE_LINKED", basename($node->
getPath()));
190 $item->setVariable(
"HREF_TITLE_LINKED",
$ilCtrl->getLinkTarget($gui_class,
"getFile") .
"&id=" . $node->
getId());
192 $item->setVariable(
"TXT_TITLE", basename($node->
getPath()));
210 if ($bytes >= 1073741824) {
211 $bytes = number_format($bytes / 1073741824, $precision) .
' GB';
212 } elseif ($bytes >= 1048576) {
213 $bytes = number_format($bytes / 1048576, $precision) .
' MB';
214 } elseif ($bytes >= 1024) {
215 $bytes = number_format($bytes / 1024, $precision) .
' KB';
216 } elseif ($bytes > 1) {
217 $bytes = $bytes .
' bytes';
218 } elseif ($bytes == 1) {
219 $bytes = $bytes .
' byte';
246 if ($node == $this->
getFileTree()->getRootNode()) {
254 return "<DIV class='xcld_locator' id='xcld_locator_" . $node->
getId() .
"'>" . $ilLocator->getHTML() .
"</DIV>";
265 return "#/open_folder?id_parent=" . $node->
getParentId() .
"¤t_id=" . $node->
getId() .
"¤t_path=" . self::_urlencode($node->
getPath());
272 $options->dropZone =
".ilFileUploadDropZone_1";
273 $options->fileInput =
"#ilFileUploadInput_1";
274 $options->submitButton =
"uploadFiles";
275 $options->cancelButton =
"cancelAll";
276 $options->dropArea =
".ilFileDropTarget";
277 $options->fileList =
"#ilFileUploadList_1";
278 $options->fileSelectButton =
"#ilFileUploadFileSelect_1";
292 return str_replace(
'%2F',
'/', rawurlencode($str));
setTreeVariablePlugin(ilTemplate $tree_tpl, ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false)
static getActionListGUIClass(ilCloudPluginService $plugin_service_class)
if(!array_key_exists('StateId', $_REQUEST)) $id
static _urlencode($str)
urlencode without encoding slashes
formatBytes($bytes, $precision=2)
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getLocatorHtml(ilCloudFileNode $node)
setFileTree(ilCloudFileTree $file_tree)
setItemVariablePlugin(ilTemplate $item, ilCloudFileNode $node)
setBlockVariablePlugin(ilTemplate $block)
static encode($mixed, $suppress_native=false)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
getFolderHtml(ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false)
static getLinkToFolder(ilCloudFileNode $node)
__construct($plugin_service_class, ilCloudFileTree $file_tree)
getItemHtml(ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files=false, $delete_folder=false, $download=false)