<div class="form">

    <?php
    /**
     * @var BHorizontalForm $form
     * @var Brand $model
     * @var BrandI18n[] $i18nModels
     */
    ?>

    <?php $form = $this->beginWidget('BHorizontalForm', array(
    'id' => 'brand-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => array(
        'enctype' => 'multipart/form-data',
    ),
)); ?>
    <!--
    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

    -->
    <?php
    echo $form->controlGroup($model, 'image',
        $form->fileField($model, 'image') . '<br/>' .
            CHtml::image($model->imageBehavior->getFileUrl()));
    ?>

    <?php
    /**
     * @var BTabs $tabs
     */
    $tabs = $this->beginWidget('BTabs');
    foreach ($i18nModels as $lang => $i18nModel):
        ?>
        <?php $tabs->beginTab(Yii::app()->params['languageNames'][$lang]) ?>
        <div class="control-group <?php echo ($i18nModel->hasErrors('name') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'name', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textField($i18nModel, "[$lang]name", array('size' => 60, 'maxlength' => 64)); ?>
                <?php echo $form->error($i18nModel, 'name'); ?>
            </div>
        </div>

        <?php $tabs->endTab() ?>
        <?php
    endforeach;
    $this->endWidget();
    ?>

    <div class="form-actions">
        <button type="submit" class="btn btn-large btn-primary">
            <?php echo ($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
        </button>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->
