<?php

$this->widget('ext.PlGrid.PlGridView', array(
    'id' => 'admin-ldap-interface-grid',
    'headerTitle' => 'ADMIN_LDAP_INTERFACE_SECTION_TITLE', // optional
    'useCustomTitle' => true,
    'addButtonTitle' => 'ADMIN_LDAP_INTERFACE_ADD_BTN',
    'modalCreateHeader' => 'ADMIN_LDAP_INTERFACE_MODEL_HEADER_CREATE', // optional
    'modalUpdateHeader' => 'ADMIN_LDAP_INTERFACE_MODEL_HEADER_UPDATE', // optional
    'createInModal' => false,
    'enableSearchButton' => false,
    'showAlertBlock' => true,
    'itemsCssClass' => 'plTable items',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'customButtons' => $this->createTranslationModeBtn(),
    'columns' => array(
        array(
            'name' => 'server',
            'header' => __('ADMIN_LDAP_INTERFACE_SERVER'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_SERVER'
            ),
        ),
        array(
            'name' => 'username',
            'header' => __('ADMIN_LDAP_INTERFACE_USERNAME'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_USERNAME'
            ),
        ),
        array(
            'name' => 'connectedModel',
            'header' => __('ADMIN_LDAP_INTERFACE_CONNECTED_MODEL'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_CONNECTED_MODEL'
            ),
        ),
        array(
            'name' => 'baseDN',
            'header' => __('ADMIN_LDAP_INTERFACE_BASE_DN'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_BASE_DN'
            ),
        ),
        array(
            'name' => 'filter',
            'header' => __('ADMIN_LDAP_INTERFACE_FILTER'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_FILTER'
            ),
        ),
        array(
            'template' => '{update}{import}{delete}',
            'class' => 'ext.PlGrid.PlCButtonColumn',
            'htmlOptions' => array(
                'style' => 'width: 55px',
                'data-translation-id' => 'ADMIN_LDAP_INTERFACE_IMPORT_DATA',
            ),
            'buttons' => array(
                'import' => array(
                    "class" => "import",
                    'icon' => 'exchange',
                    'label' => __('ADMIN_LDAP_INTERFACE_IMPORT_DATA'),
                    'url' => 'Yii::app()->createUrl("adminLdapInterface/default/startImport", array("id"=>$data->id))',
                ),
            ),
        )
    )
        )
);


