getElement(); if (! $form instanceof Form) { return $content; } $view = $form->getView(); if ($view === null) { return $content; } $descriptions = $this->recurseForm($form); if (empty($descriptions)) { return $content; } $html = '
' . Icinga::app()->getViewRenderer()->view->icon('info-circled', '', ['class' => 'form-description-icon']) . '
'; case self::PREPEND: return $html . '' . $content; } } /** * Recurse the given form and return the descriptions for it and all of its subforms * * @param Form $form The form to recurse * * @return array */ protected function recurseForm(Form $form) { $descriptions = array($form->getDescriptions()); foreach ($form->getSubForms() as $subForm) { $descriptions[] = $this->recurseForm($subForm); } return call_user_func_array('array_merge', $descriptions); } }