<?php

if (! empty($object->contacts)) {

    $list = array();
    foreach ($object->contacts as $contact) {
        $list[] = $this->qlink($contact->contact_alias, 'monitoring/show/contact', array(
            'contact' => $contact->contact_name
        ));
    }

    printf(
        "<tr><th>%s</th><td>%s %s</td></tr>\n",
        $this->translate('Contacts'),
        $this->img('img/icons/user_petrol.png'),
        implode(', ', $list)
    );

}

if (! empty($object->contactgroups)) {
    $list = array();
    foreach ($object->contactgroups as $contactgroup) {
        $list[] = $this->qlink(
            $contactgroup->contactgroup_alias,
            'monitoring/list/contactgroups',
            array('contactgroup' => $contactgroup->contactgroup_name)
        );
    }

    printf(
        "<tr><th>%s</th><td>%s %s</td></tr>\n",
        $this->translate('Contactgroups'),
        $this->img('img/icons/user_petrol.png'),
        implode(', ', $list)
    );

}

