* @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} use \Monitoring\Command\Meta; /** * Class MonitoringCommands * * Helper which produces a list of command buttons * depending on object states */ class Zend_View_Helper_MonitoringCommands extends Zend_View_Helper_Abstract { /** * @param stdClass $object host or service object or something other * @param string $type small or full * @return string html output */ public function monitoringCommands(\stdClass $object, $type) { $commands = new Meta(); $definitions = $commands->getCommandForObject($object, $type); $out = '
'; $i = 0; foreach ($definitions as $definition) { if ($i % 5 === 0) { $out .= '
'; } if ($type === Meta::TYPE_FULL) { $out .= '
'; } $out .= sprintf( '', $definition->id, $definition->shortDescription, $definition->longDescription, $definition->iconCls, $definition->btnCls ); if ($type === Meta::TYPE_FULL) { $out .= '
'; } $i++; } $out .= '
'; $out .= '
'; if ($type === Meta::TYPE_FULL) { return '
'. $out. '
'; } return $out; } }