Class 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 296)


	
			
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, 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 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 492)

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 356)

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 465)

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 523)

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 599)

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 457)

Return the HTML fragment to end the form.

  • return: The HTML fragment to end the form.
string EndForm ()
HelpInCell (line 396)

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

void HelpInCell ()
HelpInLine (line 388)

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

void HelpInLine ()
HiddenField (line 477)

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

  • return: The HTML fragment for the hidden field.
string HiddenField (string $fname, string $fvalue)
  • string $fname: The name of the field.
  • string $fvalue: The value of the field.
MultiEntryLine (line 612)

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 380)

Set the line format to have no help display

void NoHelp ()
PopulateForm (line 370)

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 421)

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

void RevertLineFormat ()
SimpleForm (line 404)

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 432)

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 589)

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 413)

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 Thu, 15 Apr 2010 20:23:04 +1200 by phpDocumentor 1.3.2