You are here

function mefibs_bef_mefibs_elements_alter in MEFIBS - More exposed forms in blocks 8

Same name and namespace in other branches
  1. 7 modules/mefibs_bef/mefibs_bef.module \mefibs_bef_mefibs_elements_alter()

Implements hook_mefibs_elements_alter().

File

modules/mefibs_bef/mefibs_bef.module, line 27
Primarily Drupal hooks and global API functions to add support for the Better Exposed Filters module.

Code

function mefibs_bef_mefibs_elements_alter(&$elements, $context) {
  $view = $context['view'];
  $display_id = $view->current_display;
  $bef_settings = $view->display[$display_id]->handler
    ->get_option('exposed_form');
  if ($bef_settings['type'] != 'better_exposed_filters') {
    return;
  }
  if (!$bef_settings['options']['bef']['sort']['advanced']['combine']) {
    return;
  }
  if (in_array('sort_by', $elements['sort'])) {
    $elements['sort'][] = 'sort_bef_combine';
  }
}