ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
18  protected $plugin_object = null;
19 
24  public function __construct($service_name, $obj_id)
25  {
26  $this->plugin_object = ilCloudConnector::getPluginClass($service_name, $obj_id);
27  }
28 
32  public function getPluginObject()
33  {
34  return $this->plugin_object;
35  }
36 
41  public function getPluginHookObject()
42  {
43  return $this->getPluginObject()->getPluginHookObject();
44  }
45 
50  public function getAdminConfigObject()
51  {
52  return $this->getPluginObject()->getAdminConfigObject();
53  }
54 
61  public function authService($callback_url = "")
62  {
63  header("Location: " . htmlspecialchars_decode($callback_url));
64  }
65 
70  public function afterAuthService()
71  {
72  return true;
73  }
74 
75  public function getServiceObject()
76  {
77  }
78 
86  public function getRootId($root_path)
87  {
88  return "root";
89  }
90 
96  public function addToFileTree(ilCloudFileTree $file_tree, $parent_folder = "/")
97  {
98  }
99 
100 
110  public function addToFileTreeWithId(ilCloudFileTree $file_tree, $id)
111  {
112  return false;
113  }
114 
120  public function getFile($path = null, ilCloudFileTree $file_tree = null)
121  {
122  }
123 
124 
133  public function getFileById($id)
134  {
135  return false;
136  }
137 
143  public function createFolder($path = null, ilCloudFileTree $file_tree = null)
144  {
145  }
146 
147 
156  public function createFolderById($parent_id, $folder_name)
157  {
158  return false;
159  }
160 
161 
170  public function putFile($file, $name, $path = '', ilCloudFileTree $file_tree = null)
171  {
172  }
173 
174 
185  public function putFileById($tmp_name, $file_name, $id)
186  {
187  return false;
188  }
189 
195  public function deleteItem($path = null, ilCloudFileTree $file_tree = null)
196  {
197  }
198 
199 
208  public function deleteItemById($id)
209  {
210  return false;
211  }
212 
217  public function isCaseSensitive()
218  {
219  return false;
220  }
221 
226  public function formatBytes($bytes)
227  {
228  $unit = array('B', 'KB', 'MB', 'GB', 'TB');
229  $bytes = max($bytes, 0);
230  $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
231  $pow = min($pow, count($unit) - 1);
232  $bytes /= pow(1024, $pow);
233  return round($bytes, 2) . ' ' . $unit[$pow];
234  }
235 
240  public function getProtokol()
241  {
242  return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
243  }
244 }
afterAuthService()
Place were the callback should lead to after authentication.
$path
Definition: aliased.php:25
getPluginHookObject()
For shorter access.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
getFileById($id)
Called when a file is accessed for download by the user Uses the id instead of the path...
putFileById($tmp_name, $file_name, $id)
Called when a file is uploaded by the user Uses the id instead of the path.
getAdminConfigObject()
For shorter access.
if(!array_key_exists('StateId', $_REQUEST)) $id
getProtokol()
A little helper function returning the currently used protocol as string.
ilCloudFileTree class
addToFileTree(ilCloudFileTree $file_tree, $parent_folder="/")
Updates the file tree when the user navigates through files and folders.
getRootId($root_path)
Called when RootId (id of the folder which is set to root) is needed.
putFile($file, $name, $path='', ilCloudFileTree $file_tree=null)
Called when a file is uploaded by the user.
__construct($service_name, $obj_id)
deleteItemById($id)
Called when an item is deleted by the user Uses the id instead of the path.
deleteItem($path=null, ilCloudFileTree $file_tree=null)
Called when an item is deleted by the user.
static getPluginClass($service_name, $obj_id)
getFile($path=null, ilCloudFileTree $file_tree=null)
Called when a file is accessed for download by the user.
addToFileTreeWithId(ilCloudFileTree $file_tree, $id)
Updates the file tree when the user navigates through files and folders.
Class ilCloudPluginService.
createFolderById($parent_id, $folder_name)
Called when a folder is created by the user Uses the id instead of the path.
authService($callback_url="")
Called after the cloud object is created to authenticate the service if needed.
createFolder($path=null, ilCloudFileTree $file_tree=null)
Called when a folder is created by the user.