ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCloudConnector.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('./Modules/Cloud/exceptions/class.ilCloudException.php');
5include_once('class.ilCloudPluginItemCreationListGUI.php');
6include_once('class.ilCloudPluginActionListGUI.php');
7include_once('class.ilCloudPlugin.php');
8include_once('class.ilCloudPluginInitGUI.php');
9include_once('class.ilCloudPluginSettingsGUI.php');
10include_once('class.ilCloudPluginService.php');
11include_once('class.ilCloudPluginFileTreeGUI.php');
12include_once('class.ilCloudPluginUploadGUI.php');
13include_once('class.ilCloudPluginDeleteGUI.php');
14include_once('class.ilCloudPluginCreateFolderGUI.php');
15include_once('class.ilCloudPluginHeaderActionGUI.php');
16include_once('class.ilCloudPluginCreationGUI.php');
17include_once('class.ilCloudPluginInfoScreenGUI.php');
18
31{
32
37 public static function getActiveServices()
38 {
39 global $DIC;
40 $ilPluginAdmin = $DIC['ilPluginAdmin'];
41
42 $cloud_services = $ilPluginAdmin->getActivePluginsForSlot("Modules", "Cloud", "cldh");
43 if (!$cloud_services) {
45 }
46 $services_names = array();
47 foreach ($cloud_services as $service) {
48 $services_names[$service] = $service;
49 }
50
51 return $services_names;
52 }
53
54
61 public static function checkServiceActive($name)
62 {
63 if (!$name) {
65 }
66
67 if (array_key_exists($name, ilCloudConnector::getActiveServices())) {
68 return true;
69 } else {
71 }
72 }
73
74
81 protected static function getFullClassName($service_name, $class_name)
82 {
83 if (file_exists("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php")) {
84 include_once("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php");
85 $class_full_name = "il" . $service_name . $class_name;
86
87 return $class_full_name;
88 }
89
90 return "ilCloudPlugin" . $class_name;
91 }
92
93
102 public static function getServiceClass($service_name, $obj_id, $connect = true)
103 {
104 if (!$service_name) {
106 }
107
108 if (array_key_exists($service_name, ilCloudConnector::getActiveServices())) {
109 $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
110
111 return new $class_name($service_name, $obj_id);
112 } else {
114 }
115 }
116
117
124 public static function getPluginClass($service_name, $obj_id)
125 {
126 $class_name = ilCloudConnector::getFullClassName($service_name, "");
127
128 return new $class_name($service_name, $obj_id);
129 }
130
131
138 public static function getPluginHookClass($service_name)
139 {
140 $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
141
142 return new $class_name($service_name);
143 }
144
145
152 public static function getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
153 {
154 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
155
156 return new $class_name($plugin_service_class);
157 }
158
159
166 public static function getActionListGUIClass(ilCloudPluginService $plugin_service_class)
167 {
168 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
169
170 return new $class_name($plugin_service_class);
171 }
172
173
180 public static function getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
181 {
182 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
183
184 return new $class_name($plugin_service_class);
185 }
186
187
194 public static function getInitGUIClass(ilCloudPluginService $plugin_service_class)
195 {
196 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
197
198 return new $class_name($plugin_service_class);
199 }
200
201
209 public static function getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
210 {
211 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
212
213 return new $class_name($plugin_service_class, $file_tree);
214 }
215
216
223 public static function getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
224 {
225 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
226
227 return new $class_name($plugin_service_class);
228 }
229
230
237 public static function getUploadGUIClass(ilCloudPluginService $plugin_service_class)
238 {
239 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
240
241 return new $class_name($plugin_service_class);
242 }
243
244
250 public static function getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
251 {
252 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
253
254 return new $class_name($plugin_service_class);
255 }
256
257
263 public static function getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
264 {
265 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
266
267 return new $class_name($plugin_service_class);
268 }
269
270
276 public static function getCreationGUIClass(ilCloudPluginService $plugin_service_class)
277 {
278 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
279
280 return new $class_name($plugin_service_class);
281 }
282
283
289 public static function getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
290 {
291 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
292
293 return new $class_name($plugin_service_class);
294 }
295}
An exception for terminatinating execution or to throw for unit testing.
ilCloudConnector class Needed to check if a a plugin making a conncection to a service like GoogleDri...
static getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
static checkServiceActive($name)
static getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
static getFullClassName($service_name, $class_name)
static getPluginClass($service_name, $obj_id)
static getCreationGUIClass(ilCloudPluginService $plugin_service_class)
static getServiceClass($service_name, $obj_id, $connect=true)
static getInitGUIClass(ilCloudPluginService $plugin_service_class)
static getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
static getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
static getActionListGUIClass(ilCloudPluginService $plugin_service_class)
static getPluginHookClass($service_name)
static getUploadGUIClass(ilCloudPluginService $plugin_service_class)
static getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
static getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
static getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
Class ilCloudException.
ilCloudFileTree class
Class ilCloudPluginService.
getPluginHookObject()
For shorter access.
global $DIC
Definition: goto.php:24
if($format !==null) $name
Definition: metadata.php:230
$service
Definition: result.php:17