File manager - Edit - /home/jardides/www/Jardi-design/plugins/pagebuilderck/googlemaplight/layouts/edit_googlemaplight.php
Back
<?php /** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2020. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr */ defined('_JEXEC') or die; $input = JFactory::getApplication()->input; ?> <div id="elementscontainer"> <div class="menulink" tab="tab_map"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_EDITION'); ?></div> <div class="tab menustyles ckproperty ckoption" id="tab_map"> <div class="menupanetitle"><?php echo JText::_('CK_ADDRESS'); ?></div> <div style="text-align:left;"> <input class="inputbox" type="text" value="" name="address" id="address" size="7" style="width:90%; min-width: 200px; clear:both;" /> <div style="text-align:center;">-- <?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_OR'); ?> --</div> <div style="display:flex;"> <div style="width:50%;"> <div class="menupanetitle"><?php echo JText::_('CK_LATITUDE'); ?></div> <input class="inputbox" type="text" value="" name="latitude" id="latitude" size="7" style="width:110px;" /> </div> <div style="width:50%;"> <div class="menupanetitle"><?php echo JText::_('CK_LONGITUDE'); ?></div> <input class="inputbox" type="text" value="" name="longitude" id="longitude" size="7" style="width:110px;" /> </div> </div> </div> <hr /> <div class="menupanetitle"><?php echo JText::_('CK_DIMENSIONS'); ?></div> <div style="text-align:left;clear:both;"> <div style="float:left;text-align:right;margin:5px 5px 0 0;line-height: 15px;;"><?php echo JText::_('CK_WIDTH'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>width.png" width="15" height="15" align="top" /></div><div style="float:left;"><input class="inputbox" type="text" name="mapwidth" id="mapwidth" size="2" value="100%" style="" onchange="ckUpdateMapPreview()" /></div><div style="float:left;text-align:left;margin-left:3px;"></div> <div style="float:left;text-align:right;margin:5px 5px 0 10px;line-height: 15px;;"><?php echo JText::_('CK_HEIGHT'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>height.png" width="15" height="15" align="top" /></div><div style="float:left;"><input class="inputbox" type="text" name="mapheight" id="mapheight" size="2" value="480px" style="" onchange="ckUpdateMapPreview()" /></div><div style="float:left;text-align:left;margin-left:3px;"></div> <br style="clear:both;"/> <div style="float:left;text-align:right;margin:5px 5px 0 0px;line-height: 15px;;"><?php echo JText::_('CK_ZOOM'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>magnifier.png" width="15" height="15" align="top" /></div><div style="float:left;"><input class="inputbox" type="text" name="mapzoom" id="mapzoom" size="2" value="8" style="" onchange="ckUpdateMapPreview()" /></div><div style="float:left;text-align:left;margin-left:3px;"></div> <div class="clr"></div> </div> <div style="text-align:left;clear:both;"> <div class="menupanetitle"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_MAPTYPE'); ?></div> <select class="inputbox" type="list" value="" name="maptype" id="maptype" style="width:30%; min-width: 200px; clear:both;" onchange="ckUpdateMapPreview()"> <option value="m"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_ROADMAP'); ?></option> <option value="k"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_SATELLITE'); ?></option> <option value="h"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_HYBRID'); ?></option> <option value="p"><?php echo JText::_('PLG_PAGEBUILDERCK_GOOGLEMAPLIGHT_TERRAIN'); ?></option> </select> </div> <div class="clr"></div> </div> <div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_STYLES'); ?></div> <div class="tab menustyles ckproperty" id="tab_blocstyles"> <?php echo $this->menustyles->createBlocStyles('bloc', 'map', '') ?> </div> </div> <div class="clr"></div> <script language="javascript" type="text/javascript"> var focus = $ck('.editfocus'); function ckLoadEditionPopup() { ckFillEditionPopup(focus.attr('id')); } function ckBeforeSaveEditionPopup() { ckUpdateMapPreview(); } function ckUpdateMapPreview() { var address = $ck('#elementscontainer').find("#address").val(); if (! address) { address = 'loc:' + $ck('#latitude').val() + '+' + $ck('#longitude').val(); } else { address = encodeURIComponent(address); } var link = 'https://maps.google.com/maps?q=' + address + '&output=embed&iwloc=near'; link += '&t=' + $ck('#maptype').val(); var mapzoom = $ck('#mapzoom').val() ? $ck('#mapzoom').val() : '8'; link += '&z=' + mapzoom; var mapw = $ck('#mapwidth').val() ? $ck('#mapwidth').val() : ''; var maph = $ck('#mapheight').val() ? $ck('#mapheight').val() : ''; focus.find('.googlemaplightck.inner').empty().append('<iframe src="' + link + '" frameborder="0" style="width: ' + mapw + '; height: ' + maph + '" />'); } /* * Method automatically called in ckCloseEditionPopup() if exists (needed if you are using an editor !!) */ // function ckBeforeCloseEditionPopup() { // var textID = 'markercontent'; // ckRemoveEditorOnTheFly(textID); // } // setup the map instance // var geocoder, map, marker; // var markers = []; function ckInitializeMap() { geocoder = new google.maps.Geocoder(); // var latlng = new google.maps.LatLng(48.856, 2.352); var latlng = {lat: 48.856, lng: 2.352}; // var latlng = {lat: -25.363, lng: 131.044}; var mapOptions = { zoom: 8, center: latlng, } map = new google.maps.Map(document.getElementById("mapck"), mapOptions); ckSetMarker(); } // translate the address to the LatLong values function ckSetMarker() { var address = $ck('#elementscontainer').find("#address").val(); if (!address && !$ck('#latitude').val() && !$ck('#longitude').val() ) return; if ($ck('#latitude').val() && $ck('#longitude').val()) { var latlng = new google.maps.LatLng($ck('#latitude').val(), $ck('#longitude').val()); } geoOpts = (latlng && !address) ? { 'location': latlng} : { 'address': address}; geocoder.geocode( geoOpts, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { $ck('#latitude').val(results[0].geometry.location.lat()); $ck('#longitude').val(results[0].geometry.location.lng()); map.setCenter(results[0].geometry.location); deleteMarkers(); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, title: $ck('#markertitle').val() }); var textID = 'markercontent'; ckSaveEditorOnTheFly(textID); var content = $ck('#markercontent').val(); content = ckEditorToContent(content); var infowindow = new google.maps.InfoWindow({ content: content }); marker.addListener($ck('#markershowon').val(), function() { infowindow.open(map, marker); }); markers.push(marker); } else { alert("Geocode was not successful for the following reason: " + status); } }); } // Sets the map on all markers in the array. function ckSetMapOnAll(map) { for (var i = 0; i < markers.length; i++) { markers[i].setMap(map); } } // Removes the markers from the map, but keeps them in the array. function ckClearMarkers() { ckSetMapOnAll(null); } // Shows any markers currently in the array. function showMarkers() { ckSetMapOnAll(map); } // Deletes all markers in the array by removing references to them. function deleteMarkers() { ckClearMarkers(); markers = []; } function _ckUpdateMapPreview() { var mapzoom = $ck('#mapzoom').val() ? $ck('#mapzoom').val() : '8'; map.setZoom(parseInt(mapzoom)); // map.setMapTypeId($ck('#maptype').val()); switch ($ck('#maptype').val()) { case 'google.maps.MapTypeId.ROADMAP' : default : map.setMapTypeId(google.maps.MapTypeId.ROADMAP); break; case 'google.maps.MapTypeId.SATELLITE' : map.setMapTypeId(google.maps.MapTypeId.SATELLITE); break; case 'google.maps.MapTypeId.HYBRID' : map.setMapTypeId(google.maps.MapTypeId.HYBRID); break; case 'google.maps.MapTypeId.TERRAIN' : map.setMapTypeId(google.maps.MapTypeId.TERRAIN); break; } map.setOptions({styles: $ck('#snazzymaps').val()}); var mapw = $ck('#mapwidth').val() ? $ck('#mapwidth').val() : ''; var maph = $ck('#mapheight').val() ? $ck('#mapheight').val() : ''; $ck('#previewareabloc #mapck').css('width', mapw).css('padding-bottom', maph).height('0'); $ck('.editfocus #mapck').css('width', mapw).css('padding-bottom', maph).height('0'); ckRefreshMap(); } function ckRefreshMap() { google.maps.event.trigger(map,'resize'); } </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings