Basic input field, from which other form elements derive.
This class provides a basic input field. This includes :
- getting data from a database or via html variables
- Privileges for handling and showing data
- displaying the data in a form or as text
Methods
Constructor for abstract Formaid_FieldInputAbstract class.
__construct(string $field_name, string $current_value, string $title, string $comment) : void
Defines current value and default value.
Parameters
$field_name
string
Name of the input field
$current_value
string
Initial value
$title
string
Title/caption that precedes this field
$comment
string
Comment that is shown after this field
Checks if INSERT of the value of this field in an SQL record is allowed.
allowSqlInsert() : bool
If the Privileges on this field ( allow_change and allow_sql_insert) are set,
it is allowed to insert the value of this field.
Returns
bool
true if insert is allowed.
Checks if SELECTing the value of this field from an SQL record is allowed.
allowSqlSelect() : bool
If the Privileges on this field (allow_show) is set,
it is allowed to select the value of this field.
Returns
bool
true if select is allowed.
Checks if UPDATE of the value of this field in an SQL record is allowed.
allowSqlUpdate() : bool
If the Privileges on this field ( allow_change and allow_sql_update) are set,
it is allowed to update the value of this field.
Returns
bool
true if update is allowed.
Disables trimming whitespace of object name
disableTrimName() : void
Inherited
inherited_from |
\Formaid_Object::disableTrimName() |
inherited_from |
\Formaid_Property::disableTrimName() |
Display object
display() : void
Inherited
The name of the object is printed to stdout.
inherited_from |
\Formaid_Object::display() |
inherited_from |
\Formaid_Property::display() |
Enables trimming whitespace of object name
enableTrimName() : void
Inherited
inherited_from |
\Formaid_Object::enableTrimName() |
inherited_from |
\Formaid_Property::enableTrimName() |
Get display seperator
getDisplaySeparator() : string
Inherited
inherited_from |
\Formaid_Property::getDisplaySeparator() |
Returns
string
String separating columns
Generates the HTML string for this element
getDisplayString() : string
If the mode is form, a form element is shown :
this includes a title, html tags and a comment
If the mode is value, only the values of a record are shown:
this includes a title and the value in human readable form.
Returns
string
Returns the html-code for the input field properties
getFieldPropertiesHtmlString() : string
Returns a html string of the object.
getHtmlString() : string
A field objected is converted to a html string to display it in a web page
or web form.
Returns
string
html string
Returns name of the object
getName() : string
Inherited
inherited_from |
\Formaid_Object::getName() |
inherited_from |
\Formaid_Property::getName() |
Returns
string
object name
Returns current value
getValue() : string
Inherited
inherited_from |
\Formaid_Property::getValue() |
Returns
string
current value
Returns a value formatted to show on a web page.
getValueDisplayString(bool $specialchars) : string
The returned value is human readable, this means that it will be
converted from an abstract value in a database to a human readable
equivalent.
Parameters
$specialchars
bool
Convert with htmlspecialchars, default = no
Returns
string
Checks if current value is empty
isEmpty() : bool
Inherited
inherited_from |
\Formaid_Property::isEmpty() |
Returns
bool
true if empty
Checks if object name is empty
isNameEmpty() : bool
Inherited
inherited_from |
\Formaid_Object::isNameEmpty() |
inherited_from |
\Formaid_Property::isNameEmpty() |
Returns
bool
true if empty
Reads value in the $_GET array
readGetValue() : void
The field value on a form is submitted and made available by the
webserver in the $_GET array,
This function checks if the value exist and sets the value of this object.
Reads value in the $_POST array
readPostValue() : void
The field value on a form is submitted and made available by the
webserver in the $_POST array,
This function checks if the value exist, applies encoding
and sets the value of this object.
Reads value from an sql-row array
readSqlValue(array $sql_row) : void
This function checks if the value exist
and sets the value of this object.
Parameters
$sql_row
array
row from sql_result
Resets current value
resetValue() : void
Inherited
inherited_from |
\Formaid_Property::resetValue() |
Sets current value to default
setDefault(string $value) : void
Inherited
When the parameter is set,
the default value is changed to the new default value.
Then the current value is set to the (new) default value.
inherited_from |
\Formaid_Property::setDefault() |
Parameters
$value
string
New default value
Sets new name for the object
setName(string $new_name) : void
Inherited
inherited_from |
\Formaid_Object::setName() |
inherited_from |
\Formaid_Property::setName() |
Parameters
Set field value
setValue(string $value) : void
Show object
show() : void
Inherited
The name of the object is printed to stdout.
inherited_from |
\Formaid_Object::show() |
inherited_from |
\Formaid_Property::show() |
Validates value of the object.
validateValue() : bool
Returns
bool
true if value is valid.
Returns name formatted for displaying
getDisplayName() : string
Inherited
inherited_from |
\Formaid_Object::getDisplayName() |
inherited_from |
\Formaid_Property::getDisplayName() |
Returns
string
formatted object name
Returns value formatted for displaying
getDisplayValue() : string
Inherited
access |
protected |
inherited_from |
\Formaid_Property::getDisplayValue() |
Returns
string
formatted object value
Updates the value of the input field status
_updateStatus() : void
When the input field is disabled, Privilege allow_change is false,
the status is set to disabled.
In all other cases, the status is set to default (= active).
Properties
$urlReturnParamEnable : bool
$urlReturnParamName : string
Default is the field name.
$current_value : string
Inherited
access |
protected |
inherited_from |
\Formaid_Property::$$current_value |
$default_value : string
Inherited
access |
protected |
inherited_from |
\Formaid_Property::$$default_value |
$displaySeparator : string
Inherited
access |
protected |
inherited_from |
\Formaid_Property::$$displaySeparator |
$encoding : string
Inherited
access |
protected |
inherited_from |
\Formaid_Object::$$encoding |
inherited_from |
\Formaid_Property::$$encoding |
$name : string
Inherited
access |
protected |
inherited_from |
\Formaid_Object::$$name |
inherited_from |
\Formaid_Property::$$name |
$status : string
Used to transfer the
status when submitting a form.
$_trimName : bool
Inherited
access |
private |
inherited_from |
\Formaid_Object::$$_trimName |
inherited_from |
\Formaid_Property::$$_trimName |