<?php

if ($object->contacts->hasResult()) {

    $list = array();
    foreach ($object->contacts as $contact) {
        $list[] = $this->qlink(
            $contact->contact_alias,
            'monitoring/show/contact',
            array('contact_name' => $contact->contact_name),
            array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias))
        );
    }

    printf(
        "<tr><th>%s</th><td class=\"go-ahead\">%s</td></tr>\n",
        $this->translate('Contacts'),
        implode(', ', $list)
    );
}

if ($object->contactgroups->hasResult()) {
    $list = array();
    foreach ($object->contactgroups as $contactgroup) {
        $list[] = $this->qlink(
            $contactgroup->contactgroup_alias,
            'monitoring/list/contactgroups',
            array('contactgroup_name' => $contactgroup->contactgroup_name),
            array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias))
        );
    }

    printf(
        "<tr><th>%s</th><td class=\"go-ahead\">%s</td></tr>\n",
        $this->translate('Contactgroups'),
        implode(', ', $list)
    );
}
