@@ -32,8 +32,6 @@ class BootstrapPanelHelper extends Helper {
3232
3333 public $ current = NULL ;
3434
35- <<<<<<< HEAD
36- =======
3735 /* Protected attributes used to generate ID for collapsible panels. */
3836 protected $ _panelCount = 0 ;
3937 protected $ _bodyId = null ;
@@ -85,7 +83,6 @@ public function endGroup() {
8583 return $ out .'</div> ' ;
8684 }
8785
88- >>>>>>> panel-helper
8986 /**
9087 *
9188 * Create a Twitter Bootstrap like panel.
@@ -99,28 +96,6 @@ public function endGroup() {
9996 public function create ($ title = null , $ options = []) {
10097
10198 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- =======
12499 $ options = $ title ;
125100 }
126101
@@ -164,34 +139,21 @@ public function create($title = null, $options = []) {
164139 }
165140
166141 return $ out ;
167- >>>>>>> panel-helper
168142 }
169143
170144 /**
171145 *
172- <<<<<<< HEAD
173- * End a panel. If $title is not null, the ModalHelper::footer functions
174- =======
175146 * End a panel. If $title is not null, the PanelHelper::footer functions
176- >>>>>>> panel-helper
177147 * is called with $title and $options arguments.
178148 *
179149 * @param string|null $buttons
180150 * @param array $options
181151 *
182152 **/
183153 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- =======
191154 $ this ->_lastPanelClosed = true ;
192155 $ res = '' ;
193156 $ res .= $ this ->_cleanCurrent ();
194- >>>>>>> panel-helper
195157 if ($ title !== null ) {
196158 $ res .= $ this ->footer ($ title , $ options ) ;
197159 }
@@ -200,38 +162,6 @@ public function end ($title = null, $options = []) {
200162 }
201163
202164 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- =======
235165 $ res = '' ;
236166 if ($ this ->current ) {
237167 $ res .= '</div> ' ;
@@ -293,58 +223,26 @@ protected function _createBody ($text = null, $options = []) {
293223 $ this ->current = 'body ' ;
294224 }
295225 return $ body ;
296- >>>>>>> panel-helper
297226 }
298227
299228 protected function _createFooter ($ text = null , $ options = []) {
300229 $ 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- =======
321230 return $ this ->_cleanCurrent ().$ this ->Html ->tag ('div ' , $ text , $ options ) ;
322- >>>>>>> panel-helper
323231 }
324232
325233 /**
326234 *
327235 * Create / Start the header. If $info is specified as a string, create and return the
328236 * whole header, otherwize only open the header.
329237 *
330- <<<<<<< HEAD
331- * @param array|string $info If string, use as the modal title, otherwize works as $options.
332- =======
333238 * @param array|string $info If string, use as the panel title, otherwize works as $options.
334- >>>>>>> panel-helper
335239 * @param array $options Options for the header div.
336240 *
337241 * Special option (if $info is string):
338242 * - close: Add the 'close' button in the header (default true).
339243 *
340244 **/
341245 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- =======
348246 if (is_array ($ info )) {
349247 $ options = $ info ;
350248 $ info = null ;
@@ -353,7 +251,6 @@ public function header ($info = null, $options = []) {
353251 'title ' => true
354252 ];
355253 return $ this ->_createHeader ($ info , $ options ) ;
356- >>>>>>> panel-helper
357254 }
358255
359256 /**
@@ -367,21 +264,11 @@ public function header ($info = null, $options = []) {
367264 *
368265 **/
369266 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- =======
379267 if (is_array ($ info )) {
380268 $ options = $ info ;
381269 $ info = null ;
382270 }
383271 return $ this ->_createBody ($ info , $ options );
384- >>>>>>> panel-helper
385272 }
386273
387274 protected function _isAssociativeArray ($ array ) {
@@ -397,15 +284,11 @@ protected function _isAssociativeArray ($array) {
397284 * @param array $options Options for the footer div.
398285 *
399286 **/
400- <<<<<<< HEAD
401- public function footer ($ text = "" , $ options = []) {
402- =======
403287 public function footer ($ text = null , $ options = []) {
404288 if (is_array ($ text )) {
405289 $ options = $ text ;
406290 $ text = null ;
407291 }
408- >>>>>>> panel-helper
409292 return $ this ->_createFooter ($ text , $ options ) ;
410293 }
411294
0 commit comments