Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 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: 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.