ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 {
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
84 public function getRootId($root_path)
85 {
86 return "root";
87 }
88
94 public function addToFileTree(ilCloudFileTree &$file_tree, $parent_folder = "/"){}
95
101 public function getFile($path = null, ilCloudFileTree $file_tree = null){}
102
108 public function createFolder($path = null, ilCloudFileTree $file_tree = null){}
109
115 public function deleteItem($path = null, ilCloudFileTree $file_tree = null){}
116
121 public function isCaseSensitive()
122 {
123 return false;
124 }
125
130 public function formatBytes($bytes)
131 {
132 $unit = array('B', 'KB', 'MB', 'GB', 'TB');
133 $bytes = max($bytes, 0);
134 $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
135 $pow = min($pow, count($unit) - 1);
136 $bytes /= pow(1024, $pow);
137 return round($bytes, 2) . ' ' . $unit[$pow];
138 }
139
144 public function getProtokol()
145 {
146 return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
147 }
148}
149?>
static getPluginClass($service_name, $obj_id, $cloud_module_object=null)
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.
getFile($path=null, ilCloudFileTree $file_tree=null)
Called when a file is accessed for download by the user.
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.
getPluginHookObject()
For shorter access.
addToFileTree(ilCloudFileTree &$file_tree, $parent_folder="/")
Updates the file tree when the user navigates through files and folders.
__construct($service_name, $obj_id)
afterAuthService()
Place were the callback should lead to after authentication.
deleteItem($path=null, ilCloudFileTree $file_tree=null)
Called when an item is deleted by the user.
$path
Definition: index.php:22
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']