<?php $this->widget('admin.widgets.TableCover');?>
<?php $this->renderPartial('_search', array('category'=>$category));?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
    'itemsCssClass' => 'widefat post',
    'summaryText'=>'显示{start}-{end}条 总共{count}条',
    'columns' => array(
        'id',
        array(
            'name' => 'name',
            'type' => 'raw',
            'value' => 'CHtml::link($data->name, array("/admin/softpcontent/view","id"=>$data->id));'
        ),
        'short_name',
        array(
            'name' => 'type',
            'value' => '$data->getTypeName($data->type)',
        ),
        array(
            'name' => 'cid',
            'value' => '$data->category->name',
        ),
        array(
            'name' => 'pid',
            'value' => '$data->platform->name',
        ),
        'day_download',
        'week_download',
        'month_download',
        'download',
        'award',
        array(
            'name' => 'iscommend',
            'value' => '$data->isCommend()'
        ),
        array(
            'name' => 'isfree',
            'value' => '$data->isFree()',
        ),
        'comments',
        'createdate',
        'updatedate',
        array(
            'header' => '操作',
            'template' => '{update} {delete} {copy}',
            'class' => 'CButtonColumn',
            'buttons' => array(
                'copy' => array(
                    'label' => '复制',
                    'url' => 'Yii::app()->controller->createUrl("copy",array("id"=>$data->primaryKey))',
                    'click' => "function () {return confirm('确定要复制？');}",
                ),
            ),
        )
    ),
));