public static function GetPopupsInfo($p_htmlDir, $p_websiteUrl)
{
global $Campsite;
$cnf_html_dir = $Campsite['HTML_DIR'];
$cnf_website_url = $Campsite['WEBSITE_URL'];
$preferencesService = \Zend_Registry::get('container')->getService('system_preferences_service');
if ('' != $p_htmlDir) {
$cnf_html_dir = $p_htmlDir;
}
if ('' != $p_websiteUrl) {
$cnf_website_url = $p_websiteUrl;
}
$popup_width = $preferencesService->MapPopupWidthMin;
if (!$popup_width) {
$popup_width = 300;
}
$popup_height = $preferencesService->MapPopupHeightMin;
if (!$popup_height) {
$popup_height = 200;
}
$size_info = array('width' => $popup_width, 'height' => $popup_height);
$video_names_arr = array('YouTube', 'Vimeo', 'Flash');
$video_names_info = array();
$video_names_info['YouTube'] = array('width' => '320', 'height' => '240');
$video_names_info['Vimeo'] = array('width' => '320', 'height' => '180');
$video_names_info['Flash'] = array('width' => '320', 'height' => '240');
foreach ($video_names_arr as $one_video_label) {
if ('' == $one_video_label) {
continue;
}
$video_width = $preferencesService->MapVideoWidth . ucfirst($one_video_label);
$video_height = $preferencesService->MapVideoHeight . ucfirst($one_video_label);
if (!$video_width && '' == $video_width) {
continue;
}
if (!$video_height && '' == $video_height) {
continue;
}
$video_names_info[$one_video_label]['width'] = $video_width;
$video_names_info[$one_video_label]['height'] = $video_height;
}
$youtube_src_default = '<object width="%%w%%" height="%%h%%"><param name="movie" value="http://www.youtube.com/v/%%id%%"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/%%id%%" type="application/x-shockwave-flash" wmode="transparent" width="%%w%%" height="%%h%%"></embed></object>';
$vimeo_src_default = '<object width="%%w%%" height="%%h%%"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=%%id%%&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=%%id%%&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="%%w%%" height="%%h%%"></object>';
$flash_src_default = '<object width="%%w%%" height="%%h%%"><param name="allowFullScreen" value="true"/><param name="wmode" value="transparent"/><param name="movie" value="%%path%%%%id%%"/><embed src="%%path%%%%id%%" width="%%w%%" height="%%h%%" allowFullScreen="true" type="application/x-shockwave-flash" wmode="transparent"/></object>';
$flv_src_default = '<object width="%%w%%" height="%%h%%"><param name="movie" value="%%path%%player.swf"></param><param name="flashvars" value="src=%%path%%%%id%%&poster=%%path%%%%ps%%&controlBarAutoHide=true"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="%%path%%player.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="%%w%%" height="%%h%%" flashvars="src=%%path%%%%id%%&poster=%%path%%%%ps%%&controlBarAutoHide=true"></embed></object>';
$flash_server = '';
$flash_directory = '';
$flash_server_setting = $preferencesService->FlashServer;
$flash_directory_setting = $preferencesService->FlashDirectory;
// if not a flash server set, use the cs server
if (!$flash_server_setting || '' == $flash_server_setting) {
$flash_server = $cnf_website_url;
if ('/' != strrchr($flash_server, '/')) {
$flash_server .= '/';
}
} else {
$flash_server = $flash_server_setting;
}
// if not flash directory set, just assure that the server/dir ends with a '/'
if (!$flash_directory_setting || '' == $flash_directory_setting) {
if ('/' == strrchr($flash_server, '/')) {
$flash_directory = '';
} else {
$flash_directory = '/';
}
} else {
$flash_directory = $flash_directory_setting;
}
$flash_path = $flash_server . $flash_directory;
if ('/' != strrchr($flash_path, '/')) {
$flash_path .= '/';
}
$cur_info = $video_names_info['YouTube'];
$video_names_usage[] = array('label' => 'YouTube', 'source' => $youtube_src_default, 'width' => $cur_info['width'], 'height' => $cur_info['height']);
$cur_info = $video_names_info['Vimeo'];
$video_names_usage[] = array('label' => 'Vimeo', 'source' => $vimeo_src_default, 'width' => $cur_info['width'], 'height' => $cur_info['height']);
$cur_info = $video_names_info['Flash'];
$video_names_usage[] = array('label' => 'Flash', 'source' => $flash_src_default, 'width' => $cur_info['width'], 'height' => $cur_info['height'], 'path' => $flash_path);
$cur_info = $video_names_info['Flash'];
$video_names_usage[] = array('label' => 'Flv', 'source' => $flv_src_default, 'width' => $cur_info['width'], 'height' => $cur_info['height'], 'path' => $flash_path);
$video_info = array('labels' => $video_names_usage);
$res_popups_info = array('width' => $size_info['width'], 'height' => $size_info['height'], 'video' => $video_info);
return array('json_obj' => $res_popups_info);
}