Documentation

ContactLib

ContactLib

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Cloudrexx Development Team info@cloudrexx.com

access

public

version
1.0.0
subpackage

coremodule_contact

Table of Contents

Constants

CHECK_TYPE_ALL  = 1
CHECK_TYPE_ALPHA  = 4
CHECK_TYPE_EMAIL  = 2
CHECK_TYPE_INTEGER  = 5
CHECK_TYPE_PHONE  = 6
CHECK_TYPE_URL  = 3
UPLOAD_DIR  = '/images/attach/'

Properties

$_arrSettings  : mixed
$arrCheckTypes  : mixed
Regexpression list
$arrForms  : mixed
$_arrRecipients  : mixed
$_lastRecipientId  : mixed
$legacyMode  : bool

Methods

_deleteFormRecipients()  : bool
delete recipients
_getJsSourceCode()  : mixed
Get Javascript Source
addForm()  : mixed
Add a new form
deleteFormEntry()  : mixed
getContactFormCaptchaStatus()  : mixed
getContactFormDetails()  : mixed
getFormEntries()  : mixed
getFormEntry()  : mixed
getFormFieldNames()  : mixed
getFormFields()  : array<string|int, mixed>
Get the form fields
getHighestSortValue()  : int
return the highest sort value of a recipient list
getLastRecipientId()  : int
return the last recipient id
getRecipients()  : array<string|int, mixed>
Return the recipients of a form
getSettings()  : mixed
initCheckTypes()  : mixed
initContactForms()  : mixed
Read the contact forms
initSettings()  : mixed
isUniqueFormName()  : bool
Check if there already exist a form with this name
processDownloadRequest()  : void
Processes file download request.
updateForm()  : mixed
Update an existing form
addFormField()  : int
Add a form field to the database
addRecipient()  : mixed
Add a new recipient
cleanFormFields()  : mixed
Remove the form fields that are not in the given list
cleanRecipients()  : mixed
Delete the recipients that aren't wanted anymore
deleteForm()  : mixed
Delete a form
getFormEntity()  : mixed
Get the form entity
insertFormLangValues()  : mixed
Insert the language values, update them if they already exist
setFormFieldLang()  : mixed
Add a form lang to a field
updateFormField()  : mixed
Update a form field
updateRecipient()  : mixed
Update the recipient
verifyDownloadRequest()  : bool
Verifies whether the current download request is authorized.
_deleteFormFieldsAndDataByFormId()  : mixed
Delete form fields and data
setRecipientLang()  : mixed
Set the recipient name of a lang

Constants

UPLOAD_DIR

public string UPLOAD_DIR = '/images/attach/'

Default upload directory

Properties

Methods

_deleteFormRecipients()

delete recipients

public _deleteFormRecipients(int $id) : bool
Parameters
$id : int
Return values
bool

_getJsSourceCode()

Get Javascript Source

public _getJsSourceCode(mixed $id, mixed $formFields[, mixed $preview = false ][, mixed $show = false ]) : mixed

Makes the sourcecode for the javascript based field checking

Parameters
$id : mixed
$formFields : mixed
$preview : mixed = false
$show : mixed = false
Tags
todo

The javascript code must be loaded using JS:registerCode()

addForm()

Add a new form

public addForm(string $emails, string $senderEmail, string $senderName, bool $showForm, bool $useCaptcha, bool $useCustomStyle, bool $sendCopy, mixed $useEmailOfSender, mixed $sendHtmlMail, mixed $sendAttachment, mixed $saveDataInCrm, mixed $crmCustomerGroups, mixed $sendMultipleReply) : mixed
Parameters
$emails : string
$senderEmail : string

E-mail address of sender

$senderName : string

Name of sender

$showForm : bool
$useCaptcha : bool
$useCustomStyle : bool
$sendCopy : bool
$useEmailOfSender : mixed
$sendHtmlMail : mixed
$sendAttachment : mixed
$saveDataInCrm : mixed
$crmCustomerGroups : mixed
$sendMultipleReply : mixed
Tags
author

Cloudrexx AG info@Cloudrexx.com

author

Stefan Heinemann sh@adfinis.com

deleteFormEntry()

public deleteFormEntry(mixed $id) : mixed
Parameters
$id : mixed

getContactFormCaptchaStatus()

public getContactFormCaptchaStatus(mixed $id) : mixed
Parameters
$id : mixed

getContactFormDetails()

public getContactFormDetails(mixed $id, mixed &$arrEmails, mixed &$senderEmail, mixed &$senderName, mixed &$subject, mixed &$feedback, mixed &$mailTemplate, mixed &$showForm, mixed &$useCaptcha, mixed &$sendCopy, mixed &$useEmailOfSender, mixed &$htmlMail, mixed &$sendAttachment, mixed &$saveDataInCRM, mixed &$crmCustomerGroups, mixed &$sendMultipleReply) : mixed
Parameters
$id : mixed
$arrEmails : mixed
$senderEmail : mixed
$senderName : mixed
$subject : mixed
$feedback : mixed
$mailTemplate : mixed
$showForm : mixed
$useCaptcha : mixed
$sendCopy : mixed
$useEmailOfSender : mixed
$htmlMail : mixed
$sendAttachment : mixed
$saveDataInCRM : mixed
$crmCustomerGroups : mixed
$sendMultipleReply : mixed

getFormEntries()

public getFormEntries(mixed $formId, mixed &$arrCols, mixed $pagingPos, mixed &$paging[, mixed $limit = true ]) : mixed
Parameters
$formId : mixed
$arrCols : mixed
$pagingPos : mixed
$paging : mixed
$limit : mixed = true

getFormEntry()

public getFormEntry(mixed $entryId) : mixed
Parameters
$entryId : mixed

getFormFieldNames()

public getFormFieldNames(mixed $id) : mixed
Parameters
$id : mixed

getFormFields()

Get the form fields

public getFormFields(int $formID) : array<string|int, mixed>
Parameters
$formID : int
Tags
author

Cloudrexx AG info@cloudrexx.com

author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

getHighestSortValue()

return the highest sort value of a recipient list

public getHighestSortValue(mixed $formId) : int
Parameters
$formId : mixed
Return values
int

getLastRecipientId()

return the last recipient id

public getLastRecipientId([mixed $refresh = false ]) : int
Parameters
$refresh : mixed = false
Return values
int

getRecipients()

Return the recipients of a form

public getRecipients(int $formID[, mixed $allLanguages = true ]) : array<string|int, mixed>
Parameters
$formID : int
$allLanguages : mixed = true
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

getSettings()

public getSettings([mixed $reinitialize = false ]) : mixed
Parameters
$reinitialize : mixed = false

initContactForms()

Read the contact forms

public initContactForms([int $id = 0 ][, string $order = null ]) : mixed
Parameters
$id : int = 0

Form ID

$order : string = null

the order for the sql query (comes from Sorting class)

isUniqueFormName()

Check if there already exist a form with this name

public isUniqueFormName(string $name, int $lang[, int $id = 0 ]) : bool
Parameters
$name : string
$lang : int
$id : int = 0
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
bool

processDownloadRequest()

Processes file download request.

public static processDownloadRequest(string $file) : void

Validates the request for proper authentication and security before serving a file from the uploads directory. Ensures that:

  • The request passes verification ( ContactLib::verifyDownloadRequest()).
  • The requested file exists and resides within the allowed upload directory.
  • Appropriate headers (content disposition and MIME type) are sent to initiate a safe browser download.

Redirects unauthenticated users to the backend login page, preserving the original request URL as a redirect parameter.

Parameters
$file : string

Relative path to the file within the upload directory.

Tags
throws
Exception

If the file is invalid, missing, or outside the upload directory.

throws
InstanceException

Used internally to terminate script execution after a successful download.

updateForm()

Update an existing form

public updateForm(int $formID, string $emails, string $senderEmail, string $senderName, bool $showForm, bool $useCaptcha, bool $useCustomStyle, bool $sendCopy, mixed $useEmailOfSender, mixed $sendHtmlMail, mixed $sendAttachment, mixed $saveDataInCrm, mixed $crmCustomerGroups, mixed $sendMultipleReply) : mixed
Parameters
$formID : int
$emails : string
$senderEmail : string

E-mail address of sender

$senderName : string

Name of sender

$showForm : bool
$useCaptcha : bool
$useCustomStyle : bool
$sendCopy : bool
$useEmailOfSender : mixed
$sendHtmlMail : mixed
$sendAttachment : mixed
$saveDataInCrm : mixed
$crmCustomerGroups : mixed
$sendMultipleReply : mixed
Tags
author

Cloudrexx AG info@cloudrexx.com

author

Stefan Heinemann sh@adfinis.com

addFormField()

Add a form field to the database

protected addFormField(int $formID, array<string|int, mixed> $field) : int
Parameters
$formID : int
$field : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
int

addRecipient()

Add a new recipient

protected addRecipient(int $formID, array<string|int, mixed> $recipient) : mixed
Parameters
$formID : int
$recipient : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

cleanFormFields()

Remove the form fields that are not in the given list

protected cleanFormFields(int $formID, array<string|int, mixed> $formFields) : mixed
Parameters
$formID : int
$formFields : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

cleanRecipients()

Delete the recipients that aren't wanted anymore

protected cleanRecipients(int $formID, array<string|int, mixed> $recipients) : mixed
Parameters
$formID : int
$recipients : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

getFormEntity()

Get the form entity

protected getFormEntity(int $id, string $emails, string $senderEmail, string $senderName, bool $showForm, bool $useCaptcha, bool $useCustomStyle, bool $sendCopy, mixed $useEmailOfSender, mixed $sendHtmlMail, mixed $sendAttachment, mixed $saveDataInCrm, mixed $crmCustomerGroups, mixed $sendMultipleReply) : mixed
Parameters
$id : int
$emails : string
$senderEmail : string

E-mail address of sender

$senderName : string

Name of sender

$showForm : bool
$useCaptcha : bool
$useCustomStyle : bool
$sendCopy : bool
$useEmailOfSender : mixed
$sendHtmlMail : mixed
$sendAttachment : mixed
$saveDataInCrm : mixed
$crmCustomerGroups : mixed
$sendMultipleReply : mixed

insertFormLangValues()

Insert the language values, update them if they already exist

protected insertFormLangValues(int $formID, int $langID, mixed $isActive, string $name, string $text, string $feedback, mixed $mailTemplate, string $subject) : mixed
Parameters
$formID : int
$langID : int
$isActive : mixed
$name : string
$text : string
$feedback : string
$mailTemplate : mixed
$subject : string
Tags
author

Stefan Heinemann sh@adfinis.com

setFormFieldLang()

Add a form lang to a field

protected setFormFieldLang(int $fieldID, mixed $langID, array<string|int, mixed> $values) : mixed

In case it already exists, update the value

Parameters
$fieldID : int
$langID : mixed
$values : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

updateFormField()

Update a form field

protected updateFormField(array<string|int, mixed> $field) : mixed
Parameters
$field : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

updateRecipient()

Update the recipient

protected updateRecipient(array<string|int, mixed> $recipient) : mixed
Parameters
$recipient : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

verifyDownloadRequest()

Verifies whether the current download request is authorized.

protected verifyDownloadRequest() : bool

Determines if a file download request can proceed based on application configuration and the current user session. Allows the request if:

  • Executed via CLI.
  • Upload protection is disabled (protectUploads setting).
  • The current user is logged in and has backend access.
Return values
bool

true if the download request is authorized; false otherwise.

_deleteFormFieldsAndDataByFormId()

Delete form fields and data

private _deleteFormFieldsAndDataByFormId(int $id) : mixed
Parameters
$id : int
Tags
author

Cloudrexx AG info@cloudrexx.com

setRecipientLang()

Set the recipient name of a lang

private setRecipientLang(int $rcID, int $langID, string $name) : mixed
Parameters
$rcID : int
$langID : int
$name : string
Tags
author

Stefan Heinemann sh@adfinis.com


        
On this page

Search results