SilverCart\Forms\ContactForm
a contact form of the CustomHTMLForms modul.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ContactForm
extends CustomForm
{
- // Inherited constants from CustomForm
- const DEFAULT_NAME = 'CustomForm';
- // members
- private static bool $spam_check_firstname_surname_enabled = true;
- protected array $customExtraClasses = ;
- protected boolean $securityTokenEnabled = false;
- private static array $requiredFields = ;
- protected HoneyPotField|null $honeyPotField = NULL;
- // Inherited members from CustomForm
- protected array $customExtraClasses;
- protected boolean $securityTokenEnabled;
- // methods
- public array getRequiredFields()
- public array getCustomFields()
- protected array getCustomFormFields()
- protected array getSubjectFields()
- protected array getGoogleRecaptchaFields()
- protected array getHoneyPotFields()
- protected array getHoneyPotField()
- public array getCustomActions()
- public void doSubmit()
- public static void enable_spam_check_firstname_surname()
- public static void disable_spam_check_firstname_surname()
- protected ContactFormPage|null ContactPage()
- public bool EnableGoogleRecaptcha()
- public bool EnableHoneyPot()
- public bool HasCustomFormFields()
- public bool HasSubjects()
- // Inherited methods from CustomForm
- public void __construct()
- public $this addErrorClass()
- public array getRequiredFields()
- public $this clearFormState()
- public CustomForm loadMessagesFrom()
- public Controller|null setErrorMessage()
- public Controller|null setSuccessMessage()
- public void setDefaultSuccessMessage()
- public void setDefaultSuccessMessageSent()
- public void markFieldValidationError()
- public void setTemplateBySuffix()
- protected void beforeUpdateFields()
- public FieldList Fields()
- public CustomForm fillWithPostedValues()
- protected void beforeUpdateActions()
- public FieldList Actions()
- protected void beforeUpdateCustomFields()
- public array getCustomFields()
- protected void beforeUpdateCustomActions()
- public array getCustomActions()
- protected void beforeOnBeforeSubmit()
- protected void beforeOnAfterSubmit()
- public void submit()
- public void doSubmit()
- protected void beforeUpdateFieldLabels()
- public array fieldLabels()
- public string fieldLabel()
- public void prepareSubmittedData()
- public DBHTMLText getRenderedUpdatedCustomFields()
- public DBHTMLText getCustomFormSpecialFields()
- public DBHTMLText getAfterFormContent()
- public DBHTMLText getBeforeFormContent()
- public string getRequiredFieldMarker()
- public DBHTMLText renderForTemplate()
- public void getEncType()
Hierarchy
Extends
Constants
Name | Value |
---|---|
DEFAULT_NAME | 'CustomForm' |
Members
private
- $requiredFields
—
array
List of required fields. - $spam_check_firstname_surname_enabled
—
SilverCart\Forms\bool
Spam check parameter for equal firstname and surname.
protected
- $customExtraClasses
—
array
Custom extra CSS classes. - $customExtraClasses
—
array
Custom extra CSS classes. - $honeyPotField
—
SilverCart\Forms\HoneyPotField|null
HoneyPotField - $securityTokenEnabled
—
boolean
Don't enable Security token for this type of form because we'll run into caching problems when using it. - $securityTokenEnabled
—
boolean
Don't enable Security token for this type of form because we'll run into caching problems when using it.
Methods
protected
- ContactPage() — Returns the contact form page.
- getCustomFormFields() — Returns the fields for the subject.
- getGoogleRecaptchaFields() — Returns the Google reCAPTCHA related form fields.
- getHoneyPotField() — Returns the HoneyPot related form fields.
- getHoneyPotFields() — Returns the HoneyPot related form fields.
- getSubjectFields() — Returns the fields for the subject.
public
- EnableGoogleRecaptcha() — Returns whether Google reCAPTCHA is enabled or not.
- EnableHoneyPot() — Returns whether HoneyPot is enabled.
- HasCustomFormFields() — Returns whether this form has FormFields.
- HasSubjects() — Returns whether this form has subjects.
- disable_spam_check_firstname_surname() — Disables the spam check parameter for equal firstname and surname.
- doSubmit() — Submits the form.
- enable_spam_check_firstname_surname() — Enables the spam check parameter for equal firstname and surname.
- getCustomActions() — Returns the static form fields.
- getCustomFields() — Returns the static form fields.
- getRequiredFields() — Returns the required fields.
Inherited from SilverCart\Forms\CustomForm
protected
- beforeOnAfterSubmit() — Allows user code to hook into CustomForm::submit() prior to onAfterSubmit being called on extensions
- beforeOnBeforeSubmit() — Allows user code to hook into CustomForm::submit() prior to onBeforeSubmit being called on extensions
- beforeUpdateActions() — Allows user code to hook into CustomForm::Actions prior to updateActions being called on extensions
- beforeUpdateCustomActions() — Allows user code to hook into CustomForm::getCustomActions prior to updateCustomActions being called on extensions
- beforeUpdateCustomFields() — Allows user code to hook into CustomForm::getCustomFields prior to updateCustomFields being called on extensions
- beforeUpdateFieldLabels() — Allows user code to hook into CustomForm::fieldLabels() prior to updateFieldLabels being called on extensions
- beforeUpdateFields() — Allows user code to hook into CustomForm::Fields prior to updateFields being called on extensions
public
- Actions() — Returns the form actions.
- Fields() — Returns the form fields.
- addErrorClass() — Adds a CSS class to the form if an error occured.
- clearFormState() — Flush persistant form state details
- doSubmit() — Method to use for a CustomForm extensions submission.
- fieldLabel() — Returns the field label for the given field name.
- fieldLabels() — Returns the field labels for this form.
- fillWithPostedValues() — Fills the form fields with the posted data.
- getAfterFormContent() — Returns the rendered content injected by extensions to insert after the form fields right before the closing </form> tag.
- getBeforeFormContent() — Returns the rendered content injected by extensions to insert before the form fields right after the hidden fields and form messages.
- getCustomActions() — Returns the static form fields.
- getCustomFields() — Returns the static form fields.
- getCustomFormSpecialFields() — Returns the rendered form fields injected by extensions.
- getEncType() — Returns the encoding type for the form.
- getRenderedUpdatedCustomFields() — Returns the rendered form fields injected by extensions.
- getRequiredFieldMarker() — Returns the required field marker.
- getRequiredFields() — Returns the required fields.
- loadMessagesFrom() — Populate this form with messages from the given ValidationResult.
- markFieldValidationError() — Marks the field with the given name as validation error field.
- prepareSubmittedData() — Prepares the submitted data.
- renderForTemplate() — Returns the rendered position.
- setDefaultSuccessMessage() — Sets the default success message.
- setDefaultSuccessMessageSent() — Sets the default success message.
- setErrorMessage() — Sets a manual error message.
- setSuccessMessage() — Sets the success message.
- setTemplateBySuffix() — Sets the form template by the given suffix.
- submit() — Submits the form.