'object-detail-actions'])); /** @var HostActionsHook|ServiceActionsHook $hook */ foreach (Hook::all($hookName) as $hook) { try { foreach ($hook->getActionsForObject($object) as $link) { if (! $link instanceof Link) { continue; } // It may be ValidHtml, but modules shouldn't be able to break our views. // That's why it needs to be rendered instantly, as any error will then // be caught here. $renderedLink = (string) $link; $moduleName = $hook->getModule()->getName(); $list->addHtml(new HtmlElement('li', Attributes::create([ 'class' => 'icinga-module module-' . $moduleName, 'data-icinga-module' => $moduleName ]), HtmlString::create($renderedLink))); } } catch (Exception $e) { Logger::error("Failed to load object actions: %s\n%s", $e, $e->getTraceAsString()); $list->addHtml(new HtmlElement('li', null, Text::create(IcingaException::describe($e)))); } } return $list; } }