Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt checkboxListGroup and radioButtonListGroup to bootstrap 3.2 #935

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 17 additions & 10 deletions src/widgets/TbActiveForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = '<div class="checkbox">{beginLabel}{input}{labelTitle}{endLabel}</div>';

if (!isset($widgetOptions['separator']))
$widgetOptions['separator'] = "\n";
Expand Down Expand Up @@ -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'] = '<div class="radio">{beginLabel}{input}{labelTitle}{endLabel}</div>';


if (!isset($widgetOptions['separator']))
$widgetOptions['separator'] = "\n";

Expand Down