AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.117
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/vesoul/modules/mod_djclassifieds_maps/tmpl/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/vesoul/modules/mod_djclassifieds_maps/tmpl/default.php
<?php
/**
 * @package DJ-Classifieds
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

defined ('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Layout\FileLayout;

$document = Factory::getDocument();
$par = ComponentHelper::getParams('com_djclassifieds');

if($params->get('layout','cluster') == 'cluster'){
	$document->addScript(Uri::base(true).'/components/com_djclassifieds/assets/mapclustering/src/markerclusterer.js');
}

$map_styles = trim($params->get('gm_styles','')) ? $params->get('gm_styles') : '[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]';

?>
<?php echo (new FileLayout('layouts.switch', JPATH_BASE . '/modules/mod_djclassifieds_maps/tmpl'))->render(['module' => $module, 'params' => $params]); ?>
<div id="mod_djcf_maps<?php echo $module->id; ?>" class="dj_cf_maps"<?php echo $params->get('switch','0') && $params->get('switch_default','0') == '0' ? ' style="display:none"' : ''; ?>>
	<?php echo (new FileLayout('layouts.fieldvalues', JPATH_BASE . '/modules/mod_djclassifieds_maps/tmpl'))->render(['module' => $module, 'params' => $params]); ?>
	<?php if($params->get('enable_places_search',0)){ ?>
		<div class="djmod_map_places_search">
			 <span id="user_pos<?php echo $module->id; ?>" class="user_pos"></span>
			 <input type="text" id="pac-input<?php echo $module->id; ?>" class="controls pac-input form-control d-inline-block" placeholder="<?php echo Text::_('MOD_DJCLASSIFIEDS_MAPS_ENTER_LOCATION'); ?>">			  
			<div class="clear_both"></div>
		</div>
	<?php } ?>
	<div id="djmod_map_box<?php echo $module->id; ?>">
		<div id="djmod_map<?php echo $module->id; ?>" class="djmod_map" style="width:<?php echo $params->get('map_width','100%'); ?>;height:<?php echo $params->get('map_height','360px'); ?>;border:1px solid #666;"></div>      
	</div>
</div>

<script>

	document.addEventListener('DOMContentLoaded', function(){
		if(typeof google !== 'undefined' && typeof google.maps !== 'undefined'){
			<?php if(!($params->get('switch','0') && $params->get('switch_default','0') == '0')){ ?>
				djmodMapStart<?php echo $module->id; ?>();
			<?php } ?>
			<?php if($params->get('enable_places_search',0)){ ?>
				djmodMapPlacesSearch<?php echo $module->id; ?>();
				getmodMAPDJLocation<?php echo $module->id; ?>();
			<?php } ?>
		}else{
			console.error('Google Maps API not available');
		}
	});
	
	if(typeof google !== 'undefined' && typeof google.maps !== 'undefined'){
		var djmap<?php echo $module->id; ?>;
		var djmarker<?php echo $module->id; ?> = new google.maps.InfoWindow();
		var djgeocoder<?php echo $module->id; ?> = new google.maps.Geocoder();
		var djmarkers<?php echo $module->id; ?> = new Array();
		var djbounds<?php echo $module->id; ?> = new google.maps.LatLngBounds();
		var djmarkerCluster<?php echo $module->id; ?>;
	}
			
	function djmodMarker<?php echo $module->id; ?>(position,txt,icon)
	{			
		var MarkerOptions =  
		{ 
			position: position, 
			icon: icon
		} 
		var marker = new google.maps.Marker(MarkerOptions);
		marker.txt = txt;
			
		google.maps.event.addListener(marker,"click",function()
		{
			djmarker<?php echo $module->id; ?>.setContent(marker.txt);
			djmarker<?php echo $module->id; ?>.open(djmap<?php echo $module->id; ?>,marker);
			});
			djbounds<?php echo $module->id; ?>.extend(marker.getPosition());
			
		return marker;
	}
		
	function djmodMapStart<?php echo $module->id; ?>()    
	{
		<?php if($center_coords){ ?>
			var map_center = new google.maps.LatLng(<?php echo $center_coords['lat'].','.$center_coords['lng']; ?>);
		<?php }else if($advert){ ?>
			var map_center = new google.maps.LatLng(<?php echo $advert->latitude.','.$advert->longitude; ?>);
		<?php }else if($loc_coord = DJClassifiedsGeocode::getCoordsFromAddress($params->get('start_address', '51.511359913757104, -0.12597474647904952'), false)){ ?>
			var map_center = new google.maps.LatLng(<?php echo $loc_coord['lat'].','.$loc_coord['lng']; ?>);
		<?php }else{ ?>
			var map_center = null;
		<?php } ?>

		if(map_center === null){
			djgeocoder<?php echo $module->id; ?>.geocode({address: '<?php echo $params->get('start_address', '51.511359913757104, -0.12597474647904952'); ?>'}, function (results, status){
				var map_center = status == google.maps.GeocoderStatus.OK ? results[0].geometry.location : new google.maps.LatLng(51.5287718,-0.241682);
				
				mapInit(map_center);
			});
		}else{
			mapInit(map_center);
		}
 
		function mapInit(map_center)
		{
			var mapOpts = {
				zoom: <?php echo $params->get('start_zoom'); ?>,
				center: map_center,
				mapTypeId: google.maps.MapTypeId.<?php echo $params->get('gm_type','ROADMAP'); ?>,
				navigationControl: <?php echo $params->get('enable_zoom','true'); ?>,
				scrollwheel: <?php echo $params->get('enable_scrolling','true'); ?>,
				styles:<?php echo $map_styles; ?>
			};
			djmap<?php echo $module->id; ?> = new google.maps.Map(document.getElementById("djmod_map<?php echo $module->id; ?>"), mapOpts);

			djmodMapAddMarkers<?php echo $module->id; ?>('<?php echo base64_encode(json_encode($items)); ?>');
		}
	}

	function djmodMapAddMarkers<?php echo $module->id; ?>(items)
    {
		items = JSON.parse(atob(items));

        if(djmarkers<?php echo $module->id; ?>.length){
			<?php if($params->get('layout','cluster') == 'cluster'){ ?>
				djmarkerCluster<?php echo $module->id; ?>.clearMarkers();
			<?php }else{ ?>
				for (let i = 0; i < djmarkers<?php echo $module->id; ?>.length; i++) {
					djmarkers<?php echo $module->id; ?>[i].setMap(null);
				}
			<?php } ?>
			djmarkers<?php echo $module->id; ?> = new Array();
			djbounds<?php echo $module->id; ?> = new google.maps.LatLngBounds();
        }

        for (let i = 0; i < items.length; i++) {
			if(items[i].icon_img){
				var size = new google.maps.Size(items[i].icon_size[0], items[i].icon_size[1]);
				var start_point = new google.maps.Point(0,0);
				var anchor_point = new google.maps.Point(items[i].icon_size[0]/2, items[i].icon_size[1]);
				var icon = new google.maps.MarkerImage(items[i].icon_img, size, start_point, anchor_point);
			}else{
				var icon = '';
			}

			var adLatlng = new google.maps.LatLng(items[i].latitude,items[i].longitude);
			djmarkers<?php echo $module->id; ?>.push(djmodMarker<?php echo $module->id; ?>(adLatlng,items[i].marker_txt,icon));
        }
				
		<?php if($params->get('layout','cluster') == 'cluster'){ ?>
			var mcOptions = {gridSize: 50, maxZoom: 14,styles: [{
			height: 53,url: "<?php echo Uri::base()?>components/com_djclassifieds/assets/mapclustering/images/m1.png",width: 53},
			{height: 56,url: "<?php echo Uri::base()?>components/com_djclassifieds/assets/mapclustering/images/m2.png",width: 56},
			{height: 66,url: "<?php echo Uri::base()?>components/com_djclassifieds/assets/mapclustering/images/m3.png",width: 66},
			{height: 78,url: "<?php echo Uri::base()?>components/com_djclassifieds/assets/mapclustering/images/m4.png",width: 78},
			{height: 90,url: "<?php echo Uri::base()?>components/com_djclassifieds/assets/mapclustering/images/m5.png",width: 90}]};
			djmarkerCluster<?php echo $module->id; ?> = new MarkerClusterer(djmap<?php echo $module->id; ?>, djmarkers<?php echo $module->id; ?>,mcOptions);
		<?php }else{ ?>
			// Create a map to count markers at same coordinates
			var coordsCount = new Map();
			djmarkers<?php echo $module->id; ?>.forEach(function(marker) {
				let coords = marker.getPosition().lat() + ',' + marker.getPosition().lng();
				coordsCount.set(coords, (coordsCount.get(coords) || 0) + 1);
			});

			djmarkers<?php echo $module->id; ?>.forEach(function(marker){
				let coords = marker.getPosition().lat() + ',' + marker.getPosition().lng();
				let count = coordsCount.get(coords);
				
				if (count > 1) {
					marker.txt = marker.txt.replace('</div>', '<br><br>+ <b>' + (count - 1) + '</b> <?php echo Text::_('MOD_DJCLASSIFIEDS_MAPS_MORE'); ?></div>');
				}
				marker.setMap(djmap<?php echo $module->id; ?>);
			});
		<?php } ?>

		<?php if($params->get('fit_to_items', '0')){ ?>
			var obj = djbounds<?php echo $module->id; ?>;
			var obj_in = obj[Object.keys(obj)[0]];
			if(obj_in[Object.keys(obj_in)[1]] != -1){
				djmap<?php echo $module->id; ?>.fitBounds(djbounds<?php echo $module->id; ?>);
			}
		<?php } ?>
	}

	<?php if($params->get('enable_places_search',0)){ ?>
		function djmodMapPlacesSearch<?php echo $module->id; ?>()
		{
			var input = (document.getElementById('pac-input<?php echo $module->id; ?>'));
			var aut_options = '';
			<?php if($params->get('api_country','')!=''){ ?>
				var aut_options = {					
						componentRestrictions: {country: '<?php echo $params->get('api_country',''); ?>'}
					};
			<?php } ?>
			var autocomplete = new google.maps.places.Autocomplete(input,aut_options);					 
			var infowindow = new google.maps.InfoWindow();
			var last_place = '';
				google.maps.event.addListener(autocomplete, 'place_changed', function() {	
					var place = autocomplete.getPlace(); //to get first on enter
					if (!place.geometry) {
						return;
					}
					
					if(place.geometry.viewport){
						djmap<?php echo $module->id; ?>.fitBounds(place.geometry.viewport);
					}else{
						djmap<?php echo $module->id; ?>.setCenter(place.geometry.location);
					}
				});
		}

		function getmodMAPDJLocation<?php echo $module->id; ?>()
		{	
			document.getElementById('user_pos<?php echo $module->id; ?>').addEventListener('click', function(event){
				if(navigator.geolocation){
					navigator.geolocation.getCurrentPosition(modMAPShowDJPosition<?php echo $module->id; ?>);
				}
			})
		}
			
		function modMAPShowDJPosition<?php echo $module->id; ?>(position)
		{
			setDJLocationCookie(position);
			var userLatlng = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
			djmap<?php echo $module->id; ?>.setCenter(userLatlng);				  	
		}
	<?php } ?>

	<?php if($params->get('start_geoloc','0')==1){ ?>	
		document.addEventListener('DOMContentLoaded', function(){
			if(navigator.geolocation){
				navigator.geolocation.getCurrentPosition(modSearchShowDJPosition<?php echo $module->id; ?>,
				function(error){
					console.log(error);         			
				}, {
					timeout: 30000, enableHighAccuracy: true, maximumAge: 90000
				});
			}
		});

		function modSearchShowDJPosition<?php echo $module->id; ?>(position)
		{
			var userLatlng = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
			djmap<?php echo $module->id; ?>.setCenter(userLatlng);		  	
		}
	<?php } ?>
			
</script>

Anon7 - 2022
AnonSec Team