public function sliderExhibitAttachment($attachment) { $item = $attachment->getItem(); $file = $attachment->getFile(); if ($file) { if (!isset($fileOptions['imgAttributes']['alt'])) { $fileOptions['imgAttributes']['alt'] = metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)); } if ($forceImage) { $imageSize = isset($fileOptions['imageSize']) ? $fileOptions['imageSize'] : 'square_thumbnail'; $image = file_image($imageSize, $fileOptions['imgAttributes'], $file); $html = exhibit_builder_link_to_exhibit_item($image, $linkProps, $item); } else { if (!isset($fileOptions['linkAttributes']['href'])) { $fileOptions['linkAttributes']['href'] = exhibit_builder_exhibit_item_uri($item); } $html = file_markup($file, $fileOptions, null); } } else { if ($item) { $html = exhibit_builder_link_to_exhibit_item(null, $linkProps, $item); } } // Don't show a caption if we couldn't show the Item or File at all if (isset($html)) { if (!is_string($attachment['caption']) || $attachment['caption'] == '') { return ''; } $html .= '<div class="exhibit-item-caption">' . $attachment['caption'] . '</div>'; return apply_filters('exhibit_attachment_caption', $html, array('attachment' => $attachment)); } else { $html = ''; } return apply_filters('exhibit_attachment_markup', $html, compact('attachment', 'fileOptions', 'linkProps', 'forceImage')); }
/** * Return the markup for displaying an exhibit attachment. * * @param ExhibitBlockAttachment $attachment * @param array $fileOptions Array of options for file_markup * @param array $linkProps Array of options for exhibit_builder_link_to_exhibit_item * @param boolean $forceImage Whether to display the attachment as an image * always Defaults to false. * @return string */ public function exhibitAttachment($attachment, $fileOptions = array(), $linkProps = array(), $forceImage = false) { $item = $attachment->getItem(); $file = $attachment->getFile(); if ($file) { if (!isset($fileOptions['imgAttributes']['alt'])) { $fileOptions['imgAttributes']['alt'] = metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)); } if ($forceImage) { $imageSize = isset($fileOptions['imageSize']) ? $fileOptions['imageSize'] : 'square_thumbnail'; $image = file_image($imageSize, $fileOptions['imgAttributes'], $file); $html = exhibit_builder_link_to_exhibit_item($image, $linkProps, $item); } else { if (!isset($fileOptions['linkAttributes']['href'])) { $fileOptions['linkAttributes']['href'] = exhibit_builder_exhibit_item_uri($item); } $html = file_markup($file, $fileOptions, null); } } else { if ($item) { $html = exhibit_builder_link_to_exhibit_item(null, $linkProps, $item); } } // Don't show a caption if we couldn't show the Item or File at all if (isset($html)) { $html .= $this->view->exhibitAttachmentCaption($attachment); } else { $html = ''; } return apply_filters('exhibit_attachment_markup', $html, compact('attachment', 'fileOptions', 'linkProps', 'forceImage')); }
/** * Return the markup for displaying an exhibit attachment. * * @param ExhibitBlockAttachment $attachment * @param array $fileOptions Array of options for file_markup * @param array $linkProps Array of options for exhibit_builder_link_to_exhibit_item * @param boolean $forceImage Whether to display the attachment as an image * always Defaults to false. * @return string */ public function exhibitAttachmentLightboxBook($attachment, $fileOptions = array(), $linkProps = array(), $forceImage = false, $pageCount = 0) { $item = $attachment->getItem(); $file = $attachment->getFile(); $caption = $attachment['caption']; if ($file) { if (!isset($fileOptions['imgAttributes']['alt'])) { $fileOptions['imgAttributes']['alt'] = metadata($item, array('Dublin Core', 'Title')); } if (!isset($fileOptions['linkAttributes']['data-lightbox'])) { $fileOptions['linkAttributes']['data-lightbox'] = 'lightbox-gallery'; } if ($caption) { $fileOptions['linkAttributes']['data-title'] = $caption; } if ($pageCount > 0) { $fileOptions['linkAttributes']['class'] = "download-file later-pages"; } if ($forceImage) { $imageSize = isset($fileOptions['imageSize']) ? $fileOptions['imageSize'] : 'square_thumbnail'; $image = file_image($imageSize, $fileOptions['imgAttributes'], $file); $html = exhibit_builder_link_to_exhibit_item($image, $linkProps, $item); } else { $html = file_markup($file, $fileOptions, null); } } else { if ($item) { $html = exhibit_builder_link_to_exhibit_item(null, $linkProps, $item); } } return apply_filters('exhibit_attachment_markup', $html, compact('attachment', 'fileOptions', 'linkProps', 'forceImage')); }
?> <?php } ?> <?php echo file_markup($file, array('imageSize' => $size, 'linkToFile' => false, 'imgAttributes' => array('class' => "sp-image", 'alt' => "{$altText}", 'title' => metadata($item, array("Dublin Core", "Title"))))); ?> <?php if ($attachment['caption']) { ?> <div class="sp-caption" > <span class="caption-title"><?php echo exhibit_builder_link_to_exhibit_item($description, array(), $item); ?> </span> <?php echo $attachment['caption']; ?> </div> <?php } ?> <?php ?> <?php// echo file_markup($file, array('imageSize'=>'thumbnail','linkToFile'=>false, 'imgAttributes'=>array('alt' => "$altText", 'class' => 'sp-thumbnail', 'title' => metadata($item, array("Dublin Core", "Title"))))); ?>
<?php $divId = "geolocation_map_{$index}"; $center = array('latitude' => (double) get_option('geolocation_default_latitude'), 'longitude' => (double) get_option('geolocation_default_longitude'), 'zoomLevel' => (int) get_option('geolocation_default_zoom_level')); $locationTable = get_db()->getTable('Location'); $locations = array(); foreach ($attachments as $attachment) { $item = $attachment->getItem(); $file = $attachment->getFile(); $location = $locationTable->findLocationByItem($item, true); if ($location) { $titleLink = exhibit_builder_link_to_exhibit_item(null, array(), $item); // Manually print just the caption as body when there's no file to avoid // double-printing the title link. if ($file) { $body = $this->exhibitAttachment($attachment, array(), array(), true); } else { $body = $this->exhibitAttachmentCaption($attachment); } $html = '<div class="geolocation_balloon">' . '<div class="geolocation_balloon_title">' . $titleLink . '</div>' . $body . '</div>'; $locations[] = array('lat' => $location->latitude, 'lng' => $location->longitude, 'html' => $html); } } ?> <script type="text/javascript"> google.maps.event.addDomListener(window, 'load', function () { var geolocation_map = new OmekaMap( <?php echo json_encode($divId); ?> ,