QuickForm: addHtmlHint helper method
This commit is contained in:
parent
9d9c23eed6
commit
c9dd2e284c
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue