foreach (loop('files', $item->Files) as $index => $file) { ?> <div id="left-panel"> <div class="note">Click on the image to magnify, scroll to adjust the zoom</div> <div class="item-file"> <img class="zoom-file" src="<?php echo file_display_url($file, 'thumbnail'); ?> " data-zoom-image="<?php echo file_display_url($file, 'original'); ?> "/> </div> <h3><?php echo link_to_file_show(array('class' => 'show', 'target' => __('_blank'), 'title' => __('View Page Metadata')), 'View Page Details'); ?> </h3> </div> <div id="right-panel"> <div class="element"> <h3>Transcription</h3> <div class="element-text"> <?php echo metadata($file, array('PDF Text', 'Text')); ?> </div> </div> </div> <?php
/** * Add a link for the file based on the given set of options. * * If the 'linkToMetadata' option is true, then link to the file * metadata page (files/show). If 'linkToFile' is true, * link to the original file, and if 'linkToFile' is a string, try * to link to that specific derivative. Otherwise just return the * $html without wrapping in a link. * * The attributes for the link will be based off the 'linkAttributes' * option, which should be an array. * * If $html is null, it defaults to original filename of the file. * * @param File $file * @param array $options * @param string $html * @return string */ protected function _linkToFile($file, $options, $html = null) { if ($html === null) { $fileTitle = strip_formatting(metadata($file, array('Dublin Core', 'Title'))); $html = $fileTitle ? $fileTitle : metadata($file, 'Original Filename'); } if ($options['linkToMetadata']) { $html = link_to_file_show((array) $options['linkAttributes'], $html, $file); } else { if ($linkToFile = $options['linkToFile']) { // If you've manually specified a derivative type to link // to, and this file actually has derivatives, we'll use // that, otherwise, the link is to the "original" file. if (is_string($linkToFile) && $file->hasThumbnail()) { $derivative = $linkToFile; } else { $derivative = 'original'; } // Wrap in a link that will download the file directly. $defaultLinkAttributes = array('class' => 'download-file', 'href' => $file->getWebPath($derivative)); $linkAttributes = array_key_exists('linkAttributes', $options) ? $options['linkAttributes'] : array(); $linkAttributes = array_merge($defaultLinkAttributes, $linkAttributes); $html = '<a ' . tag_attributes($linkAttributes) . '>' . $html . '</a>'; } } return $html; }
<p><?php echo __('There are no files for this item yet.'); ?> <?php echo link_to_item(__('Add a File'), array(), 'edit'); ?> .</p> <?php } else { ?> <ul> <?php foreach (loop('files', $this->item->Files) as $file) { ?> <li><?php echo link_to_file_show(array('class' => 'show', 'title' => __('View File Metadata'))); ?> </li> <?php } ?> </ul> <?php } ?> </div> </div> <div class="panel"> <h4><?php echo __('Output Formats');