ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
44 {
46 }
47 $services_names = array();
48 foreach ($cloud_services as $service)
49 {
50 $services_names[$service] = $service;
51 }
52 return $services_names;
53 }
54
60 public static function checkServiceActive($name)
61 {
62 if (!$name)
63 {
65 }
66
67 if (array_key_exists($name, ilCloudConnector::getActiveServices()))
68 {
69 return true;
70 } else
71 {
73 }
74 }
75
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 {
85 include_once("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" .$service_name . $class_name.".php");
86 $class_full_name = "il" . $service_name . $class_name;
87 return $class_full_name;
88 }
89 return "ilCloudPlugin" .$class_name;
90 }
98 public static function getServiceClass($service_name, $obj_id, $connect = true)
99 {
100 if (!$service_name)
101 {
103 }
104
105 if (array_key_exists($service_name, ilCloudConnector::getActiveServices()))
106 {
107 $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
108 return new $class_name($service_name, $obj_id);
109 } else
110 {
112 }
113 }
114
120 public static function getPluginClass($service_name, $obj_id)
121 {
122 $class_name = ilCloudConnector::getFullClassName($service_name, "");
123 return new $class_name($service_name, $obj_id);
124 }
125
131 public static function getPluginHookClass($service_name)
132 {
133 $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
134 return new $class_name($service_name);
135 }
136
142 public static function getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
143 {
144 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
145 return new $class_name($plugin_service_class);
146 }
147
153 public static function getActionListGUIClass(ilCloudPluginService $plugin_service_class)
154 {
155 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
156 return new $class_name($plugin_service_class);
157 }
158
164 public static function getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
165 {
166 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
167 return new $class_name($plugin_service_class);
168 }
169
175 public static function getInitGUIClass(ilCloudPluginService $plugin_service_class)
176 {
177 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
178 return new $class_name($plugin_service_class);
179 }
180
187 public static function getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
188 {
189 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
190 return new $class_name($plugin_service_class, $file_tree);
191 }
192
198 public static function getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
199 {
200 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
201 return new $class_name($plugin_service_class);
202 }
203
209 public static function getUploadGUIClass(ilCloudPluginService $plugin_service_class)
210 {
211 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
212 return new $class_name($plugin_service_class);
213 }
214
219 public static function getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
220 {
221 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
222 return new $class_name($plugin_service_class);
223 }
224
229 public static function getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
230 {
231 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
232 return new $class_name($plugin_service_class);
233 }
234
239 public static function getCreationGUIClass(ilCloudPluginService $plugin_service_class)
240 {
241 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
242 return new $class_name($plugin_service_class);
243 }
244
249 public static function getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
250 {
251 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
252 return new $class_name($plugin_service_class);
253 }
254}
255?>
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