From 84b6196e7925a5ec3e14a2a2fed2459743c2b112 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 25 Aug 2017 17:30:29 +0200 Subject: [PATCH] QuickBaseForm: allow for ipl elements in Html --- library/Director/Web/Form/QuickBaseForm.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/library/Director/Web/Form/QuickBaseForm.php b/library/Director/Web/Form/QuickBaseForm.php index 00d62b67..4e7eb211 100644 --- a/library/Director/Web/Form/QuickBaseForm.php +++ b/library/Director/Web/Form/QuickBaseForm.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Web\Form; use Icinga\Application\Icinga; use Icinga\Application\Modules\Module; +use ipl\Html\Html; use ipl\Html\ValidHtml; use Zend_Form; @@ -82,13 +83,20 @@ abstract class QuickBaseForm extends Zend_Form implements ValidHtml } // TODO: Should be an element - public function addHtmlHint($html, $options = array()) + public function addHtmlHint($html, $options = []) { - return $this->addHtml('
' . $html . '
', $options); + return $this->addHtml( + Html::tag('div', ['class' => 'hint'], $html), + $options + ); } - public function addHtml($html, $options = array()) + public function addHtml($html, $options = []) { + if ($html instanceof ValidHtml) { + $html = $html->render(); + } + if (array_key_exists('name', $options)) { $name = $options['name']; unset($options['name']);