Andrew's Web Libraries (AWL)
EntryForm Class Reference

Public Member Functions

 __construct ( $action, &$record, $editing=false)
 
 PopulateForm (&$record, $prefix="")
 
 NoHelp ()
 
 HelpInLine ()
 
 HelpInCell ()
 
 SimpleForm ( $new_format='< span class="prompt">%s:</span > &nbsp;< span class="entry">%s</span >')
 
 TempLineFormat ( $new_format='< span class="prompt">%s:</span > &nbsp;< span class="entry">%s</span >')
 
 RevertLineFormat ()
 
 StartForm ( $extra_attributes='')
 
 EndForm ()
 
 BreakLine ( $text='')
 
 HiddenField ($fname, $fvaluei, $fid=null)
 
 DataEntryField ( $format, $ftype='', $base_fname='', $attributes='', $prefix='')
 
 SubmitButton ( $fname, $fvalue, $attributes='')
 
 DataEntryLine ( $prompt, $field_format, $ftype='', $fname='', $attributes='', $prefix='')
 
 MultiEntryLine ( $prompt_options, $prompt_name, $default_prompt, $format, $ftype='', $fname='', $attributes='', $prefix='')
 

Static Public Member Functions

 _ParseAttributes ( $ftype='', $attributes='')
 

Public Attributes

 $action
 
 $record
 
 $EditMode
 
 $name
 
 $class
 
 $break_line_format
 
 $table_line_format
 
 $saved_line_format
 

Detailed Description

Definition at line 334 of file DataEntry.php.

Constructor & Destructor Documentation

◆ __construct()

EntryForm::__construct (   $action,
$record,
  $editing = false 
)

#- Initialise a new data-entry form.

Parameters
string$actionThe action when the form is submitted.
objectref$recordA reference to the database object we are displaying / editing.
boolean$editmodeWhether we are editing.

Definition at line 394 of file DataEntry.php.

Member Function Documentation

◆ _ParseAttributes()

EntryForm::_ParseAttributes (   $ftype = '',
  $attributes = '' 
)
static

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.

Returns
string The parsed type extra.

Definition at line 532 of file DataEntry.php.

◆ BreakLine()

EntryForm::BreakLine (   $text = '')

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

Returns
string The HTML fragment to end the form.

Definition at line 504 of file DataEntry.php.

◆ DataEntryField()

EntryForm::DataEntryField (   $format,
  $ftype = '',
  $base_fname = '',
  $attributes = '',
  $prefix = '' 
)

A utility function for a data entry line within a table

Returns
string The HTML fragment to display the data entry field

For some forms we prefix the field name with xxxx so it doesn't collide with the real DB field name.

If it is a date, then format it according to the current user's date format type

Definition at line 563 of file DataEntry.php.

◆ DataEntryLine()

EntryForm::DataEntryLine (   $prompt,
  $field_format,
  $ftype = '',
  $fname = '',
  $attributes = '',
  $prefix = '' 
)

A utility function for a data entry line within a table

Returns
string The HTML fragment to display the prompt and field.

Definition at line 639 of file DataEntry.php.

◆ EndForm()

EntryForm::EndForm ( )

Return the HTML fragment to end the form.

Returns
string The HTML fragment to end the form.

Definition at line 496 of file DataEntry.php.

◆ HelpInCell()

EntryForm::HelpInCell ( )

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

Definition at line 434 of file DataEntry.php.

◆ HelpInLine()

EntryForm::HelpInLine ( )

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

Definition at line 426 of file DataEntry.php.

◆ HiddenField()

EntryForm::HiddenField (   $fname,
  $fvaluei,
  $fid = null 
)

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

Parameters
string$fnameThe name of the field.
string$fvalueThe value of the field.
Returns
string The HTML fragment for the hidden field.

Definition at line 516 of file DataEntry.php.

◆ MultiEntryLine()

EntryForm::MultiEntryLine (   $prompt_options,
  $prompt_name,
  $default_prompt,
  $format,
  $ftype = '',
  $fname = '',
  $attributes = '',
  $prefix = '' 
)

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

Returns
string The HTML fragment for the drop-down prompt and associated entry field.

Definition at line 652 of file DataEntry.php.

◆ NoHelp()

EntryForm::NoHelp ( )

Set the line format to have no help display

Definition at line 418 of file DataEntry.php.

◆ PopulateForm()

EntryForm::PopulateForm ( $record,
  $prefix = "" 
)

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

Parameters
objectref$recordA reference to the database object we are displaying / editing.
string$prefixA prefix to prepend to the field name.

Definition at line 408 of file DataEntry.php.

◆ RevertLineFormat()

EntryForm::RevertLineFormat ( )

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

Definition at line 459 of file DataEntry.php.

◆ SimpleForm()

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

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

Definition at line 442 of file DataEntry.php.

◆ StartForm()

EntryForm::StartForm (   $extra_attributes = '')

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

Parameters
array$extra_attributesExtra key/value pairs for the FORM tag.
Returns
string The HTML fragment for the start of the form.

Definition at line 470 of file DataEntry.php.

◆ SubmitButton()

EntryForm::SubmitButton (   $fname,
  $fvalue,
  $attributes = '' 
)

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

Returns
string The HTML fragment to display a submit button for the form.

Definition at line 629 of file DataEntry.php.

◆ TempLineFormat()

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

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

Parameters
string$new_formatThe (optional) new format we will temporarily use.

Definition at line 451 of file DataEntry.php.

Member Data Documentation

◆ $action

EntryForm::$action

Definition at line 343 of file DataEntry.php.

◆ $break_line_format

EntryForm::$break_line_format

Definition at line 373 of file DataEntry.php.

◆ $class

EntryForm::$class

Definition at line 367 of file DataEntry.php.

◆ $EditMode

EntryForm::$EditMode

Definition at line 355 of file DataEntry.php.

◆ $name

EntryForm::$name

Definition at line 361 of file DataEntry.php.

◆ $record

EntryForm::$record

Definition at line 349 of file DataEntry.php.

◆ $saved_line_format

EntryForm::$saved_line_format

Definition at line 385 of file DataEntry.php.

◆ $table_line_format

EntryForm::$table_line_format

Definition at line 379 of file DataEntry.php.


The documentation for this class was generated from the following file: