<?php
namespace Modules\Admin\Config\Customers\Flags; class View_Utils_FormFilters extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $fieldsValues = $this->values['listingParams']->getFilters(); $form=\Engine\Form\Filters::create(); $form->setColumns(2); $nameFld=new \Engine\Form\Input\Text($this->lang['index']['filters']['name'], 'filters[name]', $fieldsValues['name']); $form->addElement($nameFld); $colors = \App\Config\CustomersFlags::getAdmin()->getAll(); $chooseColors = ['' => $this->lang['index']['filters']['selectCode']]; foreach ($colors as $colorCode => $colorName) { $chooseColors[$colorCode] = $this->lang['flagsList'][$colorCode]; } $codeFld = new \Engine\Form\Input\Select($this->lang['index']['filters']['code'], 'filters[code]', $fieldsValues['code'], $chooseColors); $form->addElement($codeFld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } }