<?php
/* @var $this LocaleController */
/* @var $model Locale */
$this->breadcrumbs = array(
    'Locales' => array('index'),
    'setDefault',
);
$this->menu = array(
    array('label' => 'Create Locale', 'url' => array('create')),
    array('label' => 'Manage Locale', 'url' => array('admin')),
);
$selected = CHtml::listData($models, 'id', 'default');
foreach ($selected as $key => $value) {
    if ($value == 0) {
        unset($selected[$key]);
    }
}
if ($selected) {
    $selected = array_keys($selected);
} else {
    $selected = '';
}
$data = CHtml::listData($models, 'id', 'locale');
?>
<div class="page-header"><h1>Set Default Locale</h1></div>
<div class="col-xs-12">
    <?php echo TbHtml::beginFormTb(); ?>




    <div class="form-group">
        <?php echo CHtml::label(Yii::t('admin', 'Select Locale:'), 'defaultLocale', array('class' => 'col-sm-3 control-label')); ?>

        <div class="col-sm-9">
            <?php echo CHtml::dropDownList('defaultLocale', $selected, $data, array('empty' => '', 'class' => 'col-xs-10 col-sm-5')) ?>
        </div>
    </div>



    <?php echo TbHtml::formActions(array(CHtml::submitButton(Yii::t('admin', 'Save'), array('class' => 'btn btn-primary')))); ?>

    <?php echo CHtml::endForm(); ?>
</div>