lib: Remove `HelpText' form element decorator

Zend already has a `Description' decorator.

refs #5525
This commit is contained in:
Eric Lippmann 2014-09-02 15:05:47 +02:00
parent 7143837ae3
commit 8478ef3fce
1 changed files with 0 additions and 37 deletions

View File

@ -1,37 +0,0 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Form\Decorator;
use Zend_Form_Decorator_Abstract;
/**
* Decorator that automatically adds a helptext to an input element
* when the 'helptext' attribute is set
*/
class HelpText extends Zend_Form_Decorator_Abstract
{
/**
* Add a helptext to an input field
*
* @param string $content The help text
*
* @return string The generated tag
*/
public function render($content = '')
{
$attributes = $this->getElement()->getAttribs();
$visible = true;
if (isset($attributes['condition'])) {
$visible = $attributes['condition'] == '1';
}
if (isset($attributes['helptext']) && $visible) {
$content = $content
. '<p class="help-block">'
. $attributes['helptext']
. '</p>';
}
return $content;
}
}