Class: I2CE FormBrowser: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 22: Line 22:
===__construct()===
===__construct()===
Th constructor
Th constructor
'FBPrefix' => The prefix of all id's related to the formBrowser.  If not set 'formBrowser' is used.
(This enables having ajax functionality for
multiple formBrowsers on the same page).
*Signature: public function __construct($page,$action,$options)
*Signature: public function __construct($page,$action,$options)
Parameters:
*Parameters:
* [[Class: I2CE_Page | I2CE_Page]] $page
** [[Class: I2CE_Page | I2CE_Page]] $page
* [http://www.php.net/manual/en/language.types.string.php string ] $action<br/>What action to perform for this form browser.  Valid options are 'showForm', 'editForm' and 'saveForm'
** [http://www.php.net/manual/en/language.types.string.php string ] $action <br/>What action to perform for this form browser.  Valid options are 'showForm', 'editForm' and 'saveForm'
**Default Value: 'showForm'
***Default Value: 'showForm'
* [http://www.php.net/manual/en/language.types.array.php array ] $options<br/>An associatve array.  The following keys are recognized:
** [http://www.php.net/manual/en/language.types.array.php array ] $options <br/>An associatve array.  The following keys are recognized: 'FBPrefix' => The prefix of all id's related to the formBrowser.  If not set 'formBrowser' is used. (This enables having ajax functionality for multiple formBrowsers on the same page).
===addChildForms()===
===addChildForms()===
Adds any child forms for this form.
Adds any child forms for this form.
*Signature: public function addChildForms($detailNode,$formConfig,$formObj)
*Signature: public function addChildForms($detailNode,$formConfig,$formObj)
*Returns: boolean.  Return false if none were added, true if child forms were added.
*Parameters:
Parameters:
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode <br/>The major node which contains the formBrowser we are creating
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode<br/>The major node which contains the formBrowser we are creating
** [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig <br/>/modules/forms/forms/$formName
* [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig<br/>/modules/forms/forms/$formName
** [[Class: I2CE_Form | I2CE_Form]] $formObj <br/>the form object for the form we are displaying ( or null.if we are not looking at a particular record)
* [[Class: I2CE_Form | I2CE_Form]] $formObj<br/>the form object for the form we are displaying ( or null.if we are not looking at a particular record)
*Returns: boolean.<br/>Return false if none were added, true if child forms were added.
===addEditLink()===
===addEditLink()===
Add the edit Link
Add the edit Link @param  I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName
@param  I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName
*Signature: protected function addEditLink($detailNode,$form,$id,$even)
*Signature: protected function addEditLink($detailNode,$form,$id,$even)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode<br/>The major node which contains the formBrowser we are creating
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode <br/>The major node which contains the formBrowser we are creating
*$form  
*$form  
*$id  
*$id  
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even<br/>If true,  makes this have class 'even'
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even <br/>If true,  makes this have class 'even'
===addParentLink()===
===addParentLink()===
Add the select records.
Add the select records.
*Signature: protected function addParentLink($detailNode,$formConfig,$formObj,$even)
*Signature: protected function addParentLink($detailNode,$formConfig,$formObj,$even)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode<br/>The major node which contains the formBrowser we are creating
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode <br/>The major node which contains the formBrowser we are creating
* [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig<br/>/modules/forms/forms/$formName
** [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig <br/>/modules/forms/forms/$formName
* [[Class: I2CE_Form | I2CE_Form]] $formObj<br/>the form object for the form we are displaying ( or null.if we are not looking at a particular record)
** [[Class: I2CE_Form | I2CE_Form]] $formObj <br/>the form object for the form we are displaying ( or null.if we are not looking at a particular record)
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even<br/>If true,  makes this have class 'even'
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even <br/>If true,  makes this have class 'even'
===addRecordSelect()===
===addRecordSelect()===
Add the select records.
Add the select records.
*Signature: protected function addRecordSelect($formConfig,$detailNode,$id)
*Signature: protected function addRecordSelect($formConfig,$detailNode,$id)
Parameters:
*Parameters:
* [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig<br/>/modules/forms/forms/$formName
** [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $formConfig <br/>/modules/forms/forms/$formName
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode<br/>The major node which contains the formBrowser we are creating
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode <br/>The major node which contains the formBrowser we are creating
*$id  
*$id  
===addSaveLink()===
===addSaveLink()===
Add the save Link
Add the save Link @param  I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName
@param  I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName
*Signature: protected function addSaveLink($detailNode,$form,$id,$even)
*Signature: protected function addSaveLink($detailNode,$form,$id,$even)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode<br/>The major node which contains the formBrowser we are creating
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $detailNode <br/>The major node which contains the formBrowser we are creating
*$form  
*$form  
*$id  
*$id  
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even<br/>If true,  makes this have class 'even'
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even <br/>If true,  makes this have class 'even'
===getFormBrowser()===
===getFormBrowser()===
Create a form browser node and append it to the specifed node
Create a form browser node and append it to the specifed node @param mixed $appendNode.  Either a DOMNode or a string which is the id of a node.  We will append the formBrowser to this node.
display generic information about the structure of the form.
@param mixed $appendNode.  Either a DOMNode or a string which is the id of a node.  We will append the
formBrowser to this node.
*Signature: public function getFormBrowser($form,$id)
*Signature: public function getFormBrowser($form,$id)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.types.string.php string ] $form
** [http://www.php.net/manual/en/language.types.string.php string ] $form
* integer $id<br/>The record id of the form we wish to browser or an integer < 1 if we wish to
** integer $id <br/>The record id of the form we wish to browser or an integer < 1 if we wish to display generic information about the structure of the form.
===getLinkChains()===
===getLinkChains()===
*Signature: protected function getLinkChains($fields,$formClassBase)
*Signature: protected function getLinkChains($fields,$formClassBase)
Parameters:
*Parameters:
*$fields  
*$fields  
*$formClassBase  
*$formClassBase  
===showFieldDetails()===
===showFieldDetails()===
Shows details the underlying database information and class information of a  form field.
Shows details the underlying database information and class information of a  form field. Intend to be called when there is no form instance we are going to set (i.e. no id for a record is expected to be give)
Intend to be called when there is no form instance we are going to set (i.e. no id for a record is
expected to be give)
where $fieldName is the name of the field we are adding
*Signature: protected function showFieldDetails($detailNode,$form,$fieldConfig,$even)
*Signature: protected function showFieldDetails($detailNode,$form,$fieldConfig,$even)
Parameters:
*Parameters:
*$detailNode  
*$detailNode  
* [http://www.php.net/manual/en/language.types.string.php string ] $form
** [http://www.php.net/manual/en/language.types.string.php string ] $form
* [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $fieldConfig<br/>The magic data node /modules/forms/formClasses/$form/fields/$fieldName
** [[Class: I2CE_MagicDataNode | I2CE_MagicDataNode]] $fieldConfig <br/>The magic data node /modules/forms/formClasses/$form/fields/$fieldName where $fieldName is the name of the field we are adding
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even<br/>(Defaults to false). If true, will add the class 'even' to the created form field nodes.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $even <br/>(Defaults to false). If true, will add the class 'even' to the created form field nodes.
**Default Value: 'I2CE_FormField'
***Default Value: 'I2CE_FormField'
===showFieldDetailsForRecord()===
===showFieldDetailsForRecord()===
*Signature: protected function showFieldDetailsForRecord($detailNode,$formObj,$field,$edit,$even,$chain)
*Signature: protected function showFieldDetailsForRecord($detailNode,$formObj,$field,$edit,$even,$chain)
Parameters:
*Parameters:
*$detailNode  
*$detailNode  
*$formObj  
*$formObj  
Line 106: Line 95:
*$edit  
*$edit  
*$even  
*$even  
**Default Value: false
***Default Value: false
*$chain  
*$chain  
**Default Value: false  
***Default Value: false  
==Inherited Fuzzy Methods==
==Inherited Fuzzy Methods==
===userMessage()===
===userMessage()===

Revision as of 23:41, 16 October 2009

This article desrcibes the class I2CE_FormBrowser.

I2CE_FormBrowser

Variables

$page

.

$template

  • Type: protected $template

$formBrowserPrefix

  • Type: protected $formBrowserPrefix

$action

  • Type: protected $action

Methods

__construct()

Th constructor

  • Signature: public function __construct($page,$action,$options)
  • Parameters:
    • I2CE_Page $page
    • string $action
      What action to perform for this form browser. Valid options are 'showForm', 'editForm' and 'saveForm'
      • Default Value: 'showForm'
    • array $options
      An associatve array. The following keys are recognized: 'FBPrefix' => The prefix of all id's related to the formBrowser. If not set 'formBrowser' is used. (This enables having ajax functionality for multiple formBrowsers on the same page).

addChildForms()

Adds any child forms for this form.

  • Signature: public function addChildForms($detailNode,$formConfig,$formObj)
  • Parameters:
    • DOMNode $detailNode
      The major node which contains the formBrowser we are creating
    • I2CE_MagicDataNode $formConfig
      /modules/forms/forms/$formName
    • I2CE_Form $formObj
      the form object for the form we are displaying ( or null.if we are not looking at a particular record)
  • Returns: boolean.
    Return false if none were added, true if child forms were added.

addEditLink()

Add the edit Link @param I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName

  • Signature: protected function addEditLink($detailNode,$form,$id,$even)
  • Parameters:
    • DOMNode $detailNode
      The major node which contains the formBrowser we are creating
  • $form
  • $id
    • boolean $even
      If true, makes this have class 'even'

addParentLink()

Add the select records.

  • Signature: protected function addParentLink($detailNode,$formConfig,$formObj,$even)
  • Parameters:
    • DOMNode $detailNode
      The major node which contains the formBrowser we are creating
    • I2CE_MagicDataNode $formConfig
      /modules/forms/forms/$formName
    • I2CE_Form $formObj
      the form object for the form we are displaying ( or null.if we are not looking at a particular record)
    • boolean $even
      If true, makes this have class 'even'

addRecordSelect()

Add the select records.

  • Signature: protected function addRecordSelect($formConfig,$detailNode,$id)
  • Parameters:
    • I2CE_MagicDataNode $formConfig
      /modules/forms/forms/$formName
    • DOMNode $detailNode
      The major node which contains the formBrowser we are creating
  • $id

addSaveLink()

Add the save Link @param I2CE_MagicDataNode $formConfig /modules/forms/forms/$formName

  • Signature: protected function addSaveLink($detailNode,$form,$id,$even)
  • Parameters:
    • DOMNode $detailNode
      The major node which contains the formBrowser we are creating
  • $form
  • $id
    • boolean $even
      If true, makes this have class 'even'

getFormBrowser()

Create a form browser node and append it to the specifed node @param mixed $appendNode. Either a DOMNode or a string which is the id of a node. We will append the formBrowser to this node.

  • Signature: public function getFormBrowser($form,$id)
  • Parameters:
    • string $form
    • integer $id
      The record id of the form we wish to browser or an integer < 1 if we wish to display generic information about the structure of the form.

getLinkChains()

  • Signature: protected function getLinkChains($fields,$formClassBase)
  • Parameters:
  • $fields
  • $formClassBase

showFieldDetails()

Shows details the underlying database information and class information of a form field. Intend to be called when there is no form instance we are going to set (i.e. no id for a record is expected to be give)

  • Signature: protected function showFieldDetails($detailNode,$form,$fieldConfig,$even)
  • Parameters:
  • $detailNode
    • string $form
    • I2CE_MagicDataNode $fieldConfig
      The magic data node /modules/forms/formClasses/$form/fields/$fieldName where $fieldName is the name of the field we are adding
    • boolean $even
      (Defaults to false). If true, will add the class 'even' to the created form field nodes.
      • Default Value: 'I2CE_FormField'

showFieldDetailsForRecord()

  • Signature: protected function showFieldDetailsForRecord($detailNode,$formObj,$field,$edit,$even,$chain)
  • Parameters:
  • $detailNode
  • $formObj
  • $field
  • $edit
  • $even
      • Default Value: false
  • $chain
      • Default Value: false

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()