<div class="controls">
    <?= $tabs ?>
</div>

<div class="content" data-base-target="_next">
    <div>
    <h2><?= $this->translate('Monitoring Backends') ?></h2>
    <?= $this->qlink(
        $this->translate('Create a New Monitoring Backend') ,
        'monitoring/config/createbackend',
        null,
        array(
            'class'   => 'button-link',
            'icon'    => 'plus',
            'title'   => $this->translate('Create a new monitoring backend')
        )
    ) ?>
    <table class="table-row-selectable common-table">
        <thead>
        <tr>
            <th><?= $this->translate('Monitoring Backend') ?></th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($this->backendsConfig as $backendName => $config): ?>
            <tr>
                <td>
                    <?= $this->qlink(
                        $backendName,
                        'monitoring/config/editbackend',
                        array('backend-name' => $backendName),
                        array(
                            'icon'  => 'edit',
                            'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
                        )
                    ) ?>
                    <span class="config-label-meta">&#40;<?= sprintf(
                        $this->translate('Type: %s'),
                        $this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
                    ) ?>&#41;
                    </span>
                </td>
                <td class="text-right">
                    <?= $this->qlink(
                        '',
                        'monitoring/config/removebackend',
                        array('backend-name' => $backendName),
                        array(
                            'class' => 'action-link',
                            'icon'  => 'cancel',
                            'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)
                        )
                    ) ?>
                </td>
            </tr>
        <?php endforeach ?>
        </tbody>
    </table>
    </div>
    <div>
    <h2><?= $this->translate('Command Transports') ?></h2>
    <?= $this->qlink(
        $this->translate('Create a New Command Transport') ,
        'monitoring/config/createtransport',
        null,
        array(
            'class'   => 'button-link',
            'icon'    => 'plus',
            'title'   => $this->translate('Create a new command transport')
        )
    ) ?>
    <?php
    /** @var \Icinga\Module\Monitoring\Forms\Config\TransportReorderForm $commandTransportReorderForm */
    echo $commandTransportReorderForm;
    ?>
    </div>
</div>
