GlobalWatchlist
Extension to create a global watchlist
Loading...
Searching...
No Matches
MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator Class Reference

Public Member Functions

 __construct (MessageLocalizer $messageLocalizer, int $maxSites, ?array $validSites)
 
 validateAnonBot ( $value, $allData)
 Validation callback called from HTMLRadioField::validate.
 
 validateAnonMinor ( $value, $allData)
 Validation callback called from HTMLRadioField::validate.
 
 validateSitesChosen ( $value, $allData)
 Validation callback called from HTMLFormFieldCloner::validate.
 
 requireShowingOneType ( $value, $allData)
 Validation callback called from HTMLMultiSelectField::validate.
 

Detailed Description

Author
DannyS712

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator::__construct ( MessageLocalizer $messageLocalizer,
int $maxSites,
?array $validSites )
Parameters
MessageLocalizer$messageLocalizer
int$maxSites
string[] | null$validSites

Member Function Documentation

◆ requireShowingOneType()

MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator::requireShowingOneType ( $value,
$allData )

Validation callback called from HTMLMultiSelectField::validate.

Ensure that at least one type of change is shown

See also
HTMLMultiSelectField::validate
Parameters
array$valuefor the specific field (the checkboxes)
array$allDatavalues for all of the form fields
Returns
bool|string|Message True on success, or string/Message error to display, or false to fail validation without displaying an error.

◆ validateAnonBot()

MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator::validateAnonBot ( $value,
$allData )

Validation callback called from HTMLRadioField::validate.

Ensure that user doesn't try to filter for anonymous bot edits

See also
HTMLRadioField::validate
Parameters
string$valuefor the specific field (bot edit filter)
array$allDatavalues for all of the form fields
Returns
bool|string|Message True on success, or string/Message error to display, or false to fail validation without displaying an error.

◆ validateAnonMinor()

MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator::validateAnonMinor ( $value,
$allData )

Validation callback called from HTMLRadioField::validate.

Ensure that user doesn't try to filter for anonymous minor edits

See also
HTMLRadioField::validate
Parameters
string$valuefor the specific field (minor edit filter)
array$allDatavalues for all of the form fields
Returns
bool|string|Message True on success, or string/Message error to display, or false to fail validation without displaying an error.

◆ validateSitesChosen()

MediaWiki\Extension\GlobalWatchlist\SettingsFormValidator::validateSitesChosen ( $value,
$allData )

Validation callback called from HTMLFormFieldCloner::validate.

Ensure that at least one site is chosen, that no site is chosen multiple times, and that the maximum number of sites is not exceeded.

See also
HTMLFormFieldCloner::validate
Parameters
array$valuefor the specific field (the cloned site fields) should always be a multidimensional array since this is for an HTMLFormFieldCloner field
array$allDatavalues for all of the form fields
Returns
bool|string|Message True on success, or string/Message error to display, or false to fail validation without displaying an error.

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