select()
->from(
'programstatus',
array('is_currently_running')
)
->fetchRow();
return $programStatus !== false ? (bool) $programStatus : false;
}
/**
* {@inheritdoc}
*/
public function render(Menu $menu)
{
return $this->getBadge() . $this->createLink($menu);
}
/**
* Get the problem badge HTML
*
* @return string
*/
protected function getBadge()
{
if (! $this->isCurrentlyRunning()) {
return sprintf(
'
%d
',
sprintf(
mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()
),
1
);
}
return '';
}
/**
* Get the problem data for the summary
*
* @return array|null
*/
public function getSummary()
{
if (! $this->isCurrentlyRunning()) {
return array(
'problems' => 1,
'title' => sprintf(
mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()
)
);
}
return null;
}
}