ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Modal.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\UI\Implementation\Component\ComponentHelper;
30
36abstract class Modal implements M\Modal
37{
38 use ComponentHelper;
40 use Triggerer;
41
45 protected string $async_render_url = '';
46 protected bool $close_with_keyboard = true;
47
49 {
50 $this->signal_generator = $signal_generator;
51 $this->initSignals();
52 }
53
57 public function getAsyncRenderUrl(): string
58 {
60 }
61
65 public function withAsyncRenderUrl(string $url): M\Modal
66 {
67 $clone = clone $this;
68 $clone->async_render_url = $url;
69 return $clone;
70 }
71
75 public function withCloseWithKeyboard(bool $state): M\Modal
76 {
77 $clone = clone $this;
78 $clone->close_with_keyboard = $state;
79 return $clone;
80 }
81
85 public function getCloseWithKeyboard(): bool
86 {
88 }
89
93 public function getShowSignal(): Signal
94 {
95 return $this->show_signal;
96 }
97
101 public function getCloseSignal(): Signal
102 {
103 return $this->close_signal;
104 }
105
109 public function withResetSignals(): Modal
110 {
111 $clone = clone $this;
112 $clone->initSignals();
113 return $clone;
114 }
115
119 public function withOnLoad(Signal $signal): Onloadable
120 {
121 return $this->withTriggeredSignal($signal, 'ready');
122 }
123
127 public function appendOnLoad(Signal $signal): Onloadable
128 {
129 return $this->appendTriggeredSignal($signal, 'ready');
130 }
131
132 public function withOnClose(Signal $signal): self
133 {
134 return $this->withTriggeredSignal($signal, 'hidden.bs.modal');
135 }
136
137 public function appendOnClose(Signal $signal): self
138 {
139 return $this->withTriggeredSignal($signal, 'hidden.bs.modal');
140 }
141
145 public function initSignals(): void
146 {
147 $this->show_signal = $this->signal_generator->create();
148 $this->close_signal = $this->signal_generator->create();
149 }
150}
SignalGeneratorInterface $signal_generator
Definition: Modal.php:42
__construct(SignalGeneratorInterface $signal_generator)
Definition: Modal.php:48
initSignals()
Set the show and close signals for this modal.
Definition: Modal.php:145
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
appendTriggeredSignal(C\Signal $signal, string $event)
Append a triggered signal to other signals of the same event.
Definition: Triggerer.php:47
withTriggeredSignal(C\Signal $signal, string $event)
Add a triggered signal, replacing any other signals registered on the same event.
Definition: Triggerer.php:62
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
$url
Definition: shib_logout.php:68