<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product">
  <?

    $urls = $this->driver->getOnlineLinks($expand=true);
    $displayDownloadButton = false;
    if (isset($urls))  {
	foreach($urls as $current)  {
		if (strcmp($current['desc'], "Inhaltsverzeichnis") == 0 || strncmp($current['desc'],"Volltext über anderen Anbieter", strlen("Volltext über anderen Anbieter")) == 0)    continue;
		$displayDownloadButton = true;
		break;
	}
    }

    $url = count($urls)  ? $urls[0] : $urls; 
    $QRCode = $this->record($this->driver)->getQRCode("core");
    $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large'));
    $cover = $coverDetails['html'];
    $preview  = $this->record($this->driver)->getPreviews();
    $filetypes = $this->driver->getFileType();
    $filetype  = count($filetypes) > 0 ? $filetypes[0] : '' ;
    if (strlen(trim($filetype)) == 0)  $filetype = "PDF"; 
    if (strcmp(trim(strtoupper($filetype)), "ADOBE PDF") == 0) $filetype = "PDF";
  ?>
  <?php if ($QRCode || $cover || $preview): ?>
    <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col">
      <?php /* Display thumbnail if appropriate: */ ?>
      <?php if($cover): ?>
        <?=$cover?>
      <?php endif; ?>

      <?php /* Display qrcode if appropriate: */ ?>
      <?php if($QRCode): ?>
        <span class="hidden-xs">
          <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
        </span>
      <?php endif; ?>

      <br />
      <?php if(isset($url['url']) &&  strlen($url['url']) > 10): ?>
      		<form action="<?=$this->escapeHtmlAttr(trim($this->proxyUrl($url['url'])))?>">
			<?php //if (strcmp($url['desc'], "Inhaltsverzeichnis") != 0 &&  strncmp(strcmp($url['desc'],"Volltext über anderen Anbieter", strlen("Volltext über anderen Anbieter")) !=0)) : ?>
			<?php if ($displayDownloadButton) : ?>
                                <button type="submit" class="btn btn-lg" style="height:30px;width:130px; background-color:#ffce53;color:#5e6c78;"><i class="fa fa-download" aria-hidden="true"></i> - <?= $filetype ?></button>
                        <?php endif; ?>
      		</form>
      <?php endif ; ?>

      <?php // if you have a preview tab but want to move or remove the preview link
         // from this area of the record view, this can be split into
         // getPreviewData() (should stay here) and
         // getPreviewLink() (can go in your desired tab) ?>
      <?php if ($preview): ?>
        <div class="record-previews">
          <?=$preview?>
        </div>
      <?php endif; ?>
    </div>
  <?php endif; ?>
  <div class="media-body">

    <h3 property="name"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection())?></h3>

    <?php $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?>
    <?php if ($summary): ?>
      <p><?=$this->truncate($summary, 300)?></p>

      <?php if(strlen($summary) > 300): ?>
        <p><a href='<?=$this->recordLinker($this->results)->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
      <?php endif; ?>
    <?php endif; ?>

    <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
      <?php /* Display the lists that this record is saved to */ ?>
      <div class="savedLists">
        <strong><?=$this->transEsc("Saved in")?>:</strong>
      </div>
    <?php endif; ?>

    <?/* Display Main Details */?>
    <?
      $formatter = $this->recordDataFormatter();
      $coreFields = $formatter->getData($driver, $formatter->getDefaults('core'));
//print_r($coreFields); 
    ?>
    
    <?php if (!empty($coreFields)) : ?>
      <table class="table table-striped" summary="<?=$this->transEsc('Bibliographic Details')?>">
        <?php  foreach ($coreFields as $key => $current): ?>
          <?php  if (strcmp($key,"Language") == 0): ?>
		<?$tr = "Language::" .$current['value'] ; ?>
		<tr><th><?=$this->transEsc($key)?>:</th><td><?=$this->translate("$tr")?></td></tr>
		<?php  continue; ?>
	  <?php endif; ?>
          <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr>
        <?php endforeach; ?>
    <?php endif; ?>
    </table>

    <?/* End Main Details */?>
  </div>
</div>
