Geo_Preferences::GetIconsWebDir PHP Method

GetIconsWebDir() public static method

Gets icons directory for map (pre)view
public static GetIconsWebDir ( string $p_htmlDir = '', string $p_websiteUrl = '' ) : string
$p_htmlDir string
$p_websiteUrl string
return string
    public static function GetIconsWebDir($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;
        }
        $icons_subpath = $preferencesService->MapMarkerDirectory;
        if (!$icons_subpath) {
            $icons_subpath = '/javascript/geocoding/markers';
        }
        $icons_webdir = $cnf_website_url . $icons_subpath;
        return $icons_webdir;
    }

Usage Example

Example #1
0
 /**
  * @param int $p_languageId
  * @param array $p_constraints
  * @param array $p_options
  * @param string $p_label
  * @param int $p_offset
  * @param int $p_limit
  * @param int $p_rank
  *    The rank of the current multi-map, used to make unique ids
  *
  * @return string
  */
 public static function GetMultiMapTagList($p_languageId, $p_constraints, $p_options, $p_label, $p_offset, $p_limit, $p_rank = 0)
 {
     $geo = self::GetMultiMapTagListData((int) $p_languageId, $p_constraints, $p_options, $p_offset, $p_limit, $p_rank);
     $map = $geo['map'];
     $pois = $geo['pois'];
     $icons_dir = Geo_Preferences::GetIconsWebDir();
     //$map_name = $map['name'];
     $map_name = $p_label;
     $map_name = str_replace('&', '&', $map_name);
     $map_name = str_replace('<', '&lt;', $map_name);
     $map_name = str_replace('>', '&gt;', $map_name);
     if (0 < strlen($map_name)) {
         $html = '
         <div class="geomap_info">
           <dl class="geomap_map_name">
             <dt class="geomap_map_name_label">' . getGS('Map') . ':
             </dt>
             <dd class="geomap_map_name_value">' . $map_name . '
             </dd>
           </dl>
         </div>';
     }
     $html .= '
         <div id="side_info" class="geo_side_info">';
     $poiIdx = 0;
     foreach ($pois as $poi) {
         $poi_title = $poi['title'];
         $poi_title = str_replace('&', '&amp;', $poi_title);
         $poi_title = str_replace('<', '&lt;', $poi_title);
         $poi_title = str_replace('>', '&gt;', $poi_title);
         $poi_perex = $poi['perex'];
         $poi_perex = str_replace('&', '&amp;', $poi_perex);
         $poi_perex = str_replace('<', '&lt;', $poi_perex);
         $poi_perex = str_replace('>', '&gt;', $poi_perex);
         $poi_icon = $poi['style'];
         $html .= '<div id="poi_seq_' . $poiIdx . '">
             <a class="geomap_poi_icon_link" href="#" onClick="' . $poi['open'] . ' return false;"><img class="geomap_poi_icon" src="' . $icons_dir . '/' . $poi_icon . '" /></a>
             <a class="geomap_poi_name" href="#" onClick="' . $poi['open'] . ' return false;">' . $poi_title . '</a>
             <div class="geomap_poi_perex">' . $poi_perex . '</div>
             <div class="geomap_poi_center">
                 <a href="#" onClick="' . $poi['center'] . ' return false;">' . getGS('Center') . '
                 </a>
             </div>
             <div class="geomap_poi_spacer">&nbsp;</div>
         </div>';
         $poiIdx += 1;
     }
     $html .= '</div>';
     return $html;
 }