"A problem was encountered uploading the file %s for the %s field. (%s)",
ERR_ZEROLENGTH => "The file %s uploaded to the %s field was of zero length.",
ERR_IMAGEUPLOADERROR => "A problem was encountered uploading the image file %s for the %s field. (%s)",
ERR_UNSUPPORTEDIMAGEFORMAT => "The image file %s uploaded for the %s field was in an unsupported image format.",
ERR_UNKNOWNIMAGETYPE => "The image file %s uploaded for the %s field was of an unknown type.",
ERR_REQUIREDFIELDEMPTY => "%s%s is a required field.",
);
?>
ERROR:
Name());
?>
UserCanViewField($User, $Field))
{
$Edit = $EditingAllowed
? $Resource->UserCanEditField($User, $Field) : FALSE;
$Error = $ErrorCode && in_array($Field->Id(), $ErrorFieldIds);
switch ($Field->Type())
{
case MDFTYPE_TEXT:
case MDFTYPE_NUMBER:
case MDFTYPE_DATE:
case MDFTYPE_TIMESTAMP:
DisplayTextField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_PARAGRAPH:
DisplayParagraphField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_FLAG:
DisplayFlagField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_TREE:
DisplayTreeField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_CONTROLLEDNAME:
DisplayControlledNameField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_OPTION:
DisplayOptionField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_USER:
DisplayUserField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_IMAGE:
DisplayImageField($Field, $Resource, $RowClass, $Edit, $Error);
break;
case MDFTYPE_FILE:
DisplayFileField($Field, $Resource, $RowClass, $Edit, $Error);
break;
}
$RowClass = ($RowClass == "DarkRow") ? "LightRow" : "DarkRow";
}
}
?>
GetByField($Field, TRUE);
# if field should be editable by current user
if ($IsEditable)
{
# if there are already files uploaded
if (count($Files))
{
# for each previously uploaded file
foreach ($Files as $File)
{
# display delete button
?> Name())); ?> Name()));
?> (no files uploaded)
GetByField($Field, TRUE);
if (is_object($Images)) { $Images = array($Images); }
# if field should be editable by current user
if ($IsEditable)
{
# if there are already images uploaded
if (count($Images))
{
# for each previously uploaded image
foreach ($Images as $Image)
{
# display image thumbnail
?> (no images uploaded)
(no values defined for this field)");
}
else
{
?>GetByField($Field, TRUE);
asort($CurrentValues);
foreach ($CurrentValues as $Value)
{
print(htmlspecialchars($Value->Name()));
$Qualifier = $Value->Qualifier();
if ($Qualifier)
{
print(" (".htmlspecialchars($Qualifier->Name()).")");
}
print(" ");
}
}
?>
GetByField($Field);
# if user can edit this field
if ($IsEditable)
{
# retrieve all possible values
$Options = $Field->GetPossibleValues();
asort($Options);
}
else
{
# use just options that are set to display
$Options = $SetOptions;
}
# determine how many values per row based on length of longest value
$MaxLength = 0;
foreach ($Options as $OptionName)
{
$Length = strlen($OptionName);
if ($Length > $MaxLength) { $MaxLength = $Length; }
}
if ($MaxLength > 25) { $OptionsPerRow = 2; }
elseif ($MaxLength > 17) { $OptionsPerRow = 3; }
elseif ($MaxLength > 12) { $OptionsPerRow = 4; }
else { $OptionsPerRow = 5; }
# determine number of rows
$OptionCount = count($Options);
$NumberOfRows = intval(($OptionCount + ($OptionsPerRow - 1)) / $OptionsPerRow);
?>
AllowMultiple())
{
?>
");
foreach ($Options as $OptionId => $OptionName)
{
?>