Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

FormUI Class Reference

Inheritance diagram for FormUI:
Collaboration diagram for FormUI:

List of all members.

Public Member Functions

 __construct ($name, $formtype=null, $extra_data=array())
 dupe (Theme $theme=null)
 get (Theme $theme=null)
 out ()
 post_redirect ($url=null)
 media_panel ($path, $panel, $callback)
 bounce ($keep_hash=true)
 content_type ()
 __toString ()
 has_session_data ()
 set_from_error_values ()
 get_id_component ()

Static Public Member Functions

static register ($name, $build_callback)
static build ($name, $formtype=null, $extra_data=array())

Public Attributes

 $success = false
 $submitted = false
 $formtype = ''
 $properties
 $success_render = false
 $dom

Static Public Attributes

static $registered_forms = array()

Detailed 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. 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 26 of file formui.php.


Constructor & Destructor Documentation

FormUI::__construct ( name,
formtype = null,
extra_data = array() 
)

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
array $extra_data An array of extra data that can be passed into the form

Definition at line 55 of file formui.php.


Member Function Documentation

FormUI::__toString (  ) 

Convert this object instance to a string

Returns:
string The form as HTML

Definition at line 351 of file formui.php.

FormUI::bounce ( keep_hash = true  ) 

Redirect the user back to the stored URL value in session

Definition at line 328 of file formui.php.

static FormUI::build ( name,
formtype = null,
extra_data = array() 
) [static]

Create a new instance of this class and return it, use the fluent interface

Parameters:
string $name The name of the form to build
string $formtype The type of the form
array $extra_data Extra data to pass to the form for configuration purposes
Returns:
FormUI The instance of the created form

Definition at line 91 of file formui.php.

Referenced by AdminGroupsHandler::get_groups(), AdminUsersHandler::get_user(), AdminUsersHandler::get_users(), AdminGroupsHandler::post_groups(), and AdminUsersHandler::post_users().

FormUI::content_type (  ) 

Implementation of IsContent

Returns:
array An array of content types that this object represents, starting with the most specific

Implements IsContent.

Definition at line 342 of file formui.php.

FormUI::dupe ( Theme theme = null  ) 

Produce a form "duplicate" that does not process the form, display output, or include one-time-javascripts

Parameters:
Theme $theme The theme to render the controls into
Returns:
string HTML form generated from all controls assigned to this form

Definition at line 104 of file formui.php.

FormUI::get ( Theme theme = null  ) 

Produce a form with the contained fields.

Parameters:
Theme $theme The theme to render the controls into
Returns:
string HTML form generated from all controls assigned to this form

Definition at line 128 of file formui.php.

Referenced by media_panel().

FormUI::get_id_component (  ) 

Get a string that will be used to generate a component of a control's HTML id

Returns:
string

Definition at line 432 of file formui.php.

FormUI::has_session_data (  ) 

Get whether there is session data stored for this form

Returns:
bool True if this form has session data set

Definition at line 409 of file formui.php.

Referenced by get(), and set_from_error_values().

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 317 of file formui.php.

FormUI::out (  ) 

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

Definition at line 229 of file formui.php.

FormUI::post_redirect ( url = null  ) 

Process a form, then redirect, saving control values on errors for redisplay

Parameters:
string $url The URL to redirect to, presumably with the original form on it
Returns:
string The form output, if needed

Definition at line 240 of file formui.php.

static FormUI::register ( name,
build_callback 
) [static]

Register a function to use to create a new form

Parameters:
string $name The name of the form to register
Callable $build_callback The method to call to customize a form instance (FormUI $form, string $name, string $form_type)

Definition at line 79 of file formui.php.

Referenced by AdminUsersHandler::__construct(), and AdminGroupsHandler::__construct().

FormUI::set_from_error_values (  ) 

Set the values of the form controls from their session error values, if stored

Definition at line 417 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',
    'method' => 'POST',
  )

Definition at line 34 of file formui.php.


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