Geo_Preferences::GetPopupsInfo PHP Method

GetPopupsInfo() public static method

Gets info on popups
public static GetPopupsInfo ( string $p_htmlDir, string $p_websiteUrl ) : array
$p_htmlDir string
$p_websiteUrl string
return array
    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%%&amp;poster=%%path%%%%ps%%&amp;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%%&amp;poster=%%path%%%%ps%%&amp;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);
    }

Usage Example

Example #1
0
    exit;
}
$articleObj = new Article($f_language_id, $f_article_number);
$cnf_html_dir = $Campsite['HTML_DIR'];
$cnf_website_url = $Campsite['WEBSITE_URL'];
$geo_map_info = Geo_Preferences::GetMapInfo($cnf_html_dir, $cnf_website_url);
$geo_map_incl = Geo_Preferences::PrepareMapIncludes($geo_map_info['incl_obj']);
$geo_map_json = "";
$geo_map_json .= json_encode($geo_map_info['json_obj']);
$geo_map_usage = Geo_Map::ReadMapInfo('article', $f_article_number);
$geo_map_usage_json = "";
$geo_map_usage_json .= json_encode($geo_map_usage);
$geo_icons_info = Geo_Preferences::GetIconsInfo($cnf_html_dir, $cnf_website_url);
$geo_icons_json = "";
$geo_icons_json .= json_encode($geo_icons_info['json_obj']);
$geo_popups_info = Geo_Preferences::GetPopupsInfo($cnf_html_dir, $cnf_website_url);
$geo_popups_json = "";
$geo_popups_json .= json_encode($geo_popups_info['json_obj']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Expires" content="now" />
    <title><?php 
putGS('Setting Map Locations');
?>
</title>

        <?php 
include dirname(__FILE__) . '/../../html_head.php';
All Usage Examples Of Geo_Preferences::GetPopupsInfo