Browse Source

limited PEI Collection search results to pei and changed title

2.x-ebsco
Paul Pound 10 years ago
parent
commit
42895e1cc0
  1. 6
      targets/evergreen/roblib_search_evergreen.module

6
targets/evergreen/roblib_search_evergreen.module

@ -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));
@ -185,6 +185,7 @@ function roblib_search_evergreen_get_results($query) {
$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 .= 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);

Loading…
Cancel
Save