File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Customer \ViewModel ;
9
+
10
+ use Magento \Framework \View \Element \Block \ArgumentInterface ;
11
+
12
+ /**
13
+ * Forgot password button view model
14
+ */
15
+ class ForgotPasswordButton implements ArgumentInterface
16
+ {
17
+ /**
18
+ * If Forgot password button should be disabled
19
+ *
20
+ * @return bool
21
+ */
22
+ public function disabled (): bool
23
+ {
24
+ return false ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change 17
17
</referenceBlock >
18
18
<referenceContainer name =" content" >
19
19
<block class =" Magento\Customer\Block\Account\Forgotpassword" name =" forgotPassword" template =" Magento_Customer::form/forgotpassword.phtml" >
20
+ <arguments >
21
+ <argument name =" forgot_password_button_view_model" xsi : type =" object" >Magento\Customer\ViewModel\ForgotPasswordButton</argument >
22
+ </arguments >
20
23
<container name =" form.additional.info" as =" form_additional_info" />
21
24
</block >
22
25
</referenceContainer >
Original file line number Diff line number Diff line change 9
9
// phpcs:disable Generic.Files.LineLength.TooLong
10
10
11
11
/** @var \Magento\Customer\Block\Account\Forgotpassword $block */
12
+ /** @var \Magento\Customer\ViewModel\ForgotPasswordButton $forgotPasswordButtonViewModel */
13
+ $ forgotPasswordButtonViewModel = $ block ->getData ('forgot_password_button_view_model ' );
12
14
?>
13
15
<form class="form password forget"
14
16
action="<?= $ block ->escapeUrl ($ block ->getUrl ('*/*/forgotpasswordpost ' )) ?> "
27
29
</fieldset>
28
30
<div class="actions-toolbar">
29
31
<div class="primary">
30
- <button type="submit" class="action submit primary"><span><?= $ block ->escapeHtml (__ ('Reset My Password ' )) ?> </span></button>
32
+ <button type="submit" class="action submit primary" id="send2" <?php if ( $ forgotPasswordButtonViewModel -> disabled ()): ?> disabled="disabled" <?php endif ; ?> ><span><?= $ block ->escapeHtml (__ ('Reset My Password ' )) ?> </span></button>
31
33
</div>
32
34
<div class="secondary">
33
35
<a class="action back" href="<?= $ block ->escapeUrl ($ block ->getLoginUrl ()) ?> "><span><?= $ block ->escapeHtml (__ ('Go back ' )) ?> </span></a>
34
36
</div>
35
37
</div>
36
38
</form>
39
+ <?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
37
40
<script type="text/x-magento-init">
38
41
{
39
42
"*": {
You can’t perform that action at this time.
0 commit comments