ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCloudPluginService Class Reference

Class ilCloudPluginService. More...

+ Collaboration diagram for ilCloudPluginService:

Public Member Functions

 __construct ($service_name, $obj_id)
 
 getPluginObject ()
 
 getPluginHookObject ()
 For shorter access. More...
 
 getAdminConfigObject ()
 For shorter access. More...
 
 authService ($callback_url="")
 Called after the cloud object is created to authenticate the service if needed. More...
 
 afterAuthService ()
 Place were the callback should lead to after authentication. More...
 
 getServiceObject ()
 
 getRootId ($root_path)
 Called when RootId (id of the folder which is set to root) is needed. More...
 
 addToFileTree (ilCloudFileTree $file_tree, $parent_folder="/")
 Updates the file tree when the user navigates through files and folders. More...
 
 addToFileTreeWithId (ilCloudFileTree $file_tree, $id)
 Updates the file tree when the user navigates through files and folders. More...
 
 getFile ($path=null, ilCloudFileTree $file_tree=null)
 Called when a file is accessed for download by the user. More...
 
 getFileById ($id)
 Called when a file is accessed for download by the user Uses the id instead of the path. More...
 
 createFolder ($path=null, ilCloudFileTree $file_tree=null)
 Called when a folder is created by the user. More...
 
 createFolderById ($parent_id, $folder_name)
 Called when a folder is created by the user Uses the id instead of the path. More...
 
 putFile ($file, $name, $path='', ilCloudFileTree $file_tree=null)
 Called when a file is uploaded by the user. More...
 
 putFileById ($tmp_name, $file_name, $id)
 Called when a file is uploaded by the user Uses the id instead of the path. More...
 
 deleteItem ($path=null, ilCloudFileTree $file_tree=null)
 Called when an item is deleted by the user. More...
 
 deleteItemById ($id)
 Called when an item is deleted by the user Uses the id instead of the path. More...
 
 isCaseSensitive ()
 by default false More...
 
 formatBytes ($bytes)
 
 getProtokol ()
 A little helper function returning the currently used protocol as string. More...
 

Protected Attributes

 $plugin_object = null
 

Detailed Description

Class ilCloudPluginService.

Basic frame for the plugin service class probably needs to be overwritten

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 13 of file class.ilCloudPluginService.php.

Constructor & Destructor Documentation

◆ __construct()

ilCloudPluginService::__construct (   $service_name,
  $obj_id 
)
Parameters
$service_name
$obj_id

Definition at line 26 of file class.ilCloudPluginService.php.

References ilCloudConnector\getPluginClass().

27  {
28  $this->plugin_object = ilCloudConnector::getPluginClass($service_name, $obj_id);
29  }
static getPluginClass($service_name, $obj_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToFileTree()

ilCloudPluginService::addToFileTree ( ilCloudFileTree  $file_tree,
  $parent_folder = "/" 
)

Updates the file tree when the user navigates through files and folders.

Parameters
ilCloudFileTree$file_tree
string$parent_folder

Definition at line 111 of file class.ilCloudPluginService.php.

112  {
113  }

◆ addToFileTreeWithId()

ilCloudPluginService::addToFileTreeWithId ( ilCloudFileTree  $file_tree,
  $id 
)

Updates the file tree when the user navigates through files and folders.

Uses the id instead of the path.

Parameters
ilCloudFileTree$file_tree
string$id
Returns
bool

Definition at line 126 of file class.ilCloudPluginService.php.

127  {
128  return false;
129  }

◆ afterAuthService()

ilCloudPluginService::afterAuthService ( )

Place were the callback should lead to after authentication.

Can be used to updated plugin settings.

Returns
bool

Definition at line 80 of file class.ilCloudPluginService.php.

81  {
82  return true;
83  }

◆ authService()

ilCloudPluginService::authService (   $callback_url = "")

Called after the cloud object is created to authenticate the service if needed.

The callback can be used to get back to the correct place in ILIAS (the afterAuth Method) after the remote authentication.

Parameters
string$callback_url

Definition at line 69 of file class.ilCloudPluginService.php.

70  {
71  header("Location: " . htmlspecialchars_decode($callback_url));
72  }

◆ createFolder()

ilCloudPluginService::createFolder (   $path = null,
ilCloudFileTree  $file_tree = null 
)

Called when a folder is created by the user.

Parameters
null$path
ilCloudFileTree$file_tree

Definition at line 162 of file class.ilCloudPluginService.php.

163  {
164  }

◆ createFolderById()

ilCloudPluginService::createFolderById (   $parent_id,
  $folder_name 
)

Called when a folder is created by the user Uses the id instead of the path.

Parameters
string$parent_id
string$folder_name
Returns
string|bool

Definition at line 176 of file class.ilCloudPluginService.php.

177  {
178  return false;
179  }

◆ deleteItem()

ilCloudPluginService::deleteItem (   $path = null,
ilCloudFileTree  $file_tree = null 
)

Called when an item is deleted by the user.

Parameters
null$path
ilCloudFileTree$file_tree

Definition at line 216 of file class.ilCloudPluginService.php.

217  {
218  }

◆ deleteItemById()

ilCloudPluginService::deleteItemById (   $id)

Called when an item is deleted by the user Uses the id instead of the path.

Parameters
string$id
Returns
bool

Definition at line 230 of file class.ilCloudPluginService.php.

231  {
232  return false;
233  }

◆ formatBytes()

ilCloudPluginService::formatBytes (   $bytes)
Parameters
int$bytes
Returns
string

Definition at line 251 of file class.ilCloudPluginService.php.

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  }

◆ getAdminConfigObject()

ilCloudPluginService::getAdminConfigObject ( )

For shorter access.

Returns
ilCloudPluginConfig

Definition at line 57 of file class.ilCloudPluginService.php.

References getPluginObject().

58  {
59  return $this->getPluginObject()->getAdminConfigObject();
60  }
+ Here is the call graph for this function:

◆ getFile()

ilCloudPluginService::getFile (   $path = null,
ilCloudFileTree  $file_tree = null 
)

Called when a file is accessed for download by the user.

Parameters
null$path
ilCloudFileTree$file_tree

Definition at line 137 of file class.ilCloudPluginService.php.

138  {
139  }

◆ getFileById()

ilCloudPluginService::getFileById (   $id)

Called when a file is accessed for download by the user Uses the id instead of the path.

Parameters
string$id
Returns
bool

Definition at line 151 of file class.ilCloudPluginService.php.

152  {
153  return false;
154  }

◆ getPluginHookObject()

◆ getPluginObject()

ilCloudPluginService::getPluginObject ( )
Returns
ilCloudPlugin

Definition at line 35 of file class.ilCloudPluginService.php.

References $plugin_object.

Referenced by getAdminConfigObject(), and getPluginHookObject().

+ Here is the caller graph for this function:

◆ getProtokol()

ilCloudPluginService::getProtokol ( )

A little helper function returning the currently used protocol as string.

Returns
string

Definition at line 268 of file class.ilCloudPluginService.php.

References $_SERVER.

269  {
270  return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
271  }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10

◆ getRootId()

ilCloudPluginService::getRootId (   $root_path)

Called when RootId (id of the folder which is set to root) is needed.

Mostly after the base directory is changed by the user or after creating the cloud Obect

Parameters
$root_path
Returns
string

Definition at line 99 of file class.ilCloudPluginService.php.

100  {
101  return "root";
102  }

◆ getServiceObject()

ilCloudPluginService::getServiceObject ( )

Definition at line 86 of file class.ilCloudPluginService.php.

87  {
88  }

◆ isCaseSensitive()

ilCloudPluginService::isCaseSensitive ( )

by default false

Returns
bool

Definition at line 240 of file class.ilCloudPluginService.php.

241  {
242  return false;
243  }

◆ putFile()

ilCloudPluginService::putFile (   $file,
  $name,
  $path = '',
ilCloudFileTree  $file_tree = null 
)

Called when a file is uploaded by the user.

Parameters
$file
$name
string$path
ilCloudFileTree$file_tree

Definition at line 190 of file class.ilCloudPluginService.php.

191  {
192  }

◆ putFileById()

ilCloudPluginService::putFileById (   $tmp_name,
  $file_name,
  $id 
)

Called when a file is uploaded by the user Uses the id instead of the path.

Parameters
string$tmp_name
string$file_name
string$id
Returns
bool

Definition at line 205 of file class.ilCloudPluginService.php.

206  {
207  return false;
208  }

Field Documentation

◆ $plugin_object

ilCloudPluginService::$plugin_object = null
protected

Definition at line 19 of file class.ilCloudPluginService.php.

Referenced by getPluginObject().


The documentation for this class was generated from the following file: