Class Wizard

Description

The Wizard class provides a system for posting, retrieving, and validating user input over a series of steps, as well as maintianing the submitted values over a series of steps, until the wizard is saved.

The wizard is designed to be called from within a single action. The values of its state allow its steps to work as "sub-actions".

The only method left to implement for classes that extend is getMarkup().

  • abstract:
  • author: Gabe Schine
  • version: $Id: Wizard.abstract.php,v 1.18 2007/09/19 14:04:50 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /polyphony/main/library/Wizard/Wizard.abstract.php (line 39)

SObject
   |
   --WizardComponent
      |
      --WizardComponentWithChildren
         |
         --Wizard
Direct descendents
Class Description
SimpleWizard The SimpleWizard is a WizardClass which contains children and a block of formatting text in which to include those children.
Variable Summary
mixed $_formName
mixed $_id
Method Summary
ref addEventListener (mixed $eventListener, string $eventType, ref 1)
string getIdString ()
ref getLayout ()
string getMarkup (string $fieldName)
string getValidationJavascript (string $elementID, ref $rule, string $errDivID, [optional $displayError = false])
ref getWizard ()
string getWizardFormName ()
void go ()
string parseText (string $text, ref $components, [optional $prepend = ''])
void setIdString (string $id)
void setParent (ref $parent)
void triggerEvent (string $eventType, ref $source, [optional $context = null])
void triggerLater (string $event, ref $source, [optional $context = null])
boolean update (string $fieldName)
Variables
array $_eventListeners = array() (line 331)
  • access: private
mixed $_eventsLater = array() (line 140)
mixed $_formName = 'wizard' (line 40)
mixed $_id = 'w' (line 41)

Inherited Variables

Inherited from WizardComponentWithChildren

WizardComponentWithChildren::$_children

Inherited from WizardComponent

WizardComponent::$_enabled
WizardComponent::$_enabledSticky
WizardComponent::$_parent
Methods
addEventListener (line 340)

Adds an EventListener to be triggered whenever an event is thrown.

  • return: object
  • access: public
ref addEventListener (mixed $eventListener, string $eventType, ref 1)
  • string $eventType: The string event type for which this EventListener is listening (example: "edu.middlebury.harmoni.action_executed")
  • ref 1: object $eventListener the EventListener object.
getIdString (line 104)

Returns the ID string.

  • access: public
string getIdString ()
getLayout (line 112)

Returns a layout of content for the current Wizard-state

  • return: object Layout
ref getLayout ()
getMarkup (line 165)

Returns a block of XHTML-valid code that contains markup for this specific component.

  • access: public
string getMarkup (string $fieldName)
  • string $fieldName: The field name to use when outputting form data or similar parameters/information.

Redefinition of:
WizardComponent::getMarkup()
Returns a block of XHTML-valid code that contains markup for this specific component.

Redefined in descendants as:
getValidationJavascript (line 312)

Returns a block of javascript that will add a validation command to the form when submitting.

  • static:
  • access: public
string getValidationJavascript (string $elementID, ref $rule, string $errDivID, [optional $displayError = false])
  • string $elementID: The ID of the form element.
  • string $errDivID: The ID of a div tag that will be displayed if the element doesn't validate.
  • ref $rule: object $rule A WECRule for error checking.
  • optional $displayError: boolean $displayError Defaults to FALSE, but allows you to display the error on pageload, if we need to notify the user immediately of an error.
getWizard (line 84)

Returns the top-level Wizard in which this component resides.

  • return: object
  • access: public
ref getWizard ()

Redefinition of:
WizardComponent::getWizard()
Returns the top-level Wizard in which this component resides.
getWizardFormName (line 136)

Returns the name (id) of the form in which the wizard is contained.

  • access: public
string getWizardFormName ()
go (line 48)

Tells this wizard to update itself and run any events that have happened.

  • access: public
void go ()
parseText (line 266)

Returns the parsed string from text including [[tags]].

The second parameter holds a hashtable of components to ask for content for each of the [[tags]].

  • static:
  • access: public
string parseText (string $text, ref $components, [optional $prepend = ''])
  • string $text
  • ref $components: array $components
  • optional $prepend: string $prepend Optionally prepends the string passed to the field names.
setIdString (line 95)

Sets this Wizard's ID string. It is optional but must be used to allow multiple Wizards to be displayed on one page to differentiate fields and save/cancel requests.

  • access: public
void setIdString (string $id)
  • string $id: must be alpha-numeric with _ or -.
setParent (line 127)

Sets this component's parent (probably a Wizard object) so that it can have access to its parent's information, if needed.

  • access: public
void setParent (ref $parent)
  • ref $parent: object

Redefinition of:
WizardComponent::setParent()
Sets this component's parent (some kind of WizardComponentWithChildren so that it can have access to its information, if needed.
triggerEvent (line 354)

Notifies all of the EventListeners that have been added that an event has occured.

  • access: public
void triggerEvent (string $eventType, ref $source, [optional $context = null])
  • string $eventType: The event type string.
  • ref $source: object $source The source object of this event.
  • optional $context: array $context An array of contextual parameters for the specific event. The content of the array will depend on the event.
triggerLater (line 149)

Triggers this event after the update has occured.

  • access: public
void triggerLater (string $event, ref $source, [optional $context = null])
  • string $event
  • ref $source: object $source
  • optional $context: array $context
update (line 61)

Tells the wizard component to update itself - this may include getting form post data or validation - whatever this particular component wants to do every pageload.

  • return: - TRUE if everything is OK
  • access: public
boolean update (string $fieldName)
  • string $fieldName: The field name to use when outputting form data or similar parameters/information.

Redefinition of:
WizardComponentWithChildren::update()
Tells the wizard component to update itself - this may include getting form post data or validation - whatever this particular component wants to do every pageload.

Inherited Methods

Inherited From WizardComponentWithChildren

WizardComponentWithChildren::addComponent()
WizardComponentWithChildren::getAllValues()
WizardComponentWithChildren::getChild()
WizardComponentWithChildren::getChildren()
WizardComponentWithChildren::removeChild()
WizardComponentWithChildren::setEnabled()
WizardComponentWithChildren::update()
WizardComponentWithChildren::validate()

Inherited From WizardComponent

WizardComponent::getAllValues()
WizardComponent::getMarkup()
WizardComponent::getWizard()
WizardComponent::isEnabled()
WizardComponent::setEnabled()
WizardComponent::setParent()
WizardComponent::update()
WizardComponent::validate()

Inherited From SObject

SObject::asA()
SObject::asString()
SObject::copy()
SObject::copySameFrom()
SObject::copyTwoLevel()
SObject::deepCopy()
SObject::isEqual()
SObject::isEqualTo()
SObject::isNotEqualTo()
SObject::isNotReferenceTo()
SObject::isReferenceTo()
SObject::newFrom()
SObject::postCopy()
SObject::printableString()
SObject::shallowCopy()
SObject::_deepCopyArray()

Documentation generated on Wed, 19 Sep 2007 10:28:02 -0400 by phpDocumentor 1.3.0RC3