You are here

function custom_search_theme in Custom Search 7

Same name and namespace in other branches
  1. 8 custom_search.module \custom_search_theme()
  2. 6 custom_search.module \custom_search_theme()

Implements hook_theme().

File

./custom_search.module, line 678
Bring customizations to the default search box

Code

function custom_search_theme() {
  $path = drupal_get_path('module', 'custom_search') . '/theme';
  $custom_search_theme_array = array(
    'custom_search_javascript' => array(
      'variables' => array(),
    ),
    'custom_search_sort_form' => array(
      'render element' => 'form',
      'path' => $path,
      'template' => 'custom_search-sort-form',
    ),
    'search_result' => array(
      'variables' => array(
        'result' => NULL,
        'module' => NULL,
      ),
      'path' => $path,
      'file' => 'custom_search.pages.inc',
      'template' => 'custom_search-result',
    ),
    'search_results' => array(
      'variables' => array(
        'results' => NULL,
        'module' => NULL,
      ),
      'path' => $path,
      'file' => 'custom_search.pages.inc',
      'template' => 'custom_search-results',
    ),
  );

  // Panels integration.
  $router_item = db_query_range('SELECT page_callback FROM {menu_router} WHERE path = :path', 0, 1, array(
    ':path' => 'search/node/%',
  ))
    ->fetchAssoc();
  if ($router_item['page_callback'] == 'page_manager_search_page') {
    unset($custom_search_theme_array['search_results'], $custom_search_theme_array['search_result']);
  }
  return $custom_search_theme_array;
}