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(
|
||||
'label' => $this->translate('Apply For'),
|
||||
'class' => 'assign-property autosubmit',
|
||||
'multiOptions' => $this->optionalEnum($hostProperties, 'None'),
|
||||
'multiOptions' => $this->optionalEnum($hostProperties, $this->translate('None')),
|
||||
'description' => $this->translate(
|
||||
'Evaluates the apply for rule for ' .
|
||||
'all objects with the custom attribute specified. ' .
|
||||
|
|
|
@ -72,11 +72,13 @@ abstract class QuickBaseForm extends Zend_Form
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function optionalEnum($enum, $text='- please choose -')
|
||||
public function optionalEnum($enum, $nullLabel = null)
|
||||
{
|
||||
return array(
|
||||
null => $this->translate($text)
|
||||
) + $enum;
|
||||
if ($nullLabel === null) {
|
||||
$nullLabel = $this->translate('- please choose -');
|
||||
}
|
||||
|
||||
return array(null => $nullLabel) + $enum;
|
||||
}
|
||||
|
||||
protected function handleOptions($options = null)
|
||||
|
|
Loading…
Reference in New Issue