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.
59 lines
1.7 KiB
59 lines
1.7 KiB
12 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
11 years ago
|
* all we do here is pass a url to some javascript so the results can be
|
||
12 years ago
|
* loaded async
|
||
12 years ago
|
*/
|
||
|
|
||
11 years ago
|
// TODO: combine these two functions and call this function from the preprocessor
|
||
|
|
||
12 years ago
|
function roblib_search_eds_preprocess_roblib_search_eds(&$variables) {
|
||
|
global $base_url;
|
||
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
|
$search_url = $base_url . '/roblib_search/eds/ajax/' . urlencode($query);
|
||
12 years ago
|
drupal_add_js(drupal_get_path('module', 'roblib_search_eds') . '/js/eds_results.js');
|
||
11 years ago
|
drupal_add_js(array(
|
||
|
'roblib_search_eds' => array(
|
||
|
'search_url' => $search_url,
|
||
|
'eds_profile' =>
|
||
7 years ago
|
variable_get('roblib_search_eds_book_profile', 'apilite')
|
||
11 years ago
|
)
|
||
|
), array('type' => 'setting'));
|
||
11 years ago
|
|
||
|
}
|
||
|
|
||
|
function roblib_search_eds_preprocess_roblib_search_eds_articles(&$variables) {
|
||
|
global $base_url;
|
||
|
if (!isset($query)) {
|
||
|
if (isset($_GET['roblib_query'])) {
|
||
|
$query = $_GET['roblib_query'];
|
||
|
}
|
||
|
else {
|
||
|
return '';
|
||
|
}
|
||
|
}
|
||
|
$spinner_path = $base_url . '/' . drupal_get_path('module', 'roblib_search') . '/img/' . 'spinner.gif';
|
||
|
$variables['spinner_path'] = $spinner_path;
|
||
|
$search_url = $base_url . '/roblib_search/eds/articles/' . urlencode($query);
|
||
|
drupal_add_js(drupal_get_path('module', 'roblib_search_eds') . '/js/eds_results_article.js');
|
||
11 years ago
|
drupal_add_js(array(
|
||
|
'roblib_search_eds_articles' => array(
|
||
|
'search_url' => $search_url,
|
||
|
'eds_profile' =>
|
||
|
variable_get('roblib_search_eds_profile', 'edsapi')
|
||
|
)
|
||
|
), array('type' => 'setting'));
|
||
11 years ago
|
|
||
12 years ago
|
}
|
||
11 years ago
|
|
||
12 years ago
|
?>
|