<?php

$this->widget('ext.PlGrid.PlGridView', array(
    'id' => 'banned-host-grid',
    'headerTitle' => 'NETWORK_FIREWALL_TITLE',
    'useCustomTitle' => true,
    'showAlertBlock' => true,
    'alertAutoHide' => false,
    'itemsCssClass' => 'plTable items',
    'enableAddButton' => false,
    'summaryText' => false,
    'enableSearchButton' => false,
    'dataProvider' => $model->search(),
    'customButtons' => $this->getTabItems(),
    'ajaxUpdate' => false,
    'columns' => array(
        array(
            'name' => 'ip',
            'header' => $model->getAttributeLabel('ip'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_FIREWALL_BANNED_HOST_MODEL_IP'),
        ),
        array(
            'name' => 'datetime',
            'value' => array($this, 'renderDatetime'),
            'header' => $model->getAttributeLabel('datetime'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_FIREWALL_BANNED_HOST_MODEL_DATETIME'),
        ),
        array(
            'name' => 'reason',
            'value' => array($this, 'renderReasonText'),
            'header' => $model->getAttributeLabel('reason'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_FIREWALL_BANNED_HOST_MODEL_REASON'),
        ),
        array(
            'class' => 'ext.PlGrid.PlCButtonColumn',
            'template' => '{delete}',
            'buttons' => array(
                'delete' => array(
                    'url' => 'Yii::app()->createUrl("networkFirewall/default/removeBanHost", array("id"=>"$data->id"))',
                ),
            ),
        ),
    ),
        )
);
$this->renderPartial('firewallScripts');
