<?php
 namespace Modules\Admin\Server\Logs; 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); $form->showResetButton(true); $fld = new \Engine\Form\Input\Text($this->lang['index']['filters']['text'], 'filters[text]', $fieldsValues['text']); $fld->setTooltip($this->lang['index']['filters']['tooltips']['text']); $form->addElement($fld); $fld = new \Engine\Form\Input\Text($this->lang['index']['filters']['stacktrace'], 'filters[stacktrace]', $fieldsValues['stacktrace']); $form->addElement($fld); $fld = new \Engine\Form\Input\Text($this->lang['index']['filters']['logSession'], 'filters[logSession]', $fieldsValues['logSession']); $form->addElement($fld); $fld = new \App\Form\Input\Autocomplete_User($this->lang['index']['filters']['idUser'], 'filters[idUser]', $fieldsValues['idUser']); $form->addElement($fld); $fld = new \Engine\Form\Input\Checkboxes($this->lang['index']['filters']['logLevel'], 'filters[logLevel]', $fieldsValues['logLevel']); $list = []; foreach (['critical', 'error', 'warning', 'info'] as $level) { $list[$level] = $this->lang['logLevels'][$level]; } $fld->setPossibleValues($list); $form->addElement($fld); $fld = new \Engine\Form\Input\DatetimeInterval($this->lang['index']['filters']['addTime'], 'filters[addTime]', $fieldsValues['addTime']); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['index']['filters']['source'], 'filters[source]', $fieldsValues['source']); $fld->showDefaultOption(); $fld->setPossibleValues([ 'TINALogger' => 'TINA', 'FluxInstance' => 'FluX', 'Disk' => 'Disk', ]); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['index']['filters']['dataSource'], 'filters[dataSource]', $fieldsValues['dataSource']); $fld->setPossibleValues([ 'current' => $this->lang['index']['filters']['dataSource_current'], 'archive' => $this->lang['index']['filters']['dataSource_archive'], ]); $form->addElement($fld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } } 