ZenphotoCMS 1.6.1

contact_form.php

Prints an e-mail contact form that uses Zenphoto's internal validation functions for <i>e-mail</i> and <i>URL</i>.

Name, e-mail address, subject and message are required fields by default. You need to set a custom mail address to be used for the messages destination.

Support is included for CAPTCHA and for confirmation before the message is sent. No other spam filter support is provided. Your mail client will provide filtering on receipt of the message.

The contact form itself is a separate file and located within %ZENFOLDER%/%PLUGIN_FOLDER%/contact_form/form.php. Place a customized version of the form in a similar folder in your theme if you wish something different from the standard form.

Tags
author

Malte Müller (acrylian), Stephen Billard (sbillard)

Interfaces, Classes, Traits and Enums

contactformOptions
Plugin option handling class

Table of Contents

getField()  : string
Retrieves the post field if it exists
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.
showOrNotShowField()  : bool
Helper function that checks if a field should be shown ("required" or "show") or omitted ("ommitt").
checkRequiredField()  : string
Helper function that checks if the field is a required one. If it returns '*" to be appended to the field name as an indicator.
printContactFormMacro()  : type
Buffers the contact form print out so it can be passed to its content macro
getContactFormMacros()  : array<string|int, mixed>
Registers the content macro(s)

Functions

getField()

Retrieves the post field if it exists

getField(string $field[, int $level = 3 ]) : string
Parameters
$field : string
$level : int = 3
Return values
string

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.

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.

Return values
mixed

showOrNotShowField()

Helper function that checks if a field should be shown ("required" or "show") or omitted ("ommitt").

showOrNotShowField(string $option) : bool

Only for the fields set by radioboxes.

Parameters
$option : string

The option value

Return values
bool

checkRequiredField()

Helper function that checks if the field is a required one. If it returns '*" to be appended to the field name as an indicator.

checkRequiredField(string $option) : string

Not for the CAPTCHA field that is always required if shown...

Parameters
$option : string

the option value

Return values
string

printContactFormMacro()

Buffers the contact form print out so it can be passed to its content macro

printContactFormMacro([type $subject_override = '' ]) : type
Parameters
$subject_override : type = ''
Return values
type

getContactFormMacros()

Registers the content macro(s)

getContactFormMacros(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>

Search results