<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php
echo $this->partial('partials/tabs.phtml', ['tabs' => $this->tabs, 'renderTo' => 'main', 'renderMode' => 'top']);
echo $this->form;
?>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function() {
    new Jsw.Panel({
        cls: 'list-box',
        renderTo: 'main',
        items: [
            new Jsw.List({
                id: 'dns-zone-acl-records',
                searchOveral: 'value',
                searchFilters: <?php echo Zend_Json::encode($this->aclRecordsList->getSearchFilterConfig()); ?>,
                data: <?php echo Zend_Json::encode($this->aclRecordsList->fetchData()); ?>,
                dataUrl: '/dns-zone/acl-records-list-data/id/<?=$this->ownerId?>/type/<?=$this->ownerType?>',
                columns: [
                    Jsw.list.COLUMN_SELECTION,
                    {
                        header: <?php echo $this->aclRecordsList->jsLmsg('value'); ?>,
                        sortable: true,
                        dataIndex: 'value'
                    }
                ],
                operations: [
                    {
                        componentType: 'Jsw.SmallButton',
                        id: 'buttonRemoveRecord',
                        title: <?php echo $this->aclRecordsList->jsLmsg('remove');?>,
                        description: <?php echo $this->aclRecordsList->jsLmsg('hintRemove'); ?>,
                        addCls: 'sb-remove-selected',
                        handler: function(event) {
                            Jsw.getComponent('dns-zone-acl-records').execGroupOperation({
                                url: '/dns-zone/delete-acl/id/<?=$this->ownerId?>/type/<?=$this->ownerType?>',
                                subtype: 'delete',
                                mouseEvent: event,
                                locale: {
                                    confirmOnGroupOperation: <?php echo $this->aclRecordsList->jsLmsg('confirmOnDelete'); ?>
                                }
                            });
                        }
                    }
                ]
            })
        ]
    });
});
//]]>
</script>
