<?php
/* @var $this LocaleController */
/* @var $model Locale */
$this->breadcrumbs = array(
    'Locales' => array('index'),
    'Manage',
);
$this->menu = array(
    array('label' => 'List Locale', 'url' => array('index')),
    array('label' => 'Create Locale', 'url' => array('create')),
);
?>
<div class="page-header"><h1>Manage Languages</h1></div>
<?php echo CHtml::link(Yii::t('admin', 'Set Default Language'), array('setDefault')); ?>
<?php
$this->widget('ext.widgets.FGridView', array(
    'id' => 'locale-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'ajaxUpdate' => false,
    'columns' => array(
	array(
	    'header' => Yii::t('admin', 'Language Name'),
	    'value' => 'Yii::app()->locale->getLocaleDisplayName(Yii::app()->locale->getLanguageID($data->locale))',
	    'htmlOptions' => array('style' => 'width:200px'),
	),
	array(
	    'header' => Yii::t('admin', 'Language Code'),
	    'name' => 'locale',
	    'htmlOptions' => array('style' => 'width:100px'),
	),
	array(
	    'class' => 'editable.EditableColumn',
	    'name' => 'active',
	    'value' => '$data->isActive',
	    'filter' => FlexLocale::getStatues(),
	    'headerHtmlOptions' => array('style' => 'width: 150px'),
	    'editable' => array(
		'type' => 'select',
		'url' => $this->createUrl('quickUpdate'),
		'source' => FlexLocale::getStatues(),
	    )
	),
	array(
	    'name' => 'default',
	    'value' => '$data->isDefault',
	    'filter' => FlexLocale::getStatues(),
	),
//	array(
//	    'class' => 'CButtonColumn',
//	),
    ),
));
?>
