1 | <?php |
||
14 | class HtmlModal extends BaseHtml { |
||
15 | protected $title="Titre de ma boîte"; |
||
16 | protected $content=""; |
||
17 | protected $buttons=array (); |
||
18 | protected $showOnStartup=false; |
||
19 | protected $draggable=false; |
||
20 | protected $validCondition=NULL; |
||
21 | protected $backdrop=true; |
||
22 | |||
23 | /** |
||
24 | * |
||
25 | * @param string $identifier the id |
||
26 | */ |
||
27 | public function __construct($identifier, $title="", $content="", $buttonCaptions=array()) { |
||
37 | |||
38 | /** |
||
39 | * Add a button |
||
40 | * @param string $value the button caption |
||
41 | * @param string $style one of "btn-default","btn-primary","btn-success","btn-info","btn-warning","btn-danger" |
||
42 | * @return HtmlButton |
||
43 | */ |
||
44 | public function addButton($value="Okay", $style="btn-primary") { |
||
51 | |||
52 | /** |
||
53 | * Add a cancel button (dismiss) |
||
54 | * @param string $value |
||
55 | * @return HtmlButton |
||
56 | */ |
||
57 | public function addCancelButton($value="Annuler") { |
||
62 | |||
63 | /** |
||
64 | * Add an Okay button (close the box only if $(identifier).valid===true) |
||
65 | * @param string $value |
||
66 | * @return HtmlButton |
||
67 | */ |
||
68 | public function addOkayButton($value="Okay",$jsCode="") { |
||
73 | |||
74 | protected function getDefaultValidCondition() { |
||
77 | |||
78 | public function setValidCondition($js) { |
||
81 | |||
82 | public function getValidCondition() { |
||
89 | |||
90 | public function setValid() { |
||
93 | |||
94 | /** |
||
95 | * set the content of the modal |
||
96 | * @param string $content |
||
97 | */ |
||
98 | public function setContent($content) { |
||
101 | |||
102 | /** |
||
103 | * set the title of the modal |
||
104 | * @param string $title |
||
105 | */ |
||
106 | public function setTitle($title) { |
||
109 | |||
110 | /** |
||
111 | * render the content of an existing view : $controller/$action and set the response to the modal content |
||
112 | * @param JsUtils $js |
||
113 | * @param Controller $initialController |
||
114 | * @param string $viewName |
||
115 | * @param $params The parameters to pass to the view |
||
116 | */ |
||
117 | public function renderView(JsUtils $js,$initialController,$viewName, $params=array()) { |
||
120 | |||
121 | /** |
||
122 | * render the content of $controller::$action and set the response to the modal content |
||
123 | * @param JsUtils $js |
||
124 | * @param string $title The panel title |
||
125 | * @param Controller $initialControllerInstance |
||
126 | * @param string $controllerName the controller name |
||
127 | * @param string $actionName the action name |
||
128 | */ |
||
129 | public function forward(JsUtils $js,$initialControllerInstance,$controllerName,$actionName,$params=NULL){ |
||
132 | |||
133 | /* |
||
134 | * (non-PHPdoc) |
||
135 | * @see BaseHtml::run() |
||
136 | */ |
||
137 | public function run(JsUtils $js) { |
||
150 | |||
151 | public function getButton($index) { |
||
157 | |||
158 | public function showOnCreate() { |
||
162 | |||
163 | public function jsShow() { |
||
166 | |||
167 | public function jsHide() { |
||
170 | |||
171 | public function jsGetContent(JsUtils $js, $url) { |
||
174 | |||
175 | public function jsSetTitle($title) { |
||
178 | |||
179 | public function jsHideButton($index) { |
||
184 | |||
185 | /** |
||
186 | * Allow modal to be moved using the mouse. |
||
187 | * needs JQuery UI |
||
188 | * @param boolean $value |
||
189 | */ |
||
190 | public function setDraggable($value) { |
||
196 | |||
197 | /** |
||
198 | * Includes a modal-backdrop element. |
||
199 | * Alternatively, specify static for a backdrop which doesn't close the modal on click. |
||
200 | * @param Boolean $value default : true |
||
201 | * @return HtmlModal |
||
202 | */ |
||
203 | public function setBackdrop($value) { |
||
206 | } |
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: