<?php
cs()->registerScript('alertAutoClose', 'window.setTimeout(function() { $(".alert").alert("close"); }, 5000)');
$this->widget('ext.PlNavbar', array(
    'brand'=>__('ADMIN_CALLFORWARDING_SETS_HEADER_TITLE'),
    'htmlOptions'=>array(
        'data-translation-id'=>'ADMIN_CALLFORWARDING_SETS_HEADER_TITLE',
    ),
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'items'=>array(
                array(
                    'label'=> __('ADMIN_CALLFORWARDING_SETS_ADD_NEW'),
                    'linkOptions'=>array(
                        'data-translation-id'=>'ADMIN_CALLFORWARDING_SETS_ADD_NEW',
                    ),
                    'icon' => 'plus',
                    'url'=>url('adminCallForwardingSets/default/create'),
                    'active'=>false
                ),
            ),
        ),
    ),
));

$this->widget('bootstrap.widgets.TbAlert', array(
    'block'=>true, // display a larger alert block?
    'fade'=>true, // use transitions?
    'closeText'=>'&times;', // close link text - if set to false, no close link is displayed
    'alerts'=>array( // configurations per alert type
        'success'=>array('block'=>true, 'fade'=>true, 'closeText'=>'&times;'), // success, info, warning, error or danger
    ),
));

$this->widget('bootstrap.widgets.TbGridView', array(
    'id'=>'presets-grid',
    'itemsCssClass'=>'plTable items',
    'dataProvider'=>$dataProvider,
    //'filter'=>$model,
    'type' => 'striped bordered condensed',//
    'columns'=>array(
        array(
            'name' => 'name',
            'header' => $model->getAttributeLabel('name'),
            'headerHtmlOptions'=>array('data-translation-id'=>'FORWARD_PRESET_MODEL_NAME'),
        ),
        array(
            'name' => 'description',
            'header' => $model->getAttributeLabel('description'),
            'headerHtmlOptions'=>array('data-translation-id'=>'FORWARD_PRESET_MODEL_DESCRIPTION'),
        ),
        array(
            'name' => 'forwardType',
            'type' => 'raw',
            'header' => $model->getAttributeLabel('forwardType'),
            'headerHtmlOptions' => array('data-translation-id' => 'FORWARD_PRESET_MODEL_FORWARD_TYPE'),
            'value' => 'ForwardType::translateType($data->forwardType)',
        ),
        array(
            'class'=>'bootstrap.widgets.TbButtonColumn',
            'template'=>'{update}{delete}',
            'htmlOptions'=>array(
                'data-translation-target'=>'USER_ERROR_MESSAGE_TRANSLATIONS',
                'class'=>'buttonColumnIcons',
            ),
        )
    ),
));


?>
<style>
    .grid-view {
        padding-top: 0;
    }
</style>