HTML_QuickForm_Controller
[ class tree: HTML_QuickForm_Controller ] [ index: HTML_QuickForm_Controller ] [ all elements ]

Class: HTML_QuickForm_Page

Source Location: /main/inc/lib/pear/HTML/QuickForm/Page.php

Class Overview

HTML_Common
   |
   --HTML_QuickForm
      |
      --HTML_QuickForm_Page

The class represents a page of a multipage form.


Author(s):

Version:

  • $Revision: 6184 $

Variables

Methods


Child classes:

Page_Language
Page in the install wizard to select the language which will be used during the installation process.
Page_Requirements
Class for requirements page
Page_LocationOldVersion
Page in the install wizard to select the location of the old Dokeos installation.
Page_License
Class for license page Displays the GNU GPL license that has to be accepted to install Dokeos.
Page_DatabaseSettings
Class for database settings page Displays a form where the user can enter the installation settings regarding the databases - login and password, names, prefixes, single or multiple databases, tracking or not...
Page_ConfigSettings
Page in the install wizard in which some config settings are asked to the user.
Page_ConfirmSettings
Page in the install wizard in which a final overview of all settings is displayed.

Inherited Variables

Inherited Methods

Class: HTML_QuickForm

HTML_QuickForm::HTML_QuickForm()
Class constructor
HTML_QuickForm::accept()
Accepts a renderer
HTML_QuickForm::addElement()
Adds an element into the form
HTML_QuickForm::addFormRule()
Adds a global validation rule
HTML_QuickForm::addGroup()
Adds an element group
HTML_QuickForm::addGroupRule()
Adds a validation rule for the given group of elements
HTML_QuickForm::addRule()
Adds a validation rule for the given field
HTML_QuickForm::apiVersion()
Returns the current API version
HTML_QuickForm::applyFilter()
Applies a data filter for the given field(s)
HTML_QuickForm::arrayMerge()
Merges two arrays
HTML_QuickForm::createElement()
Creates a new form element of the given type.
HTML_QuickForm::defaultRenderer()
Returns a reference to default renderer object
HTML_QuickForm::elementExists()
Returns true if element is in the form
HTML_QuickForm::errorMessage()
Return a textual error message for an QuickForm error code
HTML_QuickForm::exportValue()
Returns a 'safe' element's value
HTML_QuickForm::exportValues()
Returns 'safe' elements' values
HTML_QuickForm::freeze()
Displays elements without HTML input tags
HTML_QuickForm::getElement()
Returns a reference to the element
HTML_QuickForm::getElementError()
Returns error corresponding to validated element
HTML_QuickForm::getElementType()
Returns the type of the given element
HTML_QuickForm::getElementValue()
Returns the element's raw value
HTML_QuickForm::getMaxFileSize()
Returns the value of MAX_FILE_SIZE hidden element
HTML_QuickForm::getRegisteredRules()
Returns an array of registered validation rules
HTML_QuickForm::getRegisteredTypes()
Returns an array of registered element types
HTML_QuickForm::getRequiredNote()
Returns the required note
HTML_QuickForm::getSubmitValue()
Returns the elements value after submit and filter
HTML_QuickForm::getSubmitValues()
Returns the values submitted by the form
HTML_QuickForm::getValidationScript()
Returns the client side validation script
HTML_QuickForm::insertElementBefore()
Inserts a new element right before the other element
HTML_QuickForm::isElementFrozen()
Returns whether or not the form element is frozen
HTML_QuickForm::isElementRequired()
Returns whether or not the form element is required
HTML_QuickForm::isError()
Tell whether a result from a QuickForm method is an error (an instance of HTML_QuickForm_Error)
HTML_QuickForm::isFrozen()
Returns whether or not the whole form is frozen
HTML_QuickForm::isRuleRegistered()
Returns whether or not the given rule is supported
HTML_QuickForm::isSubmitted()
Tells whether the form was already submitted
HTML_QuickForm::isTypeRegistered()
Returns whether or not the form element type is supported
HTML_QuickForm::process()
Performs the form data processing
HTML_QuickForm::registerElementType()
Registers a new element type
HTML_QuickForm::registerRule()
Registers a new validation rule
HTML_QuickForm::removeElement()
Removes an element
HTML_QuickForm::setConstants()
Initializes constant form values.
HTML_QuickForm::setDatasource()
Sets a datasource object for this form object
HTML_QuickForm::setDefaults()
Initializes default form values
HTML_QuickForm::setElementError()
Set error message for a form element
HTML_QuickForm::setJsWarnings()
Sets JavaScript warning messages
HTML_QuickForm::setMaxFileSize()
Sets the value of MAX_FILE_SIZE hidden element
HTML_QuickForm::setRequiredNote()
Sets required-note
HTML_QuickForm::toArray()
Returns the form's contents in an array.
HTML_QuickForm::toHtml()
Returns an HTML version of the form
HTML_QuickForm::updateElementAttr()
Updates Attributes for one or more elements
HTML_QuickForm::validate()
Performs the server side validation
HTML_QuickForm::_loadElement()
Returns a form element of the given type
HTML_QuickForm::_recursiveFilter()
Recursively apply a filter function
HTML_QuickForm::_reindexFiles()
A helper function to change the indexes in $_FILES array

Class: HTML_Common

HTML_Common::HTML_Common()
Class constructor
HTML_Common::apiVersion()
Returns the current API version
HTML_Common::display()
Displays the HTML to the screen
HTML_Common::getAttribute()
Returns the value of the given attribute
HTML_Common::getAttributes()
Returns the assoc array (default) or string of attributes
HTML_Common::getComment()
Returns the HTML comment
HTML_Common::getTabOffset()
Returns the tabOffset
HTML_Common::removeAttribute()
Removes an attribute
HTML_Common::setAttributes()
Sets the HTML attributes
HTML_Common::setComment()
Sets the HTML comment to be displayed at the beginning of the HTML string
HTML_Common::setLineEnd()
Sets the line end style to Windows, Mac, Unix or a custom string.
HTML_Common::setTab()
Sets the string used to indent HTML
HTML_Common::setTabOffset()
Sets the tab offset
HTML_Common::toHtml()
Abstract method. Must be extended to return the objects HTML
HTML_Common::updateAttributes()
Updates the passed attributes without changing the other existing attributes
HTML_Common::_getAttrKey()
Returns the array key for the given non-name-value pair attribute
HTML_Common::_getAttrString()
Returns an HTML formatted attribute string
HTML_Common::_getLineEnd()
Returns the lineEnd
HTML_Common::_getTab()
Returns a string containing the unit for indenting HTML
HTML_Common::_getTabs()
Returns a string containing the offset for the whole HTML code
HTML_Common::_parseAttributes()
Returns a valid atrributes array from either a string or array
HTML_Common::_removeAttr()
Removes the given attribute from the given array
HTML_Common::_updateAttrArray()
Updates the attributes in $attr1 with the values in $attr2 without changing the other existing attributes

Class Details

[line 35]
The class represents a page of a multipage form.

Generally you'll need to subclass this and define your buildForm() method that will build the form. While it is also possible to instantiate this class and build the form manually, this is not the recommended way.




Tags:

author:  Alexey Borzov <avb@php.net>
version:  $Revision: 6184 $


[ Top ]


Class Variables

$controller =  null

[line 48]

Contains a reference to a Controller object containing this page



Tags:

access:  public



[ Top ]

$_actions = array()

[line 41]

Contains the mapping of actions to corresponding HTML_QuickForm_Action objects


Type:   array


[ Top ]

$_formBuilt =  false

[line 54]

Should be set to true on first call to buildForm()


Type:   bool


[ Top ]



Class Methods


constructor HTML_QuickForm_Page [line 61]

HTML_QuickForm_Page HTML_QuickForm_Page( $formName, [ $method = 'post'], [ $target = '_self'], [ $attributes = null])

Class constructor



Tags:

access:  public


Parameters:

   $formName  
   $method  
   $target  
   $attributes  

[ Top ]

method addAction [line 74]

void addAction( string $actionName, object HTML_QuickForm_Action &$action)

Registers a handler for a specific action.



Tags:

access:  public


Parameters:

string   $actionName   name of the action
object HTML_QuickForm_Action   &$action   the handler for the action

[ Top ]

method buildForm [line 141]

void buildForm( )

Builds a form.

You should override this method when you subclass HTML_QuickForm_Page, it should contain all the necessary addElement(), applyFilter(), addRule() and possibly setDefaults() and setConstants() calls. The method will be called on demand, so please be sure to set $_formBuilt property to true to assure that the method works only once.




Tags:

abstract:  
access:  public


Overridden in child classes as:

Page_Language::buildForm()
Page_Requirements::buildForm()
Page_LocationOldVersion::buildForm()
Page_License::buildForm()
Page_DatabaseSettings::buildForm()
Page_ConfigSettings::buildForm()
Page_ConfirmSettings::buildForm()

[ Top ]

method getButtonName [line 106]

string getButtonName( string $actionName)

Returns a name for a submit button that will invoke a specific action.



Tags:

return:  "name" attribute for a submit button
access:  public


Parameters:

string   $actionName   Name of the action

[ Top ]

method handle [line 89]

void handle( string $actionName)

Handles an action.

If an Action object was not registered here, controller's handle() method will be called.




Tags:

access:  public


Parameters:

string   $actionName   Name of the action

[ Top ]

method isFormBuilt [line 153]

bool isFormBuilt( )

Checks whether the form was already built.



Tags:

access:  public


[ Top ]

method loadValues [line 120]

void loadValues( array $values)

Loads the submit values from the array.

The method is NOT intended for general usage.




Tags:

access:  public


Parameters:

array   $values   'submit' values

[ Top ]

method setDefaultAction [line 169]

void setDefaultAction( string $actionName)

Sets the default action invoked on page-form submit

This is necessary as the user may just press Enter instead of clicking one of the named submit buttons and then no action name will be passed to the script.




Tags:

access:  public


Parameters:

string   $actionName   default action name

[ Top ]


Documentation generated on Thu, 12 Jun 2008 14:09:49 -0500 by phpDocumentor 1.4.1