ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
ExportLinkBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 public function __construct(
29 protected string $template,
30 protected array $keyword_map = []
31 ) {
32 }
33
34 protected function build(string $type, string $id): string
35 {
36 return str_replace(["{TYPE}", "{ID}"], [$type, $id], $this->template);
37 }
38
39 public function forMonth(string $month): string
40 {
41 return $this->build("m", $month);
42 }
43
44 public function forPosting(int $posting_id, string $month = ""): string
45 {
46 return $this->build("p", (string) $posting_id);
47 }
48
49 public function forKeyword(string $keyword): string
50 {
51 $id = (string) ($this->keyword_map[$keyword] ?? "");
52 return $this->build("k", $id);
53 }
54
55 public function forAuthor(int $user_id): string
56 {
57 // Currently not supported in HTML export, but could be added if needed.
58 return "";
59 }
60
61 public function forMainList(): string
62 {
63 return "index.html";
64 }
65}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23