Delete all empty forms created
static boolean
cleanEmptyForms
()
Constructor
CMS_forms_formular
__construct
(
integer $id, [
CMS_profile_user $cms_user =
false],
boolean $public)
-
integer
$id
-
boolean
$public: if only public data to retrieve
-
CMS_profile_user
$cms_user
Add a field in form code
string,
addField
(
$source,
$field,
string $source,,
CMS_forms_field $field,)
-
string
$source,: the xhtml source to check
-
CMS_forms_field
$field,: the field to replace
-
$source
-
$field
Analyse a form xhtml code check if it has some copy-pasted code inside
true
checkFormCode
( $formCode)
Check all input tags in XHTML source (cause IE sometimes remove input type values)
string,
checkInputs
( $source, string $source,)
-
string
$source,: the xhtml source to check
-
$source
Totally destroys references to this formular and all its records
boolean
destroy
()
Get all form actions
array
getActions
()
Get all actions of a given type
array
getActionsByType
( $actionType)
Get all form records datas
multidimentionnal
getAllRecordDatas
([boolean $withDesactivedFields = false], [ $withDate = false])
-
boolean
$withDesactivedFields: : add desactived fields to returned result (default : false)
-
$withDate
Getter for any private attribute on this class
string
getAttribute
(string $name)
Get the CMS_forms_formularCategories object representing relations between this object and modules categories
Get content for this formular means a PHP/XHTML source code executable representing full working form
XHTML
getContent
([constant $actionParams = false], [array $fieldsError = array()])
-
constant
$actionParams: : add some params to form execution (default : false, return form just as it is in db)
- self::REMOVE_FORM_SUBMIT : form can't be submitted, throw js alert message
- self::ALLOW_FORM_SUBMIT : form can be submitted, add form action, hidden fields, selected values, etc. (used in public mode)
-
array
$fieldsError: : add an array of error fields' id
Get form field by it's id
-
string
$fieldId: : the form field id to get
Get form field by it's name
array
getFieldByName
(string $fieldName, [boolean $outputobjects = false], [boolean $withDesactivedFields = false])
-
string
$fieldName: : the form field name to get
-
boolean
$outputobjects: : return array of CMS_forms_field instead of array of ids (default : false)
-
boolean
$withDesactivedFields: : add desactived fields to returned list (default : false)
Get all form fields
array
getFields
([boolean $outputobjects = false], [boolean $withDesactivedFields = false])
-
boolean
$outputobjects: : return array of CMS_forms_field instead of array of ids (default : false)
-
boolean
$withDesactivedFields: : add desactived fields to returned list (default : false)
Getter for the ID
integer
getID
()
Get the resource's owner
CMS_profile_user,
getOwner
()
This label is only used when printign resources in workflow tables
string
getValidationLabel
()
This form has actions attached to it ?
boolean
hasActions
()
This form has records attached to it ?
boolean
hasRecords
()
Is form already folded by sender
array
isAlreadyFolded
( $sender)
Is form pubic ?
boolean
isPublic
()
Replace field in form code
string,
replaceField
(
$source,
$field,
string $source,,
CMS_forms_field $field,)
-
string
$source,: the xhtml source to check
-
CMS_forms_field
$field,: the field to replace
-
$source
-
$field
Delete all form records
boolean
resetRecords
()
Setter for any private attribute on this class
void
setAttribute
(string $name, $value $value)
-
string
$name: name of attribute to set
-
$value
$value: , the value to give
Writes the news into persistence (MySQL for now), along with base data.
boolean
writeToPersistence
()
Recursive method to add input tags in XHTML source
void
_addField
(
multidimentionnal &$definition,
&$field,
CMS_forms_field $field,)
-
CMS_forms_field
$field,: the field to replace
-
multidimentionnal
&$definition: array &definition : the XML definition to treat (by reference)
-
&$field
Recursive method to check all input tags in XHTML source (cause IE sometimes remove input type values)
void
_checkInputs
(multidimentionnal &$definition)
-
multidimentionnal
&$definition: array &definition : the XML definition to treat (by reference)
Recursive method to add all selected values into a multidimentionnal array representing a formular source
void
_fillSelectedFormValues
(multidimentionnal &$definition, array $fields, array $fieldsError, (inplicit) 3)
-
array
$fields: : all form fields to get default values
-
array
$fieldsError: : all form fields malformed or required
-
(inplicit)
3: the current global $_POST values
-
multidimentionnal
&$definition: array &$definition : the XML definition to treat (by reference)
Recursive method to replace input tags in XHTML source
void
_replaceField
(
multidimentionnal &$definition,
&$field,
CMS_forms_field $field,)
-
CMS_forms_field
$field,: the field to replace
-
multidimentionnal
&$definition: array &definition : the XML definition to treat (by reference)
-
&$field
Inherited Methods
Inherited From CMS_grandFather
CMS_grandFather::autoload()
CMS_grandFather::hasError()
CMS_grandFather::log()
CMS_grandFather::PHPErrorHandler()
CMS_grandFather::raiseError()
CMS_grandFather::setDebug()
CMS_grandFather::setLog()
CMS_grandFather::_raiseError()
CMS_grandFather::__call()