<?php

$servicegroupLinkList = array();
if (!empty($this->servicegroups)) {
    foreach ($this->servicegroups as $name => $alias) {
        $servicegroupLinkList[] = '<a href="' . $this->href(
            'monitoring/list/services',
            array(
                'servicegroups' => $name
            )
        ) . '">' . $alias . '</a>';
    }
}
?>
<?=
$this->partial(
    'show/header.phtml',
    array(
        'host'    => $this->host,
        'service' => $this->service,
        'tabs'    => $this->tabs,
        'compact' => $this->compact
    )
);
?>

<?= $this->preview_image ?>
<div>
  <div>
    <span>Plugin output</span>
  </div>
  <div>
    <?= $this->pluginOutput($this->service->service_output); ?>
    <?= $this->pluginOutput($this->service->service_long_output); ?>
  </div>
</div>

<div>
  <div>
    {{CHECK_ICON}} <span>Check Command</span>
  </div>

  <div>
    <?php
    $explodedCommand = explode('!', $this->service->service_check_command, 2);
    echo array_shift($explodedCommand);
    ?>
    <?= $this->commandArguments($this->service->service_check_command); ?>
  </div>
</div>

<div>
  <div>
    {{GROUP_ICON}} <span>Groups and Contacts</span>
  </div>
  <?php if (count($servicegroupLinkList)) { ?>
    {{SERVICEGROUP_ICON}} <strong>Servicegroups:</strong>
  <?= implode(' ', $servicegroupLinkList); ?>
  <?php } ?>

  <?= $this->render('show/components/contacts.phtml') ?>
</div>

<?= $this->render('show/components/comments.phtml'); ?>

<?= $this->render('show/components/downtime.phtml'); ?>

<?= $this->render('show/components/customvars.phtml'); ?>

<?php if ($this->service->service_perfdata): ?>
<div>

  <div>
    <span>Perfdata</span>
  </div>
  <div>
    <?= $this->perfdata($this->service->service_perfdata); ?>
  </div>
</div>
<?php endif; ?>

<div>
  <div>
    <span>Flags</span>
  </div>
  <div>
    <?= $this->render('show/components/flags.phtml'); ?>
  </div>
</div>

<div>
  <div>
    <span>Properties</span>
  </div>
  <div>
    <?= $this->render('show/components/properties.phtml'); ?>
  </div>
</div>

<div>
  <div>
    {{COMMAND_ICON}} <span>Commands</span>
  </div>
  <div>
    <?= $this->monitoringCommands($this->service, 'full'); ?>
  </div>
</div>