<?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.3.3
 */
 
?>

<?php $form = $this->beginWidget('CActiveForm'); ?>


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

        <?php foreach ($model->template_tags as $index => $tagInfo) { ?>
        <div class="form-group col-lg-4">
            <div class="col-lg-8">
                <?php echo CHtml::textField($model->modelName . '[template_tags][tag]['.$index.']', $tagInfo['tag'], $model->getHtmlOptions('template_tags', array('readonly' => true)));?>
            </div>
            <div class="col-lg-4">
                <?php echo CHtml::dropDownList($model->modelName . '[template_tags][required]['.$index.']', $tagInfo['required'], $model->getRequiredOptions(), $model->getHtmlOptions('template_tags'));?>
            </div>
        </div>
        <?php } ?>
        
        <div class="clearfix"><!-- --></div>
    </div>
    
    <div class="panel-footer">
        <div class="pull-right">
            <button type="submit" class="btn btn-default btn-submit" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo Yii::t('app', 'Save changes');?></button>
        </div>
        <div class="clearfix"><!-- --></div>
    </div>
    
</div>

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