diff --git a/web/themes/asc_bootstrap/asc_bootstrap.theme b/web/themes/asc_bootstrap/asc_bootstrap.theme index dee8ebcc9b9bd3d30d0c69d657e70c1363661619..ed531369aced9a1f484edb9eb357686c0feb2207 100755 --- a/web/themes/asc_bootstrap/asc_bootstrap.theme +++ b/web/themes/asc_bootstrap/asc_bootstrap.theme @@ -70,7 +70,7 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $ /* * events and news filters */ - if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == 'views-exposed-form-news-page-1')) { + if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == 'views-exposed-form-news-page-1')||($form['#id'] == 'views-exposed-form-research-project-directory-page-1')) { /* * add new HTML content to filters (headers and spacer) * and setting weights for where they should appear in the form hierarchy @@ -117,6 +117,32 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $ if(count($form['field_news_terms_2_target_id']['#options']) == 1) { $form['field_news_terms_2_target_id']['#access'] = FALSE; } + + if(count($form['field_research_departments_target_id']['#options']) == 1) { + $form['field_research_departments_target_id']['#access'] = FALSE; + } + + if(count($form['field_research_other_target_id']['#options']) == 1) { + $form['field_research_other_target_id']['#access'] = FALSE; + } + + if(count($form['field_research_year_target_id']['#options']) == 1) { + $form['field_research_year_target_id']['#access'] = FALSE; + } + /* + * research filters - setting default value on select box to taxonomy vocabulary + */ + if(count($form['field_research_departments_target_id']['#options']['#value']) == "All") { + $form['field_research_departments_target_id']['#options']['All'] = $form['#info']['filter-field_research_departments_target_id']['label']; + } + + if(count($form['field_research_other_target_id']['#options']['#value']) == "All") { + $form['field_research_other_target_id']['#options']['All'] = $form['#info']['filter-field_research_other_target_id']['label']; + } + + if(count($form['field_research_year_target_id']['#options']['#value']) == "All") { + $form['field_research_year_target_id']['#options']['All'] = $form['#info']['filter-field_research_year_target_id']['label']; + } } /*