Custom Forms: Difference between revisions

From IHRIS Wiki
Line 3: Line 3:
Define and edit the form Classes available in the system.
Define and edit the form Classes available in the system.
===I2CE_Swiss_FormClasses===
===I2CE_Swiss_FormClasses===
This is the root swiss node for the form classes interface and will be associated (via the I2CE_Page_SwissMagic) to the /modules/forms/formClasses magic data node.
This is the root swiss node for the form classes interface.
Will be associated (via the I2CE_Page_SwissMagic) to the /modules/forms/formClasses magic data node.


Functionality:
Functionality:
Line 13: Line 14:
All of this children have type I2CE_Swiss_FormClass
All of this children have type I2CE_Swiss_FormClass
===I2CE_Swiss_FormClass===
===I2CE_Swiss_FormClass===
This is the the swiss node associated to each of the subclasses of I2CE_Form
This is the the swiss node associated to each of the subclasses of I2CE_Form.
Correponds to the magic data node /modules/forms/formClasses/$formClass
If has the following functionality:
If has the following functionality:
*links to the [[#I2Ce_Swiss_FormClass_Fields|fields]] menu
*links to the [[#I2Ce_Swiss_FormClass_Fields|fields]] menu
Line 20: Line 22:
===I2CE_Swiss_FormClasss_Fields===
===I2CE_Swiss_FormClasss_Fields===
Container swiss node to  hold all of the fields.   
Container swiss node to  hold all of the fields.   
Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields.
Functionality:
Functionality:
*lists all the fields in this class
*lists all the fields in this class
*allow you to add a new field to this class by specifying
*allow you to add a new field to this class by specifying
**a short name for the field
**a short name for the field
***This will be the name $name of the child magic data node to create
**the subclass of I2CE_FormField which implements this field
**the subclass of I2CE_FormField which implements this field
**A default header (this will be passed to the I2CE_Swiss_FormClass_Field_Headers)
***once the name, form field and header are validated this will be set via I2CE_Swiss_FormClass_Field
**A default header
***once the name, form field and header are validated this this will be set via I2CE_Swiss_FormClass_Field which in turn will pass it to I2CE_Swiss_FormClass_Field_Headers


Each child of this node has type FormClass_Field
Each child of this node has type FormClass_Field
Line 31: Line 37:
===I2CE_Swiss_FormClass_Field===
===I2CE_Swiss_FormClass_Field===
This is the swiss node responsible for defining the field in a form class.
This is the swiss node responsible for defining the field in a form class.
Corresponds to the magic data node /modules/forms/formClasses/$class/fields/$field.
Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields/$field.
Functionality:
Functionality:
*links to the field headers menu
*allows you to specify if this field is stored in the DB. (defaults to true)
*if the field
**use I2CE_Swiss->get/setField() $field='in_db'
*allows you to specify if this field is required. (defaults to false
**use I2CE_Swiss->get/setField() $field='required'
*links to the [[#I2CE_Siwss_FormClass_Field_Headers| headers]] menu
 


===I2CE_Swiss_FormClass_Field_Headers===
===I2CE_Swiss_FormClass_Field_Headers===
Specifies the headers for a form field.  
Specifies the headers for a form field.  
Corresponds to the magic data node /modules/forms/formClasses/$class/fields/$field/headers.
Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields/$field/headers.
Functionality:
Functionality:
*specify the 'default' header.
*specify the 'default' header.
*specify any other named headers.
**use get/setField() with $field = 'default'
*specify any other named header named $name.
**use I2CE_Swiss->get/setField() with $field = $nam


===I2CE_Swiss_FormClass_Field_Meta===
===I2CE_Swiss_FormClass_Field_Meta===

Revision as of 13:22, 4 September 2009

Provide a means to design forms from the web interface.

Form Classes Swiss Magic Data Editor

Define and edit the form Classes available in the system.

I2CE_Swiss_FormClasses

This is the root swiss node for the form classes interface. Will be associated (via the I2CE_Page_SwissMagic) to the /modules/forms/formClasses magic data node.

Functionality:

  • lists all the available form classes
    • These are keys of the sub magic data nodes of /modules/forms/formClasses and can be determeined as getStorage()->getKeys()
  • allow the creation of a new form class by specifying:
    • the class name
    • the class that it extends (Defaults to I2CE_Form). should be a drop down list of the available classess

All of this children have type I2CE_Swiss_FormClass

I2CE_Swiss_FormClass

This is the the swiss node associated to each of the subclasses of I2CE_Form. Correponds to the magic data node /modules/forms/formClasses/$formClass If has the following functionality:

The child 'fields' has type FormClass_Fields

I2CE_Swiss_FormClasss_Fields

Container swiss node to hold all of the fields. Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields. Functionality:

  • lists all the fields in this class
  • allow you to add a new field to this class by specifying
    • a short name for the field.
      • This will be the name $name of the child magic data node to create
    • the subclass of I2CE_FormField which implements this field
      • once the name, form field and header are validated this will be set via I2CE_Swiss_FormClass_Field
    • A default header
      • once the name, form field and header are validated this this will be set via I2CE_Swiss_FormClass_Field which in turn will pass it to I2CE_Swiss_FormClass_Field_Headers

Each child of this node has type FormClass_Field

I2CE_Swiss_FormClass_Field

This is the swiss node responsible for defining the field in a form class. Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields/$field. Functionality:

  • allows you to specify if this field is stored in the DB. (defaults to true)
    • use I2CE_Swiss->get/setField() $field='in_db'
  • allows you to specify if this field is required. (defaults to false
    • use I2CE_Swiss->get/setField() $field='required'
  • links to the headers menu


I2CE_Swiss_FormClass_Field_Headers

Specifies the headers for a form field. Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields/$field/headers. Functionality:

  • specify the 'default' header.
    • use get/setField() with $field = 'default'
  • specify any other named header named $name.
    • use I2CE_Swiss->get/setField() with $field = $nam

I2CE_Swiss_FormClass_Field_Meta

Container node for the meta data associated to a field. Corresponds to the magic data node /modules/forms/formClasses/$formClass/fields/$fields/meta. Functionality:

DO NOT READ THIS SECTION

      • if a mapped field, what are the forms it can take values in
      • if a mapped field, what is the (default) displayed fields for tiered lists (e.g. county, district, region country) this should be done in a nice drop-down interface to choose the form/linked field.
    • if if it is a list form, what are the primary and secondary display fields:
      • need to move the code for defining primary/secondary display fields out of the class constants and into magic data and adjust the hooked method into the class autoloader to allow for constants or move the display fields
  • Define a form