<div class="form">

    <?php
    /**
     * @var $this NodeController
     * @var BHorizontalForm $form
     * @var Node $model
     * @var NodeI18n[] $i18nModels
     */
    ?>

    <?php $form = $this->beginWidget('BHorizontalForm', array(
    'id' => 'node-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); ?>

    -->

    <!--<div class="control-group <?php /*echo ($model->hasErrors('node_id') ? ' error' : '') */?>">
        <?php /*echo $form->label($model, 'node_id', array('class' => 'control-label'))*/?>
        <div class="controls">
            <?php /*echo $form->textField($model, 'node_id'); */?>
            <?php /*echo $form->error($model, 'node_id'); */?>
        </div>
    </div>-->

    <div class="control-group <?php echo ($model->hasErrors('hidden') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'hidden', array('class' => 'control-label'))?>
        <div class="controls">
            <?php echo $form->checkBox($model, "hidden"); ?>
            <?php echo $form->error($model, 'hidden'); ?>
        </div>
    </div>

    <div class="control-group <?php echo ($model->hasErrors('link') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'link', array('class' => 'control-label'))?>
        <div class="controls">
            <?php echo $form->textField($model, 'link', array('size' => 60, 'maxlength' => 128)); ?>
            <?php echo $form->error($model, 'link'); ?>
        </div>
    </div>

    <?php if (!isset($model->data_type)): ?>
    <div class="control-group <?php echo ($model->hasErrors('data_type') ? ' error' : '') ?>">
        <?php echo $form->label($model, 'data_type', array('class' => 'control-label'))?>
        <div class="controls">
            <?php echo $form->dropDownList($model, 'data_type',$model->nodeTypes); ?>
            <?php echo $form->error($model, 'data_type'); ?>
        </div>
    </div>
    <?php endif;?>

    <!--<div class="control-group <?php /*echo ($model->hasErrors('data_id') ? ' error' : '') */?>">
        <?php /*echo $form->label($model, 'data_id', array('class' => 'control-label'))*/?>
        <div class="controls">
            <?php /*echo $form->textField($model, 'data_id'); */?>
            <?php /*echo $form->error($model, 'data_id'); */?>
        </div>
    </div>-->

    <!--<div class="control-group <?php /*echo ($model->hasErrors('menu_tag') ? ' error' : '') */?>">
        <?php /*echo $form->label($model, 'menu_tag', array('class' => 'control-label'))*/?>
        <div class="controls">
            <?php /*echo $form->textField($model, 'menu_tag', array('size' => 60, 'maxlength' => 64)); */?>
            <?php /*echo $form->error($model, 'menu_tag'); */?>
        </div>
    </div>-->

    <!--<div class="control-group <?php /*echo ($model->hasErrors('rank') ? ' error' : '') */?>">
        <?php /*echo $form->label($model, 'rank', array('class' => 'control-label'))*/?>
        <div class="controls">
            <?php /*echo $form->textField($model, 'rank'); */?>
            <?php /*echo $form->error($model, 'rank'); */?>
        </div>
    </div>-->

    <?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('label') ? ' error' : '') ?>">
            <?php echo $form->label($i18nModel, 'label', array('class' => 'control-label'))?>
            <div class="controls">
                <?php echo $form->textField($i18nModel, "[$lang]label", array('size' => 60, 'maxlength' => 256)); ?>
                <?php echo $form->error($i18nModel, 'label'); ?>
            </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 -->
