You are here

function panopoly_search_theme_registry_alter in Panopoly Search 8.2

Implements hook_theme_registry_alter().

File

./panopoly_search.module, line 16
Hooks for the panopoly_search module.

Code

function panopoly_search_theme_registry_alter(&$theme_registry) {

  // Replace the exposed form templates in Bartik, because it adds the
  // 'form--inline' class.
  if (isset($theme_registry['views_exposed_form'])) {
    $module_path = drupal_get_path('module', 'panopoly_search');
    foreach ([
      'panopoly_search_db',
      'panopoly_search_solr',
    ] as $view_name) {
      if (!isset($theme_registry["views_exposed_form__{$view_name}"])) {
        $theme_registry["views_exposed_form__{$view_name}"] = array_merge($theme_registry["views_exposed_form"], [
          'base hook' => 'views_exposed_form',
          'template' => 'views-exposed-form--panopoly-search',
          'theme path' => $module_path,
          'path' => $module_path . '/templates',
        ]);
      }
    }
  }
}