public function makeOnOff(Centurion_Form $form) { if (null !== ($displayGroups = $form->getDisplayGroup('_aside'))) { foreach ($form->getDisplayGroup('_aside') as $displayGroup) { foreach ($displayGroup->getElements() as $name => $element) { if (!strncmp($element->getName(), 'is_', 3) || !strncmp($element->getName(), 'can_be_', 7)) { $onLabel = $this->view->translate('On'); $offLabel = $this->view->translate('Off'); $value = $element->getValue(); $element = new Zend_Form_Element_Select(array('disableTranslator' => true, 'name' => $name, 'class' => 'field-switcher', 'label' => $element->getLabel(), 'decorators' => $form->defaultElementDecorators)); $element->addMultiOption('1', $onLabel); $element->addMultiOption('0', $offLabel); $element->setValue($value); $displayGroup->addElement($element); } } } } }