Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

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: 100 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.