ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 24 of file class.ilCloudPluginService.php.

References ilCloudConnector\getPluginClass().

25  {
26  $this->plugin_object = ilCloudConnector::getPluginClass($service_name, $obj_id);
27  }
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 96 of file class.ilCloudPluginService.php.

97  {
98  }

◆ 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 110 of file class.ilCloudPluginService.php.

111  {
112  return false;
113  }

◆ afterAuthService()

ilCloudPluginService::afterAuthService ( )

Place were the callback should lead to after authentication.

Can be used to updated plugin settings.

Returns
bool

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

71  {
72  return true;
73  }

◆ 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 61 of file class.ilCloudPluginService.php.

62  {
63  header("Location: " . htmlspecialchars_decode($callback_url));
64  }

◆ 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 143 of file class.ilCloudPluginService.php.

144  {
145  }

◆ 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 156 of file class.ilCloudPluginService.php.

157  {
158  return false;
159  }

◆ 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 195 of file class.ilCloudPluginService.php.

196  {
197  }

◆ 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 208 of file class.ilCloudPluginService.php.

209  {
210  return false;
211  }

◆ formatBytes()

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

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

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  }

◆ getAdminConfigObject()

ilCloudPluginService::getAdminConfigObject ( )

For shorter access.

Returns
ilCloudPluginConfig

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

References getPluginObject().

51  {
52  return $this->getPluginObject()->getAdminConfigObject();
53  }
+ 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 120 of file class.ilCloudPluginService.php.

121  {
122  }

◆ 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 133 of file class.ilCloudPluginService.php.

134  {
135  return false;
136  }

◆ getPluginHookObject()

◆ getPluginObject()

ilCloudPluginService::getPluginObject ( )
Returns
ilCloudPlugin

Definition at line 32 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 240 of file class.ilCloudPluginService.php.

References $_SERVER.

241  {
242  return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
243  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

◆ 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 86 of file class.ilCloudPluginService.php.

87  {
88  return "root";
89  }

◆ getServiceObject()

ilCloudPluginService::getServiceObject ( )

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

76  {
77  }

◆ isCaseSensitive()

ilCloudPluginService::isCaseSensitive ( )

by default false

Returns
bool

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

218  {
219  return false;
220  }

◆ 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 170 of file class.ilCloudPluginService.php.

171  {
172  }

◆ 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 185 of file class.ilCloudPluginService.php.

186  {
187  return false;
188  }

Field Documentation

◆ $plugin_object

ilCloudPluginService::$plugin_object = null
protected

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

Referenced by getPluginObject().


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