"No", 1 => "Yes");
}
/**
* Get an array of options available for a privilege value. The array keys are
* values for the form and the values are the labels for the form.
* @return array array of privilege options
*/
function GetPrivilegeOptions()
{
$PrivilegeFactory = new PrivilegeFactory();
return array("--" => "--") + $PrivilegeFactory->GetPrivileges(TRUE, FALSE);
}
/**
* Get the escaped option text and value for a flag value.
* @param int $State TRUE if the flag is on and FALSE if the flag is OFF
* @return array the first value is the text, the second is the value
*/
function GetSafeFlagOption($State)
{
return array(
defaulthtmlentities(GetArrayValue(GetFlagOptions(), $State ? 1 : 0)),
defaulthtmlentities($State ? 1 : 0));
}
/**
* Print the type field for the given metadata field data.
* @param array $Data metadata field data
* @param string|null $Error field error, if one exists
* @return void
*/
function PrintTypeField(array $Data, $Error)
{
$AllowedTypes = MakeTypesHumanReadable($Data["AllowedTypes"]);
$HasNoAllowedTypes = !count($AllowedTypes);
$SafeType = defaulthtmlentities($Data["Type"]);
$SafeTypeName = defaulthtmlentities(MetadataField::$FieldTypeHumanEnums[$Data["Type"]]);
?>
All fields.
All fields.
All fields.
All fields.
All fields.
All fields.
All fields.
All fields.
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, User, Image, File, URL, and
Point fields.
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, Image, File, URL, and Point
fields.
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, Image, File, URL, and Point
fields.
"--") + $Options;
?>
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, Image, File, URL, and Point
fields.
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, Image, File, URL, and Point
fields.
(on the full record page)
Text, Paragraph, Number, Date,
Timestamp, Flag, Tree, Controlled Name,
Option, Image, File, URL, and Point
fields.
)";
}
}
# glue together all the elements we collected with our logic
return implode(" ".$Logic." ", $Elements);
}
/**
* Print the form field for the subject field.
* @param string $PrivilegeType The privilege type used in the field name attribute.
* @param mixed $Selected The value to select. (OPTIONAL)
*/
function PrintSubjectField($PrivilegeType, $Selected=NULL)
{
$SupportedFields = GetSupportedFields();
$SafePrivilegeType = defaulthtmlentities($PrivilegeType);
$ValidSelections = array_keys($SupportedFields);
$ValidSelections []= "current_user";
$ValidSelections []= "set_entry";
$ValidSelections []= "set_exit";
$ValidSelections []= "have_resource";
?>
Id());
$SafeId = defaulthtmlentities($H_FieldData["Id"]);
$SafeName = defaulthtmlentities($H_FieldData["Name"]);
$SafeMappedName = defaulthtmlentities($H_FieldData["MappedName"]);
$SafeTypeAsName = defaulthtmlentities($H_FieldData["TypeAsName"]);
$SafeOwner = defaulthtmlentities($H_FieldData["Owner"]);
?>