<?php
/* @var $this MessageController */
/* @var $model Message */
$this->breadcrumbs = array(
    'Messages' => array('admin'),
    'Manage',
);
$this->menu = array(
    array('label' => 'Manage Message', 'url' => array('admin')),
    array('label' => 'Create Message', 'url' => array('create')),
);
?>
<div class="page-header"><h1>Manage Messages</h1></div>
<?php
$this->widget('ext.widgets.FGridView', array(
    'id' => 'message-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        array(
            'name' => 'id',
            'htmlOptions' => array('style' => 'width:50px;'),
        ),
        array(
            'name' => 'language',
            'value' => 'FlexLocale::getLocales()[$data->language]',
            'filter' => FlexLocale::getLocales(),
        ),
        'sourceMessage.category',
        'sourceMessage.message',
        array(
            'class' => 'editable.EditableColumn',
            'name' => 'translation',
            'headerHtmlOptions' => array('style' => 'width: 110px'),
            'editable' => array( //editable section
                'url' => $this->createUrl('quickUpdate'),
                'placement' => 'right',
            ),
            'htmlOptions' => array('width' => '300px'),
        ),
        array(
            'class' => 'CButtonColumn',
            'template' => '{delete}',
            'updateButtonUrl' => 'Yii::app()->controller->createUrl("update",array("id"=>$data->id,"language"=>$data->language))',
            'deleteButtonUrl' => 'Yii::app()->controller->createUrl("delete",array("id"=>$data->id,"language"=>$data->language))',
        ),
    ),
));
?>
