b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.10) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Form

Source Location: /blogs/inc/_misc/_form.class.php

Class Form

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Widget

Widget::$global_icons
Widget::$title

Inherited From Widget

Widget::gen_global_icons()
Generate img tags for registered icons, through global_icon().
Widget::global_icon()
Registers a global action icon
Widget::replace_callback()
Callback function used to replace only necessary values in template.
Widget::replace_callback_wrapper()
This is an additional wrapper to replace_vars() that allows to react on the return value of it.
Widget::replace_vars()
Replaces $vars$ with appropriate values.

[ Top ]
Property Summary
array   $append_javascript   Additional Javascript to append to the form, in Form::end_form().
mixed   $check_all   Do we need to add javascript for check/uncheck all functionality
boolean   $disp_param_err_messages_with_fields   Display param errors with fields, appended to the note?
string   $hiddens   This is a buffer for hidden fields. We'll display all of them just before the end of form </form>. This avoids having them caught in between table rows.
string   $label_suffix   Suffix for LABELs. Only gets used, if $label_to_the_left is true.
boolean   $label_to_the_left   Display order of <label> and <input>.
string   $note_format   This is the default note format, where handle_common_params() falls back to, when not given with $field_params.
boolean   $output  
array   $_common_params   Common params shared between methods.
array   $_opentags   Remember number of open tags that need to be handled in end_form().

[ Top ]
Method Summary
static string   get_valid_id()   Convert a given string (e.g. fieldname) to a valid HTML id.
Form   Form()   Constructor
The   begin_field()   Start an input field.
true|string   begin_fieldset()   Builds a fieldset tag. This is a fieldset element by default, but a th element for table layout.
mixed   begin_form()   Builds the form field
mixed   button()   Builds a button
mixed   buttons()   Builds a button list.
mixed   buttons_input()   Builds a button list.
mixed   button_input()   Builds a button.
mixed   checkbox()   Builds a checkbox field
mixed   checkbox_input()   Builds a checkbox field
mixed   checklist()   Builds a checkbox list
void   check_all()   Return links to check and uncheck all check boxes of the form
mixed   combo_box()   Combo box Display a select options list with an option 'new', and when this one is seleted, display a combo input text to add a new value
array   convert_button_to_field_params()   Convert a deprecated, numeric button array to a field_params array.
mixed   date()   Builds a date input field.
mixed   date_input()   Builds a date input field.
true|string   dayOfWeek()   Build a select to choose a weekday.
true|string   dayOfWeek_input()   Build a select to choose a weekday.
true|string   display_or_return()   Display or return, according to $output.
mixed   duration()   Builds a duration input field.
mixed   duration_input()   Builds a duration input field.
The   end_field()   End an input field.
true|string   end_fieldset()   Ends a fieldset.
true|string   end_form()   Ends the form, optionally displays buttons and closes all open fieldsets.
string   get_input_element()   Generate a general input element.
string   get_label()   Get the label of a field. This is used by begin_field() or end_field(), according to $label_to_the_left
void   handle_common_params()   Extract common params out of $field_params into $_common_params and unsets them in $field_params.
void   hidden()   Builds an hidden input tag, overwriting any previous hidden values (except for "foo[]").
mixed   hiddens()   Builds a list of hidden inputs.
void   hiddens_by_key()   Builds a list of hidden inputs from an array where the keys are the field names.
void   hidden_ctrl()   Add the "ctrl" param, used in the backoffice, as a hidden field.
mixed   info()   Builds an info field.
mixed   info_field()   Builds an info field.
true|string   input_field()   Generate a general input field.
mixed   password()   Builds a password input field.
mixed   password_input()   Builds a password input field.
mixed   radio()   Generate set of radio options.
mixed   radio_input()   Generate set of radio options.
mixed   select()   Display a select field and populate it with a callback function.
mixed   select_input()   Display a select field and populate it with a callback function.
mixed   select_input_array()   This is a stub for select_input_options() which builds the required list of <option> elements from a given list of options ($field_options) and the selected value ($field_value).
mixed   select_input_object()   Display a select field and populate it with a cache object by using a callback method.
mixed   select_input_options()   Display a select field and populate it with a cache object.
mixed   select_object()   Display a select field and populate it with a cache object.
mixed   select_options()   Display a select field and populate it with a cache object.
mixed   submit()   Builds a submit input tag
mixed   submit_input()   Builds a submit input tag
void   switch_layout()  
mixed   text()   Builds a text (or password) input field.
void   textarea()   Build a text area.
void   textarea_input()   Build a text area.
true|string   text_input()   Builds a text (or password) input field.
mixed   time()   Builds a time input field.
mixed   time_input()   Builds a time input field.
void   time_select()   Builds a time select input field

[ Top ]
Properties
array   $append_javascript = array() [line 127]

Additional Javascript to append to the form, in Form::end_form().

API Tags:
Access:  protected


[ Top ]
mixed   $check_all = false [line 119]

Do we need to add javascript for check/uncheck all functionality


[ Top ]
boolean   $disp_param_err_messages_with_fields = true [line 133]

Display param errors with fields, appended to the note?


[ Top ]
string   $hiddens = array() [line 114]

This is a buffer for hidden fields. We'll display all of them just before the end of form </form>. This avoids having them caught in between table rows.


[ Top ]
string   $label_suffix = ':' [line 78]

Suffix for LABELs. Only gets used, if $label_to_the_left is true.


[ Top ]
boolean   $label_to_the_left = true [line 84]

Display order of <label> and <input>.


[ Top ]
string   $note_format = ' <span class="notes">%s</span>' [line 107]

This is the default note format, where handle_common_params() falls back to, when not given with $field_params.

Information Tags:
Todo:  This might be used in switch_layout().

[ Top ]
boolean   $output = true [line 65]

[ Top ]
array   $_common_params = array() [line 99]

Common params shared between methods.

These can all be used with the $field_params argument of the functions.

  • 'note': The note associated with the field.
  • 'note_format': The format of the note. %s gets replaced by the note.
  • 'label': The label for the field.
  • 'required': is the element required to be filled/checked? This will add a visual hint (boolean; default: false)

API Tags:
See:  Form::handle_common_params()
Usedby:  Form::begin_field()


[ Top ]
array   $_opentags = array( 'fieldset' => 0 ) [line 72]

Remember number of open tags that need to be handled in end_form().


[ Top ]
Methods
static method get_valid_id  [line 2494]

  static string get_valid_id( $id  )

Convert a given string (e.g. fieldname) to a valid HTML id.

Parameters:
   $id: 


[ Top ]
Constructor Form  [line 145]

  Form Form( [string $form_action = NULL], [string $form_name = ''], [string $form_method = 'post'], [string $layout = NULL], [string $enctype = '']  )

Constructor

Parameters:
string   $form_action:  the action destination of the form (NULL for pagenow)
string   $form_name:  the name of the form (will be used as an ID)
string   $form_method:  the action to execute when the form is submitted
string   $layout:  the method used to send data
string   $enctype:  the form layout : 'fieldset', 'table' or '' (NULL means: if there is an $AdminUI object get it from there, otherwise use 'fieldset')


[ Top ]
begin_field  [line 292]

  The begin_field( [string $field_name = NULL], [string $field_label = NULL], [boolean $reset_common_params = false]  )

Start an input field.

A field is a fielset containing a label div and an input div.

Parameters:
string   $field_name:  The name of the field
string   $field_label:  The field label
boolean   $reset_common_params:  Reset $_common_params? This should be used if you build a field by yourself.

API Tags:
Return:  generated HTML
Uses:  Form::$_common_params


[ Top ]
begin_fieldset  [line 381]

  true|string begin_fieldset( [string $title = ''], [string $field_params = array()], [array $icons = array()]  )

Builds a fieldset tag. This is a fieldset element by default, but a th element for table layout.

Parameters:
string   $title:  the title of the fieldset
string   $field_params:  the field params to the fieldset additionally 'legend_params' can be used to give an array of field params
array   $icons:  the icons action of the fieldset

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
begin_form  [line 1170]

  mixed begin_form( [string $form_class = NULL], [string $form_title = ''], [array $form_params = array()]  )

Builds the form field

Parameters:
string   $form_class:  the class to use for the form tag
string   $form_title:  title to display on top of the form
array   $form_params:  Additional params to the form element. See $_common_params. These may override class members.

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
button  [line 2046]

  mixed button( array $options  )

Builds a button

the array must contain :

  • the button type
  • the name (optional)
  • the value (optional)
  • the class (optional)
  • the onclick attribute (optional)
  • the style (optional)

Parameters:
array   $options:  a two-dimension array containing the elements of the input tags

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
buttons  [line 1994]

  mixed buttons( [array $buttons = array()], boolean 1  )

Builds a button list.

Array entries with numeric (deprecated) keys are converted to their equivalent string indexes.

the two-dimension array must contain :

  • the button type
  • the name (optional)
  • the value (optional)
  • the class (optional)
  • the onclick attribute (optional)
  • the style (optional)

Parameters:
boolean   1:  to select or not the default display
array   $buttons:  a two-dimension array containing the elements of the input tags

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
buttons_input  [line 1934]

  mixed buttons_input( [array $buttons = array()]  )

Builds a button list.

The array contains an associative array for each button (params to button_input().

Parameters:
array   $buttons:  a two-dimension array containing the elements of the input tags

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
button_input  [line 2016]

  mixed button_input( [array $field_params = array()]  )

Builds a button.

Array entries with numeric (deprecated) keys are converted to their equivalent string indexes.

Parameters:
array   $field_params:  Optional params. Additionally to $_common_params you can use:
  • type: The type attribute (string, default 'submit')

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
checkbox  [line 1117]

  mixed checkbox( string $field_name, boolean $field_checked, string $field_label, [string $field_note = ''], [string $field_class = ''], [string $field_value = 1], [boolean $field_disabled = false]  )

Builds a checkbox field

Parameters:
string   $field_name:  the name of the checkbox
boolean   $field_checked:  indicating if the checkbox must be checked
string   $field_label:  label
string   $field_note:  note
string   $field_class:  CSS class
string   $field_value:  value to use
boolean   $field_disabled:  an optional indicating whether the box is disabled or not

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
checkbox_input  [line 1080]

  mixed checkbox_input( string $field_name, boolean $field_checked, string $field_label, [array $field_params = array()]  )

Builds a checkbox field

Parameters:
string   $field_name:  the name of the checkbox
boolean   $field_checked:  indicating if the checkbox must be checked by default
string   $field_label:  label
array   $field_params:  Optional params. Additionally to $_common_params you can use: 'value': the value attribute of the checkbox (default 1)

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
checklist  [line 1355]

  mixed checklist( array $options, string $field_name, string $field_label, [boolean $required = false], [boolean $add_highlight_spans = false]  )

Builds a checkbox list

the two-dimension array must indicate, for each checkbox:

  • the name,
  • the value,
  • the comment to put between <input> and
  • a boolean indicating whether the box must be checked or not
  • an optional boolean indicating whether the box is disabled or not
  • an optional note
  • 'required': is the box required to be checked (boolean; default: false)

Parameters:
array   $options:  a two-dimensional array containing the parameters of the input tag
string   $field_name:  name
string   $field_label:  label
boolean   $required:  true to surround checkboxes if they are required
boolean   $add_highlight_spans:  true add a surround_check span, used by check_all mouseover

API Tags:
Return:  true (if output) or the generated HTML if not outputting

Information Tags:
Todo:  Transform to $field_params schema.

[ Top ]
check_all  [line 1146]

  void check_all( )

Return links to check and uncheck all check boxes of the form



[ Top ]
combo_box  [line 1707]

  mixed combo_box( string $field_name, string $field_value, string $field_options, string $field_label, [array $field_params = array()]  )

Combo box Display a select options list with an option 'new', and when this one is seleted, display a combo input text to add a new value

Parameters:
string   $field_name:  field name
string   $field_value:  field value
string   $field_options:  containing options
string   $field_label:  field label
array   $field_params:  Optional params

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
convert_button_to_field_params  [line 2066]

  array convert_button_to_field_params( array $options  )

Convert a deprecated, numeric button array to a field_params array.

Parameters:
array   $options:  A button array like button() and buttons() are getting.

API Tags:
Return:  The button array converted to a string indexed button array (field_params).
Deprecated:  


[ Top ]
date  [line 761]

  mixed date( string $field_name, string $field_value, string $field_label, [string $date_format = NULL]  )

Builds a date input field.

Parameters:
string   $field_name:  the name of the input field
string   $field_value:  initial value (ISO datetime)
string   $field_label:  label displayed in front of the field
string   $date_format:  date format (php format)

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
date_input  [line 635]

  mixed date_input( string $field_name, string $field_value, string $field_label, [array $field_params = array()]  )

Builds a date input field.

Parameters:
string   $field_name:  the name of the input field
string   $field_value:  initial value (ISO datetime (YYYY-MM-DD HH:MM:SS) or erroneous if the field is in error state)
string   $field_label:  label displayed in front of the field
array   $field_params:  Optional params. Additionally to $_common_params you can use:
  • date_format: Format of the date (string, PHP format, default taken from locale_datefmt())
  • add_date_format_note: If true, date format note gets prepended to the field's note

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
dayOfWeek  [line 1053]

  true|string dayOfWeek( $field_name, $field_value, $field_label, [ $field_note = NULL], [ $field_class = NULL]  )

Build a select to choose a weekday.

Parameters:
   $field_name: 
   $field_value: 
   $field_label: 
   $field_note: 
   $field_class: 


[ Top ]
dayOfWeek_input  [line 1027]

  true|string dayOfWeek_input( $field_name, $field_value, $field_label, [ $field_params = array()]  )

Build a select to choose a weekday.

Parameters:
   $field_name: 
   $field_value: 
   $field_label: 
   $field_params: 

API Tags:
Uses:  Form::select_input_options()


[ Top ]
display_or_return  [line 2674]

  true|string display_or_return( $r  )

Display or return, according to $output.

Parameters:
   $r: 

API Tags:
Return:  True, if we want to display, the string if not.


[ Top ]
duration  [line 1014]

  mixed duration( string $field_prefix, string $duration, string $field_label  )

Builds a duration input field.

Parameters:
string   $field_prefix:  the name of the input field
string   $duration:  initial value (seconds)
string   $field_label:  label displayed in front of the field

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
duration_input  [line 966]

  mixed duration_input( string $field_prefix, string $duration, string $field_label, [array $field_params = array()]  )

Builds a duration input field.

Parameters:
string   $field_prefix:  the name of the input field
string   $duration:  initial value (seconds)
string   $field_label:  label displayed in front of the field
array   $field_params:  Optional params. Additionally to $_common_params you can use:
  • minutes_step ( default = 15 );

API Tags:
Return:  true (if output) or the generated HTML if not outputting

Information Tags:
Todo:  @Francois: please check API and change as appropriate.

[ Top ]
end_field  [line 335]

  The end_field( [string $field_note = NULL], [string $field_note_format = NULL]  )

End an input field.

A field is a fielset containing a label div and an input div.

Parameters:
string   $field_note:  Field's note to display. (deprecated)
string   $field_note_format:  Format of the field's note (%s gets replaced with the note). (deprecated)

API Tags:
Return:  generated HTML


[ Top ]
end_fieldset  [line 451]

  true|string end_fieldset( )

Ends a fieldset.


API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
end_form  [line 1275]

  true|string end_form( [array $buttons = array()]  )

Ends the form, optionally displays buttons and closes all open fieldsets.

Parameters:
array   $buttons:  Optional array to display the buttons before the end of the form, see buttons_input()

API Tags:
Return:  true (if output) or the generated HTML if not outputting.


[ Top ]
get_input_element  [line 2446]

  string get_input_element( [array $field_params = array()], [ $parse_common = true]  )

Generate a general input element.

Parameters:
array   $field_params:  Optional params. Additionally to $_common_params you can use:
  • input_prefix: Text before <input /> (string, default '')
  • input_suffix: Text after <input /> (string, default "\n")
  • input_help: Gets used as default value on empty input (type=text) elements. It gets attached through JavaScript (onfocus, onblur and form.onsubmit).
   $parse_common: 

API Tags:
Return:  The <input /> element.
Usedby:  Form::input_field() - to generate the <input> element


[ Top ]
get_label  [line 2512]

  string get_label( )

Get the label of a field. This is used by begin_field() or end_field(), according to $label_to_the_left


API Tags:
Access:  protected


[ Top ]
handle_common_params  [line 2552]

  void handle_common_params( array &$field_params, [string|NULL $field_name = NULL], [ $field_label = NULL]  )

Extract common params out of $field_params into $_common_params and unsets them in $field_params.

Also handles adding errors from $Request to the note.

Parameters:
array   &$field_params:  An array passed to a field generating function like text_input(). By reference!
string|NULL   $field_name:  The name of the field. If not empty it gets used to build the id attribute.
   $field_label: 

API Tags:
Access:  protected


[ Top ]
hidden  [line 2100]

  void hidden( string $field_name, string $field_value  )

Builds an hidden input tag, overwriting any previous hidden values (except for "foo[]").

Parameters:
string   $field_name:  Field name
string   $field_value:  Field value

API Tags:
Usedby:  Form::hiddens_by_key()


[ Top ]
hiddens  [line 2159]

  mixed hiddens( array $hiddens  )

Builds a list of hidden inputs.

Parameters:
array   $hiddens:  Array of parameters to hidden():
  • 0: field_name
  • 1: field_value
  • 2: field_params

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
hiddens_by_key  [line 2180]

  void hiddens_by_key( array $hiddens, [array|NULL $exclude = NULL]  )

Builds a list of hidden inputs from an array where the keys are the field names.

It supports array values (one-dimensional) and generates appropriate key-value pairs.

Parameters:
array   $hiddens:  associative array ( name => value ) of hidden fields.
array|NULL   $exclude:  A list of keys to ignore.

API Tags:
Uses:  Form::hidden()


[ Top ]
hidden_ctrl  [line 2140]

  void hidden_ctrl( )

Add the "ctrl" param, used in the backoffice, as a hidden field.



[ Top ]
info  [line 1916]

  mixed info( string $field_label, string $field_info, [string $field_note = NULL], [ $format = 'htmlbody']  )

Builds an info field.

An info field is a fieldset containing a label div and an info div.

Parameters:
string   $field_label:  the field label
string   $field_info:  the field info
string   $field_note:  see format_to_output()
   $format: 

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
info_field  [line 1855]

  mixed info_field( string $field_label, string $field_info, [array $field_params = array()]  )

Builds an info field.

An info field is a fieldset containing a label div and an info div.

Parameters:
string   $field_label:  the field label
string   $field_info:  the field info
array   $field_params:  Optional params. Additionally to $_common_params you can use:
  • 'format_info': Format of info content, see format_to_output() (string, default 'htmlbody')

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
input_field  [line 2422]

  true|string input_field( [array $field_params = array()]  )

Generate a general input field.

This is the base function for text_input(), checkbox_input(), ..

Parameters:
array   $field_params:  Optional params. Additionally to $_common_params you can use:

API Tags:
Return:  true (if output) or the generated HTML if not outputting
Uses:  Form::get_input_element() - to generate the <input> element


[ Top ]
password  [line 601]

  mixed password( string $field_name, string $field_value, integer $field_size, string $field_label, [string $field_note = ''], [integer $field_maxlength = 0], [string $field_class = '']  )

Builds a password input field.

Calls the text() method with a 'password' parameter.

Parameters:
string   $field_name:  the name of the input field
string   $field_value:  initial value
integer   $field_size:  size of the input field
string   $field_label:  label displayed in front of the field
string   $field_note:  note displayed with field
integer   $field_maxlength:  max length of the value (if 0 field_size will be used!)
string   $field_class:  the CSS class to use

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
password_input  [line 579]

  mixed password_input( string $field_name, string $field_value, integer $field_size, string $field_label, [string $field_params = array()], integer 5, string 6  )

Builds a password input field.

Calls the text_input() method with type == 'password'.

Parameters:
integer   5:  Max length of the value (if 0 field_size will be used!)
string   6:  Extended attributes, see text_input().
string   $field_name:  The name of the input field. This gets used for id also, if no id given in $field_params.
string   $field_value:  Initial value
integer   $field_size:  Size of the input field
string   $field_label:  Label displayed in front of the field
string   $field_params:  Note displayed with field

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
radio  [line 2365]

  mixed radio( string $field_name, string $field_value, array $field_options, string $field_label, [boolean $field_lines = false], [string $field_note = '']  )

Generate set of radio options.

Parameters:
string   $field_name:  the name of the radio options
string   $field_value:  the checked option
array   $field_options:  of arrays the radio options (0: value, 1: label, 2: notes, 3: additional HTML [input field, ..], 4: attribs for <input tag> )
string   $field_label:  label
boolean   $field_lines:  options on seperate lines (DIVs)
string   $field_note:  notes

API Tags:
Return:  true (if output) or the generated HTML if not outputting


[ Top ]
radio_input  [line 2273]

  mixed radio_input( string $field_name, string $field_value, array $field_options, string $field_label, [array $field_params = array()]  )

Generate set of radio options.

Parameters:
string   $field_name:  The name of the radio options
string   $field_value:  The checked option
array   $field_options:  of arrays The radio options (keys: 'value', 'label', 'note', 'params' (array)).
    • 'note': Note for the option (string)
    • 'input_suffix' (additional HTML [input field, ..])
    • Plus everything for get_input_element() )
    string   $field_label:  Label
    array   $field_params:  Optional params. Additionally to $_common_params you can use:
    • lines: Options on seperate lines (DIVs) (boolean, default false)

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    select  [line 1462]

      mixed select( string $field_name, string $field_value, callback $field_list_callback, string $field_label, [string $field_note = ''], [string $field_class = ''], [string $field_onchange = NULL]  )

    Display a select field and populate it with a callback function.

    Parameters:
    string   $field_name:  field name
    string   $field_value:  default field value
    callback   $field_list_callback:  callback function
    string   $field_label:  field label to be display before the field
    string   $field_note:  note to be displayed after the field
    string   $field_class:  CSS class for select
    string   $field_onchange:  Javascript to add for onchange event (trailing ";").

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    select_input  [line 1442]

      mixed select_input( string $field_name, string $field_value, callback $field_list_callback, string $field_label, [array $field_params = array()]  )

    Display a select field and populate it with a callback function.

    Parameters:
    string   $field_name:  field name
    string   $field_value:  default field value
    callback   $field_list_callback:  callback function
    string   $field_label:  field label to be display before the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use: Nothing yet.

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    select_input_array  [line 1660]

      mixed select_input_array( string $field_name, array $field_options, string $field_label, [array $field_params = array()]  )

    This is a stub for select_input_options() which builds the required list of <option> elements from a given list of options ($field_options) and the selected value ($field_value).

    Parameters:
    string   $field_name:  field name
    array   $field_options:  Options. If an associative key (string) is used, this gets the value attribute.
    string   $field_label:  Field label to be display before the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use:

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting
    Uses:  Form::select_input_options()


    [ Top ]
    select_input_object  [line 1504]

      mixed select_input_object( string $field_name, string $field_value, DataObjectCache &$field_object, string $field_label, [array $field_params = array()]  )

    Display a select field and populate it with a cache object by using a callback method.

    Parameters:
    string   $field_name:  Field name
    string   $field_value:  Default field value
    DataObjectCache   &$field_object:  Cache containing values for list
    string   $field_label:  Field label to be display with the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use:
    • 'allow_none': allow to select [none] in list (boolean, default false)
    • 'object_callback': Object's callback method name (string, default 'option_list_return')
    • 'loop_object_method': The method on the objects inside the callback (string, default NULL)

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting
    Usedby:  Form::select_object()
    Uses:  Form::select_input_options()


    [ Top ]
    select_input_options  [line 1587]

      mixed select_input_options( string $field_name, string $field_options, string $field_label, [array $field_params = array()]  )

    Display a select field and populate it with a cache object.

    Parameters:
    string   $field_name:  field name
    string   $field_options:  string containing options '<option>...</option>'
    string   $field_label:  field label to be display before the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use:
    • 'label': Field label to be display before the field
    • 'class': CSS class for select

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting
    Usedby:  Form::select_input_array()
    Usedby:  Form::select_options()
    Usedby:  Form::select_input_object()
    Usedby:  Form::dayOfWeek_input()


    [ Top ]
    select_object  [line 1554]

      mixed select_object( string $field_name, string $field_value, DataObjectCache &$field_object, string $field_label, [string $field_note = ''], [boolean $allow_none = false], [string $field_class = ''], [string $field_object_callback = 'option_list_return'], [string $field_onchange = NULL]  )

    Display a select field and populate it with a cache object.

    Parameters:
    string   $field_name:  field name
    string   $field_value:  default field value
    DataObjectCache   &$field_object:  Cache containing values for list
    string   $field_label:  field label to be display before the field
    string   $field_note:  note to be displayed after the field
    boolean   $allow_none:  allow to select [none] in list
    string   $field_class:  CSS class for select
    string   $field_object_callback:  Object's callback method name.
    string   $field_onchange:  Javascript to add for onchange event (trailing ";").

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting
    Uses:  Form::select_input_object()


    [ Top ]
    select_options  [line 1628]

      mixed select_options( string $field_name, string $field_options, string $field_label, [string $field_note = NULL], [string $field_class = NULL], [string $field_onchange = NULL]  )

    Display a select field and populate it with a cache object.

    Parameters:
    string   $field_name:  field name
    string   $field_options:  string containing options
    string   $field_label:  field label to be display before the field
    string   $field_note:  note to be displayed after the field
    string   $field_class:  CSS class for select
    string   $field_onchange:  Javascript to add for onchange event (trailing ";").

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting
    Uses:  Form::select_input_options()


    [ Top ]
    submit  [line 2250]

      mixed submit( array $options  )

    Builds a submit input tag

    the array must contain :

    • the name (optional)
    • the value (optional)
    • the class (optional)
    • the onclick attribute (optional)
    • the style (optional)

    Parameters:
    array   $options:  an array containing the elements of the input tags

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    submit_input  [line 2229]

      mixed submit_input( [array $field_params = array()]  )

    Builds a submit input tag

    the array must contain :

    • the name (optional)
    • the value (optional)
    • the class (optional)
    • the onclick attribute (optional)
    • the style (optional)

    Parameters:
    array   $field_params:  Optional params. Additionally to $_common_params you can use: Nothing yet.

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting

    Information Tags:
    Todo:  Use <div class="input"> for layout == 'fieldset' (property).

    [ Top ]
    switch_layout  [line 175]

      void switch_layout( string|NULL $layout  )

    Parameters:
    string|NULL   $layout:  the form layout : 'fieldset', 'table' or ''; NULL to restore previsouly saved layout


    [ Top ]
    text  [line 535]

      mixed text( string $field_name, string $field_value, integer $field_size, string $field_label, [string $field_note = ''], [integer $field_maxlength = 0], [string $field_class = ''], [string $inputtype = 'text'], [ $force_to = '']  )

    Builds a text (or password) input field.

    Note: please use Form::password() for password fields

    Parameters:
    string   $field_name:  the name of the input field
    string   $field_value:  initial value
    integer   $field_size:  size of the input field
    string   $field_label:  label displayed in front of the field
    string   $field_note:  note displayed with field
    integer   $field_maxlength:  max length of the value (if 0 field_size will be used!)
    string   $field_class:  the CSS class to use
    string   $inputtype:  input type (only 'text' or 'password' makes sense)
       $force_to: 

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    textarea  [line 1828]

      void textarea( string $field_name, string $field_value, integer $field_rows, string $field_label, [string $field_note = ''], [integer $field_cols = 50], [string $field_class = '']  )

    Build a text area.

    Parameters:
    string   $field_name: 
    string   $field_value: 
    integer   $field_rows: 
    string   $field_label: 
    string   $field_note: 
    integer   $field_cols: 
    string   $field_class: 

    API Tags:
    Uses:  Form::textarea_input()


    [ Top ]
    textarea_input  [line 1782]

      void textarea_input( string $field_name, string $field_value, integer $field_rows, string $field_label, [array $field_params = array()]  )

    Build a text area.

    Parameters:
    string   $field_name:  Name of the field
    string   $field_value:  Value of the field
    integer   $field_rows:  Number of rows
    string   $field_label:  Label for the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use:
    • 'cols': Number of columns (integer, default 50)

    API Tags:
    Usedby:  Form::textarea()


    [ Top ]
    text_input  [line 485]

      true|string text_input( string $field_name, string $field_value, integer $field_size, string $field_label, [array $field_params = array()]  )

    Builds a text (or password) input field.

    Note: please use Form::password_input() for password fields.

    Parameters:
    string   $field_name:  The name of the input field. This gets used for id also, if no id given in $field_params.
    string   $field_value:  Initial value
    integer   $field_size:  Size of the input field
    string   $field_label:  Label displayed with the field (in front by default, see $label_to_the_left).
    array   $field_params:  Extended attributes/params.
    • 'maxlength': if not set, $field_size gets used (use '' to disable it)
    • 'class': the CSS class to use for the <input> element
    • 'type': 'text', 'password' (defaults to 'text')
    • 'force_to': 'UpperCase' (JS onchange handler)
    • NOTE: any other attributes will be used as is (onchange, onkeyup, id, ..).

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    time  [line 818]

      mixed time( string $field_name, string $field_value, string $field_label, [ $field_format = 'hh:mm:ss']  )

    Builds a time input field.

    Parameters:
    string   $field_name:  the name of the input field
    string   $field_value:  initial value (ISO datetime)
    string   $field_label:  label displayed in front of the field
       $field_format: 

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    time_input  [line 779]

      mixed time_input( string $field_name, string $field_value, string $field_label, [array $field_params = array()]  )

    Builds a time input field.

    Parameters:
    string   $field_name:  The name of the input field
    string   $field_value:  Initial value (ISO datetime)
    string   $field_label:  Label displayed in front of the field
    array   $field_params:  Optional params. Additionally to $_common_params you can use:
    • 'time_format': Format of the time (string, default 'hh:mm:ss')

    API Tags:
    Return:  true (if output) or the generated HTML if not outputting


    [ Top ]
    time_select  [line 837]

      void time_select( string $field_name, [string $field_value = NULL], [string $precision = '5mn'], string $field_label, [string $field_note = NULL], [string $field_class = NULL], [string $field_onchange = NULL]  )

    Builds a time select input field

    Parameters:
    string   $field_name:  field name
    string   $field_value:  initial value (ISO datetime or time only)
    string   $precision:  precison xmn or xsec (x:integer) for the options minutes or secondes
    string   $field_label:  field label to be display before the field
    string   $field_note:  note to be displayed after the field
    string   $field_class:  CSS class for select
    string   $field_onchange:  Javascript to add for onchange event (trailing ";").


    [ Top ]

    Documentation generated on Tue, 20 May 2008 01:40:22 +0200 by phpDocumentor 1.4.2