<?php
 namespace Modules\Admin\Config\Services\ActiveServices; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $label = new \Engine\Form\Input\Label(); $label->setDetails($this->lang['index']['description']); $form->addElement($label); $otherServicesFieldset = null; foreach (\App\Config\Services_Basic::getInstance()->getListGrouped() as $groupServiceCode => $groupServiceDetails) { if($groupServiceDetails['type']=='group') { $fieldset = \Engine\Form\Container\Fieldset::create($groupServiceDetails['name']) ; $form->addContainer($fieldset); foreach($groupServiceDetails['list'] as $serviceCode=>$serviceDetails) { $checkbox = new \App\Form\Input\Checkboxes_CountryCriterion($serviceDetails['name'], 'activeServices['.$serviceCode.']', $this->values['activeServices'][$serviceCode]); $fieldset->addElement($checkbox); } } else { if (!$otherServicesFieldset) { $otherServicesFieldset = \Engine\Form\Container\Fieldset::create($this->lang['index']['fieldset']['otherSection']); } $checkbox = new \App\Form\Input\Checkboxes_CountryCriterion($groupServiceDetails['name'], 'activeServices['.$groupServiceCode.']', $this->values['activeServices'][$groupServiceCode]); $otherServicesFieldset->addElement($checkbox); } } if ($otherServicesFieldset) { $form->addContainer($otherServicesFieldset); } $form->addElement(new \Engine\Form\Input\Hidden(null, 'save', 1)); $form->addButton(new \Engine\Form\Button\Submit('save')); return $form; } }