Public Member Functions | Public Attributes

FormUI Class Reference

Inheritance diagram for FormUI:
Collaboration diagram for FormUI:

List of all members.

Public Member Functions

 __construct ($name, $formtype=null)
 salted_name ()
 get ($use_theme=null, $process_for_success=true)
 out ()
 output_controls ($forvalidation=false)
 pre_out_controls ()
 validate ()
 on_success ($callback)
 on_save ($callback)
 success ()
 save ()
 set_option ($option, $value)
 get_option ($option)
 media_panel ($path, $panel, $callback)
 bounce ()

Public Attributes

 $success = false
 $submitted = false
 $class = array( 'formui' )
 $id = null
 $formtype = ''
 $properties

Detailed Description

FormUI Class This will generate the <form> structure and call subsequent controls

For a list of options to customize its output or behavior see FormUI::set_option()

Definition at line 461 of file formui.php.


Constructor & Destructor Documentation

FormUI::__construct ( name,
formtype = null 
)

FormUI's constructor, called on instantiation.

Parameters:
string $name The name of the form, used to differentiate multiple forms.
string $formtype The type of the form, used to classify form types for plugin modification

Definition at line 494 of file formui.php.

Referenced by __construct().


Member Function Documentation

FormUI::get ( use_theme = null,
process_for_success = true 
)

Produce a form with the contained fields.

Parameters:
boolean $process_for_success Set to true to display the form as it would look if the submission succeeded, but do not execute success methods.
Returns:
string HTML form generated from all controls assigned to this form

Definition at line 521 of file formui.php.

Referenced by media_panel().

FormUI::get_option ( option  ) 

Get a form option

Parameters:
string $option The name of the option to get
Returns:
mixed The value of the named option if set, null if not set

Definition at line 746 of file formui.php.

FormUI::media_panel ( path,
panel,
callback 
)

Configure all the options necessary to make this form work inside a media bar panel

Parameters:
string $path Identifies the silo
string $panel The panel in the silo to submit to
string $callback Javascript function to call on form submission

Definition at line 757 of file formui.php.

FormUI::on_save ( callback  ) 

Set a function to call on form submission success

Parameters:
mixed $callback A callback function or a plugin filter name.

Definition at line 671 of file formui.php.

Referenced by save().

FormUI::on_success ( callback  ) 

Set a function to call on form submission success

Parameters:
mixed $callback A callback function or a plugin filter name.

Definition at line 658 of file formui.php.

FormUI::out (  ) 

Output a form with the contained fields. Calls $this->get() and echoes.

Definition at line 598 of file formui.php.

FormUI::output_controls ( forvalidation = false  ) 

Return the form control HTML.

Parameters:
boolean $forvalidation True if the controls should output additional information based on validation.
Returns:
string The output of controls' HTML.

Definition at line 610 of file formui.php.

Referenced by get().

FormUI::pre_out_controls (  ) 

Return pre-output control configuration scripts for any controls that require them.

Returns:
string The output of controls' pre-output HTML.

Definition at line 626 of file formui.php.

Referenced by get().

FormUI::salted_name (  ) 

Generate a unique MD5 hash based on the form's name or the control's name.

Returns:
string Unique string composed of 35 hexadecimal digits representing the victim.

Definition at line 510 of file formui.php.

Referenced by get().

FormUI::save (  ) 

Save all controls to their storage locations

Reimplemented from FormContainer.

Definition at line 706 of file formui.php.

Referenced by success().

FormUI::set_option ( option,
value 
)

Set a form option Defaults for options are stored in the $this->options array

Parameters:
string $option The name of the option to set
mixed $value The value of the option

Definition at line 735 of file formui.php.

FormUI::success (  ) 

Calls the success callback for the form, and optionally saves the form values to the options table.

Definition at line 680 of file formui.php.

Referenced by get().

FormUI::validate (  ) 

Process validation on all controls of this form.

Returns:
array An array of strings describing validation issues, or an empty array if no issues.

Reimplemented from FormContainer.

Definition at line 644 of file formui.php.

Referenced by get().


Member Data Documentation

FormUI::$properties
Initial value:
 array(
    'action' => '',
    'onsubmit' => '',
    'enctype' => 'application/x-www-form-urlencoded',
    'accept_charset' => 'UTF-8',
  )

Reimplemented from FormContainer.

Definition at line 481 of file formui.php.


The documentation for this class was generated from the following file: