CWIS Developer Documentation
|
Child class (covering presentation elements only) supplying a standard user interface for presenting and working with HTML forms. More...
Public Member Functions | |
DisplayFormTable ($TableId=NULL, $TableStyle=NULL, $TableCssClass=NULL) | |
Display HTML table for form. More... | |
HandleDeletes () | |
Handle image deletion, removing deleted images from text fields where they may have been inserted. More... | |
![]() | |
__construct ($FieldParams, $FieldValues=array(), $UniqueKey=NULL) | |
Class constructor. More... | |
DisplayFormTable ($TableId=NULL, $TableStyle=NULL) | |
Display HTML table with settings parameters. More... | |
ValidateFieldInput () | |
Validate field values on submitted form. More... | |
AddValidationParameters () | |
Add values to be passed to input validation functions, in addition to field name and value. More... | |
GetNewValuesFromForm () | |
Retrieve values set by form. More... | |
GetFieldValue ($FieldName) | |
Get value for form field. More... | |
HandleUploads () | |
Handle image and file uploads. More... | |
HandleDeletes () | |
Handle image and file deletions. More... | |
SetEventToSignalOnChange ($EventName, $EventParams=array()) | |
Set event to signal when retrieving values from form when settings have changed. More... | |
ValidateEmail ($FieldName, $FieldValues) | |
Validate value as valid-appearing email address. More... | |
ValidateUrl ($FieldName, $FieldValues) | |
Validate value as valid-appearing URL. More... | |
ValidateHostName ($FieldName, $FieldValues) | |
Validate value as valid host name (i.e. More... | |
Static Public Member Functions | |
static | DisplayErrorBlock () |
Display HTML block with error messages (if any). More... | |
![]() | |
static | LogError ($Msg, $Field=NULL) |
Log error message for later display. More... | |
static | GetLoggedErrors () |
Get logged errors. More... | |
static | ErrorsLogged ($Field=FALSE) |
Report whether errors have been logged. More... | |
static | ClearLoggedErrors ($Field=FALSE) |
Clear logged errors. More... | |
static | DidValueChange ($OldValue, $NewValue) |
Determine if a new form field value is different from an old one. More... | |
static | LoadValue ($Type, $Data) |
Load value of requested type from supplied data. More... | |
Public Attributes | |
const | OPTION_RADIO_BUTTON_THRESHOLD = 2 |
FTYPE_OPTION fields with this many or fewer options will display as radio buttons by default. More... | |
![]() | |
const | FTYPE_FILE = "File" |
Supported field types. More... | |
const | FTYPE_FLAG = "Flag" |
const | FTYPE_IMAGE = "Image" |
const | FTYPE_METADATAFIELD = "MetadataField" |
const | FTYPE_NUMBER = "Number" |
const | FTYPE_OPTION = "Option" |
const | FTYPE_PARAGRAPH = "Paragraph" |
const | FTYPE_PASSWORD = "Password" |
const | FTYPE_PRIVILEGES = "Privileges" |
const | FTYPE_SEARCHPARAMS = "Search Parameters" |
const | FTYPE_TEXT = "Text" |
const | FTYPE_URL = "URL" |
const | FTYPE_USER = "User" |
const | FTYPE_QUICKSEARCH = "Quick Search" |
const | FTYPE_HEADING = "Heading" |
Supported field pseudo-types. More... | |
const | NO_VALUE_FOR_FIELD = "NO VALUE" |
Marker used to indicate currently no value for field. More... | |
Protected Member Functions | |
DisplayFormField ($Name, $Value, $Params) | |
Display HTML form field for specified field. More... | |
DisplayImageField ($FieldName, $Value, $Params) | |
Display image form field for specified field. More... | |
DisplayFileField ($FieldName, $Value, $Params) | |
Display file form field for specified field. More... | |
PrintFieldHidingJavascript () | |
Print any JavaScript required to support toggling display of fields or sections. More... | |
![]() | |
DisplayFormField ($Name, $Value, $Params) | |
Display HTML form field for specified field. More... | |
GetFormFieldName ($FieldName, $IncludePrefix=TRUE) | |
Get HTML form field name for specified field. More... | |
GetHiddenFieldsHtml () | |
Get HTML for hidden form fields associated with form processing. More... | |
ConvertItemIdsToNames ($MField, $ItemIds) | |
Take an array of ItemIds and convert it to [ ItemId => ItemName ]. More... | |
Protected Attributes | |
$UsingWysiwygEditor = FALSE | |
![]() | |
$DeletedFiles = array() | |
$DeletedImages = array() | |
$ExtraValidationParams = array() | |
$ExtraValues = array() | |
$FieldParams | |
$FieldValues | |
$HiddenFields = array() | |
$SettingChangeEventName = NULL | |
$SettingChangeEventParams = array() | |
Additional Inherited Members | |
![]() | |
static | $ErrorMessages = array() |
Child class (covering presentation elements only) supplying a standard user interface for presenting and working with HTML forms.
NOTE: If any fields of type FTYPE_PRIVILEGE are included in the form, the enclosing <form> must have the class "priv-form" to work correctly. (This is a requirement of the PrivilegeEditingUI class.)
USAGE EXAMPLE
This implements a form for editing widget attributes, which are encapsulated within a "Widget" class, including photographs of widgets. The photos are displayed in a separate form section, below the other attributes. If the variable $DoNotEditName evaluates to TRUE, the name attribute of the widget will be displayed but not be editable. The same validation function can be used for multiple form fields by checking the value of $FieldName inside the function to decide how to validate the incoming value(s).
Definition at line 134 of file FormUI.php.
|
static |
Display HTML block with error messages (if any).
Definition at line 294 of file FormUI.php.
|
protected |
Display file form field for specified field.
string | $FieldName | Field name. |
mixed | $Value | Current value for field. |
array | $Params | Field parameters. |
Definition at line 769 of file FormUI.php.
References FormUI_Base\$DeletedFiles, FormUI_Base\GetFormFieldName(), and PHP.
Referenced by DisplayFormField().
|
protected |
Display HTML form field for specified field.
string | $Name | Field name. |
mixed | $Value | Current value for field. |
array | $Params | Field parameters. |
Definition at line 398 of file FormUI.php.
References DisplayFileField(), DisplayImageField(), FormUI_Base\GetFormFieldName(), MetadataSchema\MDFTYPE_REFERENCE, PHP, QuickSearchHelper\PrintQuickSearchField(), and MetadataSchema\SCHEMAID_DEFAULT.
Referenced by DisplayFormTable().
FormUI::DisplayFormTable | ( | $TableId = NULL , |
|
$TableStyle = NULL , |
|||
$TableCssClass = NULL |
|||
) |
Display HTML table for form.
string | $TableId | CSS ID for table element. (OPTIONAL) |
string | $TableStyle | CSS styles for table element. (OPTIONAL) |
string | $TableCssClass | Additional CSS class for table element. (OPTIONAL) |
Definition at line 145 of file FormUI.php.
References DisplayFormField(), FormUI_Base\GetFieldValue(), FormUI_Base\GetFormFieldName(), FormUI_Base\GetHiddenFieldsHtml(), PHP, PrintFieldHidingJavascript(), and MetadataSchema\SCHEMAID_DEFAULT.
Referenced by ConfigSettingsUI\DisplaySettingsTable().
|
protected |
Display image form field for specified field.
string | $FieldName | Field name. |
mixed | $Value | Current value for field. |
array | $Params | Field parameters. |
Definition at line 647 of file FormUI.php.
References FormUI_Base\$DeletedImages, FormUI_Base\GetFormFieldName(), and PHP.
Referenced by DisplayFormField().
FormUI::HandleDeletes | ( | ) |
Handle image deletion, removing deleted images from text fields where they may have been inserted.
Definition at line 319 of file FormUI.php.
References FormUI_Base\GetFieldValue(), and FormUI_Base\GetFormFieldName().
|
protected |
Print any JavaScript required to support toggling display of fields or sections.
Definition at line 864 of file FormUI.php.
References FormUI_Base\GetFormFieldName(), and PHP.
Referenced by DisplayFormTable().
|
protected |
Definition at line 384 of file FormUI.php.
const FormUI::OPTION_RADIO_BUTTON_THRESHOLD = 2 |
FTYPE_OPTION fields with this many or fewer options will display as radio buttons by default.
Definition at line 390 of file FormUI.php.