Bitrix API

Form

Subtype for blocks with CRM-forms

Table of Contents

Constants

INLINE_MARKER_PREFIX  = '#crmFormInline'
POPUP_MARKER_PREFIX  = '#crmFormPopup'

Methods

clearCache()  : void
Clears cache all sites with blocks.
getCallbackForms()  : array<string|int, mixed>
Find only callback forms. Return array of form arrays, or empty array if not found
getFormByBlock()  : int|null
Return CRM-form ID from block, if exists. Else return null;
getFormById()  : array<string|int, mixed>
Find just one form by ID. Return array of form fields, or empty array if not found
getForms()  : array<string|int, mixed>
Gets web forms in system.
getLandingFormBlocks()  : array<string|int, mixed>
getOriginalFormDomain()  : string
Get original domain for web-forms.
prepareFormsToPublication()  : string
Replace form markers in block, put true scripts. Run on publication action
prepareFormsToView()  : string
Replace form markers in block, put true scripts. Run on view in public mode
prepareManifest()  : array<string|int, mixed>
Prepare manifest.
setFormIdToBlock()  : bool
Save form params in block for current form
setSpecialFormToBlock()  : void
updateLandingToEmbedForms()  : void
Find old forms blocks and update to embed format

Constants

INLINE_MARKER_PREFIX

public mixed INLINE_MARKER_PREFIX = '#crmFormInline'

POPUP_MARKER_PREFIX

public mixed POPUP_MARKER_PREFIX = '#crmFormPopup'

Methods

clearCache()

Clears cache all sites with blocks.

public static clearCache() : void

getCallbackForms()

Find only callback forms. Return array of form arrays, or empty array if not found

public static getCallbackForms() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFormByBlock()

Return CRM-form ID from block, if exists. Else return null;

public static getFormByBlock(int $blockId) : int|null
Parameters
$blockId : int
Return values
int|null

getFormById()

Find just one form by ID. Return array of form fields, or empty array if not found

public static getFormById(int $id) : array<string|int, mixed>
Parameters
$id : int
Return values
array<string|int, mixed>

getForms()

Gets web forms in system.

public static getForms([bool $force = false ]) : array<string|int, mixed>
Parameters
$force : bool = false
  • if true - get forms forcibly w/o cache
Return values
array<string|int, mixed>

getLandingFormBlocks()

public static getLandingFormBlocks(int|array<string|int, mixed> $landingIds) : array<string|int, mixed>
Parameters
$landingIds : int|array<string|int, mixed>
  • int or [int] of landing IDs
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>

of all block with CRM-forms at this page

getOriginalFormDomain()

Get original domain for web-forms.

public static getOriginalFormDomain() : string
Return values
string

prepareFormsToPublication()

Replace form markers in block, put true scripts. Run on publication action

public static prepareFormsToPublication(string $content) : string
Parameters
$content : string
  • content of block
Return values
string
  • replaced content

prepareFormsToView()

Replace form markers in block, put true scripts. Run on view in public mode

public static prepareFormsToView(string $content) : string
Parameters
$content : string
  • content of block
Return values
string
  • replaced content

prepareManifest()

Prepare manifest.

public static prepareManifest(array<string|int, mixed> $manifest[, Block|null $block = null ][, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$manifest : array<string|int, mixed>

Block's manifest.

$block : Block|null = null

Block instance.

$params : array<string|int, mixed> = []

Additional params.

Return values
array<string|int, mixed>

setFormIdToBlock()

Save form params in block for current form

public static setFormIdToBlock(int $blockId, int $formId) : bool
Parameters
$blockId : int
  • from landing block table
$formId : int
  • from webform table
Return values
bool
  • true if success, false if errors

setSpecialFormToBlock()

public static setSpecialFormToBlock(Block $block, string $xmlId) : void
Parameters
$block : Block
$xmlId : string

updateLandingToEmbedForms()

Find old forms blocks and update to embed format

public static updateLandingToEmbedForms(int $landingId) : void
Parameters
$landingId : int

        
On this page

Search results