|
|
@ -11,22 +11,17 @@ use Drupal\roblib_search_eds\Lib\EBSCOAPI; |
|
|
|
class RoblibSearchEdsController extends ControllerBase { |
|
|
|
class RoblibSearchEdsController extends ControllerBase { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the markup. |
|
|
|
* Print JSON. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
|
|
|
|
* A renderable array. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function articleResults($query = NULL) { |
|
|
|
public function articleResults($query = NULL) { |
|
|
|
print $this->eds_get_results($query, 'Articles'); |
|
|
|
print $this->eds_get_results($query, 'Articles'); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the markup. |
|
|
|
* Print JSON. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
|
|
|
|
* A renderable array. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function bookResults($query = NULL) { |
|
|
|
public function bookResults($query = NULL) { |
|
|
|
print $this->eds_get_results($query, 'Books'); |
|
|
|
print $this->eds_get_results($query, 'Books'); |
|
|
@ -34,10 +29,13 @@ class RoblibSearchEdsController extends ControllerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* |
|
|
|
* Query EBSCO using the EDS API. |
|
|
|
* @param string $query |
|
|
|
* @param string $query |
|
|
|
|
|
|
|
* The search term(s) to send to EBSCO. |
|
|
|
|
|
|
|
* @param string type |
|
|
|
|
|
|
|
* The type of search, either Books or Articles. |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
* json string |
|
|
|
* A JSON string |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function eds_get_results($query = NULL, $type = 'Articles') { |
|
|
|
function eds_get_results($query = NULL, $type = 'Articles') { |
|
|
|
//drupal_add_css(drupal_get_path('module', 'roblib_search_eds') . '/css/roblib_search_eds.theme.css'); |
|
|
|
//drupal_add_css(drupal_get_path('module', 'roblib_search_eds') . '/css/roblib_search_eds.theme.css'); |
|
|
@ -69,8 +67,7 @@ class RoblibSearchEdsController extends ControllerBase { |
|
|
|
|
|
|
|
|
|
|
|
$output = $eds_api->apiSearch($search, $filters, 1, $number_per_page); |
|
|
|
$output = $eds_api->apiSearch($search, $filters, 1, $number_per_page); |
|
|
|
$output['is_local_ip'] = $is_local_ip; |
|
|
|
$output['is_local_ip'] = $is_local_ip; |
|
|
|
print json_encode($output); |
|
|
|
return json_encode($output); |
|
|
|
exit(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|