Class: I2CE Module Forms: Difference between revisions
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
*Signature: public function getField($template,$form_field,$node) | *Signature: public function getField($template,$form_field,$node) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
** [http://www.php.net/manual/en/language.types.string.php string ] $form_field <br/>The form name and field name separataed by a colon. Example $form_field = "salary:begin"; | ** [http://www.php.net/manual/en/language.types.string.php string ] $form_field <br/>The form name and field name separataed by a colon. Example $form_field = "salary:begin"; | ||
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $node <br/>Specfies the node at which the data is set. If $node is a DOMNode then it is the node. If null (default) then the data applies to the whole. Otherwise $node should specify the ID of some node in the DOM. | ** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $node <br/>Specfies the node at which the data is set. If $node is a DOMNode then it is the node. If null (default) then the data applies to the whole. Otherwise $node should specify the ID of some node in the DOM. | ||
Line 38: | Line 38: | ||
*Signature: protected function hasPermission_form($calling_args) | *Signature: protected function hasPermission_form($calling_args) | ||
*Parameters: | *Parameters: | ||
*$calling_args | **$calling_args | ||
===invisibleClass()=== | ===invisibleClass()=== | ||
*Signature: public function invisibleClass($class_name) | *Signature: public function invisibleClass($class_name) | ||
*Parameters: | *Parameters: | ||
*$class_name | **$class_name | ||
===isReview()=== | ===isReview()=== | ||
Get the review status | Get the review status | ||
*Signature: public function isReview($template) | *Signature: public function isReview($template) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
===processForms()=== | ===processForms()=== | ||
Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span. The first two are as follows <span type='form' name='form_name:form_field_name'></span> and <span type='form' name='form_name->method_name(args)'></span> In each case we find the form with form name 'form_name'. In the first case, we call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for <span type='form' name='form_field_name'></span> In this case is like the first case except that the form used is the default form for this page. | Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span. The first two are as follows <span type='form' name='form_name:form_field_name'></span> and <span type='form' name='form_name->method_name(args)'></span> In each case we find the form with form name 'form_name'. In the first case, we call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for <span type='form' name='form_field_name'></span> In this case is like the first case except that the form used is the default form for this page. | ||
*Signature: public function processForms($page) | *Signature: public function processForms($page) | ||
*Parameters: | *Parameters: | ||
*$page | **$page | ||
===setForm()=== | ===setForm()=== | ||
*Signature: public function setForm($template,$form,$node) | *Signature: public function setForm($template,$form,$node) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
*$form | **$form | ||
*$node | **$node | ||
***Default Value: null | ***Default Value: null | ||
===setFormPriority()=== | ===setFormPriority()=== | ||
*Signature: public function setFormPriority($page) | *Signature: public function setFormPriority($page) | ||
*Parameters: | *Parameters: | ||
*$page | **$page | ||
===setReview()=== | ===setReview()=== | ||
Set the isReview variable to true. | Set the isReview variable to true. | ||
*Signature: public function setReview($template) | *Signature: public function setReview($template) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
===setShowForm()=== | ===setShowForm()=== | ||
Set the showForm flag to true. | Set the showForm flag to true. | ||
*Signature: public function setShowForm($template) | *Signature: public function setShowForm($template) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
===showForm()=== | ===showForm()=== | ||
*Signature: public function showForm($template) | *Signature: public function showForm($template) | ||
*Parameters: | *Parameters: | ||
*$template | **$template | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===upgrade()=== | ===upgrade()=== | ||
Line 83: | Line 83: | ||
*Signature: public function upgrade($old_vers,$new_vers) | *Signature: public function upgrade($old_vers,$new_vers) | ||
*Parameters: | *Parameters: | ||
*$old_vers | **$old_vers | ||
*$new_vers | **$new_vers | ||
===validate_formfield()=== | ===validate_formfield()=== | ||
Hooked Function to check if a fieldObj is valid | Hooked Function to check if a fieldObj is valid |
Revision as of 12:08, 17 October 2009
This article desrcibes the class I2CE_Module_Forms.
- Extends the class: I2CE_Module.
- Location: Part of the module forms in the package I2CE
- Source: Defined in the file modules/Forms/lib/I2CE_Module_Forms.php
- Author: Luke Duncan <lduncan@intrahealth.org> carl leitner <litlfred@ibiblio.org>
- Since: v1.0.0
Variables
$isReview
A flag to determine if the page is a confirmation form. This will cause the form display to make all elements "hidden" and display the values as text for a confirmation view.
- Type: protected boolean $isReview
$showForm
A flag to determine if the page is a form and should display the form elements. If this is false then instead of adding in form elements for form fields the value will be displayed.
- Type: protected $showForm
Methods
__construct()
- Signature: public function __construct()
createDateIndexOnLastEntry()
Checks to make sure there is an index on the date column last_entry table named date. If it does not exist it adds it.
- Signature: protected function createDateIndexOnLastEntry()
getCLIHooks()
- Signature: static public function getCLIHooks()
getField()
returns the indicated field from the indicated form that is responsible for the data in this node.
- Signature: public function getField($template,$form_field,$node)
- Parameters:
- $template
- string $form_field
The form name and field name separataed by a colon. Example $form_field = "salary:begin"; - mixed $node
Specfies the node at which the data is set. If $node is a DOMNode then it is the node. If null (default) then the data applies to the whole. Otherwise $node should specify the ID of some node in the DOM.- Default Value: null
- Returns: I2CE_Field
getHooks()
- Signature: static public function getHooks()
getMethods()
- Signature: static public function getMethods()
hasPermission_form()
- Signature: protected function hasPermission_form($calling_args)
- Parameters:
- $calling_args
invisibleClass()
- Signature: public function invisibleClass($class_name)
- Parameters:
- $class_name
isReview()
Get the review status
- Signature: public function isReview($template)
- Parameters:
- $template
processForms()
Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span. The first two are as follows and method_name(args)'> In each case we find the form with form name 'form_name'. In the first case, we call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for In this case is like the first case except that the form used is the default form for this page.
- Signature: public function processForms($page)
- Parameters:
- $page
setForm()
- Signature: public function setForm($template,$form,$node)
- Parameters:
- $template
- $form
- $node
- Default Value: null
setFormPriority()
- Signature: public function setFormPriority($page)
- Parameters:
- $page
setReview()
Set the isReview variable to true.
- Signature: public function setReview($template)
- Parameters:
- $template
setShowForm()
Set the showForm flag to true.
- Signature: public function setShowForm($template)
- Parameters:
- $template
showForm()
- Signature: public function showForm($template)
- Parameters:
- $template
- Returns: boolean
upgrade()
Upgrade module method
- Signature: public function upgrade($old_vers,$new_vers)
- Parameters:
- $old_vers
- $new_vers
validate_formfield()
Hooked Function to check if a fieldObj is valid
- Signature: public function validate_formfield($fieldObj)
- Parameters:
- I2CE_FormField $fieldObj
Inherited Fuzzy Methods
launchBackgroundProcess()
This method is inherited from I2CE_Module->launchBackgroundProcess()
launchBackgroundPHPScript()
This method is inherited from I2CE_Module->launchBackgroundPHPScript()
launchBackgroundPage()
This method is inherited from I2CE_Module->launchBackgroundPage()
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()