<?php
namespace Modules\Admin\EntityMngWsAccounts; class View_Utils_SetAccess extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $accountAccessConfig = new \Modules\Admin\EntityMngWsAccounts\AccountAccessConfig(); $accessLevelArr = $accountAccessConfig->getAccountAvailableAccess(); foreach($accessLevelArr as $entity => $operations) { $possibleValuesArr = []; $fieldset = \Engine\Form\Container\Fieldset::create(); $checkbox = new \Engine\Form\Input\Checkboxes($this->lang['entities'][$entity], 'accessLevel['.$entity.']', $this->values['accessLevel'][$entity]); if (!$entity) { $checkbox = new \Engine\Form\Input\Checkboxes($this->lang['index']['generalOperations'], 'accessLevel[generalOperations]', $this->values['accessLevel']['generalOperations']); } foreach(array_keys($operations) as $operation) { $possibleValuesArr[$operation] = $this->lang['entityOperation'][$operation]; } $checkbox->setPossibleValues($possibleValuesArr); $fieldset->addElement($checkbox); $form->addContainer($fieldset); } $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }