ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Popover.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\UI\Implementation\Component\ComponentHelper;
27
34abstract class Popover implements C\Popover\Popover
35{
36 use ComponentHelper;
38
39 protected string $title = '';
40 protected string $position = self::POS_AUTO;
41 protected string $ajax_content_url = '';
45 protected bool $fixed_position = false;
46
48 {
49 $this->signal_generator = $signal_generator;
50 $this->initSignals();
51 }
52
56 public function getTitle(): string
57 {
58 return $this->title;
59 }
60
64 public function getPosition(): string
65 {
66 return $this->position;
67 }
68
72 public function getAsyncContentUrl(): string
73 {
75 }
76
81 {
82 $clone = clone $this;
83 $clone->position = self::POS_VERTICAL;
84 return $clone;
85 }
86
91 {
92 $clone = clone $this;
93 $clone->position = self::POS_HORIZONTAL;
94 return $clone;
95 }
96
100 public function withAsyncContentUrl(string $url): C\Popover\Popover
101 {
102 $clone = clone $this;
103 $clone->ajax_content_url = $url;
104 return $clone;
105 }
106
110 public function withTitle(string $title): C\Popover\Popover
111 {
112 $clone = clone $this;
113 $clone->title = $title;
114 return $clone;
115 }
116
121 {
122 $clone = clone $this;
123 $clone->initSignals();
124 return $clone;
125 }
126
130 public function getShowSignal(): C\Signal
131 {
132 return $this->show_signal;
133 }
134
139 {
141 }
142
146 protected function initSignals()
147 {
148 $this->show_signal = $this->signal_generator->create();
150 $signal = $this->signal_generator->create("ILIAS\\UI\\Implementation\\Component\\ReplaceContentSignal");
151 $this->replace_content_signal = $signal;
152 }
153
158 {
159 $this->fixed_position = true;
160
161 return $this;
162 }
163
167 public function isFixedPosition(): bool
168 {
170 }
171}
C ReplaceContentSignal $replace_content_signal
Definition: Popover.php:43
__construct(SignalGeneratorInterface $signal_generator)
Definition: Popover.php:47
SignalGeneratorInterface $signal_generator
Definition: Popover.php:44
This signal replaces the content of a component by ajax.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
$url
Definition: shib_logout.php:68