<?php
/* @var $this GoogleMapController */
/* @var $model GoogleMap */
/* @var $form TbActiveForm */
?>

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

    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'google-map-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,
    ));
    ?>

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


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

    <div class="form-group">
        <?php echo $form->labelEx($model, 'center_latitude', array('class' => 'col-md-3 control-label')) ?>
        <div class="col-md-5 controls">
            <?php
            $this->widget('CMaskedTextField', array(
                'model' => $model,
                'attribute' => 'center_latitude',
				'charMap'=>array('9'=>'[0-9\-]','8'=>'[0-9]') ,
                'mask' => '?988.888888',
                'htmlOptions' => array('class' => 'form-control',),
            ));
            ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model, 'center_longitude', array('class' => 'col-md-3 control-label')) ?>
        <div class="col-md-5 controls">
            <?php
            $this->widget('CMaskedTextField', array(
                'model' => $model,
                'attribute' => 'center_longitude',
                'mask' => '99.999999',
                'htmlOptions' => array('class' => 'form-control',),
            ));
            ?>
        </div>
    </div>

    <?php echo $form->dropDownListControlGroup($model, 'zoom', range(19, 0)); ?>
    <?php echo $form->dropDownListControlGroup($model, 'maptype_id', GoogleMap::getTypes()); ?>

    <?php echo $form->textFieldControlGroup($model, 'width', array('maxlength' => 20)); ?>
    <?php echo $form->textFieldControlGroup($model, 'height', array('maxlength' => 20)); ?>
    <?php echo $form->textFieldControlGroup($model, 'html_id', array('maxlength' => 45)); ?>
    <?php echo $form->textFieldControlGroup($model, 'html_class', array('maxlength' => 45)); ?>








    <div class="row">
        <div class="col-xs-offset-3 col-xs-5">


            <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">
                    <?php echo $form->checkboxControlGroup($model, 'fit_markers_into_view', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'labelCssClass' => 'col-md-12')); ?>
                    <?php echo $form->checkboxControlGroup($model, 'disable_double_click_zoom', 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->checkboxControlGroup($model, 'scrollwheel', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'labelCssClass' => 'col-md-12')); ?>
                    <?php echo $form->textFieldControlGroup($model, 'background_color', array('maxlength' => 7)); ?>

                </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', 'Map Type Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'maptype_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php $model->maptype_control_ids = $model->getMaptypeControlIds(); ?>
                    <?php echo $form->checkboxlistControlGroup($model, 'maptype_control_ids', GoogleMap::getTypes()); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'maptype_control_style', GoogleMap::getStyles()); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'maptype_control_position', GoogleMap::getPositions()); ?>
                </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', 'Overview Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'overview_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php echo $form->checkboxControlGroup($model, 'overview_control_opened', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10',)); ?>
                </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', 'Pan Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'pan_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'pan_control_position', GoogleMap::getPositions()); ?>
                </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', 'Rorate Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'rotate_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'rotate_control_position', GoogleMap::getPositions()); ?>
                </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', 'Scale Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'scale_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'scale_control_position', GoogleMap::getPositions()); ?>
                </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', 'Zoom Control'); ?>
                    </a>                
                </div>
                <div class="widget-body">
                    <?php echo $form->checkboxControlGroup($model, 'zoom_control', array('controlGroupCssClass' => 'col-xs-offset-3 col-xs-10', 'label' => Yii::t('admin', 'Visible'))); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'zoom_control_style', GoogleMap::getZoomControlStyles()); ?>
                    <?php echo $form->dropDownListControlGroup($model, 'zoom_control_position', GoogleMap::getPositions()); ?>
                </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>