本文整理汇总了PHP中caHTMLImage函数的典型用法代码示例。如果您正苦于以下问题:PHP caHTMLImage函数的具体用法?PHP caHTMLImage怎么用?PHP caHTMLImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caHTMLImage函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: caGetThemeGraphic
/**
* Generate HTML <img> tag for graphic in current theme; if graphic is not available the graphic in the default theme will be returned.
*
* @param RequestHTTP $po_request
* @param string $ps_file_path
* @param array $pa_attributes
* @param array $pa_options
* @return string
*/
function caGetThemeGraphic($po_request, $ps_file_path, $pa_attributes = null, $pa_options = null)
{
$vs_base_url_path = $po_request->getThemeUrlPath();
$vs_base_path = $po_request->getThemeDirectoryPath();
$vs_file_path = '/assets/pawtucket/graphics/' . $ps_file_path;
if (!file_exists($vs_base_path . $vs_file_path)) {
$vs_base_url_path = $po_request->getDefaultThemeUrlPath();
}
$vs_html = caHTMLImage($vs_base_url_path . $vs_file_path, $pa_attributes, $pa_options);
return $vs_html;
}
示例2: htmlTag
//.........这里部分代码省略.........
<!-- End VideoJS -->
<?php
}
?>
<?php
return ob_get_clean();
break;
# ------------------------------------------------
# ------------------------------------------------
case 'video/ogg':
$vs_id = $pa_options["id"] ? $pa_options["id"] : "mp4_player";
$vs_poster_frame_url = $pa_options["poster_frame_url"];
$vn_width = $pa_options["viewer_width"] ? $pa_options["viewer_width"] : $pa_properties["width"];
$vn_height = $pa_options["viewer_height"] ? $pa_options["viewer_height"] : $pa_properties["height"];
return "<video id='{$vs_id}' src='{$ps_url}' width='{$vn_width}' height='{$vn_height}' controls='1'></video>";
break;
# ------------------------------------------------
# ------------------------------------------------
case 'video/x-matroska':
$vs_id = $pa_options["id"] ? $pa_options["id"] : "mp4_player";
$vs_poster_frame_url = $pa_options["poster_frame_url"];
$vn_width = $pa_options["viewer_width"] ? $pa_options["viewer_width"] : $pa_properties["width"];
$vn_height = $pa_options["viewer_height"] ? $pa_options["viewer_height"] : $pa_properties["height"];
return "<video id='{$vs_id}' src='{$ps_url}' width='{$vn_width}' height='{$vn_height}' controls='1'></video>";
break;
# ------------------------------------------------
# ------------------------------------------------
case 'application/x-shockwave-flash':
$vs_name = $pa_options["name"] ? $pa_options["name"] : "swfplayer";
#
# We allow forcing of width and height for Flash media
#
# If you set a width or height, the Flash media will be scaled so it is as large as it
# can be without exceeding either dimension
if (isset($pa_options["width"]) || isset($pa_options["height"])) {
$vn_ratio = 1;
$vn_w_ratio = 0;
if ($pa_options["width"] > 0) {
$vn_ratio = $vn_w_ratio = $pa_options["width"] / $pa_properties["width"];
}
if ($pa_options["height"] > 0) {
$vn_h_ratio = $pa_options["height"] / $pa_properties["height"];
if ($vn_h_ratio < $vn_w_ratio || !$vn_w_ratio) {
$vn_ratio = $vn_h_ratio;
}
}
$pa_options["width"] = intval($pa_properties["width"] * $vn_ratio);
$pa_options["height"] = intval($pa_properties["height"] * $vn_ratio);
}
ob_start();
if ($pa_options["text_only"]) {
return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "View Flash") . "</a>";
} else {
?>
<div id="<?php
print $vs_name;
?>
">
<h1><?php
print _t('You must have the Flash Plug-in version 9.0.124 or better installed to play video and audio in CollectiveAccess');
?>
</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<script type="text/javascript">
jQuery(document).ready(function() { swfobject.embedSWF("<?php
print $ps_url;
?>
", "<?php
print $vs_name;
?>
", "<?php
print isset($pa_options["width"]) ? $pa_options["width"] : $pa_properties["width"];
?>
", "<?php
print isset($pa_options["height"]) ? $pa_options["height"] : $pa_properties["height"];
?>
", "9.0.124", "swf/expressInstall.swf", {}, {'allowscriptaccess': 'always', 'allowfullscreen' : 'true', 'allowNetworking' : 'all'}); });
</script>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case 'image/jpeg':
case 'image/gif':
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
break;
# ------------------------------------------------
}
}
示例3: caHTMLImage
JavascriptLoadManager::register('tableview');
$t_display = $this->getVar('t_display');
$va_display_list = $this->getVar('display_list');
$vo_result = $this->getVar('result');
$vn_num_hits = $vo_result->numHits();
$vs_subject_table = $vo_result->tableName();
$va_columns = $this->getVar('columns');
$va_column_headers = $this->getVar('columnHeaders');
$va_row_headers = $this->getVar('rowHeaders');
$va_initial_data = $this->getVar('initialData');
?>
<div id="caResultsEditorWrapper">
<div id="scrollingResults" class="caResultsEditorContainer">
<div id="caResultsEditorGrid" class="caResultsEditorContent"></div>
<a href="#" onclick="caResultsEditor.caResultsEditorOpenFullScreen();" class="caResultsEditorToggleFullScreenButton"><?php
print caHTMLImage($this->request->getThemeUrlPath() . "/graphics/buttons/fullscreen.png", array('width' => 14, 'height' => 14, 'alt' => _t('Full screen')));
?>
</a>
<div id="caResultsEditorStatusDisplay" class="caResultsEditorStatusDisplay"> </div>
<div class="caResultsEditorControls" id="caResultsEditorControls">
<div class='info'><?php
print $vn_num_hits . ' ' . $this->request->datamodel->getTableProperty($vs_subject_table, $vn_num_hits == 1 ? 'NAME_SINGULAR' : 'NAME_PLURAL');
?>
</div>
<div class='close'><a href="#" onclick="caResultsEditorPanel.hidePanel(); return false;" title="close"> </a></div>
<div id="caResultsEditorFullScreenStatus" class="caResultsEditorStatusDisplay"> </div>
</div>
</div><!--end scrollingResults -->
</div>
示例4: htmlTag
public function htmlTag($ps_url, $pa_properties, $pa_options = null, $pa_volume_info = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
}
示例5: caNavIcon
/**
* @param array $pa_options Options are:
* graphicsPath =
*/
function caNavIcon($po_request, $pn_type, $pa_attributes = null, $pa_options = null)
{
if (!is_array($pa_attributes)) {
$pa_attributes = array();
}
$vs_graphics_path = isset($pa_options['graphicsPath']) && $pa_options['graphicsPath'] ? $pa_options['graphicsPath'] : $po_request->getThemeUrlPath() . "/graphics";
$vs_button = '';
if (is_array($va_img = _caNavTypeToImgName($pn_type))) {
if (!isset($pa_attributes['alt'])) {
$pa_attributes['alt'] = $va_img['filename'];
}
if (!isset($pa_attributes['border'])) {
$pa_attributes['border'] = '0';
}
$vs_button = caHTMLImage("{$vs_graphics_path}/buttons/" . $va_img['filename'] . ".png", $pa_attributes);
}
return $vs_button;
}
示例6: htmlTag
public function htmlTag($ps_url, $pa_properties, $pa_options = null, $pa_volume_info = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
foreach (array('name', 'show_controls', 'url', 'text_only', 'viewer_width', 'viewer_height', 'id', 'poster_frame_url', 'viewer_parameters', 'viewer_base_url', 'width', 'height', 'vspace', 'hspace', 'alt', 'title', 'usemap', 'align', 'border', 'class', 'style') as $vs_k) {
if (!isset($pa_options[$vs_k])) {
$pa_options[$vs_k] = null;
}
}
switch ($pa_properties["mimetype"]) {
# ------------------------------------------------
case 'x-world/x-qtvr':
$vs_name = $pa_options["name"] ? $pa_options["name"] : "qplayer";
$vn_width = $pa_options["viewer_width"] ? $pa_options["viewer_width"] : $pa_properties["width"];
$vn_height = $pa_options["viewer_height"] ? $pa_options["viewer_height"] : $pa_properties["height"];
ob_start();
if ($pa_options["text_only"]) {
return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "View QuickTime") . "</a>";
} else {
?>
<table>
<tr>
<td>
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="<?php
print $vn_width;
?>
" height="<?php
print $vn_height + 16;
?>
"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" VALUE="<?php
print $ps_url;
?>
">
<param name="autoplay" VALUE="true">
<param name="controller" VALUE="true">
<embed src="<?php
print $ps_url;
?>
"
name="id_<?php
print $vs_name;
?>
"
width="<?php
print $vn_width;
?>
" height="<?php
print $vn_height + 16;
?>
"
autoplay="true" controller="true" kioskmode="true"
pluginspage="http://www.apple.com/quicktime/download/"
type="video/quicktime"
>
</embed>
</object>
</td>
</tr>
</table>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case 'image/jpeg':
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
break;
# ------------------------------------------------
}
}
示例7: htmlTag
//.........这里部分代码省略.........
# ------------------------------------------------
# ------------------------------------------------
case 'audio/x-aiff':
$name = $pa_options["name"] ? $pa_options["name"] : "mp3player";
if ($pa_options["text_only"]) {
return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "Listen to AIFF") . "</a>";
} else {
ob_start();
$vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400;
$vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95;
?>
<div style="width: {$vn_width}px; height: {$vn_height}px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<embed width="<?php
print $pa_properties["width"];
?>
" height="<?php
print $pa_properties["height"] + 16;
?>
"
src="<?php
print $ps_url;
?>
" type="audio/x-aiff">
</td>
</tr>
</table>
</div>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case "video/x-flv":
$vs_name = $pa_options["name"] ? $pa_options["name"] : "flv_player";
$vs_id = $pa_options["id"] ? $pa_options["id"] : "flv_player";
$vs_flash_vars = $pa_options["viewer_parameters"];
$viewer_base_url = $pa_options["viewer_base_url"];
$vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400;
$vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95;
$vs_data_url = $pa_options["data_url"];
$vs_poster_frame_url = $pa_options["poster_frame_url"];
ob_start();
?>
<div id="<?php
print $vs_id;
?>
" style="width: {$vn_width}px; height: {$vn_height}px;">
<h1><?php
print _t('You must have the Flash Plug-in version 9.0.124 or better installed to play video and audio in CollectiveAccess');
?>
</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<script type="text/javascript">
jQuery(document).ready(function() { swfobject.embedSWF("<?php
print $viewer_base_url;
?>
/viewers/apps/niftyplayer.swf ", "<?php
print $vs_id;
?>
", "<?php
print $vn_width;
?>
", "<?php
print $vn_height;
?>
", "9.0.124", "swf/expressInstall.swf", {'source' : '<?php
print $ps_url;
?>
', 'dataUrl':'<?php
print $vs_data_url;
?>
', 'posterFrameUrl': '<?php
print $vs_poster_frame_url;
?>
'}, {'allowscriptaccess': 'always', 'allowfullscreen' : 'true', 'allowNetworking' : 'all'}); });
</script>
<?php
return ob_get_clean();
break;
# ------------------------------------------------
# ------------------------------------------------
case 'image/jpeg':
case 'image/png':
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
break;
# ------------------------------------------------
}
}
示例8: caGetDefaultMediaIconTag
/**
* Attempt to detect faces in image files (TIFF, JPEG, PNG) using OpenCV and the php-facedetect module
* If php-facedetect and/or OpenCV are not installed then function will return an empty array
*
* @param string $ps_type
* @param int $pn_width Width of media
* @param int $pn_height Height of media
* @param array $pa_options
*
* @return string Media ICON <img> tag
*/
function caGetDefaultMediaIconTag($ps_type, $pn_width, $pn_height, $pa_options = null)
{
if (is_array($va_selected_size = caGetMediaIconForSize($ps_type, $pn_width, $pn_height, $pa_options))) {
$o_config = Configuration::load();
$o_icon_config = Configuration::load($o_config->get('default_media_icons'));
$va_icons = $o_icon_config->getAssoc($ps_type);
return caHTMLImage($o_icon_config->get('icon_folder_url') . '/' . $va_icons[$va_selected_size['size']], array('width' => $va_selected_size['width'], 'height' => $va_selected_size['height']));
}
return null;
}
示例9: htmlTag
public function htmlTag($ps_url, $pa_properties, $pa_options = null, $pa_volume_info = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
foreach (array('name', 'url', 'viewer_width', 'viewer_height', 'idname', 'viewer_base_url', 'width', 'height', 'vspace', 'hspace', 'alt', 'title', 'usemap', 'align', 'border', 'class', 'style') as $vs_k) {
if (!isset($pa_options[$vs_k])) {
$pa_options[$vs_k] = null;
}
}
if (preg_match("/\\.xml\$/", $ps_url)) {
if (!$this->opo_config) {
$this->opo_config = Configuration::load();
}
$o_xml_config = Configuration::load($this->opo_config->get('xml_config'));
$vs_xml_resource_path = $o_xml_config->get('xml_resource_directory');
if (file_exists($vs_xml_resource_path . '/xsl/styl.xslt')) {
$o_xsl = new DOMDocument();
$o_xsl->load($vs_xml_resource_path . '/xsl/styl.xslt');
$o_xml = new DOMDocument();
$o_xml->load($ps_url);
$o_xsl_proc = new XSLTProcessor();
$o_xsl_proc->importStylesheet($o_xsl);
return $o_xsl_proc->transformToXML($o_xml);
} else {
return "<a href='{$ps_url}'>" . _t('View XML file') . "</a>";
}
} else {
if (preg_match("/\\.pdf\$/", $ps_url)) {
if ($pa_options['embed']) {
$vn_viewer_width = intval($pa_options['viewer_width']);
if ($vn_viewer_width < 100) {
$vn_viewer_width = 400;
}
$vn_viewer_height = intval($pa_options['viewer_height']);
if ($vn_viewer_height < 100) {
$vn_viewer_height = 400;
}
return "<object data='{$ps_url}' type='application/pdf' width='{$vn_viewer_width}' height='{$vn_viewer_height}'><p><a href='{$ps_url}' target='_pdf'>" . _t("View PDF file") . "</a></p></object>";
} else {
return "<a href='{$ps_url}' target='_pdf'>" . _t("View PDF file") . "</a>";
}
} else {
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
}
}
}
示例10: htmlTag
public function htmlTag($ps_url, $pa_properties, $pa_options = null, $pa_volume_info = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
foreach (array('name', 'url', 'viewer_width', 'viewer_height', 'idname', 'viewer_base_url', 'width', 'height', 'vspace', 'hspace', 'alt', 'title', 'usemap', 'align', 'border', 'class', 'style', 'embed') as $vs_k) {
if (!isset($pa_options[$vs_k])) {
$pa_options[$vs_k] = null;
}
}
$vn_viewer_width = intval($pa_options['viewer_width']);
if ($vn_viewer_width < 100) {
$vn_viewer_width = 400;
}
$vn_viewer_height = intval($pa_options['viewer_height']);
if ($vn_viewer_height < 100) {
$vn_viewer_height = 400;
}
if (!($vs_id = isset($pa_options['id']) ? $pa_options['id'] : $pa_options['name'])) {
$vs_id = '_pdf';
}
if (preg_match("/\\.pdf\$/", $ps_url)) {
if ($vs_poster_frame_url = $pa_options["poster_frame_url"]) {
$vs_poster_frame = "<img src='{$vs_poster_frame_url}'/ alt='" . _t("Click to download document") . " title='" . _t("Click to download document") . "''>";
} else {
$vs_poster_frame = _t("View PDF document");
}
$vs_buf = "<script type='text/javascript'>jQuery(document).ready(function() {\nnew PDFObject({\n\turl: '{$ps_url}',\n\tid: '{$vs_id}',\n\twidth: '{$vn_viewer_width}px',\n\theight: '{$vn_viewer_height}px',\n}).embed('{$vs_id}_div');\n});</script>\n<div id='{$vs_id}_div'><a href='{$ps_url}' target='_pdf'>" . $vs_poster_frame . "</a></div>\n";
return $vs_buf;
} else {
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
}
}
示例11: htmlTag
//.........这里部分代码省略.........
?>
" height="<?php
print $vn_height + 16;
?>
"
src="<?php
print $ps_url;
?>
" type="audio/mp4">
</td>
</tr>
</table>
</div>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case 'audio/x-wav':
$name = $pa_options["name"] ? $pa_options["name"] : "mp3player";
if ($pa_options["text_only"]) {
return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "Listen to WAV") . "</a>";
} else {
ob_start();
$vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400;
$vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95;
?>
<div style="width: {$vn_width}px; height: {$vn_height}px;">
<table>
<tr>
<td>
<embed width="<?php
print $pa_properties["width"];
?>
" height="<?php
print $pa_properties["height"] + 16;
?>
"
src="<?php
print $ps_url;
?>
" type="audio/x-wav">
</td>
</tr>
</table>
</div>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case 'audio/x-aiff':
$name = $pa_options["name"] ? $pa_options["name"] : "mp3player";
if ($pa_options["text_only"]) {
return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "Listen to AIFF") . "</a>";
} else {
ob_start();
$vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400;
$vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95;
?>
<div style="width: {$vn_width}px; height: {$vn_height}px;">
<table>
<tr>
<td>
<embed width="<?php
print $pa_properties["width"];
?>
" height="<?php
print $pa_properties["height"] + 16;
?>
"
src="<?php
print $ps_url;
?>
" type="audio/x-aiff">
</td>
</tr>
</table>
</div>
<?php
return ob_get_clean();
}
break;
# ------------------------------------------------
# ------------------------------------------------
case 'image/jpeg':
case 'image/png':
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!is_array($pa_properties)) {
$pa_properties = array();
}
return caHTMLImage($ps_url, array_merge($pa_options, $pa_properties));
break;
# ------------------------------------------------
}
}
示例12: array
$va_dimensions_display = array();
foreach ($va_dimensions as $id => $va_dimension) {
$va_dimensions_display[] = $va_dimension["display_dimensions"];
}
print join("<br/>", $va_dimensions_display) . "<br/>";
}
if ($t_object->get("ca_objects.base")) {
print $t_object->get("ca_objects.base") . "<br/>";
}
if ($t_object->get("ca_objects.num_of_elements")) {
print $t_object->get("ca_objects.num_of_elements") . "<br/>";
}
if ($vs_inscription = $t_object->get("ca_objects.inscriptions")) {
// replace symbol codes with graphics
$vs_circle = caHTMLImage($this->request->getThemeUrlPath(true) . '/graphics/symbols/bisected_circle_24_gray.png', array('width' => 12, 'height' => 12, 'alt' => 'circle line'));
$vs_hiragana_no = caHTMLImage($this->request->getThemeUrlPath(true) . '/graphics/symbols/hiragana_no_24_gray.png', array('width' => 13, 'height' => 12, 'alt' => 'Hiragana no'));
$vs_inscription = preg_replace('!\\[c\\]!i', $vs_circle, $vs_inscription);
$vs_inscription = preg_replace('!\\[circle/line\\]!i', $vs_circle, $vs_inscription);
$vs_inscription = preg_replace('!\\[no\\]!i', $vs_hiragana_no, $vs_inscription);
$vs_inscription = preg_replace('!\\[Hiragana no\\]!i', $vs_hiragana_no, $vs_inscription);
print $vs_inscription . "<br/>";
}
print "</div><!-- end unit -->";
$va_entities = $t_object->get("ca_entities", array("exclude_relationship_types" => array('sitter'), "returnAsArray" => 1, 'checkAccess' => $va_access_values));
if ($t_object->get("ca_objects.description") || $t_object->get("ca_objects.edition") || sizeof($va_entities) > 0) {
print "<div class='unit'>";
if ($t_object->get("ca_objects.description")) {
print $t_object->get("ca_objects.description", array('convertLineBreaks' => true)) . "<br/>";
}
if ($t_object->get("ca_objects.edition")) {
print $t_object->get("ca_objects.edition") . "<br/>";