File tree Expand file tree Collapse file tree 3 files changed +36
-4
lines changed
com.woltlab.wcf/templates
wcfsetup/install/files/lib
system/form/builder/field Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 2727 document.getElementById(' { unsafe:$fieldId |encodeJS} ' ),
2828 { /foreach }
2929 ],
30+ staticDictionary: [
31+ { foreach from= $field -> getStaticDictionary () item= staticDictionary}
32+ ' { unsafe:$staticDictionary |encodeJS} ' ,
33+ { /foreach }
34+ ],
3035 } );
3136 } );
3237 </script >
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ protected function createForm()
107107 ->addFieldClass ('long ' )
108108 ->autocomplete ('new-password ' )
109109 ->fieldAttribute ('passwordrules ' , UserRegistrationUtil::getPasswordRulesAttributeValue ())
110+ ->addStaticDictionary ([$ this ->user ->username , $ this ->user ->email ])
110111 ->addValidator (new FormFieldValidator (
111112 'passwordValidator ' ,
112113 $ this ->validatePassword (...)
Original file line number Diff line number Diff line change 77/**
88 * Implementation of a form field for a password.
99 *
10- * @author Matthias Schmidt
11- * @copyright 2001-2021 WoltLab GmbH
12- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13- * @since 5.4
10+ * @author Matthias Schmidt
11+ * @copyright 2001-2025 WoltLab GmbH
12+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13+ * @since 5.4
1414 */
1515class PasswordFormField extends AbstractFormField implements
1616 IAttributeFormField,
@@ -63,6 +63,12 @@ class PasswordFormField extends AbstractFormField implements
6363 */
6464 protected array $ relatedFieldsId = [];
6565
66+ /**
67+ * @var string[]
68+ * @since 6.2
69+ */
70+ protected array $ staticDictionary = [];
71+
6672 /**
6773 * Creates a new instance of `PasswordFormField`.
6874 */
@@ -181,4 +187,24 @@ public function getRelatedFieldsIDs(): array
181187
182188 return $ result ;
183189 }
190+
191+ /**
192+ * @param string[] $staticDictionary
193+ * @since 6.2
194+ */
195+ public function addStaticDictionary (array $ staticDictionary ): static
196+ {
197+ $ this ->staticDictionary = \array_merge ($ this ->staticDictionary , $ staticDictionary );
198+
199+ return $ this ;
200+ }
201+
202+ /**
203+ * @return string[]
204+ * @since 6.2
205+ */
206+ public function getStaticDictionary (): array
207+ {
208+ return $ this ->staticDictionary ;
209+ }
184210}
You can’t perform that action at this time.
0 commit comments