/**
  * 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'));
 }
 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'));
 }
예제 #3
0
 protected function buildDescription($item)
 {
     $description = all_element_texts($item);
     //Output HTML that would display all the files in whatever way is possible
     $description .= file_markup($item->Files);
     return $description;
 }
 /**
  * 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'));
 }
예제 #5
0
    $fileTitle = '';
}
$fileTitle = __('File #%s', metadata('file', 'id')) . $fileTitle;
echo head(array('title' => $fileTitle, 'bodyclass' => 'files show primary-secondary'));
?>

<div class="container single-item">
    <div class="content-block">
        <h1><?php 
echo $fileTitle;
?>
</h1>
        <div class="row">
            <div class="col-sm-5">
                <?php 
echo file_markup($file, array('imageSize' => 'original'));
?>
            </div>
            <div class="col-sm-7">
                <?php 
echo all_element_texts('file');
?>
                <div id="original-filename" class="element">
                    <h6><?php 
echo __('Original Filename');
?>
</h6>
                    <p class="element-text"><?php 
echo metadata('file', 'Original Filename');
?>
</p>
예제 #6
0
파일: edit.php 프로젝트: lchen01/STEdwards
$fileTitle = metadata('file', 'display title');
if ($fileTitle != '') {
    $fileTitle = ': &quot;' . $fileTitle . '&quot; ';
} else {
    $fileTitle = '';
}
$fileTitle = __('Edit File #%s', metadata('file', 'id')) . $fileTitle;
queue_js_file(array('vendor/tiny_mce/tiny_mce', 'elements', 'tabs'));
echo head(array('title' => $fileTitle, 'bodyclass' => 'files edit'));
include 'form-tabs.php';
echo flash();
?>
<form method="post" action="">
    <section class="seven columns alpha" id="edit-form">
        <?php 
echo file_markup($file);
?>
        <div id="file-metadata">
            <?php 
foreach ($tabs as $tabName => $tabContent) {
    ?>
            <?php 
    if (!empty($tabContent)) {
        ?>
                <div id="<?php 
        echo text_to_id(html_escape($tabName));
        ?>
-metadata">
                    <fieldset class="set">
                        <h2><?php 
        echo html_escape(__($tabName));
 /**
  * Adds the zoom options to the images attached to the record, it inserts a
  * "Zoom" tab in the admin->edit page
  *
  * @return array of tabs
  */
 public function filterAdminItemsFormTabs($tabs, $args)
 {
     $item = $args['item'];
     $useHtml = '<span>' . __('Only images files attached to the record can be zoomed.') . '</span>';
     $zoomList = '';
     $view = get_view();
     foreach ($item->Files as $file) {
         if (strpos($file->mime_type, 'image/') === 0) {
             // See if this image has been zoooomed yet.
             if ($view->openLayersZoom()->isZoomed($file)) {
                 $isChecked = '<input type="checkbox" checked="checked" name="open_layers_zoom_filename_' . $file->id . '" id="open_layers_zoom_filename_' . $file->id . '" value="' . $file->filename . '"/>' . __('This image is zoomed.') . '</label>';
                 $isChecked .= '<input type="hidden" name="open_layers_zoom_removed_hidden_' . $file->id . '" id="open_layers_zoom_removed_hidden_' . $file->id . '" value="' . $file->filename . '"/>';
                 $title = __('Click and Save Changes to make this image un zoom-able');
                 $style_color = "color:green";
             } else {
                 $isChecked = '<input type="checkbox" name="open_layers_zoom_filename_' . $file->id . '" id="open_layers_zoom_filename_' . $file->id . '" value="' . $file->filename . '"/>' . __('Zoom this image') . '</label>';
                 $title = __('Click and Save Changes to make this image zoom-able');
                 $style_color = "color:black";
             }
             $useHtml .= '
             <div style="float:left; margin:10px;">
                 <label title="' . $title . '" style="width:auto;' . $style_color . ';" for="zoomThis_' . $file->id . '">' . file_markup($file, array('imageSize' => 'thumbnail')) . $isChecked . '<br />
             </div>';
         }
     }
     $ttabs = array();
     foreach ($tabs as $key => $html) {
         if ($key == 'Tags') {
             $ttabs['Zoom'] = $useHtml;
         }
         $ttabs[$key] = $html;
     }
     $tabs = $ttabs;
     return $tabs;
 }
예제 #8
0
 /**
  * Shortcode for displaying a single file.
  *
  * @param array $args
  * @param Omeka_View $view
  * @return string
  */
 public static function shortcodeFile($args, $view)
 {
     $recordId = $args['id'];
     $props = array();
     if (isset($args['size'])) {
         $props['imageSize'] = $args['size'];
     }
     if (isset($args['link_file'])) {
         switch ($args['link_file']) {
             case 'true':
                 $props['linkToFile'] = true;
                 break;
             case 'false':
                 $props['linkToFile'] = false;
                 break;
             default:
                 $props['linkToFile'] = $args['link_file'];
         }
     }
     if (isset($args['width'])) {
         $props['width'] = $args['width'];
     }
     if (isset($args['height'])) {
         $props['height'] = $args['height'];
     }
     $file = get_record_by_id('File', $recordId);
     if ($file) {
         return file_markup($file, $props);
     }
 }
예제 #9
0
echo count($info) ? '<span id="file-header-info" class="story-meta byline">' . implode(" | ", $info) . '</span>' : null;
?>
	</header>

	<div id="item-primary" class="show">
		<hr>
		<?php 
$record = get_record_by_id('Item', $file->item_id);
$title = metadata($record, array('Dublin Core', 'Title'));
echo link_to_item('<i class="icon-chevron-left"></i> ' . __('This file appears in') . ': <em><strong>' . $title . '</strong></em>', array('class' => 'file-appears-in-item'), 'show', $record);
?>
 
		<hr>
		
		<?php 
echo file_markup($file, array('imageSize' => 'fullsize'));
?>
		
		<div id="key-file-metadata">
		<?php 
echo ($desc = metadata('file', array('Dublin Core', 'Description'))) ? '<span class="file-desc">' . $desc . '</span>' : null;
echo link_to_file_edit($file);
?>
	
		</div>	
		
		<hr>
		<?php 
echo link_to_item('<i class="icon-chevron-left"></i> ' . __('This file appears in') . ': <em><strong>' . $title . '</strong></em>', array('class' => 'file-appears-in-item'), 'show', $record);
?>
 
예제 #10
0
    $item = $attachment->getItem();
    $file = $attachment->getFile();
    ?>
                    <?php 
    if ($description = metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true))) {
        ?>
                        <?php 
        $altText = $description;
        ?>
                    <?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 
예제 #11
0
function mh_item_images($item, $index = 0)
{
    //===========================//
    ?>
	<script>
	// the fancybox caption minimize/expand button
	function hideText(){
		var link = jQuery('a.fancybox-hide-text');
		jQuery(".fancybox-title span").fadeToggle(function(){
            if (jQuery(this).is(":visible")) {
                 link.html('X');                
            } else {
                 link.html('&hellip;');                
            } 			
		});
	}
	// checkWidth.js sets 'big' and 'small' body classes
	// FancyBox is used only when the body class is 'big'
	jQuery(".fancybox").fancybox({
        beforeLoad: function() {
            this.title = jQuery(this.element).attr('data-caption');
        },
        beforeShow: function () {
            if (this.title) {
                // Add caption close button
                this.title += '<a class="fancybox-hide-text" onclick="hideText()">X</a> ';
            }
        },
	    helpers : {
	         title: {
	            type: 'over'
	        },
	         overlay : {
	         	locked : false
	         	}
	    }
	});
	</script>
	<?php 
    //========================//
    foreach (loop('files', $item->Files) as $file) {
        $img = array('image/jpeg', 'image/jpg', 'image/png', 'image/jpeg', 'image/gif');
        $mime = metadata($file, 'MIME Type');
        if (in_array($mime, $img)) {
            if ($index == 0) {
                echo '<h3><i class="icon-camera-retro"></i>Photos <span class="toggle instapaper_ignore">Show <i class="icon-chevron-right"></i></span></h3>';
            }
            $filelink = link_to($file, 'show', '<span class="view-file-link"> [View Additional File Details]</span>', array('class' => 'view-file-record', 'rel' => 'nofollow'));
            $photoDesc = metadata($file, array('Dublin Core', 'Description'));
            $photoTitle = metadata($file, array('Dublin Core', 'Title'));
            if ($photoTitle) {
                $photoCaption = $photoTitle . ($photoDesc ? ': ' . $photoDesc : '') . ' ';
                $photoCaption = '<span class="main">' . strip_tags($photoCaption) . '</span>' . $filelink;
            } else {
                $photoCaption = '<span class="main">Image ' . ($index + 1) . '</span>';
            }
            $html = '<div class="item-file-container">';
            $html .= file_markup($file, array('imageSize' => 'fullsize', 'linkAttributes' => array('data-caption' => $photoCaption, 'title' => $photoTitle, 'class' => 'fancybox', 'rel' => 'group'), 'imgAttributes' => array('alt' => $photoTitle)));
            $html .= $photoTitle ? '<h4 class="title image-title">' . $photoTitle . '</h4>' : '';
            $html .= $photoDesc ? '<p class="description image-description">' . $photoDesc . ' ' . link_to($file, 'show', '<span class="view-file-link"> [View Additional File Details]</span>', array('class' => 'view-file-record', 'rel' => 'nofollow')) . '</p>' : '';
            $html .= '</div>';
            echo $html;
            $index++;
        }
    }
}
예제 #12
0
<?php 
$item_id = metadata('file', 'item_id');
?>
		<?php 
$item = get_record_by_id('item', $item_id);
?>
		<?php 
set_current_record('item', $item);
?>
<h2>This file is from <?php 
echo link_to_item(metadata('item', array('Dublin Core', 'Title')), array('class' => 'permalink'));
?>
</h2>
<div class="file-left-panel">
    <?php 
echo file_markup($file, array('imageSize' => 'thumbnail'));
?>
</div>
 <?php 
if (metadata($file, array('PDF Text', 'Text'))) {
    ?>
<div class="file-right-panel">
       <div class="element">
 		<h3>Transcription</h3>
		<div class="element-text">
			<?php 
    echo metadata($file, array('PDF Text', 'Text'));
    ?>
 
    		</div>
   </div>
"><?php 
    echo __('next page');
    ?>
 &#187;</a><?php 
} else {
    echo __('next page');
    ?>
 &#187;<?php 
}
?>
 | <a href="#" id="scripto-page-show"></a>
</p>

<!-- document viewer -->
<?php 
echo file_markup($this->file, array('imageSize' => get_option('scripto_file_source')));
?>

<!-- pagination -->
<p>
<?php 
if (isset($this->paginationUrls['previous'])) {
    ?>
<a href="<?php 
    echo html_escape($this->paginationUrls['previous']);
    ?>
">&#171; <?php 
    echo __('previous page');
    ?>
</a><?php 
} else {
예제 #14
0
	</div>		

	<div class="carousel-stage" style="max-width:100%; max-height:100%; width:<?php 
echo $tempwidth;
?>
;" >
		<?php 
foreach ($items as $item) {
    set_current_record('Item', $item);
    if (metadata($item, 'has files')) {
        $itemFiles = $item->Files;
        foreach ($itemFiles as $itemfile) {
            ?>
				<div>
					<?php 
            echo file_markup($itemfile, array('imageSize' => 'fullsize', 'linkToFile' => true, 'imgAttributes' => array('max-height' => '100%', 'max-width' => '100%', 'width' => '100%')));
            ?>
					<?php 
            if ($captionPosition != 'none') {
                ?>
						
					<p class="desc caption-<?php 
                echo $captionPosition;
                ?>
">			
						<?php 
                if (metadata($itemfile, array('Dublin Core', 'Title'))) {
                    echo metadata($itemfile, array('Dublin Core', 'Title'));
                } else {
                    echo html_escape(metadata($item, array('Dublin Core', 'Title'))), ' ';
                }
예제 #15
0
  <div class="state">
    <?php 
echo metadata('item', array('Item Type Metadata', 'State'));
?>
  </div>

</div>

<div class="content">

  <hr />

  <div class="picture">
    <?php 
echo file_markup($item->Files, array('imageSize' => 'fullsize', 'linkToFile' => false));
?>
  </div>

  <div class="text source">

    <?php 
$source = metadata('item', array('Dublin Core', 'Source'));
?>

    <span>From</span>

    <a
      href="<?php 
echo $source;
?>
예제 #16
0
/**
 * Get HTML for all files assigned to an item.
 *
 * @package Omeka\Function\View\Item
 * @uses file_markup()
 * @param array $options
 * @param array $wrapperAttributes
 * @param Item|null $item Check for this specific item record (current item if null).
 * @return string HTML
 */
function files_for_item($options = array(), $wrapperAttributes = array('class' => 'item-file'), $item = null)
{
    if (!$item) {
        $item = get_current_record('item');
    }
    return file_markup($item->Files, $options, $wrapperAttributes);
}
예제 #17
0
파일: item.php 프로젝트: libraryman/guarani
            }
            if (isset($dublin_files['Dublin Core']['Description'])) {
                $label_pic = $label_pic . "<p><span class='lb-caption-bold'>Descrição: </span><span class='lb-content'>" . $dublin_files['Dublin Core']['Description'][0] . "</span></p>";
            }
            if (isset($dublin_files['Dublin Core']['Creator'])) {
                $label_pic = $label_pic . "<p><span class='lb-caption-bold'>Criador: </span><span class='lb-content'>" . $dublin_files['Dublin Core']['Creator'][0] . "</span></p>";
            }
            if (isset($dublin_files['Dublin Core']['Date'])) {
                $label_pic = $label_pic . "<p><span class='lb-caption-bold'>Data: </span><span class='lb-content'>" . $dublin_files['Dublin Core']['Date'][0] . "</span></p>";
            }
            if (isset($dublin_files['Dublin Core']['Rights'])) {
                $label_pic = $label_pic . "<p><span class='lb-caption-bold'>Direitos: </span><span class='lb-content'>" . $dublin_files['Dublin Core']['Rights'][0] . "</span></p>";
            }
            echo file_markup(get_current_record('file'), array('linkAttributes' => array('data-lightbox' => 'setimages', 'title' => $label_pic)));
        } else {
            echo file_markup(get_current_record('file'));
        }
        ?>
			<!-- Display the file's metadata -->
			<div class="file-metadata">
				<?php 
        /*verificando se possui os campos*/
        /*depois verificar quais campos serão exibidos*/
        if (isset($dublin_files['Dublin Core']['Title'])) {
            ?>
				<h4> <?php 
            echo $dublin_files['Dublin Core']['Title'][0];
            ?>
 </h4>
			<?php 
        }