<?php
/* @var $this CmsMainController */
/* @var $model CmsMain */

$this->breadcrumbs=array(
	'Cms Mains'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List CmsMain', 'url'=>array('index')),
	array('label'=>'Create CmsMain', 'url'=>array('create')),
);

?>

<div id="communbox" style="width:885px; float:left;">
<div id="headlines" style="width: 99%; padding-left:2%;"><img src="images/admin/bg.png" width="12" height="7" class="right5"/>Manage Digital library | <a href="<?php echo Yii::app()->createUrl('DigitalLibrary/create'); ?>">Add new </a></div>
<div id="communicationsbox" style="height:525px; background-color:#f7eee1;">
<div id="form_wrapper">

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'download-centre-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'header'=>'Sl.No.',
			'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
			'htmlOptions'=>array('width'=>'5px'),
		),
		array(
			'name'=>'user_group_id',
			'value'=>'$data->userGroup->group_name',
			'filter'=>UserGroup::getGroups(),
			//'type'=>'raw'
		),
		'file_title',
                array(
			'name'=>'File',
			'value'=>'CHtml::image("media/downloadcenter/thumbs/120_150".$data->file, "loading..")',			
			'filter'=>false,
                        'type'=>'html'
		),
		array(
            'name'=>'isActive',
            'header'=>'Status',
            'filter'=>array(''=>'All','Y'=>'Active','N'=>'Inactive'),
                    'htmlOptions'=>array('width'=>'10px'),
            'value'=>'CHtml::link(($data->isActive=="Y")?CHtml::image("images/admin/active.png",""):CHtml::image("images/admin/inactive.png",""),"#",array("class"=>"doChangeStatus","id"=>$data->id,"title"=>"Change status"))',
			'type'=>'raw'
        ),
		array(
			'header'=>'Actions',
			'template'=>'{add}{update}{delete}',
			'class'=>'CButtonColumn',
			'buttons'=>array
			(
				'add' => array
				(
					'label'=>'Create new',
					'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/add_small.png',
					'url'=>'Yii::app()->createUrl("DownloadCentre/create")',
				),
			),
		),
	),
)); ?>
</div>
</div>
</div>
