Class ilWebDAVMountInstructions.
More...
Class ilWebDAVMountInstructions.
This class creates the page and links for the WebDAV mount instruction page
- Author
- Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$
Definition at line 11 of file class.ilWebDAVMountInstructions.php.
◆ __construct()
ilWebDAVMountInstructions::__construct |
( |
|
$a_user_agent = '' , |
|
|
|
$a_request_uri = '' , |
|
|
|
$a_http_host = '' , |
|
|
|
$a_script_name = '' , |
|
|
|
$a_client_id = '' |
|
) |
| |
Definition at line 30 of file class.ilWebDAVMountInstructions.php.
References $_SERVER, $DIC, ilObject\_lookupObjectId(), ilObject\_lookupTitle(), settings(), and setValuesFromUserAgent().
35 $this->lng = $DIC->language();
37 $this->user_agent = $a_user_agent ==
'' ? strtolower(
$_SERVER[
'HTTP_USER_AGENT']) : $a_user_agent;
38 $this->request_uri = $a_request_uri ==
'' ?
$_SERVER[
'REQUEST_URI'] : $a_request_uri;
39 $this->http_host = $a_http_host ==
'' ?
$_SERVER[
'HTTP_HOST'] : $a_http_host;
40 $this->script_name = $a_http_host ==
'' ?
$_SERVER[
'SCRIPT_NAME'] : $a_script_name;
41 $this->client_id = $a_http_host ==
'' ? CLIENT_ID : $a_client_id;
42 $this->path_to_template =
'Customizing/clients/' . $this->client_id .
'/webdavtemplate.htm';
45 foreach (explode(
'/', $this->request_uri) as $uri_part) {
46 if (strpos($uri_part,
'ref_') !==
false && $this->ref_id == 0) {
47 $this->ref_id = (int) explode(
'_', $uri_part)[1];
50 if ($this->ref_id == 0) {
51 throw new Exception(
'Bad Request: No ref id given!');
57 $this->base_uri = $this->http_host . $this->script_name .
'/' . $this->client_id .
'/ref_' . $this->ref_id .
'/';
59 $this->protocol_prefixes = array(
60 'default' =>
'https://',
61 'konqueror' =>
'webdavs://',
62 'nautilus' =>
'davs://'
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
setValuesFromUserAgent($a_user_agent)
◆ getCustomInstruction()
ilWebDAVMountInstructions::getCustomInstruction |
( |
| ) |
|
◆ getDefaultInstruction()
ilWebDAVMountInstructions::getDefaultInstruction |
( |
| ) |
|
◆ getDefaultUri()
ilWebDAVMountInstructions::getDefaultUri |
( |
| ) |
|
◆ getIEUri()
ilWebDAVMountInstructions::getIEUri |
( |
| ) |
|
◆ getInstructionsFromTplFile()
ilWebDAVMountInstructions::getInstructionsFromTplFile |
( |
| ) |
|
◆ getKonquerorUri()
ilWebDAVMountInstructions::getKonquerorUri |
( |
| ) |
|
◆ getNautilusUri()
ilWebDAVMountInstructions::getNautilusUri |
( |
| ) |
|
◆ getWebfolderTitle()
ilWebDAVMountInstructions::getWebfolderTitle |
( |
| ) |
|
◆ instructionsTplFileExists()
ilWebDAVMountInstructions::instructionsTplFileExists |
( |
| ) |
|
◆ setInstructionPlaceholders()
ilWebDAVMountInstructions::setInstructionPlaceholders |
( |
|
$a_instruction_tpl | ) |
|
Gets Webfolder mount instructions for the specified webfolder.
The following placeholders are currently supported:
[WEBFOLDER_TITLE] - the title of the webfolder [WEBFOLDER_URI] - the URL for mounting the webfolder with standard compliant WebDAV clients [WEBFOLDER_URI_IE] - the URL for mounting the webfolder with Internet Explorer [WEBFOLDER_URI_KONQUEROR] - the URL for mounting the webfolder with Konqueror [WEBFOLDER_URI_NAUTILUS] - the URL for mounting the webfolder with Nautilus [IF_WINDOWS]...[/IF_WINDOWS] - conditional contents, with instructions for Windows [IF_MAC]...[/IF_MAC] - conditional contents, with instructions for Mac OS X [IF_LINUX]...[/IF_LINUX] - conditional contents, with instructions for Linux [ADMIN_MAIL] - the mailbox address of the system administrator
- Parameters
-
unknown | $a_instruction_tpl | |
- Returns
- mixed
Definition at line 168 of file class.ilWebDAVMountInstructions.php.
References getDefaultUri(), getIEUri(), getKonquerorUri(), getNautilusUri(), and settings().
170 $a_instruction_tpl = str_replace(
"[WEBFOLDER_ID]", $this->ref_id, $a_instruction_tpl);
171 $a_instruction_tpl = str_replace(
"[WEBFOLDER_TITLE]", $this->obj_title, $a_instruction_tpl);
172 $a_instruction_tpl = str_replace(
"[WEBFOLDER_URI]", $this->
getDefaultUri(), $a_instruction_tpl);
173 $a_instruction_tpl = str_replace(
"[WEBFOLDER_URI_IE]", $this->
getIEUri(), $a_instruction_tpl);
174 $a_instruction_tpl = str_replace(
"[WEBFOLDER_URI_KONQUEROR]", $this->
getKonquerorUri(), $a_instruction_tpl);
175 $a_instruction_tpl = str_replace(
"[WEBFOLDER_URI_NAUTILUS]", $this->
getNautilusUri(), $a_instruction_tpl);
176 $a_instruction_tpl = str_replace(
"[ADMIN_MAIL]", $this->
settings->get(
"admin_email"), $a_instruction_tpl);
178 if (strpos($this->user_agent,
'MSIE') !==
false) {
179 $a_instruction_tpl = preg_replace(
'/\[IF_IEXPLORE\](?:(.*))\[\/IF_IEXPLORE\]/s',
'\1', $a_instruction_tpl);
181 $a_instruction_tpl = preg_replace(
'/\[IF_NOTIEXPLORE\](?:(.*))\[\/IF_NOTIEXPLORE\]/s',
'\1', $a_instruction_tpl);
184 switch ($this->clientOS) {
186 $operatingSystem =
'WINDOWS';
189 switch ($this->clientOSFlavor) {
191 $operatingSystem =
'MAC';
194 $operatingSystem =
'LINUX';
197 $operatingSystem =
'LINUX';
202 $operatingSystem =
'UNKNOWN';
205 if ($operatingSystem !=
'UNKNOWN') {
206 $a_instruction_tpl = preg_replace(
'/\[IF_' . $operatingSystem .
'\](?:(.*))\[\/IF_' . $operatingSystem .
'\]/s',
'\1', $a_instruction_tpl);
207 $a_instruction_tpl = preg_replace(
'/\[IF_([A-Z_]+)\](?:(.*))\[\/IF_\1\]/s',
'', $a_instruction_tpl);
209 $a_instruction_tpl = preg_replace(
'/\[IF_([A-Z_]+)\](?:(.*))\[\/IF_\1\]/s',
'\2', $a_instruction_tpl);
212 return $a_instruction_tpl;
◆ setValuesFromUserAgent()
ilWebDAVMountInstructions::setValuesFromUserAgent |
( |
|
$a_user_agent | ) |
|
|
protected |
Definition at line 68 of file class.ilWebDAVMountInstructions.php.
Referenced by __construct().
78 if (strpos($a_user_agent,
'windows') !==
false 79 || strpos($a_user_agent,
'microsoft') !==
false) {
80 $this->clientOS =
'windows';
81 if (strpos($a_user_agent,
'nt 5.1') !==
false) {
82 $this->clientOSFlavor =
'xp';
84 $this->clientOSFlavor =
'nichtxp';
86 } elseif (strpos($this->user_agent,
'darwin') !==
false 87 || strpos($a_user_agent,
'macintosh') !==
false 88 || strpos($a_user_agent,
'linux') !==
false 89 || strpos($a_user_agent,
'solaris') !==
false 90 || strpos($a_user_agent,
'aix') !==
false 91 || strpos($a_user_agent,
'unix') !==
false 92 || strpos($a_user_agent,
'gvfs') !==
false 94 $this->clientOS =
'unix';
95 if (strpos($a_user_agent,
'linux') !==
false) {
96 $this->clientOSFlavor =
'linux';
97 } elseif (strpos($a_user_agent,
'macintosh') !==
false) {
98 $this->clientOSFlavor =
'osx';
◆ $client_id
ilWebDAVMountInstructions::$client_id |
|
protected |
◆ $clientOS
ilWebDAVMountInstructions::$clientOS |
|
protected |
◆ $clientOSFlavor
ilWebDAVMountInstructions::$clientOSFlavor |
|
protected |
◆ $http_host
ilWebDAVMountInstructions::$http_host |
|
protected |
◆ $lng
ilWebDAVMountInstructions::$lng |
|
protected |
◆ $obj_id
ilWebDAVMountInstructions::$obj_id |
|
protected |
◆ $obj_title
ilWebDAVMountInstructions::$obj_title |
|
protected |
◆ $path_to_template
ilWebDAVMountInstructions::$path_to_template |
|
protected |
◆ $ref_id
ilWebDAVMountInstructions::$ref_id |
|
protected |
◆ $request_uri
ilWebDAVMountInstructions::$request_uri |
|
protected |
◆ $script_name
ilWebDAVMountInstructions::$script_name |
|
protected |
◆ $settings
ilWebDAVMountInstructions::$settings |
|
protected |
◆ $user_agent
ilWebDAVMountInstructions::$user_agent |
|
protected |
The documentation for this class was generated from the following file: