コード例 #1
0
ファイル: MarcRecord.php プロジェクト: bharatm/NDL-VuFind
 /**
  * Return a URL to a thumbnail preview of the record, if available; false
  * otherwise.
  *
  * @param array $size Size of thumbnail (small, medium or large -- small is
  * default).
  *
  * @return mixed
  * @access public
  */
 public function getThumbnail($size = 'small')
 {
     global $configArray;
     foreach ($this->marcRecord->getFields('856') as $url) {
         $type = $url->getSubfield('q');
         if ($type) {
             $type = $type->getData();
             if ("IMAGE" == $type || "image/jpeg" == $type) {
                 $address = $url->getSubfield('u');
                 if ($address && $this->urlAllowed($address->getData())) {
                     return $configArray['Site']['url'] . '/thumbnail.php?id=' . urlencode($this->getUniqueID()) . '&size=' . urlencode($size);
                 }
             }
         }
     }
     return parent::getThumbnail($size);
 }