当前位置: 首页>>代码示例>>PHP>>正文


PHP Codes::render_embed方法代码示例

本文整理汇总了PHP中Codes::render_embed方法的典型用法代码示例。如果您正苦于以下问题:PHP Codes::render_embed方法的具体用法?PHP Codes::render_embed怎么用?PHP Codes::render_embed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Codes的用法示例。


在下文中一共展示了Codes::render_embed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

     $text = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">' . "\n" . '<html>' . "\n" . '<head>' . "\n" . '<title>' . $context['page_title'] . '</title>' . "\n";
     // load the full library
     $text .= '<script type="text/javascript" src="' . $context['url_to_root'] . $script . '"></script>' . "\n";
     // load javascript files from the skin directory -- e.g., Global Crossing js extensions, etc.
     if (isset($context['skin']) && ($pathnames = Safe::glob($context['path_to_root'] . $context['skin'] . '/*.js'))) {
         foreach ($pathnames as $name) {
             $text .= '<script type="text/javascript" src="' . $context['url_to_root'] . $context['skin'] . '/' . basename($name) . '"></script>' . "\n";
         }
     }
     // load skin style sheet
     // 		if(isset($context['skin']))
     // 			$text .= '<link rel="stylesheet" href="'.$context['url_to_root'].$context['skin'].'/'.str_replace('skins/', '', $context['skin']).'.css" type="text/css" media="all" />'."\n";
     // full screen
     $text .= '</head>' . "\n" . '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">' . "\n" . '<div id="live_flash">' . "\n";
     // render object full size
     $text .= Codes::render_embed($item['id'] . ', 100%, 90%');
     // add a link to close the window
     $text .= '</div>' . "\n" . '<p style="text-align: center; margin: 0.5em 0 1em 0;"><button type="button" onclick="self.close()">' . i18n::s('Close') . '</button></p>' . "\n";
     // page postamble
     $text .= '</body>' . "\n" . '</html>' . "\n";
     break;
 case 'wma':
     // we are returning a .wax
     $type = '.wax';
     $mime = 'audio/x-ms-wax';
     // where the file actually is
     $text = '<ASX VERSION="3.0">' . "\n" . '	<ENTRY>' . "\n" . '		<REF HREF="' . $target_href . '" />' . "\n" . '	</ENTRY>' . "\n" . '</ASX>';
     break;
 case 'wmv':
     // we are returning a .wvx
     $type = '.wvx';
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:stream.php

示例2: str_replace

 //
 $description = '';
 // offer audio streaming, where applicable
 if (Files::is_audio_stream($item['file_name'])) {
     // explain what streaming is about
     $description .= '<p>' . i18n::s('This file may be accessed on-demand.') . '</p>';
     // the label
     Skin::define_img('FILES_PLAY_IMG', 'files/play.gif');
     $label = FILES_PLAY_IMG . ' ' . i18n::s('Play') . ' ' . str_replace('_', ' ', $item['file_name']);
     // use a definition list to enable customization of the download box
     $context['text'] .= '<dl class="download">' . '<dt>' . Skin::build_link(Files::get_url($item['id'], 'stream', $item['file_name']), $label, 'basic', i18n::s('Start')) . '</dt>' . '<dd>' . $description . '</dd></dl><div class="bottom" >&nbsp;</div>' . "\n";
 }
 // offer video streaming, where applicable
 if (Files::is_video_stream($item['file_name'])) {
     // embed the player for streamed video files
     if (!($description = Codes::render_embed($item['id']))) {
         // explain what streaming is about
         $description .= '<p>' . i18n::s('This file may be accessed on-demand.') . '</p>';
     }
     // the label
     Skin::define_img('FILES_PLAY_IMG', 'files/play.gif');
     $label = FILES_PLAY_IMG . ' ' . i18n::s('Play') . ' ' . str_replace('_', ' ', $item['file_name']);
     // use a definition list to enable customization of the download box
     $context['text'] .= '<dl class="download">' . '<dt>' . Skin::build_link(Files::get_url($item['id'], 'stream', $item['file_name']), $label, 'basic', i18n::s('Start')) . '</dt>' . '<dd>' . $description . '</dd></dl><div class="bottom" >&nbsp;</div>' . "\n";
 }
 // view a GanttProject file interactively
 if (preg_match('/\\.gan$/i', $item['file_name'])) {
     // the label
     Skin::define_img('FILES_PLAY_IMG', 'files/play.gif');
     $label = FILES_PLAY_IMG . ' ' . sprintf(i18n::s('Browse %s'), str_replace('_', ' ', $item['file_name']));
     // use a definition list to enable customization of the download box
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:view.php


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