FormSimpleNote: do not use "Note" from ZF
For compatibility reasons we'll not use 'note' anymore, it isn't part of older Zend Framework versions fixes #11297
This commit is contained in:
parent
ddba5c570c
commit
70db23b8d1
|
@ -84,7 +84,7 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
|
|||
protected function addCustomVariable($varname)
|
||||
{
|
||||
$a = new \Zend_Form_SubForm();
|
||||
$a->addElement('note', 'title', array(
|
||||
$a->addElement('simpleNote', 'title', array(
|
||||
'label' => sprintf($this->translate('Custom Variable "%s"'), $varname),
|
||||
));
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class Zend_View_Helper_FormSimpleNote extends Zend_View_Helper_FormElement
|
||||
{
|
||||
public function formSimpleNote($name, $value = null)
|
||||
{
|
||||
$info = $this->_getInfo($name, $value);
|
||||
extract($info); // name, value, attribs, options, listsep, disable
|
||||
return $value;
|
||||
}
|
||||
}
|
|
@ -77,7 +77,7 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
|
||||
/*
|
||||
// TODO implement when new logic is there
|
||||
$this->addElement('note', '_newrange_hint', array('label' => 'New range'));
|
||||
$this->addElement('simpleNote', '_newrange_hint', array('label' => 'New range'));
|
||||
$this->addElement('text', '_newrange_name', array(
|
||||
'label' => 'Name'
|
||||
));
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Web\Form\Element;
|
||||
|
||||
class SimpleNote extends FormElement
|
||||
{
|
||||
public $helper = 'formSimpleNote';
|
||||
|
||||
protected $_ignore = true;
|
||||
|
||||
public function isValid($value, $context = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -246,7 +246,7 @@ abstract class QuickForm extends Zend_Form
|
|||
public function addHtml($html, $options = array())
|
||||
{
|
||||
$name = '_HINT' . ++$this->hintCount;
|
||||
$this->addElement('note', $name, $options);
|
||||
$this->addElement('simpleNote', $name, $options);
|
||||
$this->getElement($name)
|
||||
->setValue($html)
|
||||
->setIgnore(true)
|
||||
|
|
Loading…
Reference in New Issue