<?php

$this->widget('ext.PlGrid.PlGridView', array(
    'id' => 'network-adapter-grid',
    'headerTitle' => 'NETWORK_ADAPTER_SETTINGS_TITLE',
    'useCustomTitle' => true,
    'showAlertBlock' => true,
    'alertAutoHide' => false,
    'itemsCssClass' => 'plTable items',
    'enableAddButton' => false,
    'summaryText' => false,
    'modalCreateHeader' => 'NETWORK_ADAPTER_SETTINGS_CREATE_NETWORK_ADAPTER', // optional
    'modalUpdateHeader' => 'NETWORK_ADAPTER_SETTINGS_UPDATE_NETWORK_ADAPTER', // optional
    'enableSearchButton' => false,
    'dataProvider' => $model->getNetworkAdapters(),
    'columns' => array(
        array(
            'name' => 'name',
            'header' => __('NETWORK_INTERFACE_MODEL_NAME'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_MODEL_NAME'),
        ),
        array(
            'name' => 'ip',
            'header' => __('NETWORK_INTERFACE_MODEL_IP'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_MODEL_IP'),
        ),
        array(
            'name' => 'netmask',
            'header' => __('NETWORK_INTERFACE_MODEL_NETMASK'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_MODEL_NETMASK'),
        ),
        array(
            'name' => 'gateway',
            'header' => __('NETWORK_INTERFACE_MODEL_GATEWAY'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_MODEL_GATEWAY'),
        ),
        array(
            'name' => 'dns',
            'header' => __('NETWORK_INTERFACE_MODEL_DNS'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_MODEL_DNS'),
        ),
        array(
            'name' => 'isPrimary',
            'type' => 'raw',
            'header' => __('NETWORK_INTERFACE_FORM_IS_PRIMARY'),
            'headerHtmlOptions' => array('data-translation-id' => 'NETWORK_INTERFACE_FORM_IS_PRIMARY'),
            'value' => '$data->getHumandReadablePrimaryStatus($data->isPrimary)'
        ),
        array(
            'class' => 'ext.PlGrid.PlCButtonColumn',
            'template' => '{ajaxUpdate}',
        )
    ),
        )
);

if (Yii::app()->user->translateMode) {
    $this->renderPartial('_translationTags');
}