ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
Configuration.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
32final class Configuration
33{
35
37
38 public function __construct(
40 private ResourceStakeholder $stakeholder,
41 private string $title,
42 private Mode $mode = Mode::DATA_TABLE,
43 private int $items_per_page = 100,
44 private bool $user_can_upload = false,
45 private bool $user_can_administrate = false,
46 ) {
47 global $DIC;
48 $this->action_provider = new ExternalActionProvider();
49 }
50
52 {
53 $this->path_status_info = $path_status_info;
54 return $this;
55 }
56
58 {
60 }
61
62 public function withExternalAction(
63 string $label,
64 string $target_gui,
65 string $target_cmd,
66 string $parameter_namespace,
67 string $path_parameter = 'path',
68 bool $supports_directories = false,
69 array $supported_mime_types = ['*']
70 ): self {
71 $this->action_provider->addSingleAction(
72 $target_gui . '_' . $target_cmd,
74 $label,
75 $target_gui,
76 $target_cmd,
77 $path_parameter,
78 $parameter_namespace,
79 false,
80 false,
81 $supports_directories,
82 $supported_mime_types
83 )
84 );
85
86 return $this;
87 }
88
89 public function withExternalTopAction(string $key, TopAction $topAction, ?RoundTrip $modal = null): self
90 {
91 $this->action_provider->addTopAction($key, $topAction, $modal);
92
93 return $this;
94 }
95
97 {
98 return $this->container;
99 }
100
102 {
103 return $this->stakeholder;
104 }
105
106 public function getTitle(): string
107 {
108 return $this->title;
109 }
110
111 public function getDescription(): ?string
112 {
113 return null;
114 }
115
116 public function getItemsPerPage(): int
117 {
118 return $this->items_per_page;
119 }
120
121 public function getMode(): Mode
122 {
123 return $this->mode;
124 }
125
126 public function canUserUpload(): bool
127 {
128 return $this->user_can_upload;
129 }
130
131 public function canUserAdministrate(): bool
132 {
133 return $this->user_can_administrate;
134 }
135
137 {
138 return $this->action_provider;
139 }
140}
withExternalAction(string $label, string $target_gui, string $target_cmd, string $parameter_namespace, string $path_parameter='path', bool $supports_directories=false, array $supported_mime_types=[' *'])
withExternalTopAction(string $key, TopAction $topAction, ?RoundTrip $modal=null)
__construct(private StorableContainerResource $container, private ResourceStakeholder $stakeholder, private string $title, private Mode $mode=Mode::DATA_TABLE, private int $items_per_page=100, private bool $user_can_upload=false, private bool $user_can_administrate=false,)
global $DIC
Definition: shib_login.php:26
$container
@noRector
Definition: wac.php:37