Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
MoodleQuickForm_passwordunmask Class Reference

Password type form element with unmask option. More...

Inheritance diagram for MoodleQuickForm_passwordunmask:

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null)
 constructor
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 getHelpButton ()
 get html for help button
 
 MoodleQuickForm_password ($elementName=null, $elementLabel=null, $attributes=null)
 Old syntax of class constructor.
 
 MoodleQuickForm_passwordunmask ($elementName=null, $elementLabel=null, $attributes=null)
 Old syntax of class constructor.
 
 setHiddenLabel ($hiddenLabel)
 Sets label to be hidden.
 
 validateSubmitValue ($value)
 Check that there is no whitespace at the beginning and end of the password.
 

Public Attributes

 $_helpbutton =''
 
 string
 html for help button, if empty then no help
 

Protected Attributes

bool $_hiddenLabel = false
 if true label will be hidden.
 

Detailed Description

Password type form element with unmask option.

HTML class for a password type element with unmask option

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_passwordunmask::__construct ( $elementName = null,
$elementLabel = null,
$attributes = null )

constructor

Parameters
string$elementName(optional) name of the password element
string$elementLabel(optional) label for password element
mixed$attributes(optional) Either a typical HTML attribute string or an associative array

Reimplemented from MoodleQuickForm_password.

Member Function Documentation

◆ export_for_template()

MoodleQuickForm_passwordunmask::export_for_template ( renderer_base $output)

Function to export the renderer data in a format that is suitable for a mustache template.

Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ getHelpButton()

MoodleQuickForm_password::getHelpButton ( )
inherited

get html for help button

Return values
stringhtml for help button

◆ MoodleQuickForm_password()

MoodleQuickForm_password::MoodleQuickForm_password ( $elementName = null,
$elementLabel = null,
$attributes = null )
inherited

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ MoodleQuickForm_passwordunmask()

MoodleQuickForm_passwordunmask::MoodleQuickForm_passwordunmask ( $elementName = null,
$elementLabel = null,
$attributes = null )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ setHiddenLabel()

MoodleQuickForm_password::setHiddenLabel ( $hiddenLabel)
inherited

Sets label to be hidden.

Parameters
bool$hiddenLabelsets if label should be hidden

◆ validateSubmitValue()

MoodleQuickForm_passwordunmask::validateSubmitValue ( $value)

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.

Parameters
string$valueSubmitted value.
Return values
string|nullValidation error message or null.

The documentation for this class was generated from the following file: