Documentation

ContactManager extends ContactLib

ContactManager

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
formMailTemplate  = '<table> <tbody> <!-- BEGIN form_field --> <tr> <td>[[FIELD_LABEL]]</td> <td>[[FIELD_VALUE]]</td> </tr> <!-- END form_field --> </tbody> </table>'
UPLOAD_DIR  = '/images/attach/'

Properties

$_arrFormFieldTypes  : mixed
$_arrSettings  : mixed
$_arrUserAccountData  : mixed
$_csvCharset  : mixed
$_csvEnclosure  : mixed
$_csvLFB  : mixed
$_csvSeparator  : mixed
$_invalidRecipients  : mixed
$_objTpl  : mixed
$_pageTitle  : mixed
$_statusMessageErr  : mixed
$_statusMessageOk  : mixed
$arrCheckTypes  : mixed
Regexpression list
$arrForms  : mixed
$em  : mixed
$_arrRecipients  : mixed
$_lastRecipientId  : mixed
$legacyMode  : bool
$act  : mixed
$nonValueFormFieldTypes  : mixed

Methods

__construct()  : mixed
PHP5 constructor
_deleteFormEntry()  : mixed
_deleteFormRecipients()  : bool
delete recipients
_escapeCsvValue()  : string
Escape a value that it could be inserted into a csv file.
_getContactFormPage()  : mixed
_getCsv()  : mixed
Get CSV File
_getFormFieldAttribute()  : mixed
_getFormFieldCheckTypesMenu()  : mixed
Check Types Menu
_getFormFieldRequiredCheckBox()  : mixed
_getFormFieldTypesMenu()  : mixed
Field Types Menu
_getJsSourceCode()  : mixed
Get Javascript Source
_getSettingsPage()  : mixed
_modifyForm()  : mixed
Modify Form
_replaceFilename()  : mixed
Replaces the special characters
_saveForm()  : mixed
Save Form
_saveSettings()  : mixed
_showRecipients()  : mixed
Display recipients in backend
addForm()  : mixed
Add a new form
csv_mb_convert_encoding()  : mixed
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
getPage()  : mixed
Get page
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.
setRecipients()  : array<string|int, mixed>
update recipient list
updateForm()  : mixed
Update an existing form
_contactFormEntries()  : void
_contactForms()  : void
_deleteForm()  : void
Delete a form
_getEntriesPage()  : void
_getEntryDetails()  : string
_settings()  : void
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
disableContentSite()  : void
getFormEntity()  : mixed
Get the form entity
getIdsOfUsedLocalesOfForm()  : array<string|int, mixed>
getPagesByLocaleIdOfForm()  : array<string|int, mixed>
insertFormLangValues()  : mixed
Insert the language values, update them if they already exist
setFormFieldLang()  : mixed
Add a form lang to a field
setNavigation()  : void
syncApplicationPages()  : void
Tries to set up application pages for the selected locales of form identified by ID $formId.
updateFormField()  : mixed
Update a form field
updateRecipient()  : mixed
Update the recipient
verifyDownloadRequest()  : bool
Verifies whether the current download request is authorized.
_getFormFieldsFromPost()  : mixed
Get the form fields from the post variables
getFileIcon()  : string
Returns the appropriate icon of the given file.
getPostRecipients()  : string
Get the recipient addresses from the post
getRecipientsFromPost()  : array<string|int, mixed>
Parse the post values and return a list of recipients

Constants

formMailTemplate

public mixed formMailTemplate = '<table> <tbody> <!-- BEGIN form_field --> <tr> <td>[[FIELD_LABEL]]</td> <td>[[FIELD_VALUE]]</td> </tr> <!-- END form_field --> </tbody> </table>'

UPLOAD_DIR

public string UPLOAD_DIR = '/images/attach/'

Default upload directory

Properties

$nonValueFormFieldTypes

private mixed $nonValueFormFieldTypes = array('horizontalLine', 'fieldset', 'label')

Methods

__construct()

PHP5 constructor

public __construct() : mixed
Tags
global

\Cx\Core\Html\Sigma

global

array

global

array

_deleteFormRecipients()

delete recipients

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

_escapeCsvValue()

Escape a value that it could be inserted into a csv file.

public _escapeCsvValue(string $value) : string
Parameters
$value : string
Return values
string

_getCsv()

Get CSV File

public _getCsv() : mixed
Tags
access

private

global

ADONewConnection

global

array

global

array

_getFormFieldAttribute()

public _getFormFieldAttribute(mixed $id, mixed $type, mixed $attr[, mixed $show = true ][, mixed $langid = 0 ]) : mixed
Parameters
$id : mixed
$type : mixed
$attr : mixed
$show : mixed = true
$langid : mixed = 0

_getFormFieldCheckTypesMenu()

Check Types Menu

public _getFormFieldCheckTypesMenu(string $name, mixed $id, mixed $type, int $selected) : mixed

Generates a selection list with all possible types which can be checked

Parameters
$name : string

Name of the selection list

$id : mixed
$type : mixed
$selected : int

Which option has to be selected

Tags
access

private

_getFormFieldRequiredCheckBox()

public _getFormFieldRequiredCheckBox(mixed $name, mixed $id, mixed $type, mixed $selected) : mixed
Parameters
$name : mixed
$id : mixed
$type : mixed
$selected : mixed

_getFormFieldTypesMenu()

Field Types Menu

public _getFormFieldTypesMenu(mixed $name, mixed $selectedType[, mixed $attrs = '' ]) : mixed

Generates a xhtml selection list with all the field types

Parameters
$name : mixed
$selectedType : mixed
$attrs : mixed = ''
Tags
access

private

_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()

_modifyForm()

Modify Form

public _modifyForm([bool $copy = false ]) : mixed

Shows the modifying page.

Parameters
$copy : bool = false

If the form should be copied or not

Tags
access

private

_replaceFilename()

Replaces the special characters

public _replaceFilename(mixed $filename) : mixed

Replaces the special characters in a filename like whitespaces or umlauts. Needed by the CSV generator.

Parameters
$filename : mixed

string Filename where the characters have to be replaced

Tags
access

private

_saveForm()

Save Form

public _saveForm() : mixed

Saves the form data

Tags
access

private

_showRecipients()

Display recipients in backend

public _showRecipients([array<string|int, mixed> $arrRecipients = array() ]) : mixed
Parameters
$arrRecipients : array<string|int, mixed> = array()

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

csv_mb_convert_encoding()

public csv_mb_convert_encoding(mixed $data) : mixed
Parameters
$data : mixed

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

getPage()

Get page

public getPage() : mixed

Get the development page

Tags
access

public

global

\Cx\Core\Html\Sigma

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.

setRecipients()

update recipient list

public setRecipients(mixed $arrRecipients) : array<string|int, mixed>
Parameters
$arrRecipients : mixed
Return values
array<string|int, mixed>

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

_getEntryDetails()

protected _getEntryDetails(mixed $arrEntry, mixed $formId) : string
Parameters
$arrEntry : mixed
$formId : mixed
Return values
string

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

disableContentSite()

protected disableContentSite(int $formId) : void
Parameters
$formId : int

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

getIdsOfUsedLocalesOfForm()

protected getIdsOfUsedLocalesOfForm(int $formId) : array<string|int, mixed>
Parameters
$formId : int
Return values
array<string|int, mixed>

getPagesByLocaleIdOfForm()

protected getPagesByLocaleIdOfForm(int $formId) : array<string|int, mixed>
Parameters
$formId : int
Return values
array<string|int, 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

syncApplicationPages()

Tries to set up application pages for the selected locales of form identified by ID $formId.

protected syncApplicationPages(int $formId) : void
Parameters
$formId : int

ID of for to set up application pages for.

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.

_getFormFieldsFromPost()

Get the form fields from the post variables

private _getFormFieldsFromPost() : mixed

This is only used when an error on saving occurs, to reparse the form fields.

getFileIcon()

Returns the appropriate icon of the given file.

private getFileIcon(string $file) : string
Parameters
$file : string
Return values
string

$img

getRecipientsFromPost()

Parse the post values and return a list of recipients

private getRecipientsFromPost() : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

        
On this page

Search results