@ -5,8 +5,9 @@
* Default theme implementation for displaying EBSCO results.
* Default theme implementation for displaying EBSCO results.
*
*
* @see template_preprocess_ebsco_results()
* @see template_preprocess_ebsco_results()
*
*
*
* Copyright [2014 ] [EBSCO Information Services]
* Copyright [2017 ] [EBSCO Information Services]
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
@ -20,37 +21,219 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
?>
<?php if ( $records ) : ?>
<?php print t ( 'Showing' ); ?>
if (isset ($autoSuggestTerms) ) {
< strong > <?php print $record_start ; ?> </ strong > - < strong > <?php print $record_end ; ?> </ strong >
if (count($autoSuggestTerms)>0) {
<?php print t ( 'of' ); ?> < strong > <?php print $record_count ; ?> </ strong >
$suggestString="";
<?php if ( $search_view == 'basic' ) : ?>
foreach ($autoSuggestTerms as $term ) {
<?php print t ( 'for search' ) ?> : < strong > '<?php print check_plain ( $lookfor ); ?> '</ strong >
$path = url('ebsco/results', array('query' => array('type' => "")));
<?php endif ; ?>
$suggestString.="< a href = \"{$path}&lookfor=$term\" > ".$term."< / a > ";
<?php if ( $search_time ) : ?>
}
, <?php print t ( 'query time' ); ?> : <?php print check_plain ( round ( $search_time , 2 )); ?> s
echo "< p > < strong > Did you mean ".$suggestString."?< / strong > < / p > ";
<?php endif ; ?>
}
}
<?php print $sort_form ; ?>
if ($records){
<?php print $pager ; ?>
echo t('Showing')." < strong > ".$record_start."< / strong > - < strong > ".$record_end."< / strong > ".t('of')." < strong > ".$record_count."< / strong > ";
if ($search_view == 'basic') {
echo t('for search')." < strong > '".check_plain($lookfor)."'< / strong > ";
}
if ($search_time){
echo "," .t('query time').":".check_plain(round($search_time, 2))." s";
}
print $sort_form;
print $pager;
if (!user_is_logged_in()) {
$link = '< a href = "' . url('user') . '" > ' . t('Login') . '< / a > ';
echo '< p class = "top-login-message" > ';
echo sprintf(t('Hello, Guest. %s for full access.'), $link);
echo '< / p > ';
}
$tabs="";
$tabsContent="";
$counter=0;
$rsItem=null;
if (isset ($relatedContent) ) {
foreach ($relatedContent as $item ) {
if (isset($item["RelatedRecord"])) {
$tabs.='< li data-target = "#researchstarters" data-slide-to = "'.$counter.'" ' . ( $ counter = =0?' class = "active" ' : ' ' ) . ' > < / li > ';
$counter++;
if (isset($item["RelatedRecord"]["Records"]["Record"][0])) {
$rsItem=$item["RelatedRecord"]["Records"]["Record"][0];
}
else
{
if (isset($item["Records"]["Record"])) {
$rsItem=$item["Records"]["Record"];
}
}
if ($rsItem==null) {
continue ;
}
//var_dump($rsItem);
$rsTitle="";
$rsSubjects="";
$rsAbstract="";
$rsSource="";
$rsImage="";
$rsAN=$rsItem["Header"]["An"];
$rsDB=$rsItem["Header"]["DbId"];
$rsUrl = url('ebsco/result', array('query' => array('id' => $rsAN."|".$rsDB)));
if (isset($rsItem["ImageInfo"]["CoverArt"])) {
$rsImage=$rsItem["ImageInfo"]["CoverArt"]["Target"];
}
foreach($rsItem["Items"]["Item"] as $it) {
switch ($it["Group"]) {
case "Ti":
$rsTitle=$it["Data"];
break;
case "Src":
$rsSource=$it["Data"];
break;
case "Su":
$rsSubjects=$it["Data"];
break;
case "Ab":
$rsAbstract=$it["Data"];
break;
}
}
$tabsContent.='< div class = "item" > < div class = "carousel-caption" > ';
if ($rsImage< >"") {
$tabsContent.='< img src = "'.$rsImage.'" alt = "'.$rsTitle.'" style = "float:left" > ';
}
if ($rsTitle< >""){
$tabsContent.='< h3 class = "relatedTitle" > < a href = "'.$rsUrl.'" class = "title _record_link" > '.$rsTitle.'< / a > < / h3 > ';
}
if ($rsSubjects< >""){
$path = url('ebsco/results', array('query' => array('type' => "Subject")));
$link_xml = '/< searchLink fieldCode = "([^\" ] * ) " term = "%22([^\" ] * ) % 22 " > /';
$link_html = "< a href = \"{$path}&lookfor=$2\" > ";
$rsSubjects = preg_replace($link_xml, $link_html, $rsSubjects);
$rsSubjects = str_replace('< / searchLink > ', '< / a > ', $rsSubjects);
$tabsContent.='< p > < strong > '.t('Subjects').'< / strong > :< span class = "quotestart" > '.str_replace(array("< br > ","< br / > "), ', ', $rsSubjects).'< / span > < / p > ';
}
if ($rsSource< >""){
$tabsContent.='< p > '.$rsSource.'< / p > ';
}
if ($rsAbstract< >""){
$tabsContent.='< p > < cite > '.$rsAbstract.'< / cite > < / p > ';
}
$tabsContent.='< / div > < / div > ';
}
// replated publications
if (isset($item["RelatedPublication"])) {
//var_dump($item);
$tabs.='< li data-target = "#ematchplacard" data-slide-to = "'.$counter.'" ' . ( $ counter = =0?' class = "active" ' : ' ' ) . ' > < / li > ';
$counter++;
$tabsContent.='< div class = "item" > < div class = "carousel-caption" > ';
$tabsContent.='
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" / >
< script src = "https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/jstree.min.js" > < / script >
';
foreach ($item["RelatedPublication"]["PublicationRecords"] as $pub){
$plink = $pub["PLink"];
foreach($pub["Items"]["Item"] as $item) {
if ($item["Group"]=="Ti")
{
$tabsContent.='< h3 class = "relatedTitle" > < a href = "'.$plink.' target=" _blank " > '.$item["Data"].'< / a > < / h3 > ';
}
else
{
$tabsContent.="< strong > ".$item["Label"]."< / strong > : ".$item["Data"]."< br / > ";
}
}
$tabsContent.='< div id = "publicationList" > < ul > ';
foreach($pub["FullTextHoldings"]["FullTextHolding"] as $itemHoldings) {
$hURL=isset($itemHoldings["URL"])?$itemHoldings["URL"] :"";
$hName=isset($itemHoldings["Name"])?$itemHoldings["Name"] :"";
$hCoverage=isset($itemHoldings["CoverageStatement"])?$itemHoldings["CoverageStatement"] :"";
$hEmbargo="";
if (isset($itemHoldings["EmbargoDescription"])) {
// if no embargo, zero size array
if (!is_array($itemHoldings["EmbargoDescription"] )) {
$hEmbargo=$itemHoldings["EmbargoDescription"];
}
}
$tabsContent.='< li >
< a href = "'.$hURL.'" target = "_blank" > '.$hName.'< / a > ;
< ul > < li > Coverage:'.$hCoverage.'; ';
if ($hEmbargo< >'') {
$tabsContent.='< / li > < li > Embargo:'.$hEmbargo;
}
$tabsContent.='< / li > < / ul > < / li > ';
// Notes
}
$tabsContent.='< / ul > < / div > ';
}
$tabsContent.='
< script >
jQuery("#publicationList").jstree().on("changed.jstree", function (e, data) {
var pubURL = data.instance.get_node(data.node, true).children("a").attr("href");
if (pubURL!="#") {
window.open(pubURL);
}
});
< / script > ';
$tabsContent.='< / div > < / div > ';
break;
}
}
}
if ($tabsContent< >"") {
echo '< script src = "https://code.jquery.com/jquery-2.2.4.min.js" > < / script >
<?php if ( ! user_is_logged_in ()) : ?>
< script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity = "sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin = "anonymous" > < / script >
<?php $link = '<a href="' . url ( 'user' ) . '">' . t ( 'Login' ) . '</a>' ; ?>
< p class = "top-login-message" >
< div id = "relatedInformation" class = "carousel slide" data-ride = "carousel" style = "display:block;" >
<?php print sprintf ( t ( 'Hello, Guest. %s for full access.' ), $link ); ?>
<!-- Indicators -->
< / p >
< ol class = "carousel-indicators" > '.$tabs.'< / ol > ';
<?php endif ; ?>
echo '< div class = "carousel-inner" role = "listbox" > '.$tabsContent.'< / div > ';
echo '<!-- Left and right controls -->
< a class = "left carousel-control" href = "#myCarousel" role = "button" data-slide = "prev" >
< span class = "glyphicon glyphicon-chevron-left" > < / span >
< / a >
< a class = "right carousel-control" href = "#myCarousel" role = "button" data-slide = "next" >
< span class = "glyphicon glyphicon-chevron-right" > < / span >
< / a >
< / div >
< script >
jQuery("#relatedInformation").carousel({
pause: true,
interval:4000
})
< / script > ';
}
?>
< ol class = "search-results ebsco" >
< ol class = "search-results ebsco" >
<?php foreach ( $records as $record ) : ?>
<?php foreach ( $records as $record ) :
<?php
$id = check_plain($record->record_id());
$id = check_plain($record->record_id());
$recordUrl = url('ebsco/result', array('query' => array('id' => $id)));
$recordUrl = url('ebsco/result', array('query' => array('id' => $id)));
$fulltextUrl = url('ebsco/fulltext', array('query' => array('id' => $id)));
$fulltextUrl = url('ebsco/fulltext', array('query' => array('id' => $id)));
$pdfUrl = url('ebsco/pdf', array('query' => array('id' => $id)));
$pdfUrl = url('ebsco/pdf', array('query' => array('id' => $id)));
?>
?>
< li >
< li >
< div class = "record-number floatleft" >
< div class = "record-number floatleft" >
@ -59,87 +242,92 @@
< div class = "result floatleft" >
< div class = "result floatleft" >
< div class = "span-2" >
< div class = "span-2" >
<?php if ( $record -> small_thumb_link ) : ?>
<?php
< a href = " <?php print $recordUrl ; ?> " class = "_record_link" >
if ($record->small_thumb_link){
< img src = " <?php print $record -> small_thumb_link ; ?> " class = "book-jacket" alt = " <?php print t ( 'Book jacket' ); ?> " />
echo'
< / a >
< a href = "'.$recordUrl.'" class = "_record_link" >
<?php endif ; ?>
< img src = "'.$record->small_thumb_link.'" class = "book-jacket" alt = "'.t('Book jacket').'" / >
< / a > ';
}
?>
< / div >
< / div >
< div class = "span-9" >
< div class = "span-9" >
< div class = "result-line1" >
< div class = "result-line1" >
<?php if ( $record -> access_level == '1' ) : ?>
<?php
< p >
<?php
if ($record->access_level == '1'){
$label = '< strong > ' . check_plain($record->db_label) . '< / strong > ';
echo '< p > ';
$link = '< a href = "' . url('user') . '" > ' . t('Login') . '< / a > ';
$label = '< strong > ' . check_plain($record->db_label) . '< / strong > ';
?>
$link = '< a href = "' . url('user') . '" > ' . t('Login') . '< / a > ';
<?php print sprintf ( t ( 'This result from %s cannot be displayed to guests.' ), $label ); ?>
echo sprintf(t('This result from %s cannot be displayed to guests.'), $label)."< br / > < strong > ".sprintf(t('%s for full access.'), $link)."< / strong > ";
< br / >
echo "< / p > ";
< strong > <?php print sprintf ( t ( '%s for full access.' ), $link ); ?> </ strong >
}
< / p >
elseif ($record->title){
<?php elseif ( $record -> title ) : ?>
echo '< a href = "'.$recordUrl.'" class = "title _record_link" > '.$record->title.'< / a > ';
< a href = " <?php print $recordUrl ; ?> " class = "title _record_link" >
}
<?php print $record -> title ; ?>
?>
< / a >
<?php endif ; ?>
< / div >
< / div >
< div class = "result-line2" >
< div class = "result-line2" >
<?php if ( ! empty ( $record -> authors )) : ?>
<?php
< p >
if (!empty($record->authors)){
<?php print t ( 'by' ); ?>
echo "< span > ".t('by'). " ".str_replace(array("< br > ","< br / > "), ', ', $record->authors)." < / span > ";
<?php print $record -> authors ; ?>
}
< / p >
<?php endif ; ?>
if (!empty($record->source)){
echo '< p > '.t('Published in')." ".$record->source.'< / p > ';
<?php if ( ! empty ( $record -> source )) : ?>
}
< p >
<?php print t ( 'Published in' ); ?>
?>
<?php print $record -> source ; ?>
< / p >
<?php endif ; ?>
< / div >
< / div >
< div class = "result-line3" >
< div class = "result-line3" >
<?php if ( ! empty ( $record -> summary )) : ?>
<?php
< cite > <?php print $record -> summary ; ?> </ cite >
< br / >
if (!empty($record->summary)){
<?php endif ; ?>
echo '< cite > '.$record->summary.'< / cite > < br / > ';
}
<?php if ( ! empty ( $record -> subjects )) : ?>
< strong > <?php print t ( 'Subjects' ); ?> </ strong > :
if (!empty($record->subjects)){
< span class = "quotestart" > <?php print str_replace ( '<br />' , ', ' , $record -> subjects ); ?> </ span >
echo '< strong > '.t('Subjects').'< / strong > :< span class = "quotestart" > '.str_replace('< br / > ', ', ', $record->subjects).'< / span > ';
<?php endif ; ?>
}
?>
< / div >
< / div >
<?php if ( ! empty ( $record -> custom_links )) : ?>
<?php
if (!empty($record->custom_links)){
?>
< div class = "result-line4" >
< div class = "result-line4" >
< ul class = "custom-links" >
< ul class = "custom-links" >
<?php foreach ( $record -> custom_links as $link ) : ?>
<?php
foreach ($record->custom_links as $link){ ?>
< li >
< li >
< a href = " <?php print $link [ 'Url' ]; ?> " target = "_blank" title = " <?php print $link [ 'MouseOverText' ]; ?> " class = "external-link" >
< a href = " <?php print $link [ 'Url' ]; ?> " target = "_blank" title = " <?php print $link [ 'MouseOverText' ]; ?> " class = "external-link" >
<?php if ( $link [ 'Icon' ]) : ?> < img src = " <?php print $link [ 'Icon' ] ?> " /> <?php endif ; ?><?php print $link [ 'Name' ]; ?>
<?php if ( $link [ 'Icon' ]) : ?> < img src = " <?php print $link [ 'Icon' ] ?> " /> <?php endif ; ?><?php print $link [ 'Name' ]; ?>
< / a >
< / a >
< / li >
< / li >
<?php endforeach ; ?>
<?php } ?>
< / ul >
< / ul >
< / div >
< / div >
<?php endif ; ?>
<?php } ?>
< div class = "result-line5" >
< div class = "result-line5" >
<?php if ( $record -> full_text_availability ) : ?>
<?php
< a href = " <?php print $fulltextUrl ; ?> #html" class = "icon html fulltext _record_link" >
if ($record->full_text_availability){
<?php print t ( 'HTML full text' ); ?>
echo '< a href = "'.$fulltextUrl.'#html" class = "icon html fulltext _record_link" > ';
< / a >
echo t('HTML full text');
echo "< / a > ";
<?php endif ; ?>
}
<?php if ( $record -> pdf_availability ) : ?>
if ($record->pdf_availability){
< a href = " <?php print $pdfUrl ; ?> " class = "icon pdf fulltext" >
echo ' < a href = "'.$pdfUrl.'" class = "icon pdf fulltext" > ';
<?php print t ( 'PDF full text' ); ?>
echo t('PDF full text');
< / a >
echo "< / a > ";
<?php endif ; ?>
}
?>
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
@ -149,9 +337,22 @@
< / ol >
< / ol >
<?php print $pager ; ?>
<?php print $pager ; ?>
<?php elseif ( ! empty ( $lookfor )) : ?>
<?php
< h2 > <?php print t ( 'Your search did not match any resources.' ); ?> </ h2 >
}
<?php print search_help ( 'search#noresults' , drupal_help_arg ()); ?>
elseif (!empty($lookfor)) {
<?php endif ; ?>
echo "< h2 > ".t('Your search did not match any resources.')."< / h2 > ";
// check for autocomplete
/*
if (isset ($autoSuggestTerms) ) {
if (count($autoSuggestTerms)>0) {
echo "Did you mean "."?< br / > ";
var_dump($autoSuggestTerms);
}
}
*/
echo search_help('search#noresults', drupal_help_arg());
}
?>
< div id = "spinner" class = "spinner" > < / div >
< div id = "spinner" class = "spinner" > < / div >