ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 return $services_names;
51 }
52
58 public static function checkServiceActive($name)
59 {
60 if (!$name) {
62 }
63
64 if (array_key_exists($name, ilCloudConnector::getActiveServices())) {
65 return true;
66 } else {
68 }
69 }
70
76 protected static function getFullClassName($service_name, $class_name)
77 {
78 if (file_exists("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php")) {
79 include_once("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php");
80 $class_full_name = "il" . $service_name . $class_name;
81 return $class_full_name;
82 }
83 return "ilCloudPlugin" . $class_name;
84 }
92 public static function getServiceClass($service_name, $obj_id, $connect = true)
93 {
94 if (!$service_name) {
96 }
97
98 if (array_key_exists($service_name, ilCloudConnector::getActiveServices())) {
99 $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
100 return new $class_name($service_name, $obj_id);
101 } else {
103 }
104 }
105
111 public static function getPluginClass($service_name, $obj_id)
112 {
113 $class_name = ilCloudConnector::getFullClassName($service_name, "");
114 return new $class_name($service_name, $obj_id);
115 }
116
122 public static function getPluginHookClass($service_name)
123 {
124 $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
125 return new $class_name($service_name);
126 }
127
133 public static function getSettingsGUIClass(ilCloudPluginService $plugin_service_class)
134 {
135 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
136 return new $class_name($plugin_service_class);
137 }
138
144 public static function getActionListGUIClass(ilCloudPluginService $plugin_service_class)
145 {
146 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
147 return new $class_name($plugin_service_class);
148 }
149
155 public static function getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
156 {
157 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
158 return new $class_name($plugin_service_class);
159 }
160
166 public static function getInitGUIClass(ilCloudPluginService $plugin_service_class)
167 {
168 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
169 return new $class_name($plugin_service_class);
170 }
171
178 public static function getFileTreeGUIClass(ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
179 {
180 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
181 return new $class_name($plugin_service_class, $file_tree);
182 }
183
189 public static function getCreateFolderGUIClass(ilCloudPluginService $plugin_service_class)
190 {
191 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
192 return new $class_name($plugin_service_class);
193 }
194
200 public static function getUploadGUIClass(ilCloudPluginService $plugin_service_class)
201 {
202 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
203 return new $class_name($plugin_service_class);
204 }
205
210 public static function getDeleteGUIClass(ilCloudPluginService $plugin_service_class)
211 {
212 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
213 return new $class_name($plugin_service_class);
214 }
215
220 public static function getHeaderActionGUIClass(ilCloudPluginService $plugin_service_class)
221 {
222 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
223 return new $class_name($plugin_service_class);
224 }
225
230 public static function getCreationGUIClass(ilCloudPluginService $plugin_service_class)
231 {
232 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
233 return new $class_name($plugin_service_class);
234 }
235
240 public static function getInfoScreenGUIClass(ilCloudPluginService $plugin_service_class)
241 {
242 $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
243 return new $class_name($plugin_service_class);
244 }
245}
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: saml.php:7