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 1717 </referenceBlock >
1818 <referenceContainer name =" content" >
1919 <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 >
2023 <container name =" form.additional.info" as =" form_additional_info" />
2124 </block >
2225 </referenceContainer >
Original file line number Diff line number Diff line change 99// phpcs:disable Generic.Files.LineLength.TooLong
1010
1111/** @var \Magento\Customer\Block\Account\Forgotpassword $block */
12+ /** @var \Magento\Customer\ViewModel\ForgotPasswordButton $forgotPasswordButtonViewModel */
13+ $ forgotPasswordButtonViewModel = $ block ->getData ('forgot_password_button_view_model ' );
1214?>
1315<form class="form password forget"
1416 action="<?= $ block ->escapeUrl ($ block ->getUrl ('*/*/forgotpasswordpost ' )) ?> "
2729 </fieldset>
2830 <div class="actions-toolbar">
2931 <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>
3133 </div>
3234 <div class="secondary">
3335 <a class="action back" href="<?= $ block ->escapeUrl ($ block ->getLoginUrl ()) ?> "><span><?= $ block ->escapeHtml (__ ('Go back ' )) ?> </span></a>
3436 </div>
3537 </div>
3638</form>
39+ <?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
3740<script type="text/x-magento-init">
3841 {
3942 "*": {
You can’t perform that action at this time.
0 commit comments