Example #1
0
 public function getAJAXPlacemarks()
 {
     $ajaxarray = JRequest::getVar('ajaxarray');
     // from placemark,because need to show in cluster info
     $getgetdetails = JRequest::getVar('getdetails');
     if ($getgetdetails == "1") {
         $usercontactattributes = JRequest::getVar('contactattrs');
         $usercontact = JRequest::getVar('usercontact');
         $useruser = JRequest::getVar('useruser');
         $service_DoDirection = JRequest::getVar('servicedirection');
         $imgpathIcons = JRequest::getVar('iconicon');
         $imgpathUtils = JRequest::getVar('iconutil');
         $directoryIcons = JRequest::getVar('icondir');
         $currentArticleId = JRequest::getVar('articleid');
         $placemarkrating = JRequest::getVar('placemarkrating');
         $placemarkTitleTag = JRequest::getVar('placemarktitletag');
         $showcreateinfo = JRequest::getVar('showcreateinfo');
         $lang = JRequest::getVar('language');
     }
     //
     if (count($ajaxarray) > 0) {
         $placemarklist = implode(",", $ajaxarray);
         $db = JFactory::getDBO();
         $query = $db->getQuery(true);
         // Create some addition filters - Begin
         $addWhereClause = '';
         $addWhereClause .= ' and h.id IN (' . $placemarklist . ')';
         $query->select('h.*, ' . ' g.icontype as groupicontype, g.overridemarkericon as overridemarkericon, g.published as publishedgroup, g.markermanagerminzoom as markermanagerminzoom, g.markermanagermaxzoom as markermanagermaxzoom, ' . ' g.iconofsetx groupiconofsetx, g.iconofsety groupiconofsety')->from('#__zhyandexmaps_markers as h')->leftJoin('#__zhyandexmaps_markergroups as g ON h.markergroup=g.id')->where('1=1' . $addWhereClause)->order('h.title');
         $db->setQuery($query);
         // Markers
         if (!($markers = $db->loadObjectList())) {
             $responseVar = array('cnt' => 0, 'dataexists' => 0);
         } else {
             if ($getgetdetails == "1") {
                 foreach ($markers as $key => $marker) {
                     if ($marker->actionbyclick == 1) {
                         $marker->xxx_getdetails = 1;
                         $marker->xxx_contentstringheader = comZhYandexMapPlacemarksHelper::get_placemark_content_string_header($currentArticleId, $marker, $usercontact, $useruser, $usercontactattributes, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $placemarkrating, $lang, $placemarkTitleTag, $showcreateinfo);
                         $marker->xxx_contentstringbody = comZhYandexMapPlacemarksHelper::get_placemark_content_string_body($currentArticleId, $marker, $usercontact, $useruser, $usercontactattributes, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $placemarkrating, $lang, $placemarkTitleTag, $showcreateinfo);
                         $marker->xxx_contentstringheadercluster = comZhYandexMapPlacemarksHelper::get_placemark_content_string_header_cluster($currentArticleId, $marker, $usercontact, $useruser, $usercontactattributes, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $placemarkrating, $lang, $placemarkTitleTag, $showcreateinfo);
                     }
                 }
             } else {
                 foreach ($markers as $key => $marker) {
                     $marker->xxx_getdetails = 0;
                 }
             }
             $responseVar = array('cnt' => count($markers), 'dataexists' => 1, 'markers' => $markers);
         }
     } else {
         $responseVar = array('cnt' => 0, 'dataexists' => 0);
     }
     echo json_encode($responseVar);
 }
Example #2
0
 public static function get_placemark_content_string_body($currentArticleId, $currentmarker, $usercontact, $useruser, $usercontactattributes, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $placemarkrating, $lang, $titleTag, $showCreateInfo)
 {
     $currentLanguage = JFactory::getLanguage();
     $currentLangTag = $currentLanguage->getTag();
     if (isset($titleTag) && $titleTag != "") {
         if ($titleTag == "h2" || $titleTag == "h3") {
             $currentTitleTag = $titleTag;
         } else {
             $currentTitleTag = 'h2';
         }
     } else {
         $currentTitleTag = 'h2';
     }
     if (isset($lang) && $lang != "") {
         $currentLanguage->load('com_zhyandexmap', JPATH_SITE, $lang, true);
         $currentLanguage->load('com_zhyandexmap', JPATH_COMPONENT, $lang, true);
         $currentLanguage->load('com_zhyandexmap', JPATH_SITE . '/components/com_zhyandexmap', $lang, true);
     } else {
         $currentLanguage->load('com_zhyandexmap', JPATH_SITE, $currentLangTag, true);
         $currentLanguage->load('com_zhyandexmap', JPATH_COMPONENT, $currentLangTag, true);
         $currentLanguage->load('com_zhyandexmap', JPATH_SITE . '/components/com_zhyandexmap', $currentLangTag, true);
     }
     $returnText = '';
     $userContactAttrs = explode(",", $usercontactattributes);
     for ($i = 0; $i < count($userContactAttrs); $i++) {
         $userContactAttrs[$i] = strtolower(trim($userContactAttrs[$i]));
     }
     if (1 == 2) {
         $returnText .= '\'<div id="gpsContent' . $currentmarker->id . '"  class="placemarkGPS">\'+' . "\n";
         $returnText .= '\'<p class="placemarkGPSLatitude">\'+Convert_Latitude_Decimal2DMS(' . $currentmarker->latitude . ')+\'</p>\'+' . "\n";
         $returnText .= '\'<p class="placemarkGPSLongitude">\'+Convert_Longitude_Decimal2DMS(' . $currentmarker->longitude . ')+\'</p>\'+' . "\n";
         $returnText .= '\'</div>\'+' . "\n";
     }
     $returnText .= '\'<div id="bodyContent' . $currentmarker->id . '"  class="placemarkBody">\'+' . "\n";
     if ($currentmarker->hrefimage != "") {
         $tmp_image_path = strtolower($currentmarker->hrefimage);
         if (substr($tmp_image_path, 0, 5) == "http:" || substr($tmp_image_path, 0, 6) == "https:" || substr($tmp_image_path, 0, 1) == "/" || substr($tmp_image_path, 0, 1) == ".") {
             $tmp_image_path_add = "";
         } else {
             $tmp_image_path_add = "/";
         }
         $returnText .= '\'<img src="' . $tmp_image_path_add . $currentmarker->hrefimage . '" alt="" />\'+' . "\n";
     }
     if (isset($currentmarker->markercontent) && ((int) $currentmarker->markercontent == 0 || (int) $currentmarker->markercontent == 2)) {
         $returnText .= '\'' . htmlspecialchars(str_replace('\\', '/', $currentmarker->description), ENT_QUOTES, 'UTF-8') . '\'+' . "\n";
     }
     $returnText .= '\'' . str_replace("'", "\\'", str_replace(array("\r", "\r\n", "\n"), '', $currentmarker->descriptionhtml)) . '\'+' . "\n";
     //$returnText .= ' latlng'. $currentmarker->id. '.toString()+'."\n";
     // Contact info - begin
     if (isset($usercontact) && (int) $usercontact != 0) {
         if (isset($currentmarker->showcontact) && (int) $currentmarker->showcontact != 0) {
             switch ((int) $currentmarker->showcontact) {
                 case 1:
                     for ($i = 0; $i < count($userContactAttrs); $i++) {
                         if ($currentmarker->contact_name != "" && $userContactAttrs[$i] == 'name') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_NAME') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_name), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_position != "" && $userContactAttrs[$i] == 'position') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_POSITION') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_position), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_address != "" && $userContactAttrs[$i] == 'address') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS') . ' ' . str_replace('<br /><br />', '<br />', str_replace(array("\r", "\r\n", "\n"), '<br />', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_address), ENT_QUOTES, 'UTF-8'))) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'suburb') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_SUBURB_SUBURB') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'city') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_SUBURB_CITY') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'state') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_STATE_STATE') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'province') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_STATE_PROVINCE') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_country != "" && $userContactAttrs[$i] == 'country') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_COUNTRY') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_country), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'postcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_POSTCODE_POSTAL') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'zipcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS_POSTCODE_ZIP') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_phone != "" && $userContactAttrs[$i] == 'phone') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_PHONE') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_phone), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_mobile != "" && $userContactAttrs[$i] == 'mobile') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_MOBILE') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_mobile), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_fax != "" && $userContactAttrs[$i] == 'fax') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_FAX') . ' ' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_fax), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_email != "" && $userContactAttrs[$i] == 'email') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_EMAIL') . ' ' . str_replace('@', '&#64;', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_email), ENT_QUOTES, 'UTF-8')) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_webpage != "" && $userContactAttrs[$i] == 'website') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_WEBSITE') . ' ' . '<a href="' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '" target="_blank">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '</a> ' . '</p>\'+' . "\n";
                         }
                     }
                     break;
                 case 2:
                     for ($i = 0; $i < count($userContactAttrs); $i++) {
                         if ($currentmarker->contact_name != "" && $userContactAttrs[$i] == 'name') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_name), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_position != "" && $userContactAttrs[$i] == 'position') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_position), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_address != "" && $userContactAttrs[$i] == 'address') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'address.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_ADDRESS') . '" />' . str_replace('<br /><br />', '<br />', str_replace(array("\r", "\r\n", "\n"), '<br />', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_address), ENT_QUOTES, 'UTF-8'))) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'suburb') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'city') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'state') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'province') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_country != "" && $userContactAttrs[$i] == 'country') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_country), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'postcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'zipcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_phone != "" && $userContactAttrs[$i] == 'phone') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'phone.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_PHONE') . '" />' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_phone), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_mobile != "" && $userContactAttrs[$i] == 'mobile') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'mobile.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_MOBILE') . '" />' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_mobile), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_fax != "" && $userContactAttrs[$i] == 'fax') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'fax.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_FAX') . '" />' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_fax), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_email != "" && $userContactAttrs[$i] == 'email') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'email.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_EMAIL') . '" />' . str_replace('@', '&#64;', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_email), ENT_QUOTES, 'UTF-8')) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_webpage != "" && $userContactAttrs[$i] == 'website') {
                             $returnText .= '\'<p class="placemarkBodyContact"><img src="' . $imgpathUtils . 'website.png" alt="' . JText::_('COM_ZHYANDEXMAP_MAP_USER_CONTACT_WEBSITE') . '" />' . '<a href="' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '" target="_blank">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '</a> ' . '</p>\'+' . "\n";
                         }
                     }
                     break;
                 case 3:
                     for ($i = 0; $i < count($userContactAttrs); $i++) {
                         if ($currentmarker->contact_name != "" && $userContactAttrs[$i] == 'name') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_name), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_position != "" && $userContactAttrs[$i] == 'position') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_position), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_address != "" && $userContactAttrs[$i] == 'address') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . str_replace('<br /><br />', '<br />', str_replace(array("\r", "\r\n", "\n"), '<br />', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_address), ENT_QUOTES, 'UTF-8'))) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'suburb') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'city') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'state') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'province') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_country != "" && $userContactAttrs[$i] == 'country') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_country), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'postcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'zipcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_phone != "" && $userContactAttrs[$i] == 'phone') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_phone), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_mobile != "" && $userContactAttrs[$i] == 'mobile') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_mobile), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_fax != "" && $userContactAttrs[$i] == 'fax') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_fax), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_email != "" && $userContactAttrs[$i] == 'email') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . str_replace('@', '&#64;', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_email), ENT_QUOTES, 'UTF-8')) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_webpage != "" && $userContactAttrs[$i] == 'website') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . '<a href="' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '" target="_blank">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '</a> ' . '</p>\'+' . "\n";
                         }
                     }
                     break;
                 default:
                     for ($i = 0; $i < count($userContactAttrs); $i++) {
                         if ($currentmarker->contact_name != "" && $userContactAttrs[$i] == 'name') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_name), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_position != "" && $userContactAttrs[$i] == 'position') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_position), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_address != "" && $userContactAttrs[$i] == 'address') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . str_replace('<br /><br />', '<br />', str_replace(array("\r", "\r\n", "\n"), '<br />', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_address), ENT_QUOTES, 'UTF-8'))) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'suburb') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_suburb != "" && $userContactAttrs[$i] == 'city') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_suburb), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'state') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_state != "" && $userContactAttrs[$i] == 'province') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_state), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_country != "" && $userContactAttrs[$i] == 'country') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_country), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'postcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_postcode != "" && $userContactAttrs[$i] == 'zipcode') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_postcode), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_phone != "" && $userContactAttrs[$i] == 'phone') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_phone), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_mobile != "" && $userContactAttrs[$i] == 'mobile') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_mobile), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_fax != "" && $userContactAttrs[$i] == 'fax') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_fax), ENT_QUOTES, 'UTF-8') . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_email != "" && $userContactAttrs[$i] == 'email') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . str_replace('@', '&#64;', htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_email), ENT_QUOTES, 'UTF-8')) . '</p>\'+' . "\n";
                         }
                         if ($currentmarker->contact_webpage != "" && $userContactAttrs[$i] == 'website') {
                             $returnText .= '\'<p class="placemarkBodyContact">' . '<a href="' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '" target="_blank">' . htmlspecialchars(str_replace('\\', '/', $currentmarker->contact_webpage), ENT_QUOTES, 'UTF-8') . '</a> ' . '</p>\'+' . "\n";
                         }
                     }
                     break;
             }
         }
     }
     // Contact info - end
     // User info - begin
     if (isset($useruser) && (int) $useruser != 0) {
         $returnText .= comZhYandexMapPlacemarksHelper::get_userinfo_for_marker($currentmarker->createdbyuser, $currentmarker->showuser, $imgpathIcons, $imgpathUtils, $directoryIcons);
     }
     // User info - end
     if ($currentmarker->hrefsite != "") {
         $returnText .= '\'<p><a class="placemarkHREF" href="' . $currentmarker->hrefsite . '" target="_blank">';
         if ($currentmarker->hrefsitename != "") {
             $returnText .= htmlspecialchars($currentmarker->hrefsitename, ENT_QUOTES, 'UTF-8');
         } else {
             $returnText .= $currentmarker->hrefsite;
         }
         $returnText .= '</a></p>\'+' . "\n";
     }
     $returnText .= '\'</div>\'' . "\n";
     return $returnText;
 }
         $routepanelcount++;
         if (isset($currentrouter->showpaneltotal) && (int) $currentrouter->showpaneltotal == 1) {
             $routepaneltotalcount++;
         }
     }
 }
 if ($currentrouter->routebymarker != "") {
     $router2name = 'routeByMarker' . $currentrouter->id;
     $router2error = 'routeByMarkerError' . $currentrouter->id;
     $cs = explode(";", $currentrouter->routebymarker);
     $cs_total = count($cs) - 1;
     $cs_idx = 0;
     $wp_list = '';
     $skipRouteCreation = 0;
     foreach ($cs as $curroute) {
         $currouteLatLng = comZhYandexMapPlacemarksHelper::parse_route_by_markers($curroute);
         //$scripttext .= 'alert("'.$currouteLatLng.'");'."\n";
         if ($currouteLatLng != "") {
             if ($currouteLatLng == "geocode") {
                 $scripttext .= 'alert(\'' . JText::_('COM_ZHYANDEXMAP_MAPROUTER_FINDMARKER_ERROR_GEOCODE') . ' ' . $curroute . '\');' . "\n";
                 $skipRouteCreation = 1;
             } else {
                 if ($cs_idx == 0) {
                     $wp_start = ' ' . $currouteLatLng . '' . "\n";
                 } else {
                     if ($cs_idx == $cs_total) {
                         $wp_end = ', ' . $currouteLatLng . ' ' . "\n";
                     } else {
                         if ($wp_list == '') {
                             $wp_list .= ', ' . $currouteLatLng;
                         } else {