Overview

Packages

  • awl
    • AuthPlugin
    • AwlDatabase
    • Browser
    • classEditor
    • DataEntry
    • DataUpdate
    • EMail
    • iCalendar
    • MenuSet
    • PgQuery
    • Session
    • Translation
    • User
    • Utilities
    • Validation
    • vCalendar
    • vComponent
    • XMLDocument
    • XMLElement
  • None
  • PHP

Classes

  • EntryField
  • EntryForm
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class EntryForm

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.

Package: awl\DataEntry
Copyright: Catalyst IT Ltd, Morphoss Ltd <http://www.morphoss.com/>
License: GNU GPL v2
Author: Andrew McMillan <andrew@mcmillan.net.nz>
Located at DataEntry.php
Methods summary
public
# EntryForm( string $action, objectref & $record, boolean $editing = false )

Initialise a new data-entry form.

Initialise a new data-entry form.

Parameters

$action
string
$action The action when the form is submitted.
$record
objectref
$record A reference to the database object we are displaying / editing.
$editing
boolean
$editmode Whether we are editing.
public
# PopulateForm( objectref & $record, string $prefix = "" )

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

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

Parameters

$record
objectref
$record A reference to the database object we are displaying / editing.
$prefix
string
$prefix A prefix to prepend to the field name.
public
# NoHelp( )

Set the line format to have no help display

Set the line format to have no help display

public
# HelpInLine( )

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

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

public
# HelpInCell( )

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

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

public
# SimpleForm( mixed $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.

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

public
# TempLineFormat( string $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.

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

Parameters

$new_format
string
$new_format The (optional) new format we will temporarily use.
public
# RevertLineFormat( )

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

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

public string
# StartForm( array $extra_attributes = '' )

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

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

Parameters

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

Returns

string
The HTML fragment for the start of the form.
public string
# EndForm( )

Return the HTML fragment to end the form.

Return the HTML fragment to end the form.

Returns

string
The HTML fragment to end the form.
public string
# BreakLine( mixed $text = '' )

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

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

Returns

string
The HTML fragment to end the form.
public string
# HiddenField( string $fname, string $fvaluei, mixed $fid = null )

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

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

Parameters

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

Returns

string
The HTML fragment for the hidden field.
public string
# _ParseAttributes( mixed $ftype = '', mixed $attributes = '' )

Internal function for parsing the type extra on a field.

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.
public string
# DataEntryField( mixed $format, mixed $ftype = '', mixed $base_fname = '', mixed $attributes = '', mixed $prefix = '' )

A utility function for a data entry line within a table

A utility function for a data entry line within a table

Returns

string
The HTML fragment to display the data entry field
public string
# SubmitButton( mixed $fname, mixed $fvalue, mixed $attributes = '' )

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

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.
public string
# DataEntryLine( mixed $prompt, mixed $field_format, mixed $ftype = '', mixed $fname = '', mixed $attributes = '', mixed $prefix = '' )

A utility function for a data entry line within a table

A utility function for a data entry line within a table

Returns

string
The HTML fragment to display the prompt and field.
public string
# MultiEntryLine( mixed $prompt_options, mixed $prompt_name, mixed $default_prompt, mixed $format, mixed $ftype = '', mixed $fname = '', mixed $attributes = '', mixed $prefix )

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

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.
Properties summary
public string $action
#

The submit action for the form

The submit action for the form

public string $record
#

The record that the form is dealing with

The record that the form is dealing with

public string $EditMode
#

Whether we are editing, or not

Whether we are editing, or not

public string $name
#

The name of the form

The name of the form

public string $class
#

The CSS class of the form

The CSS class of the form

public string $break_line_format
#

Format string for lines that are breaks in the data entry field groupings

Format string for lines that are breaks in the data entry field groupings

public string $table_line_format
#

Format string for normal data entry field lines.

Format string for normal data entry field lines.

public string $saved_line_format
#

Format string that has been temporarily saved so we can restore it later

Format string that has been temporarily saved so we can restore it later

AWL API documentation generated by ApiGen 2.8.0