<?php
/** @var BootstrapCode $this */
$className = $this->modelClass;
$classLabel = $this->class2name ( $className );
$classLabelPl = $this->pluralize ( $classLabel );

echo ("<?php");

?>

/** @var <?php echo $this->getControllerClass() ?> $this */
/** @var <?php echo $this->getModelClass() ?> $model */

$this->menu=array(
	array('label'=>t('Create <?php echo $this->modelClass; ?>'),'url'=>array('create'),'visible'=>user()->checkAccess('<?php echo($this->getAuthName('create')); ?>')),
);

<?php echo("?>"); ?>

<h1>Manage <?php echo $this->pluralize($this->class2name($this->modelClass)); ?></h1>

<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
<?php
$count = 0;
foreach ( $this->tableSchema->columns as $column )
{
  if (++ $count == 7)
    echo "\t\t/*\n";
  echo "\t\t'" . $column->name . "',\n";
}
if ($count >= 7)
  echo "\t\t*/\n";
?>
    array(
          'class'=>'bootstrap.widgets.TbButtonColumn',
          'buttons'=>array
          (
            'view' => array
            (
                'label'=>t('View'),                
                'visible'=>'user()->checkAccess("<?php echo($this->getAuthName('view')); ?>")',
            ),
            'update' => array
            (
                'label'=>t('Update'),                
                'visible'=>'user()->checkAccess("<?php echo($this->getAuthName('update')); ?>")',
            ),
            'delete' => array
            (
                'label'=>t('Delete'),                
                'visible'=>'user()->checkAccess("<?php echo($this->getAuthName('delete')); ?>")',
                'click'=>"return confirm('".t('Do you confirm?')."');",
            ),
          ),
        ),
	),
)); ?>
