ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCloudPluginService Class Reference

Class ilCloudPluginService. More...

+ Collaboration diagram for ilCloudPluginService:

Public Member Functions

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

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

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

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

References ilCloudConnector\getPluginClass().

{
$this->plugin_object = ilCloudConnector::getPluginClass($service_name, $obj_id);
}

+ Here is the call graph for this function:

Member Function Documentation

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

{}
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.

{
return true;
}
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.

{
header("Location: " . htmlspecialchars_decode($callback_url));
}
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 108 of file class.ilCloudPluginService.php.

{}
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 115 of file class.ilCloudPluginService.php.

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

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

{
$unit = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($unit) - 1);
$bytes /= pow(1024, $pow);
return round($bytes, 2) . ' ' . $unit[$pow];
}
ilCloudPluginService::getAdminConfigObject ( )

For shorter access.

Returns
ilCloudPluginConfig

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

References getPluginObject().

{
return $this->getPluginObject()->getAdminConfigObject();
}

+ Here is the call graph for this function:

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

{}
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:

ilCloudPluginService::getProtokol ( )

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

Returns
string

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

{
return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'HTTPS' : 'HTTP';
}
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 84 of file class.ilCloudPluginService.php.

{
return "root";
}
ilCloudPluginService::getServiceObject ( )

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

{}
ilCloudPluginService::isCaseSensitive ( )

by default false

Returns
bool

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

{
return false;
}

Field Documentation

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: