You are here

function vefl_theme_registry_alter in Views exposed form layout 7

Same name and namespace in other branches
  1. 8.3 vefl.module \vefl_theme_registry_alter()
  2. 8 vefl.module \vefl_theme_registry_alter()
  3. 8.2 vefl.module \vefl_theme_registry_alter()

Implements hook_theme_registry_alter().

Replace default views template for views-exposed-form.tpl.php.

File

./vefl.module, line 57
Provides functionality to output Views exposed filters in layout.

Code

function vefl_theme_registry_alter(&$theme_registry) {
  $module_path = drupal_get_path('module', 'vefl');
  $views_path = drupal_get_path('module', 'views');
  if ($theme_registry['views_exposed_form']['path'] == $views_path . '/theme') {
    $theme_registry['views_exposed_form']['path'] = $module_path . '/theme';
    $theme_registry['views_exposed_form']['theme path'] = $module_path . '/theme';
  }
  $theme_registry['views_exposed_form']['preprocess functions'][] = 'vefl_views_exposed_form_preprocess';

  // Adds additional preprocess function for ds layout.
  if (module_exists('ds')) {
    $module_layouts = ds_get_layout_info();
    foreach ($module_layouts as $id => $layout) {
      if (!empty($layout['module']) && $layout['module'] == 'panels') {
        continue;
      }
      $theme_registry[$id]['preprocess functions'][] = 'vefl_ds_preprocess_layout';
    }
  }
}