ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
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 global $DIC;
78 $lng = $DIC['lng'];
79 $this->addItemsBefore();
80 if (($delete_item && !$this->node->getIsDir()) || ($delete_folder && $this->node->getIsDir())) {
81 $this->selection_list->addItem($lng->txt("delete"), "delete_item", "javascript:il.CloudFileList.deleteItem(\'" . $this->node->getId()
82 . "\');");
83 }
84
85 $this->addItemsAfter();
86 }
87
88
94 public function asyncGetContent($delete_item = false, $delete_folder = false, ilCloudFileNode $node) {
95 global $DIC;
96 $lng = $DIC['lng'];
97 $this->node = $node;
98 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
99 $this->selection_list = new ilAdvancedSelectionListGUI();
100 $this->selection_list->setId($this->node->getId());
101 $this->selection_list->setListTitle($lng->txt("actions"));
102 $this->selection_list->setItemLinkClass("xsmall");
103
104 $this->addSelectionListItems($delete_item, $delete_folder);
105 if ($this->selection_list->getItems() != NULL) {
106 echo $this->selection_list->getHTML(true);
107 exit;
108 } else {
109 echo $lng->txt("empty");
110 exit;
111 }
112 }
113
114
115 protected function addItemsBefore() { }
116
117
118 protected function addItemsAfter() { }
119
120
121 protected function checkHasAction() { }
122
123
127 protected function getAsyncMode() {
128 return true;
129 }
130}
131
132?>
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 $lng
Definition: privfeed.php:17
global $DIC