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); }
} else { $scripttext .= $markername . '.properties.set("iconContent", "' . htmlspecialchars(str_replace('\\', '/', $currentmarker->title), ENT_QUOTES, 'UTF-8') . '");' . "\n"; } } } } } //} if ($allowUserMarker == 0 || isset($currentmarker->userprotection) && (int) $currentmarker->userprotection == 1 || $currentUserID == 0 || isset($currentmarker->createdbyuser) && ((int) $currentmarker->createdbyuser != $currentUserID || (int) $currentmarker->createdbyuser == 0)) { if (isset($map->useajax) && (int) $map->useajax != 0) { // do not create listeners, create by loop only in the end $scripttext .= ' ajaxmarkersLL' . $mapDivSuffix . '.push(marker' . $currentmarker->id . ');' . "\n"; } else { $scripttext .= 'var contentStringHead' . $currentmarker->id . ' = ' . comZhYandexMapPlacemarksHelper::get_placemark_content_string_header($mapDivSuffix, $currentmarker, $map->usercontact, $map->useruser, $userContactAttrs, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $map->placemark_rating, $map->lang, $placemarkTitleTag, $map->showcreateinfo); $scripttext .= 'var contentStringHeadCluster' . $currentmarker->id . ' = ' . comZhYandexMapPlacemarksHelper::get_placemark_content_string_header_cluster($mapDivSuffix, $currentmarker, $map->usercontact, $map->useruser, $userContactAttrs, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $map->placemark_rating, $map->lang, $placemarkTitleTag, $map->showcreateinfo); $scripttext .= 'var contentStringBody' . $currentmarker->id . ' = ' . comZhYandexMapPlacemarksHelper::get_placemark_content_string_body($mapDivSuffix, $currentmarker, $map->usercontact, $map->useruser, $userContactAttrs, $service_DoDirection, $imgpathIcons, $imgpathUtils, $directoryIcons, $map->placemark_rating, $map->lang, $placemarkTitleTag, $map->showcreateinfo); if (isset($map->markercluster) && (int) $map->markercluster != 0) { $scripttext .= $markername . '.properties.set("clusterCaption", contentStringHeadCluster' . $currentmarker->id . ');' . "\n"; } // Action By Click - Begin switch ((int) $currentmarker->actionbyclick) { // None case 0: if ((int) $currentmarker->zoombyclick != 100) { $scripttext .= $markername . '.events.add("click", function (e) {' . "\n"; $scripttext .= ' map.setCenter(latlng' . $currentmarker->id . ');' . "\n"; $scripttext .= ' map.setZoom(' . (int) $currentmarker->zoombyclick . ');' . "\n"; $scripttext .= '});' . "\n"; } break; // Info