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