ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWebDAVObjectMountInstructions.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 protected int $obj_id;
28 protected string $obj_title;
29
30 public function __construct(
32 ilWebDAVUriBuilder $a_uri_builder,
33 ilSetting $a_settings,
34 string $language,
35 protected int $ref_id
36 ) {
37 parent::__construct($a_repo, $a_uri_builder, $a_settings, $language);
38
39 // TODO: Change this to be more unit testable!
40 $this->obj_id = ilObject::_lookupObjectId($this->ref_id);
41 $this->obj_title = ilObject::_lookupTitle($this->obj_id);
42 }
43
44 protected function fillPlaceholdersForMountInstructions(array $mount_instructions): array
45 {
46 foreach ($mount_instructions as $title => $mount_instruction) {
47 $mount_instruction = str_replace("[WEBFOLDER_ID]", (string) $this->ref_id, $mount_instruction);
48 $mount_instruction = str_replace("[WEBFOLDER_TITLE]", $this->obj_title, $mount_instruction);
49 $mount_instruction = str_replace(
50 "[WEBFOLDER_URI]",
51 $this->uri_builder->getWebDavDefaultUri($this->ref_id),
52 $mount_instruction
53 );
54 $mount_instruction = str_replace(
55 "[WEBFOLDER_URI_KONQUEROR]",
56 $this->uri_builder->getWebDavKonquerorUri($this->ref_id),
57 $mount_instruction
58 );
59 $mount_instruction = str_replace(
60 "[WEBFOLDER_URI_NAUTILUS]",
61 $this->uri_builder->getWebDavNautilusUri($this->ref_id),
62 $mount_instruction
63 );
64 $mount_instruction = str_replace("[ADMIN_MAIL]", $this->settings->get("admin_email"), $mount_instruction);
65
66 $mount_instructions[$title] = $mount_instruction;
67 }
68
69 // TODO: Implement fillPlaceholdersForMountInstructions() method.
70 return $mount_instructions;
71 }
72}
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
ILIAS Setting Class.
__construct(ilWebDAVMountInstructionsRepository $a_repo, ilWebDAVUriBuilder $a_uri_builder, ilSetting $a_settings, string $language, protected int $ref_id)
fillPlaceholdersForMountInstructions(array $mount_instructions)
$ref_id
Definition: ltiauth.php:66
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc