Class FormWizard

Description

This is the main engine for the processing

of Forms. It builds the form tag, and calls the appropriate FormContent methods to build the FormElement's and validation, as well as backend processing to do the action after the data has been validated.

Located in Program_Root/form/FormWizard.inc (line 26)

Container
   |
   --FormProcessor
      |
      --FormWizard
Direct descendents
Class Description
MyWizard This is the main engine for the processing
Variable Summary
mixed $_steps
mixed $_vars
Method Summary
void FormWizard ()
void add_step (string $title, string $desc, string $help, FormContent &$step)
void render (mixed $indent_level, mixed $output_debug)
string render_confirm (int $indent_level, int $output_debug)
void user_setup ()
string _build_js ()
Atag &_build_step_image (string $step_num, mixed $step_title)
void _build_toolbar ()
void _clean ()
void _current_step ()
void _init ()
void _init_session ()
boolean _is_step_visited (int $step_num)
void _process_form ()
void _session_test ()
void _set_current_step (int $step)
void _set_step ()
void _step_visited (int $step_num, [boolean $visited = TRUE])
void __hidden_fields ()
Variables
mixed $_steps = array() (line 33)

This holds the array of

step objects for the wizard

mixed $_vars = array("to_step" => 0,
"num_steps" => 0,
"on_confirm" => FALSE,
WIZARD_ID => NULL )
(line 40)

Holds a bunch of state

variables

Inherited Variables

Inherited from FormProcessor

FormProcessor::$_auto_show_errors
FormProcessor::$_confirmed
FormProcessor::$_confirmed_successfull
FormProcessor::$_FormValidation
FormProcessor::$_form_attributes
FormProcessor::$_form_content
FormProcessor::$_form_submit_action
FormProcessor::$_form_success_render
FormProcessor::$_has_errors

Inherited from Container

Container::$_flags
Methods
Constructor FormWizard (line 49)

The constructor

void FormWizard ()
add_step (line 269)

This adds a step to the wizard

void add_step (string $title, string $desc, string $help, FormContent &$step)
  • string $title:

    - the title for the step

  • string $desc:

    - the description for the step

  • string $help:

    - the help url for the step (if any)

  • FormContent &$step:

    - the form content object that is the step.

render (line 81)

This function renders the

FormWizard

void render (mixed $indent_level, mixed $output_debug)

Redefinition of:
FormProcessor::render()
This method is called to render the form's html
render_confirm (line 223)

This function renders the confirmation page. This page sits in between the front end form, and the action handler.

This only gets called after a form and its data has been successfully validated.

  • return:

    - the raw html

string render_confirm (int $indent_level, int $output_debug)
  • int $indent_level:

    - $indent_level

  • int $output_debug:

    - $output_debug


Redefinition of:
FormProcessor::render_confirm()
This function renders the confirmation page. This page sits in between the front end form, and the action handler.
user_setup (line 253)

A subclass can override this function to setup the class variables after the constructor. The constructor automatically calls this function.

void user_setup ()

Redefined in descendants as:
_build_js (line 362)

This builds the javascript needed for the navigation of the wizard

string _build_js ()
_build_step_image (line 474)

This function builds an image for a step #

  • return:

    object

Atag &_build_step_image (string $step_num, mixed $step_title)
  • string $step_num:

    - the step # to build

_build_toolbar (line 392)

This renders the toolbar/step table

for the navigation of the wizard

void _build_toolbar ()
_clean (line 577)

This function cleans up the saved Session state for the wizard. This gets called when we have completed the wizard w/o errors.

void _clean ()
_current_step (line 531)

This returns the current step id

from the session

void _current_step ()
_init (line 287)

This function initializes all of the fields we need to keep track of for the internal state of the wizard. It also walks each of the step FormContent objects and initializes them.

We save some of the state of the wizard in the session.

void _init ()
_init_session (line 512)

This method initializes the session

variable that we use

void _init_session ()
_is_step_visited (line 563)

This tests to see if the step has been visited or not.

  • return:

    - TRUE = visited

boolean _is_step_visited (int $step_num)
  • int $step_num:

    - the step to mark

_process_form (line 136)

This method does the logic of

doing the form processing

void _process_form ()

Redefinition of:
FormProcessor::_process_form()
This method does the logic of
_session_test (line 585)

This ensures that we have sessions started

void _session_test ()
_set_current_step (line 540)

This sets the current step id

void _set_current_step (int $step)
  • int $step:

    - the new step #

_set_step (line 323)

This function sets the _form_content object for the current step we are operating on.

The parent FormProcessor needs this object set in order to process the step correctly.

void _set_step ()
_step_visited (line 553)

This sets the state variable for the step to let us know it has been visited or not

void _step_visited (int $step_num, [boolean $visited = TRUE])
  • int $step_num:

    - the step to mark

  • boolean $visited:

    - TRUE = visited

__hidden_fields (line 327)
void __hidden_fields ()

Redefinition of:
FormProcessor::__hidden_fields()
This method adds the processor specific hidden fields.

Inherited Methods

Inherited From FormProcessor

FormProcessor::FormProcessor()
FormProcessor::can_validate()
FormProcessor::do_validation()
FormProcessor::get_action()
FormProcessor::get_auto_error_display()
FormProcessor::get_error_array()
FormProcessor::get_error_display_object()
FormProcessor::get_form_action()
FormProcessor::get_form_enctype()
FormProcessor::get_form_method()
FormProcessor::get_form_name()
FormProcessor::get_form_target()
FormProcessor::has_errors()
FormProcessor::is_action_successfull()
FormProcessor::render()
FormProcessor::render_confirm()
FormProcessor::render_error()
FormProcessor::render_form()
FormProcessor::setup_validation()
FormProcessor::set_auto_error_display()
FormProcessor::set_form_action()
FormProcessor::set_form_enctype()
FormProcessor::set_form_method()
FormProcessor::set_form_name()
FormProcessor::set_form_target()
FormProcessor::set_render_form_after_success()
FormProcessor::_add_confirm_data()
FormProcessor::_add_hidden_fields()
FormProcessor::_build_form_tag()
FormProcessor::_build_javascript()
FormProcessor::_pre_confirm()
FormProcessor::_process_action()
FormProcessor::_process_form()
FormProcessor::_set_action()
FormProcessor::_set_confirmed_success()
FormProcessor::__hidden_fields()

Inherited From Container

Container::Container()
Container::add()
Container::add_reference()
Container::count_content()
Container::get_indent_flag()
Container::push()
Container::push_reference()
Container::render()
Container::reset_content()
Container::set_collapse()
Container::set_indent_flag()
Container::_set_flags()

Documention generated on Thu, 31 Jul 2003 18:32:46 -0700 by phpDocumentor 1.2.0