Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class for Notice
*/
class Notice extends Field
{

/**
* Render text
*
* @param AbstractElement $element
*
* @return string
*/
public function render(AbstractElement $element)
{
$html = '<td colspan="4"><p class="' . $element->getId() . '_notice">' . '<strong>' . __('Important:')
. ' ' . '</strong>' . ' <span>' . __('Please note, for reCAPTCHA to be enabled,
the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '</span>' . '</p></td>';

return $this->_decorateRowHtml($element, $html);
}
}
1 change: 1 addition & 0 deletions ReCaptchaAdminUi/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"require": {
"php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-config": "*",
"magento/module-re-captcha-ui": "*"
},
"type": "magento2-module",
Expand Down
8 changes: 8 additions & 0 deletions ReCaptchaAdminUi/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<group id="type_for" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="0"
showInStore="0">
<label>Admin Panel</label>
<field id="recaptcha_backend_info_heading" translate="label" sortOrder="100" showInDefault="1"
showInWebsite="0" showInStore="0" >
<frontend_model>Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice</frontend_model>
</field>
</group>
</section>

Expand All @@ -35,6 +39,10 @@
<group id="type_for" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1"
showInStore="0">
<label>Storefront</label>
<field id="recaptcha_frontend_info_heading" translate="label" sortOrder="100" showInDefault="1"
showInWebsite="1" showInStore="0">
<frontend_model>Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice</frontend_model>
</field>
</group>
</section>
</system>
Expand Down
10 changes: 10 additions & 0 deletions ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
.recaptcha_backend_type_for_recaptcha_backend_info_heading_notice,
.recaptcha_frontend_type_for_recaptcha_frontend_info_heading_notice {
strong {
color: @grid-severity-critical-color;
}
}
4 changes: 2 additions & 2 deletions ReCaptchaUser/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<system>
<section id="recaptcha_backend">
<group id="type_for">
<field id="user_login" translate="label" type="select" sortOrder="100" showInDefault="1"
<field id="user_login" translate="label" type="select" sortOrder="110" showInDefault="1"
showInWebsite="0" showInStore="0" canRestore="1">
<label>Enable for Login</label>
<source_model>Magento\ReCaptchaAdminUi\Model\OptionSource\Type</source_model>
</field>

<field id="user_forgot_password" translate="label" type="select" sortOrder="110" showInDefault="1"
<field id="user_forgot_password" translate="label" type="select" sortOrder="120" showInDefault="1"
showInWebsite="0" showInStore="0" canRestore="1">
<label>Enable for Forgot Password</label>
<source_model>Magento\ReCaptchaAdminUi\Model\OptionSource\Type</source_model>
Expand Down