tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Static_HTML_Form_Generator

Source Location: /form/static_html_form_generator.class.php

Class Static_HTML_Form_Generator

Class Overview

Generates HTML for "static" forms

Static forms are forms that once created remain the same in temrs of count of fields and their type. In contrary, dynamic form may can be manipulated at runtime and receive new fields (with usual add_field() method), or remove fields from it.

Located in /form/static_html_form_generator.class.php [line 40]

Tangra_Class
   |
   --Static_HTML_Form_Generator

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
array   $errs_tpl_map   Map for fields' errors templates
array   $fields_tpl_map   Map for fields templates
Form   $form   Form object
string   $language   Form language (in term of native language)
string   $tpl_path   Path to template dir

[ Top ]
Method Summary
Static_HTML_Form_Generator   __construct()   Constructor
void   add_tpl_map_entry()   Adds new map entry for templates
void   change_field_p_error_map_entry()   Changes map entry for field error template
void   change_tpl_map_entry()   Changes existying map entry for template
void   create_default_tpl_maps()   Creates default template maps for fields and fields potential errors
unknown   create_field_errors_tpl_map()   Creates default map for fields' potential errors
unknown   get_fields_tpl_map_entry_value()   Enter description here...
Form   get_form()   Returns Form object
string   get_language()   Returns form language
string   get_static_html()   Returns generated HTML code
unknown   get_tpl_path()   Returns template path
array   sort_fields()   Sorts fields array

[ Top ]
Properties
array   $errs_tpl_map = array() [line 75]

Map for fields' errors templates

API Tags:
Access:  private


[ Top ]
array   $fields_tpl_map = array() [line 68]

Map for fields templates

API Tags:
Access:  private


[ Top ]
Form   $form [line 47]

Form object

API Tags:
Internal:  
Access:  private


[ Top ]
string   $language [line 61]

Form language (in term of native language)

API Tags:
Access:  private


[ Top ]
string   $tpl_path [line 54]

Path to template dir

API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 85]

  Static_HTML_Form_Generator __construct( Form $form, string $tpl_path, string $language  )

Constructor

Parameters:
Form   $form: 
string   $tpl_path: 
string   $language: 


[ Top ]
add_tpl_map_entry  [line 247]

  void add_tpl_map_entry( unknown_type $field_name, unknown_type $tpl_path  )

Adds new map entry for templates

Parameters:
unknown_type   $field_name: 
unknown_type   $tpl_path: 

API Tags:
Internal:  
Access:  protected


[ Top ]
change_field_p_error_map_entry  [line 207]

  void change_field_p_error_map_entry( string $field_name, string $p_error_name, string $tpl_path  )

Changes map entry for field error template

Parameters:
string   $field_name:  Name of the field
string   $p_error_name:  Name of the error
string   $tpl_path:  Path to template file

API Tags:
Access:  public


[ Top ]
change_tpl_map_entry  [line 191]

  void change_tpl_map_entry( unknown_type $field_name, unknown_type $tpl_path  )

Changes existying map entry for template

Parameters:
unknown_type   $field_name: 
unknown_type   $tpl_path: 

API Tags:
Access:  public


[ Top ]
create_default_tpl_maps  [line 173]

  void create_default_tpl_maps( )

Creates default template maps for fields and fields potential errors


API Tags:
Access:  public


[ Top ]
create_field_errors_tpl_map  [line 291]

  unknown create_field_errors_tpl_map( $f  )

Creates default map for fields' potential errors

Parameters:
   $f: 

API Tags:
Internal:  
Access:  private


[ Top ]
get_fields_tpl_map_entry_value  [line 227]

  unknown get_fields_tpl_map_entry_value( unknown_type $field_name  )

Enter description here...

Parameters:
unknown_type   $field_name: 

API Tags:
Access:  public


[ Top ]
get_form  [line 107]

  Form get_form( )

Returns Form object


API Tags:
Access:  public


[ Top ]
get_language  [line 117]

  string get_language( )

Returns form language


API Tags:
Access:  public


[ Top ]
get_static_html  [line 127]

  string get_static_html( )

Returns generated HTML code


API Tags:
Access:  public


[ Top ]
get_tpl_path  [line 97]

  unknown get_tpl_path( )

Returns template path


API Tags:
Access:  public


[ Top ]
sort_fields  [line 267]

  array sort_fields( &$fields, array $fields  )

Sorts fields array

Purpose is to move all hidden fields at the end of the result array. That way hidden fields does not bother the sequence of odd/even rows when HTML is generated (e.g. if diferent styles are used for odd and even rows (and if template uses one row per field))

Parameters:
array   $fields: 
   &$fields: 

API Tags:
Internal:  
Access:  protected


[ Top ]