Difference between revisions of "Field settings.php"
Andydufton (talk | contribs) (→Alias Settings) |
Andydufton (talk | contribs) (→Common/Obligatory Attributes) |
||
| Line 27: | Line 27: | ||
*'''add_validation''' = validation rules for this field when on an add routine | *'''add_validation''' = validation rules for this field when on an add routine | ||
*'''edt_validation''' = validation rules for this field when on an edt routine | *'''edt_validation''' = validation rules for this field when on an edt routine | ||
| + | |||
| + | ====Examples==== | ||
| + | |||
| + | An example of a standard text field: | ||
| + | <pre>$conf_field_desc = | ||
| + | array( | ||
| + | 'dataclass' => 'txt', | ||
| + | 'classtype' => 'desc', | ||
| + | 'alias_tbl' => 'cor_lut_txttype', | ||
| + | 'alias_col' => 'txttype', | ||
| + | 'alias_src_key' => 'desc', | ||
| + | 'alias_type' => '1', | ||
| + | 'editable' => TRUE, | ||
| + | 'hidden' => FALSE, | ||
| + | 'add_validation' => $txt_add_validation, | ||
| + | 'edt_validation' => $txt_edt_validation | ||
| + | ); | ||
| + | </pre> | ||
| + | |||
| + | An example of a standard attribute field: | ||
| + | <pre> | ||
| + | $conf_field_samplecondition = | ||
| + | array( | ||
| + | 'dataclass' => 'attr', | ||
| + | 'classtype' => 'samplecondition', | ||
| + | 'alias_tbl' => 'cor_lut_attributetype', | ||
| + | 'alias_col' => 'attributetype', | ||
| + | 'alias_src_key' => 'sampleconditions', | ||
| + | 'alias_type' => '1', | ||
| + | //'alias_classtype' => 'Condition', | ||
| + | 'editable' => TRUE, | ||
| + | 'hidden' => FALSE, | ||
| + | 'add_validation' => $attr_add_validation, | ||
| + | 'edt_validation' => $attr_edt_validation | ||
| + | ); | ||
| + | </pre> | ||
| + | |||
| + | An example of a standard number field: | ||
| + | <pre> | ||
| + | $conf_field_total = | ||
| + | array( | ||
| + | 'dataclass' => 'number', | ||
| + | 'classtype' => 'total', | ||
| + | 'alias_tbl' => 'cor_lut_numbertype', | ||
| + | 'alias_col' => 'numbertype', | ||
| + | 'alias_src_key' => 'total', | ||
| + | 'alias_type' => '1', | ||
| + | 'editable' => TRUE, | ||
| + | 'hidden' => FALSE, | ||
| + | 'add_validation' => $number_add_validation, | ||
| + | 'edt_validation' => $number_edt_validation | ||
| + | ); | ||
| + | </pre> | ||
===Class specific settings=== | ===Class specific settings=== | ||
Revision as of 11:24, 14 November 2008
This is the documentation for the field settings file. It contains a technical description of the elements that must be and may optionally be present in fields.
Contents
Common/Obligatory Attributes
Basics
The two top settings are essential for the good working of the field:
- dataclass = This tells the system what Data Class the field is.
- classtype = This tells the system what Classtype the field is.
Alias Settings
The alias for the field requires the following 3 attributes:
- alias_tbl = the table for the getAlias call
- alias_col = the col for the getAlias call
- alias_src_key = the alias_src_key for the getAlias call
- alias_type = the alias_type for the getAlias call
It is important to add all alias values to cor_tbl_alias when configuring fields. This can be completed using the Alias Administration tools.
Other Obligatory Settings
- editable = set TRUE to process this field in forms set FALSE for display only
- hidden = set true to make the field <input type="hidden" />
- add_validation = validation rules for this field when on an add routine
- edt_validation = validation rules for this field when on an edt routine
Examples
An example of a standard text field:
$conf_field_desc =
array(
'dataclass' => 'txt',
'classtype' => 'desc',
'alias_tbl' => 'cor_lut_txttype',
'alias_col' => 'txttype',
'alias_src_key' => 'desc',
'alias_type' => '1',
'editable' => TRUE,
'hidden' => FALSE,
'add_validation' => $txt_add_validation,
'edt_validation' => $txt_edt_validation
);
An example of a standard attribute field:
$conf_field_samplecondition =
array(
'dataclass' => 'attr',
'classtype' => 'samplecondition',
'alias_tbl' => 'cor_lut_attributetype',
'alias_col' => 'attributetype',
'alias_src_key' => 'sampleconditions',
'alias_type' => '1',
//'alias_classtype' => 'Condition',
'editable' => TRUE,
'hidden' => FALSE,
'add_validation' => $attr_add_validation,
'edt_validation' => $attr_edt_validation
);
An example of a standard number field:
$conf_field_total =
array(
'dataclass' => 'number',
'classtype' => 'total',
'alias_tbl' => 'cor_lut_numbertype',
'alias_col' => 'numbertype',
'alias_src_key' => 'total',
'alias_type' => '1',
'editable' => TRUE,
'hidden' => FALSE,
'add_validation' => $number_add_validation,
'edt_validation' => $number_edt_validation
);
Class specific settings
Each class has some specific settings some of which may be optional or required.
Class: action
An example of an action class field.
$conf_field_issuedto =
array(
'dataclass' => 'action',
'classtype' => 'issuedto',
'alias_tbl' => 'cor_lut_actiontype',
'alias_col' => 'actiontype',
'alias_src_key' => 'issuedto',
'actors_mod' => 'abk',
'actors_type' => 'people',
'actors_element' => 'name',
'actors_style' => 'single',
'actors_elementclass' => 'txt',
'actors_grp' => FALSE,
'alias_type' => '1',
'editable' => TRUE,
'hidden' => FALSE,
'add_validation' => $action_add_validation,
'edt_validation' => $action_edt_validation
);
- actors_mod = The module holding the actors (normally abk)
- actors_type = The mod type as listed in mod_lut_modtype
- actors_element = The text type to display within the dropdown
- actors_style = whether actor information is displayed in a list style ('list') or as a single actor/date pairing ('single')
- actors_elementclass = Class of data to be displayed for a given actor (ie. txt, number, etc)
- actors_grp = Group functionality will allow the selection of a group of actors (in development)
Event Fields
Event fields are effectively wrappers for action/date fields. All fields must be set up above. One can also use actions and dates without having the event wrapper, but this allows one to group multiple events into a single subform.
See below for an example of a configured event field:
$conf_event_compiled =
array(
'type' => 'compiled',
'date' => $conf_field_compiledon,
'action' => $conf_field_compiledby
);