Skip to content

Commit

Permalink
Merge pull request #13 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
Merge branch '2.4-develop' into '2.4'
  • Loading branch information
bdtrung authored Mar 23, 2021
2 parents 556ad11 + e0247bf commit 2ea82d3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 71 deletions.
52 changes: 26 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "mageplaza/module-google-maps",
"description": "Magento 2 Google Maps Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "1.0.4",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\GoogleMaps\\": ""
}
}
}
{
"name": "mageplaza/module-google-maps",
"description": "Magento 2 Google Maps Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "4.0.0",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\GoogleMaps\\": ""
}
}
}
56 changes: 28 additions & 28 deletions etc/adminhtml/menu.xml → etc/adminhtml/menu.xml--
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0"?>
<!--
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_GoogleMaps
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Mageplaza_GoogleMaps::googlemaps" title="Google Maps" module="Mageplaza_GoogleMaps" sortOrder="110" resource="Mageplaza_GoogleMaps::googlemaps" parent="Magento_Backend::content"/>
<add id="Mageplaza_GoogleMaps::configuration" title="Configuration" module="Mageplaza_GoogleMaps" sortOrder="1000" action="adminhtml/system_config/edit/section/mpgooglemaps" resource="Mageplaza_GoogleMaps::configuration" parent="Mageplaza_GoogleMaps::googlemaps"/>
</menu>
</config>
<?xml version="1.0"?>
<!--
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_GoogleMaps
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Mageplaza_GoogleMaps::googlemaps" title="Google Maps" module="Mageplaza_GoogleMaps" sortOrder="110" resource="Mageplaza_GoogleMaps::googlemaps" parent="Magento_Backend::content"/>
<add id="Mageplaza_GoogleMaps::configuration" title="Configuration" module="Mageplaza_GoogleMaps" sortOrder="1000" action="adminhtml/system_config/edit/section/mpgooglemaps" resource="Mageplaza_GoogleMaps::configuration" parent="Mageplaza_GoogleMaps::googlemaps"/>
</menu>
</config>
24 changes: 8 additions & 16 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
<resource>Mageplaza_GoogleMaps::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General</label>
<field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Select <b>Yes</b> to enable this module]]></comment>
</field>
<field id="contact_page" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="contact_page" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Insert on Contact Page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="position" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="position" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Position</label>
<source_model>Mageplaza\GoogleMaps\Model\Config\Source\System\Position</source_model>
<depends>
Expand All @@ -47,7 +47,7 @@
</group>
<group id="map_setting" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Map Settings</label>
<field id="protocol" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="protocol" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Protocol</label>
<source_model>Mageplaza\GoogleMaps\Model\Config\Source\System\Protocol</source_model>
</field>
Expand All @@ -58,29 +58,29 @@
</depends>
<comment><![CDATA[Get Google Map API <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">here</a>.]]></comment>
</field>
<field id="map_type" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="map_type" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Map Type</label>
<source_model>Mageplaza\GoogleMaps\Model\Config\Source\System\MapType</source_model>
<depends>
<field id="protocol">1</field>
</depends>
</field>
<field id="map_style" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="map_style" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Map Style</label>
<source_model>Mageplaza\GoogleMaps\Model\Config\Source\System\MapStyle</source_model>
<depends>
<field id="protocol">1</field>
</depends>
</field>
<field id="allow_drag" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="allow_drag" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Allow Map Dragging</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="protocol">1</field>
</depends>
<comment><![CDATA[Select <b>Yes</b> to allow dragging the map.]]></comment>
</field>
<field id="zoom_default" translate="label comment" type="text" sortOrder="60" showInWebsite="1" showInStore="1" showInDefault="1">
<field id="zoom_default" translate="label comment" type="text" sortOrder="60" showInWebsite="1" showInStore="1" showInDefault="1" canRestore="1">
<label>Zoom Default</label>
<validate>validate-zero-or-greater</validate>
<depends>
Expand Down Expand Up @@ -121,17 +121,9 @@
</field>
<field id="latitude" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Latitude</label>
<validate>required-entry</validate>
<comment><![CDATA[
<span><strong style="color:red">Warning</strong>: This field is <b>required</b></span>
]]></comment>
</field>
<field id="longitude" translate="label" type="text" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Longitude</label>
<validate>required-entry</validate>
<comment><![CDATA[
<span><strong style="color:red">Warning</strong>: This field is <b>required</b></span>
]]></comment>
</field>
</group>
</group>
Expand Down
2 changes: 2 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<position>1</position>
</general>
<map_setting>
<map_type>roadmap</map_type>
<map_style>default</map_style>
<protocol>1</protocol>
<allow_drag>0</allow_drag>
<zoom_default>20</zoom_default>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/map.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/** @var \Mageplaza\GoogleMaps\Block\Map $block */
?>
<?php if ($block->isEnabled()): ?>
<?php if ($block->getProtocol() === Mageplaza\GoogleMaps\Model\Config\Source\System\Protocol::API): ?>
<?php if ((int)$block->getProtocol() === Mageplaza\GoogleMaps\Model\Config\Source\System\Protocol::API): ?>
<div class="mpgooglemaps_review_map">
<div class="mpgooglemaps_map" id="mpgooglemaps_map_<?= $block->getNameInLayout() ?>"
style="height: 550px;width: 100%;margin: 15px 0;">
Expand Down

0 comments on commit 2ea82d3

Please sign in to comment.