ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCloudPluginFileTreeGUI Class Reference

Class ilCloudFileTree. More...

+ Inheritance diagram for ilCloudPluginFileTreeGUI:
+ Collaboration diagram for ilCloudPluginFileTreeGUI:

Public Member Functions

 __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)
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 getPluginObject ()
 getPluginHookObject ()
 getAdminConfigObject ()
 getService ()
 txt ($var="")
 executeCommand ()

Static Public Member Functions

static getLinkToFolder (ilCloudFileNode $node)

Protected Member Functions

 setBlockVariablePlugin (ilTemplate $block)
 setItemVariablePlugin (ilTemplate $item, ilCloudFileNode $node)
 addDropZone ()

Protected Attributes

 $file_tree
- Protected Attributes inherited from ilCloudPluginGUI
 $service = null

Detailed Description

Class ilCloudFileTree.

Class for drawing the file tree.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 19 of file class.ilCloudPluginFileTreeGUI.php.

Constructor & Destructor Documentation

ilCloudPluginFileTreeGUI::__construct (   $plugin_service_class,
ilCloudFileTree  $file_tree 
)
Parameters
ilCloudFileTree$file_tree

Definition at line 30 of file class.ilCloudPluginFileTreeGUI.php.

References setFileTree().

{
parent::__construct($plugin_service_class);
$this->setFileTree($file_tree);
}

+ Here is the call graph for this function:

Member Function Documentation

ilCloudPluginFileTreeGUI::addDropZone ( )
protected

Definition at line 227 of file class.ilCloudPluginFileTreeGUI.php.

References $options, and ilJsonUtil\encode().

{
$options = new stdClass();
$options->dropZone = ".ilFileUploadDropZone_1";
$options->fileInput = "#ilFileUploadInput_1";
$options->submitButton = "uploadFiles";
$options->cancelButton = "cancelAll";
$options->dropArea = ".ilFileDropTarget";
$options->fileList = "#ilFileUploadList_1";
$options->fileSelectButton = "#ilFileUploadFileSelect_1";
echo "<script language='javascript' type='text/javascript'>var fileUpload1 = new ilFileUpload(1, " . ilJsonUtil::encode($options)
. ");</script>";
}

+ Here is the call graph for this function:

ilCloudPluginFileTreeGUI::getFileTree ( )
Returns
ilCloudFileTree

Definition at line 49 of file class.ilCloudPluginFileTreeGUI.php.

References $file_tree.

Referenced by getFolderHtml(), and getLocatorHtml().

{
}

+ Here is the caller graph for this function:

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
ilCloudException

Definition at line 66 of file class.ilCloudPluginFileTreeGUI.php.

References $lng, $path, getFileTree(), getItemHtml(), ilCloudException\ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION, setBlockVariablePlugin(), and setTreeVariablePlugin().

{
global $lng;
$node = NULL;
$node = $this->getFileTree()->getNodeFromId($id);
if (!$node) {
}
$tree_tpl = new ilTemplate("tpl.cloud_block.html", true, true, "Modules/Cloud/");
if ($files_visible || $folders_visible) {
$tree_tpl->setVariable("NODE_ID", $node->getId());
$block = new ilTemplate("tpl.container_list_block.html", true, true, "Services/Container/");
if ($node->hasChildren()) {
$block->setVariable("BLOCK_HEADER_CONTENT", $lng->txt("content"));
$children = $this->getFileTree()->getSortedListOfChildren($node);
foreach ($children as $path) {
$child_node = $this->getFileTree()->getNodeFromPath($path);
if (($child_node->getIsDir() && $folders_visible) || (!$child_node->getIsDir() && $files_visible)) {
$block->setCurrentBlock("container_standard_row");
if ($child_node->getIsDir()) {
$block->setVariable("ROW_ID", "id=xcld_folder_" . $child_node->getId());
} else {
$block->setVariable("ROW_ID", "id=xcld_file_" . $child_node->getId());
}
$block->setVariable("BLOCK_ROW_CONTENT", $this->getItemHtml($child_node, $gui_class, $delete_files, $delete_folder, $download));
$block->parseCurrentBlock();
}
}
}
$this->setBlockVariablePlugin($block);
$tree_tpl->setVariable("CONTENT", $block->get());
} else {
// Nothing is visible
// $tree_tpl->setVariable("CONTENT", $lng->txt("file_folder_not_visible"));
}
$this->setTreeVariablePlugin($tree_tpl, $gui_class, $id, $delete_files, $delete_folder, $download, $files_visible, $folders_visible);
return $tree_tpl->get();
}

+ Here is the call graph for this function:

ilCloudPluginFileTreeGUI::getItemHtml ( ilCloudFileNode  $node,
ilObjCloudGUI  $gui_class,
  $delete_files = false,
  $delete_folder = false,
  $download = false 
)
Parameters
ilCloudFileNode$node
ilObjCloudGUI$gui_class
bool$delete_files
bool$delete_folder
bool$download
Returns
string

Definition at line 140 of file class.ilCloudPluginFileTreeGUI.php.

References $ilCtrl, 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().

{
global $ilCtrl;
$item = new ilTemplate("tpl.container_list_item.html", true, true, "Services/Container/");
$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');
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_dcl_fold.svg'));
}
$item->setVariable("TXT_DESC", '&nbsp;');
$item->setVariable("TXT_TITLE_LINKED", basename($node->getPath()));
$item->setVariable("HREF_TITLE_LINKED", $this->getLinkToFolder($node));
} // File
else {
if ($node->getIconPath() == "") {
// $item->setVariable("SRC_ICON", "./Modules/Cloud/templates/images/icon_file_b.png");
$item->setVariable("SRC_ICON", ilUtil::getImagePath('icon_dcl_file.svg'));
}
$item->setVariable("TXT_DESC",
pathinfo($node->getPath(), PATHINFO_EXTENSION) . "&nbsp;&nbsp;&nbsp;" . $node->getSize() . "&nbsp;&nbsp;&nbsp;" . $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();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilCloudPluginFileTreeGUI::getLinkToFolder ( ilCloudFileNode  $node)
static
Parameters
ilCloudFileNode$node
Returns
string

Definition at line 222 of file class.ilCloudPluginFileTreeGUI.php.

References ilCloudFileNode\getId(), ilCloudFileNode\getParentId(), and ilCloudFileNode\getPath().

Referenced by ilCloudPluginInitGUI\addToolbar(), getItemHtml(), and getLocatorHtml().

{
return "#/open_folder?id_parent=" . $node->getParentId() . "&current_id=" . $node->getId() . "&current_path=" . $node->getPath();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCloudPluginFileTreeGUI::getLocatorHtml ( ilCloudFileNode  $node)
Parameters
ilCloudFileNode$node
Returns
string

Definition at line 202 of file class.ilCloudPluginFileTreeGUI.php.

References getFileTree(), ilCloudFileNode\getId(), getLinkToFolder(), ilCloudFileNode\getParentId(), ilCloudFileNode\getPath(), and ilCloudPluginGUI\getPluginObject().

{
global $ilLocator;
if ($node == $this->getFileTree()->getRootNode()) {
$ilLocator = new ilLocatorGUI();
$ilLocator->addItem($this->getPluginObject()->getCloudModulObject()->getTitle(), ilCloudPluginFileTreeGUI::getLinkToFolder($node));
} else {
$this->getLocatorHtml($this->getFileTree()->getNodeFromId($node->getParentId()));
$ilLocator->addItem(basename($node->getPath()), $this->getLinkToFolder($node));
}
return "<DIV class='xcld_locator' id='xcld_locator_" . $node->getId() . "'>" . $ilLocator->getHTML() . "</DIV>";
}

+ Here is the call graph for this function:

ilCloudPluginFileTreeGUI::setBlockVariablePlugin ( ilTemplate  $block)
protected
Parameters
ilTemplate$block

Definition at line 128 of file class.ilCloudPluginFileTreeGUI.php.

Referenced by getFolderHtml().

{ }

+ Here is the caller graph for this function:

ilCloudPluginFileTreeGUI::setFileTree ( ilCloudFileTree  $file_tree)
Parameters
ilCloudFileTree$file_tree

Definition at line 39 of file class.ilCloudPluginFileTreeGUI.php.

References $file_tree.

Referenced by __construct().

{
if ($file_tree) {
$this->file_tree = $file_tree;
}
}

+ Here is the caller graph for this function:

ilCloudPluginFileTreeGUI::setItemVariablePlugin ( ilTemplate  $item,
ilCloudFileNode  $node 
)
protected
Parameters
ilTemplate$item
ilCloudFileNode$node

Definition at line 194 of file class.ilCloudPluginFileTreeGUI.php.

Referenced by getItemHtml().

{ }

+ Here is the caller graph for this function:

ilCloudPluginFileTreeGUI::setTreeVariablePlugin ( ilTemplate  $tree_tpl,
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

Definition at line 122 of file class.ilCloudPluginFileTreeGUI.php.

Referenced by getFolderHtml().

{ }

+ Here is the caller graph for this function:

Field Documentation

ilCloudPluginFileTreeGUI::$file_tree
protected

Definition at line 24 of file class.ilCloudPluginFileTreeGUI.php.

Referenced by getFileTree(), and setFileTree().


The documentation for this class was generated from the following file: