Class ilCloudFileTree.
More...
|
| __construct ($plugin_service_class, ilCloudFileTree $file_tree) |
|
| setFileTree (ilCloudFileTree $file_tree) |
|
| getFileTree () |
|
| getFolderHtml (ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false) |
|
| setTreeVariablePlugin (ilTemplate $tree_tpl, ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false) |
|
| getItemHtml (ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files=false, $delete_folder=false, $download=false) |
|
| getLocatorHtml (ilCloudFileNode $node) |
|
| __construct ($plugin_service_class) |
|
| getPluginObject () |
|
| getPluginHookObject () |
|
| getAdminConfigObject () |
|
| getService () |
|
| txt ($var="") |
|
| executeCommand () |
|
◆ __construct()
ilCloudPluginFileTreeGUI::__construct |
( |
|
$plugin_service_class, |
|
|
ilCloudFileTree |
$file_tree |
|
) |
| |
◆ _urlencode()
static ilCloudPluginFileTreeGUI::_urlencode |
( |
|
$str | ) |
|
|
staticprotected |
◆ addDropZone()
ilCloudPluginFileTreeGUI::addDropZone |
( |
| ) |
|
|
protected |
Definition at line 277 of file class.ilCloudPluginFileTreeGUI.php.
References ilJsonUtil\encode().
279 $options =
new stdClass();
280 $options->dropZone =
".ilFileUploadDropZone_1";
281 $options->fileInput =
"#ilFileUploadInput_1";
282 $options->submitButton =
"uploadFiles";
283 $options->cancelButton =
"cancelAll";
284 $options->dropArea =
".ilFileDropTarget";
285 $options->fileList =
"#ilFileUploadList_1";
286 $options->fileSelectButton =
"#ilFileUploadFileSelect_1";
287 echo
"<script language='javascript' type='text/javascript'>var fileUpload1 = new ilFileUpload(1, " .
ilJsonUtil::encode($options)
static encode($mixed, $suppress_native=false)
◆ formatBytes()
ilCloudPluginFileTreeGUI::formatBytes |
( |
|
$bytes, |
|
|
|
$precision = 2 |
|
) |
| |
|
protected |
- Parameters
-
- Returns
- string
Definition at line 216 of file class.ilCloudPluginFileTreeGUI.php.
Referenced by getItemHtml().
218 if ($bytes >= 1073741824) {
219 $bytes = number_format($bytes / 1073741824, $precision) .
' GB';
220 } elseif ($bytes >= 1048576) {
221 $bytes = number_format($bytes / 1048576, $precision) .
' MB';
222 } elseif ($bytes >= 1024) {
223 $bytes = number_format($bytes / 1024, $precision) .
' KB';
224 } elseif ($bytes > 1) {
225 $bytes = $bytes .
' bytes';
226 } elseif ($bytes == 1) {
227 $bytes = $bytes .
' byte';
◆ getFileTree()
ilCloudPluginFileTreeGUI::getFileTree |
( |
| ) |
|
◆ getFolderHtml()
ilCloudPluginFileTreeGUI::getFolderHtml |
( |
ilObjCloudGUI |
$gui_class, |
|
|
|
$id, |
|
|
|
$delete_files = false , |
|
|
|
$delete_folder = false , |
|
|
|
$download = false , |
|
|
|
$files_visible = false , |
|
|
|
$folders_visible = false |
|
) |
| |
- Parameters
-
ilObjCloudGUI | $gui_class | |
| $id | |
bool | $delete_files | |
bool | $delete_folder | |
bool | $download | |
bool | $files_visible | |
bool | $folders_visible | |
- Returns
- string
- Exceptions
-
Definition at line 70 of file class.ilCloudPluginFileTreeGUI.php.
References $DIC, $lng, getFileTree(), getItemHtml(), ilCloudException\ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION, setBlockVariablePlugin(), and setTreeVariablePlugin().
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();
setTreeVariablePlugin(ilTemplate $tree_tpl, ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false)
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
setBlockVariablePlugin(ilTemplate $block)
getItemHtml(ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files=false, $delete_folder=false, $download=false)
◆ getItemHtml()
ilCloudPluginFileTreeGUI::getItemHtml |
( |
ilCloudFileNode |
$node, |
|
|
ilObjCloudGUI |
$gui_class, |
|
|
|
$delete_files = false , |
|
|
|
$delete_folder = false , |
|
|
|
$download = false |
|
) |
| |
- Parameters
-
- Returns
- string
Definition at line 157 of file class.ilCloudPluginFileTreeGUI.php.
References $DIC, $ilCtrl, formatBytes(), ilDatePresentation\formatDate(), ilCloudConnector\getActionListGUIClass(), ilCloudFileNode\getIconPath(), ilCloudFileNode\getId(), ilUtil\getImagePath(), ilCloudFileNode\getIsDir(), getLinkToFolder(), ilCloudFileNode\getModified(), ilCloudFileNode\getPath(), ilCloudPluginGUI\getService(), ilCloudFileNode\getSize(), IL_CAL_UNIX, and setItemVariablePlugin().
Referenced by getFolderHtml().
162 $item =
new ilTemplate(
"tpl.container_list_item.html",
true,
true,
"Services/Container/");
165 $item->setVariable(
"COMMAND_SELECTION_LIST", $action_list_gui->getSelectionListItemsHTML($delete_files, $delete_folder, $node));
167 $item->setVariable(
"DIV_CLASS",
"ilContainerListItemOuter");
168 $item->touchBlock(
"d_1");
170 include_once(
'./Services/Calendar/classes/class.ilDate.php');
174 $item->setVariable(
"SRC_ICON", $node->
getIconPath());
183 $item->setVariable(
"TXT_TITLE_LINKED", htmlspecialchars(basename($node->
getPath())));
184 $item->setVariable(
"HREF_TITLE_LINKED", $this->
getLinkToFolder($node));
197 $item->setVariable(
"TXT_TITLE_LINKED", htmlspecialchars(basename($node->
getPath())));
198 $item->setVariable(
"HREF_TITLE_LINKED",
$ilCtrl->getLinkTarget($gui_class,
"getFile") .
"&id=" . $node->
getId());
200 $item->setVariable(
"TXT_TITLE", htmlspecialchars(basename($node->
getPath())));
static getActionListGUIClass(ilCloudPluginService $plugin_service_class)
formatBytes($bytes, $precision=2)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
setItemVariablePlugin(ilTemplate $item, ilCloudFileNode $node)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getLinkToFolder(ilCloudFileNode $node)
◆ getLinkToFolder()
◆ getLocatorHtml()
◆ setBlockVariablePlugin()
ilCloudPluginFileTreeGUI::setBlockVariablePlugin |
( |
ilTemplate |
$block | ) |
|
|
protected |
◆ setFileTree()
◆ setItemVariablePlugin()
◆ setTreeVariablePlugin()
ilCloudPluginFileTreeGUI::setTreeVariablePlugin |
( |
ilTemplate |
$tree_tpl, |
|
|
ilObjCloudGUI |
$gui_class, |
|
|
|
$id, |
|
|
|
$delete_files = false , |
|
|
|
$delete_folder = false , |
|
|
|
$download = false , |
|
|
|
$files_visible = false , |
|
|
|
$folders_visible = false |
|
) |
| |
◆ $file_tree
ilCloudPluginFileTreeGUI::$file_tree |
|
protected |
The documentation for this class was generated from the following file: