/** * @param ilCloudFileNode $node * @param ilObjCloudGUI $gui_class * @param bool $delete_files * @param bool $delete_folder * @param bool $download * * @return string */ public function getItemHtml(ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files = false, $delete_folder = false, $download = false) { global $ilCtrl; $item = new ilTemplate("tpl.container_list_item.html", true, true, "Services/Container/"); $action_list_gui = ilCloudConnector::getActionListGUIClass($this->getService()); $item->setVariable("COMMAND_SELECTION_LIST", $action_list_gui->getSelectionListItemsHTML($delete_files, $delete_folder, $node)); $item->setVariable("DIV_CLASS", "ilContainerListItemOuter"); $item->touchBlock("d_1"); include_once './Services/Calendar/classes/class.ilDate.php'; $modified = ilDatePresentation::formatDate(new ilDateTime($node->getModified(), IL_CAL_UNIX)); if ($node->getIconPath() != "") { $item->setVariable("SRC_ICON", $node->getIconPath()); } // Folder with content if ($node->getIsDir()) { if ($node->getIconPath() == "") { // $item->setVariable("SRC_ICON", "./Modules/Cloud/templates/images/icon_folder_b.png"); $item->setVariable("SRC_ICON", ilUtil::getImagePath('icon_fold.svg')); } $item->setVariable("TXT_DESC", ' '); $item->setVariable("TXT_TITLE_LINKED", basename($node->getPath())); $item->setVariable("HREF_TITLE_LINKED", $this->getLinkToFolder($node)); } else { if ($node->getIconPath() == "") { // $item->setVariable("SRC_ICON", "./Modules/Cloud/templates/images/icon_file_b.png"); $item->setVariable("SRC_ICON", ilUtil::getImagePath('icon_file.svg')); } $item->setVariable("TXT_DESC", pathinfo($node->getPath(), PATHINFO_EXTENSION) . " " . $node->getSize() . " " . $modified); if ($download) { $item->setVariable("TXT_TITLE_LINKED", basename($node->getPath())); $item->setVariable("HREF_TITLE_LINKED", $ilCtrl->getLinkTarget($gui_class, "getFile") . "&id=" . $node->getId()); } else { $item->setVariable("TXT_TITLE", basename($node->getPath())); } } $this->setItemVariablePlugin($item, $node); return $item->get(); }
function asyncGetActionListContent() { $action_list = ilCloudConnector::getActionListGUIClass($this->plugin_service); $file_tree = ilCloudFileTree::getFileTreeFromSession(); return $action_list->asyncGetContent($this->checkPermissionBool("delete_files"), $this->checkPermissionBool("delete_folders"), $file_tree->getNodeFromId($_GET["node_id"])); }