contactForm
in package
The plugin class
Tags
Table of Contents
Properties
- $processing_post : mixed
Methods
- getAutocompleteAttr() : string
- Gets the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
- getField() : string
- Retrieves the post field if it exists
- getFieldVisiblilityOptionValue() : string
- Compatibility helper for parameters that formerly required the field visibility option values to be passed via e.g. getOption('contactform_title');
- getFormAutocompleteAttr() : string
- Returns the autocomplete attribute for the form depending if autocomplete is enabled
- getMacros() : array<string|int, mixed>
- Registers the content macro(s)
- getProcessedFieldDisabledAttr() : string
- Returns the disabled attribute if the field is being processed
- getQuizFieldQuestion() : string|bool
- Gets the the question to a quiz field if the field is enabled and setup correctly
- getRequiredAttr() : string
- Returns the required element attribute if the field is required
- getRequiredFieldMark() : string
- Helper function that returns '*" to be appended to the field name as an indicator for required fields Not for the CAPTCHA field that is always required if shown.
- isProcessingPost() : bool
- Returns true if the form is being processed.
- isRequiredField() : bool
- Checks if a field is a required one
- isVisibleField() : bool
- Helper function that checks if a field should be shown ("required" or "show") or omitted ("ommitt").
- printAttributes() : mixed
- Wrapper for printing the disabled and required attributes as needed
- printAutocompleteAttr() : mixed
- Prints the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
- printContactForm() : mixed
- Prints the mail contact form, handles checks and the mail sending. It uses Zenphoto's check for valid e-mail address and website URL and also supports CAPTCHA.
- printMacro() : type
- Buffers the contact form print out so it can be passed to its content macro
Properties
$processing_post
private
static mixed
$processing_post
= \false
Methods
getAutocompleteAttr()
Gets the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
public
static getAutocompleteAttr([string $value = 'on' ][, bool $skip_off = false ]) : string
Parameters
- $value : string = 'on'
-
Default "on" if autocomplete is ebabled
- $skip_off : bool = false
-
Set to true to skip returing autocomplete="off"
Tags
Return values
stringgetField()
Retrieves the post field if it exists
public
static getField(string $field[, int $level = 3 ]) : string
Parameters
- $field : string
- $level : int = 3
Return values
stringgetFieldVisiblilityOptionValue()
Compatibility helper for parameters that formerly required the field visibility option values to be passed via e.g. getOption('contactform_title');
public
static getFieldVisiblilityOptionValue(string $value) : string
Parameters
- $value : string
-
The field option name or the field option value (legacy)
Tags
Return values
stringgetFormAutocompleteAttr()
Returns the autocomplete attribute for the form depending if autocomplete is enabled
public
static getFormAutocompleteAttr() : string
Tags
Return values
stringgetMacros()
Registers the content macro(s)
public
static getMacros(array<string|int, mixed> $macros) : array<string|int, mixed>
Parameters
- $macros : array<string|int, mixed>
-
Passes through the array of already registered
Return values
array<string|int, mixed>getProcessedFieldDisabledAttr()
Returns the disabled attribute if the field is being processed
public
static getProcessedFieldDisabledAttr() : string
Tags
Return values
stringgetQuizFieldQuestion()
Gets the the question to a quiz field if the field is enabled and setup correctly
public
static getQuizFieldQuestion([string $which = '' ]) : string|bool
Parameters
- $which : string = ''
Tags
Return values
string|boolgetRequiredAttr()
Returns the required element attribute if the field is required
public
static getRequiredAttr(string $option) : string
Parameters
- $option : string
-
The field option name or the field option value (legacy)
Tags
Return values
stringgetRequiredFieldMark()
Helper function that returns '*" to be appended to the field name as an indicator for required fields Not for the CAPTCHA field that is always required if shown.
public
static getRequiredFieldMark(string $option) : string
..
Parameters
- $option : string
-
The field option name or the field option value (legacy)
Return values
stringisProcessingPost()
Returns true if the form is being processed.
public
static isProcessingPost() : bool
Tags
Return values
boolisRequiredField()
Checks if a field is a required one
public
static isRequiredField(string $option) : bool
Parameters
- $option : string
-
The field option name or the field option value (legacy)
Tags
Return values
boolisVisibleField()
Helper function that checks if a field should be shown ("required" or "show") or omitted ("ommitt").
public
static isVisibleField(string $option) : bool
Only for the fields set by radioboxes.
Parameters
- $option : string
-
The field option name or the field option value (legacy)
Return values
boolprintAttributes()
Wrapper for printing the disabled and required attributes as needed
public
static printAttributes(string $option[, string $autocomplete_value = 'on' ]) : mixed
Parameters
- $option : string
-
The field option name or the field option value (legacy)
- $autocomplete_value : string = 'on'
-
Default "on" if autocomplete is ebabled
Tags
printAutocompleteAttr()
Prints the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
public
static printAutocompleteAttr([string $value = "on" ][, bool $skip_off = false ]) : mixed
Parameters
- $value : string = "on"
-
Default "on" if autocomplete is ebabled
- $skip_off : bool = false
-
Set to true to skip printing autocomplete="off"
Tags
printContactForm()
Prints the mail contact form, handles checks and the mail sending. It uses Zenphoto's check for valid e-mail address and website URL and also supports CAPTCHA.
public
static printContactForm([string $subject_override = '' ]) : mixed
The contact form itself is a separate file and is located within the /contact_form/form.php so that it can be style as needed.
Parameters
- $subject_override : string = ''
-
set to override the subject.
printMacro()
Buffers the contact form print out so it can be passed to its content macro
public
static printMacro([type $subject_override = '' ]) : type
Parameters
- $subject_override : type = ''