diff --git a/modules/monitoring/application/forms/Command/Object/ToggleObjectFeaturesCommandForm.php b/modules/monitoring/application/forms/Command/Object/ToggleObjectFeaturesCommandForm.php index 3a97d173f..e4aabb207 100644 --- a/modules/monitoring/application/forms/Command/Object/ToggleObjectFeaturesCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/ToggleObjectFeaturesCommandForm.php @@ -80,17 +80,25 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm $options['description'] = $this->translate('changed'); } if ($formData[$feature] === 2) { - $options['multiOptions'] = array( - $this->translate('disable'), - $this->translate('enable'), - ); - $options['separator'] = ''; - $elementType = 'radio'; + $this->addElement('select', $feature, $options + [ + 'description' => $this->translate('Multiple Values'), + 'filters' => [['Null', ['type' => \Zend_Filter_Null::STRING]]], + 'multiOptions' => [ + '' => $this->translate('Leave Unchanged'), + $this->translate('Disable All'), + $this->translate('Enable All') + ], + 'decorators' => array_merge( + array_slice(static::$defaultElementDecorators, 0, 3), + [['Description', ['tag' => 'span']]], + array_slice(static::$defaultElementDecorators, 4, 1), + [['HtmlTag', ['tag' => 'div', 'class' => 'control-group indeterminate']]] + ) + ]); } else { - $elementType = 'checkbox'; $options['value'] = $formData[$feature]; + $this->addElement('checkbox', $feature, $options); } - $this->addElement($elementType, $feature, $options); } } diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 7e079adc1..c0a0ca10c 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -629,11 +629,39 @@ form.instance-features span.description, form.object-features span.description { .control-group { margin-top: 0; margin-bottom: 0; + + &.indeterminate { + justify-content: flex-start; + + .control-label-group { + flex: 0 1 auto; + } + + select { + width: auto; + flex: 0 1 auto; + + & + span.hint { + flex: 0 1 auto; + } + } + } } .toggle-switch { margin-left: @table-column-padding; } + + select { + margin-right: .5em; + margin-left: @table-column-padding; + + & + span.hint { + margin: .35em; + color: @gray-light; + font-style: italic; + } + } } .plugin-output {