4include_once(
"class.ilObjCloudGUI.php");
 
    5include_once(
"class.ilCloudFileNode.php");
 
    6include_once(
"class.ilCloudFileTree.php");
 
    7include_once(
"class.ilCloudConnector.php");
 
   31                parent::__construct($plugin_service_class);
 
   66        public function getFolderHtml(
ilObjCloudGUI $gui_class, $id, $delete_files = 
false, $delete_folder = 
false, $download = 
false, $files_visible = 
false, $folders_visible = 
false) {
 
   76                $tree_tpl = 
new ilTemplate(
"tpl.cloud_block.html", 
true, 
true, 
"Modules/Cloud/");
 
   78                if ($files_visible || $folders_visible) {
 
   79                        $tree_tpl->setVariable(
"NODE_ID", $node->getId());
 
   81                        $block = 
new ilTemplate(
"tpl.container_list_block.html", 
true, 
true, 
"Services/Container/");
 
   83                        if ($node->hasChildren()) {
 
   84                                $block->setVariable(
"BLOCK_HEADER_CONTENT", 
$lng->txt(
"content"));
 
   86                                $children = $this->
getFileTree()->getSortedListOfChildren($node);
 
   87                                foreach ($children as 
$path) {
 
   88                                        $child_node = $this->
getFileTree()->getNodeFromPath($path);
 
   89                                        if (($child_node->getIsDir() && $folders_visible) || (!$child_node->getIsDir() && $files_visible)) {
 
   91                                                $block->setCurrentBlock(
"container_standard_row");
 
   92                                                if ($child_node->getIsDir()) {
 
   93                                                        $block->setVariable(
"ROW_ID", 
"id=xcld_folder_" . $child_node->getId());
 
   95                                                        $block->setVariable(
"ROW_ID", 
"id=xcld_file_" . $child_node->getId());
 
   97                                                $block->setVariable(
"BLOCK_ROW_CONTENT", $this->
getItemHtml($child_node, $gui_class, $delete_files, $delete_folder, $download));
 
   98                                                $block->parseCurrentBlock();
 
  103                        $tree_tpl->setVariable(
"CONTENT", $block->get());
 
  108                $this->
setTreeVariablePlugin($tree_tpl, $gui_class, $id, $delete_files, $delete_folder, $download, $files_visible, $folders_visible);
 
  110                return $tree_tpl->get();
 
  145                $item = 
new ilTemplate(
"tpl.container_list_item.html", 
true, 
true, 
"Services/Container/");
 
  148                $item->setVariable(
"COMMAND_SELECTION_LIST", $action_list_gui->getSelectionListItemsHTML($delete_files, $delete_folder, $node));
 
  150                $item->setVariable(
"DIV_CLASS", 
"ilContainerListItemOuter");
 
  151                $item->touchBlock(
"d_1");
 
  153                include_once(
'./Services/Calendar/classes/class.ilDate.php');
 
  157                        $item->setVariable(
"SRC_ICON", $node->
getIconPath());
 
  166                        $item->setVariable(
"TXT_DESC", 
' ');
 
  167                        $item->setVariable(
"TXT_TITLE_LINKED", basename($node->
getPath()));
 
  168                        $item->setVariable(
"HREF_TITLE_LINKED", $this->
getLinkToFolder($node));
 
  176                        $item->setVariable(
"TXT_DESC",
 
  179                                $item->setVariable(
"TXT_TITLE_LINKED", basename($node->
getPath()));
 
  180                                $item->setVariable(
"HREF_TITLE_LINKED", 
$ilCtrl->getLinkTarget($gui_class, 
"getFile") . 
"&id=" . $node->
getId());
 
  182                                $item->setVariable(
"TXT_TITLE", basename($node->
getPath()));
 
  199                if ($bytes >= 1073741824)
 
  201                        $bytes = number_format($bytes / 1073741824, $precision) . 
' GB';
 
  203                elseif ($bytes >= 1048576)
 
  205                        $bytes = number_format($bytes / 1048576, $precision) . 
' MB';
 
  207                elseif ($bytes >= 1024)
 
  209                        $bytes = number_format($bytes / 1024, $precision) . 
' KB';
 
  213                        $bytes = $bytes . 
' bytes';
 
  217                        $bytes = $bytes . 
' byte';
 
  243                if ($node == $this->
getFileTree()->getRootNode()) {
 
  248                        $ilLocator->addItem(basename($node->
getPath()), $this->getLinkToFolder($node));
 
  251                return "<DIV class='xcld_locator' id='xcld_locator_" . $node->
getId() . 
"'>" . $ilLocator->getHTML() . 
"</DIV>";
 
  267                $options->dropZone = 
".ilFileUploadDropZone_1";
 
  268                $options->fileInput = 
"#ilFileUploadInput_1";
 
  269                $options->submitButton = 
"uploadFiles";
 
  270                $options->cancelButton = 
"cancelAll";
 
  271                $options->dropArea = 
".ilFileDropTarget";
 
  272                $options->fileList = 
"#ilFileUploadList_1";
 
  273                $options->fileSelectButton = 
"#ilFileUploadFileSelect_1";
 
  274                echo 
"<script language='javascript' type='text/javascript'>var fileUpload1 = new ilFileUpload(1, " . 
ilJsonUtil::encode(
$options)
 
  286                return str_replace(
'%2F', 
'/', rawurlencode($str));
 
An exception for terminatinating execution or to throw for unit testing.
static getActionListGUIClass(ilCloudPluginService $plugin_service_class)
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
setFileTree(ilCloudFileTree $file_tree)
getItemHtml(ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files=false, $delete_folder=false, $download=false)
setTreeVariablePlugin(ilTemplate $tree_tpl, ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false)
setBlockVariablePlugin(ilTemplate $block)
static _urlencode($str)
urlencode without encoding slashes
static getLinkToFolder(ilCloudFileNode $node)
__construct($plugin_service_class, ilCloudFileTree $file_tree)
getFolderHtml(ilObjCloudGUI $gui_class, $id, $delete_files=false, $delete_folder=false, $download=false, $files_visible=false, $folders_visible=false)
setItemVariablePlugin(ilTemplate $item, ilCloudFileNode $node)
getLocatorHtml(ilCloudFileNode $node)
formatBytes($bytes, $precision=2)
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static encode($mixed, $suppress_native=false)
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!is_array($argv)) $options