Browse Source

added complete one search results to misc results

2.x-ebsco
Paul Pound 7 years ago
parent
commit
bbbd3675d1
  1. 7
      targets/passthru_results/js/passthru_results.js
  2. 14
      targets/passthru_results/roblib_search_passthru.module
  3. 21
      targets/passthru_results/theme/roblib-search-passthru.tpl.php
  4. 2
      targets/passthru_results/theme/theme.inc

7
targets/passthru_results/js/passthru_results.js

@ -2,6 +2,7 @@ Drupal.behaviors.roblib_search_passthru = {
attach: function (context, settings) {
scholar_url = settings.roblib_search_passthru.scholar_search_url;
evergreen_url = settings.roblib_search_passthru.evergreen_search_url;
eds_url = settings.roblib_search_passthru.eds_search_url;
jQuery.getJSON(scholar_url, function (data) {
var scholar_numfound = data.response.numFound;
var query = encodeURIComponent(data.responseHeader.params.q);
@ -14,6 +15,12 @@ Drupal.behaviors.roblib_search_passthru = {
jQuery('#roblib-search-passthru-evergreen-more').empty().append('<a href = "' + data.catalogBaseSearchUrl + '">PEI Collection (' +
evergreen_numfound +')</a>');
});
jQuery.getJSON(eds_url, function (data) {
var eds_numfound = data.recordCount;
var href_str = 'http://search.ebscohost.com/login.aspx?direct=true&site=ehost-live&scope=site&type=1&custid=uprince&groupid=main&profid=eds&mode=bool&lang=en&bquery=';
jQuery('#roblib-search-passthru-eds-more').empty().append('<a href="http://proxy.library.upei.ca/login?url=' + href_str + query + '">Complete OneSearch results (' +
eds_numfound +')</a>');
});
jQuery('#roblib-search-content-passthru').empty();
}
}

14
targets/passthru_results/roblib_search_passthru.module

@ -26,6 +26,13 @@ function roblib_search_passthru_menu() {
'type' => MENU_CALLBACK,
'access arguments' => ['search roblib'],
];
$items['roblib_search/passthru/eds/ajax/%'] = [
'title' => 'eds ajax',
'page callback' => 'roblib_search_passthru_eds_ajax',
'page arguments' => [4],
'type' => MENU_CALLBACK,
'access arguments' => ['search roblib'],
];
return $items;
}
@ -36,6 +43,12 @@ function roblib_search_passthru_evergreen_ajax($query) {
exit();
}
function roblib_search_passthru_eds_ajax($query) {
$output = roblib_search_eds_get_results($query);
print $output;
exit();
}
/**
*
* @param string $query
@ -150,7 +163,6 @@ function roblib_search_passthru_block_view($delta = '') {
*/
function roblib_search_passthru_islandscholar_ajax($query) {
$output = roblib_search_passthru_get_results($query);
debug($output, 'pp_passthru_content', TRUE);
print $output;
exit();
}

21
targets/passthru_results/theme/roblib-search-passthru.tpl.php

@ -2,23 +2,30 @@
/**
* @file roblib-search-passthru.tpl.php
*/
?>
<div class ="roblib-search-content " id="roblib-search-content-passthru">
<div class="roblib-search-content " id="roblib-search-content-passthru">
<img src="<?php print (empty($spinner_path) ? ' ' : $spinner_path); ?>"/>
</div>
<div class ="roblib-search-row" id="roblib-search-passthru-islandscholar-more"></div>
<div class ="roblib-search-row" id="roblib-search-passthru-evergreen-more"></div>
<div class="roblib-search-row"
id="roblib-search-passthru-eds-more"></div>
<div class="roblib-search-row"
id="roblib-search-passthru-islandscholar-more"></div>
<div class="roblib-search-row" id="roblib-search-passthru-evergreen-more"></div>
<div class="roblib-search-row" id="roblib-search-google-scholar">
<a href="http://scholar.google.ca/scholar?q=<?php print ($query); ?>">Google Scholar</a>
<a href="http://scholar.google.ca/scholar?q=<?php print ($query); ?>">Google
Scholar</a>
</div>
<div class="roblib-search-row" id="roblib-search-google-cse-carleton">
<a href="http://www.google.com/cse?cx=015121753026627038989:9jvssbo3xgo&ie=UTF-8&q=<?php print ($query); ?>&sa=Search">Canadian Government Sites</a>
<a
href="http://www.google.com/cse?cx=015121753026627038989:9jvssbo3xgo&ie=UTF-8&q=<?php print ($query); ?>&sa=Search">Canadian
Government Sites</a>
</div>
<div class="roblib-search-row" id="roblib-search-filmsondemand">
<a href="http://proxy.library.upei.ca/login?url=http://digital.films.com/portalplaylists.aspx?aid=14978&rd=lo&q=<?php print ($query); ?>">Films on Demand</a>
<a
href="http://proxy.library.upei.ca/login?url=http://digital.films.com/portalplaylists.aspx?aid=14978&rd=lo&q=<?php print ($query); ?>">Films
on Demand</a>
</div>

2
targets/passthru_results/theme/theme.inc

@ -20,6 +20,7 @@ function roblib_search_passthru_preprocess_roblib_search_passthru(&$variables) {
$variables['spinner_path'] = $spinner_path;
$scholar_search_url = $base_url . '/roblib_search/passthru/scholar/ajax/' . urlencode($query);
$evergreen_search_url = $base_url . '/roblib_search/passthru/evergreen/ajax/' . urlencode($query);
$eds_search_url = $base_url . '/roblib_search/passthru/eds/ajax/' . urlencode($query);
drupal_add_js(drupal_get_path('module', 'roblib_search_passthru') . '/js/passthru_results.js');
drupal_add_js(
@ -27,6 +28,7 @@ function roblib_search_passthru_preprocess_roblib_search_passthru(&$variables) {
'roblib_search_passthru' => [
'scholar_search_url' => $scholar_search_url,
'evergreen_search_url' => $evergreen_search_url,
'eds_search_url' => $eds_search_url,
],
],
['type' => 'setting']);

Loading…
Cancel
Save