"A problem was encountered uploading the file %s for the %s field. (%s)", ERR_ZEROLENGTH => "The file %s uploaded to the %s field was empty (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.", ERR_POSTEMPTY => "File or image upload was too large (No POST data received)", ERR_IMAGESTORE => "There were problems with the image store:%s
Contact the site administrator with this error to resolve them.", ERR_TEMPSTORE => "tmp does not exist or is not writeable, contact the site administrator with this error.", ERR_FILESTORE => "FileStorage does not exist or is not writeable, contact the site administrator with this error." ); ?> UserCanViewField($User, $Field)) { $Edit = $EditingAllowed ? $Resource->UserCanEditField($User, $Field) : FALSE; # if the field is not editable, don't allow editing in this # interface if (!$Field->Editable()) { $Edit = FALSE; } $Error = $ErrorCode && in_array($Field->Id(), $ErrorFieldIds); $EditValue = $Resource->GetByField($Field); global $AF; $SignalResult = $AF->SignalEvent( ($Edit ? "EVENT_PRE_FIELD_EDIT_FILTER" : "EVENT_FIELD_DISPLAY_FILTER"), array( "Field" => $Field, "Resource" => $Resource, "Value" => $EditValue)); $EditValue = $SignalResult["Value"]; # get additional HTML to display, if any $Context = $Edit ? "EDIT" : "EDIT_COMPLETE_DISPLAY"; $SignalResult = $AF->SignalEvent( "EVENT_APPEND_HTML_TO_FIELD_DISPLAY", array( "Field" => $Field, "Resource" => $Resource, "Context" => $Context, "Html" => NULL)); $Html = $SignalResult["Html"]; switch ($Field->Type()) { case MetadataSchema::MDFTYPE_TEXT: case MetadataSchema::MDFTYPE_NUMBER: case MetadataSchema::MDFTYPE_DATE: case MetadataSchema::MDFTYPE_URL: DisplayTextField( $Field, $Resource, $Edit, $Error, $EditValue, $Html); break; case MetadataSchema::MDFTYPE_TIMESTAMP: DisplayTimestampField( $Field, $Resource, $Edit, $Error, $EditValue, $Html); break; case MetadataSchema::MDFTYPE_POINT: DisplayPointField( $Field, $Resource, $Edit, $Error, $EditValue, $Html); break; case MetadataSchema::MDFTYPE_PARAGRAPH: DisplayParagraphField( $Field, $Resource, $Edit, $Error, $EditValue, $Html); break; case MetadataSchema::MDFTYPE_FLAG: DisplayFlagField( $Field, $Resource, $Edit, $Error, $EditValue, $Html); break; case MetadataSchema::MDFTYPE_TREE: DisplayTreeField($Field, $Resource, $Edit, $Error, $Html); break; case MetadataSchema::MDFTYPE_CONTROLLEDNAME: DisplayControlledNameField($Field, $Resource, $Edit, $Error, $Html); break; case MetadataSchema::MDFTYPE_OPTION: DisplayOptionField($Field, $Resource, $Edit, $Error, $Html); break; case MetadataSchema::MDFTYPE_USER: DisplayUserField($Field, $Resource, $Edit, $Error, $Html); break; case MetadataSchema::MDFTYPE_IMAGE: DisplayImageField($Field, $Resource, $Edit, $Error, $Html); break; case MetadataSchema::MDFTYPE_FILE: DisplayFileField($Field, $Resource, $Edit, $Error, $Html); break; } } } ?>
GetDisplayName()); $FieldDescription = htmlspecialchars($Field->Description()); $ClassAttr = NULL; if ($Error) { $ClassAttr = "cw-form-error"; } else if (!$Field->Optional()) { $ClassAttr = "cw-form-required"; } ?> MaxLength()) { ?>maxlength="MaxLength(); ?>" /> MaxLength()) { ?>maxlength="MaxLength(); ?>" /> UpdateMethod() == MetadataField::UPDATEMETHOD_BUTTON) { ?> (not set)"; } ?> /> /> FlagOnLabel() : $Field->FlagOffLabel(); } ?> GetByField($Field, TRUE); ?> 0) { ?> class="cw-content-tallrow"> Name()); ?>
(no files uploaded) GetByField($Field, TRUE); if (is_object($Images)) { $Images = array($Images); } ?> 0) { ?> class="cw-content-tallrow"> (no images uploaded) GetPossibleValues(); asort($Names); $Names = array(-1 => "--") + $Names; # retrieve values currently selected $SetNames = $Resource->GetByField($Field); asort($SetNames); # set up javascript function to dynamically populate option lists $DBFieldName = $Field->DBFieldName(); ?> $Name) { PrintOptionList("D_".$DBFieldName."_".$MenuIndex, $Names, $NameId, "", 1, 0, FALSE, "CheckAdd('dbentry', 'D_".$DBFieldName."_', ".$MenuIndex.");", "auto; display: block; max-height: 10000000"); $MenuIndex++; } # print option list for use in selecting additional name PrintOptionList("D_".$DBFieldName."_".$MenuIndex, $Names, -1, "", 1, 0, FALSE, "CheckAdd('dbentry', 'D_".$DBFieldName."_', ".$MenuIndex.");", "auto; display: block; max-height: 10000000"); $MenuIndex++; # print shells to contain additional option lists $MaxNames = 21; for (; $MenuIndex < $MaxNames; $MenuIndex++) { ?> DBFieldName(); $DBFieldId = $Field->Id(); $SetNames = $Resource->GetByField($Field); asort($SetNames); # print search inputs/text containers for currently selected names $MenuIndex = 1; foreach ($SetNames as $NameId => $Name) { ?> GetCountOfPossibleValues(); ?> (no values defined for this field)"; } else { if ($ValueCount < $InterfaceToggleThreshold) { DisplayTermsUsingLists($Field, $Resource); } else { DisplayTermsUsingSearch($Field, $Resource); } } } else { ?> 0) { ?> GetByField($Field); # retrieve all possible values if user can edit this field if ($IsEditable) { $Options = $Field->GetPossibleValues(); asort($Options); } # otherwise use just options that are set to display else { $Options = $SetOptions; } $MaxLength = 0; # determine the length of the longest value foreach ($Options as $OptionName) { $Length = strlen($OptionName); if ($Length > $MaxLength) { $MaxLength = $Length; } } # determine how many values per row based on length of longest value if ($MaxLength > 25) { $OptionsPerRow = 2; } else if ($MaxLength > 17) { $OptionsPerRow = 3; } else if ($MaxLength > 12) { $OptionsPerRow = 4; } else { $OptionsPerRow = 5; } # determine number of rows $OptionCount = count($Options); $NumberOfRows = intval(($OptionCount + ($OptionsPerRow - 1)) / $OptionsPerRow); ?> 1) { ?> class="cw-content-tallrow"> "; foreach ($Options as $OptionId => $OptionName) { ?>AllowMultiple()) { ?>" name="DBFieldName()."_".$OptionId."\""; if (in_array($OptionName, $SetOptions)) { print " checked"; } print " />"; ?> "; ?> \n"; $OptionsInThisRow++; if ($OptionsInThisRow == $OptionsPerRow) { print "\n"; $OptionsInThisRow = 0; } } if (!count($Options)) { print "(no options selected)"; } print ""; ?> AllowMultiple()) { ?> GetByField($Field, TRUE); if (!is_array($Users)) { $Users = array($Users); } ?>
  • Get("UserName")); ?>