ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Popover.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use \ILIAS\UI\Component;
10 
17 abstract class Popover implements Component\Popover\Popover
18 {
19  use ComponentHelper;
24  protected $title = '';
28  protected $position = self::POS_AUTO;
32  protected $ajax_content_url = '';
36  protected $show_signal;
44  protected $signal_generator;
48  protected $fixed_position = false;
49 
50 
55  {
56  $this->signal_generator = $signal_generator;
57  $this->initSignals();
58  }
59 
60 
64  public function getTitle()
65  {
66  return $this->title;
67  }
68 
69 
73  public function getPosition()
74  {
75  return $this->position;
76  }
77 
78 
82  public function getAsyncContentUrl()
83  {
85  }
86 
87 
91  public function withVerticalPosition()
92  {
93  $clone = clone $this;
94  $clone->position = self::POS_VERTICAL;
95 
96  return $clone;
97  }
98 
99 
103  public function withHorizontalPosition()
104  {
105  $clone = clone $this;
106  $clone->position = self::POS_HORIZONTAL;
107 
108  return $clone;
109  }
110 
111 
115  public function withAsyncContentUrl($url)
116  {
117  $this->checkStringArg('url', $url);
118  $clone = clone $this;
119  $clone->ajax_content_url = $url;
120 
121  return $clone;
122  }
123 
124 
128  public function withTitle($title)
129  {
130  $this->checkStringArg('title', $title);
131  $clone = clone $this;
132  $clone->title = $title;
133 
134  return $clone;
135  }
136 
137 
141  public function withResetSignals()
142  {
143  $clone = clone $this;
144  $clone->initSignals();
145 
146  return $clone;
147  }
148 
149 
153  public function getShowSignal()
154  {
155  return $this->show_signal;
156  }
157 
158 
162  public function getReplaceContentSignal()
163  {
165  }
166 
167 
171  protected function initSignals()
172  {
173  $this->show_signal = $this->signal_generator->create();
174  $this->replace_content_signal = $this->signal_generator->create("ILIAS\\UI\\Implementation\\Component\\ReplaceContentSignal");
175  }
176 
177 
181  public function withFixedPosition()
182  {
183  $this->fixed_position = true;
184 
185  return $this;
186  }
187 
188 
192  public function isFixedPosition()
193  {
194  return $this->fixed_position;
195  }
196 }
withTitle($title)
Get the same popover displaying a title above the content.Popover
Definition: Popover.php:128
getTitle()
Get the title of the popover.string
Definition: Popover.php:64
__construct(SignalGeneratorInterface $signal_generator)
Definition: Popover.php:54
getPosition()
Get the position of the popover.string
Definition: Popover.php:73
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
isFixedPosition()
bool whether it&#39;s fixed or not
Definition: Popover.php:192
getReplaceContentSignal()
Get the signal to replace the content of this popover.ReplaceContentSignal
Definition: Popover.php:162
initSignals()
Init any signals of this component.
Definition: Popover.php:171
getAsyncContentUrl()
Get the url returning the rendered content, if the popovers content is rendered via ajax...
Definition: Popover.php:82
withHorizontalPosition()
Get the same popover being rendered to the left or right of the triggerer, based on the available spa...
Definition: Popover.php:103
withFixedPosition()
Get a popover which can be used in fixed places such as the main menu.This popover will stay fixed wh...
Definition: Popover.php:181
withVerticalPosition()
Get the same popover being rendered below or above the triggerer, based on the available space...
Definition: Popover.php:91
getShowSignal()
Get the signal to show this popover in the frontend.Signal
Definition: Popover.php:153
withAsyncContentUrl($url)
Get a popover like this who&#39;s content is rendered via ajax by the given $url before the popover is sh...
Definition: Popover.php:115
$url
withResetSignals()
Get a component like this but reset (regenerate) its signals.$this
Definition: Popover.php:141