/** * 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; }
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 'audio/x-realaudio': $vs_name = $pa_options["name"] ? $pa_options["name"] : "prm"; $vb_show_controls = isset($pa_options["show_controls"]) && $pa_options["show_controls"] ? 1 : 0; if ($pa_options["text_only"]) { return "<a href='" . (isset($pa_options["url"]) ? $pa_options["url"] : $ps_url) . "'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "View Realmedia") . "</a>"; } else { ob_start(); ?> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <object id="<?php print $vs_name; ?> " width="<?php print $pa_properties["width"]; ?> " height="<?php print $pa_properties["height"]; ?> " classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"> <param name="controls" value="ImageWindow"> <?php if ($vb_show_controls) { ?> <param name="console" value="<?php print $vs_name; ?> _controls"> <?php } ?> <param name="autostart" value="true"> <param name="type" value="audio/x-pn-realaudio-plugin"> <param name="autogotourl" value="false"> <param name="src" value="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> "> <embed name="<?php print $vs_name; ?> " src="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> " width="<?php print $pa_properties["width"]; ?> " height="<?php print $pa_properties["height"]; ?> " controls="ImageWindow" nojava="false" showdisplay="0" showstatusbar="1" autostart="true" type="audio/x-pn-realaudio-plugin"> </embed> </object> </td> </tr> <?php if ($vb_show_controls) { ?> <tr> <td> <object id="<?php print $vs_name; ?> _controls" width="<?php print $pa_properties["width"]; ?> " height="32" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"> <param name="controls" value="ControlPanel"> <param name="type" value="audio/x-pn-realaudio-plugin"> <param name="src" value="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> "> <embed name="id_<?php print $vs_name; ?> _controls" src="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> " width="<?php print $pa_properties["width"]; ?> " height="32" console="Clip1" controls="ControlPanel" type="audio/x-pn-realaudio-plugin"> </embed> </object> </td> </tr> <?php } ?> </table> <?php return ob_get_clean(); } break; # ------------------------------------------------ # ------------------------------------------------ case 'video/x-ms-asf': case 'video/x-ms-wmv': $vs_name = $pa_options["name"] ? $pa_options["name"] : "pwmv"; $vb_show_controls = isset($pa_options["show_controls"]) && $pa_options["show_controls"] ? "1" : "0"; ob_start(); if (isset($pa_options["text_only"]) && $pa_options["text_only"]) { return "<a href='" . (isset($pa_options["url"]) ? $pa_options["url"] : $ps_url) . "'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "View WindowsMedia") . "</a>"; } else { ?> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <object id="<?php print $vs_name; ?> " standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="<?php print $pa_properties["width"]; ?> " height="<?php print $pa_properties["height"] + ($vb_show_controls == 'true' ? 45 : 0); ?> " codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <param name="ShowControls" value="<?php print $vb_show_controls; ?> "> <param name="ShowAudioControls" value="<?php print $vb_show_controls; ?> "> <param name="ShowPositionControls" value="<?php print $vb_show_controls; ?> "> <param name="ShowTracker" value="<?php print $vb_show_controls; ?> "> <param name="ShowStatusBar" value="<?php print $vb_show_controls; ?> "> <param name="ShowDisplay" value="<?php print $vb_show_controls; ?> "> <param name="AnimationatStart" value="0"> <param name="AutoStart" value="1"> <param name="FileName" value="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> "> <param name="AllowChangeDisplaySize" value="1"> <param name="DisplaySize" value="0"> <embed src="<?php print isset($pa_options["url"]) ? $pa_options["url"] : $ps_url; ?> " name="<?php print $vs_name; ?> " id="<?php print $vs_name; ?> " width="<?php print $pa_properties["width"]; ?> " height="<?php print $pa_properties["height"] + ($vb_show_controls == 'true' ? 45 : 0); ?> " AutoStart="1" AnimationatStart="0" ShowControls="<?php print $vb_show_controls; ?> " ShowAudioControls="<?php print $vb_show_controls; ?> " ShowPositionControls="<?php print $vb_show_controls; ?> " ShowStatusBar="<?php print $vb_show_controls; ?> " ShowTracker="<?php print $vb_show_controls; ?> " ShowDisplay="<?php print $vb_show_controls; ?> " AllowChangeDisplaySize="1" DisplaySize="0" TYPE="application/x-mplayer2" PLUGINSPAGE="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"> </embed> </object> </td> </tr> </table> <?php return ob_get_clean(); } # ------------------------------------------------ # ------------------------------------------------ case 'video/quicktime': $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 border="0" cellpadding="0" cellspacing="0"> <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 "video/x-flv": case 'video/mpeg': case 'audio/mpeg': case 'video/mp4': $vs_id = $pa_options["id"] ? $pa_options["id"] : "mp4_player"; $vs_poster_frame_url = $pa_options["poster_frame_url"]; $vs_flash_vars = $pa_options["viewer_parameters"]; $viewer_base_url = $pa_options["viewer_base_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"]; $va_captions = caGetOption("captions", $pa_options, array(), array('castTo' => 'array')); ob_start(); $vs_config = 'config={"playlist":[{"url":"' . $vs_poster_frame_url . '", "scaling": "fit"}, {"url": "' . $ps_url . '","autoPlay":false,"autoBuffering":true, "scaling": "fit"}]};'; $vb_is_rtmp = false; if ($vb_is_rtmp = substr($ps_url, 0, 7) === 'rtmp://') { // && (isset($pa_options['always_use_flash']) && $pa_options['always_use_flash'])) { $pa_options['always_use_flash'] = true; switch ($pa_properties["mimetype"]) { case "video/x-flv": $vs_type = 'flv'; break; case 'audio/mpeg': $vs_type = 'mp3'; break; case 'video/mpeg': case 'video/mp4': default: $vs_type = 'mp4'; break; } if ($vb_is_rtmp) { $va_volume_info = isset($pa_volume_info['accessUsingMirror']) && (bool) $pa_volume_info['accessUsingMirror'] ? $pa_volume_info['mirrors'][$pa_volume_info['accessUsingMirror']] : $pa_volume_info; $va_tmp = explode('/', $ps_url); $va_filename = explode('.', array_pop($va_tmp)); $vs_ext = $va_filename[1]; $vs_stub = (isset($va_volume_info['accessProtocol']) ? $va_volume_info['accessProtocol'] : $va_volume_info['protocol']) . '://' . (isset($va_volume_info['accessHostname']) ? $va_volume_info['accessHostname'] : $va_volume_info['hostname']) . (isset($va_volume_info['accessUrlPath']) ? $va_volume_info['accessUrlPath'] : $va_volume_info['urlPath']); $vs_file_path = str_replace($vs_stub, '', $ps_url); $vs_file_path = preg_replace('!\\.' . $vs_ext . '$!', '', $vs_file_path); $vs_config = '{ "playlist":[ {"url": "' . $va_volume_info['rtmpContentPath'] . $vs_file_path . '", "provider": "streaming_server"} ], "plugins" : { "streaming_server" : { "url": "flowplayer.rtmp-3.2.3.swf", "netConnectionUrl": "' . (isset($va_volume_info['accessProtocol']) ? $va_volume_info['accessProtocol'] : $va_volume_info['protocol']) . '://' . (isset($va_volume_info['accessHostname']) ? $va_volume_info['accessHostname'] : $va_volume_info['hostname']) . $va_volume_info['rtmpMediaPrefix'] . '" } } }'; } ?> <div id="<?php print $vs_id; ?> " style="width: <?php print $vn_width; ?> px; height: <?php print $vn_height; ?> px;"> </div> <script type="text/javascript"> flowplayer("<?php print $vs_id; ?> ", "<?php print $viewer_base_url; ?> /viewers/apps/flowplayer-3.2.7.swf", <?php print $vs_config; ?> ); </script> <?php } else { ?> <!-- Begin VideoJS --> <video id="<?php print $vs_id; ?> " class="video-js vjs-default-skin" controls preload="auto" width="<?php print $vn_width; ?> " height="<?php print $vn_height; ?> " poster="<?php print $vs_poster_frame_url; ?> " data-setup='{}'> <source src="<?php print $ps_url; ?> " type='video/mp4' /> <?php if (is_array($va_captions)) { foreach ($va_captions as $vn_locale_id => $va_caption_track) { print "<track kind=\"captions\" src=\"" . $va_caption_track['url'] . "\" srclang=\"" . $va_caption_track["locale_code"] . "\" label=\"" . $va_caption_track['locale'] . "\">\n"; } } ?> </video> <script type="text/javascript"> _V_.players["<?php print $vs_id; ?> "] = undefined; // make sure VideoJS doesn't think it has already loaded the viewer jQuery("#<?php print $vs_id; ?> ").attr('width', jQuery('#<?php print $vs_id; ?> :parent').width()).attr('height', jQuery('#<?php print $vs_id; ?> :parent').height()); _V_("<?php print $vs_id; ?> ", {}, function() {}); </script> <!-- 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; # ------------------------------------------------ } }
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>
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)); }
/** * @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; }
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; # ------------------------------------------------ } }
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', 'data_url', 'poster_frame_url', 'viewer_parameters', 'viewer_base_url', 'width', 'height', 'vspace', 'hspace', 'alt', 'title', 'usemap', 'align', 'border', 'class', 'style', 'duration', 'pages') as $vs_k) { if (!isset($pa_options[$vs_k])) { $pa_options[$vs_k] = null; } } switch ($pa_properties["mimetype"]) { # ------------------------------------------------ case 'audio/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"]; if (!$vn_width) { $vn_width = 300; } if (!$vn_height) { $vn_height = 32; } return "<div style='width: {$vn_width}px; height: {$vn_height}px;'><audio id='{$vs_id}' src='{$ps_url}' width='{$vn_width}' height='{$vn_height}' controls='1'></audio></div>"; break; # ------------------------------------------------ # ------------------------------------------------ case 'audio/mpeg': $viewer_base_url = $pa_options["viewer_base_url"]; $vs_id = $pa_options["id"] ? $pa_options["id"] : "mp3player"; switch ($pa_options["player"]) { case 'small': JavascriptLoadManager::register("swfobject"); ob_start(); $vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 165; $vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 38; ?> <div style='width: {$vn_width}px; height: {$vn_height}px;'> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<?php print $vn_viewer_width; ?> " height="<?php print $vn_viewer_height; ?> " id="<?php print $vs_id; ?> " align=""> <param name="movie" value="<?php print $viewer_base_url; ?> /viewers/apps/niftyplayer.swf?file=<?php print $ps_url; ?> &as=0"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <embed src="<?php print $viewer_base_url; ?> /viewers/apps/niftyplayer.swf?file=<?php print $ps_url; ?> &as=0" quality="high" bgcolor="#FFFFFF" width="<?php print $vn_viewer_width; ?> " height="<?php print $vn_viewer_height; ?> " align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object> </div> <?php return ob_get_clean(); break; case 'text': return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "Listen to MP3") . "</a>"; break; default: JavascriptLoadManager::register("mediaelement"); $vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400; $vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95; ob_start(); ?> <div class="<?php print isset($pa_options["class"]) ? $pa_options["class"] : "caAudioPlayer"; ?> "> <audio id="<?php print $vs_id; ?> " src="<?php print $ps_url; ?> " type="audio/mp3" controls="controls"></audio> </div> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#<?php print $vs_id; ?> ').mediaelementplayer({showTimecodeFrameCount: true, framesPerSecond: 100, audioWidth: <?php print (int) $vn_width; ?> , audioHeight: <?php print (int) $vn_height; ?> }); }); </script> <?php return ob_get_clean(); break; } break; # ------------------------------------------------ # ------------------------------------------------ case 'audio/mp4': $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 AAC") . "</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 $vn_width; ?> " 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 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-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 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; # ------------------------------------------------ } }
/** * 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; }
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)); } } }
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)); } }
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', 'data_url', 'poster_frame_url', 'viewer_parameters', 'viewer_base_url', 'width', 'height', 'vspace', 'hspace', 'alt', 'title', 'usemap', 'align', 'border', 'class', 'style', 'duration', 'pages') as $vs_k) { if (!isset($pa_options[$vs_k])) { $pa_options[$vs_k] = null; } } switch ($pa_properties["mimetype"]) { # ------------------------------------------------ case 'audio/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"]; if (!$vn_width) { $vn_width = 300; } if (!$vn_height) { $vn_height = 32; } return "<div style='width: {$vn_width}px; height: {$vn_height}px;'><audio id='{$vs_id}' src='{$ps_url}' width='{$vn_width}' height='{$vn_height}' controls='1'></audio></div>"; break; # ------------------------------------------------ # ------------------------------------------------ case 'audio/mpeg': $viewer_base_url = $pa_options["viewer_base_url"]; $vs_id = $pa_options["id"] ? $pa_options["id"] : "mp3player"; switch ($pa_options["player"]) { case 'small': ob_start(); $vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 165; $vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 38; ?> <div style='width: {$vn_width}px; height: {$vn_height}px;'> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<?php print $vn_width; ?> " height="<?php print $vn_height; ?> " id="<?php print $vs_id; ?> "> <param name="movie" value="<?php print $viewer_base_url; ?> /viewers/apps/niftyplayer.swf?file=<?php print $ps_url; ?> &as=0"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <embed src="<?php print $viewer_base_url; ?> /viewers/apps/niftyplayer.swf?file=<?php print $ps_url; ?> &as=0" quality="high" bgcolor="#FFFFFF" width="<?php print $vn_width; ?> " height="<?php print $vn_height; ?> " type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object> </div> <?php return ob_get_clean(); break; case 'text': return "<a href='{$ps_url}'>" . ($pa_options["text_only"] ? $pa_options["text_only"] : "Listen to MP3") . "</a>"; break; default: AssetLoadManager::register("mediaelement"); $vn_width = $pa_options["viewer_width"] > 0 ? $pa_options["viewer_width"] : 400; $vn_height = $pa_options["viewer_height"] > 0 ? $pa_options["viewer_height"] : 95; ob_start(); ?> <div class="<?php print isset($pa_options["class"]) ? $pa_options["class"] : "caAudioPlayer"; ?> "> <audio id="<?php print $vs_id; ?> " src="<?php print $ps_url; ?> " type="audio/mp3" controls="controls"></audio> </div> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#<?php print $vs_id; ?> ').mediaelementplayer({showTimecodeFrameCount: true, framesPerSecond: 100, audioWidth: '<?php print $vn_width; ?> ', audioHeight: '<?php print $vn_height; ?> ' }); }); </script> <?php return ob_get_clean(); break; } break; # ------------------------------------------------ # ------------------------------------------------ case 'audio/mp4': $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 AAC") . "</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 $vn_width; ?> " 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; # ------------------------------------------------ } }
$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/>";