|
|
@ -151,6 +151,17 @@ function roblib_search_eds_theme() { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function roblib_search_eds_preprocess_panels_pane(&$variables, $hook){ |
|
|
|
|
|
|
|
if($variables['pane']->subtype == 'roblib_search_eds-roblib_search_eds_articles'){ |
|
|
|
|
|
|
|
$variables['title_prefix'] = '<div class="roblib-search-eds-articles-header">'; |
|
|
|
|
|
|
|
$variables['title_suffix'] ='</div>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if($variables['pane']->subtype == 'roblib_search_eds-roblib_search_eds_results'){ |
|
|
|
|
|
|
|
$variables['title_prefix'] = '<div class="roblib-search-eds-media-header">'; |
|
|
|
|
|
|
|
$variables['title_suffix'] ='</div>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function roblib_search_eds_block_info() { |
|
|
|
function roblib_search_eds_block_info() { |
|
|
|
|
|
|
|
|
|
|
|
$blocks['roblib_search_eds_results'] = array( |
|
|
|
$blocks['roblib_search_eds_results'] = array( |
|
|
@ -193,7 +204,7 @@ function roblib_search_eds_ajax($query) { |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function roblib_search_eds_articles($query){ |
|
|
|
function roblib_search_eds_articles($query) { |
|
|
|
print roblib_search_eds_get_results($query, 'Articles'); |
|
|
|
print roblib_search_eds_get_results($query, 'Articles'); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
@ -217,28 +228,28 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$limiters = ''; |
|
|
|
$limiters = ''; |
|
|
|
if($type != NULL){ |
|
|
|
if ($type != NULL) { |
|
|
|
$limiters = roblib_search_eds_get_query_limiters($type); |
|
|
|
$limiters = roblib_search_eds_get_query_limiters($type); |
|
|
|
} |
|
|
|
} |
|
|
|
$config = roblib_search_eds_build_config_arr(); |
|
|
|
$config = roblib_search_eds_build_config_arr(); |
|
|
|
$eds_api = new EBSCOAPI($config); |
|
|
|
$eds_api = new EBSCOAPI($config); |
|
|
|
$number_per_page = variable_get('roblib_search_eds_num_results', '5'); |
|
|
|
$number_per_page = variable_get('roblib_search_eds_num_results', '5'); |
|
|
|
$query = urlencode($query); |
|
|
|
$query = urlencode($query); |
|
|
|
$params = "query=AND,$query&includefacets=n&$limiters&resultsperpage=$number_per_page"; |
|
|
|
$params = "query=AND,$query&view=detailed&includefacets=n&$limiters&resultsperpage=$number_per_page"; |
|
|
|
$output = $eds_api->apiSearch($params); |
|
|
|
$output = $eds_api->apiSearch($params); |
|
|
|
return json_encode($output); |
|
|
|
return json_encode($output); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function roblib_search_eds_get_query_limiters($type){ |
|
|
|
function roblib_search_eds_get_query_limiters($type) { |
|
|
|
$limiters = 'n'; |
|
|
|
$limiters = 'n'; |
|
|
|
switch ($type) { |
|
|
|
switch ($type) { |
|
|
|
case 'Articles': |
|
|
|
case 'Articles': |
|
|
|
$limiters = 'facetfilter=1,SourceType:Magazines,SourceType:News,SourceType:Academic+Journals,SourceType:Conference+Materials'; |
|
|
|
$limiters = 'facetfilter=1,SourceType:Magazines,SourceType:News,SourceType:Academic+Journals,SourceType:Conference+Materials'; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'Books': |
|
|
|
case 'Books': |
|
|
|
// $limiters = '+AND+(PT+book)'; |
|
|
|
// $limiters = '+AND+(PT+book)'; |
|
|
|
$limiters = 'facetfilter=1,SourceType:Books,SourceType:Audio,SourceType:Videos'; |
|
|
|
$limiters = 'facetfilter=1,SourceType:Books,SourceType:Audio,SourceType:Videos'; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|