From e2f561d1dd2294d8bf8a40ae20b7a6a5c8f67adb Mon Sep 17 00:00:00 2001 From: lisps Date: Tue, 2 Sep 2014 13:24:18 +0200 Subject: [PATCH 1/2] adapt checkboxListGroup and radioButtonListGroup to bootstrap 3.2 --- src/widgets/TbActiveForm.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/widgets/TbActiveForm.php b/src/widgets/TbActiveForm.php index a30c4036..1be61999 100644 --- a/src/widgets/TbActiveForm.php +++ b/src/widgets/TbActiveForm.php @@ -691,14 +691,17 @@ public function checkboxListGroup($model, $attribute, $options = array()) { // if(!isset($options['widgetOptions']['data'])) // throw new CException('$options["widgetOptions"]["data"] must exist'); - if (!isset($widgetOptions['labelOptions']['class'])) - $widgetOptions['labelOptions']['class'] = 'checkbox'; + // if (!isset($widgetOptions['labelOptions']['class'])) + // $widgetOptions['labelOptions']['class'] = 'checkbox'; - if(isset($options['inline']) && $options['inline']) + if(isset($options['inline']) && $options['inline']) { $widgetOptions['labelOptions']['class'] = 'checkbox-inline'; + if (!isset($widgetOptions['template'])) + $widgetOptions['template'] = '{beginLabel}{input}{labelTitle}{endLabel}'; + } if (!isset($widgetOptions['template'])) - $widgetOptions['template'] = '{beginLabel}{input}{labelTitle}{endLabel}'; + $widgetOptions['template'] = '
{beginLabel}{input}{labelTitle}{endLabel}
'; if (!isset($widgetOptions['separator'])) $widgetOptions['separator'] = "\n"; @@ -735,15 +738,19 @@ public function radioButtonListGroup($model, $attribute, $options = array()) { // if(!isset($options['widgetOptions']['data'])) // throw new CException('$options["widgetOptions"]["data"] must exist'); - if (!isset($widgetOptions['labelOptions']['class'])) - $widgetOptions['labelOptions']['class'] = 'radio'; - - if(isset($options['inline']) && $options['inline']) - $widgetOptions['labelOptions']['class'] = 'checkbox-inline'; + // if (!isset($widgetOptions['labelOptions']['class'])) + // $widgetOptions['labelOptions']['class'] = 'radio'; + if(isset($options['inline']) && $options['inline']) { + $widgetOptions['labelOptions']['class'] = 'radio-inline'; + if (!isset($widgetOptions['template'])) + $widgetOptions['template'] = '{beginLabel}{input}{labelTitle}{endLabel}'; + } + if (!isset($widgetOptions['template'])) - $widgetOptions['template'] = '{beginLabel}{input}{labelTitle}{endLabel}'; + $widgetOptions['template'] = '
{beginLabel}{input}{labelTitle}{endLabel}
'; + if (!isset($widgetOptions['separator'])) $widgetOptions['separator'] = "\n"; From bcea202f86b204a4954fe3ab7a7ebe22f6d4bdf5 Mon Sep 17 00:00:00 2001 From: lisps Date: Thu, 25 Sep 2014 09:05:34 +0200 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 111c4a37..28746bd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ Thank you all Antonio Ramirez. ## YiiBooster latest development alpha -- +- **(fix)** fix TbActiveForm/checkboxListGroup, radioButtonListGroup to work with Bootstrap 3.2.0 #935 ## YiiBooster version 4.1.0 - **(enh)** upgarde to Bootstrap 3.2.0 - #882