Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс Form

Открытые статические члены

static prepareFormsToPublication (string $content)
 
static prepareFormsToView (string $content)
 
static clearCache ()
 
static getForms (bool $force=false)
 
static getFormById (int $id)
 
static getCallbackForms ()
 
static prepareManifest (array $manifest, Block $block=null, array $params=[])
 
static getLandingFormBlocks ($landingIds)
 
static getFormByBlock (int $blockId)
 
static setFormIdToBlock (int $blockId, int $formId)
 
static setSpecialFormToBlock (Block $block, string $xmlId)
 
static updateLandingToEmbedForms (int $landingId)
 
static getOriginalFormDomain ()
 

Открытые атрибуты

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

Защищенные статические члены

static replaceFormMarkers (string $content)
 
static isCrm ()
 
static getFormsForPortal (array $filter=[])
 
static getFormsViaConnector ()
 
static getFormsByFilter (array $filter)
 
static getAttrs ()
 
static prepareFormsToAttrs (array $forms)
 
static setFormIdParam (Block $block, int $formId)
 
static createDefaultForm ()
 
static createForm (array $formData)
 
static getSpecialFormsData ()
 
static updateBlockToEmbed (Block $block)
 

Защищенные данные

const ATTR_FORM_PARAMS = 'data-b24form'
 
const ATTR_FORM_EMBED = 'data-b24form-embed'
 
const ATTR_FORM_STYLE = 'data-b24form-design'
 
const ATTR_FORM_USE_STYLE = 'data-b24form-use-style'
 
const ATTR_FORM_FROM_CONNECTOR = 'data-b24form-connector'
 
const ATTR_FORM_OLD_DOMAIN = 'data-b24form-original-domain'
 
const ATTR_FORM_OLD_HEADER = 'data-b24form-show-header'
 
const SELECTOR_FORM_NODE = '.bitrix24forms'
 
const SELECTOR_OLD_STYLE_NODE = '.landing-block-form-styles'
 
const STYLE_SETTING = 'crm-form'
 
const REGEXP_FORM_STYLE = '/data-b24form-design *= *[\'"](\{.+\})[\'"]/i'
 
const REGEXP_FORM_ID_INLINE = '/data-b24form=["\']#crmFormInline(?<id>[\d]+)["\']/i'
 
const AVAILABLE_FORM_FIELDS
 

Подробное описание

См. определение в файле form.php строка 25

Методы

◆ clearCache()

static clearCache ( )
static

Clears cache all sites with blocks.

Возвращает
void

См. определение в файле form.php строка 172

◆ createDefaultForm()

static createDefaultForm ( )
staticprotected

Create form with default params

Возвращает
array - array with once item, fields equal getForms(). Or empty array if not created

См. определение в файле form.php строка 710

◆ createForm()

static createForm ( array $formData)
staticprotected
Аргументы
array$formData
Возвращает
int|null - id of created form or null if errors

См. определение в файле form.php строка 724

◆ getAttrs()

static getAttrs ( )
staticprotected

Gets attrs for form.

Возвращает
array

См. определение в файле form.php строка 512

◆ getCallbackForms()

static getCallbackForms ( )
static

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

Возвращает
array

См. определение в файле form.php строка 315

◆ getFormByBlock()

static getFormByBlock ( int $blockId)
static

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

Аргументы
int$blockId
Возвращает
int|null

См. определение в файле form.php строка 663

◆ getFormById()

static getFormById ( int $id)
static

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

Возвращает
array

См. определение в файле form.php строка 304

◆ getForms()

static getForms ( bool $force = false)
static

Gets web forms in system.

Аргументы
bool$force- if true - get forms forcibly w/o cache
Возвращает
array

См. определение в файле form.php строка 215

◆ getFormsByFilter()

static getFormsByFilter ( array $filter)
staticprotected

См. определение в файле form.php строка 320

◆ getFormsForPortal()

static getFormsForPortal ( array $filter = [])
staticprotected

См. определение в файле form.php строка 244

◆ getFormsViaConnector()

static getFormsViaConnector ( )
staticprotected

См. определение в файле form.php строка 273

◆ getLandingFormBlocks()

static getLandingFormBlocks ( $landingIds)
static
Аргументы
int | array$landingIds- int or [int] of landing IDs
Возвращает
array of all block with CRM-forms at this page
Исключения

Bitrix\Main\ArgumentException

Исключения

Bitrix\Main\ObjectPropertyException

Исключения

Bitrix\Main\SystemException

См. определение в файле form.php строка 633

◆ getOriginalFormDomain()

static getOriginalFormDomain ( )
static

Get original domain for web-forms.

Возвращает
string

См. определение в файле form.php строка 969

◆ getSpecialFormsData()

static getSpecialFormsData ( )
staticprotected

См. определение в файле form.php строка 801

◆ isCrm()

static isCrm ( )
staticprotected

Check if b24 or box portal

Возвращает
bool

См. определение в файле form.php строка 239

◆ prepareFormsToAttrs()

static prepareFormsToAttrs ( array $forms)
staticprotected

Move callback form to end.

Аргументы
array$formsForms array.
Возвращает
array

См. определение в файле form.php строка 596

◆ prepareFormsToPublication()

static prepareFormsToPublication ( string $content)
static

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

Аргументы
string$content- content of block
Возвращает
string - replaced content

См. определение в файле form.php строка 61

◆ prepareFormsToView()

static prepareFormsToView ( string $content)
static

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

Аргументы
string$content- content of block
Возвращает
string - replaced content

См. определение в файле form.php строка 72

◆ prepareManifest()

static prepareManifest ( array $manifest,
Block $block = null,
array $params = [] )
static

Prepare manifest.

Аргументы
array$manifestBlock's manifest.
Block | null$blockBlock instance.
array$paramsAdditional params.
Возвращает
array

См. определение в файле form.php строка 369

◆ replaceFormMarkers()

static replaceFormMarkers ( string $content)
staticprotected

Replaces and returns all #crmForm-link to the popup codes or in inline forms For CP - every hit (cached), for SMN - on public

Аргументы
string$contentSome content.
Возвращает
string

См. определение в файле form.php строка 87

◆ setFormIdParam()

static setFormIdParam ( Block $block,
int $formId )
staticprotected

Encapsulates the form params save logic

Аргументы
Block$block
int$formId- from webform table

См. определение в файле form.php строка 693

◆ setFormIdToBlock()

static setFormIdToBlock ( int $blockId,
int $formId )
static

Save form params in block for current form

Аргументы
int$blockId- from landing block table
int$formId- from webform table
Возвращает
bool - true if success, false if errors

См. определение в файле form.php строка 679

◆ setSpecialFormToBlock()

static setSpecialFormToBlock ( Block $block,
string $xmlId )
static
Аргументы
Block$block
string$xmlId

См. определение в файле form.php строка 771

◆ updateBlockToEmbed()

static updateBlockToEmbed ( Block $block)
staticprotected

Migrate from old form to new embed, adjust block params, remove old style nodes

Аргументы
Block$block

См. определение в файле form.php строка 902

◆ updateLandingToEmbedForms()

static updateLandingToEmbedForms ( int $landingId)
static

Find old forms blocks and update to embed format

Аргументы
int$landingId

См. определение в файле form.php строка 878

Данные класса

◆ ATTR_FORM_EMBED

const ATTR_FORM_EMBED = 'data-b24form-embed'
protected

См. определение в файле form.php строка 28

◆ ATTR_FORM_FROM_CONNECTOR

const ATTR_FORM_FROM_CONNECTOR = 'data-b24form-connector'
protected

См. определение в файле form.php строка 31

◆ ATTR_FORM_OLD_DOMAIN

const ATTR_FORM_OLD_DOMAIN = 'data-b24form-original-domain'
protected

См. определение в файле form.php строка 32

◆ ATTR_FORM_OLD_HEADER

const ATTR_FORM_OLD_HEADER = 'data-b24form-show-header'
protected

См. определение в файле form.php строка 33

◆ ATTR_FORM_PARAMS

const ATTR_FORM_PARAMS = 'data-b24form'
protected

См. определение в файле form.php строка 27

◆ ATTR_FORM_STYLE

const ATTR_FORM_STYLE = 'data-b24form-design'
protected

См. определение в файле form.php строка 29

◆ ATTR_FORM_USE_STYLE

const ATTR_FORM_USE_STYLE = 'data-b24form-use-style'
protected

См. определение в файле form.php строка 30

◆ AVAILABLE_FORM_FIELDS

const AVAILABLE_FORM_FIELDS
protected
Инициализатор
= [
'ID',
'NAME',
'SECURITY_CODE',
'IS_CALLBACK_FORM',
'ACTIVE',
'XML_ID',
]

См. определение в файле form.php строка 43

◆ INLINE_MARKER_PREFIX

const INLINE_MARKER_PREFIX = '#crmFormInline'

См. определение в файле form.php строка 40

◆ POPUP_MARKER_PREFIX

const POPUP_MARKER_PREFIX = '#crmFormPopup'

См. определение в файле form.php строка 41

◆ REGEXP_FORM_ID_INLINE

const REGEXP_FORM_ID_INLINE = '/data-b24form=["\']#crmFormInline(?<id>[\d]+)["\']/i'
protected

См. определение в файле form.php строка 38

◆ REGEXP_FORM_STYLE

const REGEXP_FORM_STYLE = '/data-b24form-design *= *[\'"](\{.+\})[\'"]/i'
protected

См. определение в файле form.php строка 37

◆ SELECTOR_FORM_NODE

const SELECTOR_FORM_NODE = '.bitrix24forms'
protected

См. определение в файле form.php строка 34

◆ SELECTOR_OLD_STYLE_NODE

const SELECTOR_OLD_STYLE_NODE = '.landing-block-form-styles'
protected

См. определение в файле form.php строка 35

◆ STYLE_SETTING

const STYLE_SETTING = 'crm-form'
protected

См. определение в файле form.php строка 36