QuickForm: addHtmlHint helper method

This commit is contained in:
Thomas Gelf 2015-07-30 08:38:30 +02:00
parent 9d9c23eed6
commit c9dd2e284c
1 changed files with 14 additions and 0 deletions

View File

@ -62,6 +62,8 @@ abstract class QuickForm extends Zend_Form
protected $icingaModuleName;
protected $hintCount = 0;
public function __construct($options = null)
{
if ($options !== null && array_key_exists('icingaModule', $options)) {
@ -162,6 +164,18 @@ abstract class QuickForm extends Zend_Form
return $this;
}
public function addHtmlHint($html, $options = array())
{
$name = '_HINT' . ++$this->hintCount;
$this->addElement('note', $name, $options);
$this->getElement($name)
->setValue('<div class="hint">' . $html . '</div>')
->setIgnore(true)
->removeDecorator('Label');
return $this;
}
public function optionalEnum($enum)
{
return array(