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.
40 lines
1.3 KiB
40 lines
1.3 KiB
7 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
7 years ago
|
* all we do here is pass a url to some javascript so results can be loaded
|
||
7 years ago
|
* indepentantly
|
||
|
*/
|
||
|
|
||
7 years ago
|
function roblib_search_passthru_preprocess_roblib_search_passthru(&$variables) {
|
||
|
global $base_url;
|
||
|
if (!isset($query)) {
|
||
7 years ago
|
if (isset($_GET['roblib_query'])) {
|
||
|
$query = $_GET['roblib_query'];
|
||
|
}
|
||
|
else {
|
||
7 years ago
|
$query = '';
|
||
7 years ago
|
}
|
||
|
}
|
||
7 years ago
|
$variables['query'] = urlencode($query);
|
||
7 years ago
|
$spinner_path = $base_url . '/' . drupal_get_path('module', 'roblib_search') . '/img/' . 'spinner.gif';
|
||
7 years ago
|
$variables['spinner_path'] = $spinner_path;
|
||
7 years ago
|
$scholar_search_url = $base_url . '/roblib_search/passthru/scholar/ajax/' . urlencode($query);
|
||
|
$evergreen_search_url = $base_url . '/roblib_search/passthru/evergreen/ajax/' . urlencode($query);
|
||
7 years ago
|
$eds_search_url = $base_url . '/roblib_search/passthru/eds/ajax/' . urlencode($query);
|
||
7 years ago
|
|
||
|
drupal_add_js(drupal_get_path('module', 'roblib_search_passthru') . '/js/passthru_results.js');
|
||
|
drupal_add_js(
|
||
|
[
|
||
|
'roblib_search_passthru' => [
|
||
|
'scholar_search_url' => $scholar_search_url,
|
||
|
'evergreen_search_url' => $evergreen_search_url,
|
||
7 years ago
|
'eds_search_url' => $eds_search_url,
|
||
7 years ago
|
],
|
||
|
],
|
||
|
['type' => 'setting']);
|
||
|
//drupal_add_js(array('roblib_search_passthru' => array('scholar_search_url' => $scholar_search_url)), array('type' => 'setting'));
|
||
|
|
||
7 years ago
|
}
|
||
7 years ago
|
|
||
7 years ago
|
?>
|