ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCloudPluginActionListGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 require_once('./Modules/Cloud/classes/class.ilCloudPluginListGUI.php');
4 
19 {
20 
24  protected $selection_list;
28  protected $node = null;
29 
30 
38  public function getSelectionListItemsHTML($delete_item = false, $delete_folder = false, ilCloudFileNode $node)
39  {
40  global $DIC;
41  $lng = $DIC['lng'];
42  $ilCtrl = $DIC['ilCtrl'];
43 
48  $this->node = $node;
49 
50  if (($delete_item && !$node->getIsDir()) || ($delete_folder && $node->getIsDir()) || $this->checkHasAction()) {
51  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
52  $this->selection_list = new ilAdvancedSelectionListGUI();
53  $this->selection_list->setId("id_action_list_" . $this->node->getId());
54  $this->selection_list->setListTitle($lng->txt("actions"));
55  $this->selection_list->setItemLinkClass("xsmall");
56 
57  if ($this->getAsyncMode()) {
58  $this->selection_list->setAsynch(true);
59  $this->selection_list->setAsynchUrl(html_entity_decode($ilCtrl->getLinkTargetByClass("ilobjcloudgui", "asyncGetActionListContent", false)
60  . "&node_id=" . $node->getId()));
61  } else {
62  $this->addSelectionListItems($delete_item, $delete_folder);
63  }
64 
65  return $this->selection_list->getHtml();
66  } else {
67  return "";
68  }
69  }
70 
71 
76  protected function addSelectionListItems($delete_item, $delete_folder)
77  {
78  global $DIC;
79  $lng = $DIC['lng'];
80  $this->addItemsBefore();
81  if (($delete_item && !$this->node->getIsDir()) || ($delete_folder && $this->node->getIsDir())) {
82  $this->selection_list->addItem($lng->txt("delete"), "delete_item", "javascript:il.CloudFileList.deleteItem('" . $this->node->getId()
83  . "');");
84  }
85 
86  $this->addItemsAfter();
87  }
88 
89 
95  public function asyncGetContent($delete_item = false, $delete_folder = false, ilCloudFileNode $node)
96  {
97  global $DIC;
98  $lng = $DIC['lng'];
99  $this->node = $node;
100  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
101  $this->selection_list = new ilAdvancedSelectionListGUI();
102  $this->selection_list->setId($this->node->getId());
103  $this->selection_list->setListTitle($lng->txt("actions"));
104  $this->selection_list->setItemLinkClass("xsmall");
105 
106  $this->addSelectionListItems($delete_item, $delete_folder);
107  if ($this->selection_list->getItems() != null) {
108  echo $this->selection_list->getHTML(true);
109  exit;
110  } else {
111  echo $lng->txt("empty");
112  exit;
113  }
114  }
115 
116 
117  protected function addItemsBefore()
118  {
119  }
120 
121 
122  protected function addItemsAfter()
123  {
124  }
125 
126 
127  protected function checkHasAction()
128  {
129  }
130 
131 
135  protected function getAsyncMode()
136  {
137  return true;
138  }
139 }
exit
Definition: login.php:29
asyncGetContent($delete_item=false, $delete_folder=false, ilCloudFileNode $node)
addSelectionListItems($delete_item, $delete_folder)
$lng
global $DIC
Definition: goto.php:24
Class ilCloudPluginListGUI.
Class ilCloudPluginActionListGUI.
ilCloudFileTree class