Docs For Class EntryForm

## EntryForm

Description

A class to handle displaying a form on the page (for editing) or a structured layout of non-editable content (for viewing), with a simple switch to flip from view mode to edit mode.

Located in /DataEntry.php (line 334)

Method Summary
static string _ParseAttributes ([ $ftype = ''], [ $attributes = ''])
EntryForm EntryForm (string $action, &$record, [ $editing = false], objectref $record, boolean $editmode)
string BreakLine ([ $text = ''])
string DataEntryField ( $format, [ $ftype = ''], [ $base_fname = ''], [ $attributes = ''], [ $prefix = ''])
string DataEntryLine ( $prompt, $field_format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], [ $prefix = ''])
string EndForm ()
void HelpInCell ()
void HelpInLine ()
string HiddenField (string $fname, $fvaluei, [ $fid = null], string $fvalue)
string MultiEntryLine ( $prompt_options, $prompt_name, $default_prompt, $format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], $prefix)
void NoHelp ()
void PopulateForm ( &$record, [string $prefix = ""], objectref $record)
void RevertLineFormat ()
void SimpleForm ([ $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
string StartForm ([array $extra_attributes = ''])
string SubmitButton ( $fname, $fvalue, [ $attributes = ''])
void TempLineFormat ([string $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
Methods
static _ParseAttributes (line 532)

Internal function for parsing the type extra on a field.

If the '_help' attribute is not set it will be assigned the value of the 'title' attribute, if there is one.

If the 'class' attribute is not set it will be assigned to 'flookup', 'fselect', etc, according to the field type.

- return: The parsed type extra.

static string _ParseAttributes ([ $ftype = ''], [ $attributes = ''])

- $ftype
- $attributes

Constructor EntryForm (line 394)

Initialise a new data-entry form.

EntryForm EntryForm (string $action, &$record, [ $editing = false], objectref $record, boolean $editmode)

- string $action: The action when the form is submitted.
- objectref $record: A reference to the database object we are displaying / editing.
- boolean $editmode: Whether we are editing.
- &$record
- $editing

BreakLine (line 504)

A utility function for a heading line within a data entry table

- return: The HTML fragment to end the form.

string BreakLine ([ $text = ''])

- $text

DataEntryField (line 563)

A utility function for a data entry line within a table

- return: The HTML fragment to display the data entry field

string DataEntryField ( $format, [ $ftype = ''], [ $base_fname = ''], [ $attributes = ''], [ $prefix = ''])

- $format
- $ftype
- $base_fname
- $attributes
- $prefix

DataEntryLine (line 639)

A utility function for a data entry line within a table

- return: The HTML fragment to display the prompt and field.

string DataEntryLine ( $prompt, $field_format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], [ $prefix = ''])

- $prompt
- $field_format
- $ftype
- $fname
- $attributes
- $prefix

EndForm (line 496)

Return the HTML fragment to end the form.

- return: The HTML fragment to end the form.

string EndForm ()
HelpInCell (line 434)

Set the line format to have help displayed in it's own separate cell

void HelpInCell ()
HelpInLine (line 426)

Set the line format to have help displayed in the same cell as the entry field.

void HelpInLine ()
HiddenField (line 516)

A utility function for a hidden field within a data entry table

- return: The HTML fragment for the hidden field.

string HiddenField (string $fname, $fvaluei, [ $fid = null], string $fvalue)

- string $fname: The name of the field.
- string $fvalue: The value of the field.
- $fvaluei
- $fid

MultiEntryLine (line 652)

A utility function for a data entry line, where the prompt is a drop-down.

- return: The HTML fragment for the drop-down prompt and associated entry field.

string MultiEntryLine ( $prompt_options, $prompt_name, $default_prompt, $format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], $prefix)

- $prompt_options
- $prompt_name
- $default_prompt
- $format
- $ftype
- $fname
- $attributes
- $prefix

NoHelp (line 418)

Set the line format to have no help display

void NoHelp ()
PopulateForm (line 408)

Initialise some more of the forms fields, possibly with a prefix

void PopulateForm ( &$record, [string $prefix = ""], objectref $record)

- objectref $record: A reference to the database object we are displaying / editing.
- string $prefix: A prefix to prepend to the field name.
- &$record

RevertLineFormat (line 459)

Revert the line format to what was in place before the last TempLineFormat call.

void RevertLineFormat ()
SimpleForm (line 442)

Set the line format to an extremely simple CSS based prompt / field layout.

void SimpleForm ([ $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])

- $new_format

StartForm (line 470)

Start the actual HTML form. Return the fragment to do this.

- return: The HTML fragment for the start of the form.

string StartForm ([array $extra_attributes = ''])

- array $extra_attributes: Extra key/value pairs for the FORM tag.

SubmitButton (line 629)

A utility function for a submit button within a data entry table

- return: The HTML fragment to display a submit button for the form.

string SubmitButton ( $fname, $fvalue, [ $attributes = ''])

- $fname
- $fvalue
- $attributes

TempLineFormat (line 451)

Set the line format to a temporary one that we can revert from.

void TempLineFormat ([string $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])

- string $new_format: The (optional) new format we will temporarily use.

Documentation generated on Fri, 13 Jan 2012 23:40:15 +1300 by phpDocumentor 1.4.3