Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Password type form element with unmask option Contains HTML class for a password type element with unmask option

Copyright: 2009 Petr Skoda
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 110 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

MoodleQuickForm_passwordunmask:: (2 methods):
  __construct()
  MoodleQuickForm_passwordunmask()

name:: (2 methods):
  export_for_template()
  validateSubmitValue()


Class: MoodleQuickForm_passwordunmask  - X-Ref

Password type form element with unmask option

HTML class for a password type element with unmask option

__construct($elementName=null, $elementLabel=null, $attributes=null)   X-Ref
constructor

param: string $elementName (optional) name of the password element
param: string $elementLabel (optional) label for password element
param: mixed $attributes (optional) Either a typical HTML attribute string

MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

export_for_template(renderer_base $output)   X-Ref
Function to export the renderer data in a format that is suitable for a mustache template.

param: renderer_base $output Used to do a final render of any components that need to be rendered for export.
return: stdClass|array

validateSubmitValue($value)   X-Ref
Check that there is no whitespace at the beginning and end of the password.

It turned out that wrapping whitespace can easily be pasted by accident when copying the text from elsewhere.
Such a mistake is very hard to debug as the whitespace is not displayed.

param: array $value Submitted value.
return: string|null Validation error message or null.