[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/inc/ -> class_form.php (summary)

MyBB 1.6 Copyright 2010 MyBB Group, All Rights Reserved Website: http://mybb.com License: http://mybb.com/about/license

File Size: 1004 lines (25 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

DefaultForm:: (18 methods):
  __construct()
  generate_hidden_field()
  generate_text_box()
  generate_password_box()
  generate_file_upload_box()
  generate_text_area()
  generate_radio_button()
  generate_check_box()
  generate_select_box()
  generate_forum_select()
  generate_group_select()
  generate_submit_button()
  generate_reset_button()
  generate_yes_no_radio()
  generate_on_off_radio()
  generate_date_select()
  output_submit_wrapper()
  end()

DefaultFormContainer:: (8 methods):
  __construct()
  output_row_header()
  output_row()
  output_cell()
  construct_row()
  output_row_cells()
  num_rows()
  end()


Class: DefaultForm  - X-Ref

Generate a form on the page.

__construct($script='', $method='', $id="", $allow_uploads=0, $name="", $return=false, $onsubmit="")   X-Ref
Constructor. Outputs the form tag with the specified options.

param: string The action for the form.
param: string The method (get or post) for this form.
param: string The ID of the form.
param: boolean Should file uploads be allowed for this form?
param: boolean The name of the form
param: boolean Should this form be returned instead of output to the browser?
param: boolean The onsubmit action of the form

generate_hidden_field($name, $value, $options=array()   X-Ref
Generate and return a hidden field.

param: string The name of the hidden field.
param: string The value of the hidden field.
param: array Optional array of options (id)
return: string The generated hidden

generate_text_box($name, $value="", $options=array()   X-Ref
Generate a text box field.

param: string The name of the text box.
param: string The value of the text box.
param: array Array of options for the text box (class, style, id)
return: string The generated text box.

generate_password_box($name, $value="", $options=array()   X-Ref
Generate a password input box.

param: string The name of the password box.
param: string The value of the password box.
param: array Array of options for the password box (class, id)
return: string The generated password input box.

generate_file_upload_box($name, $options=array()   X-Ref
Generate a file upload field.

param: string The name of the file upload field.
param: array Array of options for the file upload field (class, id)
return: string The generated file upload field.

generate_text_area($name, $value="", $options=array()   X-Ref
Generate a text area.

param: string The name of of the text area.
param: string The value of the text area field.
param: array Array of options for text area (class, id, rows, cols, style, disabled)
return: string The generated text area field.

generate_radio_button($name, $value="", $label="", $options=array()   X-Ref
Generate a radio button.

param: string The name of the radio button.
param: string The value of the radio button
param: string The label of the radio button if there is one.
param: array Array of options for the radio button (id, class, checked)
return: string The generated radio button.

generate_check_box($name, $value="", $label="", $options=array()   X-Ref
Generate a checkbox.

param: string The name of the check box.
param: string The value of the check box.
param: string The label of the check box if there is one.
param: array Array of options for the check box (id, class, checked)
return: string The generated check box.

generate_select_box($name, $option_list, $selected=array()   X-Ref
Generate a select box.

param: string The name of the select box.
param: array Array of options in key => val format.
param: mixed Either a string containing the selected item or an array containing multiple selected items (options['multiple'] must be true)
param: array Array of options for the select box (multiple, class, id, size)
return: string The select box.

generate_forum_select($name, $selected, $options=array()   X-Ref
Generate a forum selection box.

param: string The name of the selection box.
param: mixed Array/string of the selected items.
param: array Array of options (pid, main_option, multiple)
param: boolean Is this our first iteration of this function?
return: string The built select box.

generate_group_select($name, $selected=array()   X-Ref
Generate a group selection box.

param: string The name of the selection box.
param: mixed Array/string of the selected items.
param: array Array of options (class, id, multiple)
return: string The built select box.

generate_submit_button($value, $options=array()   X-Ref
Generate a submit button.

param: string The value for the submit button.
param: array Array of options for the submit button (class, id, name, dsiabled, onclick)
return: string The generated submit button.

generate_reset_button($value, $options=array()   X-Ref
Generate a reset button.

param: string The value for the reset button.
param: array Array of options for the reset button (class, id, name)
return: string The generated reset button.

generate_yes_no_radio($name, $value=1, $int=true, $yes_options=array()   X-Ref
Generate a yes/no radio button choice.

param: string The name of the yes/no choice field.
param: string The value that should be checked.
param: boolean Using integers for the checkbox?
param: array Array of options for the yes checkbox (@see generate_radio_button)
param: array Array of options for the no checkbox (@see generate_radio_button)
return: string The generated yes/no radio button.

generate_on_off_radio($name, $value=1, $int=true, $on_options=array()   X-Ref
Generate an on/off radio button choice.

param: string The name of the on/off choice field.
param: string The value that should be checked.
param: boolean Using integers for the checkbox?
param: array Array of options for the on checkbox (@see generate_radio_button)
param: array Array of options for the off checkbox (@see generate_radio_button)
return: string The generated on/off radio button.

generate_date_select($name, $day="",$month="",$year="")   X-Ref
No description

output_submit_wrapper($buttons)   X-Ref
Output a row of buttons in a wrapped container.

param: array Array of the buttons (html) to output.
return: string The submit wrapper (optional)

end()   X-Ref
Finish up a form.

return: string The ending form tag (optional)

Class: DefaultFormContainer  - X-Ref

Generate a form container.

__construct($title='', $extra_class='')   X-Ref
Initialise the new form container.

param: string The title of the forum container
param: string An additional class to apply if we have one.

output_row_header($title, $extra=array()   X-Ref
Output a header row of the form container.

param: string The header row label.
param: array TODO

output_row($title, $description="", $content="", $label_for="", $options=array()   X-Ref
Output a row of the form container.

param: string The title of the row.
param: string The description of the row/field.
param: string The HTML content to show in the row.
param: string The ID of the control this row should be a label for.
param: array Array of options for the row cell.
param: array Array of options for the row container.

output_cell($data, $options=array()   X-Ref
Output a row cell for a table based form row.

param: string The data to show in the cell.
param: array Array of options for the cell (optional).

construct_row($extra=array()   X-Ref
Build a row for the table based form row.

param: array Array of extra options for the cell (optional).

output_row_cells($row_id, $return=false)   X-Ref
return the cells of a row for the table based form row.

param: string The id of the row.
param: boolean Whether or not to return or echo the resultant contents.
return: string The output of the row cells (optional).

num_rows()   X-Ref
Count the number of rows in the form container. Useful for displaying a 'no rows' message.

return: int The number of rows in the form container.

end($return=false)   X-Ref
Output the end of the form container row.

param: boolean Whether or not to return or echo the resultant contents.
return: string The output of the form container (optional).



Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1