ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
4include_once("class.ilCloudPluginListGUI.php");
5
20{
21
25 protected $selection_list;
29 protected $node = null;
30
31
39 public function getSelectionListItemsHTML($delete_item = false, $delete_folder = false, ilCloudFileNode $node)
40 {
41 global $DIC;
42 $lng = $DIC['lng'];
43 $ilCtrl = $DIC['ilCtrl'];
44
49 $this->node = $node;
50
51 if (($delete_item && !$node->getIsDir()) || ($delete_folder && $node->getIsDir()) || $this->checkHasAction()) {
52 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
53 $this->selection_list = new ilAdvancedSelectionListGUI();
54 $this->selection_list->setId("id_action_list_" . $this->node->getId());
55 $this->selection_list->setListTitle($lng->txt("actions"));
56 $this->selection_list->setItemLinkClass("xsmall");
57
58 if ($this->getAsyncMode()) {
59 $this->selection_list->setAsynch(true);
60 $this->selection_list->setAsynchUrl(html_entity_decode($ilCtrl->getLinkTargetByClass("ilobjcloudgui", "asyncGetActionListContent", false)
61 . "&node_id=" . $node->getId()));
62 } else {
63 $this->addSelectionListItems($delete_item, $delete_folder);
64 }
65
66 return $this->selection_list->getHtml();
67 } else {
68 return "";
69 }
70 }
71
72
77 protected function addSelectionListItems($delete_item, $delete_folder)
78 {
79 global $DIC;
80 $lng = $DIC['lng'];
81 $this->addItemsBefore();
82 if (($delete_item && !$this->node->getIsDir()) || ($delete_folder && $this->node->getIsDir())) {
83 $this->selection_list->addItem($lng->txt("delete"), "delete_item", "javascript:il.CloudFileList.deleteItem(\'" . $this->node->getId()
84 . "\');");
85 }
86
87 $this->addItemsAfter();
88 }
89
90
96 public function asyncGetContent($delete_item = false, $delete_folder = false, ilCloudFileNode $node)
97 {
98 global $DIC;
99 $lng = $DIC['lng'];
100 $this->node = $node;
101 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
102 $this->selection_list = new ilAdvancedSelectionListGUI();
103 $this->selection_list->setId($this->node->getId());
104 $this->selection_list->setListTitle($lng->txt("actions"));
105 $this->selection_list->setItemLinkClass("xsmall");
106
107 $this->addSelectionListItems($delete_item, $delete_folder);
108 if ($this->selection_list->getItems() != null) {
109 echo $this->selection_list->getHTML(true);
110 exit;
111 } else {
112 echo $lng->txt("empty");
113 exit;
114 }
115 }
116
117
118 protected function addItemsBefore()
119 {
120 }
121
122
123 protected function addItemsAfter()
124 {
125 }
126
127
128 protected function checkHasAction()
129 {
130 }
131
132
136 protected function getAsyncMode()
137 {
138 return true;
139 }
140}
exit
Definition: backend.php:16
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
ilCloudFileTree class
Class ilCloudPluginActionListGUI.
asyncGetContent($delete_item=false, $delete_folder=false, ilCloudFileNode $node)
addSelectionListItems($delete_item, $delete_folder)
Class ilCloudPluginListGUI.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
$lng