<?php
/* @var $this MenuController */
/* @var $model Menu */
$this->breadcrumbs = array(
    'Menus' => array('admin'),
    'Manage',
);
$this->menu = array(
    array('label' => 'Create Menu', 'url' => array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#menu-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="page-header"><h1>Manage Menus</h1></div>
<?php
$this->widget('ext.widgets.FGridView', array(
    'id' => 'menu-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        array(
            'name' => 'id',
            'htmlOptions' => array('style' => 'width:50px;'),
        ),
        array(
            'name' => 'title',
            'value' => 'CHtml::link($data->title,array("update","id"=>$data->id))',
            'type' => 'raw',
        ),
        'slug',
        array(
            'name' => 'status',
            'value' => '$data->getStatusLabel($data->status)',
            'type' => 'html',
            'filter' => $model->getStatuses(),
            'htmlOptions' => array('style' => 'width:100px;'),
        ),
        array(
            'value' => 'CHtml::link(Yii::t("admin", "Add Items to Menu"), array("menuItem/create", "menu_id" => $data->id), array("class" => "update-button btn btn-xs btn-primary ")) ." ".CHtml::link(Yii::t("admin", "Manage Menu Items"), array("menuItem/admin", "menu_id" => $data->id), array("class" => "btn btn-xs", "data-id" => $data->id))',
            'type' => 'raw',
            'htmlOptions' => array('class' => 'td-buttons'),
        ),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
<!-- Modal -->
<div id="full-width" class="modal container hide" tabindex="-1">
    <div class="modal-header">
        <a type="button" data-dismiss="modal" href="#" class="btn-link"><i class="icon icon-remove"></i></a>
    </div>
    <div class="modal-body">
        <div class="loading"></div>
    </div>
    <div class="modal-footer">
    </div>
</div><!-- Modal -->