@@ -32,8 +32,6 @@ class BootstrapPanelHelper extends Helper {
32
32
33
33
public $ current = NULL ;
34
34
35
- <<<<<<< HEAD
36
- =======
37
35
/* Protected attributes used to generate ID for collapsible panels. */
38
36
protected $ _panelCount = 0 ;
39
37
protected $ _bodyId = null ;
@@ -85,7 +83,6 @@ public function endGroup() {
85
83
return $ out .'</div> ' ;
86
84
}
87
85
88
- >>>>>>> panel-helper
89
86
/**
90
87
*
91
88
* Create a Twitter Bootstrap like panel.
@@ -99,28 +96,6 @@ public function endGroup() {
99
96
public function create ($ title = null , $ options = []) {
100
97
101
98
if (is_array ($ title )) {
102
- <<<<<<< HEAD
103
- $ options = $ title ;
104
- }
105
-
106
- $ nobody = $ this ->_extractOption ('no-body ' , $ options , false );
107
- unset ($ options ['no-body ' ]);
108
- $ type = $ this ->_extractOption ('type ' , $ options , 'default ' );
109
- unset ($ options ['type ' ]);
110
-
111
- $ options = $ this ->addClass ($ options , ['panel ' , 'panel- ' .$ type ]);
112
- $ class = $ options ['class ' ];
113
- unset ($ options ['class ' ]);
114
-
115
- $ res = $ this ->Html ->div ($ class , null , $ options );
116
- if (is_string ($ title ) && $ title ) {
117
- $ res .= $ this ->_createHeader ($ title , []) ;
118
- if (!$ nobody ) {
119
- $ res .= $ this ->_startPart ('body ' );
120
- }
121
- }
122
- return $ res ;
123
- =======
124
99
$ options = $ title ;
125
100
}
126
101
@@ -164,34 +139,21 @@ public function create($title = null, $options = []) {
164
139
}
165
140
166
141
return $ out ;
167
- >>>>>>> panel-helper
168
142
}
169
143
170
144
/**
171
145
*
172
- <<<<<<< HEAD
173
- * End a panel. If $title is not null, the ModalHelper::footer functions
174
- =======
175
146
* End a panel. If $title is not null, the PanelHelper::footer functions
176
- >>>>>>> panel-helper
177
147
* is called with $title and $options arguments.
178
148
*
179
149
* @param string|null $buttons
180
150
* @param array $options
181
151
*
182
152
**/
183
153
public function end ($ title = null , $ options = []) {
184
- <<<<<<< HEAD
185
- $ res = '' ;
186
- if ($ this ->current != null ) {
187
- $ this ->current = null ;
188
- $ res .= $ this ->_endPart ();
189
- }
190
- =======
191
154
$ this ->_lastPanelClosed = true ;
192
155
$ res = '' ;
193
156
$ res .= $ this ->_cleanCurrent ();
194
- >>>>>>> panel-helper
195
157
if ($ title !== null ) {
196
158
$ res .= $ this ->footer ($ title , $ options ) ;
197
159
}
@@ -200,38 +162,6 @@ public function end ($title = null, $options = []) {
200
162
}
201
163
202
164
protected function _cleanCurrent () {
203
- <<<<<<< HEAD
204
- if ($ this ->current ) {
205
- $ this ->current = NULL ;
206
- return $ this ->_endPart ();
207
- }
208
- return '' ;
209
- }
210
-
211
- protected function _createHeader ($ title , $ options = [], $ titleOptions = []) {
212
- $ options += [
213
- '_title ' => []
214
- ];
215
- if (empty ($ titleOptions ))
216
- $ titleOptions = $ options ['_title ' ];
217
- unset ($ options ['_title ' ]);
218
- $ options = $ this ->addClass ($ options , 'panel-heading ' );
219
- $ class = $ options ['class ' ];
220
- unset ($ options ['class ' ]);
221
- $ titleOptions = $ this ->addClass ($ titleOptions , 'panel-title ' );
222
- return $ this ->_cleanCurrent ().$ this ->Html ->div ($ class ,
223
- $ this ->Html ->tag ('h3 ' , $ title ,
224
- $ titleOptions ),
225
- $ options
226
- ) ;
227
- }
228
-
229
- protected function _createBody ($ text , $ options = []) {
230
- $ options = $ this ->addClass ($ options , 'panel-body ' );
231
- $ class = $ options ['class ' ];
232
- unset ($ options ['class ' ]);
233
- return $ this ->_cleanCurrent ().$ this ->Html ->div ($ class , $ text , $ options ) ;
234
- =======
235
165
$ res = '' ;
236
166
if ($ this ->current ) {
237
167
$ res .= '</div> ' ;
@@ -293,58 +223,26 @@ protected function _createBody ($text = null, $options = []) {
293
223
$ this ->current = 'body ' ;
294
224
}
295
225
return $ body ;
296
- >>>>>>> panel-helper
297
226
}
298
227
299
228
protected function _createFooter ($ text = null , $ options = []) {
300
229
$ options = $ this ->addClass ($ options , 'panel-footer ' );
301
- <<<<<<< HEAD
302
- $ class = $ options ['class ' ];
303
- unset ($ options ['class ' ]);
304
- return $ this ->_cleanCurrent ().$ this ->Html ->div ($ class , $ text , $ options ) ;
305
- }
306
-
307
- protected function _startPart ($ part , $ options = []) {
308
- $ res = '' ;
309
- if ($ this ->current != null ) {
310
- $ res = $ this ->_endPart () ;
311
- }
312
- $ this ->current = $ part ;
313
- return $ res .$ this ->Html ->div ('panel- ' .$ part .' ' .$ this ->_extractOption ('class ' ,
314
- $ options , '' ),
315
- null , $ options ) ;
316
- }
317
-
318
- protected function _endPart () {
319
- return '</div> ' ;
320
- =======
321
230
return $ this ->_cleanCurrent ().$ this ->Html ->tag ('div ' , $ text , $ options ) ;
322
- >>>>>>> panel-helper
323
231
}
324
232
325
233
/**
326
234
*
327
235
* Create / Start the header. If $info is specified as a string, create and return the
328
236
* whole header, otherwize only open the header.
329
237
*
330
- <<<<<<< HEAD
331
- * @param array|string $info If string, use as the modal title, otherwize works as $options.
332
- =======
333
238
* @param array|string $info If string, use as the panel title, otherwize works as $options.
334
- >>>>>>> panel-helper
335
239
* @param array $options Options for the header div.
336
240
*
337
241
* Special option (if $info is string):
338
242
* - close: Add the 'close' button in the header (default true).
339
243
*
340
244
**/
341
245
public function header ($ info = null , $ options = []) {
342
- <<<<<<< HEAD
343
- if (is_string ($ info )) {
344
- return $ this ->_createHeader ($ info , $ options ) ;
345
- }
346
- return $ this ->_startPart ('header ' , is_array ($ info ) ? $ info : $ options ) ;
347
- =======
348
246
if (is_array ($ info )) {
349
247
$ options = $ info ;
350
248
$ info = null ;
@@ -353,7 +251,6 @@ public function header ($info = null, $options = []) {
353
251
'title ' => true
354
252
];
355
253
return $ this ->_createHeader ($ info , $ options ) ;
356
- >>>>>>> panel-helper
357
254
}
358
255
359
256
/**
@@ -367,21 +264,11 @@ public function header ($info = null, $options = []) {
367
264
*
368
265
**/
369
266
public function body ($ info = null , $ options = []) {
370
- <<<<<<< HEAD
371
- if (is_string ($ info )) {
372
- if ($ this ->current != null ) {
373
- $ this ->_endPart () ;
374
- }
375
- return $ this ->_createBody ($ info , $ options ) ;
376
- }
377
- return $ this ->_startPart ('body ' , is_array ($ info ) ? $ info : $ options ) ;
378
- =======
379
267
if (is_array ($ info )) {
380
268
$ options = $ info ;
381
269
$ info = null ;
382
270
}
383
271
return $ this ->_createBody ($ info , $ options );
384
- >>>>>>> panel-helper
385
272
}
386
273
387
274
protected function _isAssociativeArray ($ array ) {
@@ -397,15 +284,11 @@ protected function _isAssociativeArray ($array) {
397
284
* @param array $options Options for the footer div.
398
285
*
399
286
**/
400
- <<<<<<< HEAD
401
- public function footer ($ text = "" , $ options = []) {
402
- =======
403
287
public function footer ($ text = null , $ options = []) {
404
288
if (is_array ($ text )) {
405
289
$ options = $ text ;
406
290
$ text = null ;
407
291
}
408
- >>>>>>> panel-helper
409
292
return $ this ->_createFooter ($ text , $ options ) ;
410
293
}
411
294
0 commit comments