ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
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 ?>