Form_Controller_Show
extends Core_Controller
in package
Показ формы.
Доступные свойства:
- formFill ссылка на объект Form_Fill, доступный после process()
- mailType тип письма, 0 - 'text/html', 1 - 'text/plain'. По умолчанию 1
- mailXsl объект XSL-шаблона для отправки письма
- mailSubject тема письма о заполнении формы, если не указана, то используется указанная для формы
- replyTo электронный адрес отправителя (заголовок Reply-To)
- mailFromFieldName название поля, в котором содержится электронный адрес отправителя (заголовок Reply-To), если явно не указан replyTo
- from электронный адрес, от которого направляется письмо. По умолчанию первый из указанных кураторов формы
- addAllowedTags('/node/path', array('description')) массив тегов для элементов, указанных в первом аргументе, разрешенных к передаче в генерируемый XML
- addForbiddenTags('/node/path', array('description')) массив тегов для элементов, указанных в первом аргументе, запрещенных к передаче в генерируемый XML
$Form_Controller_Show = new Form_Controller_Show(
Core_Entity::factory('Form', 1)
);
$Form_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('ОтобразитьФорму')
)
->show();
Доступные пути для методов addAllowedTags/addForbiddenTags:
- '/' или '/form' Форма
- '/form/form_field_dir' Раздел полей форм
- '/form/form_field' Поле формы
Tags
Table of Contents
Properties
- $_aEmails : array<string|int, mixed>
- Emails
- $_aForm_Fields : array<string|int, mixed>|null
- Form fields
- $_aForm_Fields_Dir_Tree : array<string|int, mixed>|null
- Form field dir tree
- $_aForm_Fields_Tree : array<string|int, mixed>|null
- Form fields tree
- $_aListItemsTree : array<string|int, mixed>
- _aListItemsTree
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_allowedTags : array<string|int, mixed>
- Allowed tags for specified elements
- $_attributePrefix : string
- Attribute's prefix
- $_aUploadedFiles : array<string|int, mixed>
- Array of uploaded files
- $_cacheApplyForbiddenAllowedTags : array<string|int, mixed>
- Cache for applyForbiddenAllowedTags
- $_cacheTags : array<string|int, mixed>
- Cache tags
- $_entities : array<string|int, mixed>
- List of children entities
- $_entity : Core_Entity
- Entity
- $_error : mixed
- Error Code 0 - CAPTCHA 1 - Заполнены не все поля 2 - Слишком частое добавление 3 - Spam 4 - Некорректный CSRF-токен
- $_forbiddenTags : array<string|int, mixed>
- Forbidden tags for specified elements
- $_mode : string
- Controller's mode
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_shownIDs : array<string|int, mixed>
- Shown IDs
- $_tpl : Tpl_Model
- TPL
- $_unlimitedProperties : bool
- Object has unlimited number of properties
- $_vars : array<string|int, mixed>
- Variables/objects to the TPL-template
- $_xsl : Xsl_Model
- XSL
Methods
- __construct() : mixed
- Constructor.
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- addAllowedTag() : self
- Add tag to allowed tags list
- addAllowedTags() : self
- Add tags to allowed tags list
- addCacheSignature() : self
- Add additional signature for cache name
- addCacheTag() : self
- Add Cache Tag
- addEmail() : mixed
- Add additional email
- addEntities() : self
- Add enities
- addEntity() : self
- Add a children entity
- addForbiddenTag() : self
- Add tag to forbidden tags list
- addForbiddenTags() : self
- Add tags to forbidden tags list
- addValues() : self
- Add Form Values
- append() : self
- Append an element to an assigned array
- applyForbiddenAllowedTags() : self
- Apply Forbidden-Allowed Tags for Entity
- assign() : self
- Assign variables/objects to the TPL-template
- clearCacheTag() : self
- Clear Cache Tag
- clearEmails() : self
- Clear emails
- clearEntities() : self
- Clear enities
- clearVars() : self
- Clear vars
- get() : string
- Get HTML based by entities tree, use XSL $this->_xsl
- getAllowedTags() : array<string|int, mixed>
- Get allowed tags list
- getCacheTags() : array<string|int, mixed>
- Get Cache Tags
- getEmails() : array<string|int, mixed>
- Get emails
- getEntities() : array<string|int, mixed>
- Get enities
- getEntity() : object
- Get entity
- getError() : mixed
- Get Error Code
- getForbiddenTags() : array<string|int, mixed>
- Get forbidden tags list
- getShownIDs() : array<string|int, mixed>
- Get shown IDs
- getStdObject() : array<string|int, mixed>
- Get ARRAY for entity and children entities
- getTpl() : Tpl_Model
- Get TPL
- getXml() : string
- Get XML for entity and children entities
- getXsl() : Xsl_Model
- Get XSL
- isAllowedTag() : bool
- Check if a tag is allowed
- isForbiddenTag() : bool
- Check if a tag is forbidden
- mode() : self
- Set mode
- process() : self
- Run when pressing submit button
- removeAllowedTag() : self
- Remove tag from allowed tags list
- removeForbiddenTag() : self
- Remove tag from forbidden tags list
- sendEmail() : self
- Send Form By Email
- set() : self
- Run when writing data to inaccessible properties
- setAttributePrefix() : self
- Change attributePrefix
- setEntity() : self
- Set entity
- setUnlimitedProperties() : self
- Set unlimitedProperties
- show() : self
- Show built data
- tpl() : self
- Set TPL
- xsl() : self
- Set XSL
- _addFormFields() : self
- Add form fields
- _addListItems() : self
- Add List Items to the $oObject
- _createLead() : self
- Create lead from form fill.
- _createNotification() : self
- Create notification for subscribers
- _fillDirAndFields() : self
- Fill Dir And Fields Arrays
- _getEmails() : array<string|int, mixed>
- Get array of emails for notification
- _getSubject() : string
- Get subject
Properties
$_aEmails
Emails
protected
array<string|int, mixed>
$_aEmails
= array()
$_aForm_Fields
Form fields
protected
array<string|int, mixed>|null
$_aForm_Fields
= \NULL
$_aForm_Fields_Dir_Tree
Form field dir tree
protected
array<string|int, mixed>|null
$_aForm_Fields_Dir_Tree
= \NULL
$_aForm_Fields_Tree
Form fields tree
protected
array<string|int, mixed>|null
$_aForm_Fields_Tree
= \NULL
$_aListItemsTree
_aListItemsTree
protected
array<string|int, mixed>
$_aListItemsTree
= array()
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array('values', 'mailType', 'mailXsl', 'mailSubject', 'mailFromFieldName', 'replyTo', 'formFill', 'captcha', 'csrfFieldName', 'from')
$_allowedTags
Allowed tags for specified elements
protected
array<string|int, mixed>
$_allowedTags
= array()
$_attributePrefix
Attribute's prefix
protected
string
$_attributePrefix
= '_'
$_aUploadedFiles
Array of uploaded files
protected
array<string|int, mixed>
$_aUploadedFiles
= array()
$_cacheApplyForbiddenAllowedTags
Cache for applyForbiddenAllowedTags
protected
array<string|int, mixed>
$_cacheApplyForbiddenAllowedTags
= array()
$_cacheTags
Cache tags
protected
array<string|int, mixed>
$_cacheTags
= array()
$_entities
List of children entities
protected
array<string|int, mixed>
$_entities
= array()
$_entity
Entity
protected
Core_Entity
$_entity
= \NULL
$_error
Error Code 0 - CAPTCHA 1 - Заполнены не все поля 2 - Слишком частое добавление 3 - Spam 4 - Некорректный CSRF-токен
protected
mixed
$_error
= \NULL
$_forbiddenTags
Forbidden tags for specified elements
protected
array<string|int, mixed>
$_forbiddenTags
= array()
$_mode
Controller's mode
protected
string
$_mode
= 'json'
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_shownIDs
Shown IDs
protected
array<string|int, mixed>
$_shownIDs
= array()
$_tpl
TPL
protected
Tpl_Model
$_tpl
= \NULL
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
$_vars
Variables/objects to the TPL-template
protected
array<string|int, mixed>
$_vars
= array()
$_xsl
XSL
protected
Xsl_Model
$_xsl
= \NULL
Methods
__construct()
Constructor.
public
__construct(Form_Model $oForm) : mixed
Parameters
- $oForm : Form_Model
-
form
addAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfaddAllowedTag()
Add tag to allowed tags list
public
addAllowedTag(string $path, string $tag) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
selfaddAllowedTags()
Add tags to allowed tags list
public
addAllowedTags(string $path[, array<string|int, mixed> $aTags = array() ]) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $aTags : array<string|int, mixed> = array()
-
array of tags
Return values
selfaddCacheSignature()
Add additional signature for cache name
public
addCacheSignature(string $name) : self
Parameters
- $name : string
-
name
Return values
selfaddCacheTag()
Add Cache Tag
public
addCacheTag(string $tagName) : self
Parameters
- $tagName : string
Return values
selfaddEmail()
Add additional email
public
addEmail(string $email) : mixed
Parameters
- $email : string
-
email
addEntities()
Add enities
public
addEntities(array<string|int, mixed> $aChildrenEntities) : self
Parameters
- $aChildrenEntities : array<string|int, mixed>
-
entities
Return values
selfaddEntity()
Add a children entity
public
addEntity(Core_Entity $oChildrenEntity) : self
Parameters
- $oChildrenEntity : Core_Entity
Return values
selfaddForbiddenTag()
Add tag to forbidden tags list
public
addForbiddenTag(string $path, string $tag) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
selfaddForbiddenTags()
Add tags to forbidden tags list
public
addForbiddenTags(string $path[, array<string|int, mixed> $aTags = array() ]) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $aTags : array<string|int, mixed> = array()
-
array of tags
Return values
selfaddValues()
Add Form Values
public
addValues() : self
Return values
selfappend()
Append an element to an assigned array
public
append(mixed $varname, mixed $var) : self
Parameters
- $varname : mixed
- $var : mixed
Return values
selfapplyForbiddenAllowedTags()
Apply Forbidden-Allowed Tags for Entity
public
applyForbiddenAllowedTags(string $path, Core_Entity|array<string|int, mixed> $mEntity) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $mEntity : Core_Entity|array<string|int, mixed>
Return values
selfassign()
Assign variables/objects to the TPL-template
public
assign(mixed $varname, mixed $var) : self
Parameters
- $varname : mixed
- $var : mixed
Return values
selfclearCacheTag()
Clear Cache Tag
public
clearCacheTag() : self
Return values
selfclearEmails()
Clear emails
public
clearEmails() : self
Return values
selfclearEntities()
Clear enities
public
clearEntities() : self
Return values
selfclearVars()
Clear vars
public
clearVars() : self
Return values
selfget()
Get HTML based by entities tree, use XSL $this->_xsl
public
get() : string
Tags
Return values
stringgetAllowedTags()
Get allowed tags list
public
getAllowedTags() : array<string|int, mixed>
Return values
array<string|int, mixed>getCacheTags()
Get Cache Tags
public
getCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>getEmails()
Get emails
public
getEmails() : array<string|int, mixed>
Return values
array<string|int, mixed>getEntities()
Get enities
public
getEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>getEntity()
Get entity
public
getEntity() : object
Return values
objectgetError()
Get Error Code
public
getError() : mixed
Return values
mixed —NULL|integer
getForbiddenTags()
Get forbidden tags list
public
getForbiddenTags() : array<string|int, mixed>
Return values
array<string|int, mixed>getShownIDs()
Get shown IDs
public
getShownIDs() : array<string|int, mixed>
Return values
array<string|int, mixed>getStdObject()
Get ARRAY for entity and children entities
public
getStdObject() : array<string|int, mixed>
Return values
array<string|int, mixed>getTpl()
Get TPL
public
getTpl() : Tpl_Model
Return values
Tpl_ModelgetXml()
Get XML for entity and children entities
public
getXml() : string
Return values
stringgetXsl()
Get XSL
public
getXsl() : Xsl_Model
Return values
Xsl_ModelisAllowedTag()
Check if a tag is allowed
public
isAllowedTag(string $path, string $tag) : bool
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
boolisForbiddenTag()
Check if a tag is forbidden
public
isForbiddenTag(string $path, string $tag) : bool
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
boolmode()
Set mode
public
mode(string $mode) : self
Parameters
- $mode : string
Return values
selfprocess()
Run when pressing submit button
public
process() : self
Tags
Return values
selfremoveAllowedTag()
Remove tag from allowed tags list
public
removeAllowedTag(string $path, string $tag) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
selfremoveForbiddenTag()
Remove tag from forbidden tags list
public
removeForbiddenTag(string $path, string $tag) : self
Parameters
- $path : string
-
Path to item, e.g. /shop/shop_item
- $tag : string
-
tag
Return values
selfsendEmail()
Send Form By Email
public
sendEmail() : self
Return values
selfset()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetAttributePrefix()
Change attributePrefix
public
setAttributePrefix(string $attributePrefix) : self
Parameters
- $attributePrefix : string
Return values
selfsetEntity()
Set entity
public
setEntity(Core_Entity $entity) : self
Parameters
- $entity : Core_Entity
-
entity
Return values
selfsetUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
selfshow()
Show built data
public
show() : self
Tags
Return values
selftpl()
Set TPL
public
tpl(Tpl_Model|string $tpl) : self
Parameters
- $tpl : Tpl_Model|string
Return values
selfxsl()
Set XSL
public
xsl(Xsl_Model|string $xsl) : self
Parameters
- $xsl : Xsl_Model|string
Return values
self_addFormFields()
Add form fields
protected
_addFormFields(int $parent_id, object $oParentObject) : self
Parameters
- $parent_id : int
-
parent group ID
- $oParentObject : object
-
parent object
Return values
self_addListItems()
Add List Items to the $oObject
protected
_addListItems(int $parentId, List_Model $oObject) : self
Parameters
- $parentId : int
- $oObject : List_Model
Return values
self_createLead()
Create lead from form fill.
protected
_createLead(Form_Fill_Model $oForm_Fill) : self
Parameters
- $oForm_Fill : Form_Fill_Model
-
fill form
Return values
self_createNotification()
Create notification for subscribers
protected
_createNotification(Form_Fill_Model $oForm_Fill) : self
Parameters
- $oForm_Fill : Form_Fill_Model
Return values
self_fillDirAndFields()
Fill Dir And Fields Arrays
protected
_fillDirAndFields() : self
Return values
self_getEmails()
Get array of emails for notification
protected
_getEmails() : array<string|int, mixed>
Return values
array<string|int, mixed>_getSubject()
Get subject
protected
_getSubject() : string