ILIAS  release_7 Revision v7.30-3-g800a261c036
ilWebDAVUriBuilder Class Reference
+ Collaboration diagram for ilWebDAVUriBuilder:

Public Member Functions

 __construct (\Psr\Http\Message\RequestInterface $a_request)
 
 getWebDavDefaultUri (int $a_ref_id)
 
 getWebDavNautilusUri (int $a_ref_id)
 
 getWebDavKonquerorUri (int $a_ref_id)
 
 getUriToMountInstructionModalByRef (int $a_ref_id)
 
 getUriToMountInstructionModalByLanguage (string $language)
 

Protected Member Functions

 changePathToWebDavScript (string $a_original_path)
 
 getWebDavPathToRef (int $a_ref_id)
 
 getWebDavPathToLanguageTemplate (string $language)
 
 getWebDavUriByPlaceholderName (string $placeholder_name, int $a_ref_id)
 

Protected Attributes

 $request
 
 $schemas
 
 $mount_instructions_query = 'mount-instructions'
 
 $webdav_script_name = 'webdav.php'
 

Detailed Description

Definition at line 4 of file class.ilWebDAVUriBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVUriBuilder::__construct ( \Psr\Http\Message\RequestInterface  $a_request)

Definition at line 20 of file class.ilWebDAVUriBuilder.php.

References changePathToWebDavScript(), and CLIENT_ID.

21  {
22  $this->request = $a_request;
23 
24  $this->uri = $a_request->getUri();
25  $this->host = $this->uri->getHost();
26 
27  $this->client_id = CLIENT_ID;
28  $this->web_path_to_script = $this->changePathToWebDavScript($this->uri->getPath());
29  }
const CLIENT_ID
Definition: constants.php:39
changePathToWebDavScript(string $a_original_path)
+ Here is the call graph for this function:

Member Function Documentation

◆ changePathToWebDavScript()

ilWebDAVUriBuilder::changePathToWebDavScript ( string  $a_original_path)
protected
Parameters
string$a_original_path
Returns
string

Definition at line 37 of file class.ilWebDAVUriBuilder.php.

References $webdav_script_name.

Referenced by __construct().

38  {
39  $exploded_path = explode('/', $a_original_path);
40 
41  if (in_array($this->webdav_script_name, $exploded_path)) {
42  return implode('/', array_splice($exploded_path, 0, -2));
43  }
44 
45  return implode('/', array_splice($exploded_path, 0, -1)) . '/' . $this->webdav_script_name;
46  }
+ Here is the caller graph for this function:

◆ getUriToMountInstructionModalByLanguage()

ilWebDAVUriBuilder::getUriToMountInstructionModalByLanguage ( string  $language)
Parameters
string$language
Returns
string

Definition at line 120 of file class.ilWebDAVUriBuilder.php.

References $mount_instructions_query, and getWebDavPathToLanguageTemplate().

121  {
122  return $this->getWebDavPathToLanguageTemplate($language) . '?' . $this->mount_instructions_query;
123  }
getWebDavPathToLanguageTemplate(string $language)
+ Here is the call graph for this function:

◆ getUriToMountInstructionModalByRef()

ilWebDAVUriBuilder::getUriToMountInstructionModalByRef ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

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

References $mount_instructions_query, and getWebDavPathToRef().

Referenced by ilObjGroupListGUI\getCommandLink(), ilObjFolderListGUI\getCommandLink(), ilObjCategoryListGUI\getCommandLink(), ilObjectListGUI\getCommandLink(), and ilContainerGUI\showPasswordInstructionObject().

112  {
113  return $this->getWebDavPathToRef($a_ref_id) . '?' . $this->mount_instructions_query;
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWebDavDefaultUri()

ilWebDAVUriBuilder::getWebDavDefaultUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 84 of file class.ilWebDAVUriBuilder.php.

References getWebDavUriByPlaceholderName().

85  {
86  return $this->getWebDavUriByPlaceholderName('default', $a_ref_id);
87  }
getWebDavUriByPlaceholderName(string $placeholder_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ getWebDavKonquerorUri()

ilWebDAVUriBuilder::getWebDavKonquerorUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 102 of file class.ilWebDAVUriBuilder.php.

References getWebDavUriByPlaceholderName().

103  {
104  return $this->getWebDavUriByPlaceholderName('konqueror', $a_ref_id);
105  }
getWebDavUriByPlaceholderName(string $placeholder_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ getWebDavNautilusUri()

ilWebDAVUriBuilder::getWebDavNautilusUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 93 of file class.ilWebDAVUriBuilder.php.

References getWebDavUriByPlaceholderName().

94  {
95  return $this->getWebDavUriByPlaceholderName('nautilus', $a_ref_id);
96  }
getWebDavUriByPlaceholderName(string $placeholder_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ getWebDavPathToLanguageTemplate()

ilWebDAVUriBuilder::getWebDavPathToLanguageTemplate ( string  $language)
protected
Parameters
string$language
Returns
string

Definition at line 61 of file class.ilWebDAVUriBuilder.php.

Referenced by getUriToMountInstructionModalByLanguage().

62  {
63  return "$this->web_path_to_script/$this->client_id/$language";
64  }
+ Here is the caller graph for this function:

◆ getWebDavPathToRef()

ilWebDAVUriBuilder::getWebDavPathToRef ( int  $a_ref_id)
protected
Parameters
int$a_ref_id
Returns
string

Definition at line 52 of file class.ilWebDAVUriBuilder.php.

Referenced by getUriToMountInstructionModalByRef(), and getWebDavUriByPlaceholderName().

53  {
54  return "$this->web_path_to_script/$this->client_id/ref_$a_ref_id";
55  }
+ Here is the caller graph for this function:

◆ getWebDavUriByPlaceholderName()

ilWebDAVUriBuilder::getWebDavUriByPlaceholderName ( string  $placeholder_name,
int  $a_ref_id 
)
protected
Parameters
string$placeholder_name
int$a_ref_id
Returns
string

Definition at line 71 of file class.ilWebDAVUriBuilder.php.

References getWebDavPathToRef().

Referenced by getWebDavDefaultUri(), getWebDavKonquerorUri(), and getWebDavNautilusUri().

72  {
73  $scheme = $this->schemas[$placeholder_name];
74  if ($this->uri->getScheme() == 'https') {
75  $scheme .= 's';
76  }
77  return $scheme . '://' . $this->host . $this->getWebDavPathToRef($a_ref_id);
78  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $mount_instructions_query

ilWebDAVUriBuilder::$mount_instructions_query = 'mount-instructions'
protected

◆ $request

ilWebDAVUriBuilder::$request
protected

Definition at line 7 of file class.ilWebDAVUriBuilder.php.

◆ $schemas

ilWebDAVUriBuilder::$schemas
protected
Initial value:
= array(
'default' => 'http',
'konqueror' => 'webdav',
'nautilus' => 'dav'
)

Definition at line 10 of file class.ilWebDAVUriBuilder.php.

◆ $webdav_script_name

ilWebDAVUriBuilder::$webdav_script_name = 'webdav.php'
protected

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

Referenced by changePathToWebDavScript().


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