<?php defined('MW_PATH') || exit('No direct script access allowed');

/**
 * This file is part of the MailWizz EMA application.
 * 
 * @package MailWizz EMA
 * @author Serban George Cristian <cristian.serban@mailwizz.com> 
 * @link http://www.mailwizz.com/
 * @copyright 2013-2014 MailWizz EMA (http://www.mailwizz.com)
 * @license http://www.mailwizz.com/license/
 * @since 1.0
 */
 
?>

<div class="panel panel-default">
    
    <div class="panel-heading">
        <h3 class="panel-title"><?php echo Yii::t('settings', 'Common settings')?></h3>
    </div>
    
    <div class="panel-body">

        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($commonModel, 'site_name');?>
            <?php echo $form->textField($commonModel, 'site_name', $commonModel->getHtmlOptions('site_name')); ?>
            <?php echo $form->error($commonModel, 'site_name');?>
        </div>
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($commonModel, 'site_tagline');?>
            <?php echo $form->textField($commonModel, 'site_tagline', $commonModel->getHtmlOptions('site_tagline')); ?>
            <?php echo $form->error($commonModel, 'site_tagline');?>
        </div>    
        
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($commonModel, 'site_description');?>
            <?php echo $form->textField($commonModel, 'site_description', $commonModel->getHtmlOptions('site_description')); ?>
            <?php echo $form->error($commonModel, 'site_description');?>
        </div>
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($commonModel, 'site_keywords');?>
            <?php echo $form->textField($commonModel, 'site_keywords', $commonModel->getHtmlOptions('site_keywords')); ?>
            <?php echo $form->error($commonModel, 'site_keywords');?>
        </div>    
        
        <hr />
        
        <div class="col-lg-6">
            <div class="form-group<?php if ($commonModel->clean_urls == 1){?> col-lg-8<?php }?>">
                <?php echo $form->labelEx($commonModel, 'clean_urls');?>
                <?php echo $form->dropDownList($commonModel, 'clean_urls', array(0 => Yii::t('app', 'No, do not use clean urls'), 1 => Yii::t('app', 'Yes, use clean urls')), $commonModel->getHtmlOptions('clean_urls')); ?>
                <?php echo $form->error($commonModel, 'clean_urls');?>
            </div>    
            <div class="form-group col-lg-2" style="<?php if ($commonModel->clean_urls != 1){?>display:none<?php }?>">
                <label><?php echo Yii::t('app', 'Action');?></label>
                <a data-toggle="modal" data-remote="<?php echo $this->createUrl('settings/htaccess_modal');?>" href="#writeHtaccessModal" class="btn btn-default"><?php echo Yii::t('settings', 'Generate htaccess')?></a>
            </div>
        </div>
        
        <div class="clearfix"><!-- --></div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($commonModel, 'api_status');?>
            <?php echo $form->dropDownList($commonModel, 'api_status', $commonModel->getSiteStatusOptions(), $commonModel->getHtmlOptions('api_status')); ?>
            <?php echo $form->error($commonModel, 'api_status');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($commonModel, 'site_status');?>
            <?php echo $form->dropDownList($commonModel, 'site_status', $commonModel->getSiteStatusOptions(), $commonModel->getHtmlOptions('site_status')); ?>
            <?php echo $form->error($commonModel, 'site_status');?>
        </div>
        
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($commonModel, 'site_offline_message');?>
            <?php echo $form->textField($commonModel, 'site_offline_message', $commonModel->getHtmlOptions('site_offline_message')); ?>
            <?php echo $form->error($commonModel, 'site_offline_message');?>
        </div>
        
    </div>

</div>