/**
* Display debug information for an object
*
* @param $item the object
* @param $options array
**/
static function debugEvent($item, $options = array())
{
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . _n('Notification', 'Notifications', Session::getPluralNumber()) . "</th><th colspan='2'><font color='blue'> (" . $item->getTypeName(1) . ")</font></th></tr>";
$events = array();
if ($target = NotificationTarget::getInstanceByType(get_class($item))) {
$events = $target->getAllEvents();
if (count($events) > 0) {
echo "<tr><th>" . self::getTypeName(Session::getPluralNumber()) . '</th><th>' . _n('Recipient', 'Recipients', Session::getPluralNumber()) . "</th>";
echo "<th>" . _n('Notification template', 'Notification templates', Session::getPluralNumber()) . "</th>" . "<th>" . _n('Email', 'Emails', Session::getPluralNumber()) . "</th></tr>";
foreach ($events as $event => $label) {
self::raiseEvent($event, $item, $options, $label);
}
} else {
echo "<tr class='tab_bg_2 center'><td colspan='4'>" . __('No item to display') . "</td></tr>";
}
}
echo "</table></div>";
}