19 declare(strict_types=1);
42 abstract class File implements FileDropzone
62 $this->clear_signal = $signal_generator->
create();
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();
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;
withCloseWithKeyboard(bool $state)
Get a modal like this which can or cannot be closed by keyboard (ESC), depending on the given $state...
withSubmitLabel(string $caption)
appendTriggeredSignal(C\Signal $signal, string $event)
Append a triggered signal to other signals of the same event.
withOnDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped...
getShowSignal()
Get the signal to show this modal in the frontend.
getCancelButtonLabel()
Get the custom label of the cancel button in the footer.
withTriggeredSignal(C\Signal $signal, string $event)
Add a triggered signal, replacing any other signals registered on the same event. ...
withCancelButtonLabel(string $label)
Get the modal like this with the provided cancel button string.
initSignals()
Init the default signals plus extra signals like Replace.
withRequest(ServerRequestInterface $request)
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
getClearSignal()
Returns a signal that can be used to clear the current file queue.
getReplaceSignal()
Get the signal to replace the content of this modal.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getContent()
Get the components representing the content of the modal.
withAdditionalDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped...
appendOnLoad(Signal $signal)
Get a component like this, triggering a signal of another component on load.
withOnLoad(Signal $signal)
Trigger a signal of another component on load.
getAsyncRenderUrl()
Get the url returning the rendered modal, if the modals content should be rendered via ajax...
withInput(InputData $input_data)
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.
withAdditionalTransformation(Transformation $trafo)
This signal replaces a component by ajax.
SignalGeneratorInterface $signal_generator
modal(string $title="", string $cancel_label="")
getTitle()
Get the custom title if set.
create(string $class='')
Create a signal, each created signal MUST have a unique ID.
getActionButtons()
Get all action buttons in the footer of the modal.
__construct(SignalGeneratorInterface $signal_generator, FieldFactory $field_factory, NameSource $name_source, string $title, string $post_url, FileInput $file_input, ?FormInput $additional_input)
withResetSignals()
Get a component like this but reset (regenerate) its signals.
withActionButtons(array $buttons)
Get a modal like this with the provided action buttons in the footer.
appendOnClose(Signal $signal)
Get a component like this, triggering a signal of another component on close.
getCloseWithKeyboard()
Returns if this modal can be closed with the keyboard (ESC key)
withAsyncRenderUrl(string $url)
Get a modal like this who's content is rendered via ajax by the given $url before the modal is shown...
withDedicatedName(string $dedicated_name)
No dedicated name can be set for this subform.