diff --git a/web/themes/asc_bootstrap/asc_bootstrap.theme b/web/themes/asc_bootstrap/asc_bootstrap.theme index e4181104779dd3e7d605b63349b6003244d61776..16549829a5f87470c69e24ac1040b04803778ec7 100755 --- a/web/themes/asc_bootstrap/asc_bootstrap.theme +++ b/web/themes/asc_bootstrap/asc_bootstrap.theme @@ -154,6 +154,34 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $ if(count($form['field_evt_taxonomy2_target_id']['#options']) == 1) { $form['field_evt_taxonomy2_target_id']['#access'] = FALSE; } + + if(isset($form['field_evt_taxonomy_target_id_1']['#options']['All'])) { + $tarr = array_slice(array_keys($form['field_evt_taxonomy_target_id_1']['#options']), 1, 5, true); + $tid = array_shift($tarr); + $term = Term::load($tid); + if (!empty($term)) { + $vid = array_shift($term->vid->getValue())['target_id']; + if(!empty($vid)) { + $vocab = Vocabulary::load($vid); + $vocab_label = $vocab->get('name'); + $form['field_evt_taxonomy_target_id_1']['#options']['All'] = $vocab_label; + } + } + } + + if(isset($form['field_evt_taxonomy2_target_id']['#options']['All'])) { + $tarr = array_slice(array_keys($form['field_evt_taxonomy2_target_id']['#options']), 1, 5, true); + $tid = array_shift($tarr); + $term = Term::load($tid); + if (!empty($term)) { + $vid = array_shift($term->vid->getValue())['target_id']; + if(!empty($vid)) { + $vocab = Vocabulary::load($vid); + $vocab_label = $vocab->get('name'); + $form['field_evt_taxonomy2_target_id']['#options']['All'] = $vocab_label; + } + } + } } //gallery @@ -222,6 +250,35 @@ 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(isset($form['field_news_terms_1_target_id']['#options']['All'])) { + $tarr = array_slice(array_keys($form['field_news_terms_1_target_id']['#options']), 1, 5, true); + $tid = array_shift($tarr); + $term = Term::load($tid); + if (!empty($term)) { + $vid = array_shift($term->vid->getValue())['target_id']; + if(!empty($vid)) { + $vocab = Vocabulary::load($vid); + $vocab_label = $vocab->get('name'); + $form['field_news_terms_1_target_id']['#options']['All'] = $vocab_label; + } + } + } + + if(isset($form['field_news_terms_2_target_id']['#options']['All'])) { + $tarr = array_slice(array_keys($form['field_news_terms_2_target_id']['#options']), 1, 5, true); + $tid = array_shift($tarr); + $term = Term::load($tid); + if (!empty($term)) { + $vid = array_shift($term->vid->getValue())['target_id']; + if(!empty($vid)) { + $vocab = Vocabulary::load($vid); + $vocab_label = $vocab->get('name'); + $form['field_news_terms_2_target_id']['#options']['All'] = $vocab_label; + } + } + } } //research filters