Class FormContainer

Description

FormUI Library - Create interfaces for plugins

FormUI This is the main class, it generates the form itself; FormContainer A form-related class that can contain form elements, derived by FormUI and FormControlFieldset; FormValidators Catalog of validation functions, it can be extended if needed; FormControl Parent class to controls, it contains basic functionalities overrode in each control's class; FormControl* Every control needs a FormControl* class, FormUI literally looks for example, FormControlCheckbox.

  • version: $Id$

Located in /system/classes/formui.php (line 15)


	
			
Direct descendents
Class Description
FormUI FormUI Class This will generate the <form> structure and call subsequent controls
FormControlTag A control to display a single tag for output via FormUI
FormControlFieldset A fieldset control based on FormControl for output via a FormUI.
FormControlWrapper A div wrapper control based on FormContainer for output via FormUI
FormControlTabs A control to display a tab splitter based on FormControl for output via a FormUI.
Variable Summary
mixed $caption
mixed $checksum
mixed $class
mixed $controls
mixed $name
mixed $properties
mixed $template
mixed $theme_obj
Method Summary
FormControl append (string $name, string $type)
string checksum ()
string get ([boolean $forvalidation = true])
array get_controls ()
Theme get_theme ([boolean $forvalidation = false], [FormControl $control = null])
array get_values ()
boolean has_user_options ()
FormControl insert (string 0, string 1, string 2)
void move ( $source, FormControl $target, [ $offset = 0], FormControl $control, int $int)
void move_after (FormControl $control, FormControl $target)
void move_before (FormControl $control, FormControl $target)
string pre_out ()
void remove (FormControl $target)
void replace (FormControl $target, FormControl $control)
void save (string $key)
array validate ()
FormControl __get (string $name)
Variables
mixed $caption = '' (line 19)
  • access: public
mixed $checksum (line 22)
  • access: protected
mixed $class = '' (line 18)
  • access: public

Redefined in descendants as:
mixed $controls = array() (line 20)
  • access: public
mixed $name = '' (line 17)
  • access: public
mixed $properties = array() (line 24)
  • access: public

Redefined in descendants as:
mixed $template = 'formcontainer' (line 23)
  • access: public
mixed $theme_obj = null (line 21)
  • access: protected
Methods
append (line 38)

Append a control to the end of this container

  • return: An instance of the named FormControl descendant.
  • access: public
FormControl append (string $name, string $type)
  • string $name: The name of the control
  • string $type: A classname, or the postfix of a class starting 'FormControl' that will be used to create the control
checksum (line 91)

Generate a hash for this container

  • return: An md5 hash built using the controls contained within this container
  • access: public
string checksum ()
get (line 153)

Produce HTML output for all this fieldset and all contained controls

  • return: HTML that will render this control in the form
string get ([boolean $forvalidation = true])
  • boolean $forvalidation: True if this control should render error information based on validation.

Redefined in descendants as:
get_controls (line 133)

Returns an associative array of controls

  • return: An array of FormControls
  • access: public
array get_controls ()
get_theme (line 177)

Retreive the Theme used to display the form component

  • return: The theme object to display the template for the control
Theme get_theme ([boolean $forvalidation = false], [FormControl $control = null])
  • boolean $forvalidation: If true, perform validation on control and add error messages to output
  • FormControl $control: The control to output using a template
get_values (line 114)

Returns an associative array of the controls' values

  • return: Associative array where key is control's name and value is the control's value
  • access: public
array get_values ()
has_user_options (line 288)

Returns true if any of the controls this container contains should be stored in userinfo

  • return: True if control data should be sotred in userinfo
boolean has_user_options ()
insert (line 73)

Insert a control into the container

  • return: The new control instance
  • access: public
FormControl insert (string 0, string 1, string 2)
  • string 0: The name of the control to insert the new control in front of
  • string 1: The type of the new control
  • string 2: The name of the new control
move (line 217)

Moves a control to target's position to which we add $int if specified That integer is useful to move before or move after the target

void move ( $source, FormControl $target, [ $offset = 0], FormControl $control, int $int)
  • FormControl $control: FormControl object to move
  • FormControl $target: FormControl object acting as destination
  • int $int: Integer added to $target's position (index)
  • $source
  • $offset
move_after (line 255)

Moves a control after the target control

void move_after (FormControl $control, FormControl $target)
  • FormControl $control: FormControl object to move
  • FormControl $target: FormControl object acting as destination
move_before (line 244)

Moves a control before the target control

void move_before (FormControl $control, FormControl $target)
  • FormControl $control: FormControl object to move
  • FormControl $target: FormControl object acting as destination
pre_out (line 323)

Return the HTML/script required for all contained controls. Do it only once.

  • return: The HTML/javascript required for all contained controls.
string pre_out ()
remove (line 277)

Removes a target control from this group (can be the form or a fieldset)

void remove (FormControl $target)
replace (line 266)

Replaces a target control by the supplied control

void replace (FormControl $target, FormControl $control)
  • FormControl $target: FormControl object to replace
  • FormControl $control: FormControl object to replace $target with
save (line 353)

Store each contained control's value under the control's specified key.

void save (string $key)
  • string $key: (optional) The Options table key to store this option in

Redefined in descendants as:
validate (line 337)

Runs any attached validation functions to check validation of each control contained in this fieldset.

  • return: An array of string validation error descriptions or an empty array if no errors were found.
array validate ()

Redefined in descendants as:
__get (line 304)

Magic property getter, returns the specified control

  • return: The control object requested
FormControl __get (string $name)
  • string $name: The name of the control

Documentation generated on Thu, 30 Oct 2008 20:31:11 +0100 by phpDocumentor 1.3.2