-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from mageplaza/2.4-develop
2.4 develop
- Loading branch information
Showing
15 changed files
with
1,780 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?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_ProductLabels | ||
* @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> | ||
<css src="Mageplaza_SocialLogin::css/style_hyva.css" /> | ||
</head> | ||
|
||
<update handle="hyva_modal"/> | ||
<update handle="hyva_form_validation"/> | ||
<body> | ||
<referenceBlock name="head.additional"> | ||
<block class="Mageplaza\SocialLogin\Block\Css" name="social_login_custom_style" ifconfig="sociallogin/general/enabled" template="Mageplaza_SocialLogin::css.phtml"/> | ||
</referenceBlock> | ||
<referenceContainer name="content"> | ||
<block class="Mageplaza\SocialLogin\Block\Popup" name="modal-dialog" template="Mageplaza_SocialLogin::hyva/header/modal.phtml"> | ||
<block class="Mageplaza\SocialLogin\Block\Popup\Social" name="social-login-popup-authentication-social" as="popup.authentication.social" template="Mageplaza_SocialLogin::hyva/popup/form/social_buttons.phtml"/> | ||
<block class="Mageplaza\SocialLogin\Block\Popup" name="social-login-popup-email" before="-" as="popup.email" template="Mageplaza_SocialLogin::hyva/popup/form/email.phtml"/> | ||
<block class="Mageplaza\SocialLogin\Block\Form\Login" name="social-login-popup-authentication" as="popup.authentication" template="Mageplaza_SocialLogin::hyva/popup/form/authentication.phtml"> | ||
<container name="social.login.form.additional.info.login" as="form_additional_info"> | ||
<block class="Magento\Captcha\Block\Captcha" name="social-login-captcha" as="login.captcha" after="-"> | ||
<action method="setFormId"> | ||
<argument name="formId" xsi:type="string">user_login</argument> | ||
</action> | ||
<action method="setImgWidth"> | ||
<argument name="width" xsi:type="string">230</argument> | ||
</action> | ||
<action method="setImgHeight"> | ||
<argument name="width" xsi:type="string">50</argument> | ||
</action> | ||
</block> | ||
</container> | ||
</block> | ||
<block class="Mageplaza\SocialLogin\Block\Form\Register" name="social-login-popup-create" as="popup.create" template="Mageplaza_SocialLogin::hyva/popup/form/create.phtml"> | ||
<container name="social.login.form.additional.info.create" as="form_additional_info"> | ||
<block class="Magento\Captcha\Block\Captcha" name="social-create-captcha" as="create.captcha" after="-"> | ||
<action method="setFormId"> | ||
<argument name="formId" xsi:type="string">user_create</argument> | ||
</action> | ||
<action method="setImgWidth"> | ||
<argument name="width" xsi:type="string">230</argument> | ||
</action> | ||
<action method="setImgHeight"> | ||
<argument name="width" xsi:type="string">50</argument> | ||
</action> | ||
</block> | ||
</container> | ||
</block> | ||
<block class="Magento\Framework\View\Element\Template" name="social-login-popup-forgot" as="popup.forgot" template="Mageplaza_SocialLogin::hyva/popup/form/forgot.phtml"> | ||
<container name="social.login.form.additional.info.forgot" as="form_additional_info"> | ||
<block class="Magento\Captcha\Block\Captcha" name="social-forgot-password-captcha" as="forgot.captcha" after="-"> | ||
<action method="setFormId"> | ||
<argument name="formId" xsi:type="string">user_forgotpassword</argument> | ||
</action> | ||
<action method="setImgWidth"> | ||
<argument name="width" xsi:type="string">230</argument> | ||
</action> | ||
<action method="setImgHeight"> | ||
<argument name="width" xsi:type="string">50</argument> | ||
</action> | ||
</block> | ||
</container> | ||
</block> | ||
</block> | ||
|
||
</referenceContainer> | ||
<referenceBlock name="customer.header.sign.in.link"> | ||
<action method="setTemplate"> | ||
<argument name="template" xsi:type="string">Mageplaza_SocialLogin::hyva/header/link/sign-in.phtml</argument> | ||
</action> | ||
</referenceBlock> | ||
<referenceBlock name="customer.header.register.link"> | ||
<action method="setTemplate"> | ||
<argument name="template" xsi:type="string">Mageplaza_SocialLogin::hyva/header/link/register.phtml</argument> | ||
</action> | ||
</referenceBlock> | ||
<referenceBlock name="authentication-popup"> | ||
<arguments> | ||
<argument name="jsLayout" xsi:type="array"> | ||
<item name="components" xsi:type="array"> | ||
<item name="authenticationPopup" xsi:type="array"> | ||
<item name="children" xsi:type="array"> | ||
<item name="social-buttons" xsi:type="array"> | ||
<item name="component" xsi:type="string">Mageplaza_SocialLogin/js/view/social-buttons</item> | ||
<item name="displayArea" xsi:type="string">before</item> | ||
</item> | ||
</item> | ||
</item> | ||
</item> | ||
</argument> | ||
</arguments> | ||
</referenceBlock> | ||
|
||
|
||
<referenceBlock name="social-login-popup-authentication-social-login" > | ||
<action method="setTemplate"> | ||
<argument name="template" xsi:type="string">Mageplaza_SocialLogin::hyva/form/social.phtml</argument> | ||
</action> | ||
</referenceBlock> | ||
|
||
<referenceBlock name="social-login-popup-authentication-social-create" > | ||
<action method="setTemplate"> | ||
<argument name="template" xsi:type="string">Mageplaza_SocialLogin:hyva/form/social.phtml</argument> | ||
</action> | ||
</referenceBlock> | ||
</body> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?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_SocialLogin | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
$availableSocials = $block->getAvailableSocials(); | ||
$childBlock = $block->getChildBlock('request.info'); | ||
|
||
if ($block->canShow() && sizeof($availableSocials)): | ||
?> | ||
<div class="block social-login-authentication-channel account-social-login"> | ||
<div class="block-content"> | ||
<?php foreach ($availableSocials as $key => $social): ?> | ||
<div class="actions-toolbar social-btn social-btn-actions-toolbar <?= $key ?>-login"> | ||
<a class="btn btn-block btn-social btn-<?= $block->getBtnKey($key) ?>" | ||
data-mage-init='{"socialProvider": {"url": "<?= $social['login_url'] ?>", "label": "<?= __('Login By %1', $social['label']) ?>"}}' | ||
onclick='clickLoginSocial("<?= $social['login_url'] ?>","<?= $social['label'] ?>")' | ||
> | ||
<span class="fa fa-<?= $block->getBtnKey($key) ?>"></span> | ||
<?= __('Sign in with %1', $social['label']) ?> | ||
</a> | ||
</div> | ||
<?php endforeach; ?> | ||
</div> | ||
</div> | ||
<?php endif; ?> | ||
<?php if ($childBlock && $childBlock->isRequireMoreInfo()): ?> | ||
<div id="social-login-popup" class="white-popup mfp-with-anim mfp-hide" | ||
data-mage-init='{"Mageplaza_SocialLogin/js/popup":<?= $childBlock->getFormParams() ?>}'> | ||
<?= $block->getChildHtml('request.info') ?> | ||
</div> | ||
<?php endif; ?> | ||
<style type="text/css"> | ||
.request-popup{ | ||
overflow-y: unset; | ||
max-width: 800px; | ||
left: 30%; | ||
} | ||
.request-popup .modal-header{ | ||
padding: 0; | ||
} | ||
.request-popup .modal-header button.action-close{ | ||
color: white; | ||
z-index: 100; | ||
} | ||
.request-popup .modal-content{ | ||
padding: 0; | ||
} | ||
</style> | ||
<script type="text/javascript"> | ||
function getPopupParams(w, h, l, t) { | ||
var screenX = typeof window.screenX !== 'undefined' ? window.screenX : window.screenLeft; | ||
var screenY = typeof window.screenY !== 'undefined' ? window.screenY : window.screenTop; | ||
var outerWidth = typeof window.outerWidth !== 'undefined' ? window.outerWidth : document.body.clientWidth; | ||
var outerHeight = typeof window.outerHeight !== 'undefined' ? window.outerHeight : (document.body.clientHeight - 22); | ||
var width = w ? w : 500; | ||
var height = h ? h : 420; | ||
var left = l ? l : parseInt(screenX + ((outerWidth - width) / 2), 10); | ||
var top = t ? t : parseInt(screenY + ((outerHeight - height) / 2.5), 10); | ||
|
||
return ( | ||
'width=' + width + | ||
',height=' + height + | ||
',left=' + left + | ||
',top=' + top | ||
); | ||
} | ||
function clickLoginSocial(login_url, label) { | ||
var date = new Date(); | ||
var currentTime = date.getTime(); | ||
window.open(login_url + '?' + currentTime, label, getPopupParams()); | ||
} | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?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_SocialLogin | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
|
||
declare(strict_types=1); | ||
|
||
use Hyva\Theme\Block\SortableItem; | ||
use Hyva\Theme\Model\ViewModelRegistry; | ||
use Hyva\Theme\ViewModel\CustomerRegistration; | ||
use Magento\Framework\Escaper; | ||
|
||
/** @var SortableItem $block */ | ||
/** @var Escaper $escaper */ | ||
/** @var ViewModelRegistry $viewModels */ | ||
/** @var CustomerRegistration $customerRegistration */ | ||
|
||
$customerRegistration = $viewModels->require(CustomerRegistration::class); | ||
|
||
$label = $block->getLabel() ? $block->getLabel() : __('Create an Account'); | ||
$helperData = $this->helper(\Mageplaza\SocialLogin\Helper\Data::class); | ||
$popupEffect = $helperData->getPopupEffect(); | ||
$popupLogin = $helperData->getPopupLogin(); | ||
?> | ||
|
||
<?php if ($customerRegistration->isAllowed()): ?> | ||
<?php | ||
if ($popupLogin === 'popup_login'): ?> | ||
<div> | ||
<a id="<?= $escaper->escapeHtmlAttr($block->getNameInLayout()) ?>" | ||
class="block px-4 py-2 lg:px-5 lg:py-2 hover:bg-gray-100" | ||
href="#" | ||
title="<?= $escaper->escapeHtmlAttr($label) ?>" | ||
onclick="onClickRegister()" | ||
> | ||
<?= $escaper->escapeHtml($label) ?> | ||
</a> | ||
</div> | ||
<?php else: ?> | ||
<div> | ||
<a id="<?= $escaper->escapeHtmlAttr($block->getNameInLayout()) ?>" | ||
class="block px-4 py-2 lg:px-5 lg:py-2 hover:bg-gray-100" | ||
href="<?= $escaper->escapeUrl($customerRegistration->getRegisterUrl()) ?>" | ||
title="<?= $escaper->escapeHtmlAttr($label) ?>" | ||
> | ||
<?= $escaper->escapeHtml($label) ?> | ||
</a> | ||
</div> | ||
<?php endif; ?> | ||
<?php endif; ?> | ||
|
||
<script type="text/javascript"> | ||
function onClickRegister () { | ||
createBtn(); | ||
const modal = document.querySelector('.wrap-modal-login'); | ||
modal.classList.add('<?= $popupEffect ?>-appear'); | ||
openMyDialog(); | ||
|
||
|
||
} | ||
</script> |
Oops, something went wrong.