ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCloudPluginService.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14{
15
19 protected $plugin_object = null;
20
21
26 public function __construct($service_name, $obj_id)
27 {
28 $this->plugin_object = ilCloudConnector::getPluginClass($service_name, $obj_id);
29 }
30
31
35 public function getPluginObject()
36 {
38 }
39
40
46 public function getPluginHookObject()
47 {
48 return $this->getPluginObject()->getPluginHookObject();
49 }
50
51
57 public function getAdminConfigObject()
58 {
59 return $this->getPluginObject()->getAdminConfigObject();
60 }
61
62
69 public function authService($callback_url = "")
70 {
71 header("Location: " . htmlspecialchars_decode($callback_url));
72 }
73
74
80 public function afterAuthService()
81 {
82 return true;
83 }
84
85
86 public function getServiceObject()
87 {
88 }
89
90
99 public function getRootId($root_path)
100 {
101 return "root";
102 }
103
104
111 public function addToFileTree(ilCloudFileTree $file_tree, $parent_folder = "/")
112 {
113 }
114
115
116
126 public function addToFileTreeWithId(ilCloudFileTree $file_tree, $id)
127 {
128 return false;
129 }
130
137 public function getFile($path = null, ilCloudFileTree $file_tree = null)
138 {
139 }
140
141
142
151 public function getFileById($id)
152 {
153 return false;
154 }
155
162 public function createFolder($path = null, ilCloudFileTree $file_tree = null)
163 {
164 }
165
166
167
176 public function createFolderById($parent_id, $folder_name)
177 {
178 return false;
179 }
180
181
190 public function putFile($file, $name, $path = '', ilCloudFileTree $file_tree = null)
191 {
192 }
193
194
205 public function putFileById($tmp_name, $file_name, $id)
206 {
207 return false;
208 }
209
216 public function deleteItem($path = null, ilCloudFileTree $file_tree = null)
217 {
218 }
219
220
221
230 public function deleteItemById($id)
231 {
232 return false;
233 }
234
240 public function isCaseSensitive()
241 {
242 return false;
243 }
244
245
251 public function formatBytes($bytes)
252 {
253 $unit = array('B', 'KB', 'MB', 'GB', 'TB');
254 $bytes = max($bytes, 0);
255 $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
256 $pow = min($pow, count($unit) - 1);
257 $bytes /= pow(1024, $pow);
258
259 return round($bytes, 2) . ' ' . $unit[$pow];
260 }
261
262
268 public function getProtokol()
269 {
270 return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
271 }
272}
An exception for terminatinating execution or to throw for unit testing.
static getPluginClass($service_name, $obj_id)
ilCloudFileTree class
Class ilCloudPluginService.
authService($callback_url="")
Called after the cloud object is created to authenticate the service if needed.
getAdminConfigObject()
For shorter access.
getProtokol()
A little helper function returning the currently used protocol as string.
getFileById($id)
Called when a file is accessed for download by the user Uses the id instead of the path.
putFile($file, $name, $path='', ilCloudFileTree $file_tree=null)
Called when a file is uploaded by the user.
getFile($path=null, ilCloudFileTree $file_tree=null)
Called when a file is accessed for download by the user.
createFolderById($parent_id, $folder_name)
Called when a folder is created by the user Uses the id instead of the path.
getRootId($root_path)
Called when RootId (id of the folder which is set to root) is needed.
createFolder($path=null, ilCloudFileTree $file_tree=null)
Called when a folder is created by the user.
putFileById($tmp_name, $file_name, $id)
Called when a file is uploaded by the user Uses the id instead of the path.
getPluginHookObject()
For shorter access.
__construct($service_name, $obj_id)
deleteItemById($id)
Called when an item is deleted by the user Uses the id instead of the path.
addToFileTree(ilCloudFileTree $file_tree, $parent_folder="/")
Updates the file tree when the user navigates through files and folders.
afterAuthService()
Place were the callback should lead to after authentication.
addToFileTreeWithId(ilCloudFileTree $file_tree, $id)
Updates the file tree when the user navigates through files and folders.
deleteItem($path=null, ilCloudFileTree $file_tree=null)
Called when an item is deleted by the user.
if($format !==null) $name
Definition: metadata.php:230
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10