<?php
/* @var $this GoogleMapMarkerController */
/* @var $model GoogleMapMarker */
/* @var $form CActiveForm */
?>

<div class="col-xs-12">

    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'google-map-marker-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // There is a call to performAjaxValidation() commented in generated controller code.
        // See class documentation of CActiveForm for details on this.
        'enableAjaxValidation' => false,
        'enableClientValidation' => true,
        'clientOptions' => array(
            'validateOnSubmit' => true
        ),
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>

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



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

    <div class="form-group">
        <?php echo $form->labelEx($model, 'latitude', array('class' => 'col-md-3 control-label')) ?>
        <div class="col-md-5 controls">
            <?php
            $this->widget('CMaskedTextField', array(
                'model' => $model,
                'attribute' => 'latitude',
                'mask' => '99.999999',
                'htmlOptions' => array('class' => 'form-control',),
            ));
            ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model, 'longitude', array('class' => 'col-md-3 control-label')) ?>
        <div class="col-md-5 controls">
            <?php
            $this->widget('CMaskedTextField', array(
                'model' => $model,
                'attribute' => 'longitude',
                'mask' => '99.999999',
                'htmlOptions' => array('class' => 'form-control',),
            ));
            ?>
        </div>
    </div>






    <div class="row">
        <div class="col-xs-offset-3 col-xs-5">
            <div class="widget-box">
                <div class="widget-header widget-header-small">
                    <h5 class="smaller"><?php echo $model->getAttributeLabel('icon'); ?></h5>
                    <div class="widget-toolbar no-border">
                        <ul class="nav nav-tabs" id="myTab">
                            <li>
                                <a data-toggle="tab" href="#icon-image"><?php echo Yii::t('admin', 'Upload'); ?></a>
                            </li>
                            <li class="active">
                                <a data-toggle="tab" href="#icon-select"><?php echo Yii::t('admin', 'Select'); ?></a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="widget-main padding-6">
                        <div class="tab-content">
                            <div id="icon-image" class="tab-pane">
                                <?php echo $form->fileField($model, 'icon_image', array('maxlength' => 200)); ?>
                            </div>
                            <div id="icon-select" class="tab-pane in active">
                                <?php echo $form->dropDownList($model, 'icon_select', GoogleMapMarker::getDefaultIcons(), array('empty' => '')); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="widget-box collapsed">
                <div class="widget-header widget-header-small">
                    <a href="#" data-action="collapse">
                        <i class="icon-chevron-down"></i>
                        <?php echo Yii::t('admin', 'Advanced Settings'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <br/>
                    <?php echo $form->dropDownListControlGroup($model, 'animation', GoogleMapMarker::getAnimations(), array('empty' => '')); ?>    
                    <?php echo $form->checkboxControlGroup($model, 'clickable', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'labelCssClass' => 'col-md-12')); ?>
                    <?php echo $form->checkboxControlGroup($model, 'draggable', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'labelCssClass' => 'col-md-12')); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'cursor', GoogleMapMarker::getCursors(), array('empty' => '')); ?>
                </div>
            </div>
        </div>
    </div>



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

</div>