SchemaId());
$SafeOrderId = defaulthtmlentities($Order->Id());
$SafeEnclosureId = defaulthtmlentities($Enclosure->Id());
$SafeEnclosureType = defaulthtmlentities(get_class($Enclosure));
$SafePreviousId = defaulthtmlentities(GetSiblingId($Previous));
$SafePreviousType = defaulthtmlentities(GetSiblingType($Previous));
$SafeNextId = defaulthtmlentities(GetSiblingId($Next));
$SafeNextType = defaulthtmlentities(GetSiblingType($Next));
$SafeItemType = defaulthtmlentities(get_class($Field));
$SafeFieldId = defaulthtmlentities($Field->Id());
$SafeFieldName = defaulthtmlentities($Field->GetDisplayName());
$SafeTitleForPrevious = defaulthtmlentities($TitleForPrevious);
$SafeTitleForNext = defaulthtmlentities($TitleForNext);
?>
GetFieldCount();
$SafeSchemaId = defaulthtmlentities($Order->SchemaId());
$SafeOrderId = defaulthtmlentities($Order->Id());
$SafeEnclosureId = defaulthtmlentities($Enclosure->Id());
$SafeEnclosureType = defaulthtmlentities(get_class($Enclosure));
$SafePreviousId = defaulthtmlentities(GetSiblingId($Previous));
$SafePreviousType = defaulthtmlentities(GetSiblingType($Previous));
$SafeNextId = defaulthtmlentities(GetSiblingId($Next));
$SafeNextType = defaulthtmlentities(GetSiblingType($Next));
$SafeItemType = defaulthtmlentities(get_class($Group));
$SafeGroupId = defaulthtmlentities($Group->Id());
$SafeGroupName = defaulthtmlentities($Group->Name());
?>
- There are no items in this group.
Id() : NULL;
}
/**
* Get the item type of a sibling object in the metadata field ordering.
* @param MetadataFieldGroup|MetadataField|null $Sibling metadata field or group
* @return mixed item type of the sibling or NULL if given NULL for the sibling
*/
function GetSiblingType($Sibling)
{
return $Sibling ? get_class($Sibling) : NULL;
}
/**
* Get the button title for the metadata field with the given parameters.
* @param MetadataFieldOrder|MetadataFieldGroup $Enclosure field enclosure
* @param MetadataField|MetadataFieldGroup $Sibling sibling object
* @param string $Placement where the field would be placed ("before" or "after")
* @param string $SiblingPlacement where the sibling is located in relation to
* the field ("previous" or "next")
* @return string button title for the metadata field
*/
function GetButtonTitle($Enclosure, $Sibling, $Placement, $SiblingPlacement)
{
if ($Sibling instanceof MetadataFieldGroup)
{
return "Move this metadata field into the metadata field group "
.$Placement." it.";
}
if ($Enclosure instanceof MetadataFieldGroup && !$Sibling)
{
return "Move this metadata field ".$Placement
." the metadata field group it's in.";
}
else if ($Sibling instanceof MetadataField)
{
return "Move this metadata field ".$Placement
." the ".$SiblingPlacement." metadata field.";
}
else if ($Sibling instanceof MetadataFieldGroup)
{
return "Move this metadata field ".$Placement
." the ".$SiblingPlacement." metadata field group.";
}
return "Move this metadata field ".$Placement
." the ".$SiblingPlacement." item.";
}
/**
* Filter callback used to filter fields from display.
* @param MetadataField|MetadataFieldGroup $Item item to test for exclusion
* @param bool TRUE if the item should be included or FALSE otherwise
*/
function FieldOrderFilter($Item)
{
# given a metadata field
if ($Item instanceof MetadataField)
{
# exclude disabled fields
if (!$Item->Enabled())
{
return FALSE;
}
}
return TRUE;
}
/**
* Print an option list containing metadata schemas.
* @param MetadataSchema $SchemaInUse Metadata schema in use.
*/
function PrintSchemaOptionList(MetadataSchema $SchemaInUse)
{
$Options = array();
# get the metadata schema options
foreach (MetadataSchema::GetAllSchemas() as $Schema)
{
$Options[$Schema->Id()] = $Schema->Name() . " Schema";
}
PrintOptionList("SC", $Options, $SchemaInUse->Id(), TRUE);
}
# ----- MAIN -----------------------------------------------------------------
$AF->RequireUIFile("MetadataFieldOrdering.css");
$AF->RequireUIFile("jquery-ui.js");
$AF->RequireUIFile("MetadataFieldOrdering.js");
$SafeSchemaId = defaulthtmlentities($H_Schema->Id());
?>
Tip: drag metadata fields and groups to reorder them.