<?php
 namespace Modules\Admin\Countries; class View_Utils_FormFilters extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $fieldsValues = $this->values['listingParams']->getFilters(); $CFG = \Engine\Loader_Cfg::getInstance()->getGlobal(); $_LANG = \App\Loader_Lang::getInstance()->getAll(); $form = \Engine\Form\Filters::create(); $form->setColumns(2); $fld = new \Engine\Form\Input\Text($this->lang['index']['filters']['text'], 'filters[text]', $fieldsValues['text']); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['formFields']['criterion'], 'filters[criterion]', $fieldsValues['criterion']); $list = []; $list[''] = $this->lang['index']['filters']['anyCountry']; foreach ($CFG['countriesCriteria'] as $criterion) { $list[$criterion] = $_LANG['locations']['countriesCriteria']['long'][$criterion]; } $fld->setPossibleValues($list); $form->addElement($fld); $fld = new \Engine\Form\Input\Text(sprintf("%s/%s", $this->lang['index']['filters']['code'], $this->lang['index']['filters']['code3']), 'filters[code]', $fieldsValues['code']); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['formFields']['zone'], 'filters[zone]', $fieldsValues['zone']); $list = []; $list[''] = $this->lang['index']['filters']['anyCountry']; foreach ($CFG['countriesZones'] as $zone) { $list[$zone] = $_LANG['locations']['countriesZones'][$zone]; } $fld->setPossibleValues($list); $form->addElement($fld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } } 