ILIAS  release_8 Revision v8.24
class.ilWebDAVObjectMountInstructions.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
26{
27 protected int $ref_id;
28 protected int $obj_id;
29 protected string $obj_title;
30
31 public function __construct(
33 ilWebDAVUriBuilder $a_uri_builder,
34 ilSetting $a_settings,
35 String $language,
36 int $a_ref_id
37 ) {
38 parent::__construct($a_repo, $a_uri_builder, $a_settings, $language);
39
40 $this->ref_id = $a_ref_id;
41
42 // TODO: Change this to be more unit testable!
43 $this->obj_id = ilObject::_lookupObjectId($this->ref_id);
44 $this->obj_title = ilObject::_lookupTitle($this->obj_id);
45 }
46
47 protected function fillPlaceholdersForMountInstructions(array $mount_instructions): array
48 {
49 foreach ($mount_instructions as $title => $mount_instruction) {
50 $mount_instruction = str_replace("[WEBFOLDER_ID]", (string) $this->ref_id, $mount_instruction);
51 $mount_instruction = str_replace("[WEBFOLDER_TITLE]", $this->obj_title, $mount_instruction);
52 $mount_instruction = str_replace("[WEBFOLDER_URI]", $this->uri_builder->getWebDavDefaultUri($this->ref_id), $mount_instruction);
53 $mount_instruction = str_replace("[WEBFOLDER_URI_KONQUEROR]", $this->uri_builder->getWebDavKonquerorUri($this->ref_id), $mount_instruction);
54 $mount_instruction = str_replace("[WEBFOLDER_URI_NAUTILUS]", $this->uri_builder->getWebDavNautilusUri($this->ref_id), $mount_instruction);
55 $mount_instruction = str_replace("[ADMIN_MAIL]", $this->settings->get("admin_email"), $mount_instruction);
56
57 $mount_instructions[$title] = $mount_instruction;
58 }
59
60 // TODO: Implement fillPlaceholdersForMountInstructions() method.
61 return $mount_instructions;
62 }
63}
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilWebDAVMountInstructionsRepository $a_repo, ilWebDAVUriBuilder $a_uri_builder, ilSetting $a_settings, String $language, int $a_ref_id)
fillPlaceholdersForMountInstructions(array $mount_instructions)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc