19declare(strict_types=1);
25use ILIAS\UI\Implementation\Component\ComponentHelper;
34use Psr\Http\Message\ServerRequestInterface;
42abstract class File implements FileDropzone
54 FieldFactory $field_factory,
58 FileInput $file_input,
64 if (
null !== $additional_input) {
65 $inputs = [$file_input, $additional_input];
93 return $this->
modal->getTitle();
100 $clone->modal = $clone->modal->withOnClose($signal);
106 $clone = clone $this;
108 $clone->modal = $clone->modal->appendOnClose($signal);
114 return $this->
modal->getAsyncRenderUrl();
119 $clone = clone $this;
120 $clone->modal = $clone->modal->withAsyncRenderUrl(
$url);
126 $clone = clone $this;
127 $clone->modal = $clone->modal->withCloseWithKeyboard($state);
133 return $this->
modal->getCloseWithKeyboard();
138 return $this->
modal->getShowSignal();
143 return $this->
modal->getCloseSignal();
148 $clone = clone $this;
149 $clone->modal = $clone->modal->withOnLoad($signal);
155 $clone = clone $this;
156 $clone->modal = $clone->modal->appendOnLoad($signal);
162 return $this->
modal->getContent();
167 return $this->
modal->getActionButtons();
172 return $this->
modal->getCancelButtonLabel();
177 $clone = clone $this;
178 $clone->modal = $clone->modal->withActionButtons($buttons);
184 $clone = clone $this;
185 $clone->modal = $clone->modal->withCancelButtonLabel($label);
191 return $this->
modal->getReplaceSignal();
196 return $this->
modal->getPostURL();
201 $clone = clone $this;
202 $clone->modal = $clone->modal->withSubmitLabel($caption);
208 return $this->
modal->getSubmitLabel();
213 return $this->
modal->getInputs();
216 public function withRequest(ServerRequestInterface $request): self
218 $clone = clone $this;
219 $clone->modal = $clone->modal->withRequest($request);
225 $clone = clone $this;
226 $clone->modal = $clone->modal->withInput($request);
232 $clone = clone $this;
233 $clone->modal = $clone->modal->withAdditionalTransformation($trafo);
239 return $this->
modal->getData();
244 return $this->
modal->getError();
259 $clone = clone $this;
260 $clone->initSignals();
266 $this->clear_signal = $this->signal_generator->create();
267 $this->
modal->initSignals();
283 return $this->buttons;
getAsyncRenderUrl()
Get the url returning the rendered modal, if the modals content should be rendered via ajax.
getTitle()
Get the custom title if set.
appendOnClose(Signal $signal)
Get a component like this, triggering a signal of another component on close.
initSignals()
Init the default signals plus extra signals like Replace.
getCancelButtonLabel()
Get the custom label of the cancel button in the footer.
getCloseWithKeyboard()
Returns if this modal can be closed with the keyboard (ESC key)
getClearSignal()
Returns a signal that can be used to clear the current file queue.
withRequest(ServerRequestInterface $request)
withDedicatedName(string $dedicated_name)
No dedicated name can be set for this subform.
withOnLoad(Signal $signal)
Trigger a signal of another component on load.
withCancelButtonLabel(string $label)
Get the modal like this with the provided cancel button string.
withActionButtons(array $buttons)
Get a modal like this with the provided action buttons in the footer.
getShowSignal()
Get the signal to show this modal in the frontend.
withAsyncRenderUrl(string $url)
Get a modal like this who's content is rendered via ajax by the given $url before the modal is shown.
withAdditionalTransformation(Transformation $trafo)
withSubmitLabel(string $caption)
withAdditionalDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped.
withResetSignals()
Get a component like this but reset (regenerate) its signals.
getContent()
Get the components representing the content of the modal.
appendOnLoad(Signal $signal)
Get a component like this, triggering a signal of another component on load.
getCloseSignal()
Get the signal to close this modal in the frontend.
withOnClose(Signal $signal)
Get a component like this, triggering a signal of another component on close.
withCloseWithKeyboard(bool $state)
Get a modal like this which can or cannot be closed by keyboard (ESC), depending on the given $state.
withOnDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped.
getReplaceSignal()
Get the signal to replace the content of this modal.
getActionButtons()
Get all action buttons in the footer of the modal.
withInput(InputData $input_data)
__construct(SignalGeneratorInterface $signal_generator, FieldFactory $field_factory, NameSource $name_source, string $title, string $post_url, FileInput $file_input, ?FormInput $additional_input)
SignalGeneratorInterface $signal_generator
This signal replaces a component by ajax.
create(string $class='')
Create a signal, each created signal MUST have a unique ID.
modal(string $title="", string $cancel_label="")
appendTriggeredSignal(C\Signal $signal, string $event)
Append a triggered signal to other signals of the same event.
withTriggeredSignal(C\Signal $signal, string $event)
Add a triggered signal, replacing any other signals registered on the same event.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.