|
|
|
@ -157,7 +157,7 @@ function roblib_search_evergreen_block_view($delta = '') {
|
|
|
|
|
// The subject is displayed at the top of the block. Note that it |
|
|
|
|
// should be passed through t() for translation. The title configured |
|
|
|
|
// for the block using Drupal UI supercedes this one. |
|
|
|
|
$block['subject'] = t('Evergreen Results'); |
|
|
|
|
$block['subject'] = t('PEI Collection'); |
|
|
|
|
// The content of the block is typically generated by calling a custom |
|
|
|
|
// function. |
|
|
|
|
$block['content'] = theme('roblib_search_evergreen', array('results' => NULL)); |
|
|
|
@ -184,7 +184,8 @@ function roblib_search_evergreen_get_results($query) {
|
|
|
|
|
$url = variable_get('roblib_search_evergreen_url', 'http://137.149.200.52'); |
|
|
|
|
$url_suffix = variable_get('roblib_search_evergreen_search_suffix', '/opac/extras/sru?version=1.1&operation=searchRetrieve&query='); |
|
|
|
|
$number_of_records = variable_get('roblib_search_evergreen_num_results', '5'); |
|
|
|
|
$query = str_replace(' ', '%20AND%20',$query);//hack until the library decides if we want phrase or individual words |
|
|
|
|
$query = str_replace(' ', '%20AND%20',$query); //hack until the library decides if we want phrase or individual words |
|
|
|
|
$query .= urlencode(' AND "prince edward island"'); |
|
|
|
|
$search_url = $url . $url_suffix . $query . '&maximumRecords=' . $number_of_records; |
|
|
|
|
$catalog_base_search_url = variable_get('roblib_search_evergreen_catalog_base_search_url', 'http://islandpines.roblib.upei.ca/opac/en-CA/skin/roblib/xml/rresult.xml?rt=keyword&tp=keyword&t='); |
|
|
|
|
drupal_add_js(array('roblib_search_evergreen' => array('catalog_url' => $catalog_base_search_url)), array('type' => 'setting')); |
|
|
|
@ -193,7 +194,8 @@ function roblib_search_evergreen_get_results($query) {
|
|
|
|
|
$output = roblib_search_evergreen_parse_results($results, $query); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$output = 'Error retrieving Evergreen results ' . $results->status_message; |
|
|
|
|
watchdog('roblib_search_evergreen', 'Error retrieving results: %error', array('%error' => $results->status_message), WATCHDOG_ERROR); |
|
|
|
|
$output = ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return json_encode($output); |
|
|
|
|