Index
Form generator
Manages all the forms generated by the TIP system using the QuickForm PEAR package.
A reference to the master content instance
The file to run on form rendering
The type of action this form must perform
Local flag to enable JSON on this form instance
If left undefined, the global json flag (got from the TIP_Application instance) is used.
Action name
Action identifier to use in localizing the title.
For basic actions, such as 'add', 'delete' and 'edit', you can leave it null: the value will default to the content of the 'action' property.
An array of fields structures, as returned by TIP_Data::getFields()
Setting this property you can choose the fields to manipulate. Leave it null for full automatic fields management.
An array of field ids to keep frozen
Wheter to include a captcha element in the form
A sum of TIP_FORM_BUTTON_... constants: leave it null to use default buttons regardling the requested action
An associative array of explicit defaults provided by the application
To this array, that initially will contain the defaults explicitely set in the configuration options or directly by the module, will be merged (with higher precedence) the default values provided by GETs.
An associative array of implicit defaults provided by the application
This array provides the same information of the defaults property but using the implicit way. This means for immutable fields the form element will be preselected instead of be frozen.
Also the fallback values have lower precedence in the default assignment stack: if you provide both defaults and fallbacks, the latter value will not be used.
Validation type, as described in HTML_QuickForm
Validation callback
Function to call before processing the data. It takes one argument: the associative array of values to validate. This callback must return true to process the record, or false to skip the processing.
This callback can be useful to provide additional validations (other than the ones provided by HTML_QuickForm) that need complex tasks.
Process callback
Function to call to process the data. This callback should take two arguments:
(usually the $this->_defaults array) or null
By default this callback is null. If the form needs to process the form and "on_process" is still undefined, an error is raised.
The return value must be %true on success or %false on error. Accordling to the return value, a notification message (error or info) will be generated.
The render mode for not-validated form
The render mode for validated form
The URI to follow on cancel
Leaves it null to use the default referer. If the action is processed, all occurrences of {field} (where field is any valid field id) are expanded to their own value. If the action fails but this URI requires an expanded field, the default referer is used.
The URI to chain up at the end of the action
Leaves it null to use the default referer. If the action is processed, all occurrences of {field} (where field is any valid field id) are expanded to their own value. If the action fails but the URI requires an expanded field, the default referer is used.
Whether to notify if an action exited succesfully
Default cols value for textarea items
Default rows value for textarea items
Constructor
Initializes a TIP_Form instance.
Run the form
Executes the requested action, accordling to the properties values set in the constructor.
Define and validate the form
Append a module structure to the current form and validate
Process the form
Also resets the session stage counter on POST driven form to avoid multiple calls.
Render the form
Start a form view
The available form views are: * 'SECTION' to browse throught the form sections
End the current view
Return the value of a generic item
Gets the value of a generic item. This implementation adds form specific features to the TIP_Module::getItem() method, such as the ability to get information from the current element or from the current section.
Call an element method
Runs the method specified in $params on the current element.