• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP file_markup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中file_markup函数的典型用法代码示例。如果您正苦于以下问题:PHP file_markup函数的具体用法?PHP file_markup怎么用?PHP file_markup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了file_markup函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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'));
 }
开发者ID:fitnycdigitalinitiatives,项目名称:plugin-ExhibitBuilder,代码行数:41,代码来源:ExhibitAttachment.php


示例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'));
 }
开发者ID:kalbers,项目名称:SliderExhibitLayout,代码行数:35,代码来源:SliderExhibitLayoutPlugin.php


示例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;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:7,代码来源:ItemRss2.php


示例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'));
 }
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:42,代码来源:ExhibitAttachmentLightboxBook.php


示例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>
开发者ID:pyscajor,项目名称:cornishmemory-omeka,代码行数:31,代码来源:show.php


示例6: metadata

$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));
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:edit.php


示例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;
 }
开发者ID:patrova,项目名称:OpenLayersZoom,代码行数:41,代码来源:OpenLayersZoomPlugin.php


示例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);
     }
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:37,代码来源:Shortcodes.php


示例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);
?>
 
开发者ID:ebellempire,项目名称:curatescape_gardens,代码行数:30,代码来源:show.php


示例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 
开发者ID:kalbers,项目名称:SliderExhibitLayout,代码行数:31,代码来源:layout.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('&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++;
        }
    }
}
开发者ID:ebellempire,项目名称:curatescape_gardens,代码行数:66,代码来源:custom.php


示例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>
开发者ID:AdrienneSerra,项目名称:Digitalsc,代码行数:31,代码来源:show.php


示例13: __

"><?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 {
开发者ID:HCDigitalScholarship,项目名称:tichadocs_scribe,代码行数:31,代码来源:transcribe.php


示例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'))), ' ';
                }
开发者ID:sclayton29,项目名称:concarousel,代码行数:31,代码来源:carousel.php


示例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;
?>
开发者ID:mhshaaban,项目名称:neatlight,代码行数:30,代码来源:item.php


示例16: files_for_item

/**
 * 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);
}
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:17,代码来源:globals.php


示例17: file_markup

            }
            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 
        }
开发者ID:libraryman,项目名称:guarani,代码行数:31,代码来源:item.php



注:本文中的file_markup函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP file_mime_type函数代码示例发布时间:2022-05-15
下一篇:
PHP file_load函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap