<?php
/* @var $this MenuController */
/* @var $model Menu */
/* @var $form CActiveForm */
if ($this->action->id === 'create')
    $this->pageTitle = Yii::t('admin', 'Create Menu');
else if ($this->action->id === 'update')
    $this->pageTitle = Yii::t('admin', 'Update Menu');
$this->breadcrumbs = array(
    'Menus' => array('admin'),
    'Create',
);
$this->menu = array(
    array('label' => 'Manage Menus', 'url' => array('admin')),
);
?>
<div class="page-header"><h1><?php echo $this->pageTitle; ?></h1></div>
<div class="col-xs-12">
    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'menu-form',
        'enableAjaxValidation' => false,
        'clientOptions' => array(
            'validateOnSubmit' => true,
            'afterValidate' => 'js:function(form, data, hasError){
                        if(!hasError)
                                jQuery(".page-loader").show();
                        return true;             
                }',
        ),
    ));
    ?>
    <?php echo $form->errorSummary($model); ?>

    <?php echo $form->textFieldControlGroup($model, 'title', array('maxlength' => 100)); ?>

    <?php echo $form->textFieldControlGroup($model, 'slug', array('maxlength' => 100)); ?>

    <?php echo $form->dropDownListControlGroup($model, 'status', $model->getStatuses(), array('empty' => '')); ?>

    <?php //if (Yii::app()->options->get('I18N_MULTILINGUAL', 0) == 1): ?>
        <?php //echo $form->dropDownListControlGroup($model, 'language', FlexLocale::getActiveLocales(), array('empty' => '')); ?>
    <?php //endif; ?>


    <div class="widget-box collapsed">
        <div class="widget-header widget-header-small">

            <a href="widgets.html#" data-action="collapse">

                <h4><i class="icon-chevron-down"></i> <?php echo Yii::t('admin', 'Advanced Settings'); ?></h4>
            </a>
        </div>
        <div class="widget-body">
            <div class="widget-main">
                <?php echo $form->textFieldControlGroup($model, 'active_css_class', array('size' => 'sm', 'maxlength' => 45)); ?>

                <?php echo $form->textFieldControlGroup($model, 'encode_label'); ?>

                <?php echo $form->textFieldControlGroup($model, 'first_item_css_class', array('size' => 'sm', 'maxlength' => 45)); ?>

                <?php echo $form->textFieldControlGroup($model, 'last_item_css_class', array('size' => 'sm', 'maxlength' => 45)); ?>

                <?php echo $form->textFieldControlGroup($model, 'hide_empty_items'); ?>

                <?php echo $form->textFieldControlGroup($model, 'item_css_class', array('size' => 'sm', 'maxlength' => 45)); ?>

                <?php echo $form->textFieldControlGroup($model, 'item_template', array('size' => 'sm', 'maxlength' => 200)); ?>

                <?php echo $form->textFieldControlGroup($model, 'link_label_wrapper', array('size' => 'sm', 'maxlength' => 45)); ?>
            </div>
        </div>
    </div>


    <?php echo TbHtml::formActions(array(TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('color' => TbHtml::BUTTON_COLOR_PRIMARY)), TbHtml::resetButton('Reset'),)); ?>


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