Framework
3.9
|
AutoForm automatically creates a form based on an underlying DataItem. More...
Public Member Functions | |
AutoForm ($target, $method="POST", $action="", $id="") | |
Creates a new AutoForm, based on the supplied target DataItem. More... | |
getData () | |
Returns the target data item for the form. More... | |
setDataSet ($params) | |
setLayout ($layout) | |
Override the default layout manager. More... | |
setFieldOrder () | |
Override the display order for ungrouped field. More... | |
createRenderer ($field) | |
This factory method creates a FieldRender based on the type of the specified field. More... | |
addDefaultValidators () | |
Creates default validators for fields in the form. More... | |
getValidationEngine () | |
Retrieve the validation engine for this AutoForm. More... | |
makeSubordinate () | |
Set this AutoForm to be a subordinate form within a CompositeAutoForm. More... | |
configureValidators () | |
writeScript () | |
This method writes any Javascript code that will be required for the generated form to operate, including code for Rich Text Editors, Date Pickers and field validation. More... | |
getRenderer ($field) | |
Retrieves the FieldRenderer object for the specified field. More... | |
override ($field, $label="", $renderer=null) | |
Overrides the defaults for the specifed form field, providing a new label and/or FieldRenderer. More... | |
overrideType ($field, $type, $label="") | |
Override the default type for the specified form field, providing a FieldRenderer based on the supplied type (and optionally also override the field label) More... | |
add ($renderer, $field="", $label="") | |
Adds an additional (pseudo) field to the form. More... | |
hide () | |
Call this method to hide one or more fields in the form's user interface. More... | |
hideExcept () | |
Call this method to hide all the fields in the form's user interface EXCEPT the fields specified. More... | |
isHidden ($field) | |
Check whether the specified field is hidden in the form. More... | |
annotate ($field, $text) | |
Adds an annotation (such as brief explanatory text) to the specified field. More... | |
alias () | |
Use this method to override the display name for fields in the form. More... | |
related ($class, $constraint="", $format=null, $field=null, $label=null, $allowAdd=false, $allowNone=true) | |
Utility function to add a RelatedItemSelectFieldRender. More... | |
crossReference ($xrefClass, $options, $format, $field, $label=null, $xrefField=null) | |
Utility function to add a CrossReferenceSelectFieldRenderer. More... | |
dropdown ($field, $label="", $options=null, $onchange=null, $grouped=false) | |
Utility function to add a SelectFieldRenderer. More... | |
groupedDropdown ($field, $label, $options, $onchange=null) | |
Utility function to add a SelectFieldRenderer with grouped options. More... | |
radio ($field, $label, $options, $onchange=null) | |
Utility function to add a RadioButtonFieldRenderer. More... | |
checklist ($field, $label, $options, $grouped=false) | |
Utility function to add a CheckListFieldRenderer. More... | |
toggle ($field, $label="", $ragged=false) | |
Utility function to create a ToggleFieldRenderer. More... | |
group ($name) | |
Define a field grouping. More... | |
addToGroup ($name) | |
Add more fields to the specified group. More... | |
groupDescription ($name, $description, $position='start') | |
Add a description block to a group. More... | |
getGroupDescription ($name, $position='start') | |
Retrieves the group description for the specified group. More... | |
makeGroupCollapsible ($name, $toggleControl) | |
Allows a group to be shown or hidden based on the value of another control. More... | |
setGroupCSSClass ($name, $cssClass) | |
Sets a specific CSS class on the specified CSS group. More... | |
getGroupCSSClass ($name) | |
Gets the CSS class for the specified group, if one has been set. More... | |
removeGroup ($name) | |
Remove the specified field grouping from the form. More... | |
hideLabel () | |
Use this method to hide the labels for the specified fields in the form. More... | |
readonly () | |
Call this method to make one or more fields read-only in the form's user interface. More... | |
isReadOnly ($field) | |
Determine whether the specified field is being displayed read-only. More... | |
required () | |
Call this method to mark one or more fields as being required fields. More... | |
hasAdditional ($field) | |
Check if this field exists as an additional field. More... | |
isRequired ($field) | |
Determine whether the specified field is a required field for the form. More... | |
requiredIfChecked ($field, $checkbox, $fieldTitle="", $checkboxTitle="", $message="") | |
Make a field required if a given checkbox is checked. More... | |
requiredSubSelect ($field, $fieldTitle, $subFieldTitle="", $message="") | |
Make a subselect field required. More... | |
regexp ($field, $expr, $message) | |
Validate the user input for the specified field against a regular expression, outputting the supplied message if the entered value does not match. More... | |
dateRange ($field, $min="", $max="", $message=null) | |
unique () | |
Adds a uniqueness validator to the specified field(s). More... | |
uniqueWithConstraint ($field, $message, $constraint="") | |
range ($field, $min, $max, $message=null) | |
Adds a range validator to the specified field. More... | |
match ($field, $title, $match, $matchTitle, $caseSensitive=true) | |
Specifies that two field values must match (as in a password/confirmation pair, for instance). More... | |
password ($field, $title) | |
Adds a password validator to the specified field. More... | |
disableAutoComplete () | |
Disable autocomplete for the selected fields. More... | |
button ($text, $url, $confirm=null, $isScript=false, $cssClass=null) | |
Adds a custom button to the form. More... | |
ajaxSubmit ($success, $failure=null) | |
Put the form into AJAX submission mode. More... | |
partialSaveButton ($containerID, $label="Save") | |
Activate partial saves for this form. More... | |
matchesSubmitted () | |
Determine if this form is the one that was submitted. More... | |
drawForm () | |
Renders the form to HTML. More... | |
drawSubmitButtons ($obj, $pk, $submitLabel) | |
renderAllFields ($obj) | |
renderFields ($obj) | |
renderOneField ($field, $renderScript=false) | |
renderAdditionalFields ($obj) | |
drawButtons () | |
Draws any additional buttons specified in the calling script. More... | |
drawReadOnly () | |
Draws the form in read-only mode. More... | |
prettifyFieldName ($field) | |
Generates a human-readable label from the given field name. More... | |
load ($id) | |
Loads the underlying DataItem from the database, using the specified primary key value. More... | |
save () | |
Saves the posted values to the database. More... | |
handlePartialSave ($success) | |
preProcessFields ($pk, $filter) | |
postProcessFields ($pk, $filter) | |
remove (&$obj) | |
validate () | |
Validate the posted values for the form. More... | |
patchUpReferences () | |
Static Public Member Functions | |
static | registerFieldRendererClass ($type, $rendererClass) |
Registers a custom type-to-renderer mapping. More... | |
Public Attributes | |
$formCSS = "" | |
CSS Class to use for the table containing the form. More... | |
$labelCSS = "" | |
CSS Class to use for label cells. More... | |
$valueCSS = "" | |
CSS Class to use for field/value cells. More... | |
$buttonCSS = "" | |
CSS Class to use for buttons. More... | |
$buttonLineCSS = "submit" | |
CSS Class to use for the button line (container for form buttons) More... | |
$inputCSS = "" | |
CSS Class to use for input fields. More... | |
$checkboxCSS = "" | |
CSS Class to use for checkbox fields. More... | |
$style = "" | |
$componentPath ="/fakoli" | |
$buttonAlignment = "left" | |
Default Form button alignment. More... | |
$passwordEncryptor = "" | |
Password Encryption method name. More... | |
$hideButtons = false | |
Set to true to hide form submission button line(s) More... | |
$capitalizationMode = "word" | |
Capitalization to be used for labels. Can be 'lower', 'upper', 'first' or 'word'. More... | |
$submitLabel = "" | |
Text to display on the form's submit button. If not specified defaut text will be generated based on the target DataItem. More... | |
$allowDelete = false | |
If true, the form will display a delete button if editing an existing item. More... | |
$deleteLabel = "" | |
Text to display on the form's delete button. If not specified defaut text will be generated based on the target DataItem. More... | |
$deleteMessage = "" | |
Confirmation message to display when the form's delete button is pressed. If not specified defaut text will be generated based on the target DataItem. More... | |
$method = "POST" | |
HTTP method that will be used to submit the form. More... | |
$action = "" | |
Action URL for submitting the form. Generally this can be left blank to submit back to the same page. More... | |
$renderers = array() | |
The field renderers collection. More... | |
$overrides = array() | |
The field overrides collection. More... | |
$hidden = array() | |
The hidden fields collection. More... | |
$additional = array() | |
The additional (pseudo) fields collection. More... | |
$additional_at_top = false | |
whether additional fields are rendered above the datamodel's field list; if false, then rendered below More... | |
$readonly = array() | |
The read-only fields collection. More... | |
$annotations = array() | |
The field annotations collection. More... | |
$buttons = array() | |
The custom buttons collection. More... | |
$fieldOrder = array() | |
The order in which to display ungrouped fields. More... | |
$validator | |
The ValidationEngine for this form. More... | |
$useLinkSubmit = false | |
Flag to indicate whether the submit button for the form should be rendered as a link (not common). More... | |
$HTMLEditorHideStyleBar = false | |
Flag to indicate that Rich Text Editors should be displayed with or without the style editing toolbar. More... | |
$HTMLEditorDefaultWidth = "540px" | |
Default width for Rich Text Editor controls. More... | |
$HTMLEditorDefaultHeight = "200px" | |
Default height for Rich Text Editor controls. More... | |
$passwordEnterLabel = "Enter" | |
Text for Password Enter label. More... | |
$passwordConfirmLabel = "Confirm" | |
Text for Password Confirm label. More... | |
$onDrawStart = null | |
Callback event handler that is fired just prior to drawing the form. More... | |
$onDrawComplete = null | |
Callback event handler that is fired just after the form been drawn. More... | |
$onInsertPreProcess = null | |
Callback event handler that is fired after fields have been preprocessed, but before the data has been saved to the database as a new record. More... | |
$onSavePreProcess = null | |
Callback event handler that is fired after fields have been preprocessed, but before the data has been saved to the database. More... | |
$onSaveComplete = null | |
Callback event handler that is fired after the AutoForm has finished saving data to the database. More... | |
$confirmPrompt = null | |
Specify a confirmation message. This will be shown to the user to have them confirm the form submission after the submit button is pressed. More... | |
$onDelete = "" | |
delete method name More... | |
$customSaveHandler = null | |
Use this field to override the default save behavior of your form. More... | |
$markRequiredFields = false | |
Set to true to add an asterisk after required field labels. More... | |
$onFormatLabel = null | |
Label Processing hook. More... | |
$buttons_at_top = false | |
$ajaxSubmitHandler = false | |
JavaScript Callback for AJAX Submit mode - called on success. More... | |
$ajaxFailureHandler = false | |
JavaScript Callback for AJAX Submit mode - called on failure. More... | |
$onSubmitHandler = null | |
Javascript Callback for user-defined onsubmit hook. More... | |
$required = array() | |
List of required fields. More... | |
$requiredFieldsText = "* indicates required field" | |
Text prompt to display when a form contains required fields. More... | |
$interstitialMessage = null | |
Specifies the message to display in an interstitial while the form is being submitted. More... | |
$interstitialSpinner = '/fakoli/images/loader.gif' | |
Set this property to override the default interstitial spinner animation. More... | |
$fields | |
Local field cache. More... | |
$groups = array() | |
List of field groups. More... | |
$collapsibleGroups = array() | |
List of collapsible groups and their default states. More... | |
$groupDescriptions = array() | |
List of group descriptions. More... | |
$groupDescriptionCSS = "group_description" | |
CSS class for group description blocks. More... | |
$groupCSSClasses = array() | |
Additional classes for specific groups. More... | |
$readOnlyForm | |
Specifies whether the entire form is read-only. More... | |
$subordinate | |
Specifies whether this form is a subordinate member of a composite form. More... | |
$hideEmptyFields = false | |
Specifies whether to hide empty fields when displaying a read-only form. More... | |
$showAnnotations = true | |
Set to false to hide field annotations. More... | |
$layout | |
Layout handler object. More... | |
$default_layout = "table" | |
$allowPartialSave = false | |
Whether to allow partial (i.e. in-progress) saves via AJAX. More... | |
$partialSaveContainerID | |
DOM ID for the element that will contain the partial save button. More... | |
$partialSaveLabel = "Save" | |
Label text for the partial save button. More... | |
Static Public Attributes | |
static | $fieldRendererMap |
Provides the mapping from Type identifier to FieldRenderer. More... | |
AutoForm automatically creates a form based on an underlying DataItem.
Definition at line 45 of file auto_form.inc.
AutoForm::add | ( | $renderer, | |
$field = "" , |
|||
$label = "" |
|||
) |
Adds an additional (pseudo) field to the form.
This can be used to render additional fields in the user interface that are not directly tied to single fields in the underlying DataItem (for instance, to provide a checkbox list for many-to-one relationships, etc)
mixed | $renderer | either a mapped type (String, Number, etc), or a FieldRenderer-derived object to use for the additional field. |
string | $field | the name of the additional field |
string | $label | (optional) label for the additional field |
Definition at line 594 of file auto_form.inc.
AutoForm::addDefaultValidators | ( | ) |
Creates default validators for fields in the form.
Currently this adds Date format validators to all date fields - other fields are not affected.
This method is called automatically before the form is rendered.
Reimplemented in SearchForm.
Definition at line 311 of file auto_form.inc.
AutoForm::addToGroup | ( | $name | ) |
Add more fields to the specified group.
string | $name | the name of the group |
Definition at line 817 of file auto_form.inc.
AutoForm::ajaxSubmit | ( | $success, | |
$failure = null |
|||
) |
Put the form into AJAX submission mode.
You must supply a Javascript function to call once the submission is complete.
string | $success | the Javascript callback function for success |
string | $failure | the Javascript callback function for failure |
Definition at line 1157 of file auto_form.inc.
AutoForm::alias | ( | ) |
Use this method to override the display name for fields in the form.
For instance, calling alias('x1', 'Useful Label') would display the text 'Useful Label' as the label for field 'x1' when rendering the form. You can alias more than one field with a single call to alias, simply by passing in more than one pairs of strings. For instance, you might call: alias('x1', 'Field 1', 'x2', 'Field 2', ...)
Definition at line 684 of file auto_form.inc.
AutoForm::annotate | ( | $field, | |
$text | |||
) |
Adds an annotation (such as brief explanatory text) to the specified field.
The annotation is displayed next to the field when the form is renderered.
string | $field | the name of the field to annotate |
string | $text | the annotation text |
Definition at line 670 of file auto_form.inc.
AutoForm::AutoForm | ( | $target, | |
$method = "POST" , |
|||
$action = "" , |
|||
$id = "" |
|||
) |
Creates a new AutoForm, based on the supplied target DataItem.
DataItem | $target | the DataItem object upon which the form will be based |
string | $method | the HTTP method to be used for submitting the form (default is POST) |
string | $action | the HTTP action URL to be used for submitting the form (default is to post back to the originating URL) |
string | $id | DOM element ID to use for the form when rendering to HTML. Useful for pages with more than one form. |
Definition at line 166 of file auto_form.inc.
AutoForm::button | ( | $text, | |
$url, | |||
$confirm = null , |
|||
$isScript = false , |
|||
$cssClass = null |
|||
) |
Adds a custom button to the form.
string | $text | the button label text |
string | $url | the URL to handle the button press |
string | $confirm | optional confirmation message |
boolean | $isScript | true if the url is javascript code to execute, false if it is a URL to redirect to |
string | $cssClass | optional CSS class(es) to apply to the button |
Definition at line 1146 of file auto_form.inc.
AutoForm::checklist | ( | $field, | |
$label, | |||
$options, | |||
$grouped = false |
|||
) |
Utility function to add a CheckListFieldRenderer.
string | $label | the label for the field |
array | $options | associative array of grouped options |
bool | $grouped | true if the options are grouped, false otherwise (default) |
Definition at line 779 of file auto_form.inc.
AutoForm::configureValidators | ( | ) |
Definition at line 353 of file auto_form.inc.
AutoForm::createRenderer | ( | $field | ) |
This factory method creates a FieldRender based on the type of the specified field.
string | $field | the field for which the FieldRenderer is to be created |
Definition at line 278 of file auto_form.inc.
AutoForm::crossReference | ( | $xrefClass, | |
$options, | |||
$format, | |||
$field, | |||
$label = null , |
|||
$xrefField = null |
|||
) |
Utility function to add a CrossReferenceSelectFieldRenderer.
string | $xrefClass | the name of the cross-reference DataItem class |
array | $options | array of possible target DataItems |
string | $format | the format specifier to use when outputting the optio0ns |
string | $field | field name for use during form submission (should not be an actual field name) |
string | $label | the label text to display |
string | $xrefField | the name of the field mapping the primary key of the target DataItems (only specify this if the field name is different from the primary key) |
Definition at line 728 of file auto_form.inc.
AutoForm::dateRange | ( | $field, | |
$min = "" , |
|||
$max = "" , |
|||
$message = null |
|||
) |
string | $field | |
string,Date,or | DateTime $min | |
string,Date | or DateTime $max | |
string | $message | Min can be either a static date min that the field's value must be set to or the name of a field whose value will be compared to the given field. |
E.g., start_date must be no earlier than today or start_date must be no earlier than end_date
Definition at line 1035 of file auto_form.inc.
AutoForm::disableAutoComplete | ( | ) |
Disable autocomplete for the selected fields.
If no fields are specified, autocomplete is disabled for all the fields in the form.
Definition at line 1110 of file auto_form.inc.
AutoForm::drawButtons | ( | ) |
Draws any additional buttons specified in the calling script.
Definition at line 1459 of file auto_form.inc.
AutoForm::drawForm | ( | ) |
Renders the form to HTML.
Reimplemented in SearchForm, FilterForm, and SubordinateAutoForm.
Definition at line 1196 of file auto_form.inc.
AutoForm::drawReadOnly | ( | ) |
Draws the form in read-only mode.
This is most often used to display the details for a DataItem on a preview or details screen.
Reimplemented in SearchForm, and SubordinateAutoForm.
Definition at line 1489 of file auto_form.inc.
AutoForm::drawSubmitButtons | ( | $obj, | |
$pk, | |||
$submitLabel | |||
) |
Definition at line 1306 of file auto_form.inc.
AutoForm::dropdown | ( | $field, | |
$label = "" , |
|||
$options = null , |
|||
$onchange = null , |
|||
$grouped = false |
|||
) |
Utility function to add a SelectFieldRenderer.
string | $field | the field name |
string | $label | the label for the field |
array | $options | associative array of grouped options |
string | $onchange | Javascript onchange handler function name (optional) |
bool | $grouped | true if the options are grouped, false otherwise (default) |
Definition at line 742 of file auto_form.inc.
AutoForm::getData | ( | ) |
Returns the target data item for the form.
Reimplemented in SubordinateAutoForm.
Definition at line 241 of file auto_form.inc.
AutoForm::getGroupCSSClass | ( | $name | ) |
Gets the CSS class for the specified group, if one has been set.
string | $name | the name of the group |
Definition at line 879 of file auto_form.inc.
AutoForm::getGroupDescription | ( | $name, | |
$position = 'start' |
|||
) |
Retrieves the group description for the specified group.
string | $name | the name of the group |
$position | whether the description should appear at the 'start' or 'end' of the group |
Definition at line 847 of file auto_form.inc.
AutoForm::getRenderer | ( | $field | ) |
Retrieves the FieldRenderer object for the specified field.
You can use this to access the underlying field renderer for a given field and change the way it is rendered or processed.
string | $field | the name of the field for which to retrieve the FieldRenderer |
Definition at line 512 of file auto_form.inc.
AutoForm::getValidationEngine | ( | ) |
Retrieve the validation engine for this AutoForm.
Reimplemented in SubordinateAutoForm.
Definition at line 340 of file auto_form.inc.
AutoForm::group | ( | $name | ) |
Define a field grouping.
string | $name | the legend to use for the group |
Definition at line 801 of file auto_form.inc.
AutoForm::groupDescription | ( | $name, | |
$description, | |||
$position = 'start' |
|||
) |
Add a description block to a group.
This will be displayed within the group, after then title (if displayed) but before any fields.
string | $name | the name of the group |
string | $description | the description to display for that group |
string | $position | whether the description should appear at the 'start' or 'end' of the group |
Definition at line 837 of file auto_form.inc.
AutoForm::groupedDropdown | ( | $field, | |
$label, | |||
$options, | |||
$onchange = null |
|||
) |
Utility function to add a SelectFieldRenderer with grouped options.
string | $field | the field name |
string | $label | the label for the field |
array | $options | associative array of grouped options |
string | $onchange | Javascript onchange handler function name (optional) |
Definition at line 755 of file auto_form.inc.
AutoForm::handlePartialSave | ( | $success | ) |
Definition at line 1655 of file auto_form.inc.
AutoForm::hasAdditional | ( | $field | ) |
AutoForm::hide | ( | ) |
Call this method to hide one or more fields in the form's user interface.
For instance, calling hide("field1", "field3") would remove field1 and field3 from display when the form is rendered. Note that the values for these fields are still carried around with the form and saved to the database when the AutoForm saves the target DataItem. To prevent a field on the DataItem from being processed by the AutoForm at all, you should use an InclusionFilter or ExclusionFilter on the target DataItem.
Definition at line 624 of file auto_form.inc.
AutoForm::hideExcept | ( | ) |
Call this method to hide all the fields in the form's user interface EXCEPT the fields specified.
For instance, calling hide("field1", "field3") would remove all the fields other than field1 and field3 when the form is rendered.
Note that the values for the hidden fields are still carried around with the form and saved to the database when the AutoForm saves the target DataItem. To prevent a field on the DataItem from being processed by the AutoForm at all, you should use an InclusionFilter or ExclusionFilter on the target DataItem.
Definition at line 641 of file auto_form.inc.
AutoForm::hideLabel | ( | ) |
Use this method to hide the labels for the specified fields in the form.
Definition at line 897 of file auto_form.inc.
AutoForm::isHidden | ( | $field | ) |
Check whether the specified field is hidden in the form.
string | $field | the name of the field |
Definition at line 658 of file auto_form.inc.
AutoForm::isReadOnly | ( | $field | ) |
Determine whether the specified field is being displayed read-only.
string | $field | the name of the field |
Definition at line 923 of file auto_form.inc.
AutoForm::isRequired | ( | $field | ) |
Determine whether the specified field is a required field for the form.
$field | the field to check |
Definition at line 966 of file auto_form.inc.
AutoForm::load | ( | $id | ) |
Loads the underlying DataItem from the database, using the specified primary key value.
integer | $id | the value to use for the primary key |
Definition at line 1556 of file auto_form.inc.
AutoForm::makeGroupCollapsible | ( | $name, | |
$toggleControl | |||
) |
Allows a group to be shown or hidden based on the value of another control.
string | $name | the name of the group |
string | $toggleControl | the field name of the toggling control |
Definition at line 859 of file auto_form.inc.
AutoForm::makeSubordinate | ( | ) |
Set this AutoForm to be a subordinate form within a CompositeAutoForm.
Reimplemented in SubordinateAutoForm.
Definition at line 348 of file auto_form.inc.
AutoForm::match | ( | $field, | |
$title, | |||
$match, | |||
$matchTitle, | |||
$caseSensitive = true |
|||
) |
Specifies that two field values must match (as in a password/confirmation pair, for instance).
string | $field | The name of the first field that must match |
string | $title | |
string | $match | The name of the second field that must match |
string | $matchTitle | |
string | $caseSensitive | specifies whether the match is case sensitive |
Definition at line 1090 of file auto_form.inc.
AutoForm::matchesSubmitted | ( | ) |
Determine if this form is the one that was submitted.
Useful for managing pages with multiple forms.
Definition at line 1187 of file auto_form.inc.
AutoForm::override | ( | $field, | |
$label = "" , |
|||
$renderer = null |
|||
) |
Overrides the defaults for the specifed form field, providing a new label and/or FieldRenderer.
string | $field | the name of the field that is to be overridden |
string | $label | the new text to use for the label for the specified field (null or "" to use the default label). |
FieldRenderer | $renderer | the FieldRenderer-derived object to use in place of the default renderer for the specified field. |
Definition at line 549 of file auto_form.inc.
AutoForm::overrideType | ( | $field, | |
$type, | |||
$label = "" |
|||
) |
Override the default type for the specified form field, providing a FieldRenderer based on the supplied type (and optionally also override the field label)
string | $field | the name of the field that is to be overridden |
string | $type | the field type to use as the override |
string | $label | the new text to use for the label for the specified field (null or "" to use the default label). |
Definition at line 569 of file auto_form.inc.
AutoForm::partialSaveButton | ( | $containerID, | |
$label = "Save" |
|||
) |
Activate partial saves for this form.
A control will be added to the page that will allow users to save their progress without fully submitting the form. This is useful for long forms that required large amounts of text entry.
string | $containerID | DOM ID of the element that will contain the partial save button |
string | $label | Text to display on the partial save button |
Definition at line 1176 of file auto_form.inc.
AutoForm::password | ( | $field, | |
$title | |||
) |
Adds a password validator to the specified field.
string | $field | The name of the field. |
string | The title of the field |
Definition at line 1101 of file auto_form.inc.
AutoForm::patchUpReferences | ( | ) |
Attempt to patch up references in the data model to cope with PHP 4's insane object reference semantics. PHP 4 is now no longer actively supported by this framework, so this method is deprecated.
Definition at line 1760 of file auto_form.inc.
AutoForm::postProcessFields | ( | $pk, | |
$filter | |||
) |
Definition at line 1705 of file auto_form.inc.
AutoForm::preProcessFields | ( | $pk, | |
$filter | |||
) |
Definition at line 1681 of file auto_form.inc.
AutoForm::prettifyFieldName | ( | $field | ) |
Generates a human-readable label from the given field name.
If an explicit alias has been specified using the alias() method, then that is returned. If not, a simple set of text replacements is performed.
string | $field | the field to prettify |
Definition at line 1512 of file auto_form.inc.
AutoForm::radio | ( | $field, | |
$label, | |||
$options, | |||
$onchange = null |
|||
) |
Utility function to add a RadioButtonFieldRenderer.
string | $field | the field name |
string | $label | the label for the field |
array | $options | associative array of grouped options |
string | $onchange | Javascript onchange handler function name (optional) |
Definition at line 768 of file auto_form.inc.
AutoForm::range | ( | $field, | |
$min, | |||
$max, | |||
$message = null |
|||
) |
Adds a range validator to the specified field.
Definition at line 1073 of file auto_form.inc.
AutoForm::readonly | ( | ) |
Call this method to make one or more fields read-only in the form's user interface.
For instance, calling readonly("field1", "field3") would cause field1 and field3 to be rendered read-only.
Definition at line 910 of file auto_form.inc.
AutoForm::regexp | ( | $field, | |
$expr, | |||
$message | |||
) |
Validate the user input for the specified field against a regular expression, outputting the supplied message if the entered value does not match.
This can be used to provide general format-based validation for fields.
string | $field | the field to be validated |
string | $expr | the Regular Expression against which to validate |
string | $message | the message to display if the match fails. |
Definition at line 1014 of file auto_form.inc.
|
static |
Registers a custom type-to-renderer mapping.
string | $type | the type identifier |
string | $rendererClass | the class name of the renderer to handle fields of this type |
Definition at line 299 of file auto_form.inc.
AutoForm::related | ( | $class, | |
$constraint = "" , |
|||
$format = null , |
|||
$field = null , |
|||
$label = null , |
|||
$allowAdd = false , |
|||
$allowNone = true |
|||
) |
Utility function to add a RelatedItemSelectFieldRender.
Definition at line 697 of file auto_form.inc.
AutoForm::remove | ( | & | $obj | ) |
Definition at line 1729 of file auto_form.inc.
AutoForm::removeGroup | ( | $name | ) |
Remove the specified field grouping from the form.
Any fields within the group will be displayed ungrouped if they are not hidden.
string | $name | the legend of the group |
Definition at line 889 of file auto_form.inc.
AutoForm::renderAdditionalFields | ( | $obj | ) |
AutoForm::renderAllFields | ( | $obj | ) |
Definition at line 1330 of file auto_form.inc.
AutoForm::renderFields | ( | $obj | ) |
Definition at line 1346 of file auto_form.inc.
AutoForm::renderOneField | ( | $field, | |
$renderScript = false |
|||
) |
Definition at line 1401 of file auto_form.inc.
AutoForm::required | ( | ) |
Call this method to mark one or more fields as being required fields.
These fields will be assigned validators to ensure that the user enters a value for each required field. For instance, calling required("field1", "field3") would cause field1 and field3 to be required fields.
Definition at line 933 of file auto_form.inc.
AutoForm::requiredIfChecked | ( | $field, | |
$checkbox, | |||
$fieldTitle = "" , |
|||
$checkboxTitle = "" , |
|||
$message = "" |
|||
) |
Make a field required if a given checkbox is checked.
string | $field | the field to be validated |
string | $checkbox | the checkbox controlling whether the field is required |
string | $message | the message to display if validation fails. |
Definition at line 977 of file auto_form.inc.
AutoForm::requiredSubSelect | ( | $field, | |
$fieldTitle, | |||
$subFieldTitle = "" , |
|||
$message = "" |
|||
) |
Make a subselect field required.
The main option must always be selected. If there is a sub-select option, that must also be selected.
string | $field | the field to be validated |
string | $fieldTitle | custom human-readable name for the field |
string | $subFieldTitle | custom human-readable name for the sub-field |
string | $message | the message to display if validation fails. |
Definition at line 995 of file auto_form.inc.
AutoForm::save | ( | ) |
Saves the posted values to the database.
Reimplemented in SubordinateAutoForm.
Definition at line 1566 of file auto_form.inc.
AutoForm::setDataSet | ( | $params | ) |
Reimplemented in SubordinateAutoForm.
Definition at line 246 of file auto_form.inc.
AutoForm::setFieldOrder | ( | ) |
Override the display order for ungrouped field.
Definition at line 263 of file auto_form.inc.
AutoForm::setGroupCSSClass | ( | $name, | |
$cssClass | |||
) |
Sets a specific CSS class on the specified CSS group.
string | $name | the name of the group |
string | $cssClass | the CSS class to apply to the group |
Definition at line 869 of file auto_form.inc.
AutoForm::setLayout | ( | $layout | ) |
AutoForm::toggle | ( | $field, | |
$label = "" , |
|||
$ragged = false |
|||
) |
Utility function to create a ToggleFieldRenderer.
string | $field | the field name |
string | $label | the label for the field |
Definition at line 789 of file auto_form.inc.
AutoForm::unique | ( | ) |
Adds a uniqueness validator to the specified field(s).
This is a server-side only validator that checks that the supplied value for the field is not present for any row in the underlying database table.
Definition at line 1048 of file auto_form.inc.
AutoForm::uniqueWithConstraint | ( | $field, | |
$message, | |||
$constraint = "" |
|||
) |
Definition at line 1062 of file auto_form.inc.
AutoForm::validate | ( | ) |
Validate the posted values for the form.
This is performed automatically when calling AutoForm::save(), but sometimes it might be necessary to validate the form values manually (for instance, you might need to perform some destructive database operations prior to calling AutoForm::save(), but only if you know the form to be valid).
Any validation errors encountered are stored in the form, and will be displayed when the form is subsequently rendered.
Definition at line 1746 of file auto_form.inc.
AutoForm::writeScript | ( | ) |
This method writes any Javascript code that will be required for the generated form to operate, including code for Rich Text Editors, Date Pickers and field validation.
Reimplemented in SearchForm, FilterForm, and SubordinateAutoForm.
Definition at line 374 of file auto_form.inc.
AutoForm::$action = "" |
Action URL for submitting the form. Generally this can be left blank to submit back to the same page.
Definition at line 68 of file auto_form.inc.
AutoForm::$additional = array() |
The additional (pseudo) fields collection.
Definition at line 73 of file auto_form.inc.
AutoForm::$additional_at_top = false |
whether additional fields are rendered above the datamodel's field list; if false, then rendered below
Definition at line 74 of file auto_form.inc.
AutoForm::$ajaxFailureHandler = false |
JavaScript Callback for AJAX Submit mode - called on failure.
Definition at line 104 of file auto_form.inc.
AutoForm::$ajaxSubmitHandler = false |
JavaScript Callback for AJAX Submit mode - called on success.
Definition at line 103 of file auto_form.inc.
AutoForm::$allowDelete = false |
If true, the form will display a delete button if editing an existing item.
Definition at line 63 of file auto_form.inc.
AutoForm::$allowPartialSave = false |
Whether to allow partial (i.e. in-progress) saves via AJAX.
Definition at line 128 of file auto_form.inc.
AutoForm::$annotations = array() |
The field annotations collection.
Definition at line 76 of file auto_form.inc.
AutoForm::$buttonAlignment = "left" |
Default Form button alignment.
Definition at line 56 of file auto_form.inc.
AutoForm::$buttonCSS = "" |
CSS Class to use for buttons.
Definition at line 50 of file auto_form.inc.
AutoForm::$buttonLineCSS = "submit" |
CSS Class to use for the button line (container for form buttons)
Definition at line 51 of file auto_form.inc.
AutoForm::$buttons = array() |
The custom buttons collection.
Definition at line 77 of file auto_form.inc.
AutoForm::$buttons_at_top = false |
Definition at line 102 of file auto_form.inc.
AutoForm::$capitalizationMode = "word" |
Capitalization to be used for labels. Can be 'lower', 'upper', 'first' or 'word'.
Definition at line 60 of file auto_form.inc.
AutoForm::$checkboxCSS = "" |
CSS Class to use for checkbox fields.
Definition at line 53 of file auto_form.inc.
AutoForm::$collapsibleGroups = array() |
List of collapsible groups and their default states.
Definition at line 114 of file auto_form.inc.
AutoForm::$componentPath ="/fakoli" |
Definition at line 55 of file auto_form.inc.
AutoForm::$confirmPrompt = null |
Specify a confirmation message. This will be shown to the user to have them confirm the form submission after the submit button is pressed.
Definition at line 97 of file auto_form.inc.
AutoForm::$customSaveHandler = null |
Use this field to override the default save behavior of your form.
Definition at line 99 of file auto_form.inc.
AutoForm::$default_layout = "table" |
Definition at line 126 of file auto_form.inc.
AutoForm::$deleteLabel = "" |
Text to display on the form's delete button. If not specified defaut text will be generated based on the target DataItem.
Definition at line 64 of file auto_form.inc.
AutoForm::$deleteMessage = "" |
Confirmation message to display when the form's delete button is pressed. If not specified defaut text will be generated based on the target DataItem.
Definition at line 65 of file auto_form.inc.
AutoForm::$fieldOrder = array() |
The order in which to display ungrouped fields.
Definition at line 78 of file auto_form.inc.
|
static |
Provides the mapping from Type identifier to FieldRenderer.
Definition at line 134 of file auto_form.inc.
AutoForm::$fields |
Local field cache.
Definition at line 111 of file auto_form.inc.
AutoForm::$formCSS = "" |
CSS Class to use for the table containing the form.
Definition at line 47 of file auto_form.inc.
AutoForm::$groupCSSClasses = array() |
Additional classes for specific groups.
Definition at line 118 of file auto_form.inc.
AutoForm::$groupDescriptionCSS = "group_description" |
CSS class for group description blocks.
Definition at line 117 of file auto_form.inc.
AutoForm::$groupDescriptions = array() |
List of group descriptions.
Definition at line 115 of file auto_form.inc.
AutoForm::$groups = array() |
List of field groups.
Definition at line 113 of file auto_form.inc.
AutoForm::$hidden = array() |
The hidden fields collection.
Definition at line 72 of file auto_form.inc.
AutoForm::$hideButtons = false |
Set to true to hide form submission button line(s)
Definition at line 59 of file auto_form.inc.
AutoForm::$hideEmptyFields = false |
Specifies whether to hide empty fields when displaying a read-only form.
Definition at line 122 of file auto_form.inc.
AutoForm::$HTMLEditorDefaultHeight = "200px" |
Default height for Rich Text Editor controls.
Definition at line 85 of file auto_form.inc.
AutoForm::$HTMLEditorDefaultWidth = "540px" |
Default width for Rich Text Editor controls.
Definition at line 84 of file auto_form.inc.
AutoForm::$HTMLEditorHideStyleBar = false |
Flag to indicate that Rich Text Editors should be displayed with or without the style editing toolbar.
Definition at line 83 of file auto_form.inc.
AutoForm::$inputCSS = "" |
CSS Class to use for input fields.
Definition at line 52 of file auto_form.inc.
AutoForm::$interstitialMessage = null |
Specifies the message to display in an interstitial while the form is being submitted.
Definition at line 108 of file auto_form.inc.
AutoForm::$interstitialSpinner = '/fakoli/images/loader.gif' |
Set this property to override the default interstitial spinner animation.
Definition at line 109 of file auto_form.inc.
AutoForm::$labelCSS = "" |
CSS Class to use for label cells.
Definition at line 48 of file auto_form.inc.
AutoForm::$layout |
Layout handler object.
Definition at line 125 of file auto_form.inc.
AutoForm::$markRequiredFields = false |
Set to true to add an asterisk after required field labels.
Definition at line 100 of file auto_form.inc.
AutoForm::$method = "POST" |
HTTP method that will be used to submit the form.
Definition at line 67 of file auto_form.inc.
AutoForm::$onDelete = "" |
delete method name
Definition at line 98 of file auto_form.inc.
AutoForm::$onDrawComplete = null |
Callback event handler that is fired just after the form been drawn.
Definition at line 91 of file auto_form.inc.
AutoForm::$onDrawStart = null |
Callback event handler that is fired just prior to drawing the form.
Definition at line 90 of file auto_form.inc.
AutoForm::$onFormatLabel = null |
Label Processing hook.
Definition at line 101 of file auto_form.inc.
AutoForm::$onInsertPreProcess = null |
Callback event handler that is fired after fields have been preprocessed, but before the data has been saved to the database as a new record.
Definition at line 93 of file auto_form.inc.
AutoForm::$onSaveComplete = null |
Callback event handler that is fired after the AutoForm has finished saving data to the database.
Definition at line 95 of file auto_form.inc.
AutoForm::$onSavePreProcess = null |
Callback event handler that is fired after fields have been preprocessed, but before the data has been saved to the database.
Definition at line 94 of file auto_form.inc.
AutoForm::$onSubmitHandler = null |
Javascript Callback for user-defined onsubmit hook.
Definition at line 105 of file auto_form.inc.
AutoForm::$overrides = array() |
The field overrides collection.
Definition at line 71 of file auto_form.inc.
AutoForm::$partialSaveContainerID |
DOM ID for the element that will contain the partial save button.
Definition at line 129 of file auto_form.inc.
AutoForm::$partialSaveLabel = "Save" |
Label text for the partial save button.
Definition at line 130 of file auto_form.inc.
AutoForm::$passwordConfirmLabel = "Confirm" |
Text for Password Confirm label.
Definition at line 88 of file auto_form.inc.
AutoForm::$passwordEncryptor = "" |
Password Encryption method name.
Definition at line 57 of file auto_form.inc.
AutoForm::$passwordEnterLabel = "Enter" |
Text for Password Enter label.
Definition at line 87 of file auto_form.inc.
AutoForm::$readonly = array() |
The read-only fields collection.
Definition at line 75 of file auto_form.inc.
AutoForm::$readOnlyForm |
Specifies whether the entire form is read-only.
Definition at line 120 of file auto_form.inc.
AutoForm::$renderers = array() |
The field renderers collection.
Definition at line 70 of file auto_form.inc.
AutoForm::$required = array() |
List of required fields.
Definition at line 106 of file auto_form.inc.
AutoForm::$requiredFieldsText = "* indicates required field" |
Text prompt to display when a form contains required fields.
Definition at line 107 of file auto_form.inc.
AutoForm::$showAnnotations = true |
Set to false to hide field annotations.
Definition at line 123 of file auto_form.inc.
AutoForm::$style = "" |
Definition at line 54 of file auto_form.inc.
AutoForm::$submitLabel = "" |
Text to display on the form's submit button. If not specified defaut text will be generated based on the target DataItem.
Definition at line 62 of file auto_form.inc.
AutoForm::$subordinate |
Specifies whether this form is a subordinate member of a composite form.
Definition at line 121 of file auto_form.inc.
AutoForm::$useLinkSubmit = false |
Flag to indicate whether the submit button for the form should be rendered as a link (not common).
Definition at line 81 of file auto_form.inc.
AutoForm::$validator |
The ValidationEngine for this form.
Definition at line 80 of file auto_form.inc.
AutoForm::$valueCSS = "" |
CSS Class to use for field/value cells.
Definition at line 49 of file auto_form.inc.