File manager - Edit - /home/jardides/www/Jardi-design/old/plugins/pagebuilderck/openstreetmap/layouts/edit_openstreetmap.php
Back
<?php /** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2015. 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; $id = $input->get('ckid', '', 'string'); $plugin = JPluginHelper::getPlugin('pagebuilderck', 'openstreetmap'); $pluginParams = new JRegistry($plugin->params); ?> <div id="elementscontainer"> <div class="menulink" tab="tab_map"><?php echo JText::_('PLG_PAGEBUILDERCK_OPENSTREETMAP_EDITION'); ?></div> <div class="tab menustyles ckproperty " id="tab_map"> <div class="menustylesblocktitle"><?php echo JText::_('PLG_PAGEBUILDERCK_OPENSTREETMAP') ?></div> <div class="menustylesblockaccordion"> <div class="menupanetitle"> <?php if (! $pluginParams->get('apikey', '')) { ?> <a href="<?php echo JUri::root(true) ?>/administrator/index.php?option=com_plugins&view=plugins&filter_search=Page Builder CK - Open Street Map" target="_blank" style="color:red;"><?php echo JText::_('PLG_PAGEBUILDERCK_OPENSTREETMAP_API_KEY_EMPTY') ?></a> <?php } ?> </div> <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;" onchange="ckgetCoordinates()" /> <div class="menupanetitle"><?php echo JText::_('CK_LATITUDE'); ?></div> <input class="inputbox" type="text" value="" name="latitude" id="latitude" size="7" style="width:45%; min-width: 200px; clear:both;" onchange="$ck('#address').val('');ckUpdateMapPreview()" /> <div class="menupanetitle"><?php echo JText::_('CK_LONGITUDE'); ?></div> <input class="inputbox" type="text" value="" name="longitude" id="longitude" size="7" style="width:45%; min-width: 200px;" onchange="$ck('#address').val('');ckUpdateMapPreview();" /> </div> <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> <div style="float:left;text-align:right;margin:5px 5px 0 10px;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 class="clr"></div> </div> <div class="menustylesblocktitle"><?php echo JText::_('PLG_PAGEBUILDERCK_OPENSTREETMAP_MARKER') ?></div> <div class="menustylesblockaccordion"> <div class="menupanetitle"><?php echo JText::_('CK_TITLE'); ?></div> <div style="text-align:left;"> <input class="inputboxfake" type="text" value="" name="markertitle" id="markertitle" size="7" style="width:90%; min-width: 200px; clear:both;" onchange="ckSetMarker()" /> </div> <div class="menupanetitle"><?php echo JText::_('CK_CONTENT'); ?></div> <textarea id="markercontent" data-id="markercontent" name="markercontent"></textarea> <div class="menupanetitle"><?php echo JText::_('CK_SHOWON'); ?></div> <div style="text-align:left;"> <select class="inputbox" type="list" value="" name="markershowon" id="markershowon" style="width:90%; min-width: 200px; clear:both;" onchange="ckSetMarker()" > <option value="always"><?php echo JText::_('CK_ALWAYS'); ?></option> <option value="click"><?php echo JText::_('CK_CLICK'); ?></option> </select> </div> <div class="clr"></div> </div> <div id="previewareabloc" class="tab_fullscreen" style="background:#fff;"> <div class="ckstyle"></div> <div class="inner"> <div id="<?php echo $id; ?>_preview_map" class="openstreetmapck inner"> <div id="mapck" style="width:100%;height:480px;"></div> </div> </div> </div> <div style="text-align:center;"> <div class="ckbutton" onclick="ckUpdateMapPreview()"><?php echo JText::_('CK_REFRESH'); ?></div> </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 mapck, markerck; function ckLoadEditionPopup() { var focus = $ck('.editfocus'); // set the marker content var content = focus.find('.openstreetmapmarkercontentck').html(); content = ckContentToEditor(content); $ck('#markercontent').val(content); ckLoadEditorOnTheFly('markercontent'); // set the marker title $ck('#markertitle').val(focus.find('.openstreetmapmarkertitleck').html()); // $ck('#previewareabloc .ckstyle').html(focus.find('.ckstyle').html()); ckFillEditionPopup(focus.attr('id')); ckInitializeMap(); ckUpdateMapPreview(); } function ckBeforeSaveEditionPopup() { var focus = $ck('.editfocus'); // save the marker content var textID = 'markercontent'; ckSaveEditorOnTheFly(textID); var content = $ck('[data-id="' + textID + '"]').val(); content = ckEditorToContent(content); focus.find('.openstreetmapmarkercontentck').html(content); // save the marker title focus.find('.openstreetmapmarkertitleck').html($ck('#markertitle').val()); // update the map preview ckUpdateMapPreview(); ckSaveMarker(); } /* * Method automatically called in ckCloseEditionPopup() if exists (needed if you are using an editor !!) */ function ckBeforeCloseEditionPopup() { var textID = 'markercontent'; ckRemoveEditorOnTheFly(textID); } function ckInitializeMap() { mapck = L.map('mapck').setView(['44.5403', '-78.5463'], parseInt(mapzoom)); } // translate the address to the LatLong values function ckgetCoordinates() { var address = document.getElementById("address").value; if (!address && !$ck('#latitude').val() && !$ck('#longitude').val() ) return; var myurl ='https://api.opencagedata.com/geocode/v1/json?q=' + address + '&key=<?php echo $pluginParams->get('apikey', '') ?>&pretty=1&jsonp=pbckmap'; $ck.ajax({ url: myurl, dataType: 'jsonp', cache: false, jsonpCallback: "pbckmap", timeout: 20000, }).done(function(code) { $ck('#latitude').val(code.results[0].geometry.lat); $ck('#longitude').val(code.results[0].geometry.lng); ckUpdateMapPreview(); }).fail(function() { }); } function ckUpdateMapPreview() { var mapzoom = $ck('#mapzoom').val() ? $ck('#mapzoom').val() : '8'; // Initialize the map // This variable map is inside the scope of the jQuery function. // Now map reference the global map declared in the first line mapck.setView([$ck('#latitude').val(), $ck('#longitude').val()], parseInt(mapzoom)); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>', maxZoom: 18, id: 'mapbox.streets' }).addTo(mapck); window.setTimeout(ckRefreshMap, 2000); ckSetMarker(); } function ckRefreshMap() { mapck.invalidateSize(); ckShowMarker(); } function ckSetMarker() { if (! $ck('#markercontent').length) return; // set the marker var textID = 'markercontent'; // ckSaveEditorOnTheFly(textID); var content = $ck('#markercontent').val(); content = ckEditorToContent(content); var title = $ck('#markertitle').val(); // mapck.removeLayer(markerck); markerck = L.marker([$ck('#latitude').val(), $ck('#longitude').val()]).addTo(mapck); if (title || content) { markerck.bindPopup(title + '<br />' + content); ckShowMarker(); } ckRefreshMap(); } function ckSaveMarker() { var textID = 'markercontent'; ckSaveEditorOnTheFly(textID); } function ckShowMarker() { if (! markerck) return; if ($ck('#markershowon').val() == 'always') { markerck.openPopup(); } else { markerck.closePopup(); markerck.on('click', function() { markerck.openPopup() }); } } </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings