CWIS Developer Documentation
|
Class to build metadata field ordering functionality on top of the foldering functionality. More...
Public Member Functions | |
GetItems () | |
Transform the item IDs of the metadata field order object into objects. | |
CreateGroup ($Name) | |
Create a new metadata field group with the given name. | |
DeleteGroup (MetadataFieldGroup $Group) | |
Move the metadata fields out of the given metadata group to the metadata field order and then delete it. | |
GetFields () | |
Get all the fields in this metadata field ordering in order. | |
GetGroups () | |
Get all the groups in this metadata field ordering in order. | |
MoveItemUp ($Item, $Filter=NULL) | |
Move the given item up in the order. | |
MoveItemDown ($Item, $Filter=NULL) | |
Move the given item down in the order. | |
MoveItemToTop ($Item) | |
Move the given item to the top of the order. | |
MoveFieldToTopOfGroup (MetadataFieldGroup $Group, MetadataField $Field) | |
Move the given item to the top of the order. | |
MoveItemAfter ($Target, $Item) | |
Move the given item after the given target item. | |
ItemInOrder ($Item) | |
Determine whether the given item is a member of this order. | |
![]() | |
Folder ($FolderId) | |
Object constructor – load an existing folder. | |
Delete () | |
Delete folder. | |
Id () | |
Get folder ID. | |
Name ($NewValue=DB_NOVALUE) | |
Get/set folder name. | |
NormalizedName ($NewValue=DB_NOVALUE) | |
Get/set normalized version of folder name. | |
IsShared ($NewValue=DB_NOVALUE) | |
Get/set whether folder is publically-viewable. | |
OwnerId ($NewValue=DB_NOVALUE) | |
Get/set user ID of folder owner. | |
Note ($NewValue=DB_NOVALUE) | |
Get/set note text for folder. | |
InsertItemBefore ($TargetItemOrItemId, $NewItemOrItemId, $TargetItemType=NULL, $NewItemType=NULL) | |
Insert item into folder before specified item. | |
InsertItemAfter ($TargetItemOrItemId, $NewItemOrItemId, $TargetItemType=NULL, $NewItemType=NULL) | |
Insert item into folder after specified item. | |
PrependItem ($ItemOrItemId, $ItemType=NULL) | |
Add item to folder as the first item. | |
AppendItem ($ItemOrItemId, $ItemType=NULL) | |
Add item to folder as the last item. | |
GetItemIds () | |
Retrieve array of IDs of items in folder, in the order that they appear in the folder. | |
RemoveItem ($ItemId, $ItemType=NULL) | |
Remove item from folder, if present. | |
NoteForItem ($ItemId, $NewValue=DB_NOVALUE, $ItemType=NULL) | |
Get/set note text for specific item within folder. | |
ContainsItem ($ItemId, $ItemType=NULL) | |
Check whether specified item is contained in folder. | |
Static Public Member Functions | |
static | SetConfiguration (SystemConfiguration $SysConfig) |
Extract the metadata field display and edit folder IDs from the given system configuration. | |
static | GetDisplayOrderObject () |
Get the metadata field display order object. | |
static | GetEditOrderObject () |
Get the metadata field edit order object. | |
static | MendIssues () |
Fix any issues found in case an unfound bug causes something to go awry. | |
![]() | |
static | NormalizeFolderName ($Name) |
Convert folder name to normalized form (lower-case alphanumeric only). | |
Public Attributes | |
const | DISPLAY_FOLDER_NAME = "FieldDisplayFolder" |
string DISPLAY_FOLDER_NAME name given to the root display folder | |
const | EDIT_FOLDER_NAME = "FieldEditFolder" |
string EDIT_FOLDER_NAME name given to the root edit folder | |
![]() | |
const | MIXEDCONTENT = -1 |
Protected Member Functions | |
IsFieldOrGroup ($Item) | |
Determine if the given item is a metadata field or metadata field group. | |
GetItemId ($Item) | |
Get the ID of the given item. | |
GetItemType ($Item) | |
Get the type of the given item. | |
GroupFilterCallback ($Item) | |
Callback for the filter to retrieve groups only from the metadata field order. | |
GetEnclosure ($Item) | |
Get the metadata field order or metadata field group that encloses the given item. | |
GetSiblingItem ($Item, $Offset, $Filter=NULL) | |
Get the item object of the item that is the given distance from the item. | |
FindSiblingItem ($Enclosure, $Item, $Offset, $Filter=NULL) | |
Attempt to find the item that is the given distance from the item within the given enclosure. | |
MoveFieldToGroup (MetadataFieldGroup $Group, MetadataField $Field, $Placement) | |
Move the field with the given ID to the group with the given ID, optionally specifying the place where the should be placed. | |
MoveFieldToOrder (MetadataFieldGroup $Group, MetadataField $Field, $Placement) | |
Move the field with the given ID from the group with the given ID to the order, optionally specifying where the field should be placed. | |
MoveFieldsToOrder (MetadataFieldGroup $Group) | |
Move all the metadata fields out of the given metadata field group and into the main order. | |
Static Protected Member Functions | |
static | CheckOrderingConfiguration () |
Check the ordering configuration, throwing an exception if it's invalid or not set. | |
static | CreateOrderingObject ($NewFolderName, $Type) |
Create an ordering object and its folder with the given folder name. | |
static | GetRowsForUpgrade ($Type) |
Get rows for upgrading purposes. | |
Static Protected Attributes | |
static | $DisplayFolderId |
static | $EditFolderId |
static | $DefaultDisplayOrder |
static | $DefaultEditOrder |
Class to build metadata field ordering functionality on top of the foldering functionality.
Definition at line 7 of file MetadataFieldOrder.php.
|
staticprotected |
Check the ordering configuration, throwing an exception if it's invalid or not set.
Exception | if the ordering configuration is invalid or not set |
Definition at line 781 of file MetadataFieldOrder.php.
MetadataFieldOrder::CreateGroup | ( | $Name | ) |
Create a new metadata field group with the given name.
string | $Name | group name |
Definition at line 42 of file MetadataFieldOrder.php.
References Folder\AppendItem().
|
staticprotected |
Create an ordering object and its folder with the given folder name.
string | $NewFolderName | name to use when creating a folder |
int | $Type | ordering type from MetadataSchema::MDFORDER_... |
Definition at line 795 of file MetadataFieldOrder.php.
References MetadataSchema\MDFORDER_DISPLAY.
MetadataFieldOrder::DeleteGroup | ( | MetadataFieldGroup | $Group | ) |
Move the metadata fields out of the given metadata group to the metadata field order and then delete it.
MetadataFieldGroup | $Group | metadata field group |
Definition at line 62 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), Folder\Id(), MoveFieldsToOrder(), and Folder\RemoveItem().
|
protected |
Attempt to find the item that is the given distance from the item within the given enclosure.
MetadataFieldGroup | MetadataFieldOrder | $Enclosure | item enclosure |
MetadataField | MetadataFieldGroup | $Item | item |
int | $Offset | distance from the item, negative values are allowed |
callback | $Filter | callback to filter out items |
Definition at line 656 of file MetadataFieldOrder.php.
References GetItemId(), and GetItemType().
Referenced by GetSiblingItem().
|
static |
Get the metadata field display order object.
Exception | if the ordering configuration is invalid or not set |
Definition at line 473 of file MetadataFieldOrder.php.
Referenced by MetadataField\Drop(), MetadataField\IsTempItem(), and MetadataSchema\UpdateFieldCompareOrders().
|
static |
Get the metadata field edit order object.
Exception | if the ordering configuration is invalid or not set |
Definition at line 485 of file MetadataFieldOrder.php.
Referenced by MetadataField\Drop(), MetadataField\IsTempItem(), and MetadataSchema\UpdateFieldCompareOrders().
|
protected |
Get the metadata field order or metadata field group that encloses the given item.
MetadataField | MetadataFieldGroup | $Item | item |
Definition at line 578 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), GetGroups(), GetItemId(), and GetItemType().
Referenced by MoveFieldToTopOfGroup(), MoveItemAfter(), MoveItemDown(), MoveItemToTop(), and MoveItemUp().
MetadataFieldOrder::GetFields | ( | ) |
Get all the fields in this metadata field ordering in order.
Definition at line 75 of file MetadataFieldOrder.php.
References GetItems().
MetadataFieldOrder::GetGroups | ( | ) |
Get all the groups in this metadata field ordering in order.
Definition at line 104 of file MetadataFieldOrder.php.
References Folder\GetItemIds().
Referenced by GetEnclosure(), GetSiblingItem(), and ItemInOrder().
|
protected |
Get the ID of the given item.
MetadataField | MetadataFieldGroup | MetadataFieldOrder | $Item | item |
Definition at line 545 of file MetadataFieldOrder.php.
Referenced by FindSiblingItem(), GetEnclosure(), GetSiblingItem(), ItemInOrder(), MoveFieldToGroup(), MoveFieldToOrder(), MoveFieldToTopOfGroup(), MoveItemAfter(), MoveItemDown(), MoveItemToTop(), and MoveItemUp().
MetadataFieldOrder::GetItems | ( | ) |
Transform the item IDs of the metadata field order object into objects.
Definition at line 24 of file MetadataFieldOrder.php.
References $Items, and Folder\GetItemIds().
Referenced by GetFields().
|
protected |
Get the type of the given item.
MetadataField | MetadataFieldGroup | MetadataFieldOrder | $Item | item |
Definition at line 555 of file MetadataFieldOrder.php.
Referenced by FindSiblingItem(), GetEnclosure(), GetSiblingItem(), ItemInOrder(), MoveFieldToTopOfGroup(), MoveItemAfter(), MoveItemDown(), MoveItemToTop(), and MoveItemUp().
|
staticprotected |
Get rows for upgrading purposes.
This should only be run if an upgrade should be performed.
int | $Type | ordering type from MetadataSchema::MDFORDER_... |
Definition at line 840 of file MetadataFieldOrder.php.
References Database\DisplayQueryErrors(), and MetadataSchema\MDFORDER_EDITING.
|
protected |
Get the item object of the item that is the given distance from the item.
MetadataField | MetadataFieldGroup | $Item | item |
int | $Offset | distance from the item, negative values are allowed |
callback | $Filter | callback to filter out items |
Definition at line 609 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), FindSiblingItem(), GetGroups(), GetItemId(), and GetItemType().
Referenced by MoveItemDown(), and MoveItemUp().
|
protected |
Callback for the filter to retrieve groups only from the metadata field order.
array | $Item | array of item info, i.e., item ID and type |
Definition at line 566 of file MetadataFieldOrder.php.
|
protected |
Determine if the given item is a metadata field or metadata field group.
mixed | $Item | item |
Definition at line 525 of file MetadataFieldOrder.php.
Referenced by ItemInOrder(), MoveItemAfter(), MoveItemDown(), MoveItemToTop(), and MoveItemUp().
MetadataFieldOrder::ItemInOrder | ( | $Item | ) |
Determine whether the given item is a member of this order.
MetadataField | MetadataFieldGroup | $Item | item |
Definition at line 401 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), GetGroups(), GetItemId(), GetItemType(), and IsFieldOrGroup().
Referenced by MoveFieldToTopOfGroup(), MoveItemAfter(), MoveItemDown(), MoveItemToTop(), and MoveItemUp().
|
static |
Fix any issues found in case an unfound bug causes something to go awry.
Definition at line 496 of file MetadataFieldOrder.php.
|
protected |
Move all the metadata fields out of the given metadata field group and into the main order.
MetadataFieldGroup | $Group | metadata field group |
Definition at line 753 of file MetadataFieldOrder.php.
References Folder\GetItemIds(), Folder\Id(), and Folder\InsertItemAfter().
Referenced by DeleteGroup().
|
protected |
Move the field with the given ID to the group with the given ID, optionally specifying the place where the should be placed.
int | $GroupId | metadata field group ID |
int | $FieldId | metadata field ID |
string | $Placement | where to place the field ("prepend" or "append") |
Definition at line 691 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), GetItemId(), and Folder\RemoveItem().
Referenced by MoveItemDown(), and MoveItemUp().
|
protected |
Move the field with the given ID from the group with the given ID to the order, optionally specifying where the field should be placed.
int | $GroupId | metadata field group ID |
int | $FieldId | metadata field ID |
string | $Placement | where to place the field ("before" or "after") |
Definition at line 721 of file MetadataFieldOrder.php.
References Folder\ContainsItem(), GetItemId(), and Folder\RemoveItem().
Referenced by MoveItemDown(), and MoveItemUp().
MetadataFieldOrder::MoveFieldToTopOfGroup | ( | MetadataFieldGroup | $Group, |
MetadataField | $Field | ||
) |
Move the given item to the top of the order.
MetadataField | MetadataFieldGroup | $Item | the item to move |
Exception | if the group or field aren't in the order |
Definition at line 305 of file MetadataFieldOrder.php.
References GetEnclosure(), GetItemId(), GetItemType(), ItemInOrder(), and Folder\PrependItem().
MetadataFieldOrder::MoveItemAfter | ( | $Target, | |
$Item | |||
) |
Move the given item after the given target item.
MetadataField | MetadataFieldGroup | $Target | the item to move after |
MetadataField | MetadataFieldGroup | $Item | the item to move |
Exception | if the items aren't a metadata field or metadata group |
Exception | if the items aren't in the order |
Exception | if attempting to put a group into another one |
Definition at line 345 of file MetadataFieldOrder.php.
References GetEnclosure(), GetItemId(), GetItemType(), IsFieldOrGroup(), and ItemInOrder().
Referenced by MoveItemDown(), and MoveItemUp().
MetadataFieldOrder::MoveItemDown | ( | $Item, | |
$Filter = NULL |
|||
) |
Move the given item down in the order.
MetadataField | MetadataFieldGroup | $Item | |
callback | $Filter | callback to filter out items before moving |
Exception | if the item isn't a metadata field or metadata group |
Exception | if the item isn't in the order |
Exception | if a callback is given and it isn't callable |
Definition at line 200 of file MetadataFieldOrder.php.
References GetEnclosure(), GetItemId(), GetItemType(), GetSiblingItem(), IsFieldOrGroup(), ItemInOrder(), MoveFieldToGroup(), MoveFieldToOrder(), and MoveItemAfter().
MetadataFieldOrder::MoveItemToTop | ( | $Item | ) |
Move the given item to the top of the order.
MetadataField | MetadataFieldGroup | $Item | the item to move |
Exception | if the item isn't a metadata field or metadata group |
Exception | if the item isn't in the order |
Definition at line 265 of file MetadataFieldOrder.php.
References GetEnclosure(), GetItemId(), GetItemType(), IsFieldOrGroup(), ItemInOrder(), and Folder\PrependItem().
MetadataFieldOrder::MoveItemUp | ( | $Item, | |
$Filter = NULL |
|||
) |
Move the given item up in the order.
MetadataField | MetadataFieldGroup | $Item | item |
callback | $Filter | callback to filter out items before moving |
Exception | if the item isn't a metadata field or metadata group |
Exception | if the item isn't in the order |
Exception | if a callback is given and it isn't callable |
Definition at line 132 of file MetadataFieldOrder.php.
References GetEnclosure(), GetItemId(), GetItemType(), GetSiblingItem(), IsFieldOrGroup(), ItemInOrder(), MoveFieldToGroup(), MoveFieldToOrder(), and MoveItemAfter().
|
static |
Extract the metadata field display and edit folder IDs from the given system configuration.
SystemConfiguration | $SysConfig | system configuration |
Definition at line 437 of file MetadataFieldOrder.php.
References $DisplayFolderId, $EditFolderId, SystemConfiguration\FieldDisplayFolder(), SystemConfiguration\FieldEditFolder(), MetadataSchema\MDFORDER_DISPLAY, and MetadataSchema\MDFORDER_EDITING.
|
staticprotected |
Definition at line 892 of file MetadataFieldOrder.php.
|
staticprotected |
Definition at line 963 of file MetadataFieldOrder.php.
|
staticprotected |
Definition at line 881 of file MetadataFieldOrder.php.
Referenced by SetConfiguration().
|
staticprotected |
Definition at line 886 of file MetadataFieldOrder.php.
Referenced by SetConfiguration().
const MetadataFieldOrder::DISPLAY_FOLDER_NAME = "FieldDisplayFolder" |
string DISPLAY_FOLDER_NAME name given to the root display folder
Definition at line 13 of file MetadataFieldOrder.php.
const MetadataFieldOrder::EDIT_FOLDER_NAME = "FieldEditFolder" |
string EDIT_FOLDER_NAME name given to the root edit folder
Definition at line 18 of file MetadataFieldOrder.php.