bibb-theme/templates/RecordDriver/SolrMarc/data-onlineAccessBIBB.phtml

101 lines
5.0 KiB
PHTML
Executable File

<?php
$account = $this->auth()->getManager();
$openUrl = $this->openUrl($this->driver, 'record');
$openUrlActive = $openUrl->isActive();
// Account for replace_other_urls setting
$urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
$title = $this->driver->getMainTitle() ;
$id = $this->driver->getUniqueID();
$accessRestrictions = $this->driver->getAccessRestrictions();
// $data = $this->driver->getRawData();
/* if (isset($data['rightsuri'])) {
$license = $data['rightsuri'];
$parts = explode("/", $license[0]);
$rightsImage = '';
if (isset($parts) && count($parts) > 1) {
$rightsImage = "/vufind/themes/bibb/images/".$parts[4].".png";
}
}
*/
// if ($title) $title = trim(strstr($title,":", true));
?>
<?php if (!empty($urls) || $openUrlActive): ?>
<?php foreach ($urls as $current): ?>
<?php if (strncmp($current['url'],"https://bibb-dspace.bibb.de/handle", strlen("https://bibb-dspace.bibb.de/handle")) == 0) : ?>
<?php continue; ?>
<?endif ; ?>
<?php if (strncmp($current['url'],"https://bibb-dspace.bibb.de/jspui/handle", strlen("https://bibb-dspace.bibb.de/jspui/handle")) == 0) : ?>
<?php continue; ?>
<?endif ; ?>
<?php if (strncmp($current['url'],"https://bibb-dspace.bibb.de/rest/bitstreams", strlen("https://bibb-dspace.bibb.de/rest/bitstreams")) == 0) : ?>
<?php $current['desc'] = "Volltext"; ?>
<?endif ; ?>
<?php //Looking for "(" and ")" and separation of the link and the label MUST be located here!! ?>
<?php if (($start = strrpos($current['url'], "(")) !== false) : ?>
<?php $current['desc'] = substr($current['url'],$start+1, strrpos($current['url'],")") - $start -1) ; ?>
<?php $current['url'] = trim(substr($current['url'],0, $start)); ?>
<?php endif; ?>
<?php if (($start = strrpos($current['url'], "[")) !== false) : ?>
<?php $current['desc'] = substr($current['url'],$start+1, strrpos($current['url'],"]") - $start -1) ; ?>
<?php $current['url'] = trim(substr($current['url'],0, $start)); ?>
<?php endif; ?>
<?php if (strncmp($current['url'],"www.bibb.de", strlen("www.bibb.de")) == 0) : ?>
<?php $current['url'] = "https://" .$current['url']; ?>
<?php endif; ?>
<?php if (strncmp(strtolower($current['url']),"http://dx.doi.org/", strlen("http://dx.doi.org/")) == 0) : ?>
<?php $current['url'] = "https://doi.org/" .urlencode(trim(substr($current['url'], strlen("http://dx.doi.org/")))) ; ?>
<?php $current['desc'] = "DOI"; ?>
<?php endif; ?>
<?php if (strncmp(strtolower($current['url']),"doi:", strlen("doi:")) == 0) : ?>
<?php $current['url'] = "https://doi.org/" .urlencode(trim(substr($current['url'], strlen("doi:")))) ; ?>
<?php $current['desc'] = "DOI"; ?>
<?php endif; ?>
<?php if (strncmp($current['url'],"http://dispatch.opac.d-nb.de/", strlen("http://dispatch.opac.d-nb.de/")) == 0) : ?>
<?php $current['url'] = "https://zdb-katalog.de/list.xhtml?t=" .urlencode("\"" .$title ."\"") ."&key=tit" ; ?>
<?php $current['desc'] = "\"" .$title ."\" in der ZDB"; ?>
<?php endif; ?>
<?php if (strncmp($current['url'],"urn:nbn:de:", strlen("urn:nbn:de:")) == 0) : ?>
<?php $current['url'] = "http://nbn-resolving.org/" .urlencode($current['url']) ; ?>
<?php $current['desc'] = "URN"; ?>
<?php endif; ?>
<?php $LoginRequired = false ; ?>
<?php if (((strpos($current['url'],"search.ebscohost.com/login.aspx") !== false) || (strpos($current['url'], "econtent.hogrefe.com") !== false || strpos($current['url'],"research.ebsco.com/") !== false)) || strlen($accessRestrictions[0]) > 0) : ?>
<?php //if (((strpos($current['url'],"search.ebscohost.com/login.aspx") !== false) || (strpos($current['url'], "econtent.hogrefe.com"))) !== false || strlen($accessRestrictions[0]) > 0) : ?>
<?php $LoginRequired = true ; ?>
<?php endif; ?>
<?php if (($LoginRequired == true) && ! $account->isLoggedIn()) : ?>
<?=$this->escapeHtml($current['desc'])?> &nbsp; &nbsp;
<?php else: ?>
<a href="<?=$this->escapeHtmlAttr(trim($this->proxyUrl($current['url'])))?>" target="_blank"><?=$this->escapeHtml($current['desc'])?></a> &nbsp; &nbsp;
<?php endif; ?>
<?php if (strlen($rightsImage)) : ?>
<img src="<?= $rightsImage ?>" alt="License" style="zoom: 0.18" name="<?php echo $this->escapeHtmlAttr($this->driver->getUniqueID())?>"
onmouseover="this.style.zoom='0.22'" onmouseout="this.style.zoom='0.18'" />
<?php $rightsImage = ''; ?>
<?php endif; ?>
<br />
&nbsp;&nbsp;
<a class="feedbackLink" style="color: #14416b; font-size: 13px;" data-lightbox href="<?=$this->url('feedback-home') ."?function=feedback&comments=Titel: " .urlencode($title) ." (ID: " .$id ."): Link ist nicht korrekt!" ?>"> <i class="fa fa-chain-broken" aria-hidden="true"></i> <?=$this->transEsc('Report broken link')?></a>
<br />
<?php endforeach; ?>
<?php if ($openUrlActive): ?>
<?=$openUrl->renderTemplate()?><br/>
<?php endif; ?>
<?php endif; ?>