You are here

function i18n_views_pre_query in Internationalization 5

Implementation of hook_views_pre_query().

Disable language conditions for views. This is called before filter handlers

File

i18nviews/i18nviews.module, line 88
Views support for Internationalization (i18n) package

Code

function i18n_views_pre_query(&$view) {

  // If any language filter, the language selection mode will be 'off'
  foreach ($view->exposed_filter as $filter) {
    if ($filter['field'] == 'i18n.language') {
      i18n_selection_mode('off');
      return;
    }
  }

  // If no filter, sets the one from settings for this view
  i18n_selection_mode(variable_get('i18n_selection_mode', 'simple'));
}