ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilWebDAVObjectMountInstructions.php
Go to the documentation of this file.
1<?php
2
12{
13 protected $user_agent;
14 protected $request_uri;
15 protected $http_host;
16 protected $script_name;
17 protected $client_id;
19
20 protected $clientOSFlavor;
21 protected $clientOS;
22
23 protected $settings;
24
25 protected $ref_id;
26 protected $obj_id;
27 protected $obj_title;
28
30 protected $uri_provider;
31
32 public function __construct(
34 ilWebDAVUriBuilder $a_uri_builder,
35 ilSetting $a_settings,
36 String $language,
37 int $a_ref_id
38 ) {
39 parent::__construct($a_repo, $a_uri_builder, $a_settings, $language);
40
41 $this->ref_id = $a_ref_id;
42
43 // TODO: Change this to be more unit testable!
44 $this->obj_id = ilObject::_lookupObjectId($this->ref_id);
45 $this->obj_title = ilObject::_lookupTitle($this->obj_id);
46 }
47
48 protected function fillPlaceholdersForMountInstructions(array $mount_instructions) : array
49 {
50 foreach ($mount_instructions as $title => $mount_instruction) {
51 $mount_instruction = str_replace("[WEBFOLDER_ID]", $this->ref_id, $mount_instruction);
52 $mount_instruction = str_replace("[WEBFOLDER_TITLE]", $this->obj_title, $mount_instruction);
53 $mount_instruction = str_replace("[WEBFOLDER_URI]", $this->uri_builder->getWebDavDefaultUri($this->ref_id), $mount_instruction);
54 $mount_instruction = str_replace("[WEBFOLDER_URI_KONQUEROR]", $this->uri_builder->getWebDavKonquerorUri($this->ref_id), $mount_instruction);
55 $mount_instruction = str_replace("[WEBFOLDER_URI_NAUTILUS]", $this->uri_builder->getWebDavNautilusUri($this->ref_id), $mount_instruction);
56 $mount_instruction = str_replace("[ADMIN_MAIL]", $this->settings->get("admin_email"), $mount_instruction);
57
58 $mount_instructions[$title] = $mount_instruction;
59 }
60
61 // TODO: Implement fillPlaceholdersForMountInstructions() method.
62 return $mount_instructions;
63 }
64}
An exception for terminatinating execution or to throw for unit testing.
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
ILIAS Setting Class.
__construct(ilWebDAVMountInstructionsRepository $a_repo, ilWebDAVUriBuilder $a_uri_builder, ilSetting $a_settings, String $language, int $a_ref_id)
fillPlaceholdersForMountInstructions(array $mount_instructions)
Interface ilWebDAVMountInstructionsRepository.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2