From 4a4fbaee8e239ccdfd79a23dde13b4202a90d5f5 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 18 Nov 2014 14:58:05 +0100 Subject: [PATCH] Add Help decorator for icon help description refs #7696 --- library/Icinga/Web/Form/Decorator/Help.php | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 library/Icinga/Web/Form/Decorator/Help.php diff --git a/library/Icinga/Web/Form/Decorator/Help.php b/library/Icinga/Web/Form/Decorator/Help.php new file mode 100644 index 000000000..1f8df2ce0 --- /dev/null +++ b/library/Icinga/Web/Form/Decorator/Help.php @@ -0,0 +1,33 @@ +getElement(); + $description = $element->getView()->escape($element->getDescription()); + + if (! empty($description)) { + $helpIcon = Icinga::app()->getViewRenderer()->view->icon('help', $description); + return $helpIcon . $content; + } + + return $content; + } +}