You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
12 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
11 years ago
|
*
|
||
12 years ago
|
*/
|
||
|
|
||
11 years ago
|
/**
|
||
|
* @param array $variables
|
||
|
* @param string $type
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
10 years ago
|
function roblib_search_solr_site_preprocess_roblib_search_solr_site(&$variables){
|
||
|
//function roblib_search_solr_site_preprocessor(&$variables, $type) {
|
||
11 years ago
|
global $base_url;
|
||
10 years ago
|
$type = $variables['type'];
|
||
11 years ago
|
if (!isset($query)) {
|
||
12 years ago
|
if (isset($_GET['roblib_query'])) {
|
||
|
$query = $_GET['roblib_query'];
|
||
|
}
|
||
|
else {
|
||
|
return '';
|
||
|
}
|
||
|
}
|
||
11 years ago
|
$spinner_path = $base_url . '/' . drupal_get_path('module', 'roblib_search') . '/img/' . 'spinner.gif';
|
||
12 years ago
|
$variables['spinner_path'] = $spinner_path;
|
||
11 years ago
|
$variables['type'] = $type;
|
||
10 years ago
|
$query = urlencode($query);
|
||
|
$search_url = $base_url . '/roblib_search/solr_site/' . $type . '/' . $query;
|
||
11 years ago
|
drupal_add_js(drupal_get_path('module', 'roblib_search_solr_site') . '/js/solr_site_' . $type . '.js');
|
||
|
$key = 'roblib_search_solr_site_' . $type;
|
||
10 years ago
|
$default_module = variable_get('search_default_module', 'site') == 'apachesolr_search'
|
||
|
? 'site' : variable_get('search_default_module', 'site');
|
||
|
|
||
|
drupal_add_js(array(
|
||
|
$key => array(
|
||
|
'search_url' => $search_url,
|
||
|
'search_query' => $query,
|
||
|
'base_url' => $base_url,
|
||
|
'default_site_type' => $default_module
|
||
|
)
|
||
|
), array('type' => 'setting'));
|
||
12 years ago
|
}
|