| Línea 39... |
Línea 39... |
| 39 |
*
|
39 |
*
|
| 40 |
* @param array $attributes
|
40 |
* @param array $attributes
|
| 41 |
* @param boolean $auth is this constructed in auth.php loginform_* definitions. Set to false to prevent autosubmission of form.
|
41 |
* @param boolean $auth is this constructed in auth.php loginform_* definitions. Set to false to prevent autosubmission of form.
|
| 42 |
* @param string|null $elementlabel Provide a different element label.
|
42 |
* @param string|null $elementlabel Provide a different element label.
|
| 43 |
*/
|
43 |
*/
|
| 44 |
public function __construct($attributes = null, $auth = true, string $elementlabel = null) {
|
44 |
public function __construct($attributes = null, $auth = true, ?string $elementlabel = null) {
|
| 45 |
global $PAGE;
|
45 |
global $PAGE;
|
| Línea 46... |
Línea 46... |
| 46 |
|
46 |
|
| 47 |
// Force attributes.
|
47 |
// Force attributes.
|
| 48 |
if (empty($attributes)) {
|
48 |
if (empty($attributes)) {
|
| Línea 51... |
Línea 51... |
| 51 |
|
51 |
|
| 52 |
$attributes['autocomplete'] = 'one-time-code';
|
52 |
$attributes['autocomplete'] = 'one-time-code';
|
| 53 |
$attributes['inputmode'] = 'numeric';
|
53 |
$attributes['inputmode'] = 'numeric';
|
| 54 |
$attributes['pattern'] = '[0-9]*';
|
54 |
$attributes['pattern'] = '[0-9]*';
|
| 55 |
// Overwrite default classes if set.
|
55 |
// Overwrite default classes if set.
|
| 56 |
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'tool-mfa-verification-code font-weight-bold';
|
56 |
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'tool-mfa-verification-code fw-bold';
|
| Línea 57... |
Línea 57... |
| 57 |
$attributes['maxlength'] = 6;
|
57 |
$attributes['maxlength'] = 6;
|
| 58 |
|
58 |
|
| 59 |
// If we aren't on the auth page, this might be part of a larger form such as for setup.
|
59 |
// If we aren't on the auth page, this might be part of a larger form such as for setup.
|