1 | <?php |
||
14 | class Modal extends SimpleExtComponent { |
||
15 | |||
16 | public function __construct(JsUtils $js) { |
||
20 | |||
21 | public function attach($identifier) { |
||
22 | parent::attach($identifier); |
||
23 | $this->js->addClass($identifier, "modal", true); |
||
24 | $this->js->attr($identifier, "role", "dialog", true); |
||
25 | $this->js->attr($identifier, "aria-labelledby", "myModalLabel", true); |
||
26 | $this->js->attr($identifier, "aria-hidden", true, true); |
||
|
|||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Shows the modal when initialized. |
||
31 | * @param Boolean $value default : true |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setShow($value) { |
||
35 | return $this->setParam("show", $value); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Includes a modal-backdrop element. |
||
40 | * Alternatively, specify static for a backdrop which doesn't close the modal on click. |
||
41 | * @param Boolean $value default : true |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function setBackdrop($value) { |
||
45 | return $this->setParam("backdrop", $value); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Closes the modal when escape key is pressed. |
||
50 | * @param Boolean $value default : false |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function setKeyboard($value) { |
||
56 | |||
57 | public function setDraggable($value) { |
||
58 | if ($value) { |
||
59 | $this->jsCodes ["draggable"]=new Draggable(); |
||
60 | $this->setBackdrop(false); |
||
61 | } else if (array_key_exists("draggable", $this->jsCodes)) { |
||
62 | unset($this->jsCodes ["draggable"]); |
||
63 | unset($this->params ["backdrop"]); |
||
64 | } |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * This event fires immediately when the show instance method is called. |
||
69 | * If caused by a click, the clicked element is available as the relatedTarget property of the event. |
||
70 | * @param string $jsCode |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function onShow($jsCode) { |
||
76 | |||
77 | /** |
||
78 | * This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete). |
||
79 | * If caused by a click, the clicked element is available as the relatedTarget property of the event. |
||
80 | * @param string $jsCode |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function onShown($jsCode) { |
||
86 | |||
87 | /** |
||
88 | * This event is fired immediately when the hide instance method has been called. |
||
89 | * @param string $jsCode |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function onHide($jsCode) { |
||
95 | |||
96 | /** |
||
97 | * This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete). |
||
98 | * @param string $jsCode |
||
99 | * @return $this |
||
100 | */ |
||
101 | public function onHidden($jsCode) { |
||
104 | |||
105 | /** |
||
106 | * This event is fired when the modal has loaded content using the remote option. |
||
107 | * @param string $jsCode |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function onLoaded($jsCode) { |
||
113 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: