
<?php
/**
 * @var $model News
 */
$this->widget('zii.widgets.CMenu', array(
    'items' => array(
      array(
            'label' => 'Добавить новость',
            'url' => Yii::app()->controller->createUrl("",array("crudAction"=>"create")+$_GET),
            'icon'=>'icon-plus'),
    ),
    'htmlOptions' => array(
        'class' => 'nav nav-pills',
    ),
));
?>

<h1>Управление списком новостей</h1>
<br/>
<?php $this->widget('BGridView', array(
    'id' => 'news-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'i18n.name',
        array(
            'name' => 'news_category_id',
            'value' => '$data->newsCategory->i18n->name',
            'filter' => CHtml::activeDropDownList($model, 'news_category_id', array('' => 'Все') + $model->getCategories()),
        ),
        array(
            'name' => 'date',
            'filter' => false,
            'value' => '$data->dateRu',
        ),
        array(
            'class' => 'CButtonColumn',
            'template' => '{update} {delete}',
            'updateButtonUrl' => 'Yii::app()->controller->createUrl("",array("crudAction"=>"update", "id"=>$data->primaryKey)+$_GET)',
            'deleteButtonUrl' => 'Yii::app()->controller->createUrl("",array("crudAction"=>"delete", "id"=>$data->primaryKey)+$_GET)',
            'htmlOptions'=>array('style'=>'width:50px !important;'),
        ),
    ),
)); ?>
