views_ef_fieldset.module in Views Exposed Form Fieldset 8
File
views_ef_fieldset.module
View source
<?php
declare (strict_types=1);
use Drupal\Core\Form\FormStateInterface;
use Drupal\views_ef_fieldset\ViewsEFFieldsetData;
function views_ef_fieldset_form_views_exposed_form_alter(array &$form, FormStateInterface &$form_state, $form_id) {
if ($display = $form_state
->get('display')) {
if (!empty($display['display_options']['display_extenders']['views_ef_fieldset']['views_ef_fieldset'])) {
$options = $display['display_options']['display_extenders']['views_ef_fieldset']['views_ef_fieldset'];
if (!empty($options['enabled'])) {
$form['filters']['#attached']['library'][] = 'views_ef_fieldset/views_ef_fieldset.styling';
if (isset($options['options']['sort'])) {
$viewsEFFieldsetData = new ViewsEFFieldsetData($options['options']['sort'], $form);
$form['filters']['children'] = $viewsEFFieldsetData
->treetofapi();
$form['#info']['views_ef_fieldset']['value'] = 'filters';
}
}
}
}
}