mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
lib: Remove `HelpText' form element decorator
Zend already has a `Description' decorator. refs #5525
This commit is contained in:
parent
7143837ae3
commit
8478ef3fce
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user