select()->from( 'statusSummary', array( 'hosts_down_unhandled', 'services_critical_unhandled' ) )->getQuery()->fetchRow(); $unhandled = $statusSummary->hosts_down_unhandled + $statusSummary->services_critical_unhandled; $badge = ''; if ($unhandled) { $badge = sprintf( '
%s
', $unhandled ); } return sprintf( '%s%s %s', $menu->getUrl() ?: '#', $menu->getIcon() ? ' ' : '', htmlspecialchars($menu->getTitle()), $badge ); } }