FormField
|
+--FileField
|
+--UploadField
|
+--UploadWebImageField
public class UploadWebImageField
extends UploadField
Field Summary | |
---|---|
mixed | The maximum permitted height of an image or null if there isn't a max. |
mixed | The maximum permitted width of an image or null if there isn't a max. |
mixed | An array of only the valid web image extensions. |
Fields inherited from FORMfields.fields.UploadField | |
---|---|
allowAllExts, clearButton, enableUploadNow, fileProperties, maxFileSize, newUpload, prohibitedExts, subFieldsCannotBeEmpty, uploadDir, uploadDirUrl, uploadNowButton, uploadedFile, uploadedFileField, uploadedFilename, uploadedLocalFile |
Fields inherited from FORMfields.fields.FileField | |
---|---|
MAX_SIZE |
Fields inherited from FORMfields.fields.FormField | |
---|---|
autoPropagate, data, disableEnterHandler, displayValuesOnNewLine, editable, enabled, endingString, enterTabHandler, enterTabs, error, extraHtml, fieldBelowLabel, formError, help, hidden, htmlify, id, isData, label, labelForId, multiValues, name, required, subFieldDisplayValueSeparator, subFieldSeparator, subFieldValueSeparator, subFields, subFieldsCannotBeEmpty, trimWhitespace, validators, value, valueIsHtml |
Constructor Summary | |
---|---|
UploadWebImageField(string name, string label, int required, int maxFileSize, int uploadDir, int uploadDirUrl, int maxImageWidth, int maxImageHeight) Creates a new UploadWebImageField. |
|
__construct(string name, string label, int required, int maxFileSize, int uploadDir, int uploadDirUrl, int maxImageWidth, int maxImageHeight) Creates a new UploadWebImageField. |
Method Summary | |
---|---|
string | getImageTag(string alt) Returns an HTML image tag for displaying the uploaded image. |
boolean | isValid() Checks for field errors detected by this field, including a check for blank. |
void | validImageExtension(mixed ext) |
Methods inherited from FORMfields.fields.UploadField | |
---|---|
getDisplayHtmlValue, getEditableFieldTag, getParameter, getValue, isValid, moveUploadedFile, setValue, uploadFile, validExtension |
Methods inherited from FORMfields.fields.FileField | |
---|---|
getEditableFieldTag |
public mixed $maxImageHeight = null
The maximum permitted height of an image or null if there isn't a max.
public mixed $maxImageWidth = null
The maximum permitted width of an image or null if there isn't a max.
public mixed $validImageExts = array("gif"
An array of only the valid web image extensions.
public UploadWebImageField(string name, string label, int required, int maxFileSize, int uploadDir, int uploadDirUrl, int maxImageWidth, int maxImageHeight)
Creates a new UploadWebImageField.
public string getImageTag(string alt)
Returns an HTML image tag for displaying the uploaded image.
public boolean isValid()
Checks for field errors detected by this field, including a check for blank. This method checks for any errors that may have occured while trying to upload the file. It also checks for valid file extensions: "gif", "jpg", "jpeg" or "png". Moreover, it checks to make sure that the image width and height are within the specified range, if the range was specified. Upon a successful upload, this method copies the file to the uploads directory. If an error is detected, the setError() method is called to set the appropriate error message.
public void validImageExtension(mixed ext)
UploadWebImageField is a field for uploading a web image: "gif", "jpg", "jpeg" or "png".