Commit 63c3d70d authored by Martin Keereman's avatar Martin Keereman
Browse files

Issue #3003685 by matsbla, r.e.younan: Create option to make secondary exposed...

Issue #3003685 by matsbla, r.e.younan: Create option to make secondary exposed form options open by default
parent a26dc750
......@@ -60,3 +60,6 @@ better_exposed_filters.general:
secondary_label:
type: label
label: 'Secondary options label'
secondary_open:
type: boolean
label: 'Secondary options is open'
......@@ -98,6 +98,7 @@ class BetterExposedFilters extends InputRequired {
'input_required' => FALSE,
'allow_secondary' => FALSE,
'secondary_label' => $this->t('Advanced options'),
'secondary_open' => FALSE,
],
'sort' => [
'plugin_id' => 'default',
......@@ -287,6 +288,17 @@ class BetterExposedFilters extends InputRequired {
],
],
];
$form['bef']['general']['secondary_open'] = [
'#type' => 'checkbox',
'#default_value' => $bef_options['general']['secondary_open'],
'#title' => $this->t('Secondary option open by default'),
'#description' => $this->t('Indicates whether the details element should be open by default.'),
'#states' => [
'visible' => [
':input[name="exposed_form_options[bef][general][allow_secondary]"]' => ['checked' => TRUE],
],
],
];
/*
* Add options for exposed sorts.
......@@ -728,6 +740,7 @@ class BetterExposedFilters extends InputRequired {
],
'#type' => 'details',
'#title' => $bef_options['general']['secondary_label'],
'#open' => $bef_options['general']['secondary_open'],
// Disable until fields are added to this fieldset.
'#access' => FALSE,
];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment