<?php
/* @var $this CategoryController */
/* @var $model Category */

$this->breadcrumbs=array(
	'Categories'=>array('index'),
	$model->name,
);

$this->pageTitle='Detail Category';
?>


<section class="col-xs-12">

	<?php echo CHtml::link('+ Kategori',
		array('create'),
		array('class' => 'btn btn-success hidden-xs','title'=>'Add Category'));
		?>
		<?php echo CHtml::link('+ Sub Kategori',
			array('master/tag/create', 'id'=>$model->id_category),
			array('class' => 'btn btn-success','title'=>'Add Tag'));
			?>
			<?php echo CHtml::link('Edit',
				array('update', 'id'=>$model->id_category,
			), array('class' => 'btn btn-success', 'title'=>'Edit Category'));
			?>
			<?php echo CHtml::link('Image',
				array('image', 'id'=>$model->id_category,
			), array('class' => 'btn btn-success', 'title'=>'Edit Image'));
			?>

			<HR>

			<?php $this->widget('zii.widgets.CDetailView', array(
				'data'=>$model,
				'htmlOptions'=>array("class"=>"table"),
				'attributes'=>array(
					'name',
					// 'icon',
					'url',
					// array('name'=>'status','value'=>User::model()->status($model->status))
				),
			)); ?>

			<?php $this->widget('zii.widgets.grid.CGridView', array(
				'id'=>'tag-grid',
				'dataProvider'=>$dataProvider,
				'itemsCssClass' => 'table-responsive table table-striped table-hover table-vcenter',
				'columns'=>array(

					array(
						'header'=>'No',
						'value'=>'$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1',
					),

					array('name'=>'category_id','value'=>'$data->Category->name'),
					'name',
					'description',
					array(
						'header' => 'Status',
						'htmlOptions' => array('nowrap' => 'nowrap'),
						'class' => 'CButtonColumn',
						'template' => '{aktif}{nonaktif}',
						'buttons' => array(
							'aktif' => array(
								'label' => 'Non Aktif',
								'visible' => '$data->status==0',
								'url' => 'Yii::app()->createUrl("master/tag/enable", array("id" => $data["id_category_sub"],))',
							),
							'nonaktif' => array(
								'visible' => '$data->status==1',
								'label' => 'Aktif',
								'url' => 'Yii::app()->createUrl("master/tag/disable", array("id" => $data["id_category_sub"],))',
							),
						),
					),
					// array(
					// 	'class'=>'CButtonColumn',
					// 	'template'=>'{Link}',
					// 	'header'=>'Link',
					// 	'buttons'=>array(
					// 		'Link'=>
					// 		array(
					// 			'url'=>'Yii::app()->createUrl("article/sub", array("url"=>$data->url))',
					// 		),
					// 	),
					// ),
					array(
						'class'=>'CButtonColumn',
						'template'=>'{update}',
						'buttons'=>array(
							'update'=>
							array(
								'url'=>'Yii::app()->createUrl("master/tag/update", array("id"=>$data->id_category_sub))',
							),
						),
					),
				),
			)); ?>

		</section>

		<STYLE>
			th{width:150px;}
		</STYLE>

