Class CMS_forms_formular

Description

Class CMS_forms_formular

Located in /automne/classes/modules/cms_forms/form.php (line 25)

CMS_grandFather
   |
   --CMS_forms_formular
Class Constant Summary
Method Summary
 static boolean cleanEmptyForms ()
 CMS_forms_formular __construct (integer $id, [CMS_profile_user $cms_user = false], boolean $public)
 string, addField ( $source,  $field, string $source,, CMS_forms_field $field,)
 true checkFormCode ( $formCode)
 string, checkInputs ( $source, string $source,)
 boolean destroy ()
 array getActions ()
 array getActionsByType ( $actionType)
 multidimentionnal getAllRecordDatas ([boolean $withDesactivedFields = false], [ $withDate = false])
 string getAttribute (string $name)
 XHTML getContent ([constant $actionParams = false], [array $fieldsError = array()])
 CMS_forms_field getFieldById (string $fieldId)
 array getFieldByName (string $fieldName, [boolean $outputobjects = false], [boolean $withDesactivedFields = false])
 array getFields ([boolean $outputobjects = false], [boolean $withDesactivedFields = false])
 integer getID ()
 CMS_profile_user, getOwner ()
 string getValidationLabel ()
 boolean hasActions ()
 boolean hasRecords ()
 array isAlreadyFolded ( $sender)
 boolean isPublic ()
 string, replaceField ( $source,  $field, string $source,, CMS_forms_field $field,)
 boolean resetRecords ()
 void setAttribute (string $name, $value $value)
 CMS_language setLanguage ($language $language)
 boolean writeToPersistence ()
 void _addField (multidimentionnal &$definition,  &$field, CMS_forms_field $field,)
 void _checkInputs (multidimentionnal &$definition)
 void _fillSelectedFormValues (multidimentionnal &$definition, array $fields, array $fieldsError, (inplicit) 3)
 void _replaceField (multidimentionnal &$definition,  &$field, CMS_forms_field $field,)
Methods
static cleanEmptyForms (line 960)

Delete all empty forms created

  • access: public
static boolean cleanEmptyForms ()
Constructor __construct (line 92)

Constructor

  • access: public
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
addField (line 482)

Add a field in form code

  • return: the xhtml source checked
  • access: public
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
checkFormCode (line 982)

Analyse a form xhtml code check if it has some copy-pasted code inside

  • return: if none error founded
  • access: public
true checkFormCode ( $formCode)
  • $formCode
checkInputs (line 353)

Check all input tags in XHTML source (cause IE sometimes remove input type values)

  • return: the xhtml source checked
  • access: public
string, checkInputs ( $source, string $source,)
  • string $source,: the xhtml source to check
  • $source
destroy (line 559)

Totally destroys references to this formular and all its records

  • return: true on success, false on failure
  • access: public
boolean destroy ()
getActions (line 735)

Get all form actions

  • return: of CMS_forms_action
  • access: public
array getActions ()
getActionsByType (line 746)

Get all actions of a given type

  • return: of CMS_forms_action
  • access: public
array getActionsByType ( $actionType)
  • $actionType
getAllRecordDatas (line 872)

Get all form records datas

  • return: array
  • access: public
multidimentionnal getAllRecordDatas ([boolean $withDesactivedFields = false], [ $withDate = false])
  • boolean $withDesactivedFields: : add desactived fields to returned result (default : false)
  • $withDate
getAttribute (line 156)

Getter for any private attribute on this class

  • access: public
string getAttribute (string $name)
  • string $name
getCategories (line 225)

Get the CMS_forms_formularCategories object representing relations between this object and modules categories

  • access: public
CMS_forms_formularCategories getCategories ()
getContent (line 244)

Get content for this formular means a PHP/XHTML source code executable representing full working form

  • return: string
  • access: public
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
getFieldById (line 835)

Get form field by it's id

  • return: or false if none found
  • access: public
CMS_forms_field getFieldById (string $fieldId)
  • string $fieldId: : the form field id to get
getFieldByName (line 805)

Get form field by it's name

  • return: of CMS_forms_field
  • access: public
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)
getFields (line 792)

Get all form fields

  • return: of CMS_forms_field
  • access: public
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)
getID (line 145)

Getter for the ID

  • access: public
integer getID ()
getLanguage (line 180)

Get the language

  • access: public
CMS_language &getLanguage ()
getOwner (line 210)

Get the resource's owner

  • return: or null if none found
  • access: public
CMS_profile_user, getOwner ()
getValidationLabel (line 136)

This label is only used when printign resources in workflow tables

  • access: public
string getValidationLabel ()
hasActions (line 724)

This form has actions attached to it ?

  • access: public
boolean hasActions ()
hasRecords (line 850)

This form has records attached to it ?

  • access: public
boolean hasRecords ()
isAlreadyFolded (line 757)

Is form already folded by sender

  • return: of CMS_forms_action
  • access: public
array isAlreadyFolded ( $sender)
  • $sender
isPublic (line 200)

Is form pubic ?

  • access: public
boolean isPublic ()
replaceField (line 402)

Replace field in form code

  • return: the xhtml source checked
  • access: public
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
resetRecords (line 922)

Delete all form records

  • access: public
boolean resetRecords ()
setAttribute (line 168)

Setter for any private attribute on this class

  • access: public
void setAttribute (string $name, $value $value)
  • string $name: name of attribute to set
  • $value $value: , the value to give
setLanguage (line 189)
  • access: public
CMS_language setLanguage ($language $language)
  • $language $language
writeToPersistence (line 652)

Writes the news into persistence (MySQL for now), along with base data.

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()
_addField (line 506)

Recursive method to add input tags in XHTML source

  • access: private
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
_checkInputs (line 375)

Recursive method to check all input tags in XHTML source (cause IE sometimes remove input type values)

  • access: private
void _checkInputs (multidimentionnal &$definition)
  • multidimentionnal &$definition: array &definition : the XML definition to treat (by reference)
_fillSelectedFormValues (line 292)

Recursive method to add all selected values into a multidimentionnal array representing a formular source

  • access: private
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)
_replaceField (line 426)

Recursive method to replace input tags in XHTML source

  • access: private
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()
Class Constants
ALLOW_FORM_SUBMIT = 1 (line 32)
MESSAGE_CMS_FORMS_EMAIL_SUBJECT = 69 (line 27)
MESSAGE_CMS_FORMS_MALFORMED_FIELDS = 68 (line 28)
MESSAGE_CMS_FORMS_REQUIRED_FIELDS = 67 (line 29)
MESSAGE_CMS_FORMS_SUBMIT_NOT_ALLOWED = 83 (line 26)
MESSAGE_CMS_FORMS_TOKEN_EXPIRED = 91 (line 30)
REMOVE_FORM_SUBMIT = 0 (line 33)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:30:36 +0100 by phpDocumentor 1.4.3