本文整理汇总了PHP中file_markup函数的典型用法代码示例。如果您正苦于以下问题:PHP file_markup函数的具体用法?PHP file_markup怎么用?PHP file_markup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了file_markup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exhibitAttachment
/**
* 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'));
}
示例2: sliderExhibitAttachment
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: buildDescription
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;
}
示例4: exhibitAttachmentLightboxBook
/**
* 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: __
$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: metadata
$fileTitle = metadata('file', 'display title');
if ($fileTitle != '') {
$fileTitle = ': "' . $fileTitle . '" ';
} 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));
示例7: filterAdminItemsFormTabs
/**
* 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: shortcodeFile
/**
* 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: count
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: file_markup
$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: mh_item_images
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('…');
}
});
}
// 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: metadata
<?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>
示例13: __
"><?php
echo __('next page');
?>
»</a><?php
} else {
echo __('next page');
?>
»<?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']);
?>
">« <?php
echo __('previous page');
?>
</a><?php
} else {
示例14: foreach
</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: metadata
<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;
?>