ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebDAVUriBuilder Class Reference
+ Collaboration diagram for ilWebDAVUriBuilder:

Public Member Functions

 __construct (RequestInterface $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

array $schemas
 
string $mount_instructions_query = 'mount-instructions'
 
string $webdav_script_name = 'webdav.php'
 
RequestInterface $request
 
UriInterface $uri
 
string $host
 
string $client_id
 
string $web_path_to_script
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVUriBuilder::__construct ( RequestInterface  $request)

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

References $request, changePathToWebDavScript(), and CLIENT_ID.

45  {
46  $this->request = $request;
47 
48  $this->uri = $request->getUri();
49  $this->host = $this->uri->getHost();
50 
51  $this->client_id = CLIENT_ID;
52  $this->web_path_to_script = $this->changePathToWebDavScript($this->uri->getPath());
53  }
const CLIENT_ID
Definition: constants.php:41
changePathToWebDavScript(string $a_original_path)
+ Here is the call graph for this function:

Member Function Documentation

◆ changePathToWebDavScript()

ilWebDAVUriBuilder::changePathToWebDavScript ( string  $a_original_path)
protected

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

References $webdav_script_name.

Referenced by __construct().

55  : string
56  {
57  $exploded_path = explode('/', $a_original_path);
58 
59  if (in_array($this->webdav_script_name, $exploded_path)) {
60  return implode('/', array_splice($exploded_path, 0, -2));
61  }
62 
63  return implode('/', array_splice($exploded_path, 0, -1)) . '/' . $this->webdav_script_name;
64  }
+ Here is the caller graph for this function:

◆ getUriToMountInstructionModalByLanguage()

ilWebDAVUriBuilder::getUriToMountInstructionModalByLanguage ( string  $language)

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

References $mount_instructions_query, and getWebDavPathToLanguageTemplate().

105  : string
106  {
107  return $this->getWebDavPathToLanguageTemplate($language) . '?' . $this->mount_instructions_query;
108  }
getWebDavPathToLanguageTemplate(string $language)
+ Here is the call graph for this function:

◆ getUriToMountInstructionModalByRef()

ilWebDAVUriBuilder::getUriToMountInstructionModalByRef ( int  $a_ref_id)

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

References $mount_instructions_query, and getWebDavPathToRef().

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

100  : string
101  {
102  return $this->getWebDavPathToRef($a_ref_id) . '?' . $this->mount_instructions_query;
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWebDavDefaultUri()

ilWebDAVUriBuilder::getWebDavDefaultUri ( int  $a_ref_id)

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

References getWebDavUriByPlaceholderName().

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

◆ getWebDavKonquerorUri()

ilWebDAVUriBuilder::getWebDavKonquerorUri ( int  $a_ref_id)

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

References getWebDavUriByPlaceholderName().

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

◆ getWebDavNautilusUri()

ilWebDAVUriBuilder::getWebDavNautilusUri ( int  $a_ref_id)

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

References getWebDavUriByPlaceholderName().

90  : string
91  {
92  return $this->getWebDavUriByPlaceholderName('nautilus', $a_ref_id);
93  }
getWebDavUriByPlaceholderName(string $placeholder_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ getWebDavPathToLanguageTemplate()

ilWebDAVUriBuilder::getWebDavPathToLanguageTemplate ( string  $language)
protected

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

Referenced by getUriToMountInstructionModalByLanguage().

71  : string
72  {
73  return "$this->web_path_to_script/$this->client_id/$language";
74  }
+ Here is the caller graph for this function:

◆ getWebDavPathToRef()

ilWebDAVUriBuilder::getWebDavPathToRef ( int  $a_ref_id)
protected

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

Referenced by getUriToMountInstructionModalByRef(), and getWebDavUriByPlaceholderName().

66  : string
67  {
68  return "$this->web_path_to_script/$this->client_id/ref_$a_ref_id";
69  }
+ Here is the caller graph for this function:

◆ getWebDavUriByPlaceholderName()

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

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

References getWebDavPathToRef().

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

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

Field Documentation

◆ $client_id

string ilWebDAVUriBuilder::$client_id
protected

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

◆ $host

string ilWebDAVUriBuilder::$host
protected

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

◆ $mount_instructions_query

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

◆ $request

RequestInterface ilWebDAVUriBuilder::$request
protected

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

Referenced by __construct().

◆ $schemas

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

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

◆ $uri

UriInterface ilWebDAVUriBuilder::$uri
protected

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

◆ $web_path_to_script

string ilWebDAVUriBuilder::$web_path_to_script
protected

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

◆ $webdav_script_name

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

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

Referenced by changePathToWebDavScript().


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