Commit d8b45c36 by 王东红

Merge branch 'master' of http://47.99.244.21:9999/root/joshine

parents 2c484922 2dd3a390
......@@ -28,17 +28,17 @@
require([
'jquery'
], function ($) {
$.fn.banner = function(options){ //fn是dom对象
$.fn.banner = function(options){
var that = this;
options = options || {};
this._obj = {
btn:options.btn===false ? false : true, //没传是undefined也是false
btn:options.btn===false ? false : true,
list:options.list===false ? false : true,
autoPlay:options.autoPlay===false ? false : true,
delayTime:options.delayTime || 2000,
moveTime:options.moveTime || 200,
index:options.index || 0,
iPrev:options.img.length-1,//可有可不有
iPrev:options.img.length-1,
img:options.img || [],
href:options.href || [],
};
......@@ -69,7 +69,7 @@
});
}
this._obj.init();
this._obj.leftClick=function () {//this是left
this._obj.leftClick=function () {
if (that._obj.index ==0){
that._obj.index = that._obj.img.length-1;
that._obj.iPrev=0;
......@@ -79,8 +79,7 @@
}
that._obj.btnMove(1);
}
//点击右边的按钮
this._obj.rightClick=function(){//this是right
this._obj.rightClick=function(){
if (that._obj.index ==that._obj.img.length-1){
that._obj.index = 0;
that._obj.iPrev=that._obj.img.length-1;
......@@ -197,7 +196,7 @@
}
$(".banner1").banner({
img: img_arr,
href: ["/hotsale.html", "/newarrivals.html"],
href: ["/shapewear", "/shapewear"],
btn: true,
list: true,
autoPlay: true,
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3e6bf64bfbd2224fc8f617fcd165743f",
"content-hash": "a754f5ae570068b0f437aebb03700209",
"packages": [
{
"name": "airwallex/payments-plugin-magento",
......@@ -4504,6 +4504,105 @@
"time": "2020-12-02T21:12:59+00:00"
},
{
"name": "mageplaza/module-core",
"version": "1.4.12",
"source": {
"type": "git",
"url": "https://github.com/mageplaza/module-core.git",
"reference": "85d1074fdee1259d438618c977ba6e21b76c4f39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mageplaza/module-core/zipball/85d1074fdee1259d438618c977ba6e21b76c4f39",
"reference": "85d1074fdee1259d438618c977ba6e21b76c4f39",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\Core\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"proprietary"
],
"authors": [
{
"name": "Mageplaza",
"email": "support@mageplaza.com",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"description": "Mageplaza Core for Magento 2",
"support": {
"issues": "https://github.com/mageplaza/module-core/issues",
"source": "https://github.com/mageplaza/module-core/tree/v1.4.12"
},
"time": "2022-05-30T03:41:05+00:00"
},
{
"name": "mageplaza/module-delete-orders",
"version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/mageplaza/magento-2-delete-orders.git",
"reference": "44bc6c2d219a24b66dd4c01d20f32b1f61733360"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mageplaza/magento-2-delete-orders/zipball/44bc6c2d219a24b66dd4c01d20f32b1f61733360",
"reference": "44bc6c2d219a24b66dd4c01d20f32b1f61733360",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\DeleteOrders\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"proprietary"
],
"authors": [
{
"name": "Mageplaza",
"email": "support@mageplaza.com",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"description": "Magento 2 Delete Orders extension",
"support": {
"issues": "https://github.com/mageplaza/magento-2-delete-orders/issues",
"source": "https://github.com/mageplaza/magento-2-delete-orders/tree/v4.0.1"
},
"time": "2021-08-16T10:06:54+00:00"
},
{
"name": "mageside/module-subscribe-at-checkout",
"version": "1.1.7",
"dist": {
......
......@@ -669,7 +669,7 @@ class Uploader
private function _setUploadFileId($fileId)
{
if (is_array($fileId)) {
$this->validateFileId($fileId);
//$this->validateFileId($fileId);
$this->_uploadType = self::MULTIPLE_STYLE;
$this->_file = $fileId;
} else {
......
......@@ -124,6 +124,7 @@ return array(
'8a9dc1de0ca7e01f3e08231539562f61' => $vendorDir . '/aws/aws-sdk-php/src/functions.php',
'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php',
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
'6b5b87bda6fedcf6ef8605219c8b67f2' => $vendorDir . '/mageplaza/module-core/registration.php',
'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
'103e25fab6e1520b3d5716d51befc8a8' => $vendorDir . '/swissup/module-breeze-integrations/registration.php',
'cbb1b03512ba520311d1592006f0c299' => $vendorDir . '/swissup/theme-frontend-breeze-blank/registration.php',
......@@ -132,6 +133,7 @@ return array(
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
'0b2ea8cc52669e97f3bdd7d78dcd8eb5' => $vendorDir . '/jajuma/module-webpimages/registration.php',
'eda65932675b68b5aee4503e0762d64d' => $vendorDir . '/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php',
'e4b1ce1168e0e22411ca45a875763ad0' => $vendorDir . '/mageplaza/module-delete-orders/registration.php',
'88ede69c0babb90b8d3e9e7a95ad0eb5' => $vendorDir . '/mageside/module-subscribe-at-checkout/registration.php',
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => $vendorDir . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
......
......@@ -68,6 +68,8 @@ return array(
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'Metadata\\' => array($vendorDir . '/jms/metadata/src'),
'Mageside\\SubscribeAtCheckout\\' => array($vendorDir . '/mageside/module-subscribe-at-checkout'),
'Mageplaza\\DeleteOrders\\' => array($vendorDir . '/mageplaza/module-delete-orders'),
'Mageplaza\\Core\\' => array($vendorDir . '/mageplaza/module-core'),
'Magento\\Tools\\Sanity\\' => array($baseDir . '/dev/build/publication/sanity/Magento/Tools/Sanity'),
'Magento\\Tools\\' => array($baseDir . '/dev/tools/Magento/Tools'),
'Magento\\TestFramework\\Utility\\' => array($baseDir . '/dev/tests/static/framework/Magento/TestFramework/Utility'),
......
......@@ -125,6 +125,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'8a9dc1de0ca7e01f3e08231539562f61' => __DIR__ . '/..' . '/aws/aws-sdk-php/src/functions.php',
'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php',
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
'6b5b87bda6fedcf6ef8605219c8b67f2' => __DIR__ . '/..' . '/mageplaza/module-core/registration.php',
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
'103e25fab6e1520b3d5716d51befc8a8' => __DIR__ . '/..' . '/swissup/module-breeze-integrations/registration.php',
'cbb1b03512ba520311d1592006f0c299' => __DIR__ . '/..' . '/swissup/theme-frontend-breeze-blank/registration.php',
......@@ -133,6 +134,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'8592c7b0947d8a0965a9e8c3d16f9c24' => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/autoload.php',
'0b2ea8cc52669e97f3bdd7d78dcd8eb5' => __DIR__ . '/..' . '/jajuma/module-webpimages/registration.php',
'eda65932675b68b5aee4503e0762d64d' => __DIR__ . '/..' . '/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php',
'e4b1ce1168e0e22411ca45a875763ad0' => __DIR__ . '/..' . '/mageplaza/module-delete-orders/registration.php',
'88ede69c0babb90b8d3e9e7a95ad0eb5' => __DIR__ . '/..' . '/mageside/module-subscribe-at-checkout/registration.php',
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => __DIR__ . '/..' . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
......@@ -229,6 +231,8 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'Monolog\\' => 8,
'Metadata\\' => 9,
'Mageside\\SubscribeAtCheckout\\' => 29,
'Mageplaza\\DeleteOrders\\' => 23,
'Mageplaza\\Core\\' => 15,
'Magento\\Tools\\Sanity\\' => 21,
'Magento\\Tools\\' => 14,
'Magento\\TestFramework\\Utility\\' => 30,
......@@ -613,6 +617,14 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
array (
0 => __DIR__ . '/..' . '/mageside/module-subscribe-at-checkout',
),
'Mageplaza\\DeleteOrders\\' =>
array (
0 => __DIR__ . '/..' . '/mageplaza/module-delete-orders',
),
'Mageplaza\\Core\\' =>
array (
0 => __DIR__ . '/..' . '/mageplaza/module-core',
),
'Magento\\Tools\\Sanity\\' =>
array (
0 => __DIR__ . '/../..' . '/dev/build/publication/sanity/Magento/Tools/Sanity',
......
......@@ -6668,6 +6668,111 @@
"install-path": "../magento/zendframework1"
},
{
"name": "mageplaza/module-core",
"version": "1.4.12",
"version_normalized": "1.4.12.0",
"source": {
"type": "git",
"url": "https://github.com/mageplaza/module-core.git",
"reference": "85d1074fdee1259d438618c977ba6e21b76c4f39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mageplaza/module-core/zipball/85d1074fdee1259d438618c977ba6e21b76c4f39",
"reference": "85d1074fdee1259d438618c977ba6e21b76c4f39",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"time": "2022-05-30T03:41:05+00:00",
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\Core\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"proprietary"
],
"authors": [
{
"name": "Mageplaza",
"email": "support@mageplaza.com",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"description": "Mageplaza Core for Magento 2",
"support": {
"issues": "https://github.com/mageplaza/module-core/issues",
"source": "https://github.com/mageplaza/module-core/tree/v1.4.12"
},
"install-path": "../mageplaza/module-core"
},
{
"name": "mageplaza/module-delete-orders",
"version": "4.0.1",
"version_normalized": "4.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/mageplaza/magento-2-delete-orders.git",
"reference": "44bc6c2d219a24b66dd4c01d20f32b1f61733360"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mageplaza/magento-2-delete-orders/zipball/44bc6c2d219a24b66dd4c01d20f32b1f61733360",
"reference": "44bc6c2d219a24b66dd4c01d20f32b1f61733360",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"mageplaza/module-core": "^1.4.5"
},
"time": "2021-08-16T10:06:54+00:00",
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\DeleteOrders\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"proprietary"
],
"authors": [
{
"name": "Mageplaza",
"email": "support@mageplaza.com",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"description": "Magento 2 Delete Orders extension",
"support": {
"issues": "https://github.com/mageplaza/magento-2-delete-orders/issues",
"source": "https://github.com/mageplaza/magento-2-delete-orders/tree/v4.0.1"
},
"install-path": "../mageplaza/module-delete-orders"
},
{
"name": "mageside/module-subscribe-at-checkout",
"version": "1.1.7",
"version_normalized": "1.1.7.0",
......
......@@ -3,7 +3,7 @@
'name' => 'magento/magento2ce',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '932207d218c95c847882fd23a97bf06d6f69ff1d',
'reference' => '5bb7eaa6d86e419c43ec37826b278d378f5628da',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -958,7 +958,7 @@
'magento/magento2ce' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '932207d218c95c847882fd23a97bf06d6f69ff1d',
'reference' => '5bb7eaa6d86e419c43ec37826b278d378f5628da',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -2233,6 +2233,24 @@
'aliases' => array(),
'dev_requirement' => false,
),
'mageplaza/module-core' => array(
'pretty_version' => '1.4.12',
'version' => '1.4.12.0',
'reference' => '85d1074fdee1259d438618c977ba6e21b76c4f39',
'type' => 'magento2-module',
'install_path' => __DIR__ . '/../mageplaza/module-core',
'aliases' => array(),
'dev_requirement' => false,
),
'mageplaza/module-delete-orders' => array(
'pretty_version' => '4.0.1',
'version' => '4.0.1.0',
'reference' => '44bc6c2d219a24b66dd4c01d20f32b1f61733360',
'type' => 'magento2-module',
'install_path' => __DIR__ . '/../mageplaza/module-delete-orders',
'aliases' => array(),
'dev_requirement' => false,
),
'mageside/module-subscribe-at-checkout' => array(
'pretty_version' => '1.1.7',
'version' => '1.1.7.0',
......
language: php
php:
- 7.0
- 7.1
sudo: required
dist: trusty
env:
global:
- COMPOSER_BIN_DIR=~/bin
- INTEGRATION_SETS=3
- NODE_JS_VERSION=6
- MAGENTO_HOST_NAME="magento2.travis"
- COMPOSER_MODULE=mageplaza/module-core
matrix:
- MAGENTO_VERSION=2.1.1 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.1.1 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.1.1 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.1.10 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.1.10 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.1.10 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.2 TEST_SUITE=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3
matrix:
exclude:
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static
cache:
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.nvm"
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- postfix
firefox: '46.0'
hosts:
- magento2.travis
before_install:
- git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION
- cd magento2
- bash ./dev/travis/before_install.sh
install:
- composer install --no-interaction --prefer-dist
- composer config repositories.test_target git https://github.com/${TRAVIS_REPO_SLUG}.git
- composer require $COMPOSER_MODULE dev-$TRAVIS_BRANCH
before_script:
#- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt
- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/static/js/blacklist/3rd-party.txt dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/
- bash ./dev/travis/before_script.sh
script:
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\Renderer;
/**
* Renderer image for admin form
* Add media path to url
*
* Class Image
* @package Mageplaza\Core\Block\Adminhtml\Renderer
*/
class Image extends \Magento\Framework\Data\Form\Element\Image
{
/**
* Get image preview url
*
* @return string
*/
protected function _getUrl()
{
$url = parent::_getUrl();
if ($this->getPath()) {
$url = $this->getPath() . '/' . trim($url, '/');
}
return $url;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config;
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Exception\LocalizedException;
use Mageplaza\Core\Helper\AbstractData;
use Mageplaza\Core\Helper\Validate;
/**
* Class Button
* @package Mageplaza\Core\Block\Adminhtml\System\Config
*/
class Button extends Field
{
/**
* @var string
*/
protected $_template = 'system/config/button.phtml';
/**
* @var AbstractData
*/
protected $_helper;
/**
* Button constructor.
*
* @param Context $context
* @param Validate $helper
* @param array $data
*/
public function __construct(
Context $context,
Validate $helper,
array $data = []
) {
$this->_helper = $helper;
parent::__construct($context, $data);
}
/**
* @return string
* @throws LocalizedException
*/
public function getButtonHtml()
{
$activeButton = $this->getLayout()
->createBlock(\Magento\Backend\Block\Widget\Button::class)
->setData([
'id' => 'mageplaza_module_active',
'label' => __('Activate Now'),
'onclick' => 'javascript:mageplazaModuleActive(); return false;',
]);
$cancelButton = $this->getLayout()
->createBlock(\Magento\Backend\Block\Widget\Button::class)
->setData([
'id' => 'mageplaza_module_update',
'label' => __('Update this license'),
'onclick' => 'javascript:mageplazaModuleUpdate(); return false;',
]);
return $activeButton->toHtml() . $cancelButton->toHtml();
}
/**
* Render button
*
* @param AbstractElement $element
*
* @return string
*/
public function render(AbstractElement $element)
{
// Remove scope label
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
/**
* @return string
*/
public function getButtonUrl()
{
return '';
}
/**
* Return element html
*
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$originalData = $element->getOriginalData();
$path = explode('/', $originalData['path']);
$this->addData(
[
'mp_is_active' => $this->_helper->isModuleActive($originalData['module_name']),
'mp_module_name' => $originalData['module_name'],
'mp_module_type' => $originalData['module_type'],
'mp_active_url' => $this->getUrl('mpcore/index/activate'),
'mp_free_config' => Validate::jsonEncode($this->_helper->getConfigValue('free/module') ?: []),
'mp_module_html_id' => implode('_', $path),
'mp_module_checkbox' => $this->_helper->getModuleCheckbox($originalData['module_name'])
]
);
return $this->_toHtml();
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Exception\LocalizedException;
/**
* Class Head
* @package Mageplaza\Core\Block\Adminhtml\System\Config
*/
class Compatibility extends Field
{
/**
* Render text
*
* @param AbstractElement $element
*
* @return string
* @throws LocalizedException
*/
public function render(AbstractElement $element)
{
$html = '';
if ($element->getComment()) {
$html .= '<div id="mp_compatibility" style="margin-left: 2em; width: 100%;padding: 10px; ">'
. $element->getComment()
. '</div>';
}
return $html;
}
/**
* Return element html
*
* @param AbstractElement $element
*
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config;
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Module\PackageInfoFactory;
use Mageplaza\Core\Helper\Validate;
/**
* Class Docs
* @package Mageplaza\Core\Block\Adminhtml\System\Config
*/
class Docs extends Field
{
/**
* @var Validate
*/
protected $helper;
/**
* @var PackageInfoFactory
*/
protected $_packageInfoFactory;
/**
* Docs constructor.
*
* @param Context $context
* @param Validate $helper
* @param PackageInfoFactory $packageInfoFactory
* @param array $data
*/
public function __construct(
Context $context,
Validate $helper,
PackageInfoFactory $packageInfoFactory,
array $data = []
) {
$this->helper = $helper;
$this->_packageInfoFactory = $packageInfoFactory;
parent::__construct($context, $data);
}
/**
* Render text
*
* @param AbstractElement $element
*
* @return string
*/
public function render(AbstractElement $element)
{
$html = '<td colspan="3" id="mageplaza-module-docs-id">
<div id="mageplaza-module-docs" class="mageplaza-module-messages">
<div class="messages">
<div class="message message-info">
<div data-ui-id="messages-message-info">
<ul style="margin: 0 0 0 2em;">
<li><a href="' . $this->getUrlByType($element) . '" target="_blank">' . __('User Guide') . '</a></li>
<li><a href="https://www.mageplaza.com/faqs/" target="_blank">' . __('FAQs') . '</a></li>
<li><a href="' . $this->getUrlByType($element, 'change_log') . '" target="_blank">' . __('Changelog') . '</a></li>
<li><a href="https://dashboard.mageplaza.com/license/" target="_blank">' . __('Check Latest Version') . '</a></li>
</ul>
</div>
</div>
</div>
</div>
</td>';
return $this->_decorateRowHtml($element, $html);
}
/**
* Return element html
*
* @param AbstractElement $element
*
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
/**
* @param $element
* @param string $type
*
* @return mixed
*/
public function getUrlByType($element, $type = 'user_guide')
{
$moduleName = $element->getOriginalData()['module_name'];
$packageName = $this->_packageInfoFactory->create()->getPackageName($moduleName);
$lowerCaseName = str_replace(['mageplaza/magento-2-', '-extension', 'mageplaza/module-'], '', $packageName);
$path = $this->helper->getModuleData($moduleName, $type) ?: str_replace('-m2', '', $lowerCaseName);
if(strpos($path, 'http') === false){
switch ($type) {
case 'user_guide':
$domain = 'http://docs.mageplaza.com/';
break;
case 'change_log':
$domain = 'https://www.mageplaza.com/releases/';
break;
default:
$domain = 'https://www.mageplaza.com/';
}
$path = $domain . $path . '/';
}
return $path;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config\Form\Field;
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Module\PackageInfoFactory;
/**
* Backend system config datetime field renderer
*/
class Version extends Field
{
/**
* @var PackageInfoFactory
*/
protected $_packageInfoFactory;
/**
* Version constructor.
*
* @param Context $context
* @param PackageInfoFactory $packageInfoFactory
* @param array $data
*/
public function __construct(
Context $context,
PackageInfoFactory $packageInfoFactory,
array $data = []
) {
$this->_packageInfoFactory = $packageInfoFactory;
parent::__construct($context, $data);
}
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$originalData = $element->getOriginalData();
$packageInfo = $this->_packageInfoFactory->create();
$version = $packageInfo->getVersion($originalData['module_name']);
return '<div class="control-value special">' . $version . '</div>';
}
/**
* @param AbstractElement $element
* @param string $html
*
* @return string
*/
protected function _decorateRowHtml(AbstractElement $element, $html)
{
return '<tr id="row_' . $element->getHtmlId() . '" class="row_mageplaza_module_version">' . $html . '</tr>';
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
/**
* Class Head
* @package Mageplaza\Core\Block\Adminhtml\System\Config
*/
class Head extends Field
{
/**
* Render text
*
* @param AbstractElement $element
*
* @return string
*/
public function render(AbstractElement $element)
{
$html = '';
if ($element->getComment()) {
$html .= '<div style="margin: auto; width: 40%;padding: 10px;">'
. $element->getComment()
. '</div>';
}
return $html;
}
/**
* Return element html
*
* @param AbstractElement $element
*
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Block\Adminhtml\System\Config;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
/**
* Class Message
* @package Mageplaza\Core\Block\Adminhtml\System\Config
*/
class Message extends Field
{
/**
* Render text
*
* @param AbstractElement $element
*
* @return string
*/
public function render(AbstractElement $element)
{
$html = '<td colspan="3" id="mageplaza-module-message-id">
<div id="mageplaza-module-messages" class="mageplaza-module-messages" style="display: none">
<div class="messages">
<div class="message message-error">
<div data-ui-id="messages-message-error"></div>
</div>
</div>
</div>
</td>';
return $this->_decorateRowHtml($element, $html);
}
/**
* Return element html
*
* @param AbstractElement $element
*
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Controller\Adminhtml\Index;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Config\Model\ResourceModel\Config;
use Magento\Framework\App\Config\ReinitableConfigInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Controller\ResultInterface;
use Mageplaza\Core\Helper\AbstractData;
use Mageplaza\Core\Helper\Validate;
use Mageplaza\Core\Model\ActivateFactory;
/**
* Class Activate
* @package Mageplaza\Core\Controller\Adminhtml\Index
*/
class Activate extends Action
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Mageplaza_Core::activate';
/**
* @var ActivateFactory
*/
protected $activateFactory;
/**
* @var Config
*/
protected $resourceConfig;
/**
* @var AbstractData
*/
protected $_coreHelper;
/**
* @var string
*/
protected $_moduleConfigPath;
/**
* Application config
*
* @var ScopeConfigInterface
*/
protected $_appConfig;
/**
* Activate constructor.
*
* @param Context $context
* @param Config $resourceConfig
* @param ReinitableConfigInterface $config
* @param Validate $helper
* @param ActivateFactory $activateFactory
*/
public function __construct(
Context $context,
Config $resourceConfig,
ReinitableConfigInterface $config,
Validate $helper,
ActivateFactory $activateFactory
) {
$this->activateFactory = $activateFactory;
$this->resourceConfig = $resourceConfig;
$this->_appConfig = $config;
$this->_coreHelper = $helper;
parent::__construct($context);
}
/**
* Execute view action
*
* @return ResultInterface
*/
public function execute()
{
$params = $this->getRequest()->getPost()->toArray();
if (!isset($params['extension'])) {
return $this->jsonResponse([
'success' => false,
'message' => __('Invalid data.')
]);
}
if ($path = $this->_coreHelper->getConfigModulePath($params['extension'])) {
$this->_moduleConfigPath = $path;
}
$activateModel = $this->activateFactory->create();
$result = $activateModel->activate($params);
if ($result['success']) {
$result['active'] = true;
$configSave = ['active' => 1];
if (isset($result['key']) && $result['key']) {
$configSave['product_key'] = $result['key'];
}
if ($this->_coreHelper->getModuleType($params['extension']) == '1') {
$freeInfo = [
'email' => $params['email'],
'name' => $params['name'],
'create' => $params['create'],
'subscribe' => $params['subscribe']
];
foreach ($freeInfo as $code => $value) {
$this->saveConfig('free/module/' . $code, $value, true);
}
$configSave += $freeInfo;
}
$this->saveConfig($configSave);
$this->_appConfig->reinit();
}
return $this->jsonResponse($result);
}
/**
* @param $result
*
* @return mixed
*/
protected function jsonResponse($result)
{
return $this->getResponse()->representJson(
Validate::jsonEncode($result)
);
}
/**
* @param $pathId
* @param null $value
* @param bool $isFullPath
* @param string $scope
* @param int $scopeId
*
* @return $this
*/
protected function saveConfig($pathId, $value = null, $isFullPath = false, $scope = 'default', $scopeId = 0)
{
if (is_array($pathId)) {
foreach ($pathId as $path => $pathValue) {
$this->saveConfig($path, $pathValue, $isFullPath, $scope, $scopeId);
}
return $this;
}
$this->resourceConfig->saveConfig(
$isFullPath ? $pathId : $this->buildConfigPath($pathId),
$value,
$scope,
$scopeId
);
return $this;
}
/**
* @param $pathId
*
* @return string
*/
protected function buildConfigPath($pathId)
{
return $this->_moduleConfigPath . '/module/' . $pathId;
}
/**
* @param $pathId
* @param bool $isFullPath
* @param string $scope
* @param int $scopeId
*
* @return $this
*/
protected function deleteConfig($pathId, $isFullPath = false, $scope = 'default', $scopeId = 0)
{
if (is_array($pathId)) {
foreach ($pathId as $path) {
$this->deleteConfig($path, $isFullPath, $scope, $scopeId);
}
return $this;
}
$this->resourceConfig->deleteConfig(
$isFullPath ? $pathId : $this->buildConfigPath($pathId),
$scope,
$scopeId
);
return $this;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Controller\Adminhtml\Index;
use Magento\Backend\App\Action;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\Controller\ResultInterface;
/**
* Class Userguide
* @package Mageplaza\Core\Controller\Adminhtml\Index
*/
class Userguide extends Action
{
/**
* Authorization level of a basic admin session
*/
const ADMIN_RESOURCE = 'Mageplaza_Core::userguide';
/**
* @return ResponseInterface|ResultInterface|void
*/
public function execute()
{
$this->_response->setRedirect(
'https://docs.mageplaza.com/?utm_source=configuration&utm_medium=link&utm_content=user-guide'
);
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Helper;
use Exception;
use Magento\Backend\App\Config;
use Magento\Framework\App\Area;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\App\State;
use Magento\Framework\Json\Helper\Data as JsonHelper;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\UrlInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;
/**
* Class AbstractData
* @package Mageplaza\Core\Helper
*/
class AbstractData extends AbstractHelper
{
const CONFIG_MODULE_PATH = 'mageplaza';
/**
* @type array
*/
protected $_data = [];
/**
* @type StoreManagerInterface
*/
protected $storeManager;
/**
* @type ObjectManagerInterface
*/
protected $objectManager;
/**
* @var Config
*/
protected $backendConfig;
/**
* @var array
*/
protected $isArea = [];
/**
* AbstractData constructor.
*
* @param Context $context
* @param ObjectManagerInterface $objectManager
* @param StoreManagerInterface $storeManager
*/
public function __construct(
Context $context,
ObjectManagerInterface $objectManager,
StoreManagerInterface $storeManager
) {
$this->objectManager = $objectManager;
$this->storeManager = $storeManager;
parent::__construct($context);
}
/**
* @param null $storeId
*
* @return bool
*/
public function isEnabled($storeId = null)
{
return $this->getConfigGeneral('enabled', $storeId);
}
/**
* @param string $code
* @param null $storeId
*
* @return mixed
*/
public function getConfigGeneral($code = '', $storeId = null)
{
$code = ($code !== '') ? '/' . $code : '';
return $this->getConfigValue(static::CONFIG_MODULE_PATH . '/general' . $code, $storeId);
}
/**
* @param string $field
* @param null $storeId
*
* @return mixed
*/
public function getModuleConfig($field = '', $storeId = null)
{
$field = ($field !== '') ? '/' . $field : '';
return $this->getConfigValue(static::CONFIG_MODULE_PATH . $field, $storeId);
}
/**
* @param $field
* @param null $scopeValue
* @param string $scopeType
*
* @return array|mixed
*/
public function getConfigValue($field, $scopeValue = null, $scopeType = ScopeInterface::SCOPE_STORE)
{
if ($scopeValue === null && !$this->isArea()) {
/** @var Config $backendConfig */
if (!$this->backendConfig) {
$this->backendConfig = $this->objectManager->get(\Magento\Backend\App\ConfigInterface::class);
}
return $this->backendConfig->getValue($field);
}
return $this->scopeConfig->getValue($field, $scopeType, $scopeValue);
}
/**
* @param $name
*
* @return null
*/
public function getData($name)
{
if (array_key_exists($name, $this->_data)) {
return $this->_data[$name];
}
return null;
}
/**
* @param $name
* @param $value
*
* @return $this
*/
public function setData($name, $value)
{
$this->_data[$name] = $value;
return $this;
}
/**
* @return mixed
*/
public function getCurrentUrl()
{
$model = $this->objectManager->get(UrlInterface::class);
return $model->getCurrentUrl();
}
/**
* @param $ver
* @param string $operator
*
* @return mixed
*/
public function versionCompare($ver, $operator = '>=')
{
$productMetadata = $this->objectManager->get(ProductMetadataInterface::class);
$version = $productMetadata->getVersion(); //will return the magento version
return version_compare($version, $ver, $operator);
}
/**
* @param $data
*
* @return string
*/
public function serialize($data)
{
if ($this->versionCompare('2.2.0')) {
return self::jsonEncode($data);
}
return $this->getSerializeClass()->serialize($data);
}
/**
* @param $string
*
* @return mixed
*/
public function unserialize($string)
{
if ($this->versionCompare('2.2.0')) {
return self::jsonDecode($string);
}
return $this->getSerializeClass()->unserialize($string);
}
/**
* Encode the mixed $valueToEncode into the JSON format
*
* @param mixed $valueToEncode
*
* @return string
*/
public static function jsonEncode($valueToEncode)
{
try {
$encodeValue = self::getJsonHelper()->jsonEncode($valueToEncode);
} catch (Exception $e) {
$encodeValue = '{}';
}
return $encodeValue;
}
/**
* Decodes the given $encodedValue string which is
* encoded in the JSON format
*
* @param string $encodedValue
*
* @return mixed
*/
public static function jsonDecode($encodedValue)
{
try {
$decodeValue = self::getJsonHelper()->jsonDecode($encodedValue);
} catch (Exception $e) {
$decodeValue = [];
}
return $decodeValue;
}
/**
* Is Admin Store
*
* @return bool
*/
public function isAdmin()
{
return $this->isArea(Area::AREA_ADMINHTML);
}
/**
* @param string $area
*
* @return mixed
*/
public function isArea($area = Area::AREA_FRONTEND)
{
if (!isset($this->isArea[$area])) {
/** @var State $state */
$state = $this->objectManager->get(\Magento\Framework\App\State::class);
try {
$this->isArea[$area] = ($state->getAreaCode() == $area);
} catch (Exception $e) {
$this->isArea[$area] = false;
}
}
return $this->isArea[$area];
}
/**
* @param $path
* @param array $arguments
*
* @return mixed
*/
public function createObject($path, $arguments = [])
{
return $this->objectManager->create($path, $arguments);
}
/**
* @param $path
*
* @return mixed
*/
public function getObject($path)
{
return $this->objectManager->get($path);
}
/**
* @return JsonHelper|mixed
*/
public static function getJsonHelper()
{
return ObjectManager::getInstance()->get(JsonHelper::class);
}
/**
* @return mixed
*/
protected function getSerializeClass()
{
return $this->objectManager->get('Zend_Serializer_Adapter_PhpSerialize');
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Helper;
use Exception;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\Exception\FileSystemException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Filesystem;
use Magento\Framework\Filesystem\Directory\ReadInterface;
use Magento\Framework\Filesystem\Directory\WriteInterface;
use Magento\Framework\Image\AdapterFactory;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\UrlInterface;
use Magento\MediaStorage\Model\File\UploaderFactory;
use Magento\Store\Model\StoreManagerInterface;
/**
* Class Media
* @package Mageplaza\Core\Helper
*/
class Media extends AbstractData
{
const TEMPLATE_MEDIA_PATH = 'mageplaza';
/**
* @var ReadInterface
*/
protected $mediaDirectory;
/**
* @var UploaderFactory
*/
protected $uploaderFactory;
/**
* @var AdapterFactory
*/
protected $imageFactory;
/**
* Media constructor.
*
* @param Context $context
* @param ObjectManagerInterface $objectManager
* @param StoreManagerInterface $storeManager
* @param Filesystem $filesystem
* @param UploaderFactory $uploaderFactory
* @param AdapterFactory $imageFactory
*
* @throws FileSystemException
*/
public function __construct(
Context $context,
ObjectManagerInterface $objectManager,
StoreManagerInterface $storeManager,
Filesystem $filesystem,
UploaderFactory $uploaderFactory,
AdapterFactory $imageFactory
) {
$this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->uploaderFactory = $uploaderFactory;
$this->imageFactory = $imageFactory;
parent::__construct($context, $objectManager, $storeManager);
}
/**
* @param $data
* @param string $fileName
* @param string $type
* @param null $oldImage
*
* @return $this
*/
public function uploadImage(&$data, $fileName = 'image', $type = '', $oldImage = null)
{
if (isset($data[$fileName]['delete']) && $data[$fileName]['delete']) {
if ($oldImage) {
try {
$this->removeImage($oldImage, $type);
} catch (Exception $e) {
$this->_logger->critical($e->getMessage());
}
}
$data['image'] = '';
} else {
try {
$uploader = $this->uploaderFactory->create(['fileId' => $fileName]);
$uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
$uploader->setAllowRenameFiles(true);
$uploader->setFilesDispersion(true);
$uploader->setAllowCreateFolders(true);
$path = $this->getBaseMediaPath($type);
$image = $uploader->save(
$this->mediaDirectory->getAbsolutePath($path)
);
if ($oldImage) {
$this->removeImage($oldImage, $type);
}
$data['image'] = $this->_prepareFile($image['file']);
} catch (Exception $e) {
$data['image'] = isset($data['image']['value']) ? $data['image']['value'] : '';
}
}
return $this;
}
/**
* @param $file
* @param $type
*
* @return $this
* @throws FileSystemException
*/
public function removeImage($file, $type)
{
$image = $this->getMediaPath($file, $type);
if ($this->mediaDirectory->isFile($image)) {
$this->mediaDirectory->delete($image);
}
return $this;
}
/**
* @param $file
* @param string $type
*
* @return string
*/
public function getMediaPath($file, $type = '')
{
return $this->getBaseMediaPath($type) . '/' . $this->_prepareFile($file);
}
/**
* @param string $type
*
* @return string
*/
public function getBaseMediaPath($type = '')
{
return trim(static::TEMPLATE_MEDIA_PATH . '/' . $type, '/');
}
/**
* @param string $file
*
* @return string
*/
protected function _prepareFile($file)
{
return ltrim(str_replace('\\', '/', $file), '/');
}
/**
* @param $file
* @param $size
* @param string $type
* @param bool $keepRatio
*
* @return string
* @throws NoSuchEntityException
*/
public function resizeImage($file, $size, $type = '', $keepRatio = true)
{
$image = $this->getMediaPath($file, $type);
if (!($imageSize = $this->correctImageSize($size))) {
return $this->getMediaUrl($image);
}
list($width, $height) = $imageSize;
$resizeImage = $this->getMediaPath($file, ($type ? $type . '/' : '') . 'resize/' . $width . 'x' . $height);
/** @var WriteInterface $mediaDirectory */
$mediaDirectory = $this->getMediaDirectory();
if ($mediaDirectory->isFile($resizeImage)) {
$image = $resizeImage;
} else {
$imageResize = $this->imageFactory->create();
$imageResize->open($mediaDirectory->getAbsolutePath($image));
$imageResize->constrainOnly(true);
$imageResize->keepTransparency(true);
$imageResize->keepFrame(false);
$imageResize->keepAspectRatio($keepRatio);
$imageResize->resize($width, $height);
try {
$imageResize->save($mediaDirectory->getAbsolutePath($resizeImage));
$image = $resizeImage;
} catch (Exception $e) {
$this->_logger->critical($e->getMessage());
}
}
return $this->getMediaUrl($image);
}
/**
* @param $size
*
* @return array|bool
*/
protected function correctImageSize($size)
{
if (!$size) {
return false;
}
if (strpos($size, 'x') === false) {
$width = $height = (int) $size;
} else {
list($width, $height) = explode('x', $size);
}
if (!$width && !$height) {
return false;
}
return [(int) $width ?: null, (int) $height ?: null];
}
/**
* @param $file
*
* @return string
* @throws NoSuchEntityException
*/
public function getMediaUrl($file)
{
return $this->getBaseMediaUrl() . '/' . $this->_prepareFile($file);
}
/**
* @return string
* @throws NoSuchEntityException
*/
public function getBaseMediaUrl()
{
return rtrim($this->storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_MEDIA), '/');
}
/**
* @return WriteInterface
*/
public function getMediaDirectory()
{
return $this->mediaDirectory;
}
/**
* @param $path
*
* @return $this
* @throws FileSystemException
*/
public function removePath($path)
{
$pathMedia = $this->mediaDirectory->getRelativePath($path);
if ($this->mediaDirectory->isDirectory($pathMedia)) {
$this->mediaDirectory->delete($path);
}
return $this;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Helper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\Module\ModuleListInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Store\Model\StoreManagerInterface;
/**
* Class AbstractData
* @package Mageplaza\Core\Helper
*/
class Validate extends AbstractData
{
const MODULE_TYPE_FREE = 1;
const MODULE_TYPE_PAID = 2;
// const DEV_ENV = ['localhost', 'dev', '127.0.0.1', '192.168.', 'demo.'];
const DEV_ENV = [];
/**
* @var array
*/
protected $configModulePath = [];
/**
* @var array
*/
protected $_mageplazaModules;
/**
* @var ModuleListInterface
*/
protected $_moduleList;
/**
* Validate constructor.
*
* @param Context $context
* @param ObjectManagerInterface $objectManager
* @param StoreManagerInterface $storeManager
* @param ModuleListInterface $moduleList
*/
public function __construct(
Context $context,
ObjectManagerInterface $objectManager,
StoreManagerInterface $storeManager,
ModuleListInterface $moduleList
) {
$this->_moduleList = $moduleList;
parent::__construct($context, $objectManager, $storeManager);
}
/**
* @param $moduleName
*
* @return bool
*/
public function needActive($moduleName)
{
$type = $this->getModuleType($moduleName);
return $type && $type === self::MODULE_TYPE_FREE;
}
/**
* @param $moduleName
*
* @return mixed
*/
public function getModuleType($moduleName)
{
return (int) $this->getModuleData($moduleName, 'type') ?: self::MODULE_TYPE_PAID;
}
/**
* @param $moduleName
* @param string $field
*
* @return array|mixed
*/
public function getModuleData($moduleName, $field = '')
{
$configModulePath = $this->getConfigModulePath($moduleName);
return $this->getConfigValue($configModulePath . '/module/' . $field);
}
/**
* @param $moduleName
*
* @return bool
*/
public function getConfigModulePath($moduleName)
{
if (!isset($this->configModulePath[$moduleName])) {
$this->configModulePath[$moduleName] = false;
$helperClassName = str_replace('_', '\\', $moduleName) . '\Helper\Data';
if (class_exists($helperClassName)) {
$helper = $this->objectManager->get($helperClassName);
if ($helper instanceof AbstractData) {
$this->configModulePath[$moduleName] = $helper::CONFIG_MODULE_PATH;
}
}
}
return $this->configModulePath[$moduleName];
}
/**
* @param $moduleName
*
* @return bool
*/
public function isModuleActive($moduleName)
{
return $this->getModuleData($moduleName, 'active') && $this->getModuleData($moduleName, 'product_key');
}
/**
* @param $moduleName
*
* @return string
*/
public function getModuleCheckbox($moduleName)
{
$create = $this->getModuleData($moduleName, 'create');
if ($create === null) {
$create = 1;
}
$subscribe = $this->getModuleData($moduleName, 'subscribe');
if ($subscribe === null) {
$subscribe = 1;
}
return self::jsonEncode([
'create' => (int) $create,
'subscribe' => (int) $subscribe
]);
}
/**
* @return array
*/
public function getModuleList()
{
if ($this->_mageplazaModules === null) {
$this->_mageplazaModules = [];
$allowList = true;
$hostName = $this->_urlBuilder->getBaseUrl();
foreach (self::DEV_ENV as $env) {
if (strpos($hostName, $env) !== false) {
$allowList = false;
break;
}
}
if ($allowList) {
$moduleList = $this->_moduleList->getNames();
foreach ($moduleList as $name) {
if (strpos($name, 'Mageplaza_') === false) {
continue;
}
$this->_mageplazaModules[] = $name;
}
}
}
return $this->_mageplazaModules;
}
}
Copyright © 2016-present Mageplaza Co. Ltd.
This License is entered by Mageplaza to govern the usage or redistribution of Mageplaza software. This is a legal agreement between you (either an individual or a single entity) and Mageplaza for Mageplaza software product(s) which may include extensions, templates and services.
By purchasing, installing, or otherwise using Mageplaza products, you acknowledge that you have read this License and agree to be bound by the terms of this Agreement. If you do not agree to the terms of this License, do not install or use Mageplaza products.
The Agreement becomes effective at the moment when you acquire software from our site or receive it through email or on data medium or by any other means. Mageplaza reserves the right to make reasonable changes to the terms of this license agreement and impose its clauses at any given time.
1. GRANT OF LICENSE: By purchasing a product of Mageplaza:
1. Customer will receive source code open 100%.
2. Customer will obtain a License Certificate which will remain valid until the Customer stops using the Product or until Mageplaza terminates this License because of Customer’s failure to comply with any of its Terms and Conditions. Each License Certificate includes a license serial which is valid for one live Magento installation only and unlimited test Magento installations.
3. You are allowed to customize our products to fit with your using purpose.
4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS
5. Installation and Use
6. For each new Software installation, you are obliged to purchase a separate License. You are not permitted to use any part of the code in whole or part in any other software or product or website. You are legally bound to preserve the copyright information intact including the text/link at bottom.
2. Distribution: You are not allowed to distribute Mageplaza software to third parties. Any distribution without our permission, including non commercial distribution is considered as violation of this Agreement and entails liability, according to the current law. You may not place the Software onto a server that allows access to the Software via a public network or the Internet for distribution purposes.
3. Rental: You may not give, sell, sub-license, rent, lease or lend any portion of the Software to anyone.
4. Compliance with Applicable Laws: You must comply with all applicable laws regarding use of software products. Mageplaza software and a portion of it are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Accordingly, customer is required to treat the software like any other copyrighted material. Any activity violating copyright law will be prosecuted according to the current law. We retain the right to revoke the license of any user holding an invalid license.
5. TERMINATION: Without prejudice to any other rights, Mageplaza may terminate this License at any time if you fail to comply with the terms and conditions of this License. In such event, it constitutes a breach of the agreement, and your license to use the program is revoked and you must destroy all copies of Mageplaza products in your possession. After being notified of termination of your license, if you continue to use Mageplaza software, you hereby agree to accept an injunction to prevent you from its further use and to pay all costs (including but not limited to reasonable attorney fees) to enforce our revocation of your license and any damages suffered by us because of your misuse of the Software. We are not bound to return you the amount spent for purchase of the Software for the termination of this License.
6. LIMITATION OF LIABILITY: In no event shall Mageplaza be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the Mageplaza products, even if Mageplaza has been advised of the possibility of such damages. In no event will Mageplaza be liable for prosecution arising from use of the Software against law or for any illegal use.
The latest License: https://www.mageplaza.com/LICENSE.txt
\ No newline at end of file
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model;
use Exception;
use Magento\Framework\DataObject;
use Magento\Framework\HTTP\Adapter\CurlFactory;
use Mageplaza\Core\Helper\AbstractData;
use Zend_Http_Client;
use Zend_Http_Response;
/**
* Class Activate
* @package Mageplaza\Core\Model
*/
class Activate extends DataObject
{
/**
* Localhost maybe not active via https
* @inheritdoc
*/
const MAGEPLAZA_ACTIVE_URL = 'https://dashboard.mageplaza.com/license/index/activate/?isAjax=true';
/**
* @var CurlFactory
*/
protected $curlFactory;
/**
* Activate constructor.
*
* @param CurlFactory $curlFactory
* @param array $data
*/
public function __construct(
CurlFactory $curlFactory,
array $data = []
) {
$this->curlFactory = $curlFactory;
parent::__construct($data);
}
/**
* @param array $params
*
* @return array
*/
public function activate($params = [])
{
$result = ['success' => false];
$curl = $this->curlFactory->create();
$curl->write(
Zend_Http_Client::POST,
self::MAGEPLAZA_ACTIVE_URL,
'1.1',
[],
http_build_query($params)
);
try {
$resultCurl = $curl->read();
if (empty($resultCurl)) {
$result['message'] = __('Cannot connect to server. Please try again later.');
} else {
$responseBody = Zend_Http_Response::extractBody($resultCurl);
$result += AbstractData::jsonDecode($responseBody);
if (isset($result['status']) && in_array($result['status'], [200, 201])) {
$result['success'] = true;
}
}
} catch (Exception $e) {
$result['message'] = $e->getMessage();
}
$curl->close();
return $result;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model\Config\Backend;
use Magento\Config\Model\ResourceModel\Config\Data;
use Magento\Framework\App\Cache\Type\Block;
use Magento\Framework\App\Cache\Type\Config;
use Magento\Framework\App\Config\Value;
/**
* Class Menu
* @package Mageplaza\Core\Model\Config\Backend
*/
class Menu extends Value
{
/**
* @var string
*/
protected $_resourceName = Data::class;
/**
* {@inheritdoc}
*/
public function afterSave()
{
if ($this->isValueChanged()) {
$this->cacheTypeList->cleanType(Block::TYPE_IDENTIFIER);
$this->cacheTypeList->cleanType(Config::TYPE_IDENTIFIER);
}
return parent::afterSave();
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model\Config\Source;
use Magento\Framework\Option\ArrayInterface;
/**
* Class AbstractSource
* @package Mageplaza\Core\Model\Config\Source
*/
abstract class AbstractSource implements ArrayInterface
{
/**
* Options getter
*
* @return array
*/
public function toOptionArray()
{
$options = [];
foreach ($this->toArray() as $value => $label) {
$options[] = compact('value', 'label');
}
return $options;
}
/**
* Get options in "key-value" format
*
* @return array
*/
abstract public function toArray();
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model\Config\Source;
/**
* Class NoticeType
* @package Mageplaza\Core\Model\Config\Source
*/
class NoticeType extends AbstractSource
{
const TYPE_ANNOUNCEMENT = 'announcement';
const TYPE_NEWUPDATE = 'new_update';
const TYPE_MARKETING = 'marketing';
/**
* Get options in "key-value" format
*
* @return array
*/
public function toArray()
{
return [
self::TYPE_ANNOUNCEMENT => __('Announcement'),
self::TYPE_NEWUPDATE => __('New & Update extensions'),
self::TYPE_MARKETING => __('Promotions ')
];
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model\Config\Structure;
use Magento\Config\Model\Config\Structure\Data as StructureData;
use Mageplaza\Core\Block\Adminhtml\System\Config\Button;
use Mageplaza\Core\Block\Adminhtml\System\Config\Docs;
use Mageplaza\Core\Block\Adminhtml\System\Config\Form\Field\Version;
use Mageplaza\Core\Block\Adminhtml\System\Config\Message;
use Mageplaza\Core\Helper\Validate as Helper;
/**
* Plugin to add 'Module Information' group to each modules (before general group)
*
* Class Data
* @package Mageplaza\Core\Model\Config\Structure
*/
class Data
{
/**
* @var Helper
*/
protected $_helper;
/**
* Data constructor.
*
* @param Helper $helper
*/
public function __construct(Helper $helper)
{
$this->_helper = $helper;
}
/**
* @param StructureData $object
* @param array $config
*
* @return array
*/
public function beforeMerge(StructureData $object, array $config)
{
if (!isset($config['config']['system'])) {
return [$config];
}
/** @var array $sections */
$sections = $config['config']['system']['sections'];
foreach ($sections as $sectionId => $section) {
if (isset($section['tab']) && ($section['tab'] === 'mageplaza') && ($section['id'] !== 'mageplaza')) {
foreach ($this->_helper->getModuleList() as $moduleName) {
if ($section['id'] !== $this->_helper->getConfigModulePath($moduleName)) {
continue;
}
$dynamicGroups = $this->getDynamicConfigGroups($moduleName, $section['id']);
if (!empty($dynamicGroups)) {
$config['config']['system']['sections'][$sectionId]['children'] = $dynamicGroups + $section['children'];
}
break;
}
}
}
return [$config];
}
/**
* @param $moduleName
* @param $sectionName
*
* @return mixed
*/
protected function getDynamicConfigGroups($moduleName, $sectionName)
{
$defaultFieldOptions = [
'type' => 'text',
'showInDefault' => '1',
'showInWebsite' => '0',
'showInStore' => '0',
'sortOrder' => 1,
'module_name' => $moduleName,
'module_type' => $this->_helper->getModuleType($moduleName),
'validate' => 'required-entry',
'_elementType' => 'field',
'path' => $sectionName . '/module'
];
$type = $this->_helper->getModuleType($moduleName);
$fields = [];
foreach ($this->getFieldList() as $id => $option) {
if (isset($option['show']) && $option['show'] !== $type) {
continue;
}
$fields[$id] = array_merge($defaultFieldOptions, ['id' => $id], $option);
}
return [
'module' => [
'id' => 'module',
'label' => __('Module Information'),
'showInDefault' => '1',
'showInWebsite' => '0',
'showInStore' => '0',
'_elementType' => 'group',
'path' => $sectionName,
'children' => $fields
]
];
}
/**
* @return array
*/
protected function getFieldList()
{
return [
'docs' => [
'frontend_model' => Docs::class,
],
'notice' => [
'frontend_model' => Message::class,
],
'version' => [
'type' => 'label',
'label' => __('Version'),
'frontend_model' => Version::class,
],
'name' => [
'label' => __('Register Name'),
'frontend_class' => 'mageplaza-module-active-field-free mageplaza-module-active-name',
'show' => Helper::MODULE_TYPE_FREE
],
'email' => [
'label' => __('Register Email'),
'validate' => 'required-entry validate-email',
'frontend_class' => 'mageplaza-module-active-field-free mageplaza-module-active-email',
'comment' => __('This email will be used to create a new account at Mageplaza.com, Mageplaza help desk (to get priority support).'),
'show' => Helper::MODULE_TYPE_FREE
],
'product_key' => [
'label' => __('Product Key'),
'frontend_class' => 'mageplaza-module-active-field-key',
'show' => Helper::MODULE_TYPE_FREE
],
'button' => [
'frontend_model' => Button::class,
'show' => Helper::MODULE_TYPE_FREE
]
];
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model;
/**
* Class Feed
* @package Mageplaza\Core\Model
*/
class Feed extends \Magento\AdminNotification\Model\Feed
{
/**
* @inheritdoc
*/
const MAGEPLAZA_FEED_URL = 'www.mageplaza.com/notifications.xml';
/**
* @inheritdoc
*/
public function getFeedUrl()
{
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
if ($this->_feedUrl === null) {
$this->_feedUrl = $httpPath . self::MAGEPLAZA_FEED_URL;
}
return $this->_feedUrl;
}
/**
* @inheritdoc
*/
public function checkUpdate()
{
if (!(boolean) $this->_backendConfig->getValue('mageplaza/general/notice_enable')) {
return $this;
}
return parent::checkUpdate();
}
/**
* @inheritdoc
*/
public function getFeedData()
{
$type = $this->_backendConfig->getValue('mageplaza/general/notice_type');
if (!$type) {
return false;
}
$feedXml = parent::getFeedData();
if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
$typeArray = explode(',', $type);
$noteToRemove = [];
foreach ($feedXml->channel->item as $item) {
if (!in_array((string) $item->type, $typeArray)) {
$noteToRemove[] = $item;
}
}
foreach ($noteToRemove as $item) {
unset($item[0]);
}
}
return $feedXml;
}
/**
* @inheritdoc
*/
public function getLastUpdate()
{
return $this->_cacheManager->load('mageplaza_notifications_lastcheck');
}
/**
* @inheritdoc
*/
public function setLastUpdate()
{
$this->_cacheManager->save(time(), 'mageplaza_notifications_lastcheck');
return $this;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Model\Message;
use Magento\Framework\Notification\MessageInterface;
use Magento\Framework\Phrase;
use Magento\Framework\UrlInterface;
use Mageplaza\Core\Helper\Validate as ValidateHelper;
/**
* Class Validate
* @package Mageplaza\Core\Model\Message
*/
class Validate implements MessageInterface
{
/**
* @var ValidateHelper
*/
protected $_helper;
/**
* @var UrlInterface
*/
protected $urlBuilder;
/**
* @var array
*/
protected $_needActiveModules = [];
/**
* Validate constructor.
*
* @param ValidateHelper $helper
* @param UrlInterface $urlBuilder
*/
public function __construct(
ValidateHelper $helper,
UrlInterface $urlBuilder
) {
$this->_helper = $helper;
$this->urlBuilder = $urlBuilder;
}
/**
* Check whether all extensions are valid or not
*
* @return bool
*/
public function isDisplayed()
{
$notActiveModules = $this->getModules();
return (bool) count($notActiveModules);
}
/**
* @return array
*/
public function getModules()
{
if (empty($this->_needActiveModules)) {
$moduleLists = $this->_helper->getModuleList();
foreach ($moduleLists as $module) {
if ($this->_helper->needActive($module) && !$this->_helper->isModuleActive($module)) {
$this->_needActiveModules[] = $module;
}
}
}
return $this->_needActiveModules;
}
/**
* Retrieve unique message identity
*
* @return string
*/
public function getIdentity()
{
return hash('md5', 'MAGEPLAZA_VALIDATE_MESSAGE');
}
/**
* Retrieve message text
*
* @return Phrase|string
*/
public function getText()
{
$modules = $this->getModules();
if (empty($modules)) {
return '';
}
$sectionName = $this->_helper->getConfigModulePath($modules[0]);
$url = $this->urlBuilder->getUrl('adminhtml/system_config/edit', ['section' => $sectionName]);
return __(
'One or more Mageplaza extensions are not validated. Click <a href="%1">here</a> to validate them.',
$url
);
}
/**
* Retrieve message severity
*
* @return int
*/
public function getSeverity()
{
return self::SEVERITY_MAJOR;
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Observer;
use Magento\Backend\Model\Auth\Session;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Mageplaza\Core\Helper\AbstractData;
use Mageplaza\Core\Model\Feed;
/**
* Class PredispatchAdminActionControllerObserver
* @package Mageplaza\Core\Observer
*/
class PredispatchAdminActionControllerObserver implements ObserverInterface
{
/**
* @type Session
*/
protected $_backendAuthSession;
/**
* @var AbstractData
*/
protected $helper;
/**
* PredispatchAdminActionControllerObserver constructor.
*
* @param Session $backendAuthSession
* @param AbstractData $helper
*/
public function __construct(
Session $backendAuthSession,
AbstractData $helper
) {
$this->_backendAuthSession = $backendAuthSession;
$this->helper = $helper;
}
/**
* @param Observer $observer
*/
public function execute(Observer $observer)
{
if ($this->_backendAuthSession->isLoggedIn()
&& $this->helper->isModuleOutputEnabled('Magento_AdminNotification')) {
/* @var $feedModel Feed */
$feedModel = $this->helper->createObject(Feed::class);
$feedModel->checkUpdate();
}
}
}
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Core\Plugin;
use Magento\Backend\Model\Menu\Builder\AbstractCommand;
use Mageplaza\Core\Helper\AbstractData;
/**
* Class MoveMenu
* @package Mageplaza\Core\Plugin
*/
class MoveMenu
{
const MAGEPLAZA_CORE = 'Mageplaza_Core::menu';
/**
* @var AbstractData
*/
protected $helper;
/**
* MoveMenu constructor.
*
* @param AbstractData $helper
*/
public function __construct(AbstractData $helper)
{
$this->helper = $helper;
}
/**
* @param AbstractCommand $subject
* @param $itemParams
*
* @return mixed
*/
public function afterExecute(AbstractCommand $subject, $itemParams)
{
if ($this->helper->getConfigGeneral('menu')) {
if (strpos($itemParams['id'], 'Mageplaza_') !== false
&& isset($itemParams['parent'])
&& strpos($itemParams['parent'], 'Mageplaza_') === false) {
$itemParams['parent'] = self::MAGEPLAZA_CORE;
}
} elseif ((isset($itemParams['id']) && $itemParams['id'] === self::MAGEPLAZA_CORE)
|| (isset($itemParams['parent']) && $itemParams['parent'] === self::MAGEPLAZA_CORE)) {
$itemParams['removed'] = true;
}
return $itemParams;
}
}
# Mageplaza Core for Magento 2
[![Latest Stable Version](https://poser.pugx.org/mageplaza/module-core/v/stable)](https://packagist.org/packages/mageplaza/module-core)
[![Total Downloads](https://poser.pugx.org/mageplaza/module-core/downloads)](https://packagist.org/packages/mageplaza/module-core)
## How to install & upgrade Mageplaza_Core
### 1. Install via composer (recommend)
We recommend you to install Mageplaza_Core module via composer. It is easy to install, update and maintaince.
Run the following command in Magento 2 root folder.
#### 1.1 Install
```
composer require mageplaza/module-core
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```
#### 1.2 Upgrade
```
composer update mageplaza/module-core
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```
Run compile if your store in Product mode:
```
php bin/magento setup:di:compile
```
### 2. Copy and paste
If you don't want to install via composer, you can use this way.
- Download [the latest version here](https://github.com/mageplaza/module-core/archive/master.zip)
- Extract `master.zip` file to `app/code/Mageplaza/Core` ; You should create a folder path `app/code/Mageplaza/Core` if not exist.
- Go to Magento root folder and run upgrade command line to install `Mageplaza_Core`:
```
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```
{
"name": "mageplaza/module-core",
"description": "Mageplaza Core for Magento 2",
"type": "magento2-module",
"version": "1.4.12",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "support@mageplaza.com",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\Core\\": ""
}
}
}
<?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_Core
* @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:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Mageplaza_Core::menu" title="Mageplaza Extensions" sortOrder="50">
<resource id="Mageplaza_Core::documentation" title="Documentations" sortOrder="50">
<resource id="Mageplaza_Core::userguide" title="User Guides" sortOrder="50"/>
</resource>
<resource id="Mageplaza_Core::activate" title="Active Module" sortOrder="70"/>
</resource>
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Mageplaza_Core::configuration" title="Mageplaza Information" sortOrder="10"/>
<resource id="Mageplaza_Core::marketplace" title="Mageplaza Marketplace" sortOrder="10"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</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_Core
* @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:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\Notification\MessageList">
<arguments>
<argument name="messages" xsi:type="array">
<item name="mageplaza_validate_message" xsi:type="string">Mageplaza\Core\Model\Message\Validate</item>
</argument>
</arguments>
</type>
<type name="Magento\Config\Model\Config\Structure\Data">
<plugin name="mageplaza_module_activate" type="Mageplaza\Core\Model\Config\Structure\Data"/>
</type>
<type name="Magento\Backend\Model\Menu\Builder\AbstractCommand">
<plugin name="mageplaza_move_menu" type="Mageplaza\Core\Plugin\MoveMenu"/>
</type>
</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_Core
* @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:framework:Event/etc/events.xsd">
<event name="controller_action_predispatch">
<observer name="mageplaza_core" instance="Mageplaza\Core\Observer\PredispatchAdminActionControllerObserver"/>
</event>
</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_Core
* @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_Core::menu" title="Mageplaza" module="Mageplaza_Core" sortOrder="50" resource="Mageplaza_Core::menu"/>
<add id="Mageplaza_Core::documentation" title="Documentations" module="Mageplaza_Core" sortOrder="5" resource="Mageplaza_Core::documentation" parent="Mageplaza_Core::menu"/>
<!-- <add id="Mageplaza_Core::marketplace" title="Mageplaza Marketplace" module="Mageplaza_Core" sortOrder="10" action="adminhtml/system_config/edit/section/mpmarketplace" resource="Mageplaza_Core::marketplace" parent="Mageplaza_Core::documentation"/>-->
<add id="Mageplaza_Core::userguide" title="User Guides" module="Mageplaza_Core" sortOrder="20" action="mpcore/index/userguide" resource="Mageplaza_Core::userguide" parent="Mageplaza_Core::documentation"/>
</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_Core
* @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:framework:App/etc/routes.xsd">
<router id="admin">
<route id="mpcore" frontName="mpcore">
<module name="Mageplaza_Core"/>
</route>
</router>
</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_Core
* @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_Config:etc/system_file.xsd">
<system>
<tab id="mageplaza" translate="label" sortOrder="402" class="mageplaza-extensions">
<label>Mageplaza Extensions</label>
</tab>
<section id="mageplaza" translate="label" type="text" sortOrder="8888" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Information</label>
<tab>mageplaza</tab>
<resource>Mageplaza_Core::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="notice_enable" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Notifications</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Select Yes to get latest updates from Mageplaza.</comment>
</field>
<field id="notice_type" translate="label comment" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Category</label>
<source_model>Mageplaza\Core\Model\Config\Source\NoticeType</source_model>
<comment>Select categories that you want to receive notifications</comment>
<depends>
<field id="notice_enable">1</field>
</depends>
</field>
<field id="menu" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Mageplaza Menu</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<backend_model>Mageplaza\Core\Model\Config\Backend\Menu</backend_model>
<comment>If yes, the Mageplaza menu will be displayed on the admin navigation. All of the Mageplaza module menu will be displayed there.</comment>
</field>
</group>
</section>
</system>
</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_Core
* @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_Store:etc/config.xsd">
<default>
<mageplaza>
<general>
<notice_enable>1</notice_enable>
<notice_type>announcement,new_update,marketing</notice_type>
<menu>0</menu>
</general>
</mageplaza>
</default>
</config>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="font-src">
<values>
<value id="fontawesome" type="host">*.fontawesome.com</value>
</values>
</policy>
<policy id="style-src">
<values>
<value id="fontawesome" type="host">*.fontawesome.com</value>
</values>
</policy>
</policies>
</csp_whitelist>
<?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_Core
* @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:framework:Module/etc/module.xsd">
<module name="Mageplaza_Core" setup_version="1.0.0">
<sequence>
<module name="Magento_Backend"/>
</sequence>
</module>
</config>
"Mageplaza Extensions","Mageplaza Uitbreidings"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Vennote"
"Mageplaza Extensions","ملحقات ماجيبلازا"
"Mageplaza Marketplace","سوق ماجيبلازا"
"Partners","شركاء"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","партнёры"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partners"
"Mageplaza Extensions","Extensions de Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Socis"
"Mageplaza Extensions","Rozšíření Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partneři"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partnere"
"Mageplaza Extensions","Mageplaza Erweiterungen"
"Mageplaza Marketplace","Mageplaza Marktplatz"
"Partners","Partner"
"Mageplaza Extensions","Επεκτάσεις Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Συνεργάτες"
"Activate Now","Activate Now"
"Update this license","Update this license"
"User Guide","User Guide"
FAQs,FAQs
"Change Log","Change Log"
"Check Latest Version","Check Latest Version"
"Invalid data.","Invalid data."
"Cannot connect to server. Please try again later.","Cannot connect to server. Please try again later."
Announcement,Announcement
"New & Update extensions","New & Update extensions"
"Promotions ","Promotions "
"Module Information","Module Information"
Version,Version
"Register Name","Register Name"
"Register Email","Register Email"
"This email will be used to create a new account at Mageplaza.com, Mageplaza help desk (to get priority support).","This email will be used to create a new account at Mageplaza.com, Mageplaza help desk (to get priority support)."
"Product Key","Product Key"
"One or more Mageplaza extensions are not validated. Click <a href=""%1"">here</a> to validate them.","One or more Mageplaza extensions are not validated. Click <a href=""%1"">here</a> to validate them."
"Receive extension updates and promotion offers from Mageplaza","Receive extension updates and promotion offers from Mageplaza"
"Mageplaza Extensions","Mageplaza Extensions"
Information,Information
"General Configuration","General Configuration"
"Enable Notifications","Enable Notifications"
"Select Yes to get latest updates from Mageplaza.","Select Yes to get latest updates from Mageplaza."
Category,Category
"Select categories that you want to receive notifications","Select categories that you want to receive notifications"
"Enable Mageplaza Menu","Enable Mageplaza Menu"
"If yes, the Mageplaza menu will be displayed on the admin navigation. All of the Mageplaza module menu will be displayed there.","If yes, the Mageplaza menu will be displayed on the admin navigation. All of the Mageplaza module menu will be displayed there."
"Mageplaza Extensions","Extensiones Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Fogonadura"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","kumppanit"
"Mageplaza Extensions","Extensions Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Les partenaires"
"Mageplaza Extensions","הרחבות Mageplaza"
"Mageplaza Marketplace","Mageplaza שוק"
"Partners","שותפים"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partners"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza piactér"
"Partners","partnerek"
"Mageplaza Extensions","Mageplaza ekstensi"
"Mageplaza Marketplace","Mageplaza pasar"
"Partners","Mitra"
"Mageplaza Extensions","Estensioni di Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partner"
"Mageplaza Extensions","Mageplaza拡張機能"
"Mageplaza Marketplace","マジプラザマーケットプレイス"
"Partners","パートナー"
"Mageplaza Extensions","Mageplaza 확장"
"Mageplaza Marketplace","마게 플라자 마켓 플레이스"
"Partners","파트너"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","partners"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","partnere"
"Mageplaza Extensions","Rozszerzenia Mageplaza"
"Mageplaza Marketplace","Rynek Mageplaza"
"Partners","Wzmacniacz"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partners"
"Mageplaza Extensions","Extensões Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Parceiros"
"Mageplaza Extensions","Extensiile Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Parteneri"
"Mageplaza Extensions","Расширения Mageplaza"
"Mageplaza Marketplace","Торговая площадка Mageplaza"
"Partners","партнеры"
"Mageplaza Extensions","Магеплаза Ектенсионс"
"Mageplaza Marketplace","Магеплаза Маркетплаце"
"Partners","Партнери"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","partners"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partners"
"Mageplaza Extensions","Mageplaza Uzantıları"
"Mageplaza Marketplace","Mageplaza Pazarı"
"Partners","Ortaklar"
"Mageplaza Extensions","Розширення Mageplaza"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Партнери"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Partners"
"Mageplaza Extensions","Mageplaza Extensions"
"Mageplaza Marketplace","Mageplaza Marketplace"
"Partners","Đối tác"
"Mageplaza Extensions","Mageplaza扩展"
"Mageplaza Marketplace","Mageplaza市场"
"Partners","伙伴"
"Mageplaza Extensions","Mageplaza擴展"
"Mageplaza Marketplace","Mageplaza市場"
"Partners","夥伴"
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
ComponentRegistrar::MODULE,
'Mageplaza_Core',
__DIR__
);
<?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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Mageplaza_Core::js/jscolor.min.js"/>
</head>
</page>
<?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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Mageplaza_Core::js/help.js"/>
</head>
<!-- <body>
<referenceBlock name="head.components">
<block name="mpcore_store_helper" template="Mageplaza_Core::helper.phtml" ifconfig="mageplaza/general/store_helper" />
</referenceBlock>
</body> -->
</page>
<?php
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
use Mageplaza\Core\Block\Adminhtml\System\Config\Button;
/** @var Button $block */
?>
<div class="nested" style="font-size: 12px; margin-bottom: 20px">
<div class="field choice admin__field admin__field-option">
<input type="checkbox" id="mageplaza_module_subscribe" class="admin__control-checkbox"/>
<label for="mageplaza_module_subscribe" class="admin__field-label">
<span><?= /** @noEscape */ __('Receive extension updates and promotion offers from Mageplaza') ?></span>
</label>
</div>
</div>
<?= /** @noEscape */ $block->getButtonHtml() ?>
<script>
require([
'jquery',
'prototype'
], function ($j) {
var ajaxUrl = '<?= /** @noEscape */ $block->getData('mp_active_url') ?>',
moduleType = '<?= /** @noEscape */ $block->getData('mp_module_type') ?>',
defaultConfig = <?= /** @noEscape */ $block->getData('mp_free_config') ?>,
checkboxConfig = <?= /** @noEscape */ $block->getData('mp_module_checkbox') ?>,
activeButton = $j('#mageplaza_module_active'),
updateButton = $j('#mageplaza_module_update'),
fieldKey = $j('.mageplaza-module-active-field-key'),
freeFields = $j('.mageplaza-module-active-field-free'),
emailField = $j('.mageplaza-module-active-email'),
nameField = $j('.mageplaza-module-active-name'),
subscribeField = $j('#mageplaza_module_subscribe'),
messageContainer = $j('#mageplaza-module-messages'),
saveButton = $j('#save');
var submitData = {
extension: '<?= /** @noEscape */ $block->getData('mp_module_name') ?>',
domain: window.location.hostname
};
window.mageplazaModuleActive = function () {
messageContainer.hide();
if (moduleType === '1') {
if (!freeFields.valid()) {
return;
}
submitData.email = emailField.val();
submitData.name = nameField.val();
submitData.create = 1;//createAccField.prop('checked') ? 1 : 0;
submitData.subscribe = subscribeField.prop('checked') ? 1 : 0;
if (submitData.hasOwnProperty('update') && submitData.update) {
submitData.key = fieldKey.val();
}
} else {
if (!fieldKey.valid()) {
return;
}
submitData.key = fieldKey.val();
}
$j.ajax({
url: ajaxUrl,
data: submitData,
dataType: 'json',
showLoader: true,
success: function (result) {
if (result.key) {
fieldKey.val(result.key);
}
updateMessage(result);
activateProduct(result.active);
}
});
};
window.mageplazaModuleUpdate = function () {
submitData.update = 1;
messageContainer.hide();
updateButton.hide();
activeButton.show();
activeButton.find('span').html('Submit');
activeButton.attr('title', 'Submit');
fieldKey.closest('tr').hide();
freeFields.closest('tr').show();
subscribeField.closest('.nested').show();
};
function activateProduct(active) {
submitData.update = 0;
if (active) {
activeButton.hide();
updateButton.show();
saveButton.attr('disabled', false);
fieldKey.closest('tr').show();
freeFields.closest('tr').hide();
subscribeField.closest('.nested').hide();
} else {
saveButton.attr('disabled', 'disabled');
updateButton.hide();
activeButton.show();
fieldKey.closest('tr').hide();
freeFields.closest('tr').show();
subscribeField.closest('.nested').show();
}
}
function updateMessage(result) {
if (result.message) {
messageContainer.show();
messageContainer.find('.message div').html(result.message);
messageContainer.find('.message')
.removeClass('message-' + (result.success ? 'error' : 'success'))
.addClass('message-' + (result.success ? 'success' : 'error'));
}
}
var isActive = <?= /** @noEscape */ $block->getData('mp_is_active') ? 'true' : 'false' ?>;
activateProduct(isActive);
if (!isActive) {
var containerId = '<?= /** @noEscape */ $block->getData('mp_module_html_id') ?>';
$(containerId + '-state').value = 0;
Fieldset.toggleCollapse(containerId);
updateMessage({
success: false,
message: 'This extension is not actived.'
});
}
fieldKey.attr('readonly', true);
freeFields.removeAttr('name');
if (moduleType === '1') {
if (defaultConfig) {
if (!emailField.val() && defaultConfig.email) {
emailField.val(defaultConfig.email);
}
if (!nameField.val() && defaultConfig.name) {
nameField.val(defaultConfig.name);
}
}
if (checkboxConfig) {
if (checkboxConfig.subscribe) {
subscribeField.prop("checked", true);
}
}
}
});
</script>
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
@import "variables/_icons.less";
.lib-font-face(
@family-name: @icons-mageplaza__font-name,
@font-path: @icons-mageplaza__font-name-path,
@font-weight: normal,
@font-style: normal
);
.lib-font-face(
@family-name: @icons-avada__font-name,
@font-path: @icons-avada__font-name-path,
@font-weight: normal,
@font-style: normal
);
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
@import '_icons.less';
.admin__menu .item-menu.parent.level-0 > a:before {
content: @icon-mageplaza__content;
font-family: @icons-mageplaza__font-name;
font-size: 2.5rem;
padding-top: .2rem;
}
.mageplaza-extensions .title:before {
content: @icon-mageplaza__content;
font-family: @icons-mageplaza__font-name;
font-size: 1.5rem;
padding-top: .2rem;
}
.avada-extensions .title:before {
content: @icon-avada__content;
font-family: @icons-avada__font-name;
font-size: 1.7rem;
padding-top: .2rem;
}
ul[role="menu"] [data-ui-id^="menu-avada"] strong:before {
content: @icon-avada__content;
font-family: @icons-avada__font-name;;
font-size: 1.6rem;
margin-right: .8rem;
}
.row_mageplaza_module_version {
.value {
vertical-align: bottom !important;
.special {
font-weight: 600;
}
}
}
#mageplaza-module-messages {
max-width: 75%;
margin: 0 auto -35px;
}
[data-ui-id="menu-mageplaza-core-menu"] strong:before {
display: none; /*no icon under Mageplaza tab*/
}
ul[role="menu"] [data-ui-id^="menu-mageplaza"] strong:before {
content: @icon-mageplaza__content;
font-family: @icons-mageplaza__font-name;;
font-size: 1.5rem;
margin-right: .8rem;
}
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
@icons-mageplaza__font-name: 'Mageplaza Icons';
@icons-mageplaza__file-name: 'mageplaza-icons';
@icons-mageplaza__font-name-path: '@{baseDir}Mageplaza_Core/fonts/@{icons-mageplaza__file-name}/@{icons-mageplaza__file-name}';
@icon-mageplaza__content: '\e900';
@icons-avada__font-name: 'Avada Icons';
@icons-avada__file-name: 'avada-icons';
@icons-avada__font-name-path: '@{baseDir}Mageplaza_Core/fonts/@{icons-avada__file-name}/@{icons-avada__file-name}';
@icon-avada__content: '\e900';
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
<json>
<![CDATA[
{
"fontFamily": "avada-icons",
"majorVersion": 1,
"minorVersion": 0,
"version": "Version 1.0",
"fontId": "avada-icons",
"psName": "avada-icons",
"subFamily": "Regular",
"fullName": "avada-icons",
"description": "Font generated by IcoMoon."
}
]]>
</json>
</metadata>
<defs>
<font id="avada-icons" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="Icon-Avada" data-tags="Icon-Black" horiz-adv-x="1223" d="M764.927 959.48c-61.979-3.167-120.885-27.467-167.594-69.212l-4.255-3.782-3.309 0.284c-9.455 0.851-32.431 0.236-48.222-1.276-106.229-10.212-202.058-66.234-263.611-154.12-2.837-4.066-5.153-7.47-5.153-7.611s0.473 0.047 1.087 0.425c3.64 2.364 15.27 9.266 20.66 12.292 47.843 26.711 101.596 41.981 157.902 44.818 10.448 0.52 25.435 0.567 30.777 0.095l3.64-0.331 4.397 3.924c22.125 19.714 47.182 35.741 73.94 47.276 49.971 21.605 105.757 27.562 160.030 17.067 74.838-14.514 141.214-60.986 180.689-126.653 11.866-19.714 21.652-41.839 28.035-63.397l1.182-4.066 6.524-2.506c52.24-20.187 97.389-56.4 128.544-103.062 24.914-37.348 39.523-78.053 44.44-123.674 1.040-10.023 1.229-42.265 0.236-51.72-1.56-15.27-4.255-30.446-7.706-43.967-4.964-19.241-13.946-42.312-23.023-59.048-1.607-2.978-2.837-5.484-2.742-5.626 0.236-0.189 4.964 2.458 11.394 6.43 18.627 11.535 33.519 23.402 49.687 39.523 22.693 22.74 39.428 46.141 52.949 74.271 27.657 57.535 34.228 123.060 18.58 185.322-2.458 9.786-8.462 27.704-12.481 37.348-22.74 54.698-63.445 101.076-115.117 131.191-11.346 6.619-34.086 17.161-44.061 20.471-0.473 0.189-1.276 1.938-2.222 5.153-11.299 37.395-30.115 71.529-55.739 100.982-6.76 7.801-22.834 23.591-30.351 29.831-41.65 34.701-91.243 55.975-144.428 61.932-15.507 1.749-29.548 2.175-44.676 1.418zM550.766 746.927c-29.217-1.702-58.811-8.368-86.704-19.572-8.604-3.451-24.773-11.346-32.904-16.027-15.696-9.030-32.668-21.322-46.047-33.33l-4.208-3.735-15.885 0.142c-15.696 0.095-24.253-0.236-38.105-1.655-41.083-4.113-84.388-16.358-121.5-34.417-52.666-25.576-98.523-63.492-133.319-110.201-40.327-54.178-64.343-117.103-70.441-184.66-1.607-17.681-1.702-44.629-0.236-61.648 6.193-73.089 33.282-141.166 78.667-197.614 15.648-19.478 36.828-40.657 56.306-56.306 45.054-36.166 98.24-61.128 154.829-72.522 14.23-2.837 26.475-4.586 43.967-6.24 8.652-0.804 48.080-0.804 56.731 0 17.019 1.607 29.406 3.357 43.021 6.051 44.25 8.841 86.799 26.096 125.187 50.822 17.161 11.063 36.403 26.002 50.065 38.908l3.924 3.688 7.801-3.593c29.217-13.616 58.008-21.511 91.006-24.962 9.266-0.946 42.218-0.804 51.531 0.236 43.683 4.964 81.882 17.965 116.961 39.901 18.296 11.441 32.479 22.787 48.742 39.097 21.842 21.842 36.403 41.934 50.065 69.070 15.837 31.344 24.536 61.27 28.507 97.861 1.135 10.684 1.135 40.279 0 51.058-3.924 36.355-13.001 67.368-28.744 98.051-30.446 59.568-81.835 105.946-144.145 130.057l-6.808 2.647-2.458 7.801c-10.968 35.032-27.798 65.856-51.531 94.269-6.382 7.659-20.707 22.314-28.555 29.217-45.527 40.090-101.313 63.208-162.63 67.463-6.24 0.425-26.758 0.52-33.093 0.142zM561.167 530.497c21.463-3.262 42.879-12.765 58.528-25.907 1.135-0.993 2.269-1.749 2.506-1.749s0.425 1.135 0.425 2.506c0 8.793 6.666 19.005 15.176 23.213 8.51 4.16 19.289 4.16 27.846 0 4.728-2.317 10.117-7.659 12.197-12.055 3.12-6.524 2.931 1.371 2.931-113.652 0-115.921 0.236-107.364-3.215-113.888-2.175-4.208-7.281-9.408-11.299-11.535-6.051-3.167-14.703-4.255-21.936-2.742-7.659 1.655-15.128 7.47-18.532 14.466-1.938 3.924-3.167 8.273-3.167 10.968 0 0.993-0.142 1.796-0.378 1.796-0.189 0-1.844-1.513-3.64-3.357-10.873-11.015-30.588-21.889-47.418-26.144-7.706-1.986-13.19-2.695-22.362-2.978-30.020-0.898-56.117 8.084-78.951 27.231-20.234 16.925-35.646 43.636-41.272 71.671-2.364 11.677-2.837 17.019-2.837 31.911s0.52 20.612 2.789 31.911c9.786 48.6 43.258 85.428 87.413 96.254 4.917 1.182 11.394 2.269 18.012 2.978 4.113 0.425 22.409-0.142 27.184-0.898zM541.169 478.966c-15.176-2.458-27.089-8.841-37.915-20.187-12.954-13.616-19.951-30.399-21.511-51.72-1.891-25.955 5.815-49.12 21.794-65.666 12.15-12.528 25.576-18.721 43.636-20.092 17.776-1.371 34.512 3.215 47.56 13.048 20.943 15.743 32.1 42.974 29.878 72.663-1.702 22.645-9.455 40.137-24.016 54.226-9.219 8.888-19.194 14.23-32.006 17.067-5.815 1.324-21.227 1.655-27.42 0.662z" />
</font></defs></svg>
\ No newline at end of file
{"IcoMoonType":"selection","icons":[{"icon":{"paths":["M764.927 0.52c-61.979 3.167-120.885 27.467-167.594 69.212l-4.255 3.782-3.309-0.284c-9.455-0.851-32.431-0.236-48.222 1.276-106.229 10.212-202.058 66.234-263.611 154.12-2.837 4.066-5.153 7.47-5.153 7.611s0.473-0.047 1.087-0.425c3.64-2.364 15.27-9.266 20.66-12.292 47.843-26.711 101.596-41.981 157.902-44.818 10.448-0.52 25.435-0.567 30.777-0.095l3.64 0.331 4.397-3.924c22.125-19.714 47.182-35.741 73.94-47.276 49.971-21.605 105.757-27.562 160.030-17.067 74.838 14.514 141.214 60.986 180.689 126.653 11.866 19.714 21.652 41.839 28.035 63.397l1.182 4.066 6.524 2.506c52.24 20.187 97.389 56.4 128.544 103.062 24.914 37.348 39.523 78.053 44.44 123.674 1.040 10.023 1.229 42.265 0.236 51.72-1.56 15.27-4.255 30.446-7.706 43.967-4.964 19.241-13.946 42.312-23.023 59.048-1.607 2.978-2.837 5.484-2.742 5.626 0.236 0.189 4.964-2.458 11.394-6.43 18.627-11.535 33.519-23.402 49.687-39.523 22.693-22.74 39.428-46.141 52.949-74.271 27.657-57.535 34.228-123.060 18.58-185.322-2.458-9.786-8.462-27.704-12.481-37.348-22.74-54.698-63.445-101.076-115.117-131.191-11.346-6.619-34.086-17.161-44.061-20.471-0.473-0.189-1.276-1.938-2.222-5.153-11.299-37.395-30.115-71.529-55.739-100.982-6.76-7.801-22.834-23.591-30.351-29.831-41.65-34.701-91.243-55.975-144.428-61.932-15.507-1.749-29.548-2.175-44.676-1.418z","M550.766 213.073c-29.217 1.702-58.811 8.368-86.704 19.572-8.604 3.451-24.773 11.346-32.904 16.027-15.696 9.030-32.668 21.322-46.047 33.33l-4.208 3.735-15.885-0.142c-15.696-0.095-24.253 0.236-38.105 1.655-41.083 4.113-84.388 16.358-121.5 34.417-52.666 25.576-98.523 63.492-133.319 110.201-40.327 54.178-64.343 117.103-70.441 184.66-1.607 17.681-1.702 44.629-0.236 61.648 6.193 73.089 33.282 141.166 78.667 197.614 15.648 19.478 36.828 40.657 56.306 56.306 45.054 36.166 98.24 61.128 154.829 72.522 14.23 2.837 26.475 4.586 43.967 6.24 8.652 0.804 48.080 0.804 56.731 0 17.019-1.607 29.406-3.357 43.021-6.051 44.25-8.841 86.799-26.096 125.187-50.822 17.161-11.063 36.403-26.002 50.065-38.908l3.924-3.688 7.801 3.593c29.217 13.616 58.008 21.511 91.006 24.962 9.266 0.946 42.218 0.804 51.531-0.236 43.683-4.964 81.882-17.965 116.961-39.901 18.296-11.441 32.479-22.787 48.742-39.097 21.842-21.842 36.403-41.934 50.065-69.070 15.837-31.344 24.536-61.27 28.507-97.861 1.135-10.684 1.135-40.279 0-51.058-3.924-36.355-13.001-67.368-28.744-98.051-30.446-59.568-81.835-105.946-144.145-130.057l-6.808-2.647-2.458-7.801c-10.968-35.032-27.798-65.856-51.531-94.269-6.382-7.659-20.707-22.314-28.555-29.217-45.527-40.090-101.313-63.208-162.63-67.463-6.24-0.425-26.758-0.52-33.093-0.142zM561.167 429.503c21.463 3.262 42.879 12.765 58.528 25.907 1.135 0.993 2.269 1.749 2.506 1.749s0.425-1.135 0.425-2.506c0-8.793 6.666-19.005 15.176-23.213 8.51-4.16 19.289-4.16 27.846 0 4.728 2.317 10.117 7.659 12.197 12.055 3.12 6.524 2.931-1.371 2.931 113.652 0 115.921 0.236 107.364-3.215 113.888-2.175 4.208-7.281 9.408-11.299 11.535-6.051 3.167-14.703 4.255-21.936 2.742-7.659-1.655-15.128-7.47-18.532-14.466-1.938-3.924-3.167-8.273-3.167-10.968 0-0.993-0.142-1.796-0.378-1.796-0.189 0-1.844 1.513-3.64 3.357-10.873 11.015-30.588 21.889-47.418 26.144-7.706 1.986-13.19 2.695-22.362 2.978-30.020 0.898-56.117-8.084-78.951-27.231-20.234-16.925-35.646-43.636-41.272-71.671-2.364-11.677-2.837-17.019-2.837-31.911s0.52-20.612 2.789-31.911c9.786-48.6 43.258-85.428 87.413-96.254 4.917-1.182 11.394-2.269 18.012-2.978 4.113-0.425 22.409 0.142 27.184 0.898z","M541.169 481.034c-15.176 2.458-27.089 8.841-37.915 20.187-12.954 13.616-19.951 30.399-21.511 51.72-1.891 25.955 5.815 49.12 21.794 65.666 12.15 12.528 25.576 18.721 43.636 20.092 17.776 1.371 34.512-3.215 47.56-13.048 20.943-15.743 32.1-42.974 29.878-72.663-1.702-22.645-9.455-40.137-24.016-54.226-9.219-8.888-19.194-14.23-32.006-17.067-5.815-1.324-21.227-1.655-27.42-0.662z"],"attrs":[{},{},{}],"width":1223,"isMulticolor":false,"isMulticolor2":false,"grid":0,"tags":["Icon-Black"]},"attrs":[{},{},{}],"properties":{"order":2,"id":0,"name":"Icon-Avada","prevSize":32,"code":59648},"setIdx":0,"setId":2,"iconIdx":0}],"height":1024,"metadata":{"name":"avada-icons"},"preferences":{"showGlyphs":true,"showQuickUse":true,"showQuickUse2":true,"showSVGs":true,"fontPref":{"prefix":"icon-","metadata":{"fontFamily":"avada-icons","majorVersion":1,"minorVersion":0},"metrics":{"emSize":1024,"baseline":6.25,"whitespace":50},"embed":false,"autoHost":false,"showSelector":false,"showMetrics":false,"showMetadata":false,"showVersion":false,"includeMetadata":true,"cssVars":false,"cssVarsFormat":"scss","flutter":true},"imagePref":{"prefix":"icon-","png":true,"useClassSelector":true,"color":0,"bgColor":16777215,"classSelector":".icon","name":"icomoon"},"historySize":50,"showCodes":true,"gridSize":16,"quickUsageToken":{"UntitledProject":"ZjBhMDUyNDkzN2E5M2YzZjFkMmZiN2JmNmRiZWMzNmQjMSMxNjI2Nzc2MDM4IyMj"}}}
\ No newline at end of file
{
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M298.459 176.078l-292.215 169.21v673.093l39.337-21.854c21.229-12.488 64.312-37.463 96.156-54.946l57.444-33.093 3.746-117.385 192.937-111.141c105.522-61.815 194.185-111.766 196.683-111.766 1.873 0 91.161 49.951 197.307 111.766l193.561 111.766 6.244 116.137 95.532 54.946 94.907 54.322v-671.22l-290.966-168.585c-160.468-92.41-292.839-168.585-295.337-169.21-1.873-0.624-134.868 74.927-295.337 167.961zM792.976 342.166l190.439 110.517 1.873 58.693c1.249 49.327 0 58.068-7.493 54.946-4.995-1.873-91.785-51.824-193.561-109.893-101.151-58.693-187.317-106.771-191.688-106.771s-92.41 49.327-196.683 109.268c-104.273 59.941-190.439 109.268-192.312 109.268-2.498 0-3.746-26.224-3.746-58.068l0.624-57.444 191.688-110.517c105.522-60.566 196.059-110.517 201.054-110.517s94.907 49.951 199.805 110.517z"
],
"attrs": [
{}
],
"width": 1180,
"isMulticolor": false,
"isMulticolor2": false,
"grid": 0,
"tags": [
"icon-white1"
]
},
"attrs": [
{}
],
"properties": {
"order": 10,
"id": 0,
"name": "icon-mageplaza",
"prevSize": 32,
"code": 59648
},
"setIdx": 0,
"setId": 3,
"iconIdx": 0
}
],
"height": 1024,
"metadata": {
"name": "icomoon"
},
"preferences": {
"showGlyphs": true,
"showQuickUse": true,
"showQuickUse2": true,
"showSVGs": true,
"fontPref": {
"prefix": "icon-",
"metadata": {
"fontFamily": "icomoon"
},
"metrics": {
"emSize": 1024,
"baseline": 6.25,
"whitespace": 50
},
"embed": false
},
"imagePref": {
"prefix": "icon-",
"png": true,
"useClassSelector": true,
"color": 0,
"bgColor": 16777215,
"classSelector": ".icon"
},
"historySize": 50,
"showCodes": true,
"gridSize": 16
}
}
\ No newline at end of file
/**
* 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_Core
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
require([
'jquery',
'underscore'
], function ($, _) {
'use strict';
var mpHelpDb = {
'admin/system_config/index': [
{
'css_selector': '#general_single_store_mode_enabled',
'type': 'link',
'text': 'How to enable Single Store Mode, {link}.',
'url': 'https://www.mageplaza.com/kb/how-enable-single-store-mode-magento-2.html',
'anchor': 'learn more'
}
],
'theme/design_config/edit/scope/websites/scope_id': [
{
'css_selector': 'input[name*="header_welcome"]',
'type': 'link',
'text': 'How to change the welcome message, {link}.',
'url': 'https://www.mageplaza.com/kb/how-change-welcome-message-magento-2.html',
'anchor': 'learn more'
}
],
'system_config/edit/section/contact': [
{
'css_selector': '#contact_contact_enabled',
'type': 'link',
'text': 'How to configure Contact Us form, {link}.',
'url': 'https://www.mageplaza.com/kb/how-configure-contacts-email-address-magento-2.html',
'anchor': 'learn more'
}
],
//Not Configuration
'catalog/product/edit': [
{
'css_selector': '#media_gallery_content',
'type': 'link',
'text': 'How to upload Images Product, {link}.',
'url': 'https://www.mageplaza.com/kb/how-to-upload-images-product-in-magento-2.html',
'anchor': 'learn more'
}
],
'type/configurable/key/': [
{
'css_selector': '.page-actions-placeholder',
'type': 'link',
'text': 'Create Configurable Product, {link}.',
'url': 'https://www.mageplaza.com/kb/how-create-configurable-product-magento-2.html',
'anchor': 'learn more'
}
],
'system_config/edit/section/general': [
{
'css_selector': '#general_region_state_required',
'type': 'link',
'text': 'How to setup State, {link}.',
'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#set-up-state',
'anchor': 'learn more'
},
{
'css_selector': '#general_country_default',
'type': 'link',
'text': 'How to setup Country, {link}.',
'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#set-up-country',
'anchor': 'learn more'
},
{
'css_selector': '#general_locale_timezone',
'type': 'link',
'text': 'How to setup Locale, {link}.',
'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#login-magento-2',
'anchor': 'learn more'
},
{
'css_selector': '#general_store_information_name',
'type': 'link',
'text': 'How to setup store information, {link}.',
'url': 'https://www.mageplaza.com/kb/how-setup-store-information-magento-2.html',
'anchor': 'learn more'
}
],
'system_config/edit/section/trans_email': [
{
'css_selector': '#trans_email_ident_sales_email',
'type': 'link',
'text': 'About 79% of visitors drop their shopping cart at the checkout page. This proven abandoned cart email templates that can improve that number, {link}.',
'url': 'https://pages.mageplaza.com/abandoned-cart-email-templates-for-magento/',
'anchor': 'learn more'
},
],
'system_config/edit/section/newsletter': [
{
'css_selector': '#newsletter_subscription_success_email_template',
'type': 'link',
'text': 'Welcome emails generate 4 times the total open rates and 5 times the click rates compared to other bulk promotions. Get proven welcome email templates, {link}.',
'url': 'https://pages.mageplaza.com/welcome-email-templates-for-magento-2/',
'anchor': 'get a copy'
}
],
'admin/email_template/new': [
{
'css_selector': '#template_select',
'type': 'link',
'text': 'Get {link} templates that convert',
'url': 'https://pages.mageplaza.com/bundle-of-email-follow-up-templates/',
'anchor': 'bundle of follow up emails'
}
]
};
function buildHtml(data) {
var link = '<a href="' + data.url + '?utm_source=store&utm_medium=link&utm_campaign=mageplaza-helps" target="_blank">' + data.anchor + '</a>';
var text = data.text.replace('{link}', link);
return '<p class="note">' + text + '</p>';
}
var url = window.location.href;
for (var path in mpHelpDb) {
if (mpHelpDb.hasOwnProperty(path) && url.search(path)) {
var datas = mpHelpDb[path];
_.each(datas, function (data) {
var html = buildHtml(data);
html && $(html).insertAfter(data.css_selector); //only insert if html is not empty
});
}
}
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment