You are here

function custom_search_init in Custom Search 7

Same name and namespace in other branches
  1. 6 custom_search.module \custom_search_init()

Implements hook_init().

File

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

Code

function custom_search_init() {
  if (user_access('use custom search')) {
    drupal_add_js(drupal_get_path('module', 'custom_search') . '/js/custom_search.js');
    drupal_add_js(array(
      'custom_search' => array(
        'form_target' => variable_get('custom_search_target', '_self'),
        'solr' => module_exists('apachesolr_search') || module_exists('search_api_solr') ? 1 : 0,
      ),
    ), array(
      'type' => 'setting',
    ));
  }
}