mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
QuickBaseForm: allow translation tools find 'None'
This commit is contained in:
parent
b00d3b4943
commit
0791b900f3
@ -284,7 +284,7 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||||||
$this->addElement('select', 'apply_for', array(
|
$this->addElement('select', 'apply_for', array(
|
||||||
'label' => $this->translate('Apply For'),
|
'label' => $this->translate('Apply For'),
|
||||||
'class' => 'assign-property autosubmit',
|
'class' => 'assign-property autosubmit',
|
||||||
'multiOptions' => $this->optionalEnum($hostProperties, 'None'),
|
'multiOptions' => $this->optionalEnum($hostProperties, $this->translate('None')),
|
||||||
'description' => $this->translate(
|
'description' => $this->translate(
|
||||||
'Evaluates the apply for rule for ' .
|
'Evaluates the apply for rule for ' .
|
||||||
'all objects with the custom attribute specified. ' .
|
'all objects with the custom attribute specified. ' .
|
||||||
|
@ -72,11 +72,13 @@ abstract class QuickBaseForm extends Zend_Form
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function optionalEnum($enum, $text='- please choose -')
|
public function optionalEnum($enum, $nullLabel = null)
|
||||||
{
|
{
|
||||||
return array(
|
if ($nullLabel === null) {
|
||||||
null => $this->translate($text)
|
$nullLabel = $this->translate('- please choose -');
|
||||||
) + $enum;
|
}
|
||||||
|
|
||||||
|
return array(null => $nullLabel) + $enum;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function handleOptions($options = null)
|
protected function handleOptions($options = null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user