You are here

function google_appliance_theme in Google Search Appliance 7

Same name and namespace in other branches
  1. 8 google_appliance.module \google_appliance_theme()
  2. 6.2 google_appliance.module \google_appliance_theme()

Implements hook_theme().

File

theme/google_appliance.theme.inc, line 10
theme registry and preprocess functions for the default templates

Code

function google_appliance_theme() {
  $registry = array();
  $ga_template_dir = drupal_get_path('module', 'google_appliance') . '/theme';

  // Full search form on results pages.
  $registry['google_appliance_search_form'] = array(
    'arguments' => array(
      'form' => NULL,
    ),
    'render element' => 'form',
    'template' => 'google-appliance-search-form',
    'path' => $ga_template_dir,
  );

  // Block search form.
  $registry['google_appliance_block_form'] = array(
    'render element' => 'form',
    'template' => 'google-appliance-block-form',
    'path' => $ga_template_dir,
  );

  // Results page (top level template for the rest).
  $registry['google_appliance_results'] = array(
    'variables' => array(
      'search_query_data' => NULL,
      'response_data' => NULL,
      'synonyms_label' => t('You might also try:'),
    ),
    'template' => 'google-appliance-results',
    'path' => $ga_template_dir,
  );

  // Spelling suggestion.
  $registry['google_appliance_spelling_suggestion'] = array(
    'variables' => array(
      'spelling_suggestion' => NULL,
    ),
    'template' => 'google-appliance-spelling-suggestion',
    'path' => $ga_template_dir,
  );

  // Single result within the results page.
  $registry['google_appliance_result'] = array(
    'variables' => array(
      'result_data' => NULL,
    ),
    'template' => 'google-appliance-result',
    'path' => $ga_template_dir,
  );

  // Single keymatch within the results page.
  $registry['google_appliance_keymatch'] = array(
    'variables' => array(
      'keymatch_data' => NULL,
    ),
    'template' => 'google-appliance-keymatch',
    'path' => $ga_template_dir,
  );

  // Single synonym within the results page.
  $registry['google_appliance_synonym'] = array(
    'variables' => array(
      'synonyms' => NULL,
    ),
    'template' => 'google-appliance-synonym',
    'path' => $ga_template_dir,
  );

  // Single Onebox module within a block.
  $registry['google_appliance_onebox_module'] = array(
    'variables' => array(
      'onebox' => NULL,
    ),
    'template' => 'google-appliance-onebox-module',
    'path' => $ga_template_dir,
  );

  // Single Onebox result within a Onebox module.
  $registry['google_appliance_onebox_result'] = array(
    'variables' => array(
      'result' => NULL,
    ),
    'template' => 'google-appliance-onebox-result',
    'path' => $ga_template_dir,
  );

  // Pager.
  $registry['google_appliance_pager'] = array(
    'variables' => array(
      'pager_data' => NULL,
    ),
  );

  // Sort headers.
  $registry['google_appliance_sort_headers'] = array(
    'variables' => array(
      'sort_header_data' => NULL,
    ),
    'template' => 'google-appliance-sort-headers',
    'path' => $ga_template_dir,
  );

  // Search stats.
  $registry['google_appliance_search_stats'] = array(
    'variables' => array(
      'search_stats_data' => NULL,
    ),
    'template' => 'google-appliance-search-stats',
    'path' => $ga_template_dir,
  );
  return $registry;
}