public function getElementGroups() { $settingHandler = $this->getSettingHandler(); $formGroups = array(); foreach ($this->getCheckouts() as $checkout) { $checkoutGroup = new Customweb_Form_ElementGroup(); $checkoutGroup->setTitle($checkout->getName()); $checkoutGroup->setMachineName($checkout->getMachineName()); // Single Checkbox // @formatter:off $element = new Customweb_Form_Element('Active', new Customweb_Form_Control_SingleCheckbox($checkout->getMachineName() . '[active]', 'yes', 'Active', $checkout->isActive()), null, false, !$settingHandler->hasCurrentStoreSetting($checkout->getMachineName() . '_active')); $element->setDescription(Customweb_I18n_Translation::__("Check to activate the external checkout.")); $checkoutGroup->addElement($element); // Input Field $element = new Customweb_Form_Element('Sort Order', new Customweb_Form_Control_TextInput($checkout->getMachineName() . '[sort_order]', $checkout->getSortOrder()), null, false, !$settingHandler->hasCurrentStoreSetting($checkout->getMachineName() . '_sort_order')); $element->setDescription(Customweb_I18n_Translation::__("Set the sort order to show the external checkouts.")); $checkoutGroup->addElement($element); // Minimal Order Total $element = new Customweb_Form_Element('Minimal Order Total', new Customweb_Form_Control_TextInput($checkout->getMachineName() . '[minimal_order_total]', $checkout->getMinimalOrderTotal()), null, false, !$settingHandler->hasCurrentStoreSetting($checkout->getMachineName() . '_minimal_order_total')); $element->setDescription(Customweb_I18n_Translation::__("Define a minimal order total for this checkout to be available.")); $checkoutGroup->addElement($element); // Maximal Order Total $element = new Customweb_Form_Element('Maximal Order Total', new Customweb_Form_Control_TextInput($checkout->getMachineName() . '[maximal_order_total]', $checkout->getMaximalOrderTotal()), null, false, !$settingHandler->hasCurrentStoreSetting($checkout->getMachineName() . '_maximal_order_total')); $element->setDescription(Customweb_I18n_Translation::__("Define a maximal order total for this checkout to be available.")); $checkoutGroup->addElement($element); // @formatter:on $formGroups[] = $checkoutGroup; } return $formGroups; }
private function getElementGroup() { $group = new Customweb_Form_ElementGroup(); $group->addElement($this->getAuthorElement())->addElement($this->getVersionNumberElement())->addElement($this->getReleaseDateElement())->addElement($this->getSupportElement()); return $group; }