ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $ilPluginAdmin;
40
41 $cloud_services = $ilPluginAdmin->getActivePluginsForSlot("Modules", "Cloud", "cldh");
42 if (!$cloud_services)
43 {
45 }
46 $services_names = array();
47 foreach ($cloud_services as $service)
48 {
49 $services_names[$service] = $service;
50 }
51 return $services_names;
52 }
53
59 public static function checkServiceActive($name)
60 {
61 if (!$name)
62 {
64 }
65
66 if (array_key_exists($name, ilCloudConnector::getActiveServices()))
67 {
68 return true;
69 } else
70 {
72 }
73 }
74
80 protected static function getFullClassName($service_name, $class_name)
81 {
82 if (file_exists("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" .$service_name . $class_name.".php"))
83 {
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 return $class_full_name;
87 }
88 return "ilCloudPlugin" .$class_name;
89 }
97 public static function getServiceClass($service_name, $obj_id, $connect = true)
98 {
99 if (!$service_name)
100 {
102 }
103
104 if (array_key_exists($service_name, ilCloudConnector::getActiveServices()))
105 {
106 $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
107 return new $class_name($service_name, $obj_id);
108 } else
109 {
111 }
112 }
113
119 public static function getPluginClass($service_name, $obj_id, $cloud_module_object = null)
120 {
121 $class_name = ilCloudConnector::getFullClassName($service_name, "");
122 return new $class_name($service_name, $obj_id, $cloud_module_object);
123 }
124
130 public static function getPluginHookClass($service_name)
131 {
132 $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
133 return new $class_name($service_name);
134 }
135
141 public static function getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
142 {
143 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
144 return new $class_name($plugin_service_class);
145 }
146
152 public static function getActionListGUIClass(ilCloudPluginService $plugin_service_class)
153 {
154 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
155 return new $class_name($plugin_service_class);
156 }
157
163 public static function getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
164 {
165 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
166 return new $class_name($plugin_service_class);
167 }
168
174 public static function getInitGUIClass(ilCloudPluginService $plugin_service_class)
175 {
176 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
177 return new $class_name($plugin_service_class);
178 }
179
186 public static function getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
187 {
188 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
189 return new $class_name($plugin_service_class, $file_tree);
190 }
191
197 public static function getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
198 {
199 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
200 return new $class_name($plugin_service_class);
201 }
202
208 public static function getUploadGUIClass(ilCloudPluginService $plugin_service_class)
209 {
210 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
211 return new $class_name($plugin_service_class);
212 }
213
218 public static function getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
219 {
220 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
221 return new $class_name($plugin_service_class);
222 }
223
228 public static function getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
229 {
230 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
231 return new $class_name($plugin_service_class);
232 }
233
238 public static function getCreationGUIClass(ilCloudPluginService $plugin_service_class)
239 {
240 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
241 return new $class_name($plugin_service_class);
242 }
243
248 public static function getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
249 {
250 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
251 return new $class_name($plugin_service_class);
252 }
253}
254?>
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 getCreationGUIClass(ilCloudPluginService $plugin_service_class)
static getServiceClass($service_name, $obj_id, $connect=true)
static getInitGUIClass(ilCloudPluginService $plugin_service_class)
static getPluginClass($service_name, $obj_id, $cloud_module_object=null)
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.