Docs For Class SVGGraphForm

Links: Child Classes Variables Inherited Variables Inherited Methods Methods Variable Detail Method Detail

## Class SVGGraphForm

(line 37)

    FormContent
       |
       --SVGGraphForm

Located in File: Program_Root/examples/jilu2.php

This class is used to build and render the form.

It builds a form by creating FormElement objects which have automatic validation. It leaves the layout of the form up to the child class. It has a mechanism in place to automagically show a confirmation 'page' after the data has been submitted and validated. It also provides a hook for any 'back end' validation of data. Finally, it provides a function for handling the action of the form, which only gets call after ALL validation has passed.

Functions:

form_init_elements() - This function is used to build the FormElement objects that will be used by the form. This function is called EVERY time the FormContent class is instantiated. After you create the FormElement, you call the FormContent::add_element() method, to add the FormElement object to the form. You will then call the 2 methods FormContent::element_label() and FormContent::element_form() to get access to the FormElement's label and form field respectively.

form_init_data() - This is called only the first time the form is encountered. It Allows you to populate the FormElements with data from a DB for example. You would use FormContent::set_element_value() or FormContent::set_hidden_element_value() inside here.

form() - This is the method that gets called to build the layout for your form. Typically you use a table and add the label in the first <td> and the form field itself in the 2nd <td>. So there are 2 methods in the FormContent object that allow u to get access to the FormElements label, and form field. FormContent::element_label() and FormContent::element_form().

form_backend_validation() - This method enables you to do any "back end" validation of data. Such as, check for a duplicate in the DB on a create/new form. This is called after the FormElement's validation methods have passed.

form_action() - This method is called after ALL validation was successfull, including each FormElement object's validation methods, as well as the FormContent::form_backend_validation()

Class Variable Summary ^TOP

Inherited Class Variable Summary ^TOP
Inherited From Class FormContent
Variable | Default Value | Description
--- | --- | ---
FormContent::$_action_message | -> ""<- | The message that is set
FormContent::$_cancel_action | -> NULL<- | The action to take opon clicking
FormContent::$_default_label_css | -> "formlabel"<- | This holds the default css class for form field label text.
FormContent::$_elements | ->array()<- | This holds the array of
FormContent::$_error_label_css | -> "formlabelerror"<- | This is the css class used
FormContent::$_form_name | -><- | This holds the name of the form
FormContent::$_has_confirm | -> FALSE<- | flag to let the FormProcessor
FormContent::$_hidden_elements | ->array()<- | This holds the array of
FormContent::$_required_field_marker | -> "*"<- | marker for the required field
FormContent::$_required_field_text | -> " - required field"<- | Text to show denoted required fields for the form.
FormContent::$_width | -> "600"<- | Holds the width to be used for the

Method Summary ^TOP
`void form ( )`
`void form_action ( )`
`void form_init_elements ( )`

Inherited Method Summary ^TOP
Inherited From Class FormContent
Function | Description
--- | ---
FormContent::FormContent() |
FormContent::add_action() | This function adds a form submit button with the appropriate action.
FormContent::add_cancel() | build a cancel button with a url to go to
FormContent::add_element() | This method is used to add a form element
FormContent::add_error() | This method is used to create a new error element during the call to form_action(). This enables us to do error handling during a transaction into a DB.
FormContent::add_hidden_action() | This function adds a submit button that can have any label. It just makes the _form_action a hidden field.
FormContent::add_hidden_element() | This method is used to add a hidden form field
FormContent::add_image_action() | This function adds an action as an image to submit the form.
FormContent::build_confirm_table() | This method allows the child to ovveride the default confirm data. By default the form_confirm() will show ALL FormElements. This is prolly not good in case of a form where a password exists.
FormContent::element_form() | This method returns the actual form object that renders the form field.
FormContent::element_label() | This method returns the label object for a visible form element.
FormContent::form() | This method builds the html form.
FormContent::form_action() | This method handles the
FormContent::form_backend_validation() | This method is called after the FormElements
FormContent::form_confirm() | This function is used to show an intermediary confirmation page. Use this function to show a confirmation of the data that was submitted by the user.
FormContent::form_errors() | This function is used to render the error table for the form. The error data comes from the FormProcessor or the FormValidation.
FormContent::form_init_data() | This method is called by the
FormContent::form_init_elements() | This method is what is called to build the list of FormElements that will be used by this form.
FormContent::form_success() | This method is called when the form_action() was successfull, and the form wants to render some kind of message
FormContent::get_action() | Get the current status of the action.
FormContent::get_default_css() | This function returns the default css class used for NON error text.
FormContent::get_element() | This method returns the FormElement based on the label.
FormContent::get_element_value() | This method is used to get the value for a non hidden element
FormContent::get_hidden_element_value() | This method is used to get the value for a hidden element
FormContent::get_required_fields_text() | This returns the required field text
FormContent::has_confirm() | This gets the value of the confirmation flag.
FormContent::pre_confirm() | This method allows this class to do any data munging prior to the form_confirm method being called @ render time.
FormContent::set_action() | Save the action for the form
FormContent::set_action_message() | This sets the action message.
FormContent::set_cancel_action() | This method sets the javasript action
FormContent::set_confirm() | This sets the $this->_has_confirmation
FormContent::set_default_css() | This function is used to set the
FormContent::set_element_value() | This method is used to set the value for a non hidden element
FormContent::set_error_css() | This function is used to set the css class that is used on text when an error on that field is detected.
FormContent::set_form_name() | **************************
FormContent::set_form_width() | this method sets the form name
FormContent::set_hidden_element_value() | This method is used to set the value for a hidden element
FormContent::set_stripslashes() | This sets the stripslashes flag for this object.

Variable Detail ^TOP

Method Detail ^TOP

form (line 47)
Usage : void form( )
Overrides : FormContent::form() This method builds the html form.
Description :

Function Info:

form_action (line 65)
Usage : void form_action( )
Overrides : FormContent::form_action() This method handles the
Description :

Function Info:

form_init_elements (line 39)
Usage : void form_init_elements( )
Overrides : FormContent::form_init_elements() This method is what is called to build the list of FormElements that will be used by this form.
Description :

Function Info:

Documention generated on Tue, 4 Mar 2003 16:40:31 -0800 by phpDocumentor 1.2.0rc1