CWIS Developer Documentation
|
Public Member Functions | |
__construct ($EditFormName, $SchemaId=MetadataSchema::SCHEMAID_DEFAULT) | |
Create a UI for specifing edits to metadata fields. More... | |
AddField ($FieldNameOrId, $CurrentValue=NULL, $CurrentOperator=NULL, $AllowRemoval=FALSE) | |
Add a field to the list of editable fields. More... | |
AddSelectableField ($FieldTypesOrIds=NULL, $CurrentFieldId=NULL, $CurrentValue=NULL, $CurrentOperator=NULL, $AllowRemoval=TRUE) | |
Add a selectable field to the list of editable fields. More... | |
AddFieldButton ($Label="Add field", $FieldTypesOrIds=NULL) | |
Add a button to create more fields above the button. More... | |
DisplayAsTable ($TableId=NULL, $TableStyle=NULL) | |
Display editing form elements enclosed in a. More... | |
DisplayAsRows () | |
Display the table rows for the editing form, without the surrounding. More... | |
GetValuesFromFormData () | |
Extract values from a dynamics field edit/modification form. More... | |
LoadConfiguration ($Data) | |
Load a configured set of fields. More... | |
Static Public Member Functions | |
static | ApplyChangesToResource ($Resource, $User, $ChangesToApply) |
Apply the changes extracted from an editing form to a specified resource. More... | |
Public Attributes | |
const | OP_NOP = 0 |
const | OP_SET = 1 |
const | OP_CLEAR = 2 |
const | OP_CLEARALL = 3 |
const | OP_APPEND = 4 |
const | OP_PREPEND = 5 |
const | OP_REPLACE = 6 |
const | OP_FIND_REPLACE = 7 |
Definition at line 10 of file FieldEditingUI.php.
FieldEditingUI::__construct | ( | $EditFormName, | |
$SchemaId = MetadataSchema::SCHEMAID_DEFAULT |
|||
) |
Create a UI for specifing edits to metadata fields.
string | $EditFormName | Name to use for the HTML elements. The form cannot contain any input elements whose names are EditFormName. |
int | $SchemaId | Schema Id (OPTIONAL, default Resource schema). |
Definition at line 29 of file FieldEditingUI.php.
References MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, and MetadataSchema\MDFTYPE_URL.
FieldEditingUI::AddField | ( | $FieldNameOrId, | |
$CurrentValue = NULL , |
|||
$CurrentOperator = NULL , |
|||
$AllowRemoval = FALSE |
|||
) |
Add a field to the list of editable fields.
int | string | $FieldNameOrId | Field name or id |
string | $CurrentValue | Initial value to display |
mixed | $CurrentOperator | Initial operator (one of the OP_XX class constants) |
bool | $AllowRemoval | TRUE if this field should be removable (OPTIONAL, default FALSE) |
Definition at line 60 of file FieldEditingUI.php.
Referenced by LoadConfiguration().
FieldEditingUI::AddFieldButton | ( | $Label = "Add field" , |
|
$FieldTypesOrIds = NULL |
|||
) |
Add a button to create more fields above the button.
string | $Label | Label to display on the button (OPTIONAL, default "Add field") |
mixed | $FieldTypesOrIds | Either an array of FieldIds, or a bitmask of MDFTYPE_ constants specifying allowed fields (OPTIONAL, defaults to all fields in the schema supported by the editing UI) |
Definition at line 123 of file FieldEditingUI.php.
FieldEditingUI::AddSelectableField | ( | $FieldTypesOrIds = NULL , |
|
$CurrentFieldId = NULL , |
|||
$CurrentValue = NULL , |
|||
$CurrentOperator = NULL , |
|||
$AllowRemoval = TRUE |
|||
) |
Add a selectable field to the list of editable fields.
array | $FieldTypesOrIds | Either an array of FieldIds, or a bitmask of MDFTYPE_ constants specifying allowed fields (OPTIONAL, defaults to all fields in the schema supported by the editing UI) |
int | null | $CurrentFieldId | FieldId giving the field selected by default (OPTIONAL, default NULL) |
string | $CurrentValue | Initial value to display |
mixed | $CurrentOperator | Initial operator to display (one of the OP_XX class constants) |
bool | $AllowRemoval | TRUE if this field should be removable (OPTIONAL, default TRUE) |
Definition at line 94 of file FieldEditingUI.php.
|
static |
Apply the changes extracted from an editing form to a specified resource.
Resource | $Resource | Resource to modify. |
CWUser | $User | User for permissions checks, or NULL when checks should be skipped. |
array | $ChangesToApply | Changes in the format from GetValuesFromFormData(). |
Definition at line 590 of file FieldEditingUI.php.
References MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_URL, and MetadataField\UPDATEMETHOD_ONRECORDCHANGE.
FieldEditingUI::DisplayAsRows | ( | ) |
Display the table rows for the editing form, without the surrounding.
.
Definition at line 159 of file FieldEditingUI.php.
References MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, and MetadataSchema\MDFTYPE_URL.
Referenced by DisplayAsTable().
FieldEditingUI::DisplayAsTable | ( | $TableId = NULL , |
|
$TableStyle = NULL |
|||
) |
Display editing form elements enclosed in a.
Note that it still must be wrapped in a <form> that has a submit button.
string | $TableId | HTML identifier to use (OPTIONAL, default NULL) |
string | $TableStyle | CSS class to attach for this table (OPTIONAL, default NULL) |
Definition at line 147 of file FieldEditingUI.php.
References DisplayAsRows().
FieldEditingUI::GetValuesFromFormData | ( | ) |
Extract values from a dynamics field edit/modification form.
Definition at line 477 of file FieldEditingUI.php.
References MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, and MetadataSchema\MDFTYPE_URL.
FieldEditingUI::LoadConfiguration | ( | $Data | ) |
Load a configured set of fields.
array | $Data | Fields to load in the format from GetValuesFromFormData() |
Definition at line 567 of file FieldEditingUI.php.
References AddField().
const FieldEditingUI::OP_APPEND = 4 |
Definition at line 17 of file FieldEditingUI.php.
const FieldEditingUI::OP_CLEAR = 2 |
Definition at line 15 of file FieldEditingUI.php.
const FieldEditingUI::OP_CLEARALL = 3 |
Definition at line 16 of file FieldEditingUI.php.
const FieldEditingUI::OP_FIND_REPLACE = 7 |
Definition at line 20 of file FieldEditingUI.php.
const FieldEditingUI::OP_NOP = 0 |
Definition at line 13 of file FieldEditingUI.php.
const FieldEditingUI::OP_PREPEND = 5 |
Definition at line 18 of file FieldEditingUI.php.
const FieldEditingUI::OP_REPLACE = 6 |
Definition at line 19 of file FieldEditingUI.php.
const FieldEditingUI::OP_SET = 1 |
Definition at line 14 of file FieldEditingUI.php.